---
title: 'Laravel Boost 2.5: Record Rules and Infer Conventions with AI'
source: 'https://youtube.com/watch?v=DGz5ecIRfOI'
video_id: 'DGz5ecIRfOI'
date: 2026-08-14
duration_sec: 694
---

# Laravel Boost 2.5: Record Rules and Infer Conventions with AI

> Source: [Laravel Boost 2.5: Record Rules and Infer Conventions with AI](https://youtube.com/watch?v=DGz5ecIRfOI)

## Summary

Laravel Boost 2.5 introduces a new 'project rules' feature that lets developers record and enforce coding conventions directly within their projects. This video demonstrates how to create, modify, and automatically infer rules using Cloud Code, and highlights the feature's potential to standardize code patterns across a codebase.

### Key Points

- **Introduction to Laravel Boost 2.5 Project Rules** [00:00] — Taylor announced a new feature in Laravel Boost 2.5 that records rules about your application. The feature is initially confusing but becomes clear with practical demonstration.
- **Creating Rules with Cloud Code** [00:35] — Using Cloud Code with Opus, you can record a rule by speaking or typing, e.g., 'all controllers should be invocable with single action.' The rule is saved in a new `.ai/rules` folder as Markdown files.
- **Rule Storage and Structure** [01:45] — The `.ai/rules` folder contains `controllers.md` (the rule) and `index.md` (a list of all rules). Rules can be created manually or via AI, and they can include exceptions (e.g., auth subfolder).
- **Checking Existing Controllers Against Rules** [03:01] — You can ask Cloud Code to check if existing controllers follow the rule. It found 3 controllers that violate the invocable rule, demonstrating the feature's ability to audit code.
- **Sponsor Segment: Spatie and Flare** [03:39] — Sponsored by Spatie and Flare. Shows how AI can install Flare in one command, including running tests and verifying setup, instead of manual steps.
- **Inferring Conventions Automatically** [06:59] — The most powerful feature: using the 'infer conventions' skill in Cloud Code scans the entire project and suggests potential rules based on existing patterns. It found 15 suggestions, e.g., 'fillable in 26 out of 27 models'.
- **Underhyped Feature** [10:06] — The feature is underhyped compared to other Laravel announcements. It can standardize code patterns, especially in larger projects, and is a significant addition to Laravel Boost.

### Conclusion

Laravel Boost 2.5's project rules feature is a powerful tool for enforcing and standardizing coding conventions, with the ability to create, modify, and automatically infer rules. It is underhyped and highly valuable for maintaining consistency in larger codebases.

## Transcript

Hello guys, in this video I want to show you a new feature they released in Laravel Boost in version 2.5 which was announced in this tweet by Taylor and at first it got me confused. So Laravel Boost record rules about your application in circumvention, so fancy words.
What does it actually mean and how does it actually work? Especially since we do have already things from Laravel Boost like automatically generated agents.md or cloud.md also agent skills with big structure so where does that new thing come in and I will show you on a
practical level how does that work in one of my projects and you will realize how important and awesome that new feature is. So in the docs of Laravel Boost there's a new section project rules which is right below guidelines and skills and it does look confusing and similar and kind of all
about the same thing. But actually it isn't. You can record rules that will be stored in a separate rules folder. So let me show you an example. So here I have Composer.json, and first I upgraded
Laravel Boost to version 2.5. So if I run composer show in the terminal, Laravel Boost should show, yep, there we go, 2.5.0. Next, I run cloud code and tell it with my whisper flow, record the rule
that all controllers should be invocable with single action. My whisper flow spelled invocable with C and not K, but I think that Cloud Code will understand. And I'm using Cloud Code with
Opus, and look what will happen now. It's calling Laravel Boost. So, there we go. Recorded in this file. And let's see what's inside. So, we have a new folder .ai. We should have that, yeah, .ai
rules and we have two new files controllers.md and index.md so this is what it recorded after my well short speech it wasn't just that it added some more details so controller must be invulpable
with k and let's see in this case and also a few more details and then do not add index store show split them into separate controllers you can record rule after rule in this way and this is
of the path where it would be applied and then there's index.md basically the list of all rules it actually reminded me way back when we started with some guidelines which started for me
from Sparky coding guidelines so they have Sparky guidelines for Laravel so how do we do things at our company what do we do with return types with properties with enums and stuff like that
So it's a very long list and now it also can be downloaded as a skill from what I remember. So there's a section using our guidelines with AI. So something similar now in Laravel Boost in a separate structure of AI rules And in the docs you can find that you can create those files separately manually like this in Markdown but why bother if you can just tell Cloud Code to do that for you And now next what
we can do, look what Cloud Code is actually suggesting. So we can just hit tab for example, and we now refer to existing controllers to follow this rule. I will not do that, I will hit double
escape. Instead, I will say check if all existing controllers follow this rule. So, not refactor, but just check the current controllers, which is a small project. AI coding daily, so it should be pretty quick. But before I show you
the result of that prompt and show you the most powerful feature of that Level Boost new version, let me talk about Spotty again because they suggest the guidelines, but also they are kindly
sponsoring my videos, which allows me to continue my mission of shooting these videos with reviews and news from Laravel. This video is sponsored by Sparti and Flare, their error monitoring and performance monitoring tool and in this video I want to show how
easy it is to install partially with AI if you want. So typical installation for such tool involves quite a few steps. So install the package, then add something to configuration, then to .env, and also it depends on your version, but luckily they
have instructions for older versions, and side note, they started supporting older Laravel 10. So I recently noticed a tweet by Freq that they support Laravel 10 and PHP 8.1 again, so separate side note.
Anyway, I wanted to try out Flare 4 JavaScript, and I will show that in the future videos, and to install this seems like so 2025. Can I ask Cloud Code to do that for me?
And yes I can. Let's try it together. I copy the instructions, I launch Cloud Code in my project, I paste, and look at the instructions. This is local project.
Basically same instructions, but AI can do that for me in one command instead of doing that one by one. So let's see the result. Of course your agent has to have permission to run Composer, installing Composer require,
And also updating .env is a sensitive topic, you may want to do that manually. But in this case I trust cloud code with that pretty simple task and you see the changes. So yeah, in one minute I have Flare installed and not only installed but also Flare test
has been executed and let's see if we have that actually registered. And at the end verify setup, Flare is connected, all good. So if I now go to the errors section, yep, I have the first exception logged successfully.
So yeah, if you are kinda lazy to read the docs, you can burn some tokens and install Flare with AI. And thank you, Spacy, for sponsoring my videos again. And there we go in 14 seconds we have the analysis results and it found 3 controllers that do not obey that rule So for example for cores if we have cores index controller with invoke and cores show controller with invoke
exactly what I wanted. And by the way, I'm not saying that you should do that in Laravel. This is my preference. Also, it depends on the project. Sometimes I do prefer that, especially for smaller projects where I know there will be like maximum 20 controllers altogether.
So, yeah, this is the structure that I want for controllers. and it found that there are three controllers that could be refactored. But also I see auth social controller, which I don't want to have that invocable structure,
so I can change the rule. Change the rule to have exception for auth subfolder in controllers. It does not need to have invocable controllers. So again, I'm typing or talking to Cloud Code,
and it will do all the changes for me. It found that it's AI rules controllers, and it will add one more line. As you can see, exception auth subfolder is exempt. Exactly what I wanted.
So now I have two violations to controllers that I may want to refactor, which I will not do in this video. This is not the point of this video. You get the idea of the rule that you may create and modify with cloud code. And then the future controllers
that will be built by AI agent should be listening to that rule that we have just created. But this is actually not the most powerful part of the new feature. So this is how you create the rules, but also we can infer applications conventions.
Again, it's a very sophisticated language, but basically it's this. Use the infer conventions skill. That's all you need to type into Cloud Code, and look what happens. Let's clear and start a new session, so the session wouldn't know anything about the rules that we just built.
And Cloud Code should run infer conventions skill. skill, I didn't even pronounce it correctly, and look what it will find. It will search through all our project for potential rules. So, there's a checklist that contains kind of guidelines and
typical things, typical decisions of Laravel, typical kind of best practice skills. And there we go, it took a bit longer, three and a half minutes, and it evaluated what are the patterns
throughout all the projects that could be potentially written as rules. And it found 15 of them. So, orientation, some general information about the project, and eloquent in line.
So, it suggests a rule that I don't use any repositories, actions, jobs, or event listeners. I would not agree. Sometimes I would want to do that, so I wouldn't consider that as a rule. But it noticed that there is a pattern in this project.
And the most probably valuable use in general of this one is if you have bigger codebase and you have multiple patterns so Cloud Code with this skill could potentially find you what are the majority of patterns and one or two files maybe have different patterns and
you may want to merge them. So, for example, I create services, resolve services with app something. So, I'm not using constructor injections in this case, but also I don't want it to be a rule. Another proposed rule about Livewire,
which also I don't want to use then validation in live where is what this validates also not a strict rule oh this one this I do like fillable in 26 out of 27 models
this is exactly what I wanted to show so one model is different it doesn't use guarded it actually doesn't use anything it just doesn't have fillables actually cloud code didn't specify which one
but you could make it a rule I prefer fillables maybe you prefer guarded but it could be a global rule, and this is a candidate. Then with observers, you may prefer attributes over registering observers in the app service provider, for example.
Then you may also prefer global helpers, which I do prefer, actually, so auth, config, and stuff like that, instead of doing facades. So you get the idea. There are 15 suggestions, which you may or may not agree with,
and again, you can prompt Cloud Code to build the rules out of those, and also you may add your own suggestions how to modify the rules, not exactly the way that Cloud Code is suggesting here.
And actually, I keep saying Cloud Code is doing that, but no, this is the skill, which is exactly what Taylor is talking about here. So, automatically infer conventions, this is what it means. So, use the infer conventions skill, and you may take a look what's inside.
So, in the version 2.5 of Booth, there's journal and infer conventions by pushback, which doesn't actually have any description, but 61 files changed, so pretty huge feature to be honest.
So you can take a look at what files changed, what is the checklist of references here. It's pretty long, so you can see, I'm not sure if you see, the scroll bar is pretty huge.
And also it contains stuff for like InertiaView, InertiaReact, a lot of other versions, so it depends on what version you want. So yeah, it's a pretty huge feature, but not really emphasized enough.
this tweet sounds like new, okay, but I think it's underhyped. Some things in Laravel community and in Laravel core features are overhyped, in my opinion, and this is much more important than
just a tweet. I think many of us should use that skill or set of skills to standardize our code patterns in the project, especially if it's a bigger project. But what do you guys think? Maybe
I'm over hyping it in this case or will I actually use it or try to use it in the project and let me know in the comments is it actually useful. That's it for this time and see you guys in other videos.
