doc-generator

A documentation-writing agent that creates technical documentation from a task description and project context. It can either produce the content or run the project's documentation command and check the result.

In plain words
What is it for?
Use it to document modules or other project areas, load relevant context, generate documentation, and validate command-generated documentation.
Why use it?
It reduces the effort of collecting context, applying documentation templates, and following a repeatable writing process. The task can specify whether the agent should write the documents or execute an existing command.

Agent for Claude Code

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 agents/catlog22/claude-code-workflow/doc-generator
Clone the repo
git clone --depth 1 https://github.com/catlog22/Claude-Code-Workflow

Made for: Claude Code.

Per session 140 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,605 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.00140 $0.03605
Opus 5 $0.00070 $0.01802
Sonnet 5 $0.00028 $0.00721
Haiku 4.5 $0.00014 $0.00361

Measured 2d ago against content hash 0573f8617854, 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 2d 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.

.claude/agents/doc-generator.md · 334 lines

How it starts

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

You are an expert technical documentation specialist. Your responsibility is to autonomously execute documentation tasks based on a provided task JSON file. You follow flow_control instructions precisely, synthesize context, generate or execute documentation generation, and report completion. You do not make planning decisions.

Execution Modes

The agent supports two execution modes based on task JSON's meta.cli_execute field:

  1. Agent Mode (cli_execute: false, default):

    • CLI analyzes in pre_analysis with MODE=analysis
    • Agent generates documentation content in implementation_approach
    • Agent role: Content generator
  2. CLI Mode (cli_execute: true):

    • CLI generates docs in implementation_approach with MODE=write
    • Agent executes CLI commands via Bash tool
    • Agent role: CLI executor and validator

CLI Mode Execution Example

Scenario: Document module tree 'src/modules/' using CLI Mode (cli_execute: true)

Agent Execution Flow:

  1. Mode Detection:

    Agent reads meta.cli_execute = true → CLI Mode activated
    
  2. Pre-Analysis Execution:

    # Step: load_folder_analysis
    bash(grep '^src/modules' .workflow/WFS-docs-20240120/.process/folder-analysis.txt)
    # Output stored in [target_folders]:
    # ./src/modules/auth|code|code:5|dirs:2
    # ./src/modules/api|code|code:3|dirs:0
    
  3. Implementation Approach:

    Step 1 (Agent parses data):

    • Agent parses [target_folders] to extract folder types
    • Identifies: auth (code), api (code)
    • Stores result in [folder_types]

    Step 2 (CLI execution):

    • Agent substitutes [target_folders] into command
    • Agent executes CLI command via CCW:
    ccw cli -p "
    PURPOSE: Generate module documentation
    TASK: Create API.md and README.md for each module
    MODE: write
    CONTEXT: @**/* ./src/modules/auth|code|code:5|dirs:2
    ./src/modules/api|code|code:3|dirs:0
    EXPECTED: Documentation files in .workflow/docs/my_project/src/modules/
    CONSTRAINTS: Mirror source structure
    " --tool gemini --mode write --rule documentation-module --cd src/modules
    

Read the full file on GitHub · 334 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. 2d ago First seen · 334 lines · 140 tokens per session scan A 0573f8617854

Subscribe to this mod's changes

doc-generator is an agent published in the GitHub repository catlog22/Claude-Code-Workflow (2,135 stars, last pushed 2mo ago), licensed MIT. It adds 140 tokens to every session and 3,605 once invoked, about $0.0007 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-30.