And the main mental model that I always teach when building systems for AI coding, and this is where we'll start to get into what it looks like to evolve our system, is the PIV loop. So PIV is short for plan, implement, and validate. And as an engineer this kind of process you should be pretty familiar with even outside of using coding agents. But there's just some specifics we have to think about when we're working with a coding agent and how we give it the context that it needs, i.e. context engineering. And no matter the strategy that you make up yourself, or you find online, like maybe you've heard of the GitHub spec kit, or the BeMad method, or PRP, there's all these different strategies floating around. It all just boils down to this. You have to plan the implementation with your coding assistant, make sure you're actually on the same page for what you're building, then you give it the implementation, you delegate, hopefully, most of the coding to the assistant. And that's what I do nowadays. And then at the end you have the validation, where both you and the check the work, run the tests, manually validate things. And the important thing with the PIV loop is that it is not vibe coding. It's that kind of cringey phrase that you've probably heard thrown around time and time again, where you're just going with the flow and giving the entire implementation up to the coding assistant and accepting whatever comes out. And the reason the PIV loop is not vibe coding is because the implementation is the only thing that we're handing the reins over to the coding assistant. We're sandwiching it in between the planning and the validation, where we are heavily a part of the process. And I cannot stress enough how important it is to be a part of the process and not get lazy there, because otherwise it's not going to be reliable.
So digging into this a little bit more for our planning phase, we start with what I like to call vibe planning. This is the one place that I give you permission to just go with the flow. Because at first, it's just an exploratory conversation with the coding assistant. There's a new feature that you have in mind, you want to implement it. And your job here is just to get on the same page with the coding assistant for things like your architecture, if it's an existing code base, like what part of the code base do I have to touch to build this, that kind of thing. And then your conversation transitions from unstructured to very structured. So you have these key sections that you have in some kind of like PRD or document that you output at the end of planning, or it outlines the external documentation that you want to reference the parts of the code you have to touch, the task list for implementing that feature, your success criteria. If you're a product manager, you're going to be able to create this kind of structure plan very well, because that's basically what you're doing here, is you're a project manager for the coding assistant.
Going along the same lines there, we take that structure plan, and we give it now to delegate the coding to the coding assistant in the implementation phase. And so your process here, which by the way, this is all using commands to outline how we do these things, the process for implementation is the coding assistant will first read through the structure plan, grab the tasks out of that, and then knock them out one by one. So it starts by doing a bit of research for that task, implementing the code, doing some quick validation before then moving on to the next task. And it just does that systematically until it knocks out your entire plan. And by the way, when I say task list here, I'm not saying that you give it like an entire epic ngira, and it just knocks out like every single task, like no, your structure plan is for a single task in something like ngira. So you want to keep it really granular, but these are just like all the individual sub steps, like one task might be more something like, write this file or set up this configuration versus implementing an entire feature, right? So we're at the feature level here. And then once we are done with the implementation, we've done a little bit of validation at each step of the way, but we still want to do the larger validation process at the end.
Comments