skills/code-documenter/SKILL.md
Expert documentation generator for coding projects. Analyzes codebases to create thorough, comprehensive documentation for developers and users. Supports incremental updates, multi-audience documentation, architecture decision records, and documentation health tracking. Works with any project type (APIs, CLIs, web apps, libraries). Use when you need to document a new project, update docs after adding features, or create comprehensive documentation for open source releases.
npx skillsauth add robertguss/claude-skills code-documenterInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
An intelligent documentation system that analyzes codebases and generates thorough, comprehensive documentation tailored to your project type and audience needs.
Documentation serves readers, not authors. Every decision about structure, depth, and content is evaluated from the reader's perspective:
Comprehensive without overwhelm. Thorough coverage of what matters, ruthless cutting of what doesn't. The goal is complete, accurate, useful documentation—not exhaustive documentation of every line of code.
Documentation as code artifact. Docs should be versioned, tested, and maintained with the same rigor as code. They're not afterthoughts; they're essential.
Primary use cases:
Not for:
The skill operates in two modes:
| Mode | When to Use | Behavior | | ---------------------- | ----------------------------------------------- | ------------------------------------------------- | | Quick Mode | Incremental updates after new features | Autonomous, fast, focused on what changed | | Comprehensive Mode | New projects, major overhauls, first-time setup | Collaborative, thorough, quality gates throughout |
The skill will ask: "Quick update or comprehensive documentation?"
The skill deploys specialized analysis agents to understand your project:
Analysis Phase:
├─ Agent 1: Project Structure
│ └─ Scanning file tree, identifying project type, tech stack
├─ Agent 2: Code Surface Analysis
│ └─ Finding APIs, components, commands, exports
├─ Agent 3: Dependency Analysis
│ └─ Reviewing packages, frameworks, key dependencies
├─ Agent 4: Git History Analysis
│ └─ Analyzing commits since last doc update
├─ Agent 5: Existing Documentation Review
│ └─ Reading current docs, assessing state
└─ Synthesis: Generating documentation plan...
Quick Mode: Focused analysis on what changed since last update
Comprehensive Mode: Full analysis of entire project
Each agent reports findings in structured format. You see everything happening.
The skill compares code state vs. documentation state:
If manifest exists (.doc-state.json):
If no manifest:
Key metrics shown:
The skill asks:
"Who needs these docs?"
"What depth of documentation?"
Quick Mode: Uses stored preferences from manifest
Comprehensive Mode: Asks explicitly, shows examples
The skill proposes what should be documented:
Based on my analysis of your Express + PostgreSQL API:
PUBLIC SURFACE (Always Document)
├─ 12 API endpoints in /routes
├─ Database schema (3 tables)
├─ 14 environment variables
└─ Authentication flow
INTERNAL IMPLEMENTATION (Recommended for Deep)
├─ 6 middleware functions
├─ Error handling patterns
└─ Database migration strategy
INFRASTRUCTURE (Essential for all levels)
├─ Docker setup
├─ CI/CD pipeline
└─ Deployment process
EXCLUDED (Recommend skip)
├─ Test files (obvious from names)
├─ Build scripts (standard tooling)
└─ Internal helpers (<10 lines each)
Adjust these boundaries? [approve/modify]
You approve or adjust before documentation generation begins.
The skill presents a complete plan:
DOCUMENTATION PLAN
Structure:
└─ /docs
├─ developers/
│ ├─ api.md (API endpoint reference)
│ ├─ architecture.md (System design + diagrams)
│ ├─ contributing.md (How to contribute)
│ ├─ deployment.md (Deploy & operate)
│ ├─ troubleshooting.md (Common issues)
│ ├─ examples/ (12 runnable examples)
│ └─ adr/ (4 architecture decisions)
├─ users/
│ ├─ getting-started.md (Quick start guide)
│ ├─ features.md (Feature overview)
│ ├─ troubleshooting.md (User-facing issues)
│ └─ examples/ (5 user examples)
├─ CHANGELOG.md (Documentation change log)
└─ documentation-map.md (Navigation guide)
Files to update:
- README.md (complete rewrite, progressive disclosure)
- docs/developers/api.md (2 new endpoints, 1 modified)
- docs/CHANGELOG.md (new entry)
Files to create:
- docs/adr/004-caching-strategy.md (new decision)
- docs/developers/examples/pagination.js (new example)
Files to remove:
- docs/developers/legacy-auth.md (endpoint removed)
Estimated scope: ~5,200 words total
Target health score: 92/100
Proceed? [yes/adjust scope/abort]
Comprehensive Mode: Review and approve before generation
Quick Mode: Brief preview, option to review or proceed
The skill works through documentation in phases, pausing for review:
Gate 1: Core Documentation (README + Getting Started)
Gate 2: Reference Documentation (API/Commands/Components)
Gate 3: Architecture & Decisions
Gate 4: Supporting Documentation
Gate 5: Polish & Verification
The skill executes the plan efficiently:
The skill produces:
Files Created/Updated:
.doc-state.json (updated manifest)docs/CHANGELOG.md (new entry)Documentation Health Report:
DOCUMENTATION HEALTH REPORT
Overall Health Score: 92/100 (↑ from 78)
Component Scores:
├─ Coverage Health: 95/100 (↑ from 82)
│ └─ 97% of public surface documented
├─ Freshness Health: 98/100 (↑ from 65)
│ └─ All docs current as of commit a3f2b1c
├─ Quality Health: 88/100 (↑ from 81)
│ └─ 12 examples, 4 ADRs, troubleshooting complete
└─ Consistency Health: 90/100 (↑ from 84)
└─ Tone consistent, terminology standardized
Debt Status:
├─ Critical: 0 items (was 2)
├─ Important: 1 item (was 4)
└─ Minor: 3 items (unchanged)
Next session recommendations:
- Document the new webhook system (flagged as potential)
- Add performance troubleshooting section
- Consider hosting docs on GitHub Pages
Session Notes:
Developer-only projects:
/docs
├── CHANGELOG.md
├── api.md / commands.md / components.md
├── architecture.md
├── contributing.md
├── deployment.md
├── troubleshooting.md
├── examples/
│ ├── example-1.js
│ ├── example-2.js
│ └── test-examples.sh
├── adr/
│ ├── 001-initial-decisions.md
│ ├── 002-database-choice.md
│ └── ...
└── scripts/
├── validate-links.sh
└── accessibility-check.md
Multi-audience projects:
/docs
├── CHANGELOG.md
├── documentation-map.md
├── users/
│ ├── getting-started.md
│ ├── features.md
│ ├── troubleshooting.md
│ └── examples/
│ ├── basic-usage.js
│ └── advanced-usage.js
├── developers/
│ ├── api.md / architecture.md
│ ├── contributing.md
│ ├── deployment.md
│ ├── troubleshooting.md
│ ├── examples/
│ │ ├── integration.js
│ │ ├── extending.js
│ │ └── test-examples.sh
│ └── adr/
│ ├── 001-framework-choice.md
│ └── ...
└── scripts/
├── validate-links.sh
└── accessibility-check.md
.doc-state.json)Tracks complete documentation state:
{
"version": "1.0",
"project": {
"name": "my-api",
"type": "express-api",
"lastScanned": "2025-01-10T14:30:00Z",
"gitCommit": "a3f2b1c"
},
"preferences": {
"audiences": ["developers", "users"],
"depthLevel": "standard",
"tone": "professional"
},
"healthScore": {
"overall": 92,
"components": {
"coverage": 95,
"freshness": 98,
"quality": 88,
"consistency": 90
},
"trend": [78, 85, 92]
},
"coverage": {
"endpoints": { "total": 12, "documented": 12, "changed": 0 },
"components": { "total": 8, "documented": 8, "changed": 0 },
"schemas": { "total": 3, "documented": 3, "changed": 0 }
},
"debt": {
"critical": [],
"important": [
{
"item": "Document webhook system",
"effort": "medium",
"status": "to-fix"
}
],
"minor": [
{
"item": "Add performance troubleshooting",
"effort": "low",
"status": "accepted"
}
]
},
"documentationMap": {
"README.md": {
"lastUpdated": "2025-01-10T14:30:00Z",
"covers": ["overview", "quickstart"],
"wordCount": 850
},
"docs/developers/api.md": {
"lastUpdated": "2025-01-10T14:30:00Z",
"covers": ["endpoints"],
"wordCount": 2400
}
}
}
Proactive contributions:
Challenge assumptions:
Surface insights:
Efficient execution:
Flag concerns:
The skill maintains high documentation quality through:
Captures WHY decisions were made:
The skill identifies decision points through:
Each ADR documents:
Examples are runnable code in /examples:
Two flavors:
The skill seeds initial content in Comprehensive Mode, grows it in Quick Mode as you add real troubleshooting content.
For large projects, a navigation guide:
The skill generates code-based diagrams:
All version-controllable, all render in GitHub.
Detects if you're using:
Generates appropriate config files and optimizes structure for static site generation.
Load contextually when needed:
references/project-types-guide.md — How to document different project
typesreferences/documentation-patterns.md — Common documentation patterns and
structuresreferences/quality-standards.md — Detailed quality criteria and examplesreferences/manifest-spec.md — Technical specification for
.doc-state.jsonreferences/depth-levels-guide.md — Standard vs. Deep explained with
examplesreferences/health-score-formula.md — How health score is calculatedreferences/adr-guide.md — Writing effective Architecture Decision
RecordsAvailable in templates/:
README-template.md — Progressive disclosure README structureapi-docs-template.md — API endpoint documentationcomponent-docs-template.md — Component/module documentationtroubleshooting-template.md — Troubleshooting guide structurecontributing-template.md — Contributing guidelinesdocumentation-map-template.md — Navigation guide templateDocumentation is complete when:
✓ Health score ≥ 85
✓ All critical and important debt resolved
✓ Examples run without errors
✓ Links validate successfully
✓ Accessibility check passes
✓ Tone is consistent throughout
✓ You're confident someone could use your project from the docs alone
documentation
Capture a writer's voice DNA through collaborative interview and sample analysis. Use when someone wants to document their writing voice for use with a ghost writer skill. Produces a Voice DNA Document with patterns, anti-patterns, and actionable guidance. Handles one register/mode per session, supports refinement over time.
testing
Produce first drafts that match a writer's authentic voice using their Voice DNA Document. Consumes DNA documents from writing-dna-discovery skill. Generates 2 meaningfully different drafts with headlines, confidence assessment, decision notes, and DNA refinement suggestions. Collaborative partner that evaluates, pushes back, and advocates for quality. Handles blog posts, essays, newsletters, and more.
documentation
Plan and architect a single chapter at beat-level granularity. Use when you have a chapter from the Architecture Document and need to create a detailed outline before drafting. Produces a Chapter Outline Document for use by draft-coach or ghostwriter.
testing
Plan, orchestrate, and validate deep research for nonfiction books. Use when an author has completed book architecture and needs to fill research gaps before outlining chapters. Triggers include requests to plan research, generate research prompts, validate research quality, or prepare for drafting. This skill does everything around deep research—planning, prompting, validating, synthesizing—but the actual research execution happens externally via Claude and Gemini deep research. Requires upstream documents from book-architect (Research Gaps Document, Master Architecture Document, Section Blueprints) and book-ideation (Book Concept Document).