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
artisanwrapper script, committed to.gitignore - Write all shared guidelines using
./artisanas 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!