home / skills / willsigmon / sigstack / service-consolidator
This skill consolidates duplicate service implementations by finding, comparing, selecting a winner, updating the DI container, and removing unused usages.
npx playbooks add skill willsigmon/sigstack --skill service-consolidatorReview the files below or copy the command above to add this skill to your agents.
---
name: Service Consolidator
description: Find and consolidate duplicate service implementations in Leavn app - analyze variants, choose winner, update call sites, delete duplicates
allowed-tools: Read, Edit, Grep, Glob, Bash
---
# Service Consolidator
Consolidate duplicate services:
1. **Find duplicates**: Search for services with similar names (Enhanced, Live, Base)
2. **Compare implementations**: Feature completeness, code quality, usage
3. **Choose winner**: Modern patterns (@Observable, async/await, protocol-based)
4. **Update DIContainer**: Use correct implementation
5. **Find all usages**: Grep for class name
6. **Delete unused**: Remove files + update imports
Use when: Multiple similar services exist, Enhanced variants, consolidation needed
This skill helps consolidate duplicate service implementations in the Leavn app by identifying similar service variants, selecting the best implementation, and updating callers and the dependency container. It streamlines maintenance by reducing redundant code paths and ensuring a single, modern implementation is used across the codebase. The workflow focuses on safety: analyze, pick a winner, update DI and usages, then safely remove duplicates.
The skill scans the TypeScript codebase for services with similar names and common suffixes like Enhanced, Live, or Base. It compares implementations for feature coverage, modern patterns (Observables, async/await, protocol-based interfaces), and code quality. After selecting a winner, it updates the DIContainer binding, finds and replaces all call sites to reference the chosen class, and removes redundant files and imports.
How do I choose the winning implementation?
Compare feature coverage, test coverage, adherence to modern patterns, and ease of maintenance. Prefer the implementation that best matches project conventions and has the fewest breaking changes required.
What if the winner lacks some niche behavior?
Add the missing behavior to the winner or create a small adapter. Avoid keeping full duplicate implementations; prefer protocol-based extension points.
How do I ensure no usages are missed?
Use both static search (grep/IDE) for class and file names and run the test suite and integration tests. Consider build-time type checks to reveal unresolved imports.