From Darkroom Engineering
Extracts modules, renames across files, and untangles abstractions using multi-agent orchestration. For behavior-preserving restructuring outside current diff, including tech debt reduction.
How this skill is triggered — by the user, by Claude, or both
Slash command
/darkroom:refactorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Before starting work, create a marker: `mkdir -p ~/.claude/tmp && echo "refactor" > ~/.claude/tmp/heavy-skill-active && date -u +"%Y-%m-%dT%H:%M:%SZ" >> ~/.claude/tmp/heavy-skill-active`
Before starting work, create a marker: mkdir -p ~/.claude/tmp && echo "refactor" > ~/.claude/tmp/heavy-skill-active && date -u +"%Y-%m-%dT%H:%M:%SZ" >> ~/.claude/tmp/heavy-skill-active
You are in Maestro orchestration mode. Delegate immediately.
explore agent to analyze current codeplanner agent to design refactoring approachimplementer agent to refactortester agent to verify behavior unchangedreviewer agent to check qualitySpawn explore and planner first — they accept thin prompts because they discover what they need from the codebase:
Agent(explore, "Analyze the code to refactor: $ARGUMENTS. Identify patterns, issues, dependencies.")
Agent(planner, "Design refactoring approach based on analysis. Keep behavior unchanged.")
Then assemble the implementer prompt from the actual planner output. Implementer runs in an isolated worktree with no access to prior agent results, so paste the real plan — not "according to plan":
$ARGUMENTS) verbatimNow spawn:
Agent(implementer, "<the assembled briefing above — all five items inline>")
Agent(tester, "Verify refactored code behaves identically to original.")
Agent(reviewer, "Review refactoring for quality and completeness.")
Return a summary:
npx claudepluginhub darkroomengineering/cc-settings --plugin darkroomRefactors code while preserving behavior: cleanup, modularize, deduplicate, rename, simplify structure in small reversible steps. Not for behavioral changes.
Orchestrates behavior-preserving refactors: confirm tests green, restructure in small steps, keep tests green, review, and gated commit. Use when structure should improve but behavior must not change.
Applies disciplined refactoring in small, verifiable steps to improve code structure without changing behavior: extract functions, rename, move code.