Pdlc implement
36 slash commands that turn Claude Code into a real PDLC workflow — PRD → TDD → implement → review → ship. Hard contracts force AI to persist artifacts, write failing tests first, and run self-checks. No more "looks done" in chat.
npx -y skills add kanfu-panda/pdlc-skills --skill pdlc-implementAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
按设计文档和已有测试用例实现代码(带前置守卫、自检、handoff)
SKILL.md
4.9 KB, as published. Nobody here has run it
按设计文档实现代码
严格按照设计文档和已有的测试用例实现功能代码。
<!-- @include templates/prompts/iron-law.md --> <!-- @include templates/prompts/noninteractive.md -->PDLC 前置守卫(不可跳过)
- 从用户输入提取功能名称关键词
- 按下面的规则搜索与该功能相关的测试代码:
- 按上述四步走完仍未找到测试代码 → 输出以下后立即中止:
⛔ PDLC 守卫:未找到与「<功能名>」相关的测试代码。 实现代码前必须先编写测试(TDD)。请先运行: 👉 /pdlc-tdd <功能描述> - 找到测试 → 运行测试,确认红灯(失败)。若已全绿:
- 交互模式:提示"测试已全部通过,可能代码已实现,请确认是否需要继续。"
--autonomous模式:视为流程性确认,默认跳过实现直接收尾(写auto_decisions[]留痕),current_stage推进为impl、next_step=pdlc-review、last_phase_result.advanced_to=review(下一阶段短名,非命令名)
- 提取功能ID(从设计文档或 PRD),继续
- 任务状态关联(如
docs/06_tasks/存在任务文件):- 匹配含功能ID的任务文件
- ⬜ 未开始 / 🔄 进行中的任务,标为 🔄,追加
<!-- 开始时间: <今日日期> -->
段一:实现代码
- 阅读设计文档:
docs/02_design/对应子目录下的文档,逐字理解 - 阅读测试用例:对应服务/应用下的测试代码,理解每条意图
- 阅读编码规范:
docs/00_standards/coding/(未命中 → 提示consider /pdlc-standard add coding/<topic>) - 最少量实现:使所有测试通过的最小代码
- 运行测试:确认绿灯
- 重构优化:测试通过前提下优化代码结构
- 更新服务 CHANGELOG
- 任务完结:匹配任务由 🔄 改 ✅,追加
<!-- 完成时间: <今日日期> -->
段二:自检(强制)
<!-- @include templates/prompts/self-audit.md -->实现自检清单(必须全部检查)
- 设计偏离检查:重读设计文档,确认没有遗漏接口或功能点
- 遗漏 → 补充实现并确认测试通过
- 偏离 → 修正代码或补充设计说明
- 编码规范快检:运行项目 lint 工具
- 可自动修复 → 直接修复
- 修复后重跑测试确认不破坏功能
- lint fix 导致失败 → 回滚并记录人工处理
- 覆盖率验证:覆盖率达标线以项目配置为准:优先取
docs/00_standards/test-commands.yml的 coverage 命令阈值参数(那才是强制点,退出码即判定),其次quality-targets.yml;两者都没有时按 >= 80% 兜底。- 不达标 → 补测试用例并确认通过
段三:修复(单次,不递归)
<!-- @include templates/prompts/loop-prevention.md -->段四:更新状态机 + 交接
<!-- @include templates/prompts/state-update.md -->本阶段状态机更新:
current_stage:impl、next_step:pdlc-review—— 仅当本阶段成功时才这样写 (所有checks通过且未命中blocked_reason)。- 失败/受阻时不得推进:
ok=false(含 blocked)→ 按state-update.md规则 5,current_stage保持原值不变、advanced_to=null、blocked_reason写明原因。⚠️ 失败也照写
current_stage: impl是常见错误:那会让current_stage不再表示 「最后一个真正完成的阶段」,外层循环的 stuck-stop 因此失效。 - 写
last_phase_result:checks.tests_pass/coverage_pass/lint_clean取自真跑unit/coverage/lint的退出码,不得用自检结果冒充。退出码语义与"跑不了"的处理见下(该文件不存在则回退项目既有约定,并提示consider 建立 docs/00_standards/test-commands.yml)。
本命令的 handoff 输出:
✅ 实现完成,自检通过
- 设计一致性:<✅/部分>
- lint 检查:<✅/X 项已自动修复/X 项待人工>
- 测试覆盖率:<XX>%
📦 状态快照:docs/.pdlc-state/<feature-id>.json
👉 下一步:/pdlc-review <feature-id>
实现目标: $ARGUMENTS