Cache any external documentation locally for your project:
- Libraries (npm packages, Python packages)
- Frameworks (Next.js, Convex, FastAPI)
- Services (Tailscale, OCI, Docker)
- CLIs and tools
- Anything with online docs
Why Cache Docs Locally?
- Validate against actual docs — not stale training data
- Avoid repeated web fetches during development
- Version docs with your project — docs travel with code
- Reference with
@filename— simple markdown inclusion
No MCP required — just fetch once, save to markdown, reference with @.
Usage
# Cache documentation
/doc convex https://docs.convex.dev
/doc nextjs https://nextjs.org/docs
/doc tailscale https://tailscale.com/kb/api
/doc poetry https://python-poetry.org/docs
# List cached docs
/doc --list
# Show path to docs
/doc --show convex
Directory Structure
Docs are saved to $PROJECT/docs/external/:
$PROJECT/docs/external/
├── convex/
│ └── README.md # Full documentation
├── nextjs/
│ └── README.md
├── tailscale/
│ └── README.md
├── poetry/
│ └── README.md
└── .index.md # List of all cached docs with source URLs
How It Works
- Uses Jina.ai reader (
https://r.jina.ai/<url>) to fetch docs as markdown - Saves to
$PROJECT/docs/external/<name>/README.md - Updates
$PROJECT/docs/external/.index.mdwith all cached docs - Reference later with
@docs/external/<name>/README.md
Session Start: Check Local Docs First
Before using WebSearch for docs:
# Check what's cached locally
ls docs/external/
# Read the index
cat docs/external/.index.md
# Reference a doc
@docs/external/convex/README.md
If no local docs exist:
- Suggest running
/doc <name> <url>to cache them - Auto-detect: When you see external imports/dependencies, prompt to cache docs
Examples
Cache Convex Docs
/doc convex https://docs.convex.dev
Cache Next.js Docs
/doc nextjs https://nextjs.org/docs
Cache Poetry Docs
/doc poetry https://python-poetry.org/docs
Integration with docs-first.md
The docs-first.md rule now checks $PROJECT/docs/external/ before using WebSearch:
- Check local docs first —
ls docs/external/ - Use WebSearch only if — no local docs exist
- Suggest caching —
/doc <name> <url>if docs would be useful
Verification
After caching docs:
# Verify file was created
ls -la docs/external/convex/
# Check index was updated
cat docs/external/.index.md
# Reference in conversation
@docs/external/convex/README.md
Keywords
documentation, docs, cache, fetch, download, reference, external, api docs, library docs