Doc Gen
Documentation generator with three modes: function-level (JSDoc/docstrings)...
Install
npx skills add SethGammon/Citadel --skill doc-gen -g -a claude-code -y- Repository
- SethGammon/Citadel927
- Category
- Writing
- Updated
- 5d ago
- License
- MIT
- Context cost
- Lightabout 1,168 tokens
- Runs scripts
- No, instructions only
What it does
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.
/doc-gen, Documentation Generator
When to Use
- 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
Mode auto-detected from target:
- File path → function-level mode
- Directory path → module-level mode
- Route file or API directory → 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
- Read AGENTS.md (then CLAUDE.md if present) for doc conventions
- Search for existing doc comments in the target area, note density, tone, tags used, and line length
- Default when no existing docs: JSDoc (
@param,@returns,@throws,@example) for TS/JS; Google-style for Python; idiomatic format for others
Apply detected style consistently across all generated docs.
Phase 2: ANALYZE TARGET
Function-Level Mode
For each function:
- Read the full body, not just the signature
- Classify:
- Trivial: simple getters/setters, one-line wrappers with obvious names, SKIP
- Non-trivial: document purpose, parameter semantics (not types, TS has those), return guarantees, throws/errors, side effects, non-obvious edge cases, and
@examplewhen usage is non-obvious
- Write using detected style
Core rule: every doc must add information beyond what the signature already says. If you cannot, skip it.
