with one click
refactor
Guided refactoring with before/after validation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Guided refactoring with before/after validation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
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
Based on SOC occupation classification
| 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.