Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when implementing a feature, refactor, direct hotfix, or scoped behavior change before writing production code. For bug reports that need root-cause investigation, use dev-fix instead; dev-fix already owns failing regression tests.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-17 | ✗→✓ | ▲ Improved | 16% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 32% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 6% | 0% |
Implementation workflow for behavior-changing code. The goal is to prevent "tests after" from becoming optimistic coverage that never proved it could catch the bug.
This skill only governs the coding loop. It does not gather requirements (dev-grill-docs; dev-spec is a compatibility alias), design implementation strategy (dev-plan), investigate root cause (dev-fix), or review the final diff (dev-code-review).
执行前先加载 references/dev-baseline.md。不假设、最小代码、外科手术式改动、可验证成功标准 全程生效。
baseline 与本 skill 的关联:
默认适用:
不要用于需要 root cause investigation 的 bug 报告。那条路径走 dev-fix,因为 dev-fix 已经内置 failing regression test、root-cause fix 和 red→green→red 验证。
可跳过,但必须在输出里说明原因:
如果用户要求跳过 TDD,只在他们明确接受风险时跳过,并把后续验证升级为 dev-verify 的完整检查。
把当前任务切成最小行为单元。每轮只选一个:
Behavior: <一句话说明>
Expected: <可断言的结果>
Test target: <测试文件 / 测试命令>
Production target: <实现文件>如果写不出 Expected,说明需求还没清楚,回 dev-grill-docs 或向用户澄清。
如果存在匹配的 .claude/artifacts/designs/<slug>.md 或 .claude/artifacts/plans/<slug>.md,本轮 behavior 应从其中一个来源选择:
输出时标明 Source: spec/<slug> AC-<n> 或 Source: plan/<slug> step <n>。如果没有 artifact,用用户当前请求作为 source,但不要把未确认的范围扩成额外行为。
先写测试,不要写生产代码。
测试要求:
运行最窄命令:
bash<test command for the specific test>
必须确认:
只写让当前 RED 测试通过的最小生产代码。
禁止:
运行:
bash<same narrow test command>
必须确认当前测试通过。若失败,修实现,不是先改测试。
仅在测试已通过后整理:
每次整理后重新运行同一测试。不要在 refactor 阶段加入新行为。
当前行为通过后,根据风险扩大验证:
| 改动范围 | 追加验证 | |---|---| | 单函数 / 单模块 | 相关测试文件 | | 多文件协作 | 相关测试目录 / package test | | 公开 API / 数据迁移 / 鉴权 / 支付 | 单测 + 集成测试 + 项目标准 lint/build | | regression / hotfix | red → green → 临时反转实现确认 test 会再 fail → 恢复 green |
输出时列明运行过的命令和结果。不能只说“应该通过”。
全部行为实现后:
dev-verify 做完成前证据门禁。dev-code-review 做提交前评审。dev-finish。dev-verify 补齐。Recommended agent_type: worker
Use when:
Do:
../../docs/multi-agent-policy.md.Do not:
Output:
Other measured skills in the registry, with their headline benchmark lift.