Agent skill
Laravel Architecture
Core architectural standards for scalable Laravel applications.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/architecture-hoangnguyen0403-agent-skills-standar-5
Metadata
Additional technical details for this skill
- labels
-
laravel architecture srp service-layer
- triggers
-
{ "files": [ "app/Http/Controllers/**/*.php", "routes/*.php" ], "keywords": [ "controller", "service", "action", "request", "container" ] }
SKILL.md
Laravel Architecture
Priority: P0 (CRITICAL)
Structure
app/
├── Http/
│ ├── Controllers/ # Slim (Request/Response only)
│ └── Requests/ # Validation logic
├── Services/ # Business logic (Optional)
└── Actions/ # Single-purpose classes (Preferred)
Implementation Guidelines
- Skinny Controllers: Keep controllers focused on routing and response.
- Service/Actions: Extract complex logic into Service or Action classes.
- Form Requests: Use
php artisan make:requestfor all validation tags. - DI usage: Inject dependencies via constructors or method injection.
- No Logic in Routes: Always delegate route closures to controllers.
- Contract First: Use Interfaces for decoupling third-party integrations.
Anti-Patterns
- Fat Controllers: No logic in Controllers: Move processing elsewhere.
- New Keyword: No Manual Instantiation: Use Service Container via DI.
- Inline Validation: No $request->validate(): Favor Form Requests.
- Global Helpers: No excessive helpers: Use class-based logic.
References
- Slim Controller Patterns
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?