$npx -y skills add fusengine/agents --skill laravel-architectureDesign Laravel app architecture with services, repositories, actions, and clean code patterns. Use when structuring projects, creating services, implementing DI, or organizing code layers.
| 1 | # Laravel Architecture Patterns |
| 2 | |
| 3 | ## Agent Workflow (MANDATORY) |
| 4 | |
| 5 | Before ANY implementation, use `TeamCreate` to spawn 3 agents: |
| 6 | |
| 7 | 1. **fuse-ai-pilot:explore-codebase** - Analyze existing architecture |
| 8 | 2. **fuse-ai-pilot:research-expert** - Verify Laravel patterns via Context7 |
| 9 | 3. **mcp__context7__query-docs** - Check service container and DI patterns |
| 10 | |
| 11 | After implementation, run **fuse-ai-pilot:sniper** for validation. |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | ## Overview |
| 16 | |
| 17 | Laravel architecture focuses on clean separation of concerns, dependency injection, and maintainable code organization. This skill covers everything from project structure to production deployment. |
| 18 | |
| 19 | ### When to Use |
| 20 | |
| 21 | - Structuring new Laravel projects |
| 22 | - Implementing services, repositories, actions |
| 23 | - Setting up dependency injection |
| 24 | - Configuring development environments |
| 25 | - Deploying to production |
| 26 | |
| 27 | --- |
| 28 | |
| 29 | ## Critical Rules |
| 30 | |
| 31 | 1. **Thin controllers** - Delegate business logic to services |
| 32 | 2. **Interfaces in app/Contracts/** - Never alongside implementations |
| 33 | 3. **DI over facades** - Constructor injection for testability |
| 34 | 4. **Files < 100 lines** - Split larger files per SOLID |
| 35 | 5. **Environment separation** - .env never committed |
| 36 | |
| 37 | --- |
| 38 | |
| 39 | ## Architecture |
| 40 | |
| 41 | ```text |
| 42 | app/ |
| 43 | ├── Actions/ # Single-purpose action classes |
| 44 | ├── Contracts/ # Interfaces (DI) |
| 45 | ├── DTOs/ # Data transfer objects |
| 46 | ├── Enums/ # PHP 8.1+ enums |
| 47 | ├── Events/ # Domain events |
| 48 | ├── Http/ |
| 49 | │ ├── Controllers/ # Thin controllers |
| 50 | │ ├── Middleware/ # Request filters |
| 51 | │ ├── Requests/ # Form validation |
| 52 | │ └── Resources/ # API transformations |
| 53 | ├── Jobs/ # Queued jobs |
| 54 | ├── Listeners/ # Event handlers |
| 55 | ├── Models/ # Eloquent models only |
| 56 | ├── Policies/ # Authorization |
| 57 | ├── Providers/ # Service registration |
| 58 | ├── Repositories/ # Data access layer |
| 59 | └── Services/ # Business logic |
| 60 | ``` |
| 61 | |
| 62 | --- |
| 63 | |
| 64 | ## Reference Guide |
| 65 | |
| 66 | ### Core Architecture |
| 67 | |
| 68 | | Reference | When to Use | |
| 69 | |-----------|-------------| |
| 70 | | [container.md](references/container.md) | Dependency injection, binding, resolution | |
| 71 | | [providers.md](references/providers.md) | Service registration, bootstrapping | |
| 72 | | [facades.md](references/facades.md) | Static proxies, real-time facades | |
| 73 | | [contracts.md](references/contracts.md) | Interfaces, loose coupling | |
| 74 | | [structure.md](references/structure.md) | Directory organization | |
| 75 | | [lifecycle.md](references/lifecycle.md) | Request handling flow | |
| 76 | |
| 77 | ### Configuration & Setup |
| 78 | |
| 79 | | Reference | When to Use | |
| 80 | |-----------|-------------| |
| 81 | | [configuration.md](references/configuration.md) | Environment, config files | |
| 82 | | [installation.md](references/installation.md) | New project setup | |
| 83 | | [upgrade.md](references/upgrade.md) | Version upgrades, breaking changes | |
| 84 | | [releases.md](references/releases.md) | Release notes, versioning | |
| 85 | |
| 86 | ### Development Environments |
| 87 | |
| 88 | | Reference | When to Use | |
| 89 | |-----------|-------------| |
| 90 | | [sail.md](references/sail.md) | Docker development | |
| 91 | | [valet.md](references/valet.md) | macOS native development | |
| 92 | | [homestead.md](references/homestead.md) | Vagrant (legacy) | |
| 93 | | [octane.md](references/octane.md) | High-performance servers | |
| 94 | |
| 95 | ### Utilities & Tools |
| 96 | |
| 97 | | Reference | When to Use | |
| 98 | |-----------|-------------| |
| 99 | | [artisan.md](references/artisan.md) | CLI commands, custom commands | |
| 100 | | [helpers.md](references/helpers.md) | Global helper functions | |
| 101 | | [filesystem.md](references/filesystem.md) | File storage, S3, local | |
| 102 | | [processes.md](references/processes.md) | Shell command execution | |
| 103 | | [context.md](references/context.md) | Request-scoped data sharing | |
| 104 | |
| 105 | ### Advanced Features |
| 106 | |
| 107 | | Reference | When to Use | |
| 108 | |-----------|-------------| |
| 109 | | [pennant.md](references/pennant.md) | Feature flags | |
| 110 | | [mcp.md](references/mcp.md) | Model Context Protocol | |
| 111 | | [concurrency.md](references/concurrency.md) | Parallel execution | |
| 112 | |
| 113 | ### Operations |
| 114 | |
| 115 | | Reference | When to Use | |
| 116 | |-----------|-------------| |
| 117 | | [de |