| name | refactor |
| description | Analyse code for SOLID and DRY violations and produce a concrete refactoring plan |
| context | fork |
| agent | solid-analyst |
| disable-model-invocation | true |
| allowed-tools | Read, Glob, Grep, LSP |
Analyse the following for SOLID and DRY violations: $ARGUMENTS
Before You Start
Read these knowledge files for context:
- docs/dev/project-patterns.md
- docs/dev/swift-concurrency.md
Analysis Framework
Analyse the code for:
- Single Responsibility: Does each type have one reason to change? Are unrelated concerns mixed?
- Open/Closed: Can new behaviour be added without modifying existing code?
- Liskov Substitution: Do protocol implementations violate contracts?
- Interface Segregation: Are protocols focused? This project uses
-ing suffix (Enumerating, VolumeControlling, etc.)
- Dependency Inversion: Do high-level modules depend on abstractions? Inject
-ing protocols, not concrete services.
- DRY: Are constants in AudioConstants/MeterConstants? Are utilities in AudioMath/MeterMath? Is logic duplicated?
Output
Produce a refactoring plan with:
- Goal: What the refactoring achieves
- Problems: Each violation with file path, type/function name, and principle violated
- Approach: High-level improved structure
- Files to modify: Explicit paths
- Steps: Incremental, each leaving the project compiling
Each step should be small, safe, and preserve existing behaviour.