设计与 UI
x-tdd
Red-green-refactor TDD in small vertical slices. Use when building a feature or bugfix that should be proven with automated tests.
Fromlan · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add Fromlan/X-agent --skill x-tdd技能说明
name: x-tdd description: Red-green-refactor TDD in small vertical slices. Use when building a feature or bugfix that should be proven with automated tests.
TDD
Work in one session. Prefer the project's existing test runner.
Loop
- Slice — One behaviour small enough to finish in one red-green cycle.
- Red — Write a failing test that names the behaviour. Run it; confirm it fails for the right reason.
- Green — Minimal production code to pass. No speculative abstractions.
- Refactor — Clean structure only while green. Re-run tests.
- Repeat for the next slice.
Guidance
- Prefer testing through a stable interface (public API, node script contract), not private guts.
- Skip TDD only when the user opts out or there is no runnable test setup — say so and propose a manual check instead.