Pdlc refactor
代码重构(保持外部行为不变,改善内部结构)From its SKILL.md
npx -y skills add kanfu-panda/pdlc-skills --skill pdlc-refactorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 10 stars10 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.
SKILL.md
1.5 KB, 458 tokens by cl100k_base, as published. Nobody here has run it
代码重构
<!-- @include templates/prompts/iron-law.md -->对指定服务或模块进行安全重构,保证行为不变。
工作流程
- 确认测试覆盖: 先检查现有测试是否充分,不充分则先补测试
- 阅读设计文档: 阅读
docs/02_design/对应子目录下的相关设计文档 - 识别坏味道: 分析代码中的坏味道(Code Smell)
- 制定重构计划: 列出重构项,按风险排序
- 逐步重构: 每次只做一个小的重构,确保测试通过
- 运行完整测试: 确认没有破坏现有功能
常见重构场景
- 提取方法/类: 过长的方法、过大的类
- 消除重复: DRY 原则,提取公共逻辑
- 简化条件: 复杂的 if-else 链、嵌套条件
- 改善命名: 不清晰的变量名、方法名
- 解耦依赖: 降低模块间耦合度
- 统一风格: 对齐项目编码规范
要求
<!-- @include templates/prompts/output-language.md -->- 重构提交信息格式:
refactor: <简要描述> - 严禁在重构中混入新功能
- 每个重构步骤都要保证测试通过
- 更新 CHANGELOG.md
重构目标: $ARGUMENTS
<!-- @include templates/prompts/state-update.md --> <!-- @include templates/prompts/handoff.md -->What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 2 of the 12 instructions most refactoring skills give in 458 tokens
Counted across 545 of the 587 authors here whose files we hold, read 2026-09-06
- Run tests after each changein 61 of 545, across 59 files
- Run tests before refactoringin 42 of 545
- Revert immediately if tests failin 31 of 545, across 28 files
- Perform refactoring in small stepshere, and in 30 of 545, across 29 files
- Write characterization tests for untested codein 21 of 545, across 19 files
- Remove dead code and unused importsin 20 of 545
- Identify code smellshere, and in 20 of 545
- Perform one refactoring at a timein 19 of 545
- Commit after each successful refactoringin 17 of 545, across 15 files
- Verify all tests pass after refactoringin 17 of 545
- Keep refactoring separate from behavior changesin 16 of 545, across 14 files
- Run the full test suitein 16 of 545
Said here and by no other author read
- Read relevant design documentation
- Update CHANGELOG.md
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.