Mastering Laravel Boost 2.0: Optimizing AI Context with Skills and MCP

Overview: The Context Gap in AI Development

AI agents have changed how we write code, but they often struggle with the nuances of specific frameworks. Standard models like

or
GPT-4o
possess vast general knowledge but lack the hyper-specific context of your local
Laravel
project. This lead to hallucinations, outdated syntax, or the AI suggesting patterns that conflict with your application's architecture.

solves this by acting as a bridge. It injects project-specific metadata, documentation, and "skills" directly into your AI agent's reasoning loop. Instead of manually feeding documentation to a chat window, Boost automates the context delivery. Version 2.0 introduces a major shift from a monolithic guideline approach to a modular, "skills-first" architecture. This reduces context bloat, saves on token costs, and makes the AI significantly more accurate by only providing the information it needs at that exact moment.

Prerequisites

To follow this guide and implement Boost 2.0, you should be comfortable with the following:

  • PHP 8.2+: Boost 2.0 has officially dropped support for PHP 8.1.
  • Laravel 11 or 12: Older versions like
    Laravel 10
    are supported only by legacy versions of Boost (v1.x).
  • Composer: Basic knowledge of managing PHP dependencies.
  • AI Coding Agents: Familiarity with tools like
    Cursor
    ,
    Claude Code
    ,
    GitHub Copilot
    , or
    Juni
    .

Key Libraries & Tools

  • Laravel Boost: The core CLI tool and package that manages AI context and skills.
  • Laravel MCP: A package for building
    Model Context Protocol
    servers, allowing AI agents to interact with your app's internal state (routes, database schemas, etc.).
  • Remotion: A React-based framework for programmatic video creation, often used as a demonstration of complex AI skill integration.
  • Prism: A
    Laravel
    package for working with LLMs, used to demonstrate how documentation can be bundled directly into vendor folders for AI consumption.

Code Walkthrough: Installing and Configuring Boost 2.0

Setting up Boost 2.0 is a methodical process. It begins with the

installer and moves into a randomized, aesthetically pleasing configuration CLI.

1. Installation

First, ensure your

installer is up to date to access the built-in Boost prompts during new project creation. If you are adding it to an existing project, use Composer:

composer require laravel/boost --dev

2. Initialization

Run the install command to start the interactive configuration.

php artisan boost:install

This command triggers a CLI interface featuring randomized gradients—a touch of "developer joy" added by

. You will be prompted to select which features to configure: AI Guidelines, Agent Skills, or the
Model Context Protocol
server.

3. Selecting Your AI Agent

Boost 2.0 simplifies agent selection. Instead of choosing both an IDE and an agent, you now choose the specific agentic tool you use daily, such as

or
Cursor
. Boost will then automatically determine the correct file paths for these tools.

4. Automated Skill Syncing

To ensure your AI context stays updated as your project evolves, add the update command to your composer.json file:

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

This ensures that every time you update your dependencies, Boost re-scans your composer.json and syncs the relevant skills for packages like

,
Tailwind CSS
, or
Livewire
.

Deep Dive into Skills vs. Guidelines

Understanding the distinction between these two features is critical for a clean development workflow.

Guidelines: The Global Rules

Guidelines are persistent. They contain high-level rules that the AI should always know. For example, if you always use

for testing or strictly follow an Action-based architecture, these belong in your guidelines. However, shoving every package's documentation into a guideline leads to "context fatigue," where the AI becomes overwhelmed and starts to hallucinate.

Skills: The On-Demand Context

Skills are modular

files. They aren't loaded into the AI's memory until they are needed. Each skill has a name and a description in its front matter. When you ask the AI to "build a new UI component with Tailwind," the agent sees the keyword "Tailwind," looks at its available skills, and activates the
Tailwind CSS
skill. This keeps the prompt lean and the output precise.

Syntax Notes: Custom Skill Creation

Creating a custom skill allows you to automate highly specific tasks, like generating pull request descriptions or adhering to internal API versioning standards. Skills rely on a specific

front matter format.

---
name: my-custom-skill
description: Use this skill when generating API endpoints or PR descriptions.
---

# My Custom Skill Rules
- Always use the `App\Actions` namespace for business logic.
- Ensure all API responses are wrapped in a standard `JsonResource`.
- Pull Request descriptions must include a 'Breaking Changes' section.

When you save this in a local .boost/skills directory and run php artisan boost:update, Boost replicates this file into the hidden configuration folders of your chosen AI agents (e.g., .cursor/rules or .claudecode/skills).

Practical Examples

Automating Pull Requests

You can create a skill that teaches an agent how to use the

. By invoking the skill with a slash command (e.g., /create-pr), the AI can analyze your staged changes, write a formatted description, and execute the CLI command to open the PR.

Package-Specific Intelligence

If you build a project using

, you don't want the AI thinking about
Filament
when you are just debugging a console command. By using a
Filament
skill, the AI only accesses those specific layout and component rules when you are actively working on the admin panel.

Tips & Gotchas

  • Git Management: Never commit the auto-generated agent folders (like .cursor/rules) to your repository. These are local mirrors. Only commit the .boost folder and your boost.json file. This allows your teammates to run boost:install and get the exact same AI behavior on their machines.
  • Hallucination Prevention: If your AI starts ignoring your project structure, check your guideline length. If it exceeds 500 lines, move package-specific rules into individual skills.
  • Legacy Projects: Do not attempt to use Boost 2.0 on
    Laravel 10
    projects. The dependency tree for the new
    Model Context Protocol
    features and skills requires the modern internals found in
    Laravel 11
    and up.
  • Manual Invocation: If an agent fails to auto-detect a skill, you can usually force it by using a slash command in the chat interface. Most modern agents support / to list and select active skills.
6 min read