generate-docs

generate-docs is a command for Claude Code from sawadari/requirements-mcp-server. It costs 9 tokens per session (3,442 once invoked), scanned C, original, MIT.

A command that creates project documentation from TypeScript code, including API reference pages, a README, architecture diagrams, and a changelog.

In plain words
What is it for?
Use it to generate API documentation, update README.md, create an architecture diagram, or produce a CHANGELOG.md.
Why use it?
It reduces the manual work of keeping technical documentation aligned with the code.

Command 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 commands/sawadari/requirements-mcp-server/generate-docs
Clone the repo
git clone --depth 1 https://github.com/sawadari/requirements-mcp-server

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/sawadari/requirements-mcp-server/generate-docs.svg)](https://agentmods.dev/commands/sawadari/requirements-mcp-server/generate-docs)
Your own site
<a href="https://agentmods.dev/commands/sawadari/requirements-mcp-server/generate-docs"><img src="https://agentmods.dev/badge/commands/sawadari/requirements-mcp-server/generate-docs.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 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,442 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.1 $0.00009 $0.03442
Opus 5 $0.00005 $0.01721
Sonnet 5 $0.00002 $0.00688
Haiku 4.5 $0.00001 $0.00344

Measured 5d ago against content hash c4653bff78a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade C, and why

generate-docs scanned grade C 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 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf node_modules/.cache
.claude/commands/generate-docs.md · 632 lines

How it starts

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

Generate Docs Command

TypeScriptコードからAPIドキュメント、README、アーキテクチャ図を自動生成します。

使用方法

/generate-docs [type]

パラメータ

  • type (オプション): 生成するドキュメントタイプ
    • all (デフォルト): すべてのドキュメント生成
    • api: API リファレンス (TypeDoc)
    • readme: README.md 更新
    • architecture: アーキテクチャ図生成
    • changelog: CHANGELOG.md 生成

実行内容

1. API リファレンス生成 (TypeDoc)

npx typedoc --out docs/api src/

生成されるドキュメント:

docs/api/
├── index.html              # エントリーポイント
├── classes/
│   ├── BaseAgent.html
│   ├── CoordinatorAgent.html
│   └── CodeGenAgent.html
├── interfaces/
│   ├── Task.html
│   ├── AgentResult.html
│   └── QualityReport.html
├── modules/
│   └── types.html
└── assets/
    ├── style.css
    └── search.js

アクセス: open docs/api/index.html

2. README.md 自動更新

コードベースを分析し、README.mdを更新:

# Project Name

## 📊 Project Stats

- **Total Files**: 234
- **Lines of Code**: 12,450
- **Test Coverage**: 85%
- **TypeScript**: 100%
- **Dependencies**: 258

## 🏗️ Architecture

<architecture-diagram>

## 📦 Modules

### Core Agents (agents/)

#### CoordinatorAgent
Orchestrates task decomposition and agent assignment.

**Methods**:
- `decomposeIssue(issue: Issue): Promise<TaskDecomposition>`
- `buildDAG(tasks: Task[]): Promise<DAG>`
- `assignAgent(task: Task): Promise<AgentType>`

**Dependencies**:
- Octokit (GitHub API)
- Anthropic SDK

#### CodeGenAgent
Generates code using Claude Sonnet 4.

**Methods**:
- `execute(task: Task): Promise<AgentResult>`
- `generateCode(spec: CodeSpec): Promise<GeneratedCode>`

...

## 📚 API Documentation

Full API documentation: [docs/api/](./docs/api/index.html)

## 🧪 Testing

```bash
npm test              # Run tests
npm run test:coverage # With coverage

📝 Contributing

See CONTRIBUTING.md


### 3. アーキテクチャ図生成

Mermaid記法でアーキテクチャ図を生成:

#### システム構成図

```mermaid
graph TB
    subgraph "User Layer"
        U[Human Developer]
    end

    subgraph "Coordinator Layer"
        C[CoordinatorAgent]
    end

    subgraph "Specialist Layer"
        CG[CodeGenAgent]
        R[ReviewAgent]
        I[IssueAgent]
        P[PRAgent]
        D[DeploymentAgent]
    end

    subgraph "External Services"
        GH[GitHub]
        AN[Anthropic API]
        FB[Firebase]
    end

    U -->|Issue| GH
    GH -->|Webhook| C
    C -->|Decompose| CG
    C -->|Assign| R
    C -->|Assign| I
    C -->|Assign| P
    C -->|Assign| D
    CG -->|Generate| AN
    D -->|Deploy| FB
    P -->|Create PR| GH

Read the full file on GitHub · 632 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. 5d ago First seen · 632 lines · 9 tokens per session scan C c4653bff78a4

Subscribe to this mod's changes

generate-docs is a command published in the GitHub repository sawadari/requirements-mcp-server (2 stars, last pushed 10mo ago), licensed MIT. It adds 9 tokens to every session and 3,442 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.