| name | refactor |
| description | Analyze an existing feature and produce a reimplementation plan focused on reducing complexity and fragmentation. Asks: "If we started over, what would we do differently?" |
| disable-model-invocation | true |
| argument-hint | <feature or area to refactor> |
Refactor
Strategic refactoring skill. Investigates a feature in the current
codebase, identifies complexity and fragmentation, and produces a
reimplementation plan answering: "Knowing what we know now, if we started
from scratch, how would we do this differently?"
Input
The argument follows the skill invocation. If empty, prompt:
What feature or area do you want to refactor?
Parse the response into a short kebab-case slug (e.g. auth-middleware,
config-loading) for use in file names.
Gather project metadata
Load git-metadata/SKILL.md and run its
commands. Include the output in the subagent prompt as context so it can
prioritize empirically.
Investigation Phase
Spawn a single subagent (exploration / investigation role) on the cheapest
model tier adequate to the investigation (see
../shared/SUBAGENT-STEERABILITY.md).
Its prompt must include: