What problem does it solve?
This Skill helps you scaffold and review PHP code so your project follows Clean Architecture layer rules and avoids dependency inversions that break maintainability.
Core Features & Use Cases
- Layer enforcement with deptrac: Run architecture checks to detect when controllers, use cases, repositories, or entities violate the dependency direction.
- Correct scaffolding for architecture layers: Generate Entities, Repositories, UseCases, Controllers, and Services in the right folders and namespaces configured in php-clean-architecture.yaml.
- Consistent use-case execution and observability: Invoke UseCases via the static run() helper and hook into UseCaseStartedEvent / UseCaseCompletedEvent using the Dispatcher singleton.
- Optional auto-fixing for marker interfaces: Apply Rector rules to automatically add the required marker interfaces based on class namespaces.
Quick Start
Use the php-clean-architecture Skill to scaffold a new Order UseCase and ensure it correctly implements UseCaseInterface, extends BaseUseCase, and can be executed via OrderPlaceUseCase::run($args) while keeping the Controller → UseCase → Repository → Entity dependency direction intact.