spatie/guidelines-skills
Spatie's battle-tested coding guidelines packaged as AI skills, compatible with Laravel Boost and skills.sh. Covers Laravel/PHP conventions, JavaScript standards, Git workflow, and security best practices, installable via Composer or npx skills add.
Architecture fit
This is not a library — it is a content artifact. There is no service provider, no config file, no runtime code path, no facade. It ships four markdown skill definitions (spatie-laravel-php, spatie-javascript, spatie-version-control, spatie-security), each a short SKILL.md (overview, activation triggers, scope, summary rules) plus a long references/ document that an AI agent reads on demand.
That means its architectural role is advisory upstream pressure on code generation, sitting beside — not inside — the enforcement layer:
| Layer | Owner | Purpose |
|---|---|---|
Skill content (vendor/spatie/guidelines-skills) |
This package | Shapes what the agent produces |
| Agent tooling (Laravel Boost) | laravel/boost |
Docs search, REPL-style tools, skill installation |
| Deterministic gates (Pint, PHPStan, Prettier, ESLint) | Your repo | Catches what the agent got wrong |
Project conventions (AGENTS.md / CLAUDE.md / .cursorrules) |
Your team | Overrides and gaps |
It fits cleanly as a --dev dependency in Laravel repos where the team already uses a coding agent. It is a poor fit anywhere the expectation is "this makes our code compliant" — it cannot fail a build.
Integration feasibility
Genuinely low effort. Two install paths:
composer require laravel/boost --dev, composer require spatie/guidelines-skills --dev, php artisan boost:install, then select the Spatie guidelines and the agents you actually use. Updates are composer update spatie/guidelines-skills && php artisan boost:update.npx skills add spatie/guidelines-skills. Effectively tracks latest.No version constraints to negotiate against a Laravel runtime, no autoload conflicts, no migration. Pick one channel per repo — mixing a pinned Composer version with npx latest produces divergent agent behavior across machines with no visible cause.
Technical risk
boost:update changes what your agent believes is correct with no failing build to alert you. Release 1.0.0 → 1.1.0 was literally "update packaged guidelines." Treat a guideline bump as a policy change and review the markdown diff.AGENTS.md.prettier.config.js at two spaces / 80 makes agent and formatter disagree on every file.Key questions
boost:install target the one each engineer actually runs?boost:update PR, and reading the guideline diff before merge?vendor/, some local) is the worst configuration.spatie-version-control conflict with our existing commit/branch discipline, and who arbitrates?Stack fit
Direct fit for Laravel/PHP backends on a Laravel version supported by laravel/boost (the docs reference Laravel 13.x Boost). Secondary fit for JS/TS/Vue frontends via spatie-javascript, provided Prettier is realigned. spatie-security is useful as a review prompt but spans application, database, server, and Git signing — parts of it (SSH config, unattended upgrades, firewall) sit outside the repo and outside the agent's reach, so it acts as a checklist rather than something the agent executes.
Migration path
Purely additive — nothing to migrate. There is a deliberate fork decision at the outset:
--dev dependency, update on the normal dependency cadence, review the resulting markdown diff as a change. Lower ownership cost, less control.skills/ into .ai/skills/ (or the agent's directory), delete what conflicts with house style, add missing skills (testing, accessibility, infra), drop the Composer dependency. Full control, you own a per-quarter review pass.Decide once. Deferring the decision is itself a decision for the half-fork state.
Compatibility
composer.lock; commit both composer.json and composer.lock.prettier.config.js to four spaces / 120 / single quotes, or edit the skill's references/ copy to match yours. Don't leave the mismatch live.spatie-javascript explicitly excludes PHP/Laravel; spatie-laravel-php excludes JS/TS. In a monorepo that's a feature, but it means PHP work and Vue work should run in separate sessions or name the skill explicitly on ambiguous files.AGENTS.md: project conventions override any spatie-* skill; where the file is silent, follow the skill; Laravel framework conventions override both.Sequencing
spatie-laravel-php and spatie-security only. Ask for a small conventional artifact: PostsController with index/store/destroy, a StorePostRequest, and routes.SKILL.md summaries (~10 minutes) before judging output. Then check the generated code against them: tuple route notation, camelCase route names, kebab-case URLs, typed properties, explicit return types including void, constructor property promotion, early returns without else, config() not env(), array validation rules.spatie-laravel-php." If it can't, the install targeted the wrong agent or the editor needs a restart. An agent that silently didn't load the skill looks identical to one ignoring it.vendor/bin/pint --test, vendor/bin/phpstan analyse, npm run lint && npx prettier --check .. The skill should reduce findings volume; it never replaces the checks.spatie-laravel-php skill and list only violations of its stated rules. Don't suggest refactors outside the skill." Paste at every PR for a consistent, quotable pass.env() outside config/, missing return types, controller naming — encode these as PHPStan rules or architecture tests so they are enforced rather than suggested, and let the skill carry the stylistic residue.boost:update as its own commit; read the markdown diff before merging.SKILL.md + references/ shape.Maintenance
Low but non-zero, and the shape depends on the fork decision. Tracking upstream: a version bump plus a markdown review on your normal dependency cadence, budgeted as a policy review rather than a patch bump. Fork-and-own: roughly one review pass per quarter plus the cost of authoring skills for the gaps (testing, accessibility, CI, deployment, infra). Either way the artifact is a vendor/ directory that is wiped and repopulated on composer install — which is why the human-readable guidelines at spatie.be/guidelines must be linked from onboarding docs so conventions aren't locked inside a dependency.
Support
No vendor SLA; MIT community project from a well-regarded source (Spatie, Freek Van der Herten). Issues route to GitHub. The practical support surface is an internal diagnostic checklist for "the agent ignores the skill":
vendor/ or the agent's skills directory?boost:install install for your agent, or a different one?Scaling
Per-repo install is trivial; consistency across repos is the real scaling cost. That requires a single distribution channel, a standard precedence line, identical Prettier config, and a shared update cadence — otherwise each repo's agent drifts independently. Two further ceilings: context budget (enable only the skills you use; name the specific references/ section you need rather than inviting a wholesale read) and scope coverage (four skills, with no testing/accessibility/infra equivalents — those are yours to write).
Failure modes
| Failure | Symptom | Mitigation |
|---|---|---|
| Skill silently not loaded | Agent "ignores" guidelines | Four-step diagnostic; quote-a-rule test |
| Precedence conflict | Agent contradicts AGENTS.md |
One-line precedence statement, stated first |
| Formatter fight | Every JS file diffs on indent/width | Align Prettier to skill, or edit skill reference |
| Channel drift | Different behavior per machine | Standardize on Composer for Laravel repos |
| Upstream guideline bump | PRs "feel off," no failing build | Pin; update as its own commit; read the diff |
| Over-reliance | Team believes compliance is automated | Keep Pint/PHPStan/Prettier as source of truth; promote rules to CI |
| Context dilution | Degraded output quality | Enable only used skills; target reference sections |
Ramp-up
Fast for individuals: ~15 minutes to a real adoption decision, ~10 minutes to read the four SKILL.md summaries, roughly one sprint to a validated pilot with CI gates identified. Team-level ramp is dominated by convention agreement, not tooling — commit format, branch naming, and JS formatting are the entrenched items, and spatie-version-control should be diffed against current practice before it is enabled anywhere. Onboarding hand-off: point new hires at the skill files in vendor/ and at spatie.be/guidelines for the prose version — written conventions inside the tool they already use beat a wiki page nobody opens.
How can I help you explore Laravel packages today?