Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Boost Laravel Package

laravel/boost

Laravel Boost accelerates AI-assisted Laravel development by supplying the context, conventions, and structure AI needs to generate high-quality, framework-specific code and suggestions, helping teams build faster while staying aligned with Laravel best practices.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation:

    composer require laravel/boost
    php artisan boost:install
    

    This installs the MCP server and configures Laravel-specific AI context.

  2. First Use Case: Open your IDE (VSCode, PHPStorm, or Zed) and start typing Laravel code. Boost automatically injects relevant context (routes, models, config) into your AI agent's prompts.

  3. Key Files to Review:

    • config/boost.php (core configuration)
    • .boost/skills/ (custom skill definitions)
    • app/Providers/BoostServiceProvider.php (service binding)

Initial Configuration

Edit config/boost.php to:

  • Set your preferred AI agent (e.g., google/antigravity, openai/chatgpt)
  • Configure enforce_tests (default: true)
  • Adjust mcp_config_path for monorepos

First Command

php artisan boost:skills

Lists available skills (e.g., laravel, livewire, pest) to enable/disable.


Implementation Patterns

Daily Workflow Integration

  1. Context-Aware Coding:

    • Models: Define a model (php artisan make:model User), then ask Boost to generate migrations, factories, or seeders.
    • Routes: Type /route in your IDE, and Boost suggests relevant route logic.
    • Blade: Write @component or @slot and let Boost auto-complete the component structure.
  2. Skill-Based Workflows:

    php artisan boost:skill enable livewire
    php artisan boost:skill enable pest
    
    • Livewire: Boost injects Livewire-specific guidelines (e.g., property typing, wire:model).
    • Pest: Suggests test structures matching your project’s tests/ conventions.
  3. IDE-Specific Patterns:

    • VSCode: Use the boost:context command in the command palette to refresh context.
    • Zed/PHPStorm: Configure the boost tool in your editor’s AI integration settings.
  4. Testing Integration:

    php artisan boost:test "generate feature test for UserController@store"
    

    Generates a Pest test file with assertions for your controller method.

Advanced Patterns

  1. Custom Skills: Create a skill in .boost/skills/custom/your-skill.php:

    return [
        'name' => 'Custom Skill',
        'description' => 'Handles XYZ logic',
        'rules' => [
            'use Custom\Namespace;',
            'extend BaseClass { ... }',
        ],
    ];
    

    Register it via:

    php artisan boost:skill register custom/your-skill
    
  2. Agent-Specific Prompts: Override agent prompts in config/boost.php:

    'agents' => [
        'google/antigravity' => [
            'prompt_template' => '@include("boost::prompts.antigravity")',
        ],
    ],
    
  3. Monorepo Support: Set mcp_config_path in config/boost.php to point to your monorepo’s root MCP config:

    'mcp_config_path' => base_path('../mcp.config.json'),
    
  4. CI/CD Integration: Use boost:validate in your pipeline to enforce guidelines:

    php artisan boost:validate --fix
    

Gotchas and Tips

Common Pitfalls

  1. Agent Detection Issues:

    • Symptom: Boost fails to detect your IDE/agent.
    • Fix: Manually specify the agent in config/boost.php:
      'agent' => 'zed', // or 'vscode', 'phpstorm', 'cli'
      
    • Zed-Specific: Ensure the binary is named zed or zeditor (see PR #846).
  2. Skill Conflicts:

    • Symptom: Overlapping rules between enabled skills (e.g., laravel and livewire).
    • Fix: Use boost:skill disable to temporarily disable conflicting skills or adjust rule precedence in .boost/skills/.
  3. Context Refresh Delays:

    • Symptom: Outdated context in AI responses.
    • Fix: Manually trigger a context refresh:
      php artisan boost:context
      
    • Automate: Add a post-update-cmd hook in composer.json:
      "scripts": {
          "post-update-cmd": "php artisan boost:context"
      }
      
  4. MCP Configuration Quirks:

    • Symptom: Boost ignores your .boost/mcp.config.json.
    • Fix: Ensure the file exists and is valid JSON. Use:
      php artisan boost:config:generate
      
    • Monorepo Note: Set mcp_config_path to the root config file (see PR #729).
  5. Test Enforcement:

    • Symptom: enforce_tests blocks code generation.
    • Fix: Temporarily disable via:
      php artisan boost:config:set enforce_tests=false
      
    • Override: Use the --no-tests flag:
      php artisan boost:generate --no-tests
      

Debugging Tips

  1. Log Level: Enable debug logs in config/boost.php:

    'logging' => [
        'level' => 'debug',
    ],
    

    Check logs at storage/logs/boost.log.

  2. Skill Validation: Validate a skill’s syntax:

    php artisan boost:skill:validate livewire
    
  3. Agent Communication: Test agent connectivity:

    php artisan boost:agent:test
    
  4. Context Inspection: Dump the current context:

    php artisan boost:context:dump
    

Extension Points

  1. Custom Prompt Templates: Override templates in resources/views/boost/prompts/. Example:

    @extends('boost::prompts.base')
    @section('context')
        {{ $context->models->take(5) }}
        {{ $context->routes->take(3) }}
    @endsection
    
  2. Event Listeners: Listen for Boost events in EventServiceProvider:

    protected $listen = [
        \Laravel\Boost\Events\GuidelinesGenerated::class => [
            \App\Listeners\LogGuidelines::class,
        ],
    ];
    
  3. MCP Tool Extensions: Add custom MCP tools by publishing the config:

    php artisan vendor:publish --tag="boost-config"
    

    Then extend config/boost.php:

    'tools' => [
        'custom' => [
            'description' => 'Runs custom logic',
            'command' => 'php artisan custom:logic',
        ],
    ],
    
  4. Livewire Integration: For Livewire v4+ compatibility, ensure your SKILL.blade.php uses:

    'livewire' => [
        'paths' => [
            app_path('Http/Livewire'),
            resource_path('js/Components'),
        ],
    ],
    

    (See PR #736.)

Pro Tips

  1. Skill Chaining: Combine skills for complex workflows:

    php artisan boost:skill enable livewire,pest,style
    
  2. Agent-Specific Shortcuts:

    • Antigravity: Use !!boost in Zed to trigger Boost.
    • CLI: Pipe commands to Boost:
      php artisan make:model User | php artisan boost:generate
      
  3. Performance: Exclude large files from context:

    'context' => [
        'exclude' => [
            'storage/*',
            'node_modules/*',
        ],
    ],
    
  4. Upgrade Notes:

    • Laravel v13+: Check for upsert breaking changes (see PR #761).
    • Livewire v4+: Update paths in SKILL.blade.php (see PR #736).
  5. Security:

    • Restrict AI access to sensitive files by configuring exclude in config/boost.php.
    • Use boost:validate in pre-commit hooks to catch guideline violations early.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony