Skip to content
Agent Friendly Code

What to put in an AGENTS.md for Laravel

Laravel's layout is predictable to agents, so spend the file on your stack and commands. With Laravel Boost, php artisan boost:install writes the agent files; put your rules in .ai/guidelines/, or the next run overwrites them.

Which commands should it list?

  • composer run devserver, queue worker and Vite together
  • php artisan test --filter=UserTesttakes any Pest or PHPUnit argument
  • ./vendor/bin/pint --dirtyfix style in uncommitted files only
  • php artisan make:test UserTest --unittests/Feature unless --unit
  • php artisan boost:updaterefresh Boost guidelines and skills

Write them as your repo runs them, with its package manager and flags, plus how to run one test.

What layout should it explain?

  • Pest or PHPUnit, and what belongs in tests/Unit versus tests/Feature.
  • The front end: Blade, Livewire, or Inertia with React, Vue or Svelte.
  • Where your own agent rules live: .ai/guidelines/ and .ai/skills/ with Boost.

What do agents get wrong?

  • Never commit .env; list its keys in .env.example, or commit only .env.encrypted from php artisan env:encrypt.
  • Call env() only inside config/; once config is cached, .env is not loaded, so elsewhere use config().
  • Boost rebuilds its CLAUDE.md and AGENTS.md on boost:install and boost:update; edit .ai/guidelines/ instead.
  • Run php artisan config:clear before tests if config was cached.

From the official docs: laravel.com/installation (new tab) · laravel.com/testing (new tab) · laravel.com/configuration (new tab) · laravel.com/pint (new tab) · laravel.com/boost (new tab). The rest of the file is the same for any project: what goes in an AGENTS.md.

Laravel repos with an AGENTS.md or CLAUDE.md (3)

Built on Laravel; 3 pass the AGENTS.md check in full.

Laravel repos with an AGENTS.md or CLAUDE.md
RepoFileLength
laravel/laravelAGENTS.md 1,445
coollabsio/coolifyAGENTS.md 46,544
filamentphp/filamentAGENTS.md 7,613

More examples: Next.js · React · FastAPI · Django · Rails · Vue · Android · Flutter · all examples