doc-expander
Skill79 starsChanged 10 months agoApache-2.0View on GitHub
Expand and enrich documentation using DeepWiki (GitHub repos) and Context7 (libraries). Use when the user wants to research a library/framework, expand existing docs, generate comprehensive documentation from questions, or fill gaps in markdown files. Generates research questions, queries multiple sources, and synthesizes findings into structured documentation.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- backend/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .claude/skills/oip-proposal/CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- frontend/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- .cursor/rules/development.mdcCursor rule
- browser-useSkill
- agent-browserSkill
- billing-automationSkill
- canvas-designSkill
- claude-agent-sdk-pythonSkill
- docxSkill
- frontend-designSkill
- internal-commsSkill
- litho-budgeted-analysisSkill
- mcp-builderSkill
- oip-proposalSkill
- paypal-integrationSkill
- pci-complianceSkill
- pdfSkill
- pptxSkill
- skill-creatorSkill
- spec-driven-devSkill
- stripe-integrationSkill
- template-skillSkill
- theme-factorySkill
- webapp-testingSkill
- web-artifacts-builderSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Read the existing document
- Distinctive: line 186
When expanding, preserve existing content and add:
- Distinctive: line 230
Always resolve library ID first: before using Context7
- Distinctive: line 233
Preserve existing content: when expanding
- Very specific: line 240
Use scripts/expand_docs.py for automated expansion:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Doc Expander
Research and expand documentation using DeepWiki and Context7 MCP servers.
Workflow Overview
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ 1. Analyze │────>│ 2. Generate │────>│ 3. Research │
│ Existing Doc │ │ Questions │ │ (DeepWiki/C7) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ 6. Output │<────│ 5. Structure │<────│ 4. Synthesize │
│ Final Doc │ │ Content │ │ Findings │
└─────────────────┘ └──────────────────┘ └─────────────────┘Quick Start
Expand Existing Documentation
User: Expand this README with more details about the API- Read the existing document
- Identify gaps and generate questions
- Research using DeepWiki/Context7
- Synthesize and append findings
Create New Documentation
User: Create comprehensive docs for the fastapi library- Generate foundational questions
- Research architecture, patterns, examples
- Structure into logical sections
- Output complete documentation
Research Tools
DeepWiki (GitHub Repositories)
Best for: Repository architecture, implementation details, source code patterns
# Get documentation structure
mcp__deepwiki-mcp__read_wiki_structure(repoName="owner/repo")
# Get full documentation
mcp__deepwiki-mcp__read_wiki_contents(repoName="owner/repo")
# Ask specific questions
mcp__deepwiki-mcp__ask_question(
repoName="owner/repo",
question="How does the authentication system work?"
)When to use DeepWiki:
- Open source libraries on GitHub
- Understanding implementation details
- Finding code examples from source
- Architecture decisions and patterns
Context7 (Library Documentation)
Best for: Official docs, API references, best practices
# Resolve library ID first
mcp__context7-mcp__resolve-library-id(libraryName="fastapi")
# Then fetch documentation
mcp__context7-mcp__get-library-docs(
context7CompatibleLibraryID="/tiangolo/fastapi",
topic="dependency injection",
mode="code" # or "info" for conceptual content
)When to use Context7:
- Official library documentation
- API references and signatures
- Best practices and guides
- Version-specific features
Choosing the Right Source
| Need | Primary Source | Secondary |
| API reference | Context7 | DeepWiki |
| Code examples | DeepWiki | Context7 |
| Architecture | DeepWiki | - |
| Best practices | Context7 | DeepWiki |
| Troubleshooting | Both | - |
| Version changes | Context7 | DeepWiki |
Question Generation
Generate targeted questions to guide research. See references/questions.md for templates.
Question Categories
- Foundation - What is it? Core concepts?
- Architecture - How is it structured? Key components?
- Usage - How to use it? Common patterns?
- Integration - How to integrate? Dependencies?
- Advanced - Edge cases? Performance? Security?
- Troubleshooting - Common issues? Debugging?
Example Questions for a Library
## Foundation
- What problem does {library} solve?
- What are the core concepts?
- How does it compare to alternatives?
## Architecture
- What is the high-level architecture?
- What are the main components/modules?
- How do components interact?
## Usage
- How do I install and configure it?
- What's the basic usage pattern?
- What are common use cases?
## Integration
- What are the dependencies?
- How does it integrate with {framework}?
- Are there official plugins/extensions?
## Advanced
- How do I handle {specific scenario}?
- What are performance considerations?
- What security practices are recommended?Research Strategy
For comprehensive documentation, use this multi-pass approach:
Pass 1: Overview (Context7 info mode)
mcp__context7-mcp__get-library-docs(
context7CompatibleLibraryID=lib_id,
mode="info" # Conceptual overview
)Pass 2: Code Examples (Context7 code mode)
mcp__context7-mcp__get-library-docs(
context7CompatibleLibraryID=lib_id,
topic="specific_topic",
mode="code" # API and examples
)Pass 3: Implementation Details (DeepWiki)
mcp__deepwiki-mcp__ask_question(
repoName="owner/repo",
question="How is {feature} implemented internally?"
)Pass 4: Fill Gaps
For any remaining questions, query both sources with specific topics.
Output Patterns
Expanding Existing Docs
When expanding, preserve existing content and add:
- Missing sections identified from questions
- Code examples from research
- Links to official resources
- Troubleshooting tips
Creating New Docs
Structure new documentation with:
# {Library/Topic} Documentation
## Overview
[From Context7 info mode]
## Installation
[From Context7 code mode]
## Quick Start
[Synthesized from both sources]
## Core Concepts
[From both sources]
## API Reference
[From Context7 code mode]
## Examples
[From DeepWiki + Context7]
## Advanced Topics
[From DeepWiki questions]
## Troubleshooting
[From both sources]
## Resources
- [Official Docs](url)
- [GitHub](url)Best Practices
- Always resolve library ID first before using Context7
- Use both sources for comprehensive coverage
- Start broad, then specific - overview first, then details
- Preserve existing content when expanding
- Cite sources with links when possible
- Use pagination in Context7 (page=1, page=2) for more content
- Check multiple topics for thorough coverage
Workflow Scripts
Use scripts/expand_docs.py for automated expansion:
# Expand a markdown file
python scripts/expand_docs.py docs/api.md --library fastapi
# Generate new documentation
python scripts/expand_docs.py --new --library pydantic --output docs/pydantic.md
# Generate questions only
python scripts/expand_docs.py docs/readme.md --questions-onlyDoes 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.

