tdd
Test-driven development. Invoke only when the user asks to build a feature or fix a bug test-first, requests a red-green-refactor loop, or requests integration tests.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- tdd
- description
- Test-driven development. Invoke only when the user asks to build a feature or fix a bug test-first, requests a red-green-refactor loop, or requests integration tests.
02 资源文件 2
- 参考文档mocking.md1.3 KB
- 参考文档tests.md1.8 KB
03 SKILL.md 正文
Test-Driven Development
TDD is the loop from red to green. Every section below applies on every
cycle: consult it before and during the loop, not after.
When exploring the codebase, follow domain-docs.md to find the glossary and architectural decision records. Use them to keep test names and interface vocabulary aligned with the project's domain language.
Required test properties
Keep tests that meet all three requirements:
- Verify behaviour through a public interface, not an internal detail.
- Read as a specification of one capability.
- Survive a refactor that does not change behaviour.
See tests.md for examples and mocking.md for mocking rules.
Seams
A seam is a public boundary where behaviour is observable without reaching inside.
- Before writing any test, write down the seams under test and confirm them with the user. For each proposed seam, write one line naming what it catches and what it misses.
- Write no test at an unconfirmed seam.
- When the interface shape is itself in question, load
../codebase-design/SKILL.mdfor the module, interface, depth, seam, and adapter vocabulary.
Prohibited test properties
Avoid these test patterns:
- Mock an internal collaborator, call a private method, or verify through a side channel. Such a test breaks on refactor without a behaviour change.
- Recompute the expected value the way the code does. Take expected values from an independent source: a known-good literal, a worked example, or the specification.
- Follow horizontal slicing (all tests first, then all implementation). Work in vertical slices: one test, one implementation, repeat.
Loop rules
- Red before green: write the failing test, then only enough code to pass it. Do not add speculative features.
- One slice at a time: one seam, one test, one minimal implementation per cycle.
- Refactoring is not part of this loop. It belongs to the review stage (see the
code-reviewskill).
04 同仓库更多 Skills
writing-for-agents
Reference for writing documents an agent consumes: skills, AGENTS.md or CLAUDE.md, and docs reached by a pointer. Invoke when creating or editing a skill or an agent instruction file, or when a document's pointer wording, load, or structure is in question. Do not invoke merely because the user mentions writing-for-agents, names a skill, or writes 'skill <word>'.
wizard
Generate an interactive bash wizard for steps only a human can perform. Invoke when the user asks for a script or wizard for manual setup: infrastructure provisioning, credentials or CI secrets, a third-party dashboard, or a one-off migration or cutover. Do not invoke for steps the agent can perform, or merely because the user mentions wizard, names a skill, or writes 'skill <word>'.
wait-what
Stop and re-pitch the last message in plain, simplified language.
to-tickets
Split an agreed specification into reviewable vertical-slice issues with explicit blockers, then publish them after confirmation.
to-spec
Turn the current conversation into a specification and publish it after confirmation.
to-pr
Create a pull request from the current branch.