Currently Available: Need a skilled Software Developer for your next project?
Categories
Laravel

Testing Code Quality with the Laravel Best Practices Tool

When an AI coding agent changes a Laravel project, your test suite can tell you whether the tested behavior still works. Those tests do not tell you whether the agent followed your project conventions or used Laravel well. Laravel’s laravel-best-practices skill gives an agent instructions for inspecting and changing Laravel code. The skill itself does not run tests, analyze code on its own, or produce a quality score.

You use the skill to guide the agent, and then you verify the edit with your project’s tests and configured checks. Each step gives you a different kind of evidence. Your test suite checks whether covered behavior works, your code-quality tools check configured rules, and your own review checks whether the agent followed the skill’s instructions.

What the skill does

Laravel distributes the skill through Laravel Boost, a package that installs agent guidance and provides Laravel-aware tools. You add Boost as a development dependency and install its resources by following the official Boost setup:

composer require laravel/boost --dev
php artisan boost:install

The best-practices skill consists of written instructions and links to more specific rules. Its workflow tells an agent to inspect nearby code and project configuration first, pick the guidance that fits the task, and make a focused edit. After that, the workflow tells the agent to check version-sensitive Laravel APIs, run the relevant checks, and review the final diff. The skill’s rule index covers areas like validation, database performance, routing, queues, and architecture.

The skill also instructs the agent to learn your project’s existing patterns before suggesting a different approach. If neighboring controllers already follow a clear pattern, the skill directs the agent to understand that pattern first. The agent can break from those patterns if the existing code has a correctness or security problem, and the skill expects the agent to explain why it did so.

Boost also includes an MCP server, which lets compatible AI agents call Laravel tools and read documentation. Even with that server, the best-practices skill only supplies guidance. Your project’s test suite and quality tools still have to run their own checks.

Try the skill on one change

Start your trial with a small, concrete task, like reviewing an endpoint’s validation or checking whether a relationship query fires unnecessary database requests. Before you prompt the agent, write down your project’s Laravel and PHP versions, the agent you are using, and the checks you already have configured. Then ask the agent to read the relevant files and tests before it edits anything.

Keep your request narrow. Ask the agent to name the Laravel guidance that applies, explain its proposed edit, make the change, run the relevant checks, and summarize what it touched. That sequence lets you see whether the skill shaped the agent’s reasoning and whether the final edit fits your codebase.

Do not take the agent’s summary at face value. Read the changed files yourself and compare them against the surrounding code. Make sure the agent skipped unrelated rewrites and that every version-specific API matches the Laravel version installed in your project. When you want to refresh Boost’s local resources later, Boost documents running php artisan boost:update.

Run tests and quality checks separately

Run the narrowest test that covers your change first, and then run the full suite when the edit affects more of the app:

php artisan test --filter=RelevantTest
php artisan test

Swap RelevantTest for a filter that matches your project’s test names. Laravel’s 13.x testing documentation explains that unit tests check isolated code without booting the Laravel application, while feature tests check how components work together or how HTTP requests behave. Laravel recommends feature tests for most application behavior because they exercise more of the app at once. Check the documentation for your installed Laravel version before relying on any version-specific details.

A passing test run only tells you that the tests you ran succeeded. It does not prove that the code is maintainable, secure, or consistent with your project’s conventions. If you change an endpoint, a feature test can confirm that the route returns the expected response, while saying nothing about whether the controller matches local patterns. For more on checking route behavior, see testing Laravel routes and response statuses.

Run the formatter and static analyzer that your project already uses. A formatter enforces your configured style rules, and a static analyzer checks your code against configured rules without running the application. A Laravel project might use Pint, PHPStan, or Larastan for this, though the skill itself never runs them or reports their output. When you record your results, list the exact commands you ran and what they returned instead of lumping everything together as “the skill passed.”

What a successful trial proves

The skill gives an AI agent a structured workflow, including steps for verification and diff review. A good trial shows that the agent followed that workflow on one specific change. It does not give you a universal quality score, and it does not prove that the same setup will improve every Laravel project.

Laravel’s post on idiomatic Laravel code draws a similar line. Tests give you evidence about correctness, while idiomatic code is a separate question. The benchmark results in that post evaluate Boost as a whole, so they do not isolate the effect of the best-practices skill on its own.

Because the skill prioritizes your existing project patterns, the agent is less likely to introduce jarring convention changes. The trade-off is that the skill will not automatically modernize weak patterns across your codebase. Weigh the agent’s suggestions against what the task requires, and plan broader architecture or security work deliberately instead of expecting the skill to catch and fix everything.

What I'm building

Delegate tasks. Get software.

Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.

Take a look at vroni.com

Email updates

Usually a new article and a few links I found interesting.

No spam. Unsubscribe with one click.

Leave a Reply

Your email address will not be published. Required fields are marked *