Post-implementation review and refactoring with specialized multi-agent architecture
Performs post-implementation review and refactoring using specialized parallel agents.
/plugin marketplace add reedom/claude-code-commands/plugin install reedom-quick-refactor@reedom-commands-and-skills[--against|-a <branch>] [--files|-f <paths>] [--commit|-c] [--cleanup]Post-implementation review and refactoring. Spawns specialized reviewer agents in parallel, evaluates findings, then applies refactorings sequentially.
| Flag | Default | Description |
|---|---|---|
--against, -a | origin/main | Target branch for diff comparison |
--files, -f | (none) | Comma-separated file paths to review |
--commit, -c | false | Commit after each successful refactoring |
--cleanup | false | Remove temp directory after completion (preserved by default) |
Create todo list to track progress:
1. [if --commit] Pre-review: commit uncommitted files
2. Phase 1: Collect files
3. Phase 2: Run parallel reviews
4. Phase 3: Evaluate findings
5. Phase 4: Process accepted findings
6. [if --cleanup] Cleanup temp directory
7. Report summary
If --commit flag is set:
git status --porcelainSkill(reedom-git:smart-commit)Invoke the collection skill:
Skill(reedom-quick-refactor:collect-commits-and-files) --against=<branch> --files=<paths>
Store from response:
temp_dir: Base temporary directorypaths.files_dir: Directory containing file listspaths.reviews_dir: Directory for review outputssummary: File count summaryRead JSON files from files_dir:
source.json: Source file listtest.json: Test file listconfig.json: Config file listSpawn reviewer agents (max 2 concurrent) using Task tool:
| Agent | Condition |
|---|---|
reedom-quick-refactor:security-reviewer | 0 < source count |
reedom-quick-refactor:project-rules-reviewer | 0 < total count |
reedom-quick-refactor:redundancy-reviewer | 0 < source + test count |
reedom-quick-refactor:code-quality-reviewer | 0 < source count |
reedom-quick-refactor:test-quality-reviewer | 0 < test count |
reedom-quick-refactor:performance-reviewer | 0 < source count |
run_in_background: true:Task(
subagent_type: "reedom-quick-refactor:security-reviewer",
prompt: "temp_dir=<path>",
run_in_background: true
)
Task(
subagent_type: "reedom-quick-refactor:project-rules-reviewer",
prompt: "temp_dir=<path>",
run_in_background: true
)
TaskOutput, then spawn next batch of 2Spawn finding-evaluator agent:
Task(
subagent_type: "reedom-quick-refactor:finding-evaluator",
prompt: "temp_dir=<path>"
)
The agent:
reviews_dirauto_fixable = true (quick wins)score >= 70 AND severity in [high, medium]decisions.json to temp directoryExecute even if no accepted findings.
<temp_dir>/decisions.jsonaccepted array, spawn refactorer sequentially:Task(
subagent_type: "reedom-quick-refactor:refactorer",
prompt: "finding={...} commit=true|false"
)
Wait for each refactorer to complete before spawning next.
Only if --cleanup flag is set, run cleanup script:
${CLAUDE_PLUGIN_ROOT}/skills/collect-commits-and-files/scripts/cleanup.sh <temp_dir>
If --cleanup is not set:
Output final summary:
{
"files_reviewed": N,
"reviews": {
"security": {"findings": N},
"project-rules": {"findings": N},
...
},
"evaluation": {
"total": N,
"accepted": N,
"rejected": N
},
"refactorings": {
"applied": N,
"skipped": N,
"failed": N
},
"temp_dir": "<path>"
}
Include temp_dir in summary so user knows where to find review results.
| Agent | Focus | Triggers |
|---|---|---|
| security-reviewer | Vulnerabilities, secrets, injection | Source files |
| project-rules-reviewer | CLAUDE.md, .kiro rules compliance | All files |
| redundancy-reviewer | DRY violations, duplicate logic | Source + test files |
| code-quality-reviewer | Complexity, readability, SRP | Source files |
| test-quality-reviewer | Meaningless tests, coverage gaps | Test files only |
| performance-reviewer | N+1 queries, memory leaks | Source files |