I shipped 122 PRs in 24 hours straight out of my software factory, and this is actual valuable work that agents start and ship even when I'm busy doing something else, like sleeping. And in this episode of Better with Kent, I'm going to show you exactly how I do that on a regular basis. So let's take a look at an example of what I mean. So here's a friction issue. The record table expand mode colSpan adds a phantom column when a responsive column is in place. So this is the table it's talking about. We've got this table component all over the place, and apparently there was a user experience issue that this agent ran into, and it costs about 20 minutes of visual debugging. Well, it opened up this issue, and then another agent came through and fixed it in this pull request. So it opened it under my account, but I was not involved in this at all. So let's dive a little deeper in how this friction process works. The problem is that we've changed the way that we developed software a lot recently. And the way that things used to go is you'd be working in the code base yourself, and you would run into some sort of issue like, oh, the server is taking so long to start up, or the tests take forever to run, or these are really flaky tests, or whatever. It's really hard to verify my fixes. And so you would go ahead and fix those problems. But agents, they can be proactive sometimes, but a lot of the time they're going to be like, oh, I found a reasonable workaround for this, so I'm just going to ignore it. But it compounds and it explodes in how much friction you actually end up feeling when you've got so many agents who are discovering this workaround, when in reality you really just want to have those things fixed. And so what you need is to turn your agents into complainers. And that's one of the things that my ship PR skill tells the agents to do. So this is just the standard process that we go by for agents to take the work that they've done, verify that everything is working well, and get it shipped into production. And we'll dive deeper into all the mechanics of how that works later. But one of the things that it does is it handles filing friction reports. And so it uses this package on Kody that has these different steps as it's going through the process of getting something from development into production. And one of those is to file friction. So after you've merged and gotten it deployed, then look at your experience in developing in this code base. And if you had any paper cuts or any problems, then use this other package on Kody to file some friction for that problem so that it can ultimately get fixed. And I'm telling you that this really greases the wheel of your software factory or your repository to make agents more effective and efficient in the code base, because they discover all kinds of things. And this is also how Lauren is able to ship so much in her repository. She's shipping 2,500 PRs in a month. And I asked her about that. I said, hey, how can you possibly do this? I feel like I'm the bottleneck in making product decisions in my application, and I cannot make 2,500 product decisions. And so talking with her about that, she said, well, most of my agents are working on polish and code quality to help my team move faster, bug fixes, performance, improving CI, refactoring, that sort of thing. So we're thoughtful about the features we add. So in practice, there's not that many, but we try to keep them high quality. That's exactly the way that I work and have been working as well in my own code base to turn my code base on autopilot so that my agents are proactively making polish and code quality improvements to make me faster and the other agents that work inside the code base faster. So of course, I'm going to be involved in the product decisions and the product direction and all of that. I'm still the bottleneck there. And I actually feel like it should continue to be that way. So that begs the question, if your agent is making and shipping choices on its own, how do you feel confident that the agent is making the right choices? And that comes down to three things. You need the agent to make good PRs in the first place. And then if something bad sneaks into the PR, you need to catch those mistakes before they go into prod. And then last, if it somehow slips into prod, you need to have really good safeguards in production to reduce the blast radius of some sort of problem. But before we get into that, let's check in with our sponsor. I just added an OpenAPI and a token bootstrap CLI flow across two repos, both my Kody and Kody CLI repos. And I want a security audit of that whole process. So I'm using a Devin cloud agent for this so I can keep working on other stuff without worrying about stepping on its toes. And because Devin's great at security audits and can handle multi repo work easily. Before I hit send on this, I want to talk about the part that I used to really hate. And that is the model chooser. A task like this is actually a bunch of tasks in one and some of those tasks require a expensive and deep model and others require just like some grunt work. And so you can use a much cheaper model. And so I don't want to have to choose just the really expensive model because I've got all this grunt work I need to do too. And vice versa, I don't want to choose a less expensive model and end up with less thorough work. And so I'm going to choose the fusion model. And what the fusion model does is it's Devin Cognition's fusion router. So it routes across different models while it works. So you get a strong lead for the ambiguity and review part and cheaper sidekicks for the grunt work. And I don't have to worry about model roulette. If you want a strong agent that stays in the software engineering lane for work like this, check out Devin at Devin.ai. So I've got this decisions directory that is just full of different architectural and product decisions that I've made over time. For example, there's this no vendor specific platform logic. So we want to be a generic platform that supports everything, not just something specific for a hub for meta and Strava and slack or whatever, but we don't want the foo hub. We just want a generic solution to problems. And now in the future, agents are going to make the right decision because I've already made this decision. And then we also have these primitives. So this primitives yaml inside of my architectural documentation just shows all of the different primitives inside of the code base. And if you don't know really what a primitive is, I made an entire video about that somewhere. Go ahead and click that. So we've got a bunch of different types of primitives. You've got your API UI or the app UI and you've got your platform and the MCP OAuth as a primitive. You've got the package apps and jobs and workflows and a backup control plane, also a primitive run records, user meter, all of this stuff, all of these things are primitives. And each one of these will link to the code where that primitive mostly lives as well as the documentation for that primitive. And so as the agent is working around these different primitives, it can find exactly the pieces that it needs to put together with the thing that it's trying to build. And so it builds the right thing the first time, rather than making up a primitive for whatever it's trying to accomplish. And then I also have for its own verification, this control Kody CLI, which I got from Lauren Tan as fantastic idea, but it's simply a CLI that it can run to do a variety of things to verify its own work. The same sort of thing that we have done as engineers over the years is we make a change and we go to the browser and click around or whatever. And agents are good enough that they can do that now. That's not really a thing you need to manually create for your agent. Most agents can do it, but there are some things that you can do to really speed things up. And the vast majority of this CLI has actually been created by friction logs. So an agent will work through things that will find a workaround or whatever to manually verify its work. And then when it's all done and it's deployed, it's like, and that was kind of hard. And I think that it would make sense if we had another command and control Kody to make it easier for me to verify my work. And so that is where control Kody came from. So feel free to take a look at what control Kody does. And you can build out your own version of this exact same thing so that your agents can verify their own work better. And then on top of that, when an agent finally opens the pull request, it needs to create this system recap. And so I've got this system recap skill that tells the agent what it's supposed to do when it opens a pull request. And one of those things is to have this section for system changes. And what this ends up looking like is useful for me because I can see what primitives were touched and all of that. And what does it think it's, as far as the risk is concerned, it looks like this is medium risk, but then it also shows a control flow or a change flow. So I can see here's what the new flow looks like, what the user experience is like, or how things move between different modules, all of that is really useful for me. But beyond that, I often don't even look at this. Where this becomes valuable is it forces the agent to really think about what primitives it put together and make sure that those primitives all piece together in a sensible way. And this also is useful for the review agents, which leads us into how do you catch mistakes if the agent does end up making a PR with some mistakes. And the real key here is this ship PR skill, which is just a thin proxy for the ship PR package that I've got in Kody. So I've turned all of the things that I want the agent to do into deterministic code, and the agent can simply just run this and it will get exactly like progressively disclosed the information that it needs to follow through the steps. And so with the ship PR skill, you end up with a number of things it's supposed to do. It's supposed to check CI and all of that stuff, but it also is supposed to iterate on the AI reviewers. And so I've got CodeRabbit in here. I also have Bugbot in here. I have a preview that gets deployed and the control Kody CLI can also interact with the deployed preview. So if it needs to run in production and verify its changes there, it can do that. We've got of course, Bugbot in here, Devin AI review is in here as well. So yes, I use all three of them. After review, I think if I could only have one, then I would keep the Cursor Bugbot one because it seems to have caught more problems. But Devin is really good at catching security problems and CodeRabbit is actually like the things that it does catch are also really valuable. So I'm glad that I've got all three, but if you can only choose one, I probably just stick with Cursor Bugbot. But yeah, all of these are, they're iterating together and fixing all of these issues. That's the entire experience until all of the AI reviewers and CI and everything is green. And the agent itself has tested things in the preview deploy and all of that looks good. And if that's the case, then it will trigger a merge and that goes through the ship PR thing. So sometimes that ends up coming through under my own account, which I don't care. That's fine. It can use my own account. And ultimately that gets shipped to production, but that's not the end for the agents because they're in intended to not only merge, but also keep an eye on the deploy. And then they're supposed to log friction issues. And so they look at their history of their conversation, their experience working in the code base, and they just let us know what problems they ran into. And then when it's all done, it sends a report to Discord. So I can pull that up at any time on my phone or on my computer and take a look at what the agents have been working on. It tells me the cost, the diff, the model that was used, the difficulty, how hard it was to do what it did, and also gives me a link to the PR and the agent so I can go and send follow up questions if I need to or anything. And it's just cool to take a look at all of the things that the agents have been doing. Some of these were not ideas that I came up with. And some of them were just friction points that only affect the development of the software. But some of them have an impact on production. And that is our third and final thing here. How do you make sure that what they ship, if they manage to make a mistake review and all of that process and the testing and everything, and they somehow land in production, how do we reduce the impact or the blast radius of that? And that comes to feature flags and disaster recovery. So for big experiments or things that I'm not sure I want to commit to or whatever, we're going to stick that behind a feature flag. And an agent can decide to create a feature flag itself. They can say, you know what, I feel pretty good about this, but I think that maybe we should put this behind a feature flag and we can attach success metrics to this as well so that we can know whether this is actually moving the needle for the people who are opted into this experiment. And that has been super valuable for me. So I can go ahead and say, yeah, this is a new thing we're trying to do. And if you want to opt into experiments, just know that some things might change or break or whatever. And so it just drastically reduces the blast radius. And then when I feel good about it, when the metrics say that things are better for the users who have it on, then we can go ahead and push it forward and merge it and get rid of the feature flag ultimately, which actually leads us to a cleanup thing that we're going to talk about here in a little bit. Like, how do you make sure that the code base just doesn't explode and complexity inside? So we'll get to that. But the other thing is, what if it's not kind of feature flag or maybe even if it is and you have some sort of disaster or data loss. And so you absolutely have to have a disaster recovery story for your application, it just becomes so much more important, the bigger your application gets, and the more people who are working on it. And now we've got agents working on all of this stuff. And so I've got a disaster recovery backup control plane, you need to have regular tests to make sure that you can restore lost data. So that if somehow an agent gets through all of the safeguards you put in place, you have a place where you can come and get some data back. And maybe you lose a little bit of data between the time that the bad thing happened and when you restored the backup, but at least you don't lose it all. And I have not yet had to actually use this, so things seem to be working pretty well so far. But agents love to create code and they don't love to delete code. And so you have to be a little bit intentional about making sure that they go through and clean things up. And so with every product decision that I'm making with the agents or with any friction logs that they put together, they're also instructed to think about cleanup. What could we do that we can't do right now, but we re need to do in the future to clean this stuff up? And so I removed a feature a while ago for ad hoc jobs, you should be using workflows now. And so we do have some jobs that people have running. I want to make sure that we don't lose track of that. And we're actually really close to deleting this. And I have an agent that goes through all of the cleanup issues and make sure that we're not at the stage where we could actually clean it up. They do run an evaluation and look at the current numbers and production, all of that stuff, to see whether we're at a place where we could actually do this cleanup. And so yeah, absolutely, you want to have some cleanup. Dogfooding is another really valuable thing that you have your agents do. Get your agents to use your software somehow, because in the process of using the software, they're going to find friction and they'll log that as friction as well. And so here is a friction thing that an agent experienced when it was using Kody. And so it opens it up as a friction log. And what's really interesting about this is that when the agent came through to come and like fix all the friction problems, this one, it decided to skip because it couldn't know for sure whether I wanted it to go one direction or another, because this is a product decision. So again, I'm not just letting the agent make all the decisions for my product. I'm letting the decisions for like how things are constructed and put together implementation details, but the product vision still belongs to me. And so it saw this as a product decision. We needed to make one decision or another here. It gave a recommended fix. And then I had a conversation. I did not actually go with the recommended fix here. And I came up with something novel myself. And I just sent that to a Grok Bot on my phone and it went through and shipped it this morning. And that was pretty cool. You just need to find a whole bunch of ways that input like useful signal can come into your system. And then your agents can work on that and then flag things that you need to look at, but try to get yourself out of the picture. So here's another one, Sentry. Anytime there's an issue that happens on Sentry, I've got a webhook that sends that over to one of my Grok Bots. And the Grok Bot uses Seer from Sentry to get the root cause analysis and then evaluates it and ships a fix. And Kody triage issue. So inside of Kody, you're actually running code. There could be errors in that code. And so when there's an error, Kody will emit an event. And then I take that event and send it over to a Grok Bot and it looks at it and fixes it if necessary. And then platform feedback. So you can actually tell when you're using your agent, if you've got Kody connected, you can say, could you leave feedback to Kody to fix this, whatever thing, or whatever for your product. However you get feedback from users, you can feed that into the system. And if it's like an obvious fix that doesn't require a product decision, then like, Oh yeah, that link is broken. Great. Thank you. And you close the loop with the user. There's, there's actually a great product for this called Modem. I'm not sponsored by them. They are fabulous though. And they will help you with this exact problem. Finding ways to get actual live issues into your software factory to go through and end up with a positive implementation is really your goal here. And it can even be like cron jobs and that sort of thing. So I've got a cron job every night. I have an agent that goes through my docs and make sure that they're all up to date and not missing links or whatever. I've got another one that takes care of tests that are no longer valuable or deletes things and tightens them to follow the principles of the code base. And then a weekly agent goes through and just does a like reaping of all of the legacy stuff that's sitting in the code base. And if it can't determine whether or not this code is actually used, then it will instrument it. And then the next week we'll see if anybody's actually using that code and then we can rip it out. So really what you need to do is create a system in which agents make good PRs in the first place. You catch mistakes if those mistakes make it into PRs and then you reduce the blast radius if mistakes end up in production. And once you have that set up, then you can set up a bunch of pipelines from a bunch of different sources to turn your code base on autopilot. This has been Better with Kent where you and I get better together. Please like, comment, and subscribe. And thank you so much for getting better with me.