doc-gen

doc-gen is a skill for Claude Code, Codex from SethGammon/Citadel. It costs 57 tokens per session (1,221 once invoked), scanned A, original, MIT.

A documentation generator for functions, modules, and APIs. It reads the project's existing documentation style and writes matching JSDoc, docstrings, READMEs, or API references.

In plain words
What is it for?
Use it to document functions in a file, explain a directory or module in a README, or describe HTTP endpoints and exported library features.
Why use it?
It reduces the manual work of documenting code while avoiding comments that merely repeat function signatures. A dry-run mode lets you see what would be documented before anything is written.

Skill for Claude CodeCodex

Part of the citadel plugin — 49 skills, 7 agents, 2 MCP servers shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/sethgammon/citadel/doc-gen
Any agent
npx skills add SethGammon/Citadel --skill doc-gen
Clone the repo
git clone --depth 1 https://github.com/SethGammon/Citadel

Made for: Claude Code, Codex.

Or install citadel, the plugin that ships this one along with the rest of its 49 skills, 7 agents, 2 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for doc-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/sethgammon/citadel/doc-gen.svg)](https://agentmods.dev/skills/sethgammon/citadel/doc-gen)
Your own site
<a href="https://agentmods.dev/skills/sethgammon/citadel/doc-gen"><img src="https://agentmods.dev/badge/skills/sethgammon/citadel/doc-gen.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,221 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00057 $0.01221
Opus 5 $0.00028 $0.00611
Sonnet 5 $0.00011 $0.00244
Haiku 4.5 $0.00006 $0.00122

Measured 5d ago against content hash cfcf2775bd5e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

doc-gen scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

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.
skills/doc-gen/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/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

  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

Read the full file on GitHub · 132 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 132 lines · 57 tokens per session scan A cfcf2775bd5e

Subscribe to this mod's changes

doc-gen is a skill published in the GitHub repository SethGammon/Citadel (916 stars, last pushed yesterday), licensed MIT. It adds 57 tokens to every session and 1,221 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

compose-org

Run a task as an evolved multi-agent ORG using the installed liquid-org framework — where YOU (the running Claude) embody the org: you ask liquid-org which proven team topology + specialist personas to use (retrieved from its evolved pool, or assembled fresh), then dispatch ONE SUBAGENT PER TALENT to play each role…

U0001F3A2/liquid-org · 226 tokens

liquid-rank

Rank the available skills by RELEVANCE to the current task, on demand, using liquid-org's read-only hermes skill ranker. This is an EXPLICIT, OPT-IN selector you invoke WHEN you want help choosing the most relevant skill for what you're doing — it is NOT default, automatic skill selection, and it does NOT decide for…

U0001F3A2/liquid-org · 198 tokens

agent-workflow-playbook

AI Agent Workflow & Skill Architecture Guide — turn expert work into measurable, reusable agent systems. Covers workflow discovery, skill decomposition, harness design, evaluation, human escalation, observability, cost control, and multi-agent orchestration. Includes a measured marketing-delivery case: 15 people × 3–4…

Gingiris-1031/gingiris-skills · 83 tokens

present-gate

First-officer gate-presentation rendering — the captain-facing gate-review template and assembly rules, including workflow-owned finding labels. Invoke at the gate point after the FO has decided a stage must be presented.

spacedock-dev/spacedock · 44 tokens

audit-project

Run an iterative multi-agent code audit until critical and high findings are resolved. Use when the user says "audit my code", "find all the bugs", "deep code audit", "iterative review", or "review until clean".

OutlineDriven/odin-claude-plugin · 50 tokens

contexts

Use when the user says "get context on X", "how does X work", or wants architectural orientation before coding.

OutlineDriven/odin-claude-plugin · 26 tokens