tdd-guide

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

A test-driven development (TDD) guide that coaches the cycle of writing a failing test, writing the smallest code that passes it, and then improving the code. It also guides test design, checks for TDD violations, and monitors coverage.

In plain words
What is it for?
Use it when implementing a feature or fixing a bug to design tests, follow the test-first cycle, review TDD practice, and track test coverage.
Why use it?
It gives a structured way to add or fix code while tests define the expected behaviour first. This helps catch cases where implementation proceeds without the intended tests.

Agent for Claude Code

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

Part of the pdforge plugin — 10 skills, 13 commands, 5 agents, 2 hooks shipped together

Good fit Use it when implementing a feature or fixing a bug to design tests, follow the test-first cycle, review TDD practice, and track test coverage.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/xrensiu/claude-code-forge/tdd-guide
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.

Clone the repo
git clone --depth 1 https://github.com/XRenSiu/claude-code-forge

Made for: Claude Code.

Or install pdforge, the plugin that ships this one along with the rest of its 10 skills, 13 commands, 5 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-guide

README.md
[![agentmods](https://agentmods.dev/badge/agents/xrensiu/claude-code-forge/tdd-guide/github.svg)](https://agentmods.dev/agents/xrensiu/claude-code-forge/tdd-guide)
Your own site
<a href="https://agentmods.dev/agents/xrensiu/claude-code-forge/tdd-guide"><img src="https://agentmods.dev/badge/agents/xrensiu/claude-code-forge/tdd-guide/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-guide

Your own site · 80×15
<a href="https://agentmods.dev/agents/xrensiu/claude-code-forge/tdd-guide"><img src="https://agentmods.dev/badge/agents/xrensiu/claude-code-forge/tdd-guide.svg" alt="Reviewed on agentmods" width="80" 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 2,264 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.00032 $0.02264
Opus 5.5 $0.00013 $0.00906
Sonnet 5.5 $0.00006 $0.00453
Haiku 4.5 $0.00003 $0.00226

Measured 1mo ago against content hash 0ace978220eb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

plugins/pdforge/agents/tdd-guide.md · 266 lines

How it starts

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

TDD Guide Agent

来源: PDForge 角色: TDD 教练 - 指导开发者遵循测试驱动开发最佳实践

You are a TDD methodology expert. You guide implementation with strict test-first discipline, ensuring code quality through comprehensive test coverage. You celebrate passing tests and catch TDD violations immediately.

Core Responsibilities

  1. 强制 TDD 流程 - RED-GREEN-REFACTOR 循环
  2. 覆盖率监控 - 确保 80%+ 覆盖率
  3. 测试设计指导 - 帮助设计有效的测试
  4. 违规检测 - 发现并纠正 TDD 违规

When to Use

Mandatory TDD Cycle

┌─────────────────────────────────────────────────────────────┐
│                    TDD 循环(不可跳过)                       │
│                                                             │
│    ┌─────────┐     ┌─────────┐     ┌─────────────┐         │
│    │  🔴 RED  │ ──▶ │ 🟢 GREEN│ ──▶ │ ♻️ REFACTOR │         │
│    │ 写失败  │     │ 写最小  │     │   改进代码   │         │
│    │  测试   │     │  代码   │     │  保持绿色   │         │
│    └─────────┘     └─────────┘     └──────┬──────┘         │
│         ▲                                  │                │
│         └──────────────────────────────────┘                │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Coverage Requirements

1→100 产品(生产级)

coverage:
  statements: 80%    # 硬性要求
  branches: 75%      # 分支覆盖
  functions: 80%     # 函数覆盖
  lines: 80%         # 行覆盖

0→1 产品(MVP)

coverage:
  statements: 50%    # 核心路径
  branches: 40%      # 主要分支
  functions: 50%     # 关键函数
  lines: 50%         # 主要代码

Detection Commands

Read the full file on GitHub · 266 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. 1mo ago First seen · 266 lines · 32 tokens per session scan A 0ace978220eb

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository XRenSiu/claude-code-forge (2 stars, last pushed 29d ago), licensed MIT. It adds 32 tokens to every session and 2,264 once invoked, about $0.0001 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-09-05.