Php architecture action based
Skill ekut/claude-code-php-toolkit/skills/php-architecture-action-based
Action-Based / ADR architecture for PHP — single-action controllers, invokable handlers, Command/Query separation, Action-Domain-Responder pattern.From its SKILL.md
npx -y skills add ekut/claude-code-php-toolkit --skill php-architecture-action-basedAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.5 KB, as published. Nobody here has run it
Action-Based / ADR Architecture
Action-Based architecture organizes code around single-responsibility actions: each class handles exactly one use case. Instead of a controller with 7 methods, you have 7 small classes with one __invoke() method each. This maps naturally to how HTTP works — one URL, one handler.
The pattern is also known as ADR (Action-Domain-Responder), an alternative to MVC proposed by Paul M. Jones. ADR separates the HTTP-specific action from the domain logic and the response formatting, giving each responsibility a dedicated class.
When to Use
- The application is request-response oriented — web APIs, HTTP services, queue workers
- Each endpoint does one distinct thing — no complex multi-step wizards sharing state
- The team prefers small, focused classes over large controllers with many methods
- You want CQRS-lite without the full DDD ceremony — separate read and write paths
- The project is an API-first application or a set of microservices
- You value high testability through small, isolated units
- The team finds large controller classes hard to navigate and review
Module Index
| Topic | File | Use when… |
|---|---|---|
| Core Principles | core-principles.md | Explaining one-class-one-action, __invoke(), no god services |
| Directory Structure | directory-structure.md | Setting up a new project; choosing standard layout vs ADR variant |
| Building Blocks | building-blocks.md | Implementing actions, command/query handlers, ADR responders, route registration |
| Cross-Cutting | cross-cutting.md | Logging, auth, validation, and error handling in an action-based context |
| Anti-Patterns | anti-patterns.md | Code review, migration decisions, "When to Migrate Away", checklist |