/aref:verifying-refactorsfrom aref
Validates structural rules (no cycles, file/fn line caps, cognitive/cyclomatic complexity) and runs mutation testing on refactored modules. Use after applying-refactors completes.
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.
Verifying refactors IS proving the refactor made the codebase better by measurable rules, not vibes.
Run the same toolchain as analyzing-codebases, on the post-refactor state. Compare before/after. Every hard rule must hold or the refactor is not done. Mutation test touched modules to confirm characterization tests actually assert.
Core principle: A refactor that reduces complexity on paper but fails hard rules is a regression.
Pattern: Chain
Handoff: user-confirmation
Next: finalizing-refactors
[verifying-refactors] Task N: <action>Tasks:
Rerun the same tools as analyzing-codebases on current (refactored) state. Save outputs to .rcc/aref-raw/{ts}-post-*.json (distinct from pre-refactor *-pre-*.json if you want to rename original outputs; else use new timestamp).
Per references/hard-rules.md, check each rule. Any failure → STOP, do not proceed to mutation testing, report failure.
Rules:
Per references/mutation-testing.md. Run mutation tool ONLY on modules touched by the refactor (derived from git diff since branch point). Global mutation runs are out of scope.
Record mutation score (killed/total). Survivors >20% → flag weak-tests in report but do not block.
Write .rcc/{ts}-verification-report.md:
# Verification Report {ts}
## Hard Rules
| Rule | Before | After | Pass/Fail |
|------|--------|-------|-----------|
| Cyclic deps | 3 | 0 | PASS |
| Max file LOC | 820 | 298 | PASS |
| ...
## Mutation Testing
| Module | Mutants | Killed | Score | Flag |
|--------|---------|--------|-------|------|
| src/auth/token.ts | 48 | 41 | 85% | |
| src/auth/middleware.ts | 32 | 20 | 63% | weak-tests |
## Delta vs Pre-refactor
- Hotspot count: -3
- Duplication clusters: -2
- AGENTS.md gaps: unchanged (handled by finalizing)
## Decision
PASS / FAIL-HARD-RULES / PASS-WITH-WEAK-TESTS
Print report summary. Ask user:
continue to finalizing-refactorsrollback last phase / replan failing target / abortcontinue / scaffold more tests / accept and continue| Thought | Reality |
|---|---|
| "Coverage is 85%, skip mutation" | Coverage measures execution, not assertion. Mutation validates asserts. |
| "Warnings are fine, not FAIL" | Warning ≠ FAIL but IS recorded. User decides acceptance. |
| "Cognitive complexity 16 is close enough" | Hard rule is hard. Negotiate in plan, not in verify. |
references/hard-rules.mdreferences/mutation-testing.mdWhat SKILL.md sets; muted values are Claude Code's defaults
6 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).npx claudepluginhub wayne930242/reflexive-claude-code --plugin arefOther plugins' skills for the same job