fetch-docs
Skill2 starsChanged 6 months agoMITView on GitHub
Fetch library/framework documentation via context7 or web search and persist it to the knowledge base. Automatically invoked when documentation is needed for implementation tasks.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- improveSkill
- teamSkill
- ccf-architecture-contractSkill
- ccf-build-and-envSkill
- ccf-change-controlSkill
- ccf-debugging-playbookSkill
- ccf-doc-sync-campaignSkill
- ccf-dogfood-and-driftSkill
- ccf-domain-referenceSkill
- ccf-failure-archaeologySkill
- ccf-onboarding-tourSkill
- ccf-parity-playbookSkill
- ccf-release-and-installSkill
- ccf-testing-and-qaSkill
- improveSkill
- teamSkill
- add-referenceSkill
- ai-updateSkill
- app-blueprintSkill
- buildSkill
- check-readinessSkill
- deploySkill
- developSkill
- draft-storySkill
- error-analyzeSkill
- factorySkill
- generate-internal-appSkill
- impactSkill
- improveSkill
- indexSkill
- iterative-reviewSkill
- merge-resolveSkill
- mock-endpointSkill
- planSkill
- promoteSkill
- refine-storySkill
- scaffold-design-systemSkill
- searchSkill
- setupSkill
- teamSkill
- skill-nameSkill
- update-trackerSkill
- validateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 12 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Error solutions: When investigating errors leads to documentation or patterns worth keeping
- Distinctive: line 34
When a user pastes or shares documentation that Claude cannot normally access (internal APIs, paywalled docs, private specs):
- Distinctive: line 45
Before fetching, check if docs already exist:
- Distinctive: line 51
If file exists and the topic is covered → use cached version, skip fetch
- Distinctive: line 52
If file exists but topic is missing → fetch and merge into existing file
- Distinctive: line 53
If file doesn't exist → fetch and create new file
- Very specific: line 59
Call resolve-library-id with the library name
- Very specific: line 60
Call get-library-docs with the resolved ID and specific topic
- Distinctive: line 111
Keep examples concise — extract the most relevant pattern, not the entire page
- Very specific: line 117
Every persist operation MUST update .claude/skills/fetch-docs/references/INDEX.md.
- Very specific: line 119
Before fetching: Read INDEX.md first. Search the tables for the library or topic.
- Distinctive: line 121
After persisting: Add or update the row in the appropriate table:
- Distinctive: line 151
When reading a cached reference file:
- Very specific: line 152
Check the Last updated date in the header
- Distinctive: line 153
If older than 30 days AND the topic is being actively used → re-fetch and merge
- Very specific: line 154
Always preserve <!-- project-specific --> and <!-- user-provided --> tagged sections
- Very specific: line 155
Add a ## Changelog section at the bottom noting what was updated and when
- Distinctive: line 158
When the project upgrades a dependency:
- Distinctive: line 159
Update the library reference header with the new version
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fetch Docs
Retrieve up-to-date documentation for any library or framework and save it to the project knowledge base. Future conversations can read cached docs instead of re-fetching.
Usage
/fetch-docs next.js app-router # Fetch Next.js App Router docs
/fetch-docs capacitor geolocation # Fetch Capacitor Geolocation plugin docs
/fetch-docs leaflet markers # Fetch Leaflet marker docs
/fetch-docs zustand persist-middleware # Fetch Zustand persist docsAuto-Trigger Rules
This skill's persistence behavior applies ANY TIME documentation enters the conversation, not just when explicitly invoked. This includes:
- AI-fetched: Context7 lookups, WebFetch, WebSearch for API references or guides
- User-provided: User pastes documentation, API specs, READMEs, or guides into chat
- User-linked: User shares a URL to docs — fetch it and persist
- User-shared files: User asks you to read a doc/PDF/spec file — extract and persist
- Error solutions: When investigating errors leads to documentation or patterns worth keeping
- Offline/unreachable docs: User provides docs because the AI can't reach them — these are especially valuable to persist since they can't be re-fetched
You MUST save the useful portions to the knowledge base before continuing with the task.
Handling user-provided documentation
When a user pastes or shares documentation that Claude cannot normally access (internal APIs, paywalled docs, private specs):
- Acknowledge that this is being saved to the knowledge base
- Structure it into the standard reference format (tables, code examples, key notes)
- Tag it with
<!-- user-provided, not auto-fetchable -->so future updates know to ask the user rather than trying to fetch - Thank briefly — the user is investing time to improve the knowledge base
Process
1. Check Cache First
Before fetching, check if docs already exist:
.claude/skills/fetch-docs/references/{library-name}.md- If file exists and the topic is covered → use cached version, skip fetch
- If file exists but topic is missing → fetch and merge into existing file
- If file doesn't exist → fetch and create new file
2. Fetch Documentation
Via Context7 (preferred for libraries)
- Call
resolve-library-idwith the library name - Call
get-library-docswith the resolved ID and specific topic - Extract the relevant code examples and API details
Via Web Search (fallback)
- Search for
{library} {topic} documentation - Fetch the most authoritative source (official docs preferred)
- Extract structured information
3. Persist to Knowledge Base
Write to: .claude/skills/fetch-docs/references/{library-name}.md
Use this format:
# {Library Name} Documentation
> Last updated: {YYYY-MM-DD}
> Source: {context7 | URL}
## {Topic 1}
### Overview
{Brief description of the API/feature}
### API Reference
| Method/Prop | Type | Description |
|-------------|------|-------------|
| `name` | `type` | What it does |
### Code Examples
```{language}
// Example from docsKey Notes
- {Important gotcha or best practice}
{Topic 2}
...
### 4. Format Rules
- **Tables** for API surfaces (methods, props, config options)
- **Code blocks** for examples (always include language tag)
- **Key Notes** section for gotchas, version-specific behavior, or best practices
- **One file per library** — multiple topics as `##` sections within the file
- Keep examples concise — extract the most relevant pattern, not the entire page
- Include the `Last updated` date so staleness is visible
- **Never store** full page content verbatim — summarize and structure it
### 5. Update Index (MANDATORY)
Every persist operation MUST update `.claude/skills/fetch-docs/references/INDEX.md`. This is the lookup table that prevents redundant fetches as the knowledge base grows.
**Before fetching:** Read `INDEX.md` first. Search the tables for the library or topic. If found, read the referenced file instead.
**After persisting:** Add or update the row in the appropriate table:
- **Libraries** table: for npm packages, frameworks, SDKs
- **Project Patterns** table: for project-specific patterns, gotchas, conventions discovered during work
- **External APIs** table: for third-party API documentation (SL Transport API, GraphHopper, etc.)
**Row format:**
```markdown
| {name} | {filename}.md | {comma-separated topics} | {YYYY-MM-DD} | {context7 / url / user-provided} |Example:
| next.js | next-js.md | app-router, server-actions, middleware | 2026-03-15 | context7 |
| capacitor | capacitor.md | geolocation, preferences, splash-screen | 2026-03-15 | user-provided |
| sl-transport-api | sl-transport-api.md | departures, journeys, stop-deviations | 2026-03-15 | https://transport.integration.sl.se |Why this matters: Without the index, the knowledge base becomes a pile of files that requires scanning every file to know what's cached. The index makes lookups O(1) — read one file, know everything that's available.
Knowledge Evolution Over Time
The knowledge base is a living system that improves with every conversation.
Incremental enrichment
Each conversation may add new topics to an existing library file. When you use a library and discover undocumented patterns, edge cases, or gotchas — add them under a ## Project Patterns section in that library's reference file. These are the most valuable entries because they capture real usage, not just API surfaces.
Staleness detection
When reading a cached reference file:
- Check the
Last updateddate in the header - If older than 30 days AND the topic is being actively used → re-fetch and merge
- Always preserve
<!-- project-specific -->and<!-- user-provided -->tagged sections - Add a
## Changelogsection at the bottom noting what was updated and when
Version tracking
When the project upgrades a dependency:
- Update the library reference header with the new version
- Re-fetch docs for any topics that may have breaking changes
- Note migration details under
## Migration Notes
Edge Cases
| Scenario | Behavior |
| Context7 returns no results | Fall back to web search |
| Web search returns no results | Note the gap, ask user for docs URL |
| Cached docs are older than 30 days | Re-fetch and merge, preserving manual notes |
| Very large API surface | Split into logical sections, link between them |
| Library version mismatch | Note version in the doc header, fetch for correct version |
| Docs contain project-specific notes | Tag with <!-- project-specific --> so merges preserve it |
| User-provided docs (not fetchable) | Tag with <!-- user-provided, not auto-fetchable --> |
| Conflicting info (cached vs new) | Keep both with dates, flag for user review |
Related Skills
/add-reference— for domain knowledge and codebase inventories/develop— triggers auto-save when docs are fetched during implementation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

