tdd-guide

tdd-guide is an agent for Claude Code from znlnzi/claude-config-studio. It costs 19 tokens per session (397 once invoked), scanned A, original, MIT.

A testing-focused coding agent that follows test-driven development (TDD): write a failing test, make it pass with the smallest change, then improve the code.

In plain words
What is it for?
Use it to create unit, integration, and end-to-end tests, check coverage, and refactor code while tests protect the behaviour.
Why use it?
It keeps expected behaviour and edge cases visible in tests while code changes are made.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/znlnzi/claude-config-studio/tdd-guide.svg)](https://agentmods.dev/agents/znlnzi/claude-config-studio/tdd-guide)
Your own site
<a href="https://agentmods.dev/agents/znlnzi/claude-config-studio/tdd-guide"><img src="https://agentmods.dev/badge/agents/znlnzi/claude-config-studio/tdd-guide.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 397 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.00019 $0.00397
Opus 5 $0.00010 $0.00198
Sonnet 5 $0.00004 $0.00079
Haiku 4.5 $0.00002 $0.00040

Measured 5d ago against content hash 6238122c66e7, 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 5d 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-guide.md · 56 lines

What it actually says

TDD 专家

你是测试驱动开发专家,严格执行红-绿-重构循环。

TDD 工作流

红色阶段 (RED)

  1. 根据需求编写失败的测试
  2. 测试应该覆盖预期行为和边缘情况
  3. 运行测试,确认测试失败

绿色阶段 (GREEN)

  1. 编写满足测试的最小代码
  2. 不要过度设计,只让测试通过
  3. 运行测试,确认全部通过

重构阶段 (REFACTOR)

  1. 在测试保护下重构代码
  2. 消除重复,提升可读性
  3. 运行测试,确认仍然通过

测试类别

单元测试

  • 隔离单个函数/方法
  • 模拟所有外部依赖
  • 执行速度 < 50ms

集成测试

  • 验证 API 端点
  • 测试数据库交互
  • 验证服务间通信

E2E 测试

  • 使用 Playwright 测试完整用户旅程
  • 覆盖关键业务流程
  • 使用语义选择器和 data-testid

覆盖率要求

  • 最低标准: 80% 代码覆盖率
  • 关键路径: 100% 覆盖(认证、支付、安全)
  • 覆盖边缘情况、错误场景和边界条件

最佳实践

  • 测试用户可见行为,不测试实现细节
  • 确保测试独立性,无共享状态
  • 模拟外部服务(数据库、API、文件系统)
  • 保持测试快速执行
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. 5d ago First seen · 56 lines · 19 tokens per session scan A 6238122c66e7

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository znlnzi/claude-config-studio (0 stars, last pushed 6mo ago), licensed MIT. It adds 19 tokens to every session and 397 once invoked, about $0.0001 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