News

Laravel Boost Project Rules: Teach Agents Your Conventions

Published
Laravel Boost Project Rules: Teach Agents Your Conventions image

Laravel Boost has added project rules, a set of committed Markdown files that record your application's conventions and are scoped to the directories they apply to. An agent reads a rule file when it is about to work on a matching path, and ignores it otherwise. Pushpak Chhajed added the feature in pull request #852. It shipped behind a flag in Boost v2.4.12 and is on by default as of v2.5.0, released on August 4. Christoph Rumpel of the Laravel team has also recorded a short video walking through it, Keep Your AI Instructions Clean With Boost Rules.

Boost's guidelines and skills already teach agents how to write Laravel. Rules are for the things only your team knows: the decision someone made six months ago, the preference an agent keeps ignoring, the trap that isn't visible in the surrounding code. The documentation frames a rule as anything you would otherwise have to explain again in every new session.

What a Rule Looks Like

Rules live in .ai/rules. Each file is Markdown with a paths: frontmatter key listing the globs it covers:

---
paths:
- app/Jobs/**
---
 
# Jobs
 
## Reporting jobs run on the reports connection
 
Any job that reads from the reporting tables must set `$connection = 'reports'`.
The default connection shares its workers with checkout, so one slow report will
hold up every order behind it in the queue.

Boost keeps an .ai/rules/index.md alongside those files, mapping globs to the rule that covers them. Agents are told to check the index before they plan or edit anything, which is what keeps a rule out of context until its paths come up:

# Project Rules Index
 
Before planning or editing, find the row whose globs match the file's path and read that rule file.
 
| Applies to | Rule file |
| --- | --- |
| app/Jobs/** | .ai/rules/jobs.md |
| database/migrations/** | .ai/rules/migrations.md |

Commit the .ai/rules directory. That is the difference between rules and an agent's own memory, which stays on one machine with one developer. Rules go into the repository, get reviewed in pull requests, and apply to every agent anyone on the team points at the codebase.

Recording Rules

You are not expected to write these files by hand. Ask your agent to remember something, and it calls Boost's record-rule MCP tool with a glob, a title, and a note:

Remember that we never call Stripe from a controller. Billing always goes
through App\Billing\Gateway so the retries and logging stay in one place.

Boost works out which area file the note belongs in, creates it if it does not exist yet, and rebuilds the index. Rebuilding the index is why the docs tell you to use the tool. Agents discover rules from index.md, so any file you drop into .ai/rules will sit unread until something regenerates it.

Bootstrapping an Existing App

Recording rules as you go is fine for new decisions, but an application you have been working on for years has already made most of them. Boost v2.5.0 added an infer-conventions skill for that. Ask your agent to use the skill, and it works through a checklist of your validation, controllers, authorisation, models, architecture, testing, frontend, database, and console code, then does an open-ended pass to look for base classes, shared traits, and module layouts.

What it writes down is what your code does, not what it ought to do. Framework defaults are skipped, as are anything Pint or Rector already handles, and a pattern that turns out to be genuinely mixed gets reported to you instead of being recorded as a convention. Every finding comes back with its supporting evidence for you to approve before it becomes a rule.

Why Scope Rules

Anyone who has kept a CLAUDE.md or AGENTS.md around for a while knows how it goes. It starts with a few bullet points about naming and testing, and six months later it is five pages, most of which have nothing to do with whatever you are working on today. All of it loads at the start of every session. Splitting that file by directory means the agent checks the index, finds the rows that match the file it is about to edit, and reads those. It is the same idea behind skills, pointed at your code instead of the framework's.

If Boost is already installed, run php artisan boost:update after upgrading. The instructions that send agents to .ai/rules/index.md live in Boost's own guidelines, so your CLAUDE.md or AGENTS.md needs regenerating before an agent knows to look, and the same command installs the infer-conventions skill:

php artisan boost:update

Rules are on from there. Setting BOOST_RULES_ENABLED=false turns them off, which removes the record-rule tool and stops Boost from touching .ai/rules.

The project rules documentation covers the rest, and the source is in the Laravel Boost repository.

Yannick Lyn Fatt photo

Staff Writer at Laravel News and Full stack web developer.

Sponsored

laravelcloud logo
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud

The latest

View all →
Extract an Image's Dominant Color in Laravel image

Extract an Image's Dominant Color in Laravel

Read article
Image Dominant Color and HEIC Support in Laravel 13.24 image

Image Dominant Color and HEIC Support in Laravel 13.24

Read article
Official Laravel Zed Extension: LSP for PHP & Blade image

Official Laravel Zed Extension: LSP for PHP & Blade

Read article
Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD image

Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD

Read article
PhpStorm 2026.2 Released image

PhpStorm 2026.2 Released

Read article
Laravel Doctor: Diagnose Your App With One Artisan Command image

Laravel Doctor: Diagnose Your App With One Artisan Command

Read article