Cursor Docs
A local, versioned analog to Cursor's @Docs. Instead of a server-side crawler
and vector index, this caches authoritative documentation as Markdown in the
repo, where it is reviewable, diffable, and free to re-read. This mirrors the
"download official docs as Markdown locally" pattern, which is more reliable
than live crawling.
Storage layout
docs/
<source-slug>/
_index.md # manifest: source URLs, fetch date, version
<page>.md # one file per page/section
<source-slug> is a short kebab-case name, e.g. microsoft-graph,
ninjaone-api, stripe.
Add or update docs
Resolve the source. If given a library name rather than a URL, use
WebSearch to find the official documentation, prefer first-party sources
(vendor docs, Microsoft Learn, RFCs) over aggregators.
Fetch. Use WebFetch on the target page(s). For multi-page docs, fetch
the specific pages relevant to the task rather than the entire site.
Clean. Strip navigation, footers, cookie banners, and repeated
boilerplate. Keep headings, prose, code blocks, and tables. Preserve the
source's own structure.
Save. Write each page to docs/<source-slug>/<page>.md.
Record the manifest. Create or update docs/<source-slug>/_index.md:
# <Source name> docs cache
| Page | Source URL | Fetched (ISO 8601) | Version |
|------|-----------|--------------------|---------|
| overview.md | https://... | 2026-06-15 | v1.2 |
Record the documented version/date if the source states one.
Reference docs
When a task involves a library that has a cache under docs/, read the relevant
docs/<source-slug>/*.md files first and base guidance on them. Quote the
cached source rather than relying on memory. If the cache does not cover the
needed topic, fetch and add it (workflow above) before answering.
Staleness
The manifest's fetch date is the source of truth for freshness. If a cached
source is older than ~90 days, or the user reports the docs changed, offer to
re-fetch and update the manifest. Never silently trust a stale cache for fast-
moving APIs without noting its age.
Rules
- First-party sources only where possible; note when a source is unofficial.
- Never fabricate API details, if it is not in the cache or fetchable, say so.
- Keep cached files clean enough to review in a PR.
1---2name: cursor-docs3description: Fetch external/official documentation for a library, API, or framework and cache it locally as clean Markdown with a manifest, so it can be referenced authoritatively without re-fetching. Use this whenever the user wants to "index", "add", "pull in", or "cache" docs, references a specific library/API and wants accurate guidance, or says "@docs" / "use the docs for X". Also consult the local cache before answering questions about a library that has cached docs. Invokable as /cursor-docs.4---56# Cursor Docs78A local, versioned analog to Cursor's `@Docs`. Instead of a server-side crawler9and vector index, this caches authoritative documentation as Markdown in the10repo, where it is reviewable, diffable, and free to re-read. This mirrors the11"download official docs as Markdown locally" pattern, which is more reliable12than live crawling.1314## Storage layout1516```17docs/18 <source-slug>/19 _index.md # manifest: source URLs, fetch date, version20 <page>.md # one file per page/section21```2223`<source-slug>` is a short kebab-case name, e.g. `microsoft-graph`,24`ninjaone-api`, `stripe`.2526## Add or update docs27281. **Resolve the source.** If given a library name rather than a URL, use29 `WebSearch` to find the official documentation, prefer first-party sources30 (vendor docs, Microsoft Learn, RFCs) over aggregators.312. **Fetch.** Use `WebFetch` on the target page(s). For multi-page docs, fetch32 the specific pages relevant to the task rather than the entire site.333. **Clean.** Strip navigation, footers, cookie banners, and repeated34 boilerplate. Keep headings, prose, code blocks, and tables. Preserve the35 source's own structure.364. **Save.** Write each page to `docs/<source-slug>/<page>.md`.375. **Record the manifest.** Create or update `docs/<source-slug>/_index.md`:3839 ```markdown40 # <Source name> docs cache4142 | Page | Source URL | Fetched (ISO 8601) | Version |43 |------|-----------|--------------------|---------|44 | overview.md | https://... | 2026-06-15 | v1.2 |45 ```4647 Record the documented version/date if the source states one.4849## Reference docs5051When a task involves a library that has a cache under `docs/`, read the relevant52`docs/<source-slug>/*.md` files first and base guidance on them. Quote the53cached source rather than relying on memory. If the cache does not cover the54needed topic, fetch and add it (workflow above) before answering.5556## Staleness5758The manifest's fetch date is the source of truth for freshness. If a cached59source is older than ~90 days, or the user reports the docs changed, offer to60re-fetch and update the manifest. Never silently trust a stale cache for fast-61moving APIs without noting its age.6263## Rules64- First-party sources only where possible; note when a source is unofficial.65- Never fabricate API details, if it is not in the cache or fetchable, say so.66- Keep cached files clean enough to review in a PR.