symfonycontroller-cleanup

MakFly's avatarfrom MakFly

Refactor fat controllers into lean controllers by extracting business logic to services, handlers, and dedicated classes

⭐26stars🔀4forks📁View on GitHub🕐Updated Dec 30, 2025

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.
namesymfony:controller-cleanup
descriptionUse 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.md
  • docs/complexity-tiers.md