large-scale-refactor
Some restructurings are too big to do as a single behavior-preserving step: replacing a data layer, splitting a god module, migrating off a deprecated API. The wrong move is a **big-bang rewrite** — branch for weeks, swap everything at once, and discover the regressions in
$ npx -y skills add vanara-agents/skills --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Some restructurings are too big to do as a single behavior-preserving step: replacing a data layer, splitting a god module, migrating off a deprecated API. The wrong move is a **big-bang rewrite** — branch for weeks, swap everything at once, and discover the regressions in
Agent definition
large-scale-refactor.mdLarge-Scale Refactoring — The Strangler Fig Pattern
Some restructurings are too big to do as a single behavior-preserving step: replacing a data layer, splitting a god module, migrating off a deprecated API. The wrong move is a **big-bang rewrite** — branch for weeks, swap everything at once, and discover the regressions in production. The right move is an **incremental migration** where the system stays shippable the entire time.
Why big-bang rewrites fail
- No safe revert point — you cannot bisect a single 4,000-line commit.
- Review is impossible; "looks fine" is the best a reviewer can honestly say.
- The old and new code drift apart while the rewrite is in flight.
- Integration problems all surface at the end, at once, under pressure.
The strangler fig
Named after the vine that grows around a tree and gradually replaces it: you build the new implementation *beside* the old, route a slice of work through it, verify, then widen the slice — until the old code is dead and can be deleted.
┌─────────────┐
caller ─┤ seam / ├─► OLD implementation (shrinking)
│ facade ├─► NEW implementation (growing)
└─────────────┘Steps
1. **Introduce a seam.** Put an interface/facade between callers and the code you're replacing, so callers depend on the seam, not the implementation. This itself is a behavior-preserving refactor. 2. **Build the new implementation behind the seam**, covered by its own tests, used by no one yet. 3. **Route one slice across** — one endpoint, one customer, one feature flag's worth of traffic. 4. **Verify in production-like conditions.** Compare outputs (consider a brief period of running both and diffing results — a "parallel run") before trusting the new path. 5. **Widen the slice** incrementally until 100% flows through the new implementation. 6. **Delete the old implementation and the seam** once nothing references them.
What keeps it safe
- The system is shippable after every step; you can pause or roll back at any slice.
- Each step is small enough to review and to revert.
- Tests (and the parallel run) prove behavior is preserved as traffic shifts.
- A feature flag makes the cutover instant to reverse.
When a strangler is overkill
For a change you can complete in a handful of small behavior-preserving steps within one session, just use the normal loop in [`safe-workflow.md`](safe-workflow.md). Reserve the strangler fig for migrations that span many commits, modules, or deploys.
Read more
Large-Scale Refactoring — The Strangler Fig Pattern
Some restructurings are too big to do as a single behavior-preserving step: replacing a data layer, splitting a god module, migrating off a deprecated API. The wrong move is a **big-bang rewrite** — branch for weeks, swap everything at once, and discover the regressions in production. The right move is an **incremental migration** where the system stays shippable the entire time.
Why big-bang rewrites fail
- No safe revert point — you cannot bisect a single 4,000-line commit.
- Review is impossible; "looks fine" is the best a reviewer can honestly say.
- The old and new code drift apart while the rewrite is in flight.
- Integration problems all surface at the end, at once, under pressure.
The strangler fig
Named after the vine that grows around a tree and gradually replaces it: you build the new implementation *beside* the old, route a slice of work through it, verify, then widen the slice — until the old code is dead and can be deleted.
┌─────────────┐
caller ─┤ seam / ├─► OLD implementation (shrinking)
│ facade ├─► NEW implementation (growing)
└─────────────┘Steps
1. **Introduce a seam.** Put an interface/facade between callers and the code you're replacing, so callers depend on the seam, not the implementation. This itself is a behavior-preserving refactor. 2. **Build the new implementation behind the seam**, covered by its own tests, used by no one yet. 3. **Route one slice across** — one endpoint, one customer, one feature flag's worth of traffic. 4. **Verify in production-like conditions.** Compare outputs (consider a brief period of running both and diffing results — a "parallel run") before trusting the new path. 5. **Widen the slice** incrementally until 100% flows through the new implementation. 6. **Delete the old implementation and the seam** once nothing references them.
What keeps it safe
- The system is shippable after every step; you can pause or roll back at any slice.
- Each step is small enough to review and to revert.
- Tests (and the parallel run) prove behavior is preserved as traffic shifts.
- A feature flag makes the cutover instant to reverse.
When a strangler is overkill
For a change you can complete in a handful of small behavior-preserving steps within one session, just use the normal loop in [`safe-workflow.md`](safe-workflow.md). Reserve the strangler fig for migrations that span many commits, modules, or deploys.
🐒 Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code — free, Apache-2.0, install with one command.
Repo: vanara-agents/skills
Other agents on vanara-agents-skills.
- AGENT
Use when designing a new HTTP/GraphQL API or changing an existing one — modeling resources, defining endpoint contracts, choosing status codes, pagination, filtering, error envelopes, versioning, and idempotency. Produces a reviewable API contract plus an OpenAPI snippet, not
Open agent - review-notes
This shows how the api-designer agent reviews a flawed draft. Findings are severity-ranked so the implementer fixes the contract-breakers first. Severity legend: **CRITICAL** (breaks clients / data risk), **HIGH** (real bug or inconsistency), **MEDIUM** (maintainability),
Open agent - contract-and-openapi
The contract is the deliverable. Express it as an **OpenAPI 3.1** document so it is human-readable *and* machine-checkable. This reference covers how to structure that document and what `scripts/lint-openapi.mjs` enforces.
Open agent - design-checklist
Run through this before declaring an API contract done. It is ordered the way you should *design*: resources first, cross-cutting rules last. Every box is a place real APIs go wrong in production.
Open agent - versioning-and-evolution
APIs are forever once published: a consumer you've never met may depend on any field you expose. Design so you can **add without breaking**, and version explicitly when you must break.
Open agent - pr-comment-template
Copy-paste templates for leaving review comments. Keep each comment to one finding: an anchor, the problem, and the fix.
Open agent

