/aref:planning-refactorsfrom aref
Converts a refactor map into a phased, always-green plan using parallel-change, branch-by-abstraction, or strangler fig patterns. Each phase is a bounded commit with verification.
Ships in aref. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Planning refactors IS producing phased, always-green, bounded-size plans from the refactor map.
Each phase is one commit: expand, migrate, or contract. Every phase has a verification hook (tests pass, specific metric improved). Phases never exceed 400 LOC predicted diff.
Core principle: Small reversible phases beat big irreversible restructures.
Pattern: Chain
Handoff: user-confirmation
Next: scaffolding-characterization-tests
[planning-refactors] Task N: <action>Tasks:
Read .rcc/{ts}-refactor-map.md. Validate all required sections present (per schema). Missing → abort and tell user to rerun analyzing.
Default: top 3 hotspots. Exceptions:
Per target, decide based on these rules (see references/patterns.md for full criteria):
For each phase:
For each phase touching untested code, mark must-scaffold and specify:
Verify/pytest-approvaltests/insta/testify golden)high-risk, require user ackWrite .rcc/{ts}-refactor-plan.md per schema in references/refactor-plan-schema.md.
Print summary: targets selected, patterns chosen, total phases, estimated total LOC, high-risk count. Ask user: approve / adjust targets / change patterns / abort.
Approved → hand off to scaffolding-characterization-tests. Dry-run mode: stop here, print plan, exit.
oversizedmigrate without preceding expand phase| Thought | Reality |
|---|---|
| "Combine expand + migrate for efficiency" | Parallel-change requires separation for rollback safety. |
| "Characterization test optional, user will review" | Research: untested code during refactor is top failure mode. |
| "Top 5 hotspots fits in one run" | 400 LOC ceiling × 3 targets ≈ safe per-run budget. |
| "Skip cycle-break, deal with it later" | Cyclic deps compound. Break first. |
references/patterns.mdreferences/refactor-plan-schema.mdWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wayne930242/reflexive-claude-code --plugin aref6 skills in this plugin
/analyzing-codebasesDetects project languages and monorepo state, runs language-appropriate static analysis (dependency graph, complexity, duplication, semantic patterns), and produces a refactor map ranking hotspots. Use when user invokes /aref or explicitly asks to analyze a codebase for refactoring./applying-refactorsExecutes a refactor plan phase-by-phase on a dedicated branch with per-phase commits and mandatory reviewer checkpoints. Use when characterization-tests scaffold is complete and plan has phases ready to execute./finalizing-refactorsWrites AGENTS.md per subproject, archives run artifacts, and suggests rcc handoff conditionally. Use when verifying-refactors passes (PASS or PASS-WITH-WEAK-TESTS)./scaffolding-characterization-testsAdds golden/snapshot tests to untested hotspot modules before refactoring. Use when refactor plan marks any phase with characterization_test.status=must-scaffold./verifying-refactorsValidates hard structural rules (no cycles, file/fn line caps, cognitive/cyclomatic complexity) and runs mutation testing on touched modules. Use when applying-refactors has completed all phases on the refactor branch.Other plugins' skills for the same job