开发与测试
tdd
Use red-green-refactor when the user explicitly asks for test-driven development or the project specifies it for the current change.
chipfighter · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add chipfighter/coding-discipline --skill tdd技能说明
name: tdd description: Use red-green-refactor when the user explicitly asks for test-driven development or the project specifies it for the current change. disable-model-invocation: true license: MIT
- Add or adapt the smallest test that expresses the expected behavior. Run it against the baseline and establish that it fails for the intended reason. For a regression, use the actual failing scenario when practical.
- Make the smallest implementation change that satisfies the behavior. Rerun the test and the relevant existing checks.
- Refactor if it improves the result, then rerun the relevant checks on the final change.
If implementation already exists, preserve it and use a safe baseline or an isolated comparison to check that the test distinguishes the behavior. When the baseline cannot be run, report what was verified.