Introducing Laravel Boost0:07
Now we're still not done with context. So next up is Laravel Boost. So work along with me and visit github.com/ Laravel slash boost. Alright, so Laravel Boost, of course, is a Laravel specific package. It's Ancp server, but don't worry about that right now. Basically, it provides additional context and power and capabilities to your AI agent. So the best way to explain this is
Installing Boost Package0:26
and capabilities to your AI agent. So the best way to explain this is to dive right in and try it out. Let's do it now. So first up, we're going to install it and we can do this directly from my editor. So I will paste that into the terminal, give that just a second to complete. And now it's gonna give us, among other things, three, uh, boost specific artisan commands. So if I run PHP B Artisan Boost, it'll show us, well,
boost specific artisan commands. So if I run PHP B Artisan Boost, it'll show us, well, we have install MCP and update. So of course right now we want install. All right, peach B Artisan Boost and stole. And it's gonna ask us a series of questions. All right? First up, do we want to install the herd MCP alongside Boost MCP? We don't know what MCP is at this point for now, just hit yes and until we talk more
We don't know what MCP is at this point for now, just hit yes and until we talk more and we have a dedicated episode on what those are, just think of it as a server that provides additional knowledge and capabilities to your AI agent. Alright, that's good enough for now. Next, what editors are you using? Select all that apply at the moment. Just Peach B Storm. Next, what agents? Remember there's lots
Select all that apply at the moment. Just Peach B Storm. Next, what agents? Remember there's lots of different agents we're using Cloud code or Codex, uh, from the Facebook team, cursor, Gemini, choose all of them that apply. In our case, we'll stick with Juni and maybe cloud code if you use that. Alright, so now notice as part of the installation, it's including guidelines, but these guidelines are dynamic,
Dynamic AI Guidelines1:44
it's including guidelines, but these guidelines are dynamic, which means it's scanning our code base and our packages to determine what we're using here. And then if it has associated guidelines, it pulls those in. So in our case, we're using Laravel 12 and notice we have Laravel 12 guidelines. We're using inertia js. So we have inertia guidelines, we are using pest PHP instead of PHP units.
So we have inertia guidelines, we are using pest PHP instead of PHP units. So once again, we have pest specific guidelines, and again, those guidelines instruct AI for how it should go about writing that code. Alright, best practices as provided by the creators of these, uh, tools. All right, so next we have, uh, everything all set to go. So if I run a GI status, you'll see that we have a handful of files that we can interact with.
So if I run a GI status, you'll see that we have a handful of files that we can interact with. Okay? All right, so let's take a look. If I open up the sidebar, I now have a dot juni directory, and here's a guidelines file, but this time it was created specifically by Laravel Boost. And again, just to reiterate, it's dynamic based upon what we have installed. So here's the tooling that AI now knows about without having to manually scan, uh, our project.
So here's the tooling that AI now knows about without having to manually scan, uh, our project. Next, you'll see all of the various guidelines here. So let's go down to how about inertia? We're using inertia here and Boost wants it to know, well, this is where we place our pages. This is how you should render an inertia page. We have code snippets, and then look at this section right here.
Explaining MCP Skills3:07
We have code snippets, and then look at this section right here. Use search docs for accurate guidelines on all things inertia. All right, so now you're thinking, well, what is search docs? Well, search docs is sort of like a skill that the MCP server provides, right? Mm-hmm. Remember I said MCP provides knowledge and capabilities?
Mm-hmm. Remember I said MCP provides knowledge and capabilities? Well, those capabilities could be referred to as skills, and in this case, one of those skills is to search the documentation without having to scrape the web and pull up blog posts and things like that. No. Now it can use the skill to get the most up-to-date documentation for the very version of the package that you're using. That's really cool. Next, let's keep going.
for the very version of the package that you're using. That's really cool. Next, let's keep going. It's gonna let it know, hey, it don't try to do any inertia one code. Here we have inertia two, here are the things it supports. And if you need to, for example, pull my server, don't wire up your own version. Here we have this out of the box. And again, if you've ever run into this in the past where AI is using outdated methodologies to solve a problem,
And again, if you've ever run into this in the past where AI is using outdated methodologies to solve a problem, well, things like this really do help. Now we can instruct it that, hey, nope, we're using inertia two, and make sure you review the features. Here's the documentation if you need to learn more via that skill, and this is how I want you to behave. Got it? Cool. So anyways, let's come back. Here is the MCP servers.
Enabling MCP Servers4:24
Got it? Cool. So anyways, let's come back. Here is the MCP servers. This is how we register these servers with your agent. In this case for Juni notice. And, and don't be overwhelmed here, this is very simple. We have an MCP server for Laravel Boost and Herd, and notice it's just specifying, well, we're gonna run PHP and then we're gonna run Artisan, and then we're gonna run Boost and MCP. So this is effectively BB artisan boost MCP.
and then we're gonna run Boost and MCP. So this is effectively BB artisan boost MCP. And in fact, you can run this directly from the command line to start up your MCP server, but now this is a way to instruct the agent how to start it up on its own. And then we also have one for hurt. Alright, so cool. I think we're all set to go here. Alright, so now the final step is to simply enable these MCP servers.
Alright, so now the final step is to simply enable these MCP servers. So open up your settings, look for MCP and yeah, down with juni. If we're using that, let's make sure we enable these. Uh, click apply and if you're working along, make sure the status is green. If it's red, that means for some reason the surfer didn't start up properly. But sure enough, if I hover over this, we'll see.
Using Tools to Fix Bugs5:26
for some reason the surfer didn't start up properly. But sure enough, if I hover over this, we'll see. Yep, these tools are now available. Okay, so let's try it out behind the scenes, I have, uh, created a route for the homepage that instantly throws an error and I've already triggered that error. So if I go into my log file, sure enough, we can see beep, beep, alert, alert failure. So here's what I want. I want AI to inspect this log,
beep, alert, alert failure. So here's what I want. I want AI to inspect this log, determine the reason for that error, and then fix the bug automatically. Let's go. Alright, so let's open our chat. We're gonna use the uni agent and let's speak it out loud. Once again, the last time I loaded the homepage, an error was thrown. I'd like you to read the application logs and fix the bug. Thank you. All right, so let's give it just a second
I'd like you to read the application logs and fix the bug. Thank you. All right, so let's give it just a second and we're gonna watch what happens here. Ah, take a look at this. Run MCP commands. So yes, otherwise without boost, what it would probably do is try to tail the Laravel log file, and that would work. But again, just notice that we're providing better capabilities, more efficient, uh, capabilities to the agent. So it's saying, Hey, I wanna use this MCP surfer
capabilities, more efficient, uh, capabilities to the agent. So it's saying, Hey, I wanna use this MCP surfer and I want to run the read log entries. Um, tool. Yeah, go ahead. All right. It revealed a critical error. Yes, it was a critical error, and it's gonna fix the bug now. All right, so now it's going into home controller. It's kind of, it's kind of a good learning opportunity as well to figure out how do I debug things.
It's kind of, it's kind of a good learning opportunity as well to figure out how do I debug things. If you're at the beginning of your career, so it goes into home controller and it reads that action and then sees, ah, well it was throwing an error, so it's gonna change the file. I examined the controller and I found a deliberate throw statement that was causing the error, removing it, fix the bug. It's always amazing when just removing the
that was causing the error, removing it, fix the bug. It's always amazing when just removing the error fixes the bug. So notice we have our plan that it creates on its own and it fixed the error. So if I were to close this out, sure enough, if I go into, what was it, home controller, you'll see, yep, it, it removed the error and it fixed the bug. You get the idea. Here's some other things you can do. Uh, let's create a new chat
You get the idea. Here's some other things you can do. Uh, let's create a new chat and we're just gonna have a conversation for now. So I will be explicit that we're only asking the agent, uh, we'll say what routes are available, um, in my application, right? So once again, without boost, it might try to scan your routes file. Um, it might try to trigger an artisan command through the terminal, but in this case, uh,
Um, it might try to trigger an artisan command through the terminal, but in this case, uh, it can instead defer to a list routes tool. So we give that a run, it retrieves the routes, and now it's preparing the response. All right, here we go. So we have a big massive list of routes that we don't need to take a look at right now. All right, let's do one more together. So we have this home controller
All right, let's do one more together. So we have this home controller and it loads the home inertia page. This is mostly just kind of generic, um, just a generic splash page. But why don't we do this? Why don't we say, well, when, uh, the component mounts, I'm going to do a console error. And once again, we'll say beep beep browser, um, issue. All right? So yeah. Uh, if I have vet running behind the scenes and I run this in the browser,
All right? So yeah. Uh, if I have vet running behind the scenes and I run this in the browser, sure enough, if I bring up the inspector and I go into console, yep, we're gonna see beep beep browser issue. Okay? So let's have AI fix this issue as well. When loading the homepage, I noticed in the console there was an error related to beep beep. I'm not sure why. Can you read the browser logs
to beep beep. I'm not sure why. Can you read the browser logs and fix the bug for me? All right, let's get going. All right. Once again, it's gonna use the browser logs tool. All right? It revealed a local error. It knows to check the homepage component. It found a console error in the mounted hook. It fixes it, and now it understands that maybe you need to rebuild the project.
It fixes it, and now it understands that maybe you need to rebuild the project. Notice it knew what the command was, it might be able to figure that out on its own, but we have a guideline for it to let it know, uh, how to build our assets. All right? And now you, once again, the bug is fixed back to the browser, give it a refresh, open the console, and we already know, ignore this. That's just related to an old gif.
and we already know, ignore this. That's just related to an old gif. Uh, but the main error is now gone, which is great. Uh, so yeah, all of this factors into the context that we present to ai. And again, just to reiterate, context refers to all relevant data and information and knowledge that we provide to the ai. So this would include the chat itself, of course, the chat history, the project, the files
So this would include the chat itself, of course, the chat history, the project, the files that we explicitly reveal to ai, and of course the MCP servers that we install that provides essential guidelines and context for the AI to make the best possible decision.
