symfonycontroller-cleanup
Refactor fat controllers into lean controllers by extracting business logic to services, handlers, and dedicated classes
When & Why to Use This Skill
This Claude skill specializes in refactoring Symfony applications by transforming 'fat' controllers into 'lean' ones. It automatically identifies business logic that should be decoupled from the routing layer and extracts it into reusable services, command handlers, and dedicated domain classes, significantly enhancing code maintainability, scalability, and adherence to SOLID principles.
Use Cases
- Refactoring legacy Symfony controllers where business logic has become deeply intertwined with HTTP request handling.
- Decoupling domain logic from the framework's controller layer to enable comprehensive unit testing of core business rules.
- Standardizing application architecture by migrating logic into a dedicated service layer or implementing the Command Bus pattern.
- Improving code readability and reducing technical debt in large-scale PHP projects by enforcing a separation of concerns.
| name | symfony:controller-cleanup |
|---|---|
| description | Use when symfony controller cleanup |
symfony:controller-cleanup (Micro)
Use when
- Use when symfony controller cleanup
Rules
- Keep changes minimal and focused
- Ask before running servers/builds/tests
- Load reference/examples only on explicit request
References
reference.mddocs/complexity-tiers.md