Skip to content

About

A tiny AI agent skill that gives your agent fresh, real documentation on demand. The user names a library, framework, or tool; the agent runs this skill to crawl its docs site into a single markdown file and reads that file back into context — instead of guessing from stale training data.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docs2MD (Agentic Skill)

A tiny AI agent skill that gives your agent fresh, real documentation on demand. The user names a library, framework, or tool; the agent runs this skill to crawl its docs site into a single markdown file and reads that file back into context — instead of guessing from stale training data.

The crawler (crawl4ai) is run in an isolated Docker container, so the host never sees the package, its transitive dependencies, or the bundled Chromium binary.

How it compares

Legend: ✅ yes · ❌ no · ⚠️ partial / caveat

vs Context7 (hosted SaaS)

The privacy / SaaS-dependence axis.

Property skill-docs2md Context7
🔒 Private (queries stay between you + target) ✅ ❌ queries hit mcp.context7.com
💸 Free, no rate limits ✅ ⚠️ free tier limited; paid tiers for more
🏠 Self-hosted ✅ ❌ proprietary cloud-only backend
🌐 Any URL on the open web ✅ ⚠️ curated index; submit-to-include
🔓 Fully open source ✅ MIT ⚠️ MCP shim MIT, core proprietary
🧯 Works without a vendor ✅ ❌ their outage = your skill is down
⚡ Zero setup ✅ ❌ sign-up + API key required

vs crawl4ai Docker Compose version

This skill uses crawl4ai internally. You might be wondering why use this Skill rather than the upstream crawl4ai. In a nutshell: The CLI-vs-service / overhead axis. Pip mode is excluded — it pollutes your host Python env, which is a separate trade-off.

Property skill-docs2md crawl4ai (Docker Compose)
🎯 One-shot CLI ✅ container per call ❌ long-running HTTP service on :11235
🪶 Zero idle resource cost ✅ ❌ Gunicorn reserves 1–4 GB RAM
🔌 No port management ✅ ❌ binds port 11235
⚡ Setup ✅ git clone + first call ⚠️ git clone + compose up + healthcheck
🤖 Agent-shaped output ✅ path to a markdown file ⚠️ JSON over HTTP — caller post-processes
🧾 Surface area to audit/maintain ✅ 6 files ⚠️ FastAPI + Redis + browser pool stack
🛠️ Feature breadth ⚠️ deep BFS crawl → markdown ✅ LLM extraction, MCP, screenshots, PDFs, …

Direction of travel: Context7 is cloud-only by design. crawl4ai is fully OSS today (no paywalls, no required keys) but has announced a closed-beta "Cloud API" coming soon — so a SaaS layer is on the horizon there too. This skill stays local, free, no key.

When to pick what

  • skill-docs2md — you want privacy, no SaaS dependency, no idle daemon, a small auditable footprint, and the agent's interface is "give me a path to a file".
  • Context7 — zero setup, a curated catalog, and you're fine with your queries living on someone else's servers.
  • crawl4ai upstream — you need the full feature surface (LLM extraction, MCP, screenshots, PDFs) or you already run a crawl service for other reasons. Docker Compose is the right shape there, just not for an occasional one-shot lookup.

What an "agent skill" is

A small package an AI agent (Claude Code, Cursor, etc.) can pull in to extend its capabilities. The agent reads the skill's SKILL.md to learn when to use the skill and how to invoke it. Here, the answer is "run ./scrape <docs-url> and read the markdown file it produces."

Install

SKILL_DIR="$HOME/.claude/skills/docs2md"
git clone https://github.com/Dzhuneyt/skill-docs2md.git "$SKILL_DIR"

The skill registers on the agent's next session. Docker must be available on the host; the upstream image is pulled automatically on first use.

What you ship

File Role
SKILL.md Frontmatter + instructions the agent reads to decide when/how.
scrape Bash wrapper. Builds image lazily, runs container, prints path.
scrape.py Python entrypoint baked into the image. Does the actual crawl.
Dockerfile Pins unclecode/crawl4ai:0.8.6, copies scrape.py, sets entry.
README.md This file. Human-facing docs.
AGENTS.md Contributor rules (for humans + AI agents editing this repo).

Use it manually (no agent)

./scrape <url> [--max-pages N] [--max-depth N] [--concurrency N]

Defaults: --max-pages 100 --max-depth 3 --concurrency 10, BFS, same-domain only.

The wrapper:

  1. Builds a tiny image layer on top of unclecode/crawl4ai:0.8.6 on first run. Subsequent runs reuse it.
  2. Creates a fresh temp directory via mktemp -d.
  3. Mounts that directory into the container as /work.
  4. Runs python /usr/local/bin/scrape.py <url> ... inside.
  5. Prints the absolute path to the resulting output.md — once on stderr with an arrow prefix, once on stdout (so out=$(./scrape ...) captures cleanly).

The host's working directory is never mounted or modified.

Output format

One file, all crawled pages concatenated, with banners between them:

============================================================
# https://example.com/page-a
============================================================

<page A markdown>


============================================================
# https://example.com/page-b
============================================================

<page B markdown>

This matches the format the upstream crwl crawl ... --deep-crawl bfs CLI produces, so anything that already parses that output works here.

Why containerise

crawl4ai is a powerful crawler with a wide dependency surface. v0.8.6 itself was a hotfix for a litellm PyPI supply-chain compromise. Containerising the crawler keeps the package and everything it pulls in behind a Docker boundary. The host environment never sees them.

Pinning

The base image is pinned to unclecode/crawl4ai:0.8.6. Bumps are deliberate and live in their own commit.

Tuning cheat sheet

Situation Flags
Small reference site --max-pages 20 --max-depth 2
Large sprawling docs --max-pages 200 + narrow seed URL
Single page, no traversal --max-pages 1 --max-depth 0
Fragile / rate-limited host --concurrency 2
Fast public docs, want speed --concurrency 20

Requirements

  • Docker (any recent version).
  • A few GB of disk for the upstream crawl4ai image (pulled once).

Troubleshooting

  • No results returned for N URLs with a low --max-pages: BFS can spend its budget enumerating siblings before fetching them. Bump --max-pages or --max-depth.
  • First run pulls the upstream image (one-time, automatic). If you prefer to pre-warm the cache: docker pull unclecode/crawl4ai:0.8.6.
  • Stale or hallucinated answers from your agent: confirm the agent's SKILL.md resolution actually triggered. The agent should announce it is using the skill and you should see ✓ [N] <url> progress lines.

License

MIT.

About

A tiny AI agent skill that gives your agent fresh, real documentation on demand. The user names a library, framework, or tool; the agent runs this skill to crawl its docs site into a single markdown file and reads that file back into context — instead of guessing from stale training data.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages