What problem does it solve?
This Skill addresses the challenges of maintaining and scaling PHP/Laravel applications by refactoring code to improve its structure, readability, and adherence to modern best practices, thereby reducing technical debt and enhancing developer productivity.
Core Features & Use Cases
- Modern PHP Adoption: Integrates PHP 8.3+/8.4+ features like property hooks, typed constants, and
#[\Override] attributes.
- Laravel Best Practices: Enforces Laravel 11+ patterns such as simplified structure, Actions, and thin controllers.
- SOLID Principles: Applies DRY, SRP, and other object-oriented design principles.
- Anti-Pattern Correction: Identifies and rectifies common issues like fat controllers, N+1 queries, and magic strings.
- Use Case: Refactor a legacy Laravel controller with complex business logic into a set of lean controllers and dedicated service classes, improving maintainability and testability.
Quick Start
Use the refactor:laravel skill to refactor the provided controller code to adhere to Laravel 11+ best practices.