docs-guide-knowledge
Documentation Knowledge Base
Provide knowledge about the llms.txt standard and official documentation access patterns for AI/LLM systems.
What is llms.txt
llms.txt is a convention where websites provide an AI-readable index of their documentation at their root URL (similar to robots.txt for search engines). It enables LLMs to accurately reference official documentation instead of relying on potentially outdated training data.
llms.txt vs llms-full.txt
| File | Content | When to use |
|---|---|---|
llms.txt |
Index/table of contents with links to individual pages | When looking for a specific topic — fetch index, find relevant link, then fetch that page |
llms-full.txt |
Entire documentation concatenated into one file | When needing broad overview. Caution: can be very large and consume context window |
Always prefer llms.txt (the index) first. Only fetch llms-full.txt if the index doesn't contain what is needed or if the user explicitly wants comprehensive coverage.
docs_map.md (variant)
Some sites use a different filename with the same purpose. For example, Claude Code uses claude_code_docs_map.md instead of llms.txt. The format differs but the concept is identical: an AI-readable index of all documentation pages.
Smart Broad Approach
This skill uses a "Smart Broad" strategy for documentation retrieval:
When to fetch external docs
- Questions about specific library/framework APIs, configuration, or features
- Setup/installation, migration guides, version-specific behavior
- API references, auth flows, payment integration, DB queries
- User explicitly asks for official documentation
When to skip fetch
- Basic language syntax (for loop, array methods)
- General CS concepts (REST, closures, design patterns)
- Architecture discussions not tied to a specific library version
When to disambiguate
- Question uses a generic term (e.g., "Router", "ORM", "auth") that could refer to multiple libraries
- Check project dependencies (package.json, requirements.txt etc.) to narrow down
- If still ambiguous, ask the user to clarify
When confidence is low, answer from knowledge first and offer to fetch official docs as follow-up.
Project Context Detection
Before doc lookup, the agent can scan the working directory for dependency files:
package.json,requirements.txt,pyproject.toml,go.mod,Cargo.toml,pom.xml
This enables:
- Auto version detection: Fetch docs matching the installed version
- Disambiguation: Identify which library the user means
- Version normalization:
react 18,React v18,^18.2.0→ all mean React 18.x
Documentation Retrieval Strategy
Step 1: Check known sites list
Refer to ${CLAUDE_PLUGIN_ROOT}/skills/docs-guide-knowledge/references/llms-txt-sites.md for the maintained list of 66+ known llms.txt URLs.
Step 2: Try llms.txt URL patterns
If the library is not in the known list, identify the official documentation site and try these URLs in order:
{official-site}/llms.txt{official-site}/docs/llms.txt{official-site}/llms-full.txt{official-site}/docs/llms-full.txt
Step 3: Fallback strategies (priority order)
If no llms.txt variant is found, check ${CLAUDE_PLUGIN_ROOT}/skills/docs-guide-knowledge/references/fallback-strategies.md:
- Per-technology strategy — 40+ technologies with tested best URLs
- GitHub raw markdown — Most reliable for open source (LLM-native format, no rendering issues)
- sitemap.xml — Universal fallback, filter for
/docs/patterns - Platform-specific signals — MkDocs
search_index.json, Sphinxobjects.inv - WebSearch — Last resort, prefer official domains
Step 4: Present results
After fetching documentation content:
- Extract only the section relevant to the user's question
- Explain clearly in the user's language
- Include code examples from the docs when available
- Note the documentation version if identifiable
- Cite the source URL and retrieval method at the end
Quality Gate
- Minimum: at least 1 official URL + 1 specific fact/code from the source
- If insufficient evidence: explicitly state "공식 문서에서 확인하지 못했습니다"
- If user rejects result ("이 문서 아니야"): try next fallback strategy
Error Handling
| Situation | Action |
|---|---|
| llms.txt returns 404 | Silently try next URL pattern, then fall back |
| llms.txt linked URL returns 404 | Strip .md extension and retry |
| Specific path 404 | Try parent path for table of contents |
GitHub main branch 404 |
Try master, then version branches |
| WebFetch returns empty/JS content | Try GitHub source or answer from knowledge |
| Content is not documentation | Discard and try next strategy |
| No documentation found at all | Inform user, answer from knowledge, suggest they provide URL |
Known Limitations
- JS-rendered sites:
developer.apple.com,docs.oracle.com— WebFetch returns empty. Answer from knowledge. - Marketing llms.txt:
neo4j.com/llms.txtis marketing index, not docs. Useneo4j.com/docs/directly. - Hugo sites: No detectable platform signals. Skip platform detection, go to sitemap/GitHub.
Response Format
[Clear explanation based on fetched documentation]
[Code examples if present in the docs]
---
Source: [URL(s) fetched]
(version: X.Y | method: llms.txt/GitHub/sitemap/WebSearch)
Match the user's language. If they ask in Korean, explain in Korean. If English, respond in English.
Version Awareness
Documentation changes across versions. Always identify the correct version before fetching.
Version Detection Priority
- Project dependencies: Check
package.json,requirements.txt,pyproject.toml,go.modetc. for installed version - User mention: Parse version from query — "React 19", "Django 5.0", "@18", "^18.2.0"
- Normalize variants:
react 18,React v18,@18,^18.2.0→ all mean React 18.x - Version-specific URLs: Some sites have versioned paths:
- Next.js:
/docs/14/getting-started - Django:
/en/5.0/topics/ - Python:
/3.12/library/
- Next.js:
- Default: If no version info, use latest stable and note which version
When documentation shows version-specific behavior (e.g., "New in 19.0"), mention it explicitly so the user knows whether it applies to their project.
Common Version Pitfalls
| Situation | Risk | Action |
|---|---|---|
| User says "React" without version | React 18 vs 19 have significant API differences | Check package.json first |
| Library has LTS and current | User may need LTS-specific docs | Ask if unclear |
| Pre-release/canary docs | May contain unstable APIs | Warn the user |
| Archived docs (e.g., Create React App) | Deprecated project | Note that the project is no longer maintained |
Disambiguation Patterns
When a user query maps to multiple possible libraries, resolve before fetching.
By Project Context
Scan dependency files to narrow down:
- "Router" in React project →
react-router-dom - "Router" in Express project →
express.Router - "ORM" in Python project → check for
sqlalchemy,django,tortoise-orm - "auth" →
next-auth,passport,firebase-auth,supabase-authetc.
By Explicit Ask
If project context is insufficient or ambiguous:
- Ask: "React Router와 Express Router 중 어떤 건가요?" / "Which router — React Router or Express?"
- Provide 2-3 specific options, not open-ended
Ecosystem Conventions
Some terms have strong ecosystem defaults:
- "middleware" in Next.js →
middleware.ts(edge middleware) - "middleware" in Express →
app.use()pattern - "store" in Vue → Pinia (modern) or Vuex (legacy)
- "state management" in React → useState/useReducer (built-in) or Zustand/Redux (external)
Retrieval Optimization
Token-Aware Fetching
Large documentation files can exhaust context. Follow these practices:
- Index first: Always fetch
llms.txt(index) beforellms-full.txt(full dump) - Targeted fetch: From the index, identify the single most relevant page URL
- Section extraction: After fetching a page, extract only the relevant section — do not include entire page content in response
- Progressive depth: Answer from first fetch. If user asks "더 자세히" or "more detail", fetch additional pages
- Multi-page strategy: For broad topics, fetch up to 3 pages maximum. Summarize connections between pages.
URL Fix Patterns
Documentation URLs often have inconsistencies. Handle these automatically:
| Pattern | Fix |
|---|---|
llms.txt links end in .md but 404 |
Strip .md extension and retry |
| Path returns 404 | Try parent path for table of contents |
GitHub main branch 404 |
Try master, then version-specific branches (e.g., v8.17) |
| URL has trailing slash issues | Try both with and without trailing / |
Concurrency with Other Agents
When the docs-guide agent is invoked alongside other skills or agents:
- Docs-guide handles all external documentation lookup
- Built-in
claude-code-guidehandles Claude Code, Claude Agent SDK, and Claude API questions - If a question spans both (e.g., "How to use Stripe with Claude Code MCP"), docs-guide handles the Stripe part
Known Sites
Refer to ${CLAUDE_PLUGIN_ROOT}/skills/docs-guide-knowledge/references/llms-txt-sites.md for the maintained list of 68+ verified sites.
Fallback Reference
For technologies without llms.txt, refer to ${CLAUDE_PLUGIN_ROOT}/skills/docs-guide-knowledge/references/fallback-strategies.md for 40+ technology-specific strategies and platform detection methods.