Skip to main content

Why you might need a custom agent

Laravel Boost supports the major AI coding tools out of the box — Claude Code, Cursor, Codex, and GitHub Copilot (VS Code). However, to integrate with in-house tools, emerging AI agents, or proprietary workflows, you need to implement a custom agent using Boost’s extension system. Scenarios where a custom agent is useful:
  • You are using an IDE or AI tool that Boost does not yet support
  • You want to integrate Boost into an internal development workflow or a custom CI/CD pipeline
  • Your agent requires a specific configuration file format or installation procedure

Boost extension architecture

The Agent base class

All agents extend Laravel\Boost\Install\Agents\Agent. This abstract class provides:
  • Agent detection (system-wide and per-project)
  • MCP server installation (file-based or shell command-based)
  • A guidelines transformation hook (transformGuidelines)
Two abstract methods must be implemented:

The three contracts

Implement only the contracts you need to selectively enable Boost features.
All three contracts are optional. You can implement guidelines support only, without MCP support.

The SupportsGuidelines contract

guidelinesPath() returns the path where generated guidelines are written — matching the format the agent reads, such as CLAUDE.md for Claude Code or .cursor/rules/laravel-boost.mdc for Cursor. transformGuidelines() is a hook for post-processing the generated Markdown. You can add agent-specific headers or convert to a special format. The default in the Agent base class returns the string unchanged.

The SupportsMcp contract

The Agent base class provides default implementations of installMcp() and installHttpMcp(), so in most cases you only need to override mcpInstallationStrategy() and mcpConfigPath(). There are two installation strategies:

The SupportsSkills contract

Returns the path to the skills directory the agent reads — for example .claude/skills for Claude Code or .cursor/skills for Cursor.

Creating a custom agent

Here we implement a real custom agent class. The example is a fictional agent called “MyAgent” embedded in a proprietary CI/CD workflow.
1

Create the agent class

Create app/Boost/MyAgent.php.
systemDetectionConfig() and projectDetectionConfig() are used by Boost to auto-detect the agent system-wide and per-project. When boost:install is run, the agent is automatically listed as a candidate.
2

Register the agent

Register the custom agent in the boot method of App\Providers\AppServiceProvider.
After registration, running php artisan boost:install will display MyAgent as an option.
3

Verify the installation

MyAgent will appear in the agent selection prompt. Selecting it generates MYAGENT.md, .myagent.json, and .myagent/skills/.

Customizing guidelines

Configuring guidelinesPath

The location of the guidelines file differs per agent.
Making it overridable via config adds flexibility.

Agents that require frontmatter

For formats that require frontmatter — such as Cursor’s .cursor/rules/*.mdc — return true from frontmatter().

Post-processing guidelines

Use transformGuidelines() to modify the generated Markdown.

Adding custom AI guidelines

To add project-specific rules to Boost’s guidelines, place Blade files in the .ai/guidelines/ directory.
Example file:
When boost:install is run, these guidelines are automatically merged with Boost’s built-in guidelines and written to the output file.

Overriding built-in guidelines

Place a custom file at the same path as a Boost built-in guideline to have it take precedence.

Adding custom skills

Creating SKILL.md

Define a skill in .ai/skills/{skill-name}/SKILL.md.
SKILL.md consists of YAML frontmatter and Markdown instructions.

Generating an invoice PDF

Generate PDFs using barryvdh/laravel-dompdf:
Skills are designed to be loaded only when needed. Keep always-needed information in guidelines and task-specific details in skills to optimize the AI’s context usage.

Overriding built-in skills

Creating a custom skill with the same name as a Boost built-in skill will override it.

Adding Boost support to a third-party package

To add Boost support to your own package, place configuration files in the package’s resources/boost/ directory.

Adding guidelines

Adding skills

When a package user runs php artisan boost:install, these guidelines and skills are automatically detected and presented as installation options.

Real-world example: custom agent for an in-house CI/CD agent

A complete implementation of a fictional agent called “PipelineAgent” that is embedded in an internal CI/CD pipeline. This agent supports guidelines only; MCP and skills are not supported.
Register it in AppServiceProvider:
In a CI environment, generate guidelines only with the following command:

ClaudeCode.php — official implementation example

View the complete implementation of the ClaudeCode agent that ships with Boost.

Agent Skills

SKILL.md format specification and best practices.

Laravel Boost Custom Agent for GitHub Copilot CLI

Public package example that supports both Copilot CLI and Testbench.

Laravel Boost Custom Agent for PhpStorm with GitHub Copilot

Public package implementation example for the PhpStorm GitHub Copilot plugin.
Last modified on May 5, 2026