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.
npx agentmods add commands/halflength-ampleness75/claude-code-recipes/doc-gengit clone --depth 1 https://github.com/halflength-ampleness75/claude-code-recipesWrote 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.
[](https://agentmods.dev/commands/halflength-ampleness75/claude-code-recipes/doc-gen)<a href="https://agentmods.dev/commands/halflength-ampleness75/claude-code-recipes/doc-gen"><img src="https://agentmods.dev/badge/commands/halflength-ampleness75/claude-code-recipes/doc-gen.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00016 | $0.00903 |
| Opus 5 | $0.00008 | $0.00451 |
| Sonnet 5 | $0.00003 | $0.00181 |
| Haiku 4.5 | $0.00002 | $0.00090 |
Grade A, and why
doc-gen 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 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.
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.
How it starts
The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Generate documentation for the code specified in $ARGUMENTS. The argument may be a file path, a directory, a function name, or a keyword like "readme" or "api".
Step 1 — Determine Documentation Type
Parse $ARGUMENTS to figure out what kind of documentation is needed:
| Argument contains | Action |
|---|---|
A file path (e.g., src/auth.ts) |
Add inline JSDoc/docstrings to that file |
A directory (e.g., src/utils/) |
Document all exported members in that directory |
readme or README |
Generate or update the project README |
api |
Generate API reference documentation |
| A function/class name | Find and document that specific symbol |
| Nothing | Ask the user what they want documented |
Step 2a — Inline Documentation (JSDoc / Docstrings)
For each exported function, class, method, type, and constant in the target file(s):
JavaScript/TypeScript — JSDoc:
/**
* Brief one-line description of what this function does.
*
* Longer explanation if the behavior is non-obvious, including
* algorithm notes, performance characteristics, or caveats.
*
* @param name - Description of the parameter
* @returns Description of the return value
* @throws {ErrorType} When and why this error is thrown
* @example
* const result = myFunction("input");
* // result === "expected output"
*/
Python — Docstrings (Google style):
def my_function(name: str) -> str:
"""Brief one-line description.
Longer explanation if needed.
Args:
name: Description of the parameter.
Returns:
Description of the return value.
Raises:
ValueError: When and why this error is raised.
Example:
>>> my_function("input")
'expected output'
"""
Rules:
- Do not state the obvious.
@param id - The idis useless. Write@param id - Unique identifier used to look up the user record. - Document why, not just what, when the purpose is non-obvious.
- Include at least one
@examplefor public API functions. - Document thrown errors and edge-case behavior.
- Preserve existing documentation — only add or improve, never remove unless it is incorrect.
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.
- 5d ago First seen · 115 lines · 16 tokens per session scan A 8f96312c7a7d
doc-gen is a command published in the GitHub repository halflength-ampleness75/claude-code-recipes (2 stars, last pushed today), licensed MIT. It adds 16 tokens to every session and 903 once invoked, about $0.0001 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-08-31.
Other commands, from other repositories
shard-doc
Splits large markdown documents into smaller, organized files based on level 2 (default) sections. Use if the user says perform shard document.
dejavu-docs
Search project documentation embeddings via dejavu (docs-only).
pull-repos
Pull all repos (parent + marketplace clones + configured project repos).
update-counts
Update all hardcoded counts (skills, agents, marketplace repos/skills) across documentation from filesystem.
brief-compliance-check
Check a LaTeX coursework submission against the requirements in a supplied PDF assessment brief. Use when verifying format, required sections, word limits, or deliverables before submission. Not for general prose proofreading; use $proofread.
latex-scaffold
Convert an existing Markdown manuscript draft into a buildable LaTeX project with canonical structure and build configuration. Use when prose already exists but no LaTeX source tree does. Not for checking template drift in an existing project; use $latex-template.