claude-config-studio: Command for Claude Code

.claude/commands/tdd.md

tdd is a command for Claude Code from znlnzi/claude-config-studio. It costs 14 tokens per session (318 once invoked), scanned A, original, MIT.

A command that enforces test-driven development, or TDD: write failing tests first, add the smallest code that passes them, then improve the code while keeping the tests passing.

In plain words
What is it for?
Use it for new functions, bug fixes, refactors, and important business logic, with coverage checks and stricter targets for authentication, payments, and security.
Why use it?
It makes expected behavior and edge cases explicit before implementation, helping catch regressions during new features, bug fixes, and refactoring.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is znlnzi/claude-config-studio's own configuration. It tells Claude Code how to work on claude-config-studio itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-config-studio configures →

Reuse

Borrowing it

Nothing to install: this file belongs to znlnzi/claude-config-studio. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/znlnzi/claude-config-studio/main/.claude/commands/tdd.md
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

README.md
[![agentmods](https://agentmods.dev/badge/commands/znlnzi/claude-config-studio/tdd.svg)](https://agentmods.dev/commands/znlnzi/claude-config-studio/tdd)
Your own site
<a href="https://agentmods.dev/commands/znlnzi/claude-config-studio/tdd"><img src="https://agentmods.dev/badge/commands/znlnzi/claude-config-studio/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 318 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.00014 $0.00318
Opus 5 $0.00007 $0.00159
Sonnet 5 $0.00003 $0.00064
Haiku 4.5 $0.00001 $0.00032

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

Security

Grade A, and why

tdd 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.

.claude/commands/tdd.md · 48 lines

What it actually says

/tdd - 测试驱动开发

强制执行 RED → GREEN → REFACTOR 循环。

工作流

1. 接口定义

  • 定义输入/输出类型
  • 明确函数签名
  • 确定边界条件

2. 编写测试 (RED)

在编写任何实现之前:

  • 编写覆盖正常路径的测试
  • 编写覆盖边缘情况的测试
  • 编写覆盖错误场景的测试
  • 运行测试,确认全部失败

3. 最小实现 (GREEN)

  • 编写满足测试的最小代码
  • 不要过度设计
  • 运行测试,确认全部通过

4. 重构 (REFACTOR)

  • 在测试保护下改善代码质量
  • 消除重复
  • 提升可读性
  • 运行测试,确认仍然通过

5. 覆盖率验证

  • 检查覆盖率是否达到 80%
  • 补充遗漏的测试场景

适用场景

  • 新功能和函数
  • Bug 修复(先写复现测试)
  • 重构工作
  • 关键业务逻辑

关键规则

测试必须在实现之前编写。 关键领域(认证、支付、安全)需要 100% 覆盖率。

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 · 48 lines · 14 tokens per session scan A 47b8a18dc641

Subscribe to this mod's changes

tdd is a command published in the GitHub repository znlnzi/claude-config-studio (0 stars, last pushed 6mo ago), licensed MIT. It adds 14 tokens to every session and 318 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.