Search Sign in Write for us
PROMPTPOST

How-to

Laravel Boost Guide: Teach AI Coding Agents to Write Laravel Your Way

Install Boost, connect Claude Code, Codex or Cursor, add your own guidelines and skills, and record project rules so every agent follows your conventions.

PromptPost Desk 6 min read
X Facebook LinkedIn
Published
A robot arm assembling building blocks according to a glowing blueprint
A robot arm assembling building blocks according to a glowing blueprint AI-generated image

AI coding agents know a lot about PHP, but they don't know your app. They guess at your folder structure, reinvent helpers you already have, and use patterns from old Laravel versions. Laravel Boost fixes much of that by giving agents the right context at the right time.

What Boost gives your agent

Boost has four parts:

  1. AI guidelines: short instruction files loaded at the start of every session, covering conventions for Laravel and the packages you use, such as Livewire, Inertia, Pest and Tailwind.

  2. Agent skills: detailed, task-specific instructions that load only when relevant, like "how to write a Pest test" or "how to build a Livewire component." This keeps the agent's context small.

  3. An MCP server: tools the agent can call to look at your real app, such as reading the database schema, running a query, reading logs or listing package versions.

  4. A documentation API: semantic search across more than 17,000 pieces of Laravel ecosystem documentation, matched to the package versions you have installed.

Step 1: Install Boost

composer require laravel/boost --dev
php artisan boost:install

The installer asks which agents you use (for example Claude Code, Codex, Cursor, GitHub Copilot or Junie) and which features you want. It then writes the right files for each agent, such as CLAUDE.md, AGENTS.md and an .mcp.json file.

If you already have a CLAUDE.md or AGENTS.md, Boost only replaces the content inside its own <laravel-boost-guidelines> block. Anything you wrote outside that block is kept.

Laravel's docs note that you can add the generated files (.mcp.json, CLAUDE.md, AGENTS.md, boost.json) to .gitignore, because Boost regenerates them. Your custom guidelines, skills and rules in .ai/ are a different matter, as covered below.

Step 2: Connect your agent to the MCP server

Most agents pick it up automatically. If not:

# Claude Code
claude mcp add -s local -t stdio laravel-boost php artisan boost:mcp

# Codex
codex mcp add laravel-boost -- php "artisan" "boost:mcp"

For any other editor, register an MCP server with command php and arguments artisan boost:mcp:

{
  "mcpServers": {
    "laravel-boost": {
      "command": "php",
      "args": ["artisan", "boost:mcp"]
    }
  }
}

In VS Code with GitHub Copilot, open the command palette, choose MCP: List Servers, select laravel-boost and start it.

The MCP tools your agent gets

ToolWhat it does
Application InfoPHP and Laravel versions, database engine, installed packages and Eloquent models
Database Schema / ConnectionsReads your schema and available connections
Database QueryRuns a query against the database
Last Error / Read Log EntriesReads recent errors and log lines
Browser LogsReads browser logs and errors
Get Absolute URLTurns relative paths into valid absolute URLs
Search DocsSearches version-matched Laravel docs
Record RuleSaves a project rule into .ai/rules

Because the agent can run real queries, treat Boost as a local development tool. Keep it as a dev dependency and point it at a local or disposable database, never production.

Step 3: Add your own guidelines and skills

Custom guidelines go in .ai/guidelines/ as .blade.php or .md files. They're included the next time you run boost:install. To override one of Boost's built-in guidelines, create a file with the same path, for example .ai/guidelines/inertia-react/2/forms.blade.php.

Custom skills go in .ai/skills/{skill-name}/SKILL.md. A skill needs YAML frontmatter with name and description, then plain Markdown instructions:

---
name: creating-invoices
description: Create and update invoices, including tax rounding and numbering rules.
---

# Creating invoices

- Store money as integer paise, never floats.
- Use App\Actions\Invoices\CreateInvoice instead of writing to the model directly.
- Every new invoice needs a feature test in tests/Feature/Invoices.

Run php artisan boost:update to install new skills.

Step 4: Record project rules

Guidelines and skills teach agents how to write Laravel. Project rules teach them how to write your app: decisions, traps and preferences you'd otherwise repeat every session.

The easiest way to add one is to ask your agent:

Remember that all money values are stored as integer paise, never as floats.

The agent calls Boost's Record Rule tool, which files the rule under .ai/rules/ with the file paths it applies to, and updates .ai/rules/index.md. Agents check that index before editing files, so each rule only loads when it's relevant.

Laravel recommends recording rules through the tool rather than creating files by hand, because the index is regenerated as part of recording.

For an existing app, ask your agent to Use the infer-conventions skill. It scans your code for conventions you actually follow, shows the evidence, and asks for approval before writing rules.

Commit .ai/rules to git. Unlike the generated files, rules are meant to be shared with your team.

Step 5: Keep Boost up to date

Add this to composer.json so guidelines and skills refresh whenever you update packages:

{
  "scripts": {
    "post-update-cmd": [
      "@php artisan boost:update --ansi"
    ]
  }
}

Boost and AGENTS.md together

Boost writes its guidelines into AGENTS.md and CLAUDE.md inside a managed block, so you can keep your own project notes in the same file outside that block. If you're new to the format, our AGENTS.md guide explains what to put in it. And whatever agent you use, the habits in how to brief an AI coding agent safely still apply.

Related reading: AGENTS.md guide · Laravel AI SDK for beginners

Frequently asked questions

What is Laravel Boost?

It's Laravel's official package that gives AI coding agents Laravel-specific guidelines, on-demand skills, an MCP server with app-aware tools, and version-matched documentation search.

How do I install Laravel Boost?

Run composer require laravel/boost --dev, then php artisan boost:install and choose your agents and features.

Which AI agents work with Laravel Boost?

Boost supports Claude Code, Codex, Cursor, GitHub Copilot in VS Code and Junie out of the box, and you can register other agents with a custom class.

Should I commit Laravel Boost files to git?

Commit your .ai/rules, custom guidelines and skills. Generated files like .mcp.json, CLAUDE.md, AGENTS.md and boost.json can be ignored because Boost regenerates them.


Sources: Laravel Boost documentation (laravel.com/docs/13.x/boost); Laravel's AI development docs; Laravel News coverage of Boost v2 skills and project rules. Commands follow the official docs at the time of writing.

Further reading: Laravel docs: Boost · laravel/boost on GitHub

Related

The stream

All stories