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.
Legend: ✅ yes · ❌ no ·
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 | ✅ | |
| 🏠 Self-hosted | ✅ | ❌ proprietary cloud-only backend |
| 🌐 Any URL on the open web | ✅ | |
| 🔓 Fully open source | ✅ MIT | |
| 🧯 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 | |
| 🧾 Surface area to audit/maintain | ✅ 6 files | |
| 🛠️ Feature breadth | ✅ 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.
- 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.
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."
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.
| 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). |
./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:
- Builds a tiny image layer on top of
unclecode/crawl4ai:0.8.6on first run. Subsequent runs reuse it. - Creates a fresh temp directory via
mktemp -d. - Mounts that directory into the container as
/work. - Runs
python /usr/local/bin/scrape.py <url> ...inside. - Prints the absolute path to the resulting
output.md— once on stderr with an arrow prefix, once on stdout (soout=$(./scrape ...)captures cleanly).
The host's working directory is never mounted or modified.
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.
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.
The base image is pinned to unclecode/crawl4ai:0.8.6. Bumps are
deliberate and live in their own commit.
| 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 |
- Docker (any recent version).
- A few GB of disk for the upstream crawl4ai image (pulled once).
No results returned for N URLswith a low--max-pages: BFS can spend its budget enumerating siblings before fetching them. Bump--max-pagesor--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.mdresolution actually triggered. The agent should announce it is using the skill and you should see✓ [N] <url>progress lines.
MIT.