一键导入
refactor
Guided refactoring with before/after validation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guided refactoring with before/after validation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Check project health — environment, dependencies, tools, and configuration
Guided first-session onboarding — helps you go from zero to your first plan and issue
Manage GitHub issues backlog — view, pick, or create work items
Create a structured implementation plan in tasks/todo.md with confidence assessment
Summarize current progress, commit working state, and update task tracking
Generate or update a PROJECT_INDEX.md for fast session orientation
| name | refactor |
| description | Guided refactoring with before/after validation |
| argument-hint | <file path, module, or pattern> |
| user-invocable | true |
| allowed-tools | Read, Grep, Glob, Edit, Bash(make test*), Bash(git diff*), Bash(git stash*) |
| context | fork |
| agent | general-purpose |
Perform a guided refactoring of the specified code with validation at each step.
$ARGUMENTS is a file: refactor that specific file.$ARGUMENTS is a module/directory: analyze and refactor across the module.$ARGUMENTS is empty: analyze recently changed files (git diff --name-only main...HEAD).make test (or appropriate test command) to establish a passing baseline.git stash or note current diff.Present the refactoring plan to the user:
## Refactoring Plan: <target>
| # | Change | Risk | Files |
|---|--------|------|-------|
| 1 | Description | low | file.py:20-35 |
| 2 | Description | medium | file.py:50-80 |
Estimated complexity reduction: X → Y (metric)
Wait for approval before proceeding.
Write results to scratch/refactor_latest.md:
## Refactoring Report: <target>
### Applied
- [x] Change 1 — description (tests pass)
- [x] Change 2 — description (tests pass)
### Skipped
- [ ] Change 3 — reason (tests failed / user declined)
### Before/After
- Lines: X → Y
- Complexity: before → after
- Tests: all passing
Return a ≤5 line summary to the main context.