AI Vibe Coding Is Broken. Strict Engineering Fixes It.

nunomaduro| 00:18:39|May 28, 2026
Chapters13
Introduces the theme of strict AI empowered engineering and sets the goal of generating better code with AI tools.

Strict engineering with PHPStan, TypeScript, and a rigorous testing pipeline beats vibe coding when building AI-assisted code in 2026.

Summary

Nuno Maduro argues that 2026 demands strict AI-driven engineering rather than sloppy prompt-based code. He highlights PHPStan as the PHP stand-in for catching errors across the whole project, not just the current file, and shows TypeScript catching missing imports in real time. Maduro emphasizes consistent coding conventions—typed code, final classes, property reads, and preferring patterns he’s developed like the action pattern—to keep AI-generated code coherent. He walks through configuring a robust testing pipeline with Composer scripts that run linting (Rector, Laravel Pint), TypeScript linting, and type-coverage checks in one go. The demo with Claude showcases generating a full feature end-to-end, complete with migrations, models, controllers, form requests, factories, tests, and a fully typed frontend. He also stresses type coverage as a gatekeeper for production-ready AI output, insisting that 100% typing is non-negotiable. Finally, Maduro calls for engineers to be “top quality” by owning their prompts and ensuring every AI-generated line meets strict standards. The talk blends practical tooling with a rallying message for disciplined, craft-focused coding in 2026.

Key Takeaways

  • PHPStan checks the entire project for non-existent properties or misused attributes, dramatically reducing runtime errors across builds.
  • TypeScript serves as the frontend counterpart to PHPStan, catching missing components and imports before deployment.
  • Composer scripts consolidate linting, formatting, and type checks into a single command (composer lint) to streamline team onboarding and CI consistency.
  • Type coverage enforces complete typing across the codebase; removing a type will trigger a failure until fixed (e.g., missing return type).
  • Running tests in parallel with 100% code coverage ensures AI-generated features are production-ready and visible via CI, with a final aggregate command (composer test).
  • Maduro links strict engineering to a broader philosophy: AI-generated code must be crafted by engineers who own the prompts and enforce quality—'Aenti coding is not vibe coding.'

Who Is This For?

Essential viewing for Laravel developers and frontend engineers who want to harness AI for production-grade code. It’s particularly valuable for teams adopting strict typing, CI/CD discipline, and consistent project conventions to keep AI-generated code reliable.

Notable Quotes

"PHPStan is literally tell me the following. The property the Japan does not exist."
Maduro demonstrates PHPStan catching a non-existent property across the whole project.
"TypeScript just like PHPStan will tell me two things. First, the page component does not even exist."
Illustrates TypeScript catching import/typing issues in the frontend.
"This is the most important thing in 2026: Aenti coding is not vibe coding."
Closing line reinforcing the strict engineering philosophy.
"Composer test will aggregate the full testing pipeline."
Shows how a single command runs linting, type checks, and unit tests.
"100% typing is not negotiable for AI-generated production code."
Stresses type coverage as a production gatekeeper.

Questions This Video Answers

  • How do I set up PHPStan for a Laravel project to scan the whole codebase and not just the current file?
  • What does a strict AI-driven testing pipeline look like in PHP and TypeScript projects with Composer scripts?
  • Can TypeScript help prevent frontend import errors when AI generates UI components for Next.js or React apps?
  • How can I enforce 100% type coverage and why is it crucial for AI-generated code in production?
  • What does the action pattern look like in real-world Laravel apps and how does it help AI-generated code stay consistent?
