Laravel clean architecture

From HoangNguyen0403/agent-skills-standard · View interactive version

Laravel clean architecture is an AI agent skill from the GitHub repository HoangNguyen0403/agent-skills-standard. Implement Domain-Driven Design with typed DTOs, repository interfaces, and single-responsibility Action classes in Laravel. Use when creating domain folders, binding repository contracts in providers, or passing DTOs between layers.

How to use this skill

Skill file

Laravel Clean Architecture

**Priority: P1 (HIGH)**

Workflow: Add Domain Feature

  1. Create domain folder — app/Domains/Order/{Actions,DTOs,Contracts}/.
  2. Define DTO — Create readonly class with typed constructor properties.
  3. Create contract — Define repository interface in Contracts/.
  4. Implement repository — Build Eloquent implementation; bind in AppServiceProvider.
  5. Write Action class — Single-responsibility use-case logic consuming DTO.
  6. Verify bindings — Run php artisan tinker and resolve interface to confirm DI works.

Action + DTO Example

See implementation examples for Action class with DTO and domain structure patterns.

Implementation Guidelines

Domain-Driven Design (DDD)

Data Transfer Objects (DTOs)

Repository Pattern & Decoupling

Anti-Patterns

References

Boundary checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.