laravel-boost

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Laravel Boost

Laravel Boost

Overview

概述

Laravel Boost is an official Laravel package that accelerates AI-assisted development by providing composable guidelines, on-demand agent skills, an MCP (Model Context Protocol) server, and a documentation API with semantic search across 17,000+ Laravel-specific knowledge pieces. It bridges AI coding tools and the Laravel ecosystem, ensuring that AI agents generate high-quality, convention-compliant Laravel code.
Apply this skill when setting up, configuring, or extending Laravel Boost in a project, or when integrating AI agents with a Laravel application.
Laravel Boost是Laravel官方推出的扩展包,通过提供可组合的开发指南、按需加载的Agent技能、MCP(模型上下文协议)服务器,以及覆盖17000+ Laravel专属知识片段的语义搜索文档API,来加速AI辅助开发流程。它打通了AI编码工具和Laravel生态,确保AI Agent生成高质量、符合规范的Laravel代码。
当你需要在项目中搭建、配置、扩展Laravel Boost,或者将AI Agent与Laravel应用集成时,可以使用本技能。

Multi-Phase Process

多阶段流程

Phase 1: Assessment

阶段1:评估

  1. Confirm Laravel version compatibility (10.x, 11.x, 12.x)
  2. Identify the AI IDE or agent in use (Cursor, Claude Code, Codex, Gemini CLI, GitHub Copilot, Junie)
  3. Check if an MCP configuration already exists (
    .mcp.json
    )
  4. Review existing guideline and skill customizations in
    .ai/
