doc-generator

doc-generator is a skill for Claude Code, Codex from JansenAnalytics/claudex. It costs 36 tokens per session (540 once invoked), scanned A, original, MIT.

A code documentation generator that scans a project and writes README files, API documentation, and JSDoc comments for JavaScript and TypeScript code.

In plain words
What is it for?
Use it to create a README from a project's structure, document Express or Fastify routes, and add comments to undocumented functions.
Why use it?
It reduces the manual work of documenting an existing codebase and helps keep documentation aligned with code changes.

Skill for Claude CodeCodex

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/jansenanalytics/claudex/doc-generator
Any agent
npx skills add JansenAnalytics/claudex --skill doc-generator
Clone the repo
git clone --depth 1 https://github.com/JansenAnalytics/claudex

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/jansenanalytics/claudex/doc-generator.svg)](https://agentmods.dev/skills/jansenanalytics/claudex/doc-generator)
Your own site
<a href="https://agentmods.dev/skills/jansenanalytics/claudex/doc-generator"><img src="https://agentmods.dev/badge/skills/jansenanalytics/claudex/doc-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 540 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00036 $0.00540
Opus 5 $0.00018 $0.00270
Sonnet 5 $0.00007 $0.00108
Haiku 4.5 $0.00004 $0.00054

Measured yesterday against content hash 6e1ced3ed679, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

doc-generator scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/doc-generator/SKILL.md · 74 lines

How it starts

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

doc-generator

Auto-generate documentation from code: README files, JSDoc comments, API docs. Scans project structure, detects frameworks, and produces ready-to-use documentation.

When to Use

  • Adding documentation to undocumented code
  • Generating README from project structure
  • Creating API documentation from Express/Fastify routes
  • Adding JSDoc/TSDoc comments to JavaScript/TypeScript functions
  • Keeping docs in sync with code changes

Scripts

generate-readme.sh

Auto-generate README.md by scanning project files.

# Generate README for current directory
bash scripts/generate-readme.sh --dir .

# Specify output file
bash scripts/generate-readme.sh --dir /path/to/project --output README.md

Detects: package.json, pyproject.toml, Makefile, Dockerfile, framework (React, Express, FastAPI, etc.)

Generates sections: Title, description, installation, usage, available scripts, project structure, dependencies, license.

jsdoc-gen.py

Generate JSDoc comments for undocumented JavaScript/TypeScript functions.

# Generate documented version
python3 scripts/jsdoc-gen.py --file src/utils.js --output src/utils.documented.js

# In-place modification
python3 scripts/jsdoc-gen.py --file src/utils.js --inplace

# Process all JS files in a directory
find src -name "*.js" -exec python3 scripts/jsdoc-gen.py --file {} --inplace \;

Analyzes: Parameter names, default values, TypeScript types, return statements, throw statements.

api-doc-gen.sh

Generate API documentation from Express/Fastify route files.

# Scan routes directory
bash scripts/api-doc-gen.sh --routes-dir src/routes/ --output API.md

# Single file
bash scripts/api-doc-gen.sh --routes-dir src/routes/users.js --output API.md

Extracts: HTTP method, path, middleware (auth, validation), handler name. Outputs Markdown with endpoint tables.

References

  • references/doc-templates.md — README templates, JSDoc patterns, Python docstring formats
  • references/doc-best-practices.md — What to document, keeping docs maintainable

Read the full file on GitHub · 74 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. yesterday First seen · 74 lines · 36 tokens per session scan A 6e1ced3ed679

Subscribe to this mod's changes

doc-generator is a skill published in the GitHub repository JansenAnalytics/claudex (5 stars, last pushed 2mo ago), licensed MIT. It adds 36 tokens to every session and 540 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories