Skip to content

Test-driven development workflow that enforces red-green-refactor cycles through public-interface tests and vertical slices.

CCM score
56 of 100
skills.sh installs
6.3K
GitHub stars
6.2K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers writing good tests against public seams, with confirmed seams agreed with the user before any test is written
  • Includes reference files tests.md and mocking.md, plus guidance to consult GLOSSARY.md and relevant ADRs when present
  • Flags anti-patterns such as implementation-coupled, tautological, and horizontal-slice tests, requiring vertical tracer-bullet slices instead
  • Designed for feature work, bug fixes, and integration testing where the user asks for red-green-refactor

Install

$ npx -y skills add vinvcn/mattpocock-skills-zh-cn --skill tdd -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

测试驱动开发

TDD 是 red -> green loop。这个 skill 是让该 loop 产出值得保留的 tests 的 reference:什么是好 test、tests 应该放在哪里、anti-patterns,以及 loop 的规则。每个 cycle 前和 cycle 中都要参考这些内容,而不是事后才看。

探索 codebase 时,读取 GLOSSARY.md(如果存在),让 test names 和 interface vocabulary 与项目 domain language 对齐,并尊重你触碰区域的 ADRs。

什么是好 test

Tests 应通过 public interfaces 验证 behavior,而不是 implementation details。代码可以完全改变;tests 不该随之改变。一个好 test 读起来像 specification:"user can checkout with valid cart" 能清楚说明存在什么能力;因为它不关心 internal structure,所以能承受 refactors。

示例见 tests.md,mocking 规则见 mocking.md。

Seams:tests 放在哪里

Seam 是你测试的 public boundary:可以观察 behavior、但不伸手进入内部的 interface。Tests 放在 seams 上,绝不针对 internals。

只测试预先认可的 seams。 写任何 test 前,先写下要测试的 seams 并与用户确认。未经确认的 seam 不写 test。你无法测试所有东西;提前认可 seams,才能把测试精力放在 critical paths 和复杂 logic 上,而不是每个 edge case。

询问:"What's the public interface, and which seams should we test?" 给每个提议的 seam 加一行说明:它能捕获什么,又会漏掉什么。

当 interface 的形状本身就是问题所在时(module 该多深、seam 该放在哪里、interface 应该暴露什么),调用 Skill 工具并指定 codebase-design 获取词汇。它是 module、interface、depth、seam、adapter、leverage 和 locality 这些术语的共享来源,是供查阅的 reference,而不是要运行的 session。

反模式

Details

Repository
github.com/vinvcn/mattpocock-skills-zh-cn
Category
Testing & QA
First seen
Jun 3, 2026

Questions

What does the tdd skill do for an agent?

The tdd skill guides an agent through test-driven development with a red-green loop: it writes a failing test first, then only enough code to make it pass. It also sets rules for what counts as a good test, where tests belong, and common anti-patterns to avoid.

When should I use the tdd skill?

Use the tdd skill when you want to build a feature or fix a bug by writing tests first, when you mention red-green-refactor, or when you need integration tests. The tdd skill keeps each cycle to one seam, one test and one minimal implementation.

How do I install the tdd skill?

Run npx -y skills add vinvcn/mattpocock-skills-zh-cn --skill tdd -y in your project to install it. After that, the tdd skill is available to your agent in that project.

Where does the tdd skill rank in its category?

The tdd skill is in the Testing and QA category and ranks in the top 100 there. Its neighbors in that category include test-driven-development, webapp-testing and break-ui.

More from vinvcn/mattpocock-skills-zh-cn

All 24

Similar to Tdd

More Testing & QA