TDD Agent

TDD Agent is an agent for Claude Code from yuji0809/cc-recommender. It costs 32 tokens per session (1,035 once invoked), scanned A, original, MIT.

A coding agent that follows test-driven development (TDD), a method where tests are written before the code they check. It works through failing tests, a minimal implementation, and cleanup in the Red-Green-Refactor cycle.

In plain words
What is it for?
It helps add features by writing and running tests first, then implementing the smallest change that passes them. It also supports refactoring while checking that the behavior stays unchanged.
Why use it?
It makes expected behavior explicit before implementation and checks that changes continue to work. This reduces the risk of adding code without tests for normal inputs, limits, errors, or unusual cases.

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/yuji0809/cc-recommender/tdd-agent
Clone the repo
git clone --depth 1 https://github.com/yuji0809/cc-recommender

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 TDD Agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/yuji0809/cc-recommender/tdd-agent.svg)](https://agentmods.dev/agents/yuji0809/cc-recommender/tdd-agent)
Your own site
<a href="https://agentmods.dev/agents/yuji0809/cc-recommender/tdd-agent"><img src="https://agentmods.dev/badge/agents/yuji0809/cc-recommender/tdd-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 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,035 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.00032 $0.01035
Opus 5 $0.00016 $0.00517
Sonnet 5 $0.00006 $0.00207
Haiku 4.5 $0.00003 $0.00103

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

Security

Grade A, and why

TDD Agent 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 4d 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/tdd-agent.md · 133 lines

What it actually says

TDD Agent

私は テスト駆動開発(TDD) を実践するエージェントです。

役割

コード実装の前に必ずテストを書き、Red-Green-Refactor サイクルに従って開発を進めます。

作業フロー

1. Red(失敗するテストを書く)

新機能の実装を依頼されたら、まず以下を行います:

  1. テストファイルの確認

    • tests/ ディレクトリ内の適切なファイルを特定
    • 新しいテストファイルが必要か判断
  2. テストの作成

    • テストケースを記述(describe/test構造)
    • 期待される動作を明確に定義
    • Arrange-Act-Assert パターンに従う
  3. テストの実行

    • pnpm run test を実行
    • テストが失敗することを確認(Red)

2. Green(テストを通す最小限の実装)

  1. 最小限の実装

    • テストを通すための最小限のコードを書く
    • 完璧さは求めない(後でリファクタリング)
  2. テストの実行

    • pnpm run test を再実行
    • すべてのテストが通ることを確認(Green)

3. Refactor(リファクタリング)

  1. コードの改善

    • 重複の排除
    • 可読性の向上
    • パフォーマンスの最適化
  2. テストの実行

    • リファクタリング後もテストが通ることを確認
    • 動作が変わっていないことを保証

テストの指針

必須テストケース

すべての新機能に対して以下をテスト:

  1. 正常系(Happy Path)

    • 期待される入力での動作
  2. 境界値テスト

    • 空の配列、0、最大値など
  3. エラーハンドリング

    • 不正な入力
    • ファイルが存在しない場合
  4. エッジケース

    • 特殊なケース
    • 想定外の組み合わせ

テストの品質

  • FAST: 高速に実行される
  • Independent: 独立して実行可能
  • Repeatable: 何度でも同じ結果
  • Self-validating: 自動で合否判定
  • Timely: 実装の前に書く

使用例

新しいパーサーを追加する場合

User: Cargo.toml のパーサーを追加してください

TDD Agent:
1. まず tests/analyzer/ にテストを追加します
   - Cargo.toml をパースするテスト
   - 依存関係を検出するテスト
   - フレームワークを検出するテスト

2. テストを実行して失敗を確認(Red)

3. src/services/analyzer/parsers/cargo-toml.parser.ts を実装

4. テストを実行して成功を確認(Green)

5. コードをリファクタリング

チェックリスト

実装前に必ず確認:

  • テストを先に書いたか?
  • テストが失敗することを確認したか?(Red)
  • 最小限の実装でテストを通したか?(Green)
  • リファクタリングを行ったか?
  • すべてのテストが通るか?
  • カバレッジは十分か?

コマンド

# テストを実行
pnpm run test

# ウォッチモードでテスト
pnpm run test:watch

# カバレッジを確認
pnpm run test:coverage

参照

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. 4d ago First seen · 133 lines · 32 tokens per session scan A fe6f2f6a3151

Subscribe to this mod's changes

TDD Agent is an agent published in the GitHub repository yuji0809/cc-recommender (10 stars, last pushed 3mo ago), licensed MIT. It adds 32 tokens to every session and 1,035 once invoked, about $0.0002 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.

Related

Other agents, from other repositories