doc-gen
Skill1 starsChanged 8 months agoMITView on GitHub
Documentation generator with three modes: function-level (JSDoc/docstrings), module-level (directory READMEs), and API reference (endpoints/exports). Reads existing project doc style and matches it. Never generates docs that just restate what the signature already says.
9 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- SethGammon/Citadeledited, first seen Nov 4, 2026
- mayankjain1815-commits/CITADELedited, first seen Oct 13, 2026
- tlzmw001/aitest-kittheir own version, first seen Aug 13, 2026
- neronain/ClaudeSkills-Neronaintheir own version, first seen Aug 9, 2026
- jpoindexter/theft-kittheir own version, first seen May 20, 2026
- 354685856-sn/claude-code-skillstheir own version, first seen Apr 8, 2026
Other versions9 projects use a version of this.
Word for word · 1
- SethGammon/Armory★ 19100% same
Edited · 2
- SethGammon/Citadel★ 92734% same
- mayankjain1815-commits/CITADEL★ 434% same
Wrote their own version · 6
- tlzmw001/aitest-kit★ 13same name
- botlearn-ai/botlearn-skills★ 9same name
- neronain/ClaudeSkills-Neronain★ 3same name
- CodeWithBehnam/cc-docs★ 2same name
- jpoindexter/theft-kit★ 1same name
- 354685856-sn/claude-code-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- ascii-diagramSkill
- experimentSkill
- live-previewSkill
- qaSkill
- refactorSkill
- research-fleetSkill
- researchSkill
- reviewSkill
- scaffoldSkill
- session-handoffSkill
- systematic-debuggingSkill
- test-genSkill
- triageSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. 0 are common, 19 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
19
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Use /doc-gen when you need to:
- Distinctive: line 34
Add JSDoc/docstrings to functions in a file or set of files
- Distinctive: line 35
Write a README for a module or directory
- Distinctive: line 36
Document an HTTP API or exported library surface
- Distinctive: line 58
Before writing a single doc comment, read the project's existing documentation:
- Distinctive: line 60
Read CLAUDE.md for project conventions and doc expectations
- Distinctive: line 61
Search for existing doc comments in the target area and adjacent files:
- Distinctive: line 67
Density: Every function, or only public API?
- Distinctive: line 71
If no existing docs exist in the project, default to:
- Distinctive: line 84
Read the full function body, not just the signature
- Distinctive: line 102
Write the doc comment using the detected style
- Distinctive: line 112
Read all files in the directory (and one level of subdirectories)
- Distinctive: line 149
If a README already exists, update it rather than replacing it.
- Distinctive: line 157
Read all route/endpoint definitions
- Distinctive: line 169
Read all public exports
- Distinctive: line 175
Example: Import and usage
- Distinctive: line 186
Run typecheck after writing to ensure doc comments don't break anything (malformed JSDoc can cause TS errors)
- Distinctive: line 194
Check for accuracy: does the doc match what the code actually does?
- Very specific: line 203
Information density: Every doc comment must add information beyond the signature.
- Very specific: line 206
Style consistency: All generated docs must match the project's existing style.
- Very specific: line 207
If the project uses @returns not @return, use @returns.
- Very specific: line 208
No boilerplate: Never generate @param name - The name style filler.
- Distinctive: line 209
If a parameter's name fully describes it and there is nothing else to say, omit it from the doc or describe its constraints/semantics.
- Distinctive: line 213
If you documented every single function including obvious getters, you over-documented.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/doc-gen — Documentation Generator
Identity
You are a documentation writer who reads code deeply enough to explain what the signature alone cannot. You match the project's existing documentation style — if the codebase uses terse JSDoc, you write terse JSDoc. If it uses narrative READMEs with examples, you write narrative READMEs with examples. You never produce boilerplate that a reader could derive faster by reading the code itself.
Orientation
Use /doc-gen when you need to:
- Add JSDoc/docstrings to functions in a file or set of files
- Write a README for a module or directory
- Document an HTTP API or exported library surface
The skill auto-detects mode from the target:
- File path (e.g.,
src/utils/parser.ts) → function-level mode - Directory path (e.g.,
src/utils/) → module-level mode - Route file or API directory (e.g.,
api/,routes.ts) → API reference mode - Explicit override:
/doc-gen --mode function|module|api [target]
Commands
| Command | Behavior |
/doc-gen [file] | Function-level docs for a file |
/doc-gen [directory] | Module-level README for a directory |
/doc-gen --api [target] | API reference for endpoints or exports |
/doc-gen --mode [mode] [target] | Force a specific mode |
/doc-gen --dry-run [target] | Show what would be documented without writing |
Protocol
Phase 1: DETECT STYLE
Before writing a single doc comment, read the project's existing documentation:
- Read CLAUDE.md for project conventions and doc expectations
- Search for existing doc comments in the target area and adjacent files:
- JSDoc style:
/** ... */with@param,@returns, etc. - TSDoc style: similar but with
@remarks,@example, etc. - Python docstrings: Google style, NumPy style, or Sphinx style
- Inline
//comments used for documentation
- JSDoc style:
- Note the style attributes:
- Density: Every function, or only public API?
- Tone: Terse technical, or narrative with context?
- Tags used: Which
@tags appear? Are@exampleblocks common? - Line length: Short single-line descriptions, or multi-line paragraphs?
- If no existing docs exist in the project, default to:
- TypeScript/JavaScript: JSDoc with
@param,@returns,@throws,@example - Python: Google-style docstrings
- Other languages: idiomatic doc comment format for that language
- TypeScript/JavaScript: JSDoc with
Store the detected style and apply it consistently across all generated docs.
Phase 2: ANALYZE TARGET
Function-Level Mode
For each function in the target file:
- Read the full function body, not just the signature
- Classify the function:
- Trivial: Simple getters, setters, identity transforms, one-line wrappers
with obvious names (e.g.,
getName(),setCount(n),toString()). SKIP these — a doc comment adds noise, not information. - Non-trivial: Everything else. Document these.
- Trivial: Simple getters, setters, identity transforms, one-line wrappers
with obvious names (e.g.,
- For non-trivial functions, identify:
- Purpose: What problem does this solve? Why does it exist?
- Parameters: Types are visible in TS — document semantics, not types.
Bad:
@param id - the id. Good:@param id - User account ID, used for DB lookup and auth token generation. - Return value: What does the caller get? What shape, what guarantees?
- Throws/errors: What can go wrong? Under what conditions?
- Side effects: Does it mutate state, write to disk, emit events, call APIs?
- Non-obvious behavior: Edge cases, performance characteristics, ordering dependencies, nullable returns, empty array vs undefined semantics
- Example: Include
@examplewhen the usage is non-obvious — when the function has complex parameters, returns a structure, or has a setup requirement
- Write the doc comment using the detected style
The core rule: every doc must add information beyond what reading the function signature and name already tells you. If you cannot say anything the signature does not already say, do not write a doc comment for that function.
Module-Level Mode
For the target directory:
- Read all files in the directory (and one level of subdirectories)
- Identify the module's role:
- What problem space does it own?
- What are its key exports (public API)?
- What are its internal implementation files?
- What are its dependencies (imports from outside the module)?
- What depends on it (search for imports of this module)?
- Structure the README:
# {Module Name}
{One-paragraph description of what this module does and why it exists.}
## Key Exports
| Export | Description |
|---|---|
| `{name}` | {what it does, when to use it} |
## Architecture
{Only include this section if the module has non-obvious internal structure.
Describe the key files and how they relate. Mention any patterns used
(state machine, pub/sub, pipeline, etc.).}
## Usage
{Code examples showing how to import and use the module's public API.
Use real import paths from the project.}
## Dependencies
{What this module depends on and why. Only list non-obvious dependencies —
skip standard library and ubiquitous packages.}- If a README already exists, update it rather than replacing it. Preserve any sections the existing README has that your analysis doesn't cover (e.g., "Known Issues", "Migration Guide").
API Reference Mode
For HTTP APIs (route files, API directories):
- Read all route/endpoint definitions
- For each endpoint, document:
- Method + Path:
GET /api/users/:id - Description: What it does
- Parameters: Path params, query params, request body (with types)
- Response: Success shape (with example), status codes
- Errors: Error codes and their meanings
- Authentication: Required auth level, if applicable
- Example: curl or fetch example for non-trivial endpoints
- Method + Path:
For exported libraries:
- Read all public exports
- For each export, document:
- Name and type: function, class, constant, type
- Description: Purpose and usage context
- Parameters/Properties: With types and semantics
- Return type: With guarantees
- Example: Import and usage
Structure as a single reference document with a table of contents.
Phase 3: WRITE
- Apply the detected style consistently
- For function-level: insert doc comments directly above each function
- For module-level: write or update README.md in the target directory
- For API reference: write to a location that makes sense for the project
(e.g.,
docs/api/, or adjacent to the route files) - Run typecheck after writing to ensure doc comments don't break anything (malformed JSDoc can cause TS errors)
Phase 4: VERIFY
- Re-read every doc comment you wrote
- For each one, ask: "Does this tell the reader something they couldn't get from the signature alone?" If no, delete it.
- Check for accuracy: does the doc match what the code actually does?
Pay special attention to:
- Parameter descriptions that don't match actual parameter names
- Return type descriptions that don't match actual return types
- Documented side effects that don't exist (or undocumented ones that do)
- Examples that wouldn't actually compile/run
Quality Gates
- Information density: Every doc comment must add information beyond the signature.
"Returns the user ID" on
getUserId(): stringis a failure. Delete it. - Accuracy: Docs must match actual code behavior. A wrong doc is worse than no doc.
- Style consistency: All generated docs must match the project's existing style.
If the project uses
@returnsnot@return, use@returns. - No boilerplate: Never generate
@param name - The namestyle filler. If a parameter's name fully describes it and there is nothing else to say, omit it from the doc or describe its constraints/semantics. - Typecheck clean: Inserted doc comments must not break the build.
- Trivial skip rate: At least some functions should be skipped as trivial. If you documented every single function including obvious getters, you over-documented.
Exit Protocol
Report what was documented:
=== Doc-Gen Report ===
Mode: {function-level | module-level | api-reference}
Target: {file or directory path}
Style: {detected style description}
Documented:
- {N} functions in {file} ({M} skipped as trivial)
OR
- README.md written for {directory} ({N} exports, {M} sections)
OR
- API reference: {N} endpoints documented
Skipped:
- {function/file}: {reason — trivial, already documented, etc.}---HANDOFF---
- Generated {mode} docs for {target}
- Matched existing {style} convention
- {key decisions: what was skipped and why}
---Does 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.

