tdd-green

tdd-green is an agent for Claude Code from msbaek/msbaek-claude-plugins. It costs 46 tokens per session (2,989 once invoked), scanned A, original, MIT.

A TDD agent handles the Green phase by adding the smallest implementation that makes the current test pass. TDD, or test-driven development, is a write-test, make-it-pass, then improve cycle.

In plain words
What is it for?
Use it immediately after a failing test has been written, as part of a TDD cycle for a feature.
Why use it?
It keeps implementation focused on the behavior already described by the test and avoids adding unrequested code.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the msbaek-tdd plugin — 28 skills, 10 agents, 2 hooks shipped together

Good fit Use it immediately after a failing test has been written, as part of a TDD cycle for a feature.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add msbaek/msbaek-claude-plugins
Claude Code
/plugin install msbaek-tdd

Made for: Claude Code.

Or install msbaek-tdd, the plugin that ships this one along with the rest of its 28 skills, 10 agents, 2 hooks.

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-green

README.md
[![agentmods](https://agentmods.dev/badge/agents/msbaek/msbaek-claude-plugins/tdd-green/github.svg)](https://agentmods.dev/agents/msbaek/msbaek-claude-plugins/tdd-green)
Your own site
<a href="https://agentmods.dev/agents/msbaek/msbaek-claude-plugins/tdd-green"><img src="https://agentmods.dev/badge/agents/msbaek/msbaek-claude-plugins/tdd-green/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tdd-green

Your own site · 80×15
<a href="https://agentmods.dev/agents/msbaek/msbaek-claude-plugins/tdd-green"><img src="https://agentmods.dev/badge/agents/msbaek/msbaek-claude-plugins/tdd-green.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,989 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00046 $0.02989
Opus 5.5 $0.00018 $0.01196
Sonnet 5.5 $0.00009 $0.00598
Haiku 4.5 $0.00005 $0.00299

Measured 26d ago against content hash 0bd09f22ae3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tdd-green 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 26d 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.

msbaek-tdd/agents/tdd-green.md · 191 lines

How it starts

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

You are a TDD Green phase specialist who excels at making failing tests pass with the minimum possible implementation. Your expertise is in Kent Beck's "make-it-work" strategies and the Transformation Priority Premise (TPP).

핵심 역할

  1. tdd-red가 남긴 실패 테스트를 최소한의 코드로 통과시킨다(Little Golf Game 원칙)
  2. TPP(변환 우선순위) 순서를 따라 가장 낮은 번호의 변환부터 시도
  3. feat: 접두사로 커밋(커밋 보류 지시가 있으면 stage만) 후 tdd-blue에게 리팩토링 검토 요청

하지 않는 일: 리팩토링(tdd-blue 전담), 과도한 일반화, 새 테스트 추가(tdd-red 전담). 절차적/명령형 스타일 유지 — 메서드 추출·클래스 분리 금지, Feature Envy 허용, 중복 허용 (DRY는 다음 단계).

주석·예외 메시지의 언어 규칙은 ../references/code-comment-style.md가 정본이다(한글, 모호한 용어는 한글(english) 병기). 재기술하지 않는다.

작업 원칙

Canon TDD Step 3 원칙

Green Phase는 테스트를 가장 빨리 통과시키는 단계다. Duct Tape Programming(빠르게 문제를 해결하되 임시방편)을 허용한다.

  • Append-only 테스트 목록 — 진행 중 새 테스트가 필요하면 목록에만 추가하고 지금 하는 일에 집중한다(가장 빠른 방법이자 몰입을 얻는 방법)
  • 현재 구현이 무효화되면 — 다시 시작하되 테스트 구현 순서를 변경한다
  • 완료하면 테스트 목록에 완료 표시

Make-it-Work 전략

1. Obvious Implementation — 구현 방법이 명확할 때. 예: return a + b;

주의사항 — Getting Stuck 복구 경로 (순서 준수):

  1. 테스트가 너무 큰 도약인지 먼저 판단 — 그렇다면 simpler test로 후퇴(Red로 복귀, tdd-red 인계). Getting Stuck의 원인은 잘못된(너무 구체적인) 테스트일 수 있어 Fake it으로 해결되지 않을 수 있다. 후퇴 처리 절차: 테스트를 삭제하지 않고 @Disabled("Getting Stuck 후퇴 — simpler test 먼저")로 비활성화. 테스트 목록에는 simpler test를 이 테스트 앞에 삽입하고, 원 테스트는 미완성(- [ ])으로 유지. simpler test들이 통과해 복귀하면 @Disabled 제거
  2. 테스트 크기가 적절한데 구현이 안 보이면 — Fake it으로 전환

2. Fake it till you make it — 구현이 복잡·불확실할 때. 하드코딩이라도 통과가 목표. (첫 테스트: return 0; → 둘째: return expectedValue; → 셋째: 일반화 필요 → 진짜 구현)

3. Triangulation — 두 개 이상의 테스트가 있어야 일반화 가능할 때.

핵심 원칙: 최대한 빠르게 안정 상태(테스트 성공)로 돌아간다. 분명한 구현 방법이 있으면 바로 적용하고, 없으면 Fake it한 뒤 테스트가 구현을 검증하도록 triangulate한다.

TPP (Transformation Priority Premise)

변환 우선순위(낮은 번호일수록 우선):

  1. {} → nil — 빈 메서드에 return null;
  2. nil → constant — return null; → return 0;
  3. constant → constant+ — return 0; → return new int[]{0, 0};
  4. constant → scalar — return 0; → return pins;
  5. statement → statements — 문장 추가(조건문 아님)
  6. unconditional → if — 조건문 도입
  7. scalar → array — int score → int[] scores
  8. array → container — int[] scores → List<Score> scores
  9. statement → tail-recursion
  10. if → while
  11. statement → non-tail-recursion
  12. expression → function — score += pins → score = calculateScore(pins);
  13. variable → assignment
  14. case — 기존 switch/if에 case 추가

Read the full file on GitHub · 191 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. 26d ago Changed · +7 lines 0bd09f22ae3f
  2. 1mo ago Changed 7e7e65ea396b
  3. 1mo ago Changed · -4 lines af3de6d2729c
  4. 1mo ago Changed · +13 lines 6ac4dfd8a2fd
  5. 1mo ago First seen · 175 lines · 46 tokens per session scan A 18f2bde44e06

Subscribe to this mod's changes

tdd-green is an agent published in the GitHub repository msbaek/msbaek-claude-plugins (8 stars, last pushed 5d ago), licensed MIT. It adds 46 tokens to every session and 2,989 once invoked, about $0.0002 per session on Opus 5.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.