Agent skill

Doc Gen

by SethGammon in SethGammon/Citadel

Documentation generator with three modes: function-level (JSDoc/docstrings), module-level (directory READMEs), and API reference (endpoints/exports).

MITAuto-check passedDevelopment

Install Doc Gen

skills CLI
$ npx skills add SethGammon/Citadel --skill doc-gen -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SethGammon/Citadel doc-gen --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SethGammon/Citadel.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/doc-gen .claude/skills/doc-gen && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
doc-gen
GitHub stars
922
Token cost
~1.3k tokens
SKILL.md length
557 words
Files
3
Skills in repo
48
Repo updated
First seen
Licence
MIT

At a glance

Documentation generator with three modes: function-level (JSDoc/docstrings), module-level (directory READMEs), and API reference (endpoints/exports).

  • Works in 4 steps: DETECT STYLE → ANALYZE TARGET → WRITE → …
  • Tasks that involve Technical documentation
  • SKILL.md covers When to Use, Commands, Protocol and Contextual Gates, plus 2 more sections
  • Calls git

What it does

Doc Gen is an agent skill from SethGammon/Citadel. 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.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `__benchmarks__/generate-readme.md` and `__benchmarks__/no-source-files.md`).

It sits in Development, covering Technical documentation. The repository describes itself as: The operating layer for Claude Code + OpenAI Codex: persistent project memory, intent routing, safety hooks, cost telemetry, and parallel agent fleets. The licence is MIT.

When your agent uses it

  • Tasks that involve Technical documentation

Example prompts

  • “/doc-gen”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. DETECT STYLE
  2. ANALYZE TARGET
  3. WRITE
  4. VERIFY

What it can do on your machine

Read from SKILL.md and the folder at commit e41ff1d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Doc Gen loads about 1.3k tokens when it runs. Until then it costs about 70 tokens; SKILL.md has 557 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SethGammon/Citadel at commit e41ff1d, republished under its MIT licence (© SethGammon). 557 words, ~1,282 tokens.

Download SKILL.mdSave it as .claude/skills/doc-gen/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
doc-gen
description
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.
license
MIT
user-invocable
true
auto-trigger
false
trigger_keywords
document, docs, docstring, jsdoc, readme, api docs
last-updated
2026-03-20

/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

CommandBehavior
/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
  1. Read CLAUDE.md for doc conventions
  2. Search for existing doc comments in the target area — note density, tone, tags used, and line length
  3. 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:

  1. Read the full body, not just the signature
  2. 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 @example when usage is non-obvious
  3. Write using detected style

Core rule: every doc must add information beyond what the signature already says. If you cannot, skip it.

Module-Level Mode
  1. Read all files in the directory (one level deep)
  2. Identify: problem space, key exports, internal files, external dependencies, and what imports this module
  3. README schema: # {Module Name} | one-paragraph description | ## Key Exports table (name, description) | ## Architecture (only if non-obvious internal structure) | ## Usage (real import paths) | ## Dependencies (non-obvious only)
  4. If a README already exists, update rather than replace — preserve sections not covered by your analysis
API Reference Mode

For HTTP endpoints: method + path, description, path/query/body params (with types), response shape and status codes, errors, auth level, and a curl/fetch example for non-trivial endpoints.

For exported libraries: name and kind (function/class/constant/type), description, parameters/properties with semantics, return type with guarantees, import and usage example.

Structure as a single reference document with a table of contents.

Show full SKILL.md (194 more words)Show less
Phase 3: WRITE
  1. Apply detected style consistently
  2. Function-level: insert doc comments above each function
  3. Module-level: write or update README.md in the target directory
  4. API reference: write to docs/api/ or adjacent to route files
  5. Run typecheck after writing (malformed JSDoc can cause TS errors)
Phase 4: VERIFY

Re-read every doc comment. For each: "Does this add information beyond the signature?" If not, delete it. Check accuracy: parameter names, return types, side effects, and that examples would actually compile/run.

Contextual Gates

Disclosure: "Generating documentation for [target]. Source files will be modified." Reversibility: amber — adds JSDoc/docstrings to source files; undo with git checkout on modified files. Trust gates:

  • Any: additive doc generation on undocumented functions.
  • Familiar (5+ sessions): rewriting existing docstrings that may discard prior content.

Quality Gates

  • Every doc comment adds information beyond the signature; if not, delete it
  • Docs match actual code behavior — wrong docs are worse than no docs
  • Style matches the project's existing convention throughout
  • No @param name - The name filler; omit parameters when their name is self-explanatory
  • Typecheck passes after insertion
  • At least some functions skipped as trivial — if every function was documented, you over-documented

Exit Protocol

=== Doc-Gen Report ===
Mode: {function-level | module-level | api-reference}
Target: {path}
Style: {detected style}
Documented: {N functions ({M} skipped as trivial) | README.md ({N} exports) | {N} endpoints}
Skipped: {item}: {reason}
---HANDOFF---
- Generated {mode} docs for {target}
- Matched existing {style} convention
- {what was skipped and why}
- Reversibility: amber — undo with `git checkout` on modified source files
---

© SethGammon, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in skills/doc-gen of SethGammon/Citadel.

  • SKILL.md
  • __benchmarks__/generate-readme.md
  • __benchmarks__/no-source-files.md

Open the folder on GitHubat commit e41ff1d

Compare with similar skills

