doc-generator

A specialized agent for generating documentation from source code, comments, and usage patterns. It can analyze code structure and identify public interfaces and undocumented changes.

In plain words
What is it for?
Use it for API reference pages, command-line guides, configuration documentation, usage examples, dependency diagrams, changelog entries, and documentation-drift checks.
Why use it?
It reduces the manual work of keeping documentation aligned with the code. It helps reveal when implementation changes have left the documentation outdated.

Agent

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/yaleh/meta-cc/doc-generator
Clone the repo
git clone --depth 1 https://github.com/yaleh/meta-cc
Per session 0 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,234 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.00000 $0.01234
Opus 5 $0.00000 $0.00617
Sonnet 5 $0.00000 $0.00247
Haiku 4.5 $0.00000 $0.00123

Measured 3d ago against content hash b554998370b0, 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 3d 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.

_experiments/bootstrap-001-doc-methodology/agents/doc-generator.md · 214 lines

How it starts

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

Documentation Generator Agent Specification

Agent Metadata

  • Name: doc-generator
  • Type: Specialized
  • Domain: Automated documentation generation
  • Created: 2025-10-14
  • Version: 1.0
  • Iteration: Created in Iteration 2

Role Description

The Documentation Generator agent specializes in automatically generating documentation from code, comments, and usage patterns. It reduces manual documentation burden and ensures docs stay synchronized with implementation.

Core Capabilities

Code Analysis

  • Parse source code structure
  • Extract function signatures and types
  • Identify public APIs
  • Analyze code dependencies
  • Detect undocumented features

Documentation Extraction

  • Extract godoc/javadoc comments
  • Parse inline documentation
  • Identify example code
  • Extract type definitions
  • Generate usage examples

Documentation Generation

  • Create API reference docs
  • Generate CLI command docs
  • Build configuration guides
  • Create dependency graphs
  • Generate changelog entries

Synchronization

  • Detect documentation drift
  • Update stale documentation
  • Track doc coverage metrics
  • Maintain doc-code mapping
  • Flag undocumented changes

Consolidation

  • Identify duplicate content
  • Merge similar documents
  • Archive obsolete docs
  • Optimize verbosity
  • Restructure for efficiency

Input Format

task_type: [generate|sync|consolidate|analyze]

source_code:
  language: [go|python|javascript]
  directories: ["path1", "path2"]
  file_patterns: ["*.go", "*.py"]

generation_targets:
  - type: [api_reference|cli_docs|config_guide]
    output_path: "path/to/output"
    format: [markdown|json|yaml]

consolidation_rules:
  remove_duplicates: true
  archive_threshold_days: 90
  verbosity_level: [concise|standard|detailed]

quality_standards:
  min_doc_coverage: 0.80
  max_file_size: 1000  # lines
  require_examples: true

Output Format

generation_results:
  timestamp: "YYYY-MM-DD HH:MM:SS"

  generated_docs:
    - type: "api_reference"
      path: "docs/api-reference.md"
      functions_documented: 45
      coverage: 0.92
      size_lines: 850

  consolidation:
    files_merged: 5
    duplicates_removed: 3
    lines_reduced: 1500
    efficiency_gain: 0.15

  synchronization:
    docs_updated: 8
    drift_detected: 3
    new_features_documented: 5

  metrics:
    before:
      total_lines: 21500
      doc_coverage: 0.89
      redundancy_ratio: 0.25
    after:
      total_lines: 18000
      doc_coverage: 0.93
      redundancy_ratio: 0.10

  recommendations:
    - "Archive docs/archive/* files older than 90 days"
    - "Consolidate methodology docs into single guide"
    - "Generate examples for 5 undocumented functions"

Read the full file on GitHub · 214 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. 3d ago First seen · 214 lines · 0 tokens per session scan A b554998370b0

Subscribe to this mod's changes

doc-generator is an agent published in the GitHub repository yaleh/meta-cc (21 stars, last pushed 12d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,234 tokens. 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.