- Home
- Skills
- Code Quality & Review
- Laravel Production Architect
Works with the AI Agents you already use
Laravel Production Architect
Ship Laravel apps with clean architecture, hardened APIs, and production-ready performance patterns.
Free
Laravel Production Architect
Example session with this skill installed
Our order module's OrderController::checkout() is 380 lines, with inline validation and synchronous Stripe webhook calls. Prod is also showing N+1 warnings on /api/v1/orders. Refactor it into the standard lifecycle: a FormRequest for validation, an Action class for the checkout use case, an API Resource for the response, and move webhook delivery into a retry-safe queued job with backoff. Add a policy so users can only read their own orders, and audit the listing query for eager loading. Show me the resulting file structure, the key diffs, and which tests to add.
- Read your context and instructions
- Compiled the laravel production architect
Summary
Refactored OrderController@checkout from 380 lines into four focused classes plus a queued webhook job, fixed the N+1 on the orders listing, and added an OrderPolicy that blocks cross-user access.
| Metric | Before | After |
|---|---|---|
| Lines in controller | 380 | 42 |
| Queries on order index | 51 | 3 |
| Checkout p95 latency | 2.4s | 0.6s (webhook queued) |
| Ownership enforcement | scattered if checks | Policy + IDOR guard |
app/Domain/Orders/Actions/CheckoutOrder.php
app/Http/Requests/CheckoutOrderRequest.php
app/Http/Resources/OrderResource.php
app/Jobs/DeliverStripeWebhook.php # tries=5, backoff 5–120s
Next steps
- Run
php artisan test --filter=Checkoutand add feature tests for policy denials and the validation error shape. - Add an index on
orders(user_id, status, placed_at)for the filtered listing query. - Run
queue:workunder supervisor so webhook retries survive deploys.
Connects securely to your tools. The creator never sees your data.
About this skill
Build and maintain Laravel applications that survive production traffic and technical audits. This skill enforces a senior engineering mindset, focusing on framework-native patterns, predictable structure, and security by default. It helps you move past messy controllers and unvalidated inputs toward a clean architecture that scales without over-engineering.
What it does
- Architectural Design Provides structured boundaries using Actions, Services, and Domain logic to keep codebases manageable.
- Production Hardening Enforces secure defaults, including FormRequest validation, Policy-based authorization, and rate limiting.
- Performance Optimization Identifies N+1 queries, suggests eager loading strategies, and implements robust caching with invalidation.
- API Standardisation Generates stable JSON payloads using API Resources and consistent error shapes for mobile or SPA consumers.
- Reliable Backgrounding Designs retry-safe Queue jobs with proper backoff, unique locks, and stateless execution.
How it works
- Define the Scope Provide a feature requirement, a messy controller, or a database schema.
- Review & Audit The agent analyzes the input for security risks, performance bottlenecks, and framework anti-patterns.
- Refactor & Implement You receive framework-idiomatic code following the request lifecycle: Routes, Middleware, FormRequests, and Resources.
Frameworks & tools
Laravel 10/11+, Eloquent, Sanctum, Redis for caching/queues, and PHP 8.2+ type systems.
Why this beats prompting it yourself
Generic prompts often result in "helper-heavy" code or logic leaks into Blade views and controllers. This skill enforces strict architectural boundaries and production-ready security patterns that standard LLMs frequently overlook.
Use cases
- Refactoring a "God Controller" into discrete, testable Actions and Services.
- Building a secure, versioned JSON API for a mobile application.
- Troubleshooting database bottlenecks and implementing N+1 query fixes.
- Designing a reliable background processing system for high-volume webhooks.
Known limitations
Does not support frontend-only tasks, non-Laravel PHP frameworks, or infrastructure-level database migrations unrelated to application design.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.
Laravel-specific — pure PHP, Symfony, or other frameworks are out of scope. Examples target Laravel 10/11 conventions; newer majors may need small adjustments.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
2 uses
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 1 month ago
- Free with an Agensi account
Permissions
File Scopes
Reads and edits Laravel project source and runs artisan/test commands locally, so no network access or secrets are required.