refactorlisted
Install: claude install-skill oprogramadorreal/optimus-claude
# Project-Wide Code Refactoring
Analyze existing source code against the project's coding guidelines using 4 parallel agents to find guideline violations, testability barriers, cross-file duplication, and pattern inconsistency. Present a prioritized refactoring plan, then apply only user-approved changes with test verification.
Two primary goals:
1. **Guideline compliance** — align code with coding-guidelines.md, architecture.md, styling.md, and testing.md
2. **Testability** — restructure code so `/optimus:unit-test` can safely increase coverage without risky refactoring
The code-simplifier agent guards new code after every edit — this skill is the on-demand complement for restructuring existing code across the project.
## Step 1: Verify Prerequisites and Determine Scope
### Multi-repo workspace detection
Read `$CLAUDE_PLUGIN_ROOT/skills/init/references/multi-repo-detection.md` for workspace detection. If a multi-repo workspace is detected, resolve prerequisites per-repo:
- Determine which repo(s) the scope targets (from file paths, user selection, or changed files)
- Load that repo's `.claude/CLAUDE.md` and `.claude/docs/` as prerequisites (not the workspace root)
- If scope spans multiple repos, load each repo's docs independently and apply per-repo context when analyzing that repo's files
- If no repo can be determined, ask the user which repo to analyze
### Prerequisite check
Read `$CLAUDE_PLUGIN_ROOT/skills/init/references/prerequisite-check.md` and apply the pre