用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Hbin77/codex-kit --skill refactor命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | refactor |
| description | Safe, systematic refactoring workflow — same behavior, better structure |
Execute a safe, systematic refactoring workflow on the target scope.
Task: the task/scope the user described when invoking this skill (if none given, ask or infer from context)
Do the analysis yourself:
~/.codex/skills/code-smells): long functions, deep nesting, duplication, large classes, long parameter lists, feature envy, primitive obsession, dead code.Present findings with severity ratings. Create a safe refactoring order based on:
Each step specifies: target file(s), smell addressed, refactoring pattern (Extract Method, Move Function, Replace Conditional with Polymorphism, etc.), and that behavior MUST remain identical.
Wait for user approval before proceeding.
build PASS | lint PASS | test X/Y PASS.For each approved step:
refactor(scope): pattern applied) → next step.
Execute sequentially in leaf → root order (dependent modules strictly sequential).Run full build + lint + full test suite. Compare test count: baseline vs current (must be equal or greater). Distinguish failure cause:
Review the refactoring yourself: verify (1) no behavior changes, (2) improved structure, (3) no regressions.
## Refactoring Report
### Before → After
| Metric | Before | After |
| Files changed / Lines removed / Lines added / Avg function length / Max nesting / Test count |
### Applied Refactorings
| # | Pattern | Target | Result |
### Smells Resolved
- [x] ...
### Remaining (deferred)
- [ ] ... — reason
### Verification
Build: PASS | Lint: PASS | Tests: X/Y PASS