VOOZH about

URL: https://deepwiki.com/invokable/laravel-boost-phpstorm-copilot/3.3-ai-guidelines-and-skills

⇱ AI Guidelines and Skills | invokable/laravel-boost-phpstorm-copilot | DeepWiki


Loading...
Last indexed: 28 February 2026 (57ef88)
Menu

AI Guidelines and Skills

This page describes the AI Guidelines and Agent Skills that this package configures for PhpStorm with GitHub Copilot. These components provide project-specific instructions, conventions, and domain knowledge to guide AI-assisted development within Laravel projects.

For information about how these guidelines are registered with the Laravel Boost framework, see Laravel Boost Integration. For details on how they are delivered to PhpStorm Copilot through the MCP protocol, see MCP Server Architecture.


Purpose and Installation

The package installs two types of AI configuration files when you run boost:install and select the appropriate features:

Feature SelectionFiles InstalledPurpose
AI Guidelines.github/instructions/laravel-boost.instructions.mdProject-wide coding standards, conventions, and best practices
Agent Skills.github/skills/*/SKILL.mdDomain-specific knowledge modules that activate contextually

These files are created by the PhpStormCopilot agent class when it implements the SupportsGuidelines and SupportsSkills contracts from Laravel Boost.

Sources: src/PhpStormCopilot.php86-97


File Structure and Locations

Published File System Structure:


Published File Locations:

File TypeDestination PathTemplate Source
Guidelines.github/instructions/laravel-boost.instructions.mdresources/boost/guidelines/core.blade.php (one contributing section)
Pest Skill.github/skills/pest-testing/SKILL.mdresources/boost/skills/pest-testing/SKILL.md (in package resources)

The guidelinesPath() and skillsPath() methods on PhpStormCopilot return these destination paths. The laravel/boost framework uses them to know where to write published files within the developer's project.

Sources: src/PhpStormCopilot.php86-97 .github/instructions/laravel-boost.instructions.md1 .github/skills/pest-testing/SKILL.md1 resources/boost/guidelines/core.blade.php1


AI Guidelines Structure

The guidelines file .github/instructions/laravel-boost.instructions.md1-248 contains multiple rule sections organized by topic, wrapped in a <laravel-boost-guidelines> XML container. Each section provides specific coding standards and tool usage instructions.

XML Container Structure:


Guidelines Content Sections

Rule Section Organization:


Sources: .github/instructions/laravel-boost.instructions.md1-248

Key Guidelines Sections

SectionLinesPurpose
Foundation Rules2-51Application context (PHP 8.5.2, Laravel 12, Pest 4), skill activation instructions, conventions
Boost Rules53-92Laravel Boost MCP tool usage, list-artisan-commands, get-absolute-url, tinker, search-docs
PHP Rules92-127Constructor property promotion, type declarations, enum conventions, PHPDoc standards
Laravel Core Rules128-182Eloquent relationships, Form Requests, authentication, URL generation, queues, testing with factories
Laravel 12 Rules183-207Bootstrap/app.php structure, middleware configuration, database features, casts() method
Pint Rules208-214Code formatting with vendor/bin/pint --dirty
Pest Rules215-224Test creation, execution, documentation search, skill activation

Sources: .github/instructions/laravel-boost.instructions.md1-248

Foundational Context Example

The guidelines specify exact package versions to ensure AI provides version-appropriate code:

## Foundational Context

This application is a Laravel application and its main Laravel ecosystems package & versions are below.

- php - 8.5.2
- laravel/framework (LARAVEL) - v12
- laravel/mcp (MCP) - v0
- laravel/prompts (PROMPTS) - v0
- laravel/pint (PINT) - v1
- pestphp/pest (PEST) - v4
- phpunit/phpunit (PHPUNIT) - v12

Sources: .github/instructions/laravel-boost.instructions.md8-18

Skills Activation Instructions

The guidelines .github/instructions/laravel-boost.instructions.md20-24 include explicit instructions for when to activate domain-specific skills. This ensures AI assistance activates the appropriate skill context based on developer actions or keywords.

Skill Activation Pattern:

ComponentContent
Trigger Keywordstest, spec, TDD, expects, assertion, coverage
Action TriggersWriting tests, creating unit/feature tests, adding assertions, debugging test failures
Domain TriggersTesting Livewire components, browser testing, working with datasets or mocking
Skill Namepest-testing
Activation Timing"MUST activate...whenever you work in that domain—don't wait until you're stuck"

Example Activation Text:


Sources: .github/instructions/laravel-boost.instructions.md20-24


Agent Skills

Skills are domain-specific knowledge modules stored as individual directories under .github/skills/. Each skill contains a SKILL.md file with YAML frontmatter and detailed documentation.

Skill File Format


Sources: .github/skills/pest-testing/SKILL.md1-174

pest-testing Skill Structure

The included pest-testing skill demonstrates the skill format:

ComponentContent
Frontmattername: pest-testing, description with activation triggers
When to ApplyCreating tests, modifying tests, debugging failures, browser/architecture testing
DocumentationReference to search-docs tool for Pest 4 patterns
Basic UsageTest creation commands, test organization, basic structure, running tests
AssertionsSpecific assertion methods table (assertSuccessful() vs assertStatus(200))
MockingImport instructions for use function Pest\Laravel\mock;
DatasetsExamples of dataset usage for repetitive tests
Pest 4 FeaturesBrowser testing, smoke testing, visual regression, test sharding, architecture testing
Common PitfallsList of frequent mistakes to avoid

Sources: .github/skills/pest-testing/SKILL.md1-174

Skill Activation Triggers


Sources: .github/skills/pest-testing/SKILL.md1-21 .github/instructions/laravel-boost.instructions.md20-24


Code Snippet Format in Skills

Skills use a custom <code-snippet> XML format to provide example code:


Examples from pest-testing Skill

Snippet NameLinesPurpose
Basic Pest Test Example40-45Demonstrates it() syntax with expect() assertions
Pest Response Assertion58-64Shows assertSuccessful() instead of assertStatus(200)
Pest Dataset Example80-90Demonstrates dataset usage with with() method
Pest Browser Test Example114-133Full browser test with visit(), interactions, assertions
Pest Smoke Testing Example139-145Quick multi-page validation
Architecture Test Example159-165Enforcing code conventions with arch()

Sources: .github/skills/pest-testing/SKILL.md40-167


AI Interaction Flow with Guidelines and Skills

Runtime Interaction Sequence:


Sources: .github/instructions/laravel-boost.instructions.md20-24 .github/skills/pest-testing/SKILL.md1-174 resources/boost/guidelines/core.blade.php1-33


Guidelines Best Practices

The guidelines enforce specific Laravel development patterns:

Eloquent and Database Patterns

  • Always use proper Eloquent relationship methods with return type hints
  • Prefer Model::query() over DB::
  • Use eager loading to prevent N+1 queries
  • Generate factories and seeders when creating models
  • Use Eloquent API Resources for APIs

Sources: .github/instructions/laravel-boost.instructions.md138-151

Form Validation Pattern

  • Always create Form Request classes for validation
  • Never use inline validation in controllers
  • Include both validation rules and custom error messages
  • Check sibling Form Requests for array vs string rule conventions

Sources: .github/instructions/laravel-boost.instructions.md153-156

Laravel Boost MCP Tool Usage

ToolWhen to Use
list-artisan-commandsBefore calling Artisan commands to check available parameters
get-absolute-urlWhen sharing project URLs with correct scheme, domain/IP, port
tinkerExecute PHP to debug code or query Eloquent models
database-queryRead from database without full Eloquent context
browser-logsRead recent browser logs, errors, exceptions
search-docsBefore making code changes - searches version-specific docs for installed packages

Sources: .github/instructions/laravel-boost.instructions.md59-91

Documentation Search Strategy

The guidelines provide specific instructions for using the search-docs tool:

- Use multiple, broad, simple, topic-based queries at once. 
 For example: ['rate limiting', 'routing rate limiting', 'routing']. 
 The most relevant results will be returned first.
- Do not add package names to queries; package information is already shared. 
 For example, use 'test resource table', not 'filament 4 test resource table'.

Available Search Syntax:

  1. Simple Word Searches with auto-stemming - authentication finds 'authenticate' and 'auth'
  2. Multiple Words (AND Logic) - rate limit finds both "rate" AND "limit"
  3. Quoted Phrases (Exact Position) - "infinite scroll" words must be adjacent
  4. Mixed Queries - middleware "rate limit" combines word and phrase
  5. Multiple Queries - ["authentication", "middleware"] finds ANY term

Sources: .github/instructions/laravel-boost.instructions.md78-91


Laravel 12 Specific Guidelines

The guidelines include version-specific instructions for Laravel 12's streamlined structure:

TopicGuideline
Middleware RegistrationNo longer in app/Http/Kernel.php, use bootstrap/app.php with Application::configure()->withMiddleware()
Bootstrap Configurationbootstrap/app.php for middleware, exceptions, routing; bootstrap/providers.php for service providers
Console Kernelapp\Console\Kernel.php no longer exists, use bootstrap/app.php or routes/console.php
Console CommandsAuto-discovered from app/Console/Commands/, no manual registration needed
Model CastsCan use casts() method instead of $casts property, follow existing conventions
Eager Loading LimitsNative support: $query->latest()->limit(10) without external packages

Sources: .github/instructions/laravel-boost.instructions.md183-207


Implementation in PhpStormCopilot Agent

The PhpStormCopilot class in src/PhpStormCopilot.php implements Laravel Boost contracts that enable guidelines and skills functionality.

Contract Implementation Architecture:


Contract Method Implementations:

ContractMethodReturn TypeDefault Return ValueConfig Key
SupportsGuidelinesguidelinesPath()string.github/instructions/laravel-boost.instructions.mdboost.agents.phpstorm_copilot.guidelines_path
SupportsSkillsskillsPath()string.github/skillsboost.agents.phpstorm_copilot.skills_path

Both return values can be overridden via the application's boost config. The returned string is the destination path inside the developer's project where the file will be written.

Publishing Process:

  1. php artisan boost:install invokes the Laravel Boost installation flow
  2. Boost framework calls guidelinesPath() and skillsPath() on the registered PhpStormCopilot agent
  3. Template files from resources/boost/guidelines/ and resources/boost/skills/ are rendered and written to the destination paths
  4. Published files become available to artisan boost:mcp at runtime

Sources: src/PhpStormCopilot.php86-97 resources/boost/guidelines/core.blade.php1-33


Package-Specific Guidelines

The guidelines .github/instructions/laravel-boost.instructions.md225-248 include a section specific to this package's development environment, which uses Orchestra Testbench instead of a full Laravel application.

Package Development Environment Rules:

TopicGuidelineReason
MCP Config Flagcopilot --additional-mcp-config @.github/mcp-config.json --continueRequired for every Copilot CLI session to access Laravel Boost MCP tools
Environment TypeLaravel package development project using Orchestra TestbenchNot a standard Laravel application
Available Commandsvendor/bin/testbench instead of php artisanOrchestra Testbench provides isolated package testing environment
MCP Tool AvailabilityTools like database-query, database-schema, list-routes may return limited resultsPackage environment lacks full application context, database, application-specific models
Working Toolsapplication-info, list-artisan-commands, search-docsBasic tools that don't depend on application-specific features
Development FocusWriting tests, implementing package features, ensuring Laravel compatibilityPackage-specific development tasks

MCP Configuration File Location:

.github/mcp-config.json

This file is referenced using the --additional-mcp-config flag when starting Copilot CLI from the package's root directory.

Sources: .github/instructions/laravel-boost.instructions.md225-248


Guidelines vs Skills Comparison

AspectAI GuidelinesAgent Skills
File Location.github/instructions/laravel-boost.instructions.md.github/skills/*/SKILL.md
ScopeProject-wide, always activeDomain-specific, contextually activated
FormatSectioned markdown with XML wrapperYAML frontmatter + markdown content
PurposeCoding standards, conventions, tool usageDeep domain knowledge for specific tasks
ContractSupportsGuidelinesSupportsSkills
ActivationAutomatic on every AI interactionTriggered by context or keywords
Content TypeRules, preferences, version infoPatterns, examples, pitfalls, detailed how-to
Examples"Use Form Requests for validation"Complete test structure with code snippets

Sources: .github/instructions/laravel-boost.instructions.md1-248 .github/skills/pest-testing/SKILL.md1-174