Refactor

From rakovi4/continue-framework · View interactive version

Refactor is an AI agent skill from the GitHub repository rakovi4/continue-framework. Refactor code using Martin Fowler's patterns. Improves readability, moves behavior closer to data, removes unnecessary abstractions.

How to use this skill

Skill file

/refactor

Dispatch one independent refactor-agent per coherent scope. The worker applies

all applicable refactoring checks; scope partitioning controls parallelism, not

checklist coverage. Load .claude/templates/workflow/quality-execution.md for

ownership, scheduling, evidence reuse, inspection modes, and result joining.

Usage

Dispatch

  1. Resolve the target, tests, helpers, and relevant collaborators. Load shared

coding detail, frontend rules where relevant, and active technology bindings.

Map responsibilities using .claude/templates/refactoring/scan-checklist.md.

  1. Dispatch refactor-agent with the scope manifest, input revisions, applicable

context, and execution mode. The worker must be independent of the primary

implementation/test author and load every applicable M, D, and T check. It must

not nest fan-outs.

For large scopes, partition by cohesive capability, assign each partition all

applicable clusters, and name an owner for cross-capability checks. Shared

writes have one owner. Partitioned dispatches are read-only initially; gather

every partition and cross-capability result before granting fixes.

  1. Default unpartitioned standalone/task mode is scan-and-fix: scan the complete scope,

resolve findings one refactoring at a time, verify, and return the completed

result using refactor-agent.md. A small scope uses this same route.

  1. Stage 2 may dispatch inspect on the stable joined candidate alongside

coverage. It returns findings without edits; this is not a completed gate.

After coverage-driven changes are verified and behavior is published, the

coordinator explicitly dispatches fix, granting owned paths and passing

current revisions and invalidations. Reuse the inspector when available;

otherwise pass its evidence to a new independent worker. Revalidate affected

checks, apply fixes, and await verification before completing the gate.

  1. A worker retained from /test-review may run /refactor only after the

coordinator publishes the reviewed tests and explicitly dispatches this skill.

Keep the two named phases and results distinct; never auto-run the next phase.

GREEN scope reuse follows quality-execution.md; every file and check remains

accounted for, including cross-file effects.

Optional cluster fan-out is a coordinator choice only when scope size and

available capacity justify it without delaying ready independent scopes. Dispatch

refactor-mechanics-agent, refactor-design-agent, and

refactor-duplication-agent before awaiting any; gather every result, then grant

one owning refactor-agent the fixes. Workers never nest this fan-out.

Available Templates

Shared principles and responsibility-specific patterns (`.claude/templates/refactoring/`)

Additional presentation and fixture patterns (`.claude/templates/refactoring/`)

Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.