一键导入
safe-refactoring
Refactor code without changing behavior. Small steps, green tests after every change, no mixing with feature work.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Refactor code without changing behavior. Small steps, green tests after every change, no mixing with feature work.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Karpathy-inspired guidelines: Think before coding, Simplicity first, Surgical changes, Goal-driven execution
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Write an actionable markdown plan before implementation. Bite-sized tasks, exact paths, complete code.
Write clear Conventional Commits. Imperative subject, explain why not what, one logical change per commit.
Optimize based on measurement, never guesswork. Profile first, fix the real bottleneck, verify the win.
Review PRs on GitHub: read diffs, leave inline comments, approve or request changes.
| name | safe-refactoring |
| description | Refactor code without changing behavior. Small steps, green tests after every change, no mixing with feature work. |
Core principle: Refactoring changes structure, NOT behavior. If tests change meaning, it is not a refactor.
NEVER mix refactoring with behavior changes in the same step.
If you need to do both, do them as separate, clearly-labeled changes.
BEFORE touching any code:
bash. If it is red, stop — fix or characterize first.Repeat in tiny increments:
bash.