← ClaudeAtlas

strangler-fig-methodlisted

Use to REPLACE part of an existing brownfield system incrementally — behind a routing facade, one slice at a time, verified by contract equivalence against a green safety net — rather than restructuring it in place. Loaded internally by brownfield-refactorer when the human chooses replacement over Mikado in-place restructuring.
SebastienDegodez/skraft-plugin · ★ 4 · AI & Automation · score 63
Install: claude install-skill SebastienDegodez/skraft-plugin
# Strangler Fig Method Replaces a component by growing a new implementation alongside the old one, behind a facade that routes traffic, slice by slice, until the old implementation has no callers left and can be deleted. Unlike Mikado (restructure what exists), this method REPLACES it — appropriate when the existing code is too coupled to restructure safely, or when the target is a different stack/design entirely. **Precondition.** Same as Mikado: a green safety net (`characterize-with-contracts` / `brownfield-harness-builder`) must exist first. Here the safety net does double duty — it is replayed against BOTH the old and the new implementation; a slice only cuts over when the new implementation is contract-equivalent to the old one on every test in the harness. ## Procedure ### 1. Establish the facade Introduce (or confirm an existing) routing seam in front of the component being replaced — a gateway route, a feature-flagged branch, or a proxy layer — such that traffic can be switched per-slice between OLD and NEW without touching callers. If no seam exists, this is the first prerequisite: build the facade itself as slice zero, verified by the harness against the OLD implementation only (no NEW yet — this slice just proves the facade is transparent). ### 2. Slice the surface Partition the component's contract (the same contract discovered/reconstructed by `characterize-with-contracts`) into independently-cutover-able slices. Default granularity for v1: **one slice pe