pdlc-refactor SKILL.md skillA
pdlc-refactor from kanfu-panda/pdlc-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add kanfu-panda/pdlc-skills/pdlc-refactor@git:20261012.48d119fPins git:20261012.48d119f in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- kanfu-panda/pdlc-skills
- Path
skills/pdlc-refactor/SKILL.md- Versions recorded
- 8
- Latest version
- git:20261012.48d119f, committed Oct 12, 2026
- First version recorded
- May 7, 2026
- Size
- 16,097 bytes
- Repository stars
- 18
- License
- MIT
代码重构(保持外部行为不变,改善内部结构).
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# 代码重构 <!-- @include templates/prompts/iron-law.md(已内联于下方,无需另读) --> ⛔ **IRON LAW · 不可违反的硬门禁** 以下规则为**不可协商**的执行约束: 1. **文件必须落盘**:所有带编号(功能ID / 缺陷ID)的文档,必须作为实际文件写入磁盘,不可仅在对话中输出。 2. **阶段必须落章**:每个阶段完成后必须在状态机 `docs/.pdlc-state/<feature-id>.json` 追加 history,不可跳过。 3. **测试必须存在**:进入 `/pdlc-implement` 前,对应测试必须存在且处于红灯状态。违反则中止。 4. **自检必须执行**:段二自检为强制步骤,不得以"已经很好了"为由跳过。 5. **防循环**:段三修复为单次,不递归。无法自动修复的问题记录到报告,继续往下走。 6. **状态必推进**:成功执行某 phase 后 `current_stage` 必须变更。收尾时若发现 `current_stage` 未推进,视为失败并报错,**不得静默返回**(防止外层循环拿滞后的状态空转烧额度)。唯一例外:命中人工点主动 block 时,`current_stage` 保持不变但必须写 `last_phase_result.ok=false` + `blocked_reason`。 **违反任一条 = 立即中止当前命令,输出违规详情,等待人工介入。** <!-- @include-end templates/prompts/iron-law.md --> 对指定服务或模块进行安全重构,保证行为不变。 ## 工作流程 1. **确认测试覆盖**: 先检查现有测试是否充分,不充分则先补测试 2. **阅读设计文档**: 阅读 `docs/02_design/` 对应子目录下的相关设计文档 3. **识别坏味道**: 分析代码中的坏味道(Code Smell) 4. **制定重构计划**: 列出重构项,按风险排序 5. **逐步重构**: 每次只做一个小的重构,确保测试通过 6. **运行完整测试**: 确认没有破坏现有功能 ## 常见重构场景 - **提取方法/类**: 过长的方法、过大的类 - **消除重复**: DRY 原则,提取公共逻辑 - **简化条件**: 复杂的 if-else 链、嵌套条件 - **改善命名**: 不清晰的变量名、方法名 - **解耦依赖**: 降低模块间耦合度 - **统一风格**: 对齐项目编码规范 ## 要求 <!-- @include templates/prompts/output-language.md(已内联于下方,无需另读) --> …
Read the whole file at its exact version.
How to install
mdr add kanfu-panda/pdlc-skills/pdlc-refactor@sha256:987f436bf558dc95The line at the top of this page pins the label git:20261012.48d119f, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_qerdj6yvzfqfrphv)
2 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 8 versions of this file, between May 7, 2026 and Oct 12, 2026, about one every 23 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261012.48d119f latest | 2026-10-12 | 48d119f | 16,097 B | A | view · diff |
| git:20261012.035af0d | 2026-10-12 | 035af0d | 14,651 B | A | view · diff |
| git:20261008.72fb7f7 | 2026-10-08 | 72fb7f7 | 14,649 B | A | view · diff |
| git:20261008.ba3006e | 2026-10-08 | ba3006e | 14,599 B | A | view · diff |
| git:20261007.7eb3b9d | 2026-10-07 | 7eb3b9d | 14,175 B | A | view · diff |
| git:20260923.3cd2f02 | 2026-09-23 | 3cd2f02 | 14,021 B | A | view · diff |
| git:20260923.6b87696 | 2026-09-23 | 6b87696 | 13,045 B | A | view · diff |
| git:20260507.ba956b7 | 2026-05-07 | ba956b7 | 1,576 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (16097 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
kanfu-panda/pdlc-skills · 18 stars · license MIT · pushed 2026-10-13 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_qerdj6yvzfqfrphv GET https://markdownregistry.com/api/v1/resolve?ref=kanfu-panda/pdlc-skills/pdlc-refactor GET https://markdownregistry.com/api/v1/blob/987f436bf558dc950200ac01bbd0b61fee16d5456be7134b2abd0f1a1faa57ea
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.