一键导入
refactor
Refactor code to fix DRY, SOLID, and Structure violations while preserving behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Refactor code to fix DRY, SOLID, and Structure violations while preserving behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Atomic execution for the project framework. Executes exactly one atomic task from `PLAN.md`.
Comprehensive Execution for the `SPAE` framework. Executes all tasks from `PLAN.md` sequentially in one invocation.
Optimization & Verification for the `SPAE` framework. Performs gap analysis on `PLAN.md`.
Orchestrate SPAE subagents sequentially through the structured workflow and lifecycle.
Task Decomposition for the `SPAE` framework. Decomposes `SPEC.md` into a `DAG` of atomic tasks in `PLAN.md`.
Orchestrate SPAE subagents sequentially through the spec, plan, and inspect phases of the structured workflow.
| name | refactor |
| description | Refactor code to fix DRY, SOLID, and Structure violations while preserving behavior. |
| user-invocable | true |
| argument-hint | [optional: file path, module, or focus area] |
references/refactoring-guide.md.DRY, SOLID, and Structure violations, improving maintainability
without altering observable behavior.Determine scope by the first available source:
Abort if no scope exists.
Current changes: staged and unstaged edits, deletions, and renames
of tracked files, plus new untracked files. Requires a versioned
project. Abort with a clear message if none detected.
See references/testing-guide.md for test structure, isolation,
mocking, assertion, and performance standards.
See references/shell-command-guide.md for command safety, timeouts,
redirects, and non-interactive environment directives.
references/testing-guide.md.references/shell-command-guide.md.antipatterns using the violation catalog in
references/refactoring-guide.md.Result: No Changes if none
detected: duplicated logic, long methods, large classes,
primitive obsession, SOLID violations.references/refactoring-guide.md.ACT step.ACT, and re-enter VERIFY.references/refactoring-guide.md.tsconfig.json, .eslintrc.*, webpack.config.*, vite.config.*,
jest.config.*, Makefile, pyproject.toml, Cargo.toml.@ts-ignore, eslint-disable, @SuppressWarnings, # type: ignore.as any,
! non-null assertions, or broadening union types.### Execution Summary
- **Actions**:
- [Terse list of actions taken]
- **Files**:
- [Terse list of affected files]
- **Findings**:
- [Terse list of notable findings]
- **Summary**:
- [Terse list of summary of changes]
> **Refactor Status** • `[scope]`
> **Result**: [Complete | No Changes | Failed]
> **Impact**: [Terse impact statement]