Guide · Agent skill
How to use the Laravel Patterns Guide agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The laravel-patterns skill is a set of Laravel architecture guidelines, written in Spanish with code examples, that an AI agent can load and follow. It covers routing and controllers, Eloquent ORM, service layers, queues, events, caching and API resources for production applications. This guide explains what the skill changes in the agent's behaviour, how to install it, how to trigger it, and what to check before relying on its code.
Quick start
- 1Download the ZIP. Download the laravel-patterns skill ZIP from this page. The skill's files list contains a single SKILL.md file.
- 2Unzip into a skills folder. Unzip it into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project to limit it to that project.
- 3Or upload it in the Claude apps. If you use the Claude apps, go to Settings → Capabilities → Skills and upload the skill there.
- 4Ask a Laravel question in plain language. Describe the Laravel task, such as an API endpoint, a service refactor or a query problem, without needing a special command.
- 5Check the output. Review the generated code against your Laravel version, your Sanctum setup and your authorization rules before using it.
What does the laravel-patterns skill make the agent do?
When the skill is installed, the agent answers and writes Laravel (a PHP web framework) code following production-oriented conventions. The skill's guidance is to keep the structure in clear layers: controllers, then services or single-purpose actions, then models.
It also steers the agent toward specific habits: thin controllers, scoped route bindings to prevent access across tenants, eager loading to avoid N+1 queries, and moving slow input/output work to queues while caching expensive reads. The skill is mostly written guidance with code examples; it does not run anything on its own.
- Keep controllers thin and put orchestration in services and single-purpose actions.
- Use route-model binding and resource controllers for predictable routes.
- Use scoped bindings for nested resources so a child record must belong to its parent.
- Use typed models, casts, enums and scopes to keep domain logic consistent.
- Use DB transactions for multi-step updates.
- Move heavy work to queues and cache costly reads.
How do you install the laravel-patterns skill?
Download the ZIP file for the skill from this page. Unzip it into one of two locations, depending on how you want to use it.
For a personal setup available across your projects, unzip it into ~/.claude/skills/. To limit it to a single project, unzip it into the .claude/skills/ folder inside that project.
If you use the Claude apps instead of files on disk, you can upload the skill under Settings → Capabilities → Skills.
- Personal: ~/.claude/skills/
- Single project: .claude/skills/ inside the project folder
- Claude apps: Settings → Capabilities → Skills, then upload
How do you trigger the skill with natural requests?
You do not need a special command. The skill is meant to be used when you ask for Laravel work that matches its scope: building web apps or APIs with Laravel, structuring controllers, services and domain logic, working with Eloquent models and relationships, designing APIs with resources and pagination, or adding queues, events, caching and background jobs.
Name Laravel and the task in plain language. Mentioning the kind of structure you want, such as services or API resources, makes it more likely the guidance is applied.
- Create a Laravel API endpoint for managing projects, using controllers that stay thin and an API resource for the response.
- Review this Laravel controller and suggest how to move the business logic into a service.
- Add a nested route for messages under conversations so that a message can only be read through its own conversation.
- Fix the N+1 queries in this Eloquent list page.
What do the examples look like?
The skill includes a recommended project layout with folders for Actions, Services, Http/Requests, Http/Resources, Jobs, Models and Policies, plus routes split into api.php, web.php and console.php. Its examples show a controller that delegates to an action and returns a JSON response with a success, data, error and meta structure.
For nested routes, the skill recommends scoped bindings so a child resource is looked up within its parent. For queries, it shows eager loading with with() and paginate(), so related records are loaded in a batch.
Route::scopeBindings()->group(function () { Route::get('/accounts/{account}/projects/{project}', [ProjectController::class, 'show']); });What does the skill need to run, and what are the safety notes?
The skill needs PHP and the Laravel framework, because the examples target a Laravel project. Some examples use Laravel Sanctum through auth:sanctum middleware, so Sanctum must be installed for that code to work.
The skill does not run scripts and does not use the network. Its files list contains only SKILL.md. Authorization and access control are still your responsibility: the examples, including Sanctum auth and scoped bindings, must be checked against your own authorization requirements before you ship them. Treat security-critical decisions as something to review, not to accept from the agent.
- Requires PHP and a Laravel project.
- Sanctum is needed only for the auth:sanctum examples.
- Runs scripts: no. Uses network: no.
- The examples are not tested against a specific Laravel version.
What are the limits and tips for getting good results?
The patterns are framework-specific. In a project that does not use Laravel, they add noise rather than help. The skill shapes the code the agent writes; it does not check or refactor your existing codebase on its own, so ask for a review explicitly if you want one.
Give the agent your real context, such as your models, routes and whether you use multi-tenant accounts. Ask it to explain why it chose a pattern, and confirm that the generated code runs against your Laravel version and authorization rules.
- Say which Laravel version and packages you use, since the examples are not version-tested.
- Ask for the reasoning behind a structure so you can judge whether it fits your app.
- Review every authorization check and binding before deploying.
What people use it for
- Scaffolding a Laravel JSON API with thin controllers, form requests and API resources.
- Reviewing an existing Laravel codebase for layering and routing conventions.
- Adding nested routes that use scoped bindings so child records must belong to their parent.
- Reducing N+1 queries by adding eager loading to Eloquent list pages.
- Moving slow work such as email or report generation into queues and caching repeated reads.
Frequently asked questions
Is the laravel-patterns skill free?
The source is published under the MIT licence, which is a permissive open-source licence. Check the licence file in the original repository for the exact terms before you reuse or redistribute it.
What do I need to use the laravel-patterns skill?
You need PHP and a Laravel project, because the examples target Laravel. Laravel Sanctum must also be installed if you use the auth:sanctum examples.
Where do I install the laravel-patterns skill?
Unzip the downloaded ZIP into ~/.claude/skills/ for personal use or into .claude/skills/ inside a project. In the Claude apps, you can upload it under Settings → Capabilities → Skills.
Does the laravel-patterns skill run scripts or access the internet?
No. The skill does not run scripts and does not use the network. It consists of a SKILL.md file with written guidance and code examples.
Can I use the laravel-patterns skill if my project is not Laravel?
It is not a good fit. The patterns are specific to Laravel, so in other frameworks they add noise. Use a skill or guide written for your framework instead.
Is the code from the skill safe to use in production?
Treat it as a starting point that needs review. The examples are not tested against a specific Laravel version, and authorization logic such as Sanctum auth and scoped bindings must be checked against your own requirements.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use the laravel-patterns skill if you build Laravel web apps or JSON APIs and want consistent structure, or if your team wants a reference for layering, routing and Eloquent habits, and you are comfortable reading Spanish. Pick something else if your project is not Laravel, if you need a finished app rather than code guidance, or if you need security-critical code that has already been verified.
Download the skill