doc-generate

doc-generate is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 32 tokens per session (1,044 once invoked), scanned A, original, MIT.

A command that creates or refreshes project documentation from existing source code, including API descriptions, architecture diagrams, README content, code explanations, and documentation checks in CI/CD. CI/CD means automated building, testing, and delivery of software.

In plain words
What is it for?
Use it to inspect Java, Node.js, Python, or Flutter projects and generate documentation such as an OpenAPI specification, diagrams, README sections, and docstrings.
Why use it?
It reduces the work of documenting APIs and project structure manually, and helps keep documentation aligned with the code.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths.

Good fit Use it to inspect Java, Node.js, Python, or Flutter projects and generate documentation such as an OpenAPI specification, diagrams, README sections, and docstrings.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/doc-generate
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.

Clone the repo
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboarding

Made for: Claude Code.

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-generate

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/doc-generate/github.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/doc-generate)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/doc-generate"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/doc-generate/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for doc-generate

Your own site · 80×15
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/doc-generate"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/doc-generate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,044 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00032 $0.01044
Opus 5.5 $0.00013 $0.00418
Sonnet 5.5 $0.00006 $0.00209
Haiku 4.5 $0.00003 $0.00104

Measured 1mo ago against content hash 25ddd7e3e749, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

doc-generate 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 1mo 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.

curl -s http://localhost:8000/openapi.json > docs/api/openapi.json 2>/dev/null || echo "[NOTE] Start the service first to export live spec"
.claude/commands/doc-generate.md · 108 lines

How it starts

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

Documentation Generation

Generate or refresh all documentation for the target project or path.

Target: $ARGUMENTS (default: current directory).

Step 1: Detect project type

TARGET="${ARGUMENTS:-.}"
HAS_JAVA=false; HAS_NODE=false; HAS_PYTHON=false; HAS_FLUTTER=false

[ -f "$TARGET/pom.xml" ] && HAS_JAVA=true && echo "Java/Spring detected"
[ -f "$TARGET/package.json" ] && HAS_NODE=true && echo "NestJS/Angular detected"
[ -f "$TARGET/pyproject.toml" ] || [ -f "$TARGET/requirements.txt" ] && HAS_PYTHON=true && echo "Python detected"
[ -f "$TARGET/pubspec.yaml" ] && HAS_FLUTTER=true && echo "Flutter detected"

Step 2: API documentation

Load the openapi-spec-generation skill, then:

  • Java/Spring Boot: Scan controllers for @RestController, @GetMapping, @PostMapping, etc. Extract route paths, request/response types, and generate or update docs/api/openapi.yaml.
  • NestJS: Scan *.controller.ts for @Controller, @Get, @Post decorators. Extract DTOs and generate or update docs/api/openapi.yaml.
  • Python FastAPI: Confirm /openapi.json is served at runtime (built-in). Export the spec with:
    curl -s http://localhost:8000/openapi.json > docs/api/openapi.json 2>/dev/null || echo "[NOTE] Start the service first to export live spec"
    
  • Flutter: Skip API generation (client-side).

Step 3: Architecture diagram

Dispatch mermaid-expert agent to create a system diagram from the project structure:

  • Scan top-level directories and entry points
  • Identify key services, controllers, models, and external dependencies
  • Produce a graph TB diagram showing components and data flows

Output to docs/diagrams/[detected-service-name]-architecture.md.

Step 4: README

Check if README.md exists:

ls $TARGET/README.md 2>/dev/null && echo "README exists" || echo "README missing"
  • If missing: Generate from the stack-specific template in skills/documentation-generation/references/readme-templates.md.
  • If exists: Check for stale sections:
    • Missing environment variables (grep process.env / os.environ / @Value against README)
    • Outdated build commands (compare against package.json scripts / pom.xml / pyproject.toml)
    • Report stale sections without overwriting (present diff to user for review)

Read the full file on GitHub · 108 lines

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. 1mo ago First seen · 108 lines · 32 tokens per session scan A 25ddd7e3e749

Subscribe to this mod's changes

doc-generate is a command published in the GitHub repository kumaran-is/claude-code-onboarding (36 stars, last pushed 3mo ago), licensed MIT. It adds 32 tokens to every session and 1,044 once invoked, about $0.0001 per session on Opus 5.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-09-03.