← ClaudeAtlas

extract-servicelisted

Extracts repeated operational mechanics (SDK, API, file-system, or network logic copy-pasted across handlers or actions) into a shared service layer — produces a stepwise migration plan, then applies it caller-by-caller with verification at each step. Use when the same "how" recurs across 2+ callers. Not for behavioral cleanup or dead code (use clean-code) or designing a system from scratch (use architect-system). For a quality review after migrating, see review-work.
hungv47/meta-skills · ★ 9 · Data & Documents · score 75
Install: claude install-skill hungv47/meta-skills
# 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`](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`](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: - **G6 Extraction threshold** — <2 real callers → `NEEDS_CONTEXT`. - **G7 Two-layer purity** — service holds only the shared *how*; or