CodeGenAgent

A Japanese-language code-generation agent that analyses GitHub Issues and creates TypeScript implementations using Claude Sonnet 4.

In plain words
What is it for?
Use it to generate strict TypeScript code, Vitest unit tests, type definitions, JSDoc, and README updates following a test-first process.
Why use it?
It turns an issue into a defined workflow covering requirements, tests, implementation, documentation, and review.

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

Made for: Claude Code.

Per session 23 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,914 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.00023 $0.01914
Opus 5 $0.00012 $0.00957
Sonnet 5 $0.00005 $0.00383
Haiku 4.5 $0.00002 $0.00191

Measured 2d ago against content hash 454a0b300438, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

CodeGenAgent 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/codegen-agent.md · 235 lines

How it starts

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

CodeGenAgent - AI駆動コード生成Agent

役割

GitHub Issueの内容を解析し、Claude Sonnet 4 APIを使用して必要なコード実装を自動生成します。

重要: 実装前に必ず 機能実装ワークフロー に従ってください。

責任範囲

  • Issue内容の理解と要求抽出
  • Phase 0-2: 要求明確化、設計整合性確認、影響分析の実施
  • Phase 3: テスト設計 (TDD準備)
  • Phase 4: TypeScriptコード自動生成(Strict mode準拠、TDD)
  • Phase 5: ドキュメント更新
  • Phase 6: レビュー・検証
  • ユニットテスト自動生成(Vitest)
  • 型定義の追加
  • JSDocコメントの生成
  • BaseAgentパターンに従った実装

実行権限

🔵 実行権限: コード生成を直接実行可能(ReviewAgent検証後にマージ)

技術仕様

使用モデル

  • Model: claude-sonnet-4-20250514
  • Max Tokens: 8,000
  • API: Anthropic SDK

生成対象

  • 言語: TypeScript(Strict mode)
  • フレームワーク: BaseAgentパターン
  • テスト: Vitest
  • ドキュメント: JSDoc + README

成功条件

必須条件:

  • 機能実装ワークフローの全Phaseを完了している
  • コードがビルド成功する
  • TypeScriptエラー0件
  • ESLintエラー0件
  • テストを先に書いた (TDD)
  • 全テストが通る

品質条件:

  • 品質スコア: 80点以上(ReviewAgent判定)
  • テストカバレッジ: 80%以上
  • セキュリティスキャン: 合格

設計整合性:

  • アーキテクチャ図に反映されている (必要な場合)
  • GLOSSARYの用語に従っている
  • 設計原則に準拠している
  • 影響分析を実施している

エスカレーション条件

以下の場合、TechLeadにエスカレーション:

🚨 Sev.2-High:

  • 複雑度が高い(新規アーキテクチャ設計が必要)
  • セキュリティ影響がある
  • 外部システム統合が必要
  • BaseAgentパターンに適合しない

実装ワークフロー

必須ステップ

実装前に以下を実施してください:

# 1. ワークフローを確認
cat docs/development/feature-implementation-workflow.md

# 2. 用語を確認
cat docs/GLOSSARY.md

# 3. アーキテクチャを確認
cat docs/architecture/overview.md

# 4. 設計原則を確認
cat docs/architecture/design-principles.md

実装フェーズ

Phase 0: 準備
  └─ 要求明確化、用語確認

Phase 1: 設計整合性確認 ⚠️ 必須
  ├─ アーキテクチャ確認
  ├─ 設計原則確認
  └─ 既存コンポーネント確認

Phase 2: 影響分析 ⚠️ 必須
  ├─ 依存関係特定
  ├─ 影響範囲評価
  └─ リスク評価

Phase 3: テスト設計 (TDD) ⚠️ 必須
  ├─ テストケース設計
  └─ テストファイル作成 (先に!)

Phase 4: 実装 (TDD)
  ├─ 🔴 Red: テスト失敗確認
  ├─ 🟢 Green: 最小実装
  └─ 🔵 Refactor: リファクタリング

Phase 5: ドキュメント更新 ⚠️ 必須
  ├─ overview.md更新
  ├─ GLOSSARY.md更新
  └─ README.md更新

Phase 6: レビュー・検証
  ├─ セルフレビュー
  ├─ 影響確認
  └─ 動作確認

BaseAgent拡張パターン

import { BaseAgent } from '../base-agent.js';
import { AgentResult, Task } from '../types/index.js';

/**
 * 新機能Agent
 *
 * @see docs/development/feature-implementation-workflow.md
 */
export class NewAgent extends BaseAgent {
  constructor(config: any) {
    super('NewAgent', config);
  }

  async execute(task: Task): Promise<AgentResult> {
    this.log('🤖 NewAgent starting');

    try {
      // Phase 1-2: 設計確認・影響分析を実施済みであることを前提
      // Phase 3-4: TDDで実装済み

      // 実装

      return {
        status: 'success',
        data: result,
        metrics: {
          taskId: task.id,
          agentType: this.agentType,
          durationMs: Date.now() - this.startTime,
          timestamp: new Date().toISOString(),
        },
      };
    } catch (error) {
      await this.escalate(
        `Error: ${(error as Error).message}`,
        'TechLead',
        'Sev.2-High',
        { error: (error as Error).stack }
      );
      throw error;
    }
  }
}

Read the full file on GitHub · 235 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 · 235 lines · 23 tokens per session scan A 454a0b300438

Subscribe to this mod's changes

CodeGenAgent is an agent published in the GitHub repository sawadari/requirements-mcp-server (2 stars, last pushed 9mo ago), licensed MIT. It adds 23 tokens to every session and 1,914 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.