test-driven-development
Use when implementing features, bug fixes, refactors, or behavior changes before writing production code.
- License 许可
- MIT
- 所属仓库
- max-kharena/nous
- 最近更新
- 2026-04-28
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- test-driven-development
- risk
- medium
- type
- quality
- version
- 0.1.0
- description
- Use when implementing features, bug fixes, refactors, or behavior changes before writing production code.
03 SKILL.md 正文
Test-Driven Development
Core Principle
If you did not watch the test fail, you do not know whether it tests the behavior.
IRON LAW
No production behavior change without a failing test first, unless the user explicitly approves an exception.
Red-Green-Refactor
- RED: Write one minimal test for one observable behavior.
- Verify red: Run it and confirm it fails for the expected reason.
- GREEN: Write the smallest production change that passes.
- Verify green: Run the focused test and relevant surrounding tests.
- REFACTOR: Clean names, duplication, and structure while keeping tests green.
Good Test Rules
- Test external behavior, not implementation details.
- One behavior per test; split tests with “and” in the name.
- Prefer real code paths over mocks unless isolation is necessary.
- Regression tests must fail when the fix is removed.
Allowed Exceptions
Ask before skipping TDD for:
- Throwaway prototypes.
- Pure config or docs changes.
- Generated code.
- UI-only visual polish where screenshot/browser verification is the stronger evidence.
Output Contract
## Behavior Under Test
## Red Evidence
## Green Evidence
## Refactor Notes
## Exceptions
04 同仓库更多 Skills
write-a-skill
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when the user wants to create, write, or build a new skill.
verification-before-completion
Use when about to claim work is complete, fixed, passing, ready, merged, shippable, reviewed, or verified.
using-nous
Use when a request needs NOUS command routing or personality-driven planning.
using-git-worktrees
Use when NOUS execution needs isolated implementation branches, phase worktrees, parallel worktrees, or safe branch setup before executing a plan.
ubiquitous-language
Use when the user wants to define domain terms, build a glossary, harden terminology, or extract a DDD-style ubiquitous language. Saves to UBIQUITOUS_LANGUAGE.md.
triage-issue
Use when the user reports a bug and wants it investigated and filed as a durable GitHub issue with a TDD-based fix plan.