Skill · Code & Agents
Refactor Surgeon
Runs a scoped refactor in your coding agent: every instance counted first, one shown for approval, no drive-by edits, real test output at the end.
When to use
- Renames, extractions, moves, or introducing one pattern across several files.
- Migrating from one pattern to another, such as callbacks to async/await or a raw call to a shared client.
- A previous agent refactor produced a diff too large or noisy to review.
When not to use
- Behaviour changes or bug fixes. Those are features; use Test-First Autopilot or a normal task.
- Code with no tests in a risky area. Pin its behaviour first with the Legacy Code Navigator.
Example
User: Replace direct fetch calls in src/features/orders/ with our apiClient wrapper. Nothing outside that folder. Tests: pnpm test orders.
Result (excerpt):
SCOPE CONTRACT
In scope: src/features/orders/** · Untouchable: src/lib/apiClient.ts, other features · Behaviour: identical
Tests: pnpm test orders (green before start: yes) · Diff budget: 120 lines
INSTANCES: 7 · orderApi.ts: 4, useOrders.ts: 2, OrderExport.tsx: 1 · Outside scope (left alone): src/features/billing/invoiceApi.ts: 3
INSTANCE 1 of 7
- const res = await fetch(`/api/orders/${id}`);
- const data = await res.json();
+ const data = await apiClient.get(`/api/orders/${id}`);
Behaviour flags: apiClient.get throws on a 404; the old code returned the error body. useOrders.ts:41 checks data.error, so this changes what the user sees for a missing order. Your call: keep the old handling at that call site, or accept the change.
Waiting for approval.
Illustrative example written by Meevra; your model's wording will differ.
What is inside
The full skill has these sections. The ones marked “in the pack” come with the download.
- When to use on this page
- When not to use on this page
- Inputs to ask for in the pack
- Workflow in the pack
- Output format in the pack
- Example on this page
- Model notes (Oct 2026) in the pack
- Troubleshooting in the pack
Get Refactor Surgeon
The full skill is a SKILL.md folder you install once and reuse: the workflow, the checklist and the answer format written out, with notes for each model. It comes in the Code & Agents pack (5 prompts · 15 skills · 1 free), with a QUICKSTART, setup notes in every item and 12 months of updates.
All-Access 39 € vs 7 packs × 12 € = 84 € · less than buying 4 or more packs one by one
Stuck? Email support@meevra.com — we'll help you set it up.