Documentation Discovery
Find technical documentation through: llms.txt → Repomix → Research
Decision Flow
code
1. Try context7.com llms.txt ├─ Found → Process URLs with Explorer agents └─ Not found ↓ 2. Find GitHub repository ├─ Found → Use Repomix └─ Not found ↓ 3. Deploy Researcher agents
Method 1: llms.txt (Priority)
context7.com Patterns
| Source | Pattern |
|---|---|
| GitHub repo | https://context7.com/{org}/{repo}/llms.txt |
| Website | https://context7.com/websites/{normalized-path}/llms.txt |
| Topic search | ...llms.txt?topic={query} |
Examples:
code
github.com/vercel/next.js → context7.com/vercel/next.js/llms.txt docs.imgix.com → context7.com/websites/imgix/llms.txt shadcn/ui + date picker → context7.com/shadcn-ui/ui/llms.txt?topic=date
Fallback: WebSearch
code
"[library] llms.txt site:[docs domain]"
Processing URLs
| URL Count | Strategy |
|---|---|
| 1-3 | Single Explorer agent |
| 4-10 | 3-5 Explorer agents |
| 11+ | 5-7 agents in phases |
Launch all agents in single message (parallel, not sequential).
Method 2: Repomix
When llms.txt unavailable, analyze GitHub repository directly.
Quick Commands
bash
# Remote (recommended - no clone needed) npx repomix --remote https://github.com/owner/repo # Docs only npx repomix --remote [url] --include "docs/**,*.md" # Source only npx repomix --remote [url] --include "src/**" --exclude "**/*.test.*" # Specific version npx repomix --remote [url] --remote-branch v2.0.0 # With security check npx repomix --remote [url] --security-check
Key Options
| Option | Purpose |
|---|---|
--remote [url] | Analyze without cloning |
--remote-branch [ref] | Specific branch/tag/commit |
--include "pattern" | Only include matching files |
--exclude "pattern" | Skip matching files |
--style markdown | Human-readable output |
--security-check | Scan for secrets |
--copy | Copy to clipboard |
Language-Specific Patterns
bash
# JavaScript/TypeScript --include "src/**,lib/**,*.md" --exclude "node_modules/**,dist/**,*.test.*" # Python --include "src/**,*.py,*.md" --exclude "__pycache__/**,venv/**" # Go --include "**/*.go,go.mod,*.md" --exclude "vendor/**,*_test.go" # PHP/Laravel --include "app/**,config/**,routes/**,*.md" --exclude "vendor/**,storage/**"
Error Handling
| Problem | Solution |
|---|---|
| Repo too large | --include "docs/**,*.md" |
| Timeout | Clone with --depth 1, then local repomix |
| Private repo | Clone with token, then local repomix |
| Not installed | Use npx repomix |
Method 3: Research (Fallback)
When no structured docs exist, deploy 3-4 Researcher agents:
- •Official sources: Package registry, website, releases
- •Tutorials: Blog posts, guides
- •Community: Stack Overflow, GitHub discussions
- •API/Reference: Auto-generated docs, code examples
Output Format
markdown
# [Library] Documentation ## Source - Method: llms.txt / Repomix / Research - URL: [source] - Version: [version] - Date: [date] ## Content [Organized by topic, not by agent] ## Limitations [Missing sections, version caveats]
Best Practices
- •context7.com first - fastest path to documentation
- •Use ?topic= when applicable - reduces noise
- •Parallel agents - never sequential for 3+ URLs
- •Verify official sources - check domain, version, date
- •Aggregate by topic - synthesize, don't concatenate
- •Report methodology - tell user how you found info
- •Handle versions explicitly - don't assume latest
- •Fail fast - 30s timeout, then try next method