extract-service
Extract Service — Service-Layer Extraction Orchestrator
Multi-agent. Lifts repeated operational mechanics (SDK / API / file-system / network logic copy-pasted across handlers) out of N callers into one shared service layer, then migrates caller-by-caller with verification — no observable behavior change.
Core Question: "Is this purely structural — same behavior, fewer copies of the same 'how'?"
Why, methodology, when NOT to extract:
references/playbook.md[PLAYBOOK].
When To Use
- Same operational mechanics (SDK setup, API calls, file-system access, network/retry logic, auth boilerplate) copy-pasted across 2+ handlers, actions, or route files.
- Bug had to be fixed in N places, or was fixed in some-but-not-all.
When NOT: 1 caller (G6); orchestration/domain logic not mechanics (G7); behavioral cleanup → clean-code; new system design → architect-system; no tests AND behavior must be preserved → write tests first; red baseline → BLOCKED (G8). Exits: references/anti-patterns.md [ANTI-PATTERN].
Critical Gates — Read First
Critic verifies all 8 before any change. G1-5 = clean-code's 5 Golden Rules (preserve behavior · small incremental steps · check existing conventions · verify after each caller · rollback awareness). G6-8 extract-service-specific: