php-clean-architecture
CommunityEnforce Clean Architecture in PHP projects
Software Engineering#code scaffolding#php#clean architecture#deptrac#layered dependencies#use case orchestration#event dispatcher
Authorgiacomomasseron
Version1.0.0
Installs0
System Documentation
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.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: php-clean-architecture Download link: https://github.com/giacomomasseron/php-clean-architecture/archive/main.zip#php-clean-architecture Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.