Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Thriddle's avatar

local AI guidelines

I'm working an a new project with Laravel 13. I'm using Lando as my development environment and everything is running in Docker containers. After installing boost I edited the mcp.json so it's using the proper command to start the MCP server.

Because every service has to be called within Lando I created a custom guideline and skill to make sure Copilot uses the correct commands. Without manually changing the commands in the .github/guidelines and AGENTS.md from 'php artisan...' to 'lando artisan...', Copilot does use lando to make use of the services. It's working great!

So what's the problem? Well, a second developer is going to help me, and he doesn't use Lando. So the guideline to use the 'lando' command doesn't work for him. This should only apply to my development environment.

Is there any convention to use local guidelines and let laravel/boost update the AGENTS.md based on local guidelines?

0 likes
2 replies
LaryAI's avatar
Level 58

Certainly! Here’s a solution to your Laracasts question regarding local AI guidelines for Copilot/Boost with Laravel development environments, especially where one developer uses Lando and another does not.


Problem Recap:
You want Copilot/Boost to use lando artisan on your machine and php artisan on your teammate's, without having to constantly change shared documentation/guidelines, and ideally, you want a way to have local guidelines that only affect your environment.


Solution

Currently, Boost/Copilot relies on the contents of guidelines files (like .github/guidelines or AGENTS.md) that are typically committed to the repository, so they're shared among all developers. There isn’t official support for per-developer guidelines as part of the sync process.

However, you can handle this scenario with a combination of convention and automation, so both use their own commands seamlessly.

1. Use a wrapper script (artisan)

Create a shell script called artisan at your project root (add it to .gitignore so it's not committed):

#!/bin/bash

if command -v lando &>/dev/null && lando info &>/dev/null; then
    # If lando is installed and project is started
    lando artisan "$@"
else
    php artisan "$@"
fi

Make it executable:

chmod +x artisan

Update your guidelines and AGENTS.md to always use:

./artisan <command>

Now, on your Lando setup, it will use lando artisan ...; on your teammate's, it'll use php artisan ..., with no manual changes needed.


2. Dynamic AGENTS.md/guideline generation (optional)

If you want to get fancy, you can generate your guidelines with a snippet in your project (in, say, a composer post-install script, Makefile, or similar), and inject the correct prefix automatically per environment. Example using a simple script:

// scripts/generate-guidelines.php
$prefix = file_exists('/usr/local/bin/lando') ? 'lando' : 'php';
$template = file_get_contents('guidelines.template.md');
file_put_contents('AGENTS.md', str_replace('{{artisan}}', "$prefix artisan", $template));

Your guidelines.template.md would use {{artisan}} migrate etc.


3. Document the approach

Document for your team that all local artisan commands should use ./artisan, not php artisan or lando artisan directly.


Summary

There is no native way in Boost/Laravel to have per-developer AI guidelines. The recommended approach is:

  • Use a project-root artisan wrapper script, committed to .gitignore
  • Write all shared guidelines using ./artisan as the command prefix
  • Optionally automate guideline generation with a local script/template system

This approach ensures both developers (Lando or not) can use the same Copilot skills, with no friction!


Example artisan script:

#!/bin/bash

if command -v lando &>/dev/null && lando info &>/dev/null; then
    lando artisan "$@"
else
    php artisan "$@"
fi

Example guideline entry:

To run migrations, use:
./artisan migrate

Let me know if you need help automating the template step or handling edge cases!

Thriddle's avatar

The problem is not limited to artisan commands. I don't have php, composer and node installed. Everything is ran in containers. So instead of 'npm ...' I use 'lando npm ...'.

  • 'php artisan make...' -> 'lando atrisan make...'
  • 'npm run build' -> 'lando npm run build'
  • 'composer dump-autoload' -> 'lando composer dump-autoload'

Please or to participate in this conversation.