Doc Gen next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Doc Gen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Doc Gen this skillSethGammon/Citadel922—~1.3kAutomated safety check: PassMIT
Diagram Designcathrynlavery/diagram-design45k1 repos~7.5kAutomated safety check: PassMIT
Simple Englishmoeru-ai/airi50k2 repos~4.6kAutomated safety check: PassMIT
Get API Docs with chubandrewyng/context-hub14k2 repos~775Automated safety check: PassMIT
Doc SyncJetBrains/ideavim10k2 repos~2.6kAutomated safety check: PassMIT
Mailspring App ScreenshotsFoundry376/Mailspring18k—~1.5kAutomated safety check: PassGPL-3.0

Similar skills

  • Diagram Design

    cathrynlavery/diagram-design

    Creates branded diagrams, from architecture, flowchart and sequence to charts and maps, as self-contained HTML with inline SVG, with import from draw.io, Mermaid and Excalidraw.

    45k GitHub starsUsed in 1 repo~7.5k tokens
    DevelopmentAuto-check passed
  • Simple English

    moeru-ai/airi

    Write or rewrite technical text with the rules of ASD-STE100 Simplified Technical English so it is clear, unambiguous, and free of AI slop.

    50k GitHub starsUsed in 2 repos~4.6k tokens
    DevelopmentAuto-check passed
  • Get API Docs with chub

    andrewyng/context-hub

    Fetches current documentation for third-party APIs and SDKs with the chub CLI before the agent writes code against them, instead of relying on remembered API shapes.

    14k GitHub starsUsed in 2 repos~775 tokens
    DevelopmentAuto-check passed
  • Doc Sync

    JetBrains/ideavim

    Official

    Keeps IdeaVim documentation in sync with code changes. An agent skill from JetBrains/ideavim.

    10k GitHub starsUsed in 2 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Mailspring App Screenshots

    Foundry376/Mailspring

    Captures screenshots of the running Mailspring dev app for docs, PRs or visual checks by launching it with a debugging port, driving the UI and clipping to an element.

    18k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Draw.io Diagram Studio

    Agents365-ai/drawio-skill

    Creates and edits editable draw.io diagrams from descriptions, code, infrastructure files, SQL and API schemas, with sync, review, test and export tools.

    10k GitHub stars~2.4k tokensUpdated 6 days ago
    DevelopmentAuto-check: notes

More from SethGammon/Citadel

All 48 skills in this repo
  • Create Skill

    SethGammon/Citadel

    Creates new skills from the user's repeating patterns. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.9k tokensUpdated 6 days ago
    Auto-check passed
  • Houseclean

    SethGammon/Citadel

    Cross-drive storage audit and cleanup. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.2k tokensUpdated 6 days ago
    Auto-check passed
  • Loop

    SethGammon/Citadel

    Bounded foreground repetition for the current session. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.4k tokensUpdated 6 days ago
    Auto-check passed
  • Triage

    SethGammon/Citadel

    GitHub issue and PR investigator. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.7k tokensUpdated 6 days ago
    Auto-check passed
  • Watch

    SethGammon/Citadel

    File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills.

    922 GitHub stars~2.9k tokensUpdated 6 days ago
    Auto-check passed
  • Archon

    SethGammon/Citadel

    Autonomous multi-session campaign agent. An agent skill from SethGammon/Citadel.

    922 GitHub stars~5.4k tokensUpdated 6 days ago
    Auto-check passed

Categories

Questions about Doc Gen

What does Doc Gen do?

Documentation generator with three modes: function-level (JSDoc/docstrings), module-level (directory READMEs), and API reference (endpoints/exports). Doc Gen is an agent skill from SethGammon/Citadel. Documentation generator with three modes: function-level (JSDoc/docstrings), module-level (directory READMEs), and API reference (endpoints/exports).

When should I use Doc Gen?

Doc Gen fits situations like: tasks that involve Technical documentation.

How do I install Doc Gen in Claude Code?

Run `npx skills add SethGammon/Citadel --skill doc-gen -a claude-code`. Or copy the skill folder (skills/doc-gen in SethGammon/Citadel) into .claude/skills/doc-gen in your project. Claude Code loads it when a task matches its description.

How do I install Doc Gen in Codex?

Run `npx skills add SethGammon/Citadel --skill doc-gen -a codex`. Or copy the skill folder (skills/doc-gen in SethGammon/Citadel) into .agents/skills/doc-gen in your project. Codex loads it when a task matches its description.

Can I use Doc Gen in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SethGammon/Citadel --skill doc-gen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/doc-gen, .gemini/skills/doc-gen, .github/skills/doc-gen and .opencode/skills/doc-gen in your project.

What does Doc Gen need to run?

Going by SKILL.md and its folder, Doc Gen needs the command-line tools its instructions call (git).

Does Doc Gen access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Doc Gen safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Doc Gen use?

Doc Gen is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Doc Gen use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Doc Gen?

Skills that share tags, products or a category with Doc Gen: Diagram Design (cathrynlavery/diagram-design, 45k stars), Simple English (moeru-ai/airi, 50k stars), Get API Docs with chub (andrewyng/context-hub, 14k stars) and Doc Sync (JetBrains/ideavim, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Doc Gen?

SethGammon (a GitHub user) maintains it in SethGammon/Citadel, which has 922 GitHub stars. The repository holds 48 skills in this directory. The repository was last updated on October 1, 2026.

Source: SethGammon/Citadel on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.