| name | docs |
| description | Manage project documentation (README.md, ./docs/*.md). Use when the user wants to
initialize, research, add, change, delete, or scan documentation. Triggers include:
"docs", "documentation", "README", "initialize docs", "update docs", "find in docs",
"living docs", "project documentation".
|
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion, Agent |
Docs Skill
Manage project documentation stored in README.md and ./docs/*.md files.
Documentation Hierarchy
| Priority | Location | Purpose |
|---|
| 1 | README.md | Project overview, quick start, feature index |
| 2 | ./docs/*.md | Detailed feature/module documentation |
| 3 | ./docs/api/*.md | API reference documentation |
| 4 | ./docs/guides/*.md | Tutorials and how-to guides |
| 5 | CLAUDE.md | AI coding guidelines (separate from user docs) |
Default assumption: README.md is the index, details go in ./docs/*.md.
Critical Rules
- NEVER guess - If information is not explicitly found, return "NO RESULTS"
- Always research first - Before add/change/delete, check for existing similar content
- Ask before destructive operations - Confirm before deleting or major reorganization
- Keep README concise - It's an index, move details to ./docs/
Actions
INIT Documentation
Initialize documentation structure using templates.
Process:
- Check if README.md exists
- Check if ./docs/ directory with .md files exists
- If docs exist:
- Present summary of existing docs
- Ask: "Extend existing docs" or "Reorganize" or "Create new (preserve old)"
- If reorganize: extract details from README to ./docs/*.md files
- If no docs:
- Ask: "Empty templates" or "Scan codebase first" or "Interactive"
- If scan: run discovery first, then create populated templates
- Create README.md from template (see references/README_TEMPLATE.md)
- Create ./docs/ structure as needed
- Ensure all ./docs/*.md files are linked from README.md
Template usage:
- README.md: overview + feature index with links
- ./docs/.md: detailed documentation per feature/module
RESEARCH Documentation
Search documentation and codebase for information.
CRITICAL CONSTRAINT:
MUST only return information explicitly found in documentation or codebase.
FORBIDDEN to guess or infer. If no explicit information found, return:
"NO RESULTS for
"
Process:
- Search README.md for query matches using Grep
- Search ./docs/*.md for query matches using Grep
- Search codebase (source files, configs, comments)
- Compile findings with source citations (file:line format)
- If absolutely no results: return "NO RESULTS for "
- NEVER fabricate or assume information
Output format (found):
# Research Results: <query>
## Summary
[Direct answer synthesized from found information ONLY]
## Sources
### Documentation
| File | Line | Excerpt |
|------|------|---------|
| README.md | 45 | "To configure authentication..." |
| ./docs/auth.md | 12-18 | "Authentication supports OAuth2..." |
### Codebase
| File | Line | Context |
|------|------|---------|
| src/auth.ts | 23 | Function with JSDoc |
## Related
- Links to related documentation sections
Output format (not found):
# Research Results: <query>
**Result:** NO RESULTS for "<query>"
## Locations Searched
- README.md
- ./docs/*.md (X files)
- Source files
- Configuration files
## Suggestions
1. Try different search terms: [alternatives]
2. Run `/project-docs scan` to identify documentation gaps
3. Run `/project-docs add <topic>` to create this documentation
ADD Documentation
Add new documentation.
Process:
- ALWAYS check for duplicates first (see references/DUPLICATE_CHECK.md)
- Scan existing docs for similar topics using semantic matching
- If potential duplicate found:
- Present existing doc with overlap details
- Ask: "Merge with existing" or "Create separate" or "Cancel"
- Determine appropriate location:
- README.md: for overview/quick-start additions
- ./docs/.md: for detailed feature documentation
- ./docs/api/.md: for API reference
- ./docs/guides/.md: for tutorials
- Create from template (see references/FEATURE_DOC_TEMPLATE.md)
- Update README.md feature index if new ./docs/ file created
- Report what was created and where
Duplicate detection:
- Title similarity (fuzzy match)
- Content overlap (key terms)
- Same code symbols referenced
CHANGE Documentation
Modify existing documentation.
Process:
- Search for documentation matching the query
- Present all matching docs with context (file, section, preview)
- Ask user to confirm which to modify
- Accept the modification (full replacement or guided edit)
- Apply change preserving markdown structure
- Update cross-references if titles change
- Report before/after summary
Matching strategies:
- Exact file name match
- Section header match
- Content keyword search
- Fuzzy match for partial queries
DELETE Documentation
Remove documentation.
Process:
- Search for documentation matching the query
- Present matching docs with full context:
- File path and size
- Preview of content
- Links from other docs (cross-references)
- Ask user to confirm deletion
- Remove file or section
- Clean up cross-references in README.md
- If ./docs/.md deleted, update README.md feature index
- Report what was deleted
SCAN Codebase
Scan codebase and suggest documentation updates.
Process:
- Detect undocumented features:
- Public functions/classes without doc comments
- API endpoints not in docs
- Configuration options not documented
- Modules without ./docs/*.md files
- Detect outdated documentation:
- Code symbols that no longer exist
- Version references that are outdated
- Commands that have changed
- Produce scan report with recommendations:
- Missing documentation (priority ranked)
- Outdated documentation (specific issues)
- Suggested new ./docs/*.md files
- Offer to create/update documentation based on findings
Output format:
# Documentation Scan Report
## Summary
- Total docs: X files
- Coverage: Y% of modules documented
- Issues: Z findings
## Missing Documentation
| Priority | Item | Suggested Location |
|----------|------|-------------------|
| HIGH | Authentication module | ./docs/authentication.md |
| MEDIUM | Config options | ./docs/configuration.md |
## Outdated Documentation
| File | Issue | Action |
|------|-------|--------|
| ./docs/api.md | References removed endpoint | Remove or update |
## Suggested Actions
1. Create ./docs/authentication.md
2. Update ./docs/api.md section 3
3. Add config table to ./docs/configuration.md
---
Apply suggestions? [all/selective/none]
Reference Files
references/README_TEMPLATE.md - Industry-standard README template
references/FEATURE_DOC_TEMPLATE.md - Template for ./docs/*.md files
references/SEARCH_PATTERNS.md - Patterns for effective documentation search
references/DUPLICATE_CHECK.md - Duplicate detection patterns
Best Practices
- Keep README.md concise: It's an index, not the full documentation
- Cross-reference liberally: Link between docs using relative paths
- Update with code: Docs should evolve with the codebase
- Be specific: "Click Submit button" > "Submit the form"
- Include examples: Code snippets, commands, screenshots
- Research before changing: Always check for existing similar content
- Never guess: Return "NO RESULTS" rather than fabricating information