← ClaudeAtlas

refactorlisted

Refactors existing code for guideline compliance and testability using 4 parallel analysis agents (guideline compliance, testability barriers, duplication/consistency, code-simplifier). Two goals — align code with project guidelines AND make untestable code testable so /optimus:unit-test can safely increase coverage. Use after /optimus:init to align existing code, before /optimus:unit-test to remove testability barriers, or periodically to prevent tech debt. Supports "testability" focus (after unit-test flags untestable code) or "guidelines" focus (after init establishes rules) to prioritize finding categories, flexible scoping, and a "deep" mode for iterative refactoring (default 8, up to 10 iterations).
oprogramadorreal/optimus-claude · ★ 57 · Code & Development · score 82
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