tdd
Test-first features, bug fixes, integration tests, or red-green-refactor requests at agreed seams.
- License 许可
- MIT
- 所属仓库
- BetoFrega/skills
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- tdd
- description
- Test-first features, bug fixes, integration tests, or red-green-refactor requests at agreed seams.
02 资源文件 4
- 参考文档agents/openai.yaml87 B
- 许可证LICENSE1.0 KB
- 参考文档mocking.md687 B
- 参考文档tests.md965 B
03 SKILL.md 正文
Test-Driven Development
Apply every section before and during each red-green cycle. Read CONTEXT.md when
present and relevant ADRs; use domain vocabulary in tests and interfaces.
What a good test is
Test behavior through public interfaces. Tests read as specifications and survive internal rewrites. Consult tests.md for examples and mocking.md for dependency strategy. Each test must also earn its runtime: apply Tests Earn Their Runtime.
Seams: where tests go
Test only at public seams. Before writing any test, record seams and confirm them with the user; reuse prior agreement. Prioritize critical paths and complex logic instead of exhaustive edge coverage.
When interface shape, module depth, or seam placement is unresolved, consult codebase-design as vocabulary reference.
Anti-patterns
- Implementation-coupled: internal mocks, private methods, or side-channel verification such as querying storage past the interface; refactors break tests without changed behavior.
- Tautological: expected values recompute implementation, so assertions cannot disagree. Use independent literals, worked examples, or the spec.
- Horizontal slicing: all tests before all code locks in imagined behavior. Use vertical tracer bullets informed by the previous cycle.
Rules of the loop
- Red before green: fail first; implement only enough to pass, without anticipated tests or speculative features.
- One slice: one seam, one test, one minimal implementation per cycle.
- Refactoring: belongs to code-review, outside the red-green implementation cycle.
04 同仓库更多 Skills
writing-for-humans
Load before writing any reader-facing text, including messages, and follow its rules as you write. Also use to rewrite or audit existing prose for plain language, clarity, readability, or actionability.
writing-for-agents
Write agent-facing documents. Use when creating or editing skills, AGENTS.md, or CLAUDE.md.
write-adr
Write, revise, or supersede architecture decision records (ADRs) documenting an architectural choice and its rationale.
wizard
Wizard scripts for human-only provisioning, credential/CI setup, unfamiliar dashboards, migrations, or cutovers; use only for steps the agent cannot perform.
verify
Check whether the current task's claimed outcome is confirmed.
verb-tense
Choose verb tense and mood by when each event happens and how certain it is. Use when writing or reviewing any text, and when a reader asks for a tense review.