PHPStanTypeScriptLaravelEloquentComposer scriptsCI/CDTesting pipelineCode qualityAI codingType coverage
Full Transcript
Let's talk about strict engineering because we are actually in 2026. This talk will be more about strict AI engineering. My goal today is give you a set of tips which hopefully are going to make you generate better code using tools like AI. Moving to the very first one which is one of my favorites. Therefore, the question about PHP stand to you all which is types are your AI best friend. Dear people from Tokyo, we are in 2026. All of you needs to know what is PHP stand is the best project that ever happened to PHP since its incarnation after Laravel if I'm honest. Okay, but PHP stand is just a must know as a PHP developer. So all of you when you go back to work at 9:00 a.m. you grab a coffee and then you learn about PHP stand. It's literally the equivalent of TypeScript for PHP. It just works. So for those of you who don't know what is PHP stand, I'm going to show you exactly what is about. Moving back to my editor and I think I'm going to open this update user.php. Just a regular class, something really peasy and easy. So what I will do here is just make a mistake. Okay, instead of accessing email, I'm going to accessing something like Japan. Okay, does not exist as an attribute. It's clearly a mistake. And what I will do now, I think, is just go to my console and I'm going to execute PHP stand. And just look how beautiful this thing is. Okay, this is better than AI. PHP stand is literally tell me the following. The property the Japan does not exist. And you might think, I know what you're thinking. You might think, well, my PHP storm also tells me what is wrong with this line. Well, that's on the file you are visualizing at that given moment. PHP stand in the other way goes to your entire project and it tells you exactly what is wrong. This is just the most valuable tool you will learn from this conference. I I'm going to tell you that already. Okay, this is PHP stand. You can enable on the CI and avoid broken deployments if you want to. Now obviously that is PHP stand but a bunch of you are probably using JavaScript on the front end too. And for that we have the equivalent of PHP stand call it TypeScript. Now TypeScript is kind of easy. You just install it. And to kind of reproduce and show you this in practice, I think I'm going to go to my my resources GS maybe pages user profile edit. Okay, I have a bunch of imports here which they are beautiful JavaScript code. And I think I'm going to just replace this use page with just page. Now page does not exist. is not something that can be imported. But I'm going to run TypeScript to see what TypeScript has to say about this. So I'm going to just type this and TypeScript just like PHP stand will tell me two things. Well, first of all, the page component does not even exist. And the use page that I was using no longer is imported. So just like PHP stand, it really just works. Okay, I'm going to execute the same command. And now obviously I have a green statues and I'm good. Okay, so this is PHP stand and Typescript and at 9:00 a.m. after the conference, this is the first thing we're going to do. Okay, moving forward to other things that are important on this area of AI, which is I love patterns and AI loves them too. I don't know if you guys have noticed, but the very first thing AI does when you ask for something is getting familiar with your project. So we'll see this dude is using PHP, is using some JavaScript, is using Laravel, is using React. But then it will understand your conventions. Do you like uh typed code? Do you are you consistent with your approach naming classes? Do you like final classes? Do you like generics? And it will basically get a general understanding of how do you like the code to be. Now it's important to be consistent on this exact moment. So the generated code after that point by AI will be just perfect. And I'm going to show you a few things you guys can do to also have this in your AI generated apps. Moving back to my editor here. And what I will do I think is show you my migrations because I have a bunch of opinions on migrations that I love. And you know as a PHP developer I like to always use the class trick types all the way top. So on every single PHP file I have, I use this line. Moving all the way down, I think PHP docs in 2026 are useless. So I don't use them ever. Also, I like to type my code. It's fully typed all over the place. And I do this not only on this file, but across all the files I have. So if I move here to other migrations, they all look the equal. they are all the same without PHP docs without uh full typed but also like I don't use the down method as well so I'm going to be consistent with that again this is super important so the next code generated by AI will be exactly like this moving a little bit to other stuff uh potentially my eloquent models I like my eloquent models to obviously start with the class three types all the way top I like to use property reads to engage the typing of my models going all the way down. I see final classes. I see generics being used all over the place. And if I continue to check this, my code is literally like this all the time. I'm going to move here all the way down. I am on this user controller, which is final readon. Um, I'm using form requests all the time. Even if I don't need them, I'm going to still use them. Form requests all the time. I use the action pattern, which is something I haven't invented, but I have popularized it. Um, and basically all my code looks the same. This to say that AI, this is crucial to have AI generating beautiful code in oneshot code for you. Okay, at the end of this talk, I'm going to actually do a demo to you all so you guys can see all of this stuff being applied on the real feature. Okay, moving from love patterns to something that means a lot to me. Okay, this is my favorite topic ever. So don't um get surprised if I get too excited. I want to talk about the testing pipeline and why that is important in 2026. If testing was important before, now with AI is even more important. It's literally the last safeguard between the code generated by AI and production code. And a lot of you may think, well, testing pipeline is just about unit tests, but it's not. It's about the whole spectrum of quality tools. We're talking about formatting. We're talking about linting, type coverage, code coverage, static analysis, the entire thing. And I'm going to show you this. How do I configure this on my own projects? So, moving again to my editor, I'm going to open the best package manager in the world, call it composer, and I'm going to scroll all the way down. Now, let me show you exactly how do I configure my testing pipeline. First of all, I use something which I don't know if you guys know, but it's called composer scripts. allow me to put some bash commands behind composer and then the very first one I have it's called it composer lint okay when I run composer lint on my terminal a couple of tools are going to be executed the very first one reactor php to keep my code modern as possible the second one is laval pint which is a nice name by the way the third one it's called it npm run lint which will execute eslink lint and preacher which are the equivalent of recctor and laval pint. So a single composer lint command will execute four tools. Let me show you this on the terminal real quick. Moving here to my terminal, I'm going to type composer lint. And now I have those four tools being executed all at the same time. Now this is important for various reasons but the main one is if a new team member is joining your beautiful project he doesn't need to know where things are on vendor or where things are on node modules you just run composer linked and you have the full spectrum of linting right there now moving uh to the other script I have uh the second script I always have it's called it test linked which is the equivalent of lint but executes everything under dash- test It's mainly for CI purposes. Same stuff as before, but instead of formatting, I'm going to check the formatter the the formatted code. Moving here to one of my favorite scripts uh with the name uh test uh type coverage. Probably the most underrated feature of past. And what it does is quite simple. It just checks if your entire code is fully typed. Let me show you this in practice. I'm going to copy this type coverage. Moving here to my terminal once again and I'm going to type composer test type coverage. It will tell me well all your project is fully type at all levels. But let's actually just remove a type to see this in practice. Uh moving to my app um update user. I'm going to remove I think I'm going to remove this return type right here. Execute exactly the same command. And now past php is telling me this code won't go to production because it's missing a type on the line 22. It literally tells you update user return type line 22 is missing a type. Now we can obviously just add it back. Rerun the same code and now it just works uh as expected. This is cool right? So this is type coverage. One of my favorite features about past also belongs on this concept of testing pipeline. Now moving here to other stuff. We talked about this already. Test types will execute PHP stand and TypeScript at the same time. And now all the way down I finally arrived to the famous unit testing. And I'm going to execute past PHP with a couple of flags that are very interesting that I want to show you. The first one is dash- parallel. We always all every single one of you have expensive laptop laptops. So let's just run our test suite in parallel to make it faster. I'm going to also use this d-ash coverage to have 100% of code coverage. You are going to see a lot of experts on the field telling you that code coverage is not important. I'm going to tell you the opposite. Is the most important thing on this area of AI is literally what forces AI to have tests for all of the generated code. Insanely important. Super important. Now all the way down I have the let's say the final command. This command is called it test and what it does is that it aggregates the full testing pipeline linting type coverage type types but also unit testing just aggregates all commands and allows me to do this. Go to the terminal and type composer test. This will execute the full testing pipeline. You don't even need to know what it is. Execute type coverage linking. The full thing will be executed from one single command. And my friends, this is very useful for three reasons. Number one, the teammate arriving to your team that needs to know how exactly can test his code. Number two, GitHub actions. We always we love GitHub actions when it's not down. Um, and GitHub actions allows you to execute script. And let's make it agnostic. So you can go to this test.yml file, which is GitHub actions. And all the way down I have composer test. I don't need to update this file all the time. I can just leverage this and run my CI like I'm running tests locally. And finally and one last thing I have here which is really cool is this.AI guidelines. So this is Laravel boost. I can tell Laravel boost super important so it doesn't forget at the very end always but always run composer tests ensuring this way that every generative code by AI will be passing all the quality tooling that we have if you are also a testing fan there is a video on my YouTube channel which is 30 minutes about this stuff youtube.com/nunaduru amazing content about testing dear Tokyo people we talked about strict engineering strict typing, strict defaults, strict patterns, and strong testing pipeline. I want to show you all of this stuff in action. Okay, so I'm going to do a live demo using cloth code. Our goal today is build a new feature together and see all of the stuff I've been pitching in talking about in practice. So under this save button, I'm going to add a new feature, a complex feature with databases, with front end. And the goal is have the give the possibility to the users to add notes, random notes about anything. So let's do that together. Moving to my terminal real quick right here. And I'm going to type uh claude, but I'm going to run claude with I think I'm going to run it with dangerous keep permissions. I love this flag. So I have Claude open. It doesn't seem to be down. And what I will do here is that I'm going to ask him build a new feature under profile settings right below profile information. uh allow the user to add random notes about anything. And I'm going to type enter and I want every single one of you to take a close look into this. I'm going to type enter. As we discussed, cloud code will get familiar with the with the with the codebase. As you can see here, we have cloud code listing all the files, getting familiar with the controllers, models, front end, understands you like Laravel, understands you like typing, understands you are using TypeScript. So that's the very first thing cloud code is doing understanding your project understanding your conventions. After this uh cloud will start working on generating files. Okay. And we are going to see how those files will actually be exactly like we want. So still reading the files still getting familiar with the codebase. Let's wait here a little bit. There we go. At some point you should start working on those files already. Here we go. We see creating a note model migration in the factory. And we also see create the note action request in controller. Okay, so it's literally working on on all that stuff. Here we go. What do we see? Okay, so it's working right now on the migrations I think. Okay, it's already working on tests. I think we can see the generated migration already. Let's move here into the generated migration to see if it was exactly like we like and it's not. Oh, it is. Here we go. So, we see declare stream types being used. This was done by cloud code. We see not PHP docs anywhere, which is good. We see full typed code exactly like we like which is very good. Uh we don't see any down method on this new migration. Let's take a look at the model for example. Here we go. The streak types being used all the way top. We also see property reads being generated on this new migration. It's literally oneshotting the feature with carbon immutable as well being used exactly like I have to uh like I like to have my code. If we move here into this node controller. Okay, it's still working on it. So let's wait a little bit. But yeah, it's literally oneshotting the feature like um typically like I like. Oh, take a look at this. It's already working on a node factory and it's working on a node factories exactly like I like with extends with final classes. No PHP docs necessary and it knows that I like tests. So, it's basically working on that. Moving it a little bit all the way down, we see working on uh relations, which is good. We see already a form request being created. So, he understands that I like form requests. So, it's working on that as well. This form request is hopefully super strict. Here we go with required strings minimum one maximum a thousand which is super important. It has a action pattern as well. So the create note is being created as well final read only and it's it's doing exactly like I want from actions which is super important. And here we have the note controller as well being coded. Uh we see a form request being used. We see an action being created uh exactly like we expect. Basically it's oneshotting the feature just because all of the conventions we love exist everywhere. At some point I expect him to migrate uh my database. Here we go. Migrating my database and it will start working at some point on the front end. It will uh hopefully understand that we like TypeScript and therefore we'll generate types. And here we go. It's working as we speak on the front end and I expect him to have types. Here we go. All of this stuff is literally types. Um exactly like I like to have my code on the front end fully typed which is very important with interfaces. It's it's literally oneshotting the feature which is super good. At some point we'll start working on tests. Okay, once it's done with the front end, we should be able already to see the feature um visually on the front end and it will start working on test fully typed front end exactly like we have all the other TypeScript code. Insanely important and it's already working on tests and because all my tests already have quality, this new test will have quality too. Uh while it's working on tests, I think we can see this feature on the front end already. So I'm going to click here on refresh. And here we have random field to add notes. I'm going to just say love you Japan and add the note. And the note was added just below. So just literally working as I expected. Okay. And the code which is most important uh was generated exactly like I would expect. Now very important at the very end we see quality tests using integration controllers in Laravel. And at the very end, I expect that once all these tests are created, we see a composer test being run ensuring that all the quality tooling in testing pipeline we talked about, it's literally right here. So let's wait a little bit so we can see that in practice already running linting. So at some point you should run composer test and ensure that we have all of the code behind the here we go. Composer test being used ensuring this way that all the quality exists on the generated code. I want to tell you something which you really need to memorize in 2026. I want every single one of you to be engineers top quality. Every single one of you will leave this conference being a top level engineering. And the key for that in 2026 is this thing right here. Aenti coding is not vibe coding. As such your responsibility in 2026 is be better than the others. Okay. Every single line generated by your prompts to AI will be generated by you. In that way, you will be a top level engineer in 2026. Japan, my name is Nuno. It was a pleasure to be here. Thank you so much. Thank you.

Get daily recaps from
nunomaduro

AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.