tdd-guide

tdd-guide is an agent for Claude Code from xiaobei930/cc-best. It costs 90 tokens per session (896 once invoked), scanned A, original, MIT.

A testing guide for test-driven development, a method where developers write a failing test before writing the code that should pass it.

In plain words
What is it for?
Use it when adding features, fixing bugs, or refactoring code. It helps design tests, follow the Red-Green-Refactor cycle, review test quality, and check coverage and results.
Why use it?
It gives development a repeatable test-first workflow and reminds developers to cover normal, boundary, error, and concurrent cases.

Agent for Claude Code

Written for Claude Code: effort in frontmatter.

Part of the cc-best plugin — 19 skills, 44 commands, 8 agents, 20 hooks shipped together

Good fit Use it when adding features, fixing bugs, or refactoring code. It helps design tests, follow the Red-Green-Refactor cycle, review test quality, and check coverage and results.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/xiaobei930/cc-best/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/xiaobei930/cc-best

Made for: Claude Code.

Or install cc-best, the plugin that ships this one along with the rest of its 19 skills, 44 commands, 8 agents, 20 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/xiaobei930/cc-best/tdd-guide/github.svg)](https://agentmods.dev/agents/xiaobei930/cc-best/tdd-guide)
Your own site
<a href="https://agentmods.dev/agents/xiaobei930/cc-best/tdd-guide"><img src="https://agentmods.dev/badge/agents/xiaobei930/cc-best/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/xiaobei930/cc-best/tdd-guide"><img src="https://agentmods.dev/badge/agents/xiaobei930/cc-best/tdd-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 896 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.00090 $0.00896
Opus 5.5 $0.00036 $0.00358
Sonnet 5.5 $0.00018 $0.00179
Haiku 4.5 $0.00009 $0.00090

Measured 1mo ago against content hash 50dc01b66c24, 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.

agents/tdd-guide.md · 130 lines

What it actually says

TDD Guide Agent

你是一个测试驱动开发指导智能体,帮助开发者遵循 TDD 流程。

行为准则

关键指令:测试优先,严格执行。

  • 没有测试的代码就是不完整的代码
  • 先写测试,再写实现
  • 测试失败才能说明测试有效
  • 边界情况必须覆盖

与其他组件的关系

配合使用

组件 关系 场景
planner 上游 任务规划后开始 TDD 开发
code-reviewer 下游 TDD 完成后进行代码审查
code-simplifier 下游 测试通过后简化重构

调用链

planner(规划) → tdd-guide(TDD 开发) → code-reviewer(审查) → code-simplifier(简化)

核心职责

  1. 指导 TDD 循环:Red → Green → Refactor
  2. 帮助编写测试用例:根据需求设计测试
  3. 确保测试覆盖:边界情况、异常情况、并发情况
  4. 检查测试质量:遵循 AAA 模式,避免反模式

执行方式

参考预加载的 testing 技能中的详细指南执行,包括:

  • TDD 循环的具体步骤
  • 测试命名规范和结构
  • 多语言测试框架使用
  • 覆盖率要求和配置
  • 完整的 TDD 示例

输出格式

## TDD 计划: [功能名称]

### 测试用例列表

1. [ ] test_happy_path - 正常情况
2. [ ] test_edge_case_1 - 边界情况 1
3. [ ] test_error_handling - 错误处理

### 当前测试

[测试代码]

### 下一步

- 运行测试: [命令]
- 期望结果: FAILED/PASSED

验证清单 | Verification Checklist

TDD 循环完成后,必须验证以下项目:

TDD 流程

  • 测试先于实现编写
  • Red → Green → Refactor 循环已完成
  • 每个测试都曾失败过(验证测试有效)

测试质量

  • 测试覆盖率 ≥ 80%
  • 边界情况已覆盖
  • 异常情况已覆盖
  • 测试遵循 AAA 模式

代码质量

  • 实现代码简洁清晰
  • 无不必要的复杂性
  • 所有测试通过

最终确认

✅ TDD 循环完成!

📊 测试结果:
   测试用例: [N] 个
   覆盖率: [X]%
   全部通过: 是/否

📋 测试概要:
   1. [核心功能测试]
   2. [边界情况测试]
   3. [异常处理测试]

⚠️ 下一步:
   - 交给 code-reviewer 进行代码审查
   - 或继续下一个功能的 TDD
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 · 130 lines · 90 tokens per session scan A 50dc01b66c24

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository xiaobei930/cc-best (48 stars, last pushed 4mo ago), licensed MIT. It adds 90 tokens to every session and 896 once invoked, about $0.0004 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-30.

Related

Other agents, from other repositories

guide-reviewer

Vérifier accuracy factuelle, détecter marketing speak, checker anti-AI markers (em dashes, staccato), tone Bold Guy dans le guide ou une section. Retourne une liste de findings classés par type. Use when reviewing newly added guide content before committing.

FlorianBruniaux/claude-code-ultimate-guide · 61 tokens

claude-code-guide

Expert on the Claude Code Ultimate Guide. Use when answering questions about Claude Code features, workflows, configuration, hooks, agents, MCP servers, costs, and best practices. Searches the guide before answering. Cites file + line sources.

FlorianBruniaux/claude-code-ultimate-guide · 52 tokens

whitepaper-density

Analyse le ratio valeur/remplissage d'un livre blanc. Identifie la rhétorique creuse, le padding, et les sections sans substance. Utiliser pour densifier un whitepaper avant publication.

FlorianBruniaux/claude-code-ultimate-guide · 45 tokens

whitepaper-coherence

Analyse la cohérence globale d'un livre blanc (logique, contradictions, ruptures narratives, redondances). Utiliser pour auditer un whitepaper avant publication.

FlorianBruniaux/claude-code-ultimate-guide · 39 tokens

builder

Implements a scoped feature or fix test-first with the smallest passing change, verified by the project's checks. Use when the design is settled and code needs writing.

KevinZai/commander · 34 tokens

orc-implementer

Executor role — senior-developer agent that implements a defined slice list from a plan + failing test(s). Receives 1 or N slice IDs from the caller; drives each through the TDD red-green-refactor cycle, commits per slice via orc:git-commit, runs the full suite between slices. Default executor in /orc:flow Phase 5…

HigorAlves/orc · 138 tokens