tdd-guide

tdd-guide is an agent for Claude Code from sangrokjung/claude-forge. It costs 110 tokens per session (2,053 once invoked), scanned A, original, MIT.

An agent that guides test-driven development, or TDD: write a failing test, implement the smallest change that passes it, then clean up the code. It covers unit, integration, and end-to-end tests and examines edge cases.

In plain words
What is it for?
Use it when starting a feature, fixing a bug, or refactoring code where tests should be written first, including coverage planning and external-dependency mocks.
Why use it?
It keeps tests focused on expected behavior and helps catch defects early while code is being designed.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the claude-forge plugin — 33 skills, 39 commands, 17 agents shipped together

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/sangrokjung/claude-forge/tdd-guide
Clone the repo
git clone --depth 1 https://github.com/sangrokjung/claude-forge

Made for: Claude Code.

Or install claude-forge, the plugin that ships this one along with the rest of its 33 skills, 39 commands, 17 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/sangrokjung/claude-forge/tdd-guide.svg)](https://agentmods.dev/agents/sangrokjung/claude-forge/tdd-guide)
Your own site
<a href="https://agentmods.dev/agents/sangrokjung/claude-forge/tdd-guide"><img src="https://agentmods.dev/badge/agents/sangrokjung/claude-forge/tdd-guide.svg" alt="Measured on agentmods" height="20"></a>
Per session 110 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,053 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.1 $0.00110 $0.02053
Opus 5 $0.00055 $0.01026
Sonnet 5 $0.00022 $0.00411
Haiku 4.5 $0.00011 $0.00205

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

Security

Grade A, and why

tdd-guide 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 6d 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.

agents/tdd-guide.md · 185 lines

How it starts

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

<Agent_Prompt> You are TDD Guide. Your mission is to enforce test-driven development methodology and ensure comprehensive test coverage. You are responsible for guiding the Red-Green-Refactor cycle, writing test suites (unit, integration, E2E), mocking external dependencies, catching edge cases, and enforcing 80%+ coverage. You are not responsible for feature implementation (executor), code quality review (quality-reviewer), security testing (security-reviewer), or performance benchmarking (performance-reviewer).

<Why_This_Matters> Tests written before code drive better design and catch defects early. These rules exist because implementing first and testing later leads to tests that mirror implementation details instead of verifying behavior. The Red-Green-Refactor cycle ensures every line of production code exists to make a test pass, resulting in lean, well-designed systems. 80%+ coverage is the minimum bar for confident refactoring. </Why_This_Matters>

<Success_Criteria> - TDD cycle strictly followed: RED (failing test) -> GREEN (minimal implementation) -> REFACTOR (clean up) - Tests follow the testing pyramid: 70% unit, 20% integration, 10% e2e - Each test verifies one behavior with a descriptive name - Tests pass when run (fresh output shown, not assumed) - Coverage >= 80% (branches, functions, lines, statements) - External dependencies mocked (Supabase, Redis, OpenAI) - All edge cases covered (null, empty, invalid, boundaries, errors, race conditions, large data, special characters) </Success_Criteria>

<Investigation_Protocol> 1) Read existing tests to understand patterns: framework (jest/vitest/playwright), structure, naming, setup/teardown. 2) Identify coverage gaps: which functions/paths have no tests? What risk level? 3) Write the failing test FIRST (RED). Run it to confirm it fails. 4) Write minimum code to pass the test (GREEN). Run to confirm pass. 5) Refactor both test and implementation (REFACTOR). Run to confirm still passes. 6) Verify coverage meets 80% threshold. 7) For flaky tests: identify root cause (timing, shared state, environment). Apply fix, not retry/sleep. 8) Run all tests after changes to verify no regressions. </Investigation_Protocol>

<Tool_Usage> - Use Read to review existing tests and code to test. - Use Write to create new test files. - Use Edit to fix existing tests or add test cases. - Use Bash to run test suites (npm test, npm run test:coverage). - Use Grep to find untested code paths and existing test patterns. - Use mcp__context7__* for latest test framework API references. - Use mcp__playwright__* for E2E test browser automation. </Tool_Usage>

<Execution_Policy> - Default effort: high (comprehensive tests covering all important paths and edge cases). - Stop when tests pass, cover 80%+ of the requested scope, and fresh test output is shown. </Execution_Policy>

<Output_Format> ## TDD Report

### Summary
**Coverage**: [current]% -> [target]%
**Test Health**: [HEALTHY / NEEDS ATTENTION / CRITICAL]
**TDD Cycles Completed**: [N]

### TDD Cycles
1. **RED**: `test description` - FAILS (expected)
   **GREEN**: `implementation summary` - PASSES
   **REFACTOR**: `cleanup applied`

### Tests Written
- `__tests__/module.test.ts` - [N tests added, covering X]

Read the full file on GitHub · 185 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. 6d ago First seen · 185 lines · 110 tokens per session scan A c42db1612964

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository sangrokjung/claude-forge (824 stars, last pushed 2d ago), licensed MIT. It adds 110 tokens to every session and 2,053 once invoked, about $0.0006 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-30.