STOP — Do NOT install Boost without confirming Laravel version compatibility and target IDE.
  1. 确认Laravel版本兼容性(10.x、11.x、12.x)
  2. 明确当前使用的AI IDE或Agent(Cursor、Claude Code、Codex、Gemini CLI、GitHub Copilot、Junie)
  3. 检查是否已存在MCP配置(
    .mcp.json
  4. 查看
    .ai/
    目录下现有的指南和技能自定义内容
停止操作 — 未确认Laravel版本兼容性和目标IDE之前,请勿安装Boost。

Phase 2: Installation and Configuration

阶段2:安装与配置

  1. Install the package and run the installer
  2. Configure MCP server for the target IDE
  3. Set up automatic updates via Composer hooks
  4. Verify MCP tools are accessible from the AI agent
STOP — Do NOT proceed until MCP server connectivity is verified with at least one tool call.
  1. 安装扩展包并运行安装程序
  2. 为目标IDE配置MCP服务器
  3. 通过Composer钩子设置自动更新
  4. 验证AI Agent可以访问MCP工具
停止操作 — 至少完成一次工具调用、确认MCP服务器连通性之前,请勿进入下一阶段。

Phase 3: Customization

阶段3:自定义

  1. Add project-specific guidelines in
    .ai/guidelines/
  2. Create domain-specific skills in
    .ai/skills/
  3. Override built-in guidelines or skills where project conventions differ
  4. Register custom agents if extending to unsupported IDEs
STOP — Do NOT override built-in guidelines unless project conventions genuinely differ from Laravel defaults.
  1. .ai/guidelines/
    目录下添加项目专属指南
  2. .ai/skills/
    目录下创建业务域专属技能
  3. 当项目规范与默认规则不同时,覆盖内置指南或技能
  4. 如果要扩展支持未适配的IDE,注册自定义Agent
停止操作 — 除非项目规范确实与Laravel默认规则存在差异,否则请勿覆盖内置指南。

Phase 4: Validation

阶段4:验证

  1. Confirm MCP server responds to tool calls (Application Info, Database Schema, Search Docs)
  2. Verify guidelines load in the AI agent's context window
  3. Test skill activation for domain-relevant tasks
  4. Check that
    boost:update
    keeps resources current after dependency changes
  1. 确认MCP服务器可以响应工具调用(应用信息、数据库 schema、文档搜索)
  2. 验证指南可以正常加载到AI Agent的上下文窗口中
  3. 测试业务域相关任务的技能激活功能
  4. 检查
    boost:update
    命令可以在依赖变更后同步资源

IDE Setup Decision Table

IDE配置决策表

IDE / AgentSetup MethodConfiguration File
Claude CodeCLI command
.mcp.json
(auto-generated)
CodexCLI command
.mcp.json
Gemini CLICLI command
.mcp.json
CursorCommand Palette GUI
.cursor/mcp.json
GitHub CopilotCommand Palette GUI
.mcp.json
JunieSettings GUI
.mcp.json
Custom / UnsupportedCustom agent classManual MCP config
IDE / Agent安装方式配置文件
Claude CodeCLI命令
.mcp.json
(自动生成)
CodexCLI命令
.mcp.json
Gemini CLICLI命令
.mcp.json
Cursor命令面板GUI
.cursor/mcp.json
GitHub Copilot命令面板GUI
.mcp.json
Junie设置GUI
.mcp.json
自定义/未支持自定义Agent类手动MCP配置

Installation

安装

bash
undefined
bash
undefined

Install as a development dependency

安装为开发依赖

composer require laravel/boost --dev
composer require laravel/boost --dev

Run the installer — generates .mcp.json, guideline files, and boost.json

运行安装程序 — 生成.mcp.json、指南文件和boost.json

php artisan boost:install

The installer generates:
- `.mcp.json` — MCP server configuration for IDE integration
- Guideline files (`CLAUDE.md`, `AGENTS.md`, etc.) tailored to detected packages
- `boost.json` — Boost configuration file
php artisan boost:install

安装程序会生成:
- `.mcp.json` — 用于IDE集成的MCP服务器配置
- 适配已检测到的扩展包的指南文件(`CLAUDE.md`、`AGENTS.md`等)
- `boost.json` — Boost配置文件

IDE-Specific MCP Setup

特定IDE的MCP配置

IDE / AgentSetup Command or Action
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"
Gemini CLI
gemini mcp add -s project -t stdio laravel-boost php artisan boost:mcp
CursorCommand Palette -> "Open MCP Settings" -> toggle on
laravel-boost
GitHub CopilotCommand Palette -> "MCP: List Servers" -> select
laravel-boost
-> "Start server"
JunieShift-Shift -> "MCP Settings" -> check
laravel-boost
-> Apply
IDE / Agent配置命令或操作
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"
Gemini CLI
gemini mcp add -s project -t stdio laravel-boost php artisan boost:mcp
Cursor命令面板 -> "打开MCP设置" -> 开启
laravel-boost
GitHub Copilot命令面板 -> "MCP: 列出服务器" -> 选择
laravel-boost
-> "启动服务器"
Junie双击Shift -> "MCP设置" -> 勾选
laravel-boost
-> 应用

Manual MCP Configuration

手动MCP配置

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

Keeping Resources Updated

保持资源更新

bash
undefined
bash
undefined

Manual update after dependency changes

依赖变更后手动更新

php artisan boost:update
php artisan boost:update

Automatic updates — add to composer.json scripts

自动更新 — 添加到composer.json的scripts配置中

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

MCP Server Tools

MCP服务器工具

Laravel Boost exposes the following tools through its MCP server, giving AI agents direct access to application context:
ToolPurposeTypical Use
Application InfoRead PHP and Laravel versions, database engine, ecosystem packages, Eloquent modelsContext discovery at session start
Database SchemaRead full database schemaMigration planning, model generation
Database QueryExecute queries against the databaseData inspection, debugging
Database ConnectionsInspect available database connectionsMulti-database configuration
Search DocsSemantic search across Laravel documentation APIFinding best practices, API references
Last ErrorRead the most recent application log errorDebugging workflow
Read Log EntriesRead last N log entriesMonitoring, debugging
Browser LogsRead logs and errors from browserFrontend debugging
Get Absolute URLConvert relative path URIs to absolute URLsLink generation
Laravel Boost通过其MCP服务器提供以下工具,让AI Agent可以直接访问应用上下文:
工具用途典型使用场景
应用信息读取PHP和Laravel版本、数据库引擎、生态扩展包、Eloquent模型会话启动时的上下文发现
数据库Schema读取完整数据库schema迁移规划、模型生成
数据库查询对数据库执行查询数据核查、调试
数据库连接查看可用的数据库连接多数据库配置
文档搜索跨Laravel文档API的语义搜索查找最佳实践、API参考
最新错误读取应用日志最新的错误信息调试流程
读取日志条目读取最近N条日志监控、调试
浏览器日志读取浏览器的日志和错误前端调试
获取绝对URL将相对路径URI转换为绝对URL链接生成

AI Guidelines

AI指南

Guidelines are composable instruction files loaded upfront into the AI agent's context, providing broad conventions and best practices.
指南是预先加载到AI Agent上下文中的可组合指令文件,提供通用规范和最佳实践。

Available Built-in Guidelines

可用内置指南

PackageVersions Supported
Laravel FrameworkCore, 10.x, 11.x, 12.x
LivewireCore, 2.x, 3.x, 4.x
Flux UICore, Free, Pro
InertiaReact, Vue, Svelte (1.x-3.x)
Tailwind CSSCore, 3.x, 4.x
PestCore, 3.x, 4.x
PHPUnit, Pint, Sail, Pennant, Volt, Wayfinder, Folio, Herd, MCPCore
扩展包支持版本
Laravel Framework核心、10.x、11.x、12.x
Livewire核心、2.x、3.x、4.x
Flux UI核心、免费版、专业版
InertiaReact、Vue、Svelte (1.x-3.x)
Tailwind CSS核心、3.x、4.x
Pest核心、3.x、4.x
PHPUnit、Pint、Sail、Pennant、Volt、Wayfinder、Folio、Herd、MCP核心

Custom Guidelines

自定义指南

Create
.blade.php
or
.md
files in
.ai/guidelines/
:
.ai/guidelines/team-conventions.md
.ai/guidelines/billing/stripe-patterns.blade.php
Override a built-in guideline by matching its path:
.ai/guidelines/inertia-react/2/forms.blade.php
.ai/guidelines/
目录下创建
.blade.php
.md
文件:
.ai/guidelines/team-conventions.md
.ai/guidelines/billing/stripe-patterns.blade.php
通过匹配内置指南的路径来覆盖它:
.ai/guidelines/inertia-react/2/forms.blade.php

Third-Party Package Guidelines

第三方扩展包指南

Package authors can ship guidelines at:
resources/boost/guidelines/core.blade.php
扩展包开发者可以将指南放在以下路径:
resources/boost/guidelines/core.blade.php

Agent Skills

Agent技能

Skills are on-demand knowledge modules activated only when relevant, reducing context window bloat.
技能是仅在相关场景下才会激活的按需知识模块,可减少上下文窗口冗余。

Available Built-in Skills

可用内置技能

SkillDomain
livewire-development
Livewire components and reactivity
inertia-react-development
Inertia.js with React
inertia-vue-development
Inertia.js with Vue
inertia-svelte-development
Inertia.js with Svelte
pest-testing
Pest test patterns
fluxui-development
Flux UI components
folio-routing
Folio page-based routing
tailwindcss-development
Tailwind CSS utility classes
volt-development
Volt single-file Livewire components
pennant-development
Pennant feature flags
wayfinder-development
Wayfinder type-safe routing
mcp-development
MCP server/tool development
技能业务域
livewire-development
Livewire组件和响应式开发
inertia-react-development
搭配React的Inertia.js开发
inertia-vue-development
搭配Vue的Inertia.js开发
inertia-svelte-development
搭配Svelte的Inertia.js开发
pest-testing
Pest测试模式
fluxui-development
Flux UI组件开发
folio-routing
Folio页面路由开发
tailwindcss-development
Tailwind CSS工具类开发
volt-development
Volt单文件Livewire组件开发
pennant-development
Pennant功能开关开发
wayfinder-development
Wayfinder类型安全路由开发
mcp-development
MCP服务器/工具开发

Custom Skills

自定义技能

Create
.ai/skills/{skill-name}/SKILL.md
:
markdown
---
name: invoice-management
description: Build and work with invoice features including PDF generation and payment tracking.
---
创建
.ai/skills/{skill-name}/SKILL.md
文件:
markdown
---
name: invoice-management
description: 构建和使用发票功能,包括PDF生成和支付跟踪。
---

Invoice Management

发票管理

When to use this skill

何时使用本技能

Use when working with the invoicing module...
undefined
当你开发发票模块时使用...
undefined

Guidelines vs Skills Decision Table

指南与技能决策表

QuestionGuidelinesSkills
When is it loaded?Always — upfront contextOn-demand — when the task matches
How broad is the scope?Foundational conventionsFocused implementation patterns
Impact on context window?Constant (always present)Minimal (loaded only when needed)
Best for?Coding standards, package versionsStep-by-step implementation guides
Content changes often?Rarely (stable conventions)Frequently (evolving patterns)
Team-wide applicability?High (everyone follows)Varies (domain-specific)
问题指南技能
何时加载?始终预先加载到上下文按需加载,仅当任务匹配时激活
覆盖范围有多广?基础规范聚焦的实现模式
对上下文窗口的影响?固定占用(始终存在)极小(仅需要时加载)
最佳适用场景?编码标准、扩展包版本约束分步实现指南
内容变更频率?很少(规范稳定)频繁(模式迭代)
团队适用性?高(所有人都需要遵守)不固定(特定业务域适用)

Documentation API

文档API

Boost provides semantic search across 17,000+ documentation pieces covering:
PackageVersions
Laravel Framework10.x, 11.x, 12.x
Filament2.x, 3.x, 4.x, 5.x
Flux UI2.x Free, 2.x Pro
Inertia1.x, 2.x
Livewire1.x, 2.x, 3.x, 4.x
Nova4.x, 5.x
Pest3.x, 4.x
Tailwind CSS3.x, 4.x
The
Search Docs
MCP tool queries this API. Guidelines and skills automatically instruct agents to use it when they need implementation details.
Boost提供覆盖17000+文档片段的语义搜索能力,覆盖以下内容:
扩展包版本
Laravel Framework10.x、11.x、12.x
Filament2.x、3.x、4.x、5.x
Flux UI2.x免费版、2.x专业版
Inertia1.x、2.x
Livewire1.x、2.x、3.x、4.x
Nova4.x、5.x
Pest3.x、4.x
Tailwind CSS3.x、4.x
搜索文档
MCP工具会查询这个API。指南和技能会自动指示Agent在需要实现细节时调用该API。

When to Use vs When Not Needed

适用与不适用场景

ScenarioUse Laravel Boost?Why
Laravel project with AI-assisted developmentYesPrimary use case
Team uses Cursor, Claude Code, Copilot, or other AI IDEYesMCP integration improves output
Need consistent Laravel conventions across AI-generated codeYesGuidelines enforce standards
Non-Laravel PHP projectNoBoost is Laravel-specific
No AI coding tools in workflowNoBoost's value is in AI agent integration
Production runtime performance optimizationNoBoost is dev-time only, not a runtime optimizer
Already have comprehensive custom AI promptsOptionalBoost may supplement or replace them
场景是否需要使用Laravel Boost?原因
使用AI辅助开发的Laravel项目核心使用场景
团队使用Cursor、Claude Code、Copilot或其他AI IDEMCP集成可以提升输出质量
需要AI生成的代码遵循统一的Laravel规范指南会强制遵守标准
非Laravel的PHP项目Boost是Laravel专属工具
工作流中不使用AI编码工具Boost的价值在于AI Agent集成
生产环境运行时性能优化Boost仅用于开发阶段,不是运行时优化工具
已经有完善的自定义AI提示词可选Boost可以补充或替代现有提示词

Extending Boost

扩展Boost

Custom Agent Registration

自定义Agent注册

For AI tools not supported out of the box:
php
// In AppServiceProvider::boot()
use Laravel\Boost\Boost;

Boost::registerAgent('custom-ide', CustomAgent::class);
The custom agent class must extend
Laravel\Boost\Install\Agents\Agent
and implement the relevant interfaces:
  • SupportsGuidelines
    — for guideline file generation
  • SupportsMcp
    — for MCP server configuration
  • SupportsSkills
    — for skill file generation
针对默认不支持的AI工具:
php
// 在AppServiceProvider::boot()方法中
use Laravel\Boost\Boost;

Boost::registerAgent('custom-ide', CustomAgent::class);
自定义Agent类必须继承
Laravel\Boost\Install\Agents\Agent
并实现相关接口:
  • SupportsGuidelines
    — 用于生成指南文件
  • SupportsMcp
    — 用于MCP服务器配置
  • SupportsSkills
    — 用于生成技能文件

Anti-Patterns / Common Mistakes

反模式/常见错误

Anti-PatternWhy It FailsWhat To Do Instead
Installing in productionBoost is dev-time only, adds unnecessary overheadUse
composer require --dev
Overriding every built-in guidelineDrifts from Laravel core team recommendationsOverride only where project genuinely differs
Ignoring
boost:update
Guidelines fall out of sync with installed packagesRun after every
composer update
Overly broad custom skillsWastes context window tokens when activatedFocus each skill on a single domain
Skipping MCP verificationMisconfigured MCP silently degrades AI agent qualityTest tool calls after installation
Not committing
.mcp.json
Team members get inconsistent AI agent experienceCommit to version control
Mixing guidelines and skillsContext window pollution with always-loaded contentConventions in guidelines, patterns in skills
Not running installer after upgradeMissing new guideline files and MCP toolsRun
php artisan boost:install
after major upgrades
反模式失败原因正确做法
安装到生产环境Boost仅用于开发阶段,会增加不必要的开销使用
composer require --dev
安装
覆盖所有内置指南偏离Laravel核心团队的推荐规范仅在项目确实有不同要求时才覆盖
忽略
boost:update
命令
指南会与已安装的扩展包版本不同步每次执行
composer update
后都运行该命令
自定义技能覆盖范围过广激活时浪费上下文窗口token每个技能仅聚焦单个业务域
跳过MCP验证配置错误的MCP会悄无声息地降低AI Agent的输出质量安装后测试工具调用
不提交
.mcp.json
到版本控制
团队成员的AI Agent体验不一致提交到版本控制
混淆指南和技能的使用场景始终加载的内容导致上下文窗口污染规范放在指南中,实现模式放在技能中
升级后不运行安装程序缺失新的指南文件和MCP工具重大升级后运行
php artisan boost:install

Anti-Rationalization Guards

反合理化约束

  • Do NOT skip MCP verification because "the install succeeded" -- test at least one tool call.
  • Do NOT override built-in guidelines without a documented reason for the deviation.
  • Do NOT create broad skills -- if it covers more than one domain, split it.
  • Do NOT install Boost in production -- it is a
    --dev
    dependency exclusively.
  • Do NOT forget to run
    boost:update
    after dependency changes -- stale guidelines degrade AI output.
  • 不要因为“安装成功了”就跳过MCP验证——至少测试一次工具调用。
  • 没有记录偏离原因的情况下,不要覆盖内置指南。
  • 不要创建覆盖范围过广的技能——如果覆盖多个业务域,就拆分它。
  • 不要在生产环境安装Boost——它是专属的
    --dev
    依赖。
  • 依赖变更后不要忘记运行
    boost:update
    ——过时的指南会降低AI输出质量。

Documentation Lookup (Context7)

文档查询(Context7)

Use
mcp__context7__resolve-library-id
then
mcp__context7__query-docs
for up-to-date docs. Returned docs override memorized knowledge.
  • laravel/framework
    — for core Laravel APIs, configuration, or Artisan commands
  • livewire
    — for component lifecycle, wire directives, or Alpine.js integration

使用
mcp__context7__resolve-library-id
mcp__context7__query-docs
获取最新文档,返回的文档优先级高于记忆中的知识。
  • laravel/framework
    — 用于查询Laravel核心API、配置或Artisan命令
  • livewire
    — 用于查询组件生命周期、wire指令或Alpine.js集成

Integration Points

集成点

SkillHow It Connects
laravel-specialist
Boost guidelines and skills enhance AI-generated Laravel code quality
php-specialist
Boost respects PHP version and PSR standards in generated guidelines
mcp-builder
Boost's MCP server is an example of the MCP pattern; extend it for custom tools
self-learning
Boost's Application Info tool feeds project context into the learning phase
senior-backend
Boost's Database Schema and Query tools support backend architecture decisions
test-driven-development
Boost's Pest skill provides testing patterns for AI-generated tests
技能集成方式
laravel-specialist
Boost的指南和技能可以提升AI生成的Laravel代码质量
php-specialist
Boost生成的指南会遵守PHP版本和PSR标准
mcp-builder
Boost的MCP服务器是MCP模式的示例,可以扩展它实现自定义工具
self-learning
Boost的应用信息工具可以将项目上下文输入到学习阶段
senior-backend
Boost的数据库Schema和查询工具可以支撑后端架构决策
test-driven-development
Boost的Pest技能可以为AI生成的测试提供测试模式参考

Skill Type

技能类型

FLEXIBLE — Adapt the process phases to what the project needs. A new project requires full installation and IDE setup (Phases 1-4). An existing Boost installation may only need customization (Phase 3) or validation after a Laravel upgrade (Phase 4). The non-negotiable minimum: verify MCP server connectivity and confirm guidelines match installed package versions.
灵活适配 — 根据项目需求调整流程阶段。新项目需要完整的安装和IDE配置(阶段1-4)。已安装Boost的现有项目可能只需要自定义(阶段3)或者Laravel升级后的验证(阶段4)。不可协商的最低要求:验证MCP服务器连通性,确认指南与已安装的扩展包版本匹配。