Laravel 13 App Guidelines
Overview
Use a repository-first workflow for Laravel 13 work. Detect the actual framework,
packages, frontend, command runner, and local conventions before selecting a
Laravel pattern; do not turn optional Laravel 13 capabilities into dependencies.
This skill owns version-specific Laravel implementation and upgrade guidance,
not the whole task lifecycle. Keep routine testing, documentation, Docker
command execution, and UI reuse as supporting work. Return routing control to
project-development-mindset if debugging, test strategy, local container
topology, UI concept work, or deployment becomes the primary concern.
Run this skill in the main conversation. Do not spawn subagents, agent teams, or
delegated parallel workers unless the user explicitly approves the proposed
agent count and scope after being told that delegation can increase usage. Ask
again before expanding the approved scope.
Execute the Workflow
- Read repository instructions such as
AGENTS.md, CLAUDE.md, and relevant
docs/ files before making decisions.
- Inspect
composer.json, composer.lock, package.json, frontend lockfiles,
bootstrap/app.php, bootstrap/providers.php, routes, configuration, and
tests. Use php artisan about or composer show when dependencies are
installed and the repository's command runner permits it.
- Identify the supported command path: host PHP, Sail, Docker Compose, or a
repository wrapper. Reuse that path consistently and do not assume Sail.
- Confirm the application shape: API-only or full-stack; Blade, Livewire, or
Inertia; frontend framework and major version; authentication; test runner;
queue, cache, search, and database drivers.
- Consult version-matched guidance before changing framework behavior. Prefer
Laravel Boost
search-docs when Boost is installed and available; otherwise
use Laravel 13.x or the installed package's official documentation.
- Follow existing architecture and naming. Implement the smallest coherent
change, add or update focused tests, and run focused checks for the affected
surface. After implementation is complete, ask the user whether to run any
broader or full suite.
Do not install, upgrade, or replace packages merely because this skill lists
them. Confirm a task requirement and compatibility first.
Apply the Laravel 13 Baseline
- Require PHP 8.3 or newer for Laravel 13 and respect the exact platform range
declared by the repository and its deployment environment.
- Configure application routing, middleware, and exception handling through
bootstrap/app.php when the project follows the modern skeleton. Register
application providers through bootstrap/providers.php.
- Treat
routes/web.php and routes/console.php as fresh-application defaults.
routes/api.php and routes/channels.php are optional and may be installed by
install:api and install:broadcasting; do not assume they exist.
- Preserve an upgraded application's established structure when it remains
supported. Do not reorganize it to resemble a fresh Laravel 13 application
unless the task requires that migration.
- Use named arguments for Laravel framework methods cautiously because parameter
names are outside Laravel's backward-compatibility promise.
Design HTTP and Domain Changes
- Keep controllers and route closures thin. Put reusable domain behavior in the
application's existing action, service, job, model, or domain layer instead
of introducing a new abstraction by default.
- Use Form Requests for reusable or non-trivial validation and authorization.
Inline validation remains reasonable for a small one-off endpoint when it
matches local conventions.
- Enforce authorization with policies, gates, or the repository's established
authorization layer; validation is not authorization.
- Prefer Eloquent models and relationships for domain-oriented work. Use the
query builder or bound raw expressions when they make bulk or complex queries
clearer and measurable; never interpolate untrusted SQL.
- Prevent N+1 queries with deliberate eager loading, constrain selected columns
when useful, and use
whenLoaded in API resources. Paginate, cursor, or chunk
large result sets according to consistency and memory requirements.
- Wrap multi-write invariants in transactions and make queued side effects safe
for retries. Dispatch after commit when consumers require committed data.
- When changing a column with
change(), restate every modifier that must be
retained because omitted modifiers are dropped. Inspect the current schema
first and make migrations reversible when practical.
- Ask for explicit approval before destructive database commands or migrations,
including
migrate:fresh, db:wipe, broad deletes, and irreversible drops.
Build APIs Deliberately
- Add or use
routes/api.php only when the project exposes a stateless API. Use
install:api only when adding that surface is part of the requested change.
- Follow the existing response envelope, error format, pagination, and versioning
contract. Use standard API Resources by default when the project uses them.
- Use Laravel 13 JSON:API Resources only when the API contract requires JSON:API;
do not silently convert an established API format.
- Detect Sanctum, Passport, session authentication, WorkOS AuthKit, or custom
authentication from installed packages and configuration. Preserve its guard
and token semantics.
- Keep API-only work independent of Vite, Tailwind, and Node unless those tools
are already part of the requested surface.
Follow the Detected Frontend Stack
- Discover page, component, and layout paths from the repository; casing and
locations vary. Do not assume
resources/js/Pages.
- For Inertia, use the APIs supported by the installed Inertia major version.
Official Laravel 13 starter kits use Inertia 3 for React, Vue, and Svelte, but
existing Laravel 13 apps may use another compatible version.
- Use Inertia links, forms, visits, partial reloads, deferred data, and SSR only
where the installed adapter and local patterns support them. Provide loading,
empty, validation, and error states for affected interactions.
- Use Wayfinder only when installed. Prefer generated named imports where the
project supports them and run the repository's route-generation or build
command after route changes.
- For Livewire, follow the installed Livewire version and component style. Use
Flux UI only when present; do not replace Blade or existing components merely
to match a starter kit.
- For Tailwind CSS 4, preserve the project's CSS-first configuration, tokens,
component library, responsive rules, and dark-mode strategy. Do not migrate a
working Tailwind 3 setup unless requested.
- Read
references/stack-guidance.md when the task touches starter kits,
authentication, Inertia, Livewire, Blade, Wayfinder, or Tailwind.
Adopt Laravel 13 Features Only When They Fit
Laravel 13 adds first-party AI primitives, JSON:API resources, semantic and
vector search, and stronger request-forgery defaults. Treat each as an optional
design choice with package, provider, database, security, cost, and operational
consequences. Read references/laravel-13-features-and-upgrade.md before using a
new Laravel 13 feature or upgrading an application from Laravel 12.
Test, Format, and Verify
- Preserve Pest or PHPUnit according to the repository. Laravel 13 supports both;
do not force PHPUnit into a Pest project or vice versa.
- Prefer feature tests for behavior crossing framework boundaries and focused
unit tests for isolated logic. Add regression tests for bug fixes.
- Confirm generator flags with
php artisan help make:test before using them.
For upgrades, expect Pest 4 or PHPUnit 12 only after dependency compatibility
has been verified.
- Run the smallest relevant test target. Use the repository wrapper and test
database; never point tests at production.
- Run focused formatting, static analysis, frontend lint, type-check, build, and
browser or E2E checks when they can fail for the changed surface. After
implementation and focused verification are complete, list the broader
affected or full-suite commands and ask the user whether to run them. Do not
run them without explicit approval unless higher-priority repository
instructions require it.
- Report the exact checks run, results, and any checks that could not run.
Use Laravel Boost Safely
- Read application information before relying on framework or package versions.
- Use
search-docs with short topic queries before implementing version-sensitive
behavior. Let Boost filter documentation by installed package versions.
- Discover the tools exposed by the installed Boost server instead of assuming
every Boost release has the same names or capabilities.
- Keep database inspection read-only and scope executable-code tools to local or
test environments. Never use Tinker or database tools to mutate production
data without explicit authorization.
- Read
references/boost-tools.md for the current tool-selection and fallback
workflow.
Preserve Project Integrity
- Reuse existing dependencies, components, factories, policies, resources, and
conventions before creating replacements.
- Keep credentials in environment configuration and never expose secrets in
logs, fixtures, frontend bundles, or agent output.
- Update durable documentation when behavior, setup, public APIs, or operational
procedures change.
- Distinguish framework facts from recommendations and from repository-specific
conventions in the final handoff.
1---2name: laravel-13-app-guidelines3description: Coordinator-routed implementation and upgrade guidance for confirmed Laravel 13 repositories or Laravel 12-to-13 upgrades when framework conventions materially own the work. Use after project-development-mindset inspects the installed or target laravel/framework major, or directly when explicitly invoked or installed standalone. Never load both Laravel version skills; do not use merely for supporting Docker, test, frontend, or Artisan commands.4---5
6# Laravel 13 App Guidelines
7
8## Overview
9
10Use a repository-first workflow for Laravel 13 work. Detect the actual framework,
11packages, frontend, command runner, and local conventions before selecting a
12Laravel pattern; do not turn optional Laravel 13 capabilities into dependencies.
13
14This skill owns version-specific Laravel implementation and upgrade guidance,
15not the whole task lifecycle. Keep routine testing, documentation, Docker
16command execution, and UI reuse as supporting work. Return routing control to
17`project-development-mindset` if debugging, test strategy, local container
18topology, UI concept work, or deployment becomes the primary concern.
19
20Run this skill in the main conversation. Do not spawn subagents, agent teams, or
21delegated parallel workers unless the user explicitly approves the proposed
22agent count and scope after being told that delegation can increase usage. Ask
23again before expanding the approved scope.
24
25## Execute the Workflow
26
271. Read repository instructions such as `AGENTS.md`, `CLAUDE.md`, and relevant
28 `docs/` files before making decisions.
292. Inspect `composer.json`, `composer.lock`, `package.json`, frontend lockfiles,
30 `bootstrap/app.php`, `bootstrap/providers.php`, routes, configuration, and
31 tests. Use `php artisan about` or `composer show` when dependencies are
32 installed and the repository's command runner permits it.
333. Identify the supported command path: host PHP, Sail, Docker Compose, or a
34 repository wrapper. Reuse that path consistently and do not assume Sail.
354. Confirm the application shape: API-only or full-stack; Blade, Livewire, or
36 Inertia; frontend framework and major version; authentication; test runner;
37 queue, cache, search, and database drivers.
385. Consult version-matched guidance before changing framework behavior. Prefer
39 Laravel Boost `search-docs` when Boost is installed and available; otherwise
40 use Laravel 13.x or the installed package's official documentation.
416. Follow existing architecture and naming. Implement the smallest coherent
42 change, add or update focused tests, and run focused checks for the affected
43 surface. After implementation is complete, ask the user whether to run any
44 broader or full suite.
45
46Do not install, upgrade, or replace packages merely because this skill lists
47them. Confirm a task requirement and compatibility first.
48
49## Apply the Laravel 13 Baseline
50
51- Require PHP 8.3 or newer for Laravel 13 and respect the exact platform range
52 declared by the repository and its deployment environment.
53- Configure application routing, middleware, and exception handling through
54 `bootstrap/app.php` when the project follows the modern skeleton. Register
55 application providers through `bootstrap/providers.php`.
56- Treat `routes/web.php` and `routes/console.php` as fresh-application defaults.
57 `routes/api.php` and `routes/channels.php` are optional and may be installed by
58 `install:api` and `install:broadcasting`; do not assume they exist.
59- Preserve an upgraded application's established structure when it remains
60 supported. Do not reorganize it to resemble a fresh Laravel 13 application
61 unless the task requires that migration.
62- Use named arguments for Laravel framework methods cautiously because parameter
63 names are outside Laravel's backward-compatibility promise.
64
65## Design HTTP and Domain Changes
66
67- Keep controllers and route closures thin. Put reusable domain behavior in the
68 application's existing action, service, job, model, or domain layer instead
69 of introducing a new abstraction by default.
70- Use Form Requests for reusable or non-trivial validation and authorization.
71 Inline validation remains reasonable for a small one-off endpoint when it
72 matches local conventions.
73- Enforce authorization with policies, gates, or the repository's established
74 authorization layer; validation is not authorization.
75- Prefer Eloquent models and relationships for domain-oriented work. Use the
76 query builder or bound raw expressions when they make bulk or complex queries
77 clearer and measurable; never interpolate untrusted SQL.
78- Prevent N+1 queries with deliberate eager loading, constrain selected columns
79 when useful, and use `whenLoaded` in API resources. Paginate, cursor, or chunk
80 large result sets according to consistency and memory requirements.
81- Wrap multi-write invariants in transactions and make queued side effects safe
82 for retries. Dispatch after commit when consumers require committed data.
83- When changing a column with `change()`, restate every modifier that must be
84 retained because omitted modifiers are dropped. Inspect the current schema
85 first and make migrations reversible when practical.
86- Ask for explicit approval before destructive database commands or migrations,
87 including `migrate:fresh`, `db:wipe`, broad deletes, and irreversible drops.
88
89## Build APIs Deliberately
90
91- Add or use `routes/api.php` only when the project exposes a stateless API. Use
92 `install:api` only when adding that surface is part of the requested change.
93- Follow the existing response envelope, error format, pagination, and versioning
94 contract. Use standard API Resources by default when the project uses them.
95- Use Laravel 13 JSON:API Resources only when the API contract requires JSON:API;
96 do not silently convert an established API format.
97- Detect Sanctum, Passport, session authentication, WorkOS AuthKit, or custom
98 authentication from installed packages and configuration. Preserve its guard
99 and token semantics.
100- Keep API-only work independent of Vite, Tailwind, and Node unless those tools
101 are already part of the requested surface.
102
103## Follow the Detected Frontend Stack
104
105- Discover page, component, and layout paths from the repository; casing and
106 locations vary. Do not assume `resources/js/Pages`.
107- For Inertia, use the APIs supported by the installed Inertia major version.
108 Official Laravel 13 starter kits use Inertia 3 for React, Vue, and Svelte, but
109 existing Laravel 13 apps may use another compatible version.
110- Use Inertia links, forms, visits, partial reloads, deferred data, and SSR only
111 where the installed adapter and local patterns support them. Provide loading,
112 empty, validation, and error states for affected interactions.
113- Use Wayfinder only when installed. Prefer generated named imports where the
114 project supports them and run the repository's route-generation or build
115 command after route changes.
116- For Livewire, follow the installed Livewire version and component style. Use
117 Flux UI only when present; do not replace Blade or existing components merely
118 to match a starter kit.
119- For Tailwind CSS 4, preserve the project's CSS-first configuration, tokens,
120 component library, responsive rules, and dark-mode strategy. Do not migrate a
121 working Tailwind 3 setup unless requested.
122- Read `references/stack-guidance.md` when the task touches starter kits,
123 authentication, Inertia, Livewire, Blade, Wayfinder, or Tailwind.
124
125## Adopt Laravel 13 Features Only When They Fit
126
127Laravel 13 adds first-party AI primitives, JSON:API resources, semantic and
128vector search, and stronger request-forgery defaults. Treat each as an optional
129design choice with package, provider, database, security, cost, and operational
130consequences. Read `references/laravel-13-features-and-upgrade.md` before using a
131new Laravel 13 feature or upgrading an application from Laravel 12.
132
133## Test, Format, and Verify
134
135- Preserve Pest or PHPUnit according to the repository. Laravel 13 supports both;
136 do not force PHPUnit into a Pest project or vice versa.
137- Prefer feature tests for behavior crossing framework boundaries and focused
138 unit tests for isolated logic. Add regression tests for bug fixes.
139- Confirm generator flags with `php artisan help make:test` before using them.
140 For upgrades, expect Pest 4 or PHPUnit 12 only after dependency compatibility
141 has been verified.
142- Run the smallest relevant test target. Use the repository wrapper and test
143 database; never point tests at production.
144- Run focused formatting, static analysis, frontend lint, type-check, build, and
145 browser or E2E checks when they can fail for the changed surface. After
146 implementation and focused verification are complete, list the broader
147 affected or full-suite commands and ask the user whether to run them. Do not
148 run them without explicit approval unless higher-priority repository
149 instructions require it.
150- Report the exact checks run, results, and any checks that could not run.
151
152## Use Laravel Boost Safely
153
154- Read application information before relying on framework or package versions.
155- Use `search-docs` with short topic queries before implementing version-sensitive
156 behavior. Let Boost filter documentation by installed package versions.
157- Discover the tools exposed by the installed Boost server instead of assuming
158 every Boost release has the same names or capabilities.
159- Keep database inspection read-only and scope executable-code tools to local or
160 test environments. Never use Tinker or database tools to mutate production
161 data without explicit authorization.
162- Read `references/boost-tools.md` for the current tool-selection and fallback
163 workflow.
164
165## Preserve Project Integrity
166
167- Reuse existing dependencies, components, factories, policies, resources, and
168 conventions before creating replacements.
169- Keep credentials in environment configuration and never expose secrets in
170 logs, fixtures, frontend bundles, or agent output.
171- Update durable documentation when behavior, setup, public APIs, or operational
172 procedures change.
173- Distinguish framework facts from recommendations and from repository-specific
174 conventions in the final handoff.