Section Insights
Introduction to Development Process
What does the development process look like?
The speaker introduces their development process, focusing on two key skills: grilling with doc skill and retro skill. They emphasize the importance of domain modeling and how understanding the application's language is crucial for building features.
- The development process involves understanding the application's language through domain modeling.
- Grilling with doc skill is an art form that aids in feature development.
- The retro skill helps in reviewing past sessions and suggesting improvements.
Managing Grilling Sessions
How do you know when to stop a grilling session?
The speaker explains that the user should take charge of the grilling session and can decide when to stop. They emphasize that the conversation should be driven by the user, not the agent.
- Users should feel empowered to end grilling sessions when they feel enough information has been gathered.
- The grilling process is a collaborative conversation rather than a one-sided interrogation.
- Effective communication with the agent can lead to better outcomes.
Understanding Components in the Glossary
What are the challenges with using the term 'component' in the glossary?
The speaker discusses the confusion caused by the term 'component' in the glossary, as it overlaps with the concept of components in React. They suggest renaming it to 'diagram component' for clarity.
- Terminology consistency is crucial to avoid confusion in development.
- Renaming glossary terms can enhance understanding and usability.
- Clear definitions help in better application design.
Optimizing Agent Performance
Why is it important to manage token relationships in agent interactions?
The speaker explains that managing token relationships is about optimizing the agent's performance rather than just avoiding hallucinations. Fewer tokens lead to better quality outputs and reduced costs.
- Optimizing token usage improves the quality of the agent's work.
- High token counts can lead to inefficiencies and increased costs.
- Understanding the balance between token management and output quality is essential.
Reviewing Pull Requests
What should be considered during code reviews?
The speaker highlights the importance of providing feedback during code reviews, focusing on eliminating 'magic strings' and ensuring type safety. They emphasize that not all comments are blocking, but some PRs are critical.
- Code reviews should focus on improving code quality and eliminating potential issues.
- Not all feedback needs to be blocking; prioritize critical changes.
- Creating a clean and maintainable codebase is a collaborative effort.
Transcript
0:00 You've been asking again and again and again for me to show you what my development process looks like. I've done a tiny little bit of it on this channel, but not nearly enough. And since I did it, I've come into possession of one of the most starred repos in the world, which is my skills repo, and certainly the most starred skills repo in the world. And so, I do think I owe it to you to show off how I use these skills in something more than a tutorial, in a real walkthrough. And in this walkthrough, we're going to focus especially hard on two skills. The first one is going to be the grill with doc skill. And I think grilling is really much more of an art form than most people assume. In this walkthrough, I really focus a lot more on the domain modeling aspects of it. In other words, the kind of classic DDD skills that allow you to basically say, "Okay, I've figured out the language of my application." And so once I've figured out the language, then I've actually figured out the app and figured out what I want to build. In this video, you see me go through that process on a real feature that I will use from now on, even to build the thumbnail for this video. And the next skill I go deep on is the retro skill, which is we look back on the huge chunk of sessions. I think we do like 30 sessions in this video, and we suggest a bunch of improvements. I'm going to walk through a real huge I think 25,000 line PR. I'm going to do some real human review on it and show you how that human review can then go back and influence and impact the system going forward. Now, if you're interested in this stuff, then the AI coding crash course that I have is absolutely the place that you need to be if you want a more structured approach.
1:30 But with that, let's get cracking. Let's dive in. So, this is where all of my courses get created. All of my videos get created. It's a video editor, a thumbnail editor, a AI writer. It helps me schedule things. It's creates shorts. It does all sorts of stuff. And the bit that I'm particularly interested in right now is this little thumbnail creator down here. This is where I can post the video that I'm creating and editing right now and I can create a new thumbnail. And this is essentially a process where I capture my face and then my face goes into the thumbnail and I can create a diagram with it. For instance, I just stopped recording so that I could take this still. This allows me to move this left and right.
2:08 And then in here in my diagram creator, I can essentially screenshot this part of the window here. And what that will do is I can then copy and paste it into the thumbnail. So if I press Ctrl +V here, you can see it gets pasted in and then the cutout automatically gets cut out by this nice API. I can position these and I have my thumbnail. Now this is pretty nice, but what I would really like to do is remove a bit of friction here. It's annoying having to swap over to the diagram view and like have my you know it's it's like a annoyingly manual process, especially if I get things wrong. I can't quite position them correctly. I have to go back. I have to screenshot it again and try it again. I essentially I don't have enough flexibility here. What I really want is to be able to draw on this surface here.
2:52 In other words, have the diagram kind of integrated with the picture of me there. I really don't have a clue on how I'm going to build this. I just know that it's something I want. And so I thought it would make a good candidate for like a new feature or an improvement and to sort of show you the whole process end to end. And so when I enter into a new piece of work, I start thinking through this decision tree, which is essentially what skill from my skills am I going to use? In other words, you have essentially a new session here. You want to create a new piece of work. You don't know what to choose. You first think through, okay, what is the thing I'm trying to create? And the thing I'm trying to create is essentially a diff.
3:28 The diff between the old codebase and the new codebase. And if that diff is really small, then you can probably just oneshot the thing. So you don't need to worry about grilling before you continue. But in this case, I know that the thing we're creating is pretty big. And so I'm going to go with grill with docks. From there, if it ends up being a lot larger than I thought, that can always bail out into Wavefinder, which is what I use for turning initial grilling sessions, running them over multiple sessions, developing this huge great big concept of what we're trying to build, and then going until we get there. But I prefer starting with grill with docs because if it ends up being smaller than I thought, then it means I don't have all the overhead of running a wayfinder session. The place I'm going to run this is inside my personal wiki, which is a home repo. If you don't know what a home repo is, then check out my accompanying video on that.
4:19 The agent I'm going to use is Claude Code because that's the one I have a subscription to. That's what I'm set up for and that's kind of what I like. I am on the Claude Ultra plan. I have Opus 5.5 and I'm running it on medium effort. And of course, I have all of my skills installed and I also have a bunch of custom skills that are inside my home repo. My home repo is not open source, but most of the skills you're going to see are open source and there are aihero.dev/skills.
4:43 So, we're going to start with grill with docs here and then I'm going to explain my problem through dictation and I'm using whisper flow for that. In the course video manager, we have a thumbnail viewer. And the thumbnail creator is okay. I like that it asks me and it sort of forces me to put my face onto the screen. But what I don't like is the sort of rigmarole I have to go through for attaching a diagram. Most of my diagrams are built in TL Draw and using the custom diagram playground that we have, but I don't have what I would really like is for the diagram to be able to be editable in the scene that I'm viewing. So, in the context of the thumbnail, in other words, I want my face visible and then to have the thing just editable next to me. I really don't know UIwise how we're going to handle that and what that's going to look like.
5:33 So, I think there are a lot of questions to answer there. I want you to notice a couple of things about how I'm prompting there. The first thing is I'm thinking a lot about the why. I'm thinking a lot about the problem that I'm trying to get the agent to solve. I'm not necessarily giving it a, you know, decent sort of like idea of what exactly to do. If I give it the why, then the agent feels a lot more empowered to go away and actually produce a solution itself or maybe have a discussion about the solution. Whereas if you come to it with a what saying I want to do X Y Z then it will often not necessarily come up with that creative an answer. And so we can see here it's come back with a bunch of grilling questions here. It's asking first what is the rigma roll? What is the part of attaching a diagram that hurts most? I would say that A leaving the thumbnail creator is annoying and B is also annoying and C is also annoying.
6:28 So I think you've put your finger on all three there to be honest. Is the thumbnails diagram the same as the videos diagram? When you edit the diagram inside the thumbnail, should the changes go back to the diagram the video uses? This is kind of a question about where do we want this diagram stored? You know, like should it be inspired from existing diagrams? Because in the application, you can see if I do a search here, then I can actually search for existing diagrams. So I found like this wavefinder diagram by just sort of like oh I've got a search, haven't I? So go to diagram wayfinder and then search all the diagrams that I've used. So this one for instance is good. This one's another one. So it's kind of asking how do we like associate these thumbnail diagrams with this list. And I'm not quite sure that with Q2. I'm not sure.
7:13 I'm kind of not sure of the tradeoffs there really. I suppose the question is do I want the diagram to be sort of searchable inside the main list? Do I want it associated? I'm not quite sure what the use case is there. Q3. Starting from scratch. Should you be able to draw a new diagram straight in the thumbnail without any existing diagram? Q3, yes, I agree. That sounds good. With Q3 too, I kind of maybe want to be able to search existing diagrams. I like the be like ability to add components that we've already got. Maybe searching for stuff that we've already got or maybe I could just copy stuff in from one TL drawboard to another. I want you to notice at this point how loose the language is that we're using to describe the feature. It doesn't feel like we are particularly sort of we haven't figured out the right names for things yet. And so I'm having to use a lot of weird verbosity and shortcuts. It's not quite clear in my head still. As we go through this grilling process, the idea of what we're building is going to become clearer and clearer in my head until we end up with a nice set of words for the things we're building. And once we're there, we've kind of built the feature. So Q4 says, should there be one editing mode or two in the thumbnail? Should there be a single edit the diagram mode and a separate arrange mode? For Q4, I think the process should probably be that we take a photo of my face first. Then that face gets arranged onto the canvas and then we once my face is there, then we can sort of build the diagram around my face and I should have the option of retaking it. For Q5 is the face fixed.
8:43 For Q5, I think I should have the option of moving the face horizontally. And from there, that would just give me a bit more flexibility. Q6, is this only about diagrams? Yeah, Q6, let's make it diagram only for now. I can't think of a use case where I want to attach other stuff inside the thumbnail. We don't want to build a second Figma. We just want to make this particular flow easier. Okay. So while we were answering those questions, the agent was going off spinning up a background agent and going to find the supporting information that we needed here. So it's actually going ahead and changing two of the questions here. And then Q7 says, should edit the diagram in place mean a live TLR editor clipped to the thumbnail frame with the camera locked so the area you see is the thumbnail? For Q7, I'm concerned that cramping us into that smaller space will mean that editing the thing or the thumbnail actually becomes kind of painful. And so I think we might need to prototype a few different approaches there. So that's a very detailed first response. Let's fire it off. Now you might be looking at this approach and you might be thinking, okay, what like what benefits this have over approaches that I'm taking over like plan mode.
9:50 Let's say what this skill does and what this approach does is we align on the thing that we're building before we go ahead and build it. This means that we're going to get a much more predictable output. I'm going to have much stronger understanding over the thing that we're building. And like while it's building, I'm going to let it just sort of run by itself. But this is the moment early on when I get to maybe with my teammates align on what we're building, figure out what it actually is, what the words we're going to use about it, and then everything from that point all the way down to human review at the end is kind of going to be fairly on rails. So Q2, it's reframing it. It's saying, is the thumbnails diagram a real diagram? And at this point, we should probably talk about what it actually means by a real diagram. This is inside the course video manager repo. And this is a glossery.mmd that is my pride and joy. When I talk about language inside a project, what I'm really talking about is the words that you're using to describe certain things. And in this pretty massive file here, which is about 560 lines, we define all of the main concepts that sit inside this course or sorry that sit inside this repository that are responsible for this project.
11:01 And the stuff that we're really talking about here is a diagram. And so there's a whole section on diagrams. So a diagram is really a group of diagram snapshots, which is a copy of the diagram's drawing at the moment that a clip is filmed. In other words, in my video editor, it's linked up to the diagram. And so I can see what diagram I was using at each point in the video. There is the active diagram. So the diagram that the author is drawing on.
11:26 Now we have an action called restore to head. when we load an older diagram snapshot back as the active diagram. There are preserved snapshots as well which are diagram snapshots kept in its diagrams timeline even when no clip uses it. You can start to see that these definitions form a really nice picture of the feature. And what we're kind of doing here is we are trying to add to this trying to figure out where our new feature lives in this existing landscape. So, by asking what a is a thumbnails diagram a real diagram, we're kind of asking, okay, it's a diagram, but maybe it's private to the thumbnail.
12:02 For Q2, I think it makes sense to have our existing setup here. But what I'm concerned about is that the thing we're putting into the thumbnail is not really a diagram. It's just a single snapshot. In our model, a diagram is really a grouping of different snapshots of that diagram as they change through a clip. whereas this is more like a diagram snapshot. So now that probably sounds like garbage or jargon to you if you don't understand the language of the project, but I've been able to communicate something pretty rich that the model understands because the glossery.mmd is in its context. Q8 sounds good. All three of those sound really valuable. Q9, yes, the when we move the face, the diagram should just stay put. Q10, yes, when we retake, then we do the background removal and we replace the photo. Okay, it's now asking whether it should prototype a few different editing surfaces, and I love this. That's exactly what I want it to do. The tricky thing about Q1 here is that it's really about a question about feel. How does it look? How does it feel to use? And I won't really know the trade-offs until I see the differences all laid out in front of me. In other words, until I have a go at it. And so, I have a prototype skill that gives you multiple options that you can use to make these kinds of decisions. And that's what the agent is trying to do here. Which ones should it prototype?
13:21 Q11. Yes, that sounds great to me. The benefit of having multiple prototypes to look at is especially if it builds something that you don't like, that often tells you more than what you might get from something you do like. So actually exploring lots of different options can give the agent a really rich view over what you actually want to build. And there we go. we now have the glossery. The CVM glossery has no entry for the thumbnail and it's proposing two. So it's proposing a thumbnail, the image shown for a video on YouTube or a cutout or rather and a cutout, the author's face with the background removed placed over the diagram. And then it's also saying there should be a third term thumbnail diagram for Q12. Yes, that sounds great. All right, let's send this off. And now again, we should be getting closer and closer as we go. Lots of folks ask me like, you know, why what happens if you have a grilling session that runs for like 500 questions or something? How do you know when to stop grilling? And you should like I should be driving this conversation. You know what I mean? Like you should be the one in charge of it.
14:29 The agent is not grilling you. You are in a conversation with it. And so you should feel free to just go, "Nope, we've talked enough. Let's go and actually create some code now." Okay, we can see it's updated the section on thumbnails inside the glossery. That's really good. And now it's doing something cool, which is it's pinging off a sub agent to go and prototype thumbnail diagrams. So, that's great. We're able to continue grilling while it goes off and does some work in the background. Okay. And now we're doing some hardcore language stuff. The thumbnails drawing is neither a diagram nor a diagram snapshot. You're right that it isn't a diagram, and a diagram snapshot doesn't fit either. The glossery defines a snapshot as a copy at the moment a clip was filmed. So it's now proposing a new term, a thumbnail drawing. The di drawing that belongs to one thumbnail you edit in place and we can start from a diagram diagram snapshot or another thumbnail's drawing.
15:16 It's actually saying to avoid thumbnail diagram here. Now I know this glossery pretty well, right? And the better I know the glossery, the more able I'm able to make smart contributions to the application, the better I know understand the application. And so I know there's this thing called a preserve snapshot, which is the diagram snapshot kept in its diagram's timeline even when no clip uses it. So I can say to the agent, doesn't it make sense to have a thumbnail represent a preserved snapshot? We don't always define snapshots as the moment that a clip was filmed. I'm going to show you a technique that I sometimes use when I feel like I'm at the crux of something or when I just want to talk about one thing for a minute, which is I'm just going to say, "For now, let's just focus on this question. Ask me one question at a time until I say otherwise." This is another way that you can direct the grilling. If you're kind of getting a bit scatterbrained, if you just want to focus in on the thing that you actually care about and don't care about all the small stuff, then you can just say, "No, just go one question at a time for now."
16:15 One other thing it's doing here is it's reading an architectural decision record that we made on snapshots and preservation. This is another thing we do during grilling. We can take a look at ADR3 just up in here diagrams as first class entities with per clip snapshots. So this is where we actually made the decision about the glossery. So the glossery kind of describes the application as it is now as does the code. But the ADRs are here to explain why we made those decisions. In other words, we are interacting with a part of the application that's relatively old, relatively mature. And if we didn't write this stuff down, then we would be guessing. This is a classic Chesterton's fence issue, right? There exists in such a case a certain institution or law, let us say for the sake of simplicity, a fence or gate erected across a road. The more modern type of reformer goes gayely up to it and says, "I don't see the use of this. Let us clear it away." to which the more intelligent type of reformer will do well to answer, "If you don't see the use of it, I certainly won't let you clear it away. Go away and think.
17:15 Then when you come back and tell me that you do see the use of it, I may allow you to destroy it." In other words, do not remove a fence until you know why it was put up in the first place. So the ADRs, the architectural decision records, help us keep track of why these fences have been put up. So it's come back and of course it's saying, "Yes, you're absolutely right. I was wrong to rule it out." And so it's saying which diagram does a thumbnail's snapshot belong to. Yeah, the thumbnail pins a snapshot of some diagram's head. The question is which head you're editing in the thumbnail creator. This is a really tricky one because we're basically deciding how the thing is going to work.
17:50 Now we basically in this mode we might have to choose a diagram so that we can create a snapshot inside it or we choose an existing snapshot that we then edit. It all feels a little bit clunky and weird. And what it's kind of suggesting is that we might need a diagram of its own for each thumbnail. It keeps the teaching diagrams head safe while you simplify for the thumbnail and you still get to touch start from the teaching version. I really don't know here. I really don't know. I'm just going to sort of spill out what I'm thinking about. I think so what I'm thinking about in my head is the decision between whether we kind of tie into the existing diagram diagram snapshot stuff which is mature there's a lot of code in there or whether we sort of extend that work and instead apply it to a different data model call it a different thing and it's essentially whether to mix the streams or not mix the streams I think probably what I'm most inclined to do here is not mixing the streams but what I'm scared about is later down the line. We might wish that we had so that these models could be linked somehow, but I can't see the concrete use case for why we would want to still hang on to the existing model. You can see that I'm struggling here, right? Like I this is a hard thing to think about. And if I had colleagues, this would be the moment when I would reach out to them and go, "Help me. I'm not quite sure what we do here. This feels like quite a large consequential decision for this feature." So, it's saying, "I would go with your instinct and keep them separate. The fear of wanting them linked later is mostly covered by two facts. So both sides s store the same scene format. In other words, the way they store it in the database is the same. Copying between them is trivial in either direction. So star from a diagram or snapshot works without the models being joined. The link you're likely to want is where a drawing came from, not one model. Which thumbnails were made from which diagram is answered by one nullable started from snapshot reference recorded when you copy. So the reason we're so obsessed with language at this point is because the language is going to form the data model that everything else fits on top of. Once we understand the language, once we understand the names for these things, we then have names for database tables. We understand how they reference other parts of the system. And so we can create tables from that, create modules and set it up. Okay, so I think I've decided okay that suggestion sounds good. I like that we have a lot of flexibility not to quite decide the data model now and I like your suggestion of tracking the snapshot that it came from in case that becomes relevant later down the line and we properly want to link it. I suppose I don't necessarily matter how we model this as long as the way we're modeling it is not lossy and we preserve all of the links. Let's just see what it says to that. I'm not necessarily giving it a great answer, but maybe that's enough for it to go on. At its best, grilling really does feel like rubber ducking with someone with a really respected colleague, someone that understands the codebase really well. And you're kind of just able to talk out your thoughts or type out your thoughts. And by talking them through, you get to a more concrete solution even before you've written any code. Okay, it's gone a bit nuts here, which is it's actually gone ahead and written an entry for thumbnail drawing, which I don't like. I don't like having the concept of drawing here. Let's take a step back. I really don't like the wording of thumbnail drawing. I I hate the fact that we've got a drawing and a diagram. Those feel like they conflict really hard. I think thumbnail diagram is just fine. Can you also run me through the decision to create an ADR here? Why did you decide to go for a new ADR? So, it sort of eagerly created an ADR without asking me, which is not how I usually like to do it. I like to have that decision be something I do during the grilling session. Okay. He says, he says, the agent says, "I've renamed it to thumbnail diagram everywhere, the glossery, the ADR, and the ADR's file name." Yeah, it's kind of coming back at me a little bit on here, saying one small catch to be aware of.
21:40 An active diagram is a diagram, but a thumbnail diagram is not. So maybe the word diagram isn't right here. So now it's saying, why did it suggest an ADR? Why did it feel the need to write down this non-obvious decision? So it's saying it is non-obvious, right? It is surprising without context. There is a real tradeoff here and so that's another criteria and it is strong and it's hard to reverse or rather it's saying it's not hard to reverse. We could potentially walk this back. So now it's spelled it out. I do agree with its reasoning as to why it suggested an ADR.
22:12 And by the way, I'm investing it time into this so that future runs understand the context for every decision so that I continue getting better grilling sessions as I continue working on this project. without this or being lazy here would mean that my next run ends up being a lot worse because I don't have as good context as I need. Okay, I agree with your decision on the ADR, but and I also agree that thumbnail diagram is a little bit awkward. Can you give me some options here and let's do some scenario testing to see how they match up against diagram versus diagram snapshot? I'm sort of leaning towards thumbnail diagram snapshot, even though that's a little bit long, but might work.
22:50 Scenario testing is a really great way of kind of testing your domain language, testing the language that you're trying to use. What it does is it gives you a table of different options, different sentences you could use to describe the system and then it checks out how easy it would be to describe in different forms of language. So here we can see we have a candidate a thumbnail diagram snapshot versus a thumbnail diagram versus a thumbnail scene. So, in the first scenario, it says, "I started the thumbnail from the agent loop snapshot used in clip 14, then I simplified it."
23:21 All three there are probably fine. You open the agent loop in the playground. Is the thumbnail in its timeline? Yeah, that's an interesting one because if it's saying it's a snapshot, then you would kind of expect it to be in there or, you know, expect it to be in there somewhere. If it's a thumbnail diagram, then you might try to look at it on the top level. And so yeah, by calling it a diagram or a diagram snapshot, it sort of makes it feel like it's linked in with the other stuff. It says here, I dragged an arrow in the diagram snapshot, but that's not good because snapshots can't change. You tell an agent to tweak the thumbnails diagram snapshot doesn't really work, but I'm starting to see why it thinks about thumbnail scene and why it thinks it's good. We can see in all of the tables here that thumbnail scene is basically fine. Apart from Matt says it allowed while working. In other words, does it match my actual mental model? For thumbnail diagram snapshot, it's bit too long, a bit too wordy. Thumbnail diagram seems fine because it is what I naturally say. And thumbnail scene is not a word that I would use. It's more sort of coding vocabulary. In other words, scene is not something that we sort of have throughout the application.
24:33 Nor maybe it is actually maybe we have like a scene layer possibly. I'm just going to search in the glossery for scene here. And yeah, we do have a concept of a scene and diagram. We've also got Okay. that's not good either because we've got a scene in there too. So let's read its kind of final part here. Yeah, even though C has all the ticks, it actually does weight number seven really high. And it says C is the clearest technically, but it's not how you talk. And it puts a code word in the domain language. B has one weakness. It reads as a kind of diagram. And so, yeah, I do think it's right that thumbnail diagram makes sense as long as we have an ADR to say it's a diagram, but not a diagram. And I can see why it went for thumbnail drawing as well. But I just don't like that word. It doesn't feel like it rolls off the tongue. Okay, thumbnail diagram is the right thing. I agree that thumbnail scene is poor, especially because we do actually have a concept of a scene elsewhere in the glossery. I also agree that having the ADR there means that yeah, we have a concept of a diagram, but we've also got a thumbnail diagram. And I think that's okay to have that distinction. Can you now widen things out? I feel like we've understood the crux of what we're building. Let's now have multiple questions at once. I think this kind of ceremony feels really off to a lot of people. A lot of people go, why are you spending so much time thinking about language and sort of like you know about the words that you're using? Why is that so important to you? And I think the reason it's so important is what you've just seen here, what we've just done. We have from almost nothing. Now, we have a fully realized concept of the thing that we're building and the data model that's going to go into it. We now know that we have a thumbnail and a thumbnail diagram. That thumbnail diagram is not technically a diagram.
26:18 It's more like a scene, but we can't use the word scene because we've got that elsewhere. And then this is going to then go into the rest of this grilling session. Q2C says starting from a diagram's head. When you start from a diagram's head, should the CVM save that head as an unpreserved diagram snapshot? Q2C, that is absolutely correct. What the start from searches and in what order? I think it's got this idea that I want a UI where we like start from an existing diagram, but I think I always want an empty diagram to start and then be able to search my existing diagrams from there. I think what I want from the Q14 is I don't necessarily want to go from a start from list of potential different diagrams. I want to start with an empty canvas and then maybe search for existing diagrams and plunk them on.
27:03 Q15 says, should we have one thumbnail diagram per thumbnail? Absolutely. Q15 is correct. Q16, no user images in the thumbnail diagram. Absolutely agree with Q16. Q17 it's asking about a separate concept called a pitch with a a pitch has a YouTube thumbnail description with arot text field 17 let's not worry about pitches they're kind of soft deprecated I don't use them very much and so let's not worry about integrating with them Q18 yes let's keep existing thumbnails as they are Q19 let's give the thumbnail editor a parity with the diagram editor in terms of saving components inserting components we may even want to consider a a shared component component. There we're seeing something a little bit awkward actually in our domain language for component. We can see that inside the diagram sections of the glossery we have this concept of a component. This is something I'm actually pretty proud of in my user interface. We have diagram components here which are reusable diagrams that I can plug into any diagram that I want to. But calling them just raw components in the glossery means that they actually sort of bump up against the concept of components in React. And that's what I was just talking about. We need to have a shared component that shows a list of components. It doesn't make sense. A quick note on the component part of the glossery, which is I'm finding it a little bit awkward with the word component in there because that bumps up against React components. So I think we probably need to prefix it with the word diagram. So a diagram component. Okay, we are cooking with gas now. So I'm starting to get a real sense for what we're building much much more than when we started. I'm not feeling the need to end the grilling session just yet. I'm feeling pretty happy with where we are.
28:48 These are still highquality questions. Okay, it's now asking whether I want to change the way the search works. Q20, no, I disagree. I still want the way I I want it to work in the diagram playground the exact same as it works in the thumbnail editor. I like that components have one search and then diagrams and diagram snapshots have their own. If we make two subtly different diagram editors, that will be very, very annoying and users, i.e. me, will paper cut themselves all the time on it. Q21, what an insert brings in.
29:20 Should an inserting a diagram or snapshot bring in the whole drawing? Q21, yes. Paste counts as a source, too. So, what it's saying is if we copy one diagram and then paste it in, should we track the snapshot that it came from? Q22. That sounds like a lot of complexity for a feature that I'm maybe not going to use that often. So, no, I don't think I care about it. One diagram component library, one UI. Should a diagram component save from the thumbnail show up in the playground and the reverse? Q23. Yes, absolutely. Next, deleting things that are a source today.
29:56 Deleting a video cascades and hard deletes its thumbnails. If next week's thumbnail diagram copies shapes from this week's, deleting this week's would break that link, which breaks the not lossy rule. Q24. Yes, thumbnails should be archived instead of deleted. We kind of want soft delete on everything should be the rule. For those who don't know, soft delete instead of deleting something from a database, which would be a hard delete, you instead mark it with a little marker like archive true or something and then it doesn't show up in the UI or you build your application so that it doesn't show up. Soft deletion is incredibly useful because it means that you can go back and retrieve that data if you want to. Whereas if you hard delete, then you're kind of screwed because it's literally been gone. It's gone from the system. Because this data is really valuable to me, I pretty much always go with soft delete. And I don't think I have any cleanup mechanism for like cleaning up old data. I just keep it around. But in an application with lots of users, then I would want to make sure I eventually, let's say on a 30-day cycle or something, deleted the stuff that people had soft deleted. Okay. It's asking about should parity come from extracting the playgrounds editor into one shared diagram editor component.
31:02 Q25. Yes, absolutely. Let's have a single source of truth for this. Q26, it's saying your step of searching for a diagram or snapshot or dropping it in doesn't exist yet. This feels to me like it's actually untrue. It's actually not noticed something about the code, which is a little annoying. Q26, I don't think that's true. We already have a like find diagram thing, right? So, we would just reuse that, wouldn't we? Q27, navigation results in the thumbnail editor. Q27.
31:32 Yes, I agree. Looks great. Q28 soft delete everywhere is a separate piece of work. It's now taking my opinion and kind of running with it. But I'm pretty sure we already have soft elite everywhere. Q28. Yeah, let's not overcope this. I'm pretty sure we already have soft elite most places that I want it. This is an important part of grilling, too, is like when you're talking about your system, you will often find little ways to improve it that might lead to issues that you create on your backlog that you eventually maybe grill about or maybe just like slam through. And so grilling is not only about the feature you're on, but it's also about staying in touch with the codebase. It's a a ritual, a ceremony for thinking about the code.
32:11 This is why I spend so long on it. Q26. Yes, let's add a new action to the existing search. That sounds great. Okay, it's now saying this is a good one. So, should past thumbnail diagrams show up in the same search? So, that's actually pretty neat idea cuz we probably do want the ability to search through old thumbnails that we've created since they might be useful in diagrams and just in the same way that diagrams are useful for thumbnails. This is again exactly the kind of thing that Grilling is really, really good at pulling together. Q29. Yes, that is a really smart idea. You should be able to search for thumbnails from or thumbnail diagrams from the diagram playground.
32:50 And you should be able to search for diagrams and diagram snapshots from the thumbnail editor. So that is an important thing that we need to think about in the data model that we weren't really valuing before, but I think our our current model gets us there because it thumbnail diagrams are probably going to be stored in a separate database table or they might just be an entry on the existing thumbnail. So, yeah, interesting one. Okay, while we've been talking, the prototype has been built.
33:18 So, let's check it out. Okay, here we go. It's pretty surreal. it's quite surreal editing a thumbnail for my own face. This is very cool. This is pretty similar to what I was imagining. Here, we can move my face like left and right here. It's a little bit fast there, but I mean, it is a it is a good one. And then in the top left, you can actually see a preview of the compos composited photo there. That's nice. And this is only variant A, right? We've got a couple more variants. So, we now have face inside the canvas. Whoa. This is again pretty trippy. We This is actually worse than I thought it was going to be.
33:54 It's a bit too large. I really hate this like bar over the left here with the view. This face thing again is just way too Woo. Okay. B is really not as good as I thought it was going to be. And then what's this? It's a split view. Okay, the split view is garbage because I have to like look over on the left here and then see it update on the right. You can see I'm moving the blue box around and then I have to like manually line it up with my finger and I can't see my finger. This is bad. So, I guess a is the one that we're kind of going for here. Oh, look at this feature. Look, it has a ghost face while pointer is in the frame. Ghost used as a verb there. So, look, I can like when the pointer is in the frame, my hand disappears. That's so freaky. It's annoying that it's showing get license for production there cuz I do actually have a license. So, something's going wrong there. So, I'm going to dictate out all the things that I love and hate about this. And we're going to iterate with the agent. I really love a I think you've really nailed something there.
34:53 I especially like the ghost face thing. That's a nice feature. The moving me left and right, so moving the face left and right is a little too sensitive. So, just bump that down a little bit. There appears to be in the composited diagram a little white line just to the left of or sorry to the on the outside of the main block there which is not good. I also want the composites to display below the thumbnail editor. We're also missing a lot of the stuff that we've grilled about such as being able to insert components and being able to drop in stuff. And I'm pretty sure we don't currently have par with the other with the diagram playground, right?
35:35 So we probably need a version of it like that. So let's abandon the three variants now. Let's just go with a and let's continue to iterate on it. It's also got a couple of questions for me after I've tried it. So it's saying which surface. I think we've added that with Q31. Yeah, I want it to live inside the thumbnail page. And I think we probably need to see that in the next prototype so that we can arrange it on the page properly. Should moving the face and retaking be on the same undo history as drawing? Oh yeah, Q32. That is genius. Really, really smart.
36:05 Definitely. That's really cool cuz I don't have an undo history in my current thumbnail editor. So, I'm kind of screwed there. But we kind of get that for free because TL Draw, which is the tool that I'm using, bakes it into its data model. Very, very, very smart. Okay. So, it's now gone and sent the prototype agent back to it saying, "Okay, drop B and C. Put A inside the real thumbnail page blah blah blah blah blah." In other words, it's confirming with me all the things that I gave it as feedback and it's now implementing all of those. This prototyping phase is so so important because we really get to stamp how we think the product is going to look before we then like actually schedule an agent to build it. In other words, this time human in the loop with the agent is so essential because we're really going to like reduce the decision space for the agent. We're going to say no, it has to look exactly like this. We know exactly the data model. All the agent then has to do once we run it AFK is plug those two things together. I find it pretty hard to like not get excited when I see a prototype, when I see things starting to come to life. You know, we've done this grilling which feels kind of a little bit ownorous sometimes, a little bit annoying, but when you actually see the thing coming together, you see how it's going to feel to use. And I'm really doing this. This is personal software for me. You know, it's just something to make my life more delightful. And seeing that actually coming together is so exciting. Okay, we are back and we have a new version here inside the thumbnail editor. So, we've got the YouTube previews down the bottom. That's nice. The face is in frame here. I love that I can resize this actually. That's something I've never had before. Let's switch me around a little bit. That is really nice and smooth. Yeah, this really, really rocks.
37:44 Now have access to a command pallet as well, so I can insert components. Let's take a look at the list item here. Yes, that's looking excellent. I should be able to search for other diagrams. So, I can insert a diagram. So, let's just go for wavefinder here. And then, would you look at that? We've got all of that working too. So, let's take a look at the composites. We can see still looks like there's that little white bit just there. Let's move me slightly this way. Move this so it covers the whole screen. Yeah, that does. That's really cool. Oh, I love it. I can still see the little white bar on the right of the export, but overall this is looking a lot better. It's also asked me some questions here. Q34, I agree. Q35, I agree. Who owns the face? It's an excellent AI sentence. Very good. Q36, I agree. Q37, I agree. Q38, I agree. So, at this point, the agent is pretty much aligned with us. We now have just sort of one problem to solve in the prototype and I can feel we're nearly at the end of the grilling session. Like once I just start going yes yes yes, we are aligned, right? The agent is making decisions as if it were me and it's making decisions understanding what I care about. So this little white bar thing is actually showing something pretty nice here. This is essentially a bug in the prototype and this is a bug that could have gone into production if we hadn't spotted it, but we have spotted it. So what it's trying to do here is it's trying to verify its own findings. It's trying to construct a harness around the problem. In other words, a reproduction, and then it's going to try to fix it, whatever the issue is. In other words, it's going to reproduce the bar in its own browser first, then read pixel colors along the right edge of the export and of each preview. That should tell us where the white comes from. This generation of agents appear to be really, really good at this. In other words, verifying their own work really solidly. There might be stuff in my home repo like steering files that tell it to do this, but I'm not quite sure. I think it is just doing this off its own back. We can see too that it's opened up the existing sub agent. So, this one that's currently on 260k tokens here. So, this is already punching pretty deep into its dum zone.
39:58 I would probably have preferred it to kick off a new sub agent with just specifically this problem. I think that probably would have been better, but I mean, let's just see how it does and see if it manages to find the solution. If it doesn't manage to find the solution, then I will punch it again with a new, a new sub agent with a clean context. Everyone's always asking me, by the way, oh, do you still stand by the smart zone dumb zone thing? You know, this is my contention, and other people have had this contention as before. It's not original to me. Dex Horthy from human layer and now factory came up with it, which is that if when your agent gets to around 150k tokens, it starts acting a little bit stupider and it starts getting slowly dumber and dumber. And if you think of what smart zone versus dumb zone actually means like what we're talking about there is that the risk of hallucination slowly raises the more tokens you add to the context window. That's because if you imagine each one of these boxes in an is an individual token, then the model needs to keep track of all of the relationships between every single token. And it's not the fact that the number of tokens increases. It's the number of relationships that the model needs to keep track of just expand quadratically and you end up with this enormous amount of memory needed and amount of work needed to hear the signal in the noise. However, making the models better at this is essentially an engineering problem, right? some kind of model design problem that I'm sure people are trying to figure out. And the question everyone always asks me is like, what number does the dumb zone begin at? When should I clear the context? And my answer is becoming, okay, in previous generations of models, sure. Okay, you pretty much had to clear the context at 120K, sometimes even like 80k tokens for Sonet 3.5 or something, you know, the number of token relationships would just go nuts and you would end up with loads and loads of factuality errors. But now it's more like it's a kind of cost and optimization thing really. You know that your agent will be smarter when there are fewer tokens here. So it's not necessarily about the risk of hallucinations. It's more like optimizing your agent to produce the best work. So for me, it's not so much that the agent produces hallucinations in the dumb zone. It's more that it just produces worse work and I end up with better results when I do my work in the smart zone. Plus operating at like 750k tokens in your context window is very very expensive because even like when your cash runs out all of those previous tokens are going to be run through again and that's going to be build again.
42:30 Okay, the next version of the prototype is ready and while it still has this little white thing in it, it actually says that it's not an issue. The little bar actually comes from the browser at Windows 125% scaling. Chrome shrinking 120 wide image into the previews. Left the last pixel column only partly painted. There's some other stuff here like some hazards. I agree with Q39. Q40. Yes, drawing edit should autos save the thumbnail. And it's now asking whether I want to write it up. So, I'm going to be careful here. I'm going to go back to the start of this little text input. And I'm going to say to spec, let's write it up. I have to go back to the start because to spec is a userinvoked skill. So I can invoke it essentially and I have to have it at the start when I'm using clawed code. I can't just sort of scatter it throughout the text input which is a bit annoying and something I've been wanting them to change for a long time. To spec what it's going to do is it's going to create a specification. It's going to ask me a couple of questions about where we're going to test and then from there we'll be able to implement it. I already have a few quite robust reducers and reducers are essentially places in the front end where you can contain lots of state together and I find them really really good with agents because they can just kind of extend existing ones. All of those three scenes look good. I'm then going to go for the to ticket skill as well. I'd like you to add some tickets too. Let's just do these in one batch. Now, what spec and to tickets do is they essentially give the agent everything it needs to run a long running session. The spec acts like a destination document. So, we're essentially running work over multiple sessions. And the spec is going to say, okay, once we get to the end of these sessions, this is where we want to end up. And then the tickets are essentially about scoping each individual session.
44:22 So each sub agent we're going to run is going to be handed a single ticket and that's going to be the scope of its piece of work. So here it's given us the proposed breakdown of all of the sessions. So the first one is like a prefactor like extracting the shared diagram editor into a shared component. Really useful. That's going to be very handy later. Each ticket says what it's blocked by. And I'm not going to like review this too much. Nine seems fine to me. I'm just going to say yep, looks good to me. Now, the plan is that once this is done, I'm then going to compact. So, I'm going to take that entire session, the grilling session we've just done, compact it down, and then we're going to run a skill called implement spec, which is going to essentially AFK just create all of this stuff and merge it into a single PR. And you think of how easy that job is going to be for the agent, right? We are going to have an updated glossery by that point. We are going to have all an entire spec of the thing it needs to build all of the tickets and the how it's going to get there and we've also got a prototype which it essentially just needs to copy in terms of the UI.
45:26 So, we've already got a bunch of code written, too. By the time I get to the spec and the tickets, by the time I get to implementation, like I'm really, you know, trying to give the agent no decision space in which to operate. No nuance that it can go, "Oh, yeah, I'll just sort of fiddle around with this." Because the more nuance you give to an agent, the worse it's going to perform because as soon as you ask an agent to make a decision, it might make a bad decision. So, the more decisions you give it, the more decision space it has, the more likely it is to choose a bad one. So I tend to like giving the agent very very few options when it comes to implementation when it comes to the decisions of the features that I want.
46:01 Okay, we now have our spec and we can see that this is in GitHub. So this is a GitHub issue. I have a bunch of user stories here around 47 of them. A bunch of implementation decisions, a very very rich document including stuff that's out of scope. We can see it's also referencing the prototype on the local branch. Fantastic. And it then has a bunch of subiss issues each of which are the individual tickets. So all of these are individual tasks and crucially these can be parallelized. And so what I'm going to do is I'm going to compact the current conversation. In other words, just sort of take all of the context that we've had so far and squash it down. And then I'm going to say implement spec just on the essentially just on the spec that it's just created.
46:44 I've started using compact a lot more. Actually compact has become a lot more reliable, a lot nicer to use. I still don't think it's a perfect thing. Like autoco compact is still a little bit dodgy. because the timing sometimes just absolutely wumps you. Something important will be taken out of context. But compact, especially in this situation when we've taken the conversation and just turned it into a document is so so safe. It's almost free. It's just a kind of like a minute it spends just compacting this conversation and bam, we're back down to essentially our starting context. Now, implement spec is a skill that I've had for a little while now. I think it came out in v 1.3. And this is really it just takes the spec and the tickets and it implements them inside our local setup.
47:28 And when it finishes, which for a piece of work like this might be like an hour or 45 minutes maybe, then we're going to end up with a nice PR that essentially implements the entire thing that is ready to merge. So, this is the point here where I would step away, where I would trust it to run AFK. It's going to run as much in parallel as it possibly can. You can see it's starting the three tickets that can begin now. And it's able to pass them very rich context about what needs to happen because it's just a compacted version of our original conversation. So, it knows exactly the parts of the codebase that matter, knows the spec, knows the prototype, too.
48:04 So, I'm going to walk away and when I come back, I should have working code. Okay, it's been a little while. We now have a massive PR and we have a code review that has run and found some violations. We can see the pull request inside the PRs here for edit a thumbnail diagram in place beside the face. We can see we've added 21,000 lines of code. Go. I'm looking forward to reviewing that. And the way the implement spec works is it goes away and reviews everything with an agent and then it checks against some existing coding standards. You should take a look at the code review skill if you want to see more of that. But basically, it found one hard violation and a couple of cases of scope creep and then it's fixing them up. Right now, I'm going to try something I don't usually try here, which is I think I do want to review this with you guys watching. And so, I think I want to try a different way of breaking down this massive PR into smaller chunks. I don't have a skill for this yet. This isn't something that I do regularly, but for large chunks of work like this that I do want to review, this makes sense. Once the review is finished, I think I want you to break it into smaller chunks using stacked diffs.
49:12 These smaller chunks ideally should be reviewable on their own. And what that means is that I want them to be each a bunch of two-way doors and finish in a final one-way door. You can look for the definitions of two-way door and one-way door inside the PR skill. One way doors and two-way doors are it's a really nice analogy. It basically means that when you have a PR that is a two-way door, it means you can merge it and then revert it any time. So you can walk through the door and then walk back through the door. Whereas a one-way door is a PR that is merged and then is very difficult to unmerge. In other words, it might mess with some data. It might speak to an external service. It might expose like a security window that's hard to walk back. And agents are pretty good at breaking up massive PRs into small PRs. So it's given me this chunk of different PRs here. I can tell though that some of them are smaller than others. It feels like this last one is kind of the big one. Can you give me an estimate of the lines of code that would be in each PR since that's really what I want to do here. I'm also wondering whether we could utilize feature flags to make the thumbnail diagram available and then pull it back later. In this situation, I'm kind of cosplaying as if this is a production system. You know, I'm kind of pretending as if, okay, I want to break this huge PR down into reviewable chunks that we can ship to production and not have like this big risk when we merge a single PR. Usually, when I merge to this repo, because it's only personal software, I don't have to care that much and I can just go, all right, bam, let's stick it in. But because if I'm imagining I've got, you know, thousands, hundreds of thousands of users, like we really want to make sure production is as close to the change as possible. And then once we finally flick it on, it should be relatively seamless. In other words, we're taking this huge chunk of or taking this a single door and turning it into lots of doors which we can revert as we need to. And then finally, we're going to flick it on at the end. Okay.
51:03 So now it's taken that last PR, the massive one, and turned it into four smaller ones. The upshot of this is it would basically run both implementations side by side for a bit, and then when we were ready, we would merge the final PR, and then that would turn the flag on. Okay, let's go with this version. Sounds good to me, but only do this once the review has finally fixed its things. Make sure you delegate this work to sub agents since you're a little bit constrained in terms of context window.
51:27 So, this is exciting. This is kind of an experiment. Hopefully, these are going to be easy to merge individually. Okay, so we have our first PR of seven here. The first one is literally just the glossery terms diagram component and ADR060. If we take a little more detailed look at this, this all looks fine. And so as this is this can just go in. I'm happy to enable an automerge here. I can press confirm automerge. And that will now go in as soon as the CI checks pass. And there we go. It has gone in and merged. Beautiful. Next we have a new PR coming in saying extract the shared diagram editor from the editor or diagram playground. So just a few files changed here. Now while we're here, we might as well talk a little bit about human review and like what the purpose of this exercise is. For me in this situation, I'm going to do this human review because I know that you're watching and you're interested in how I do human review and so I'm going to review every single line. But do am I saying that you need to do every single line yourself or review every single line? No, I don't think you do.
52:27 When I'm reviewing code like this, obviously I want to make sure that it works. And so if this was going out to a production system, then I would clone it locally or I would get some kind of playground where I could walk through it and check that it works. What I'm actually going to do is I'm going to merge everything and then because it's I'm I'm the only user, I'm just then going to review it at the end. But the point of checking the code here is that I'm not just interested in like what the code does. I'm also interested in the system that produced this code. In other words, if I notice that something is going wrong inside this code or there's a pattern that I don't like, then what I'd like to do is create a like a lint rule or something to make sure it doesn't happen again. And by don't like, I mean that I want to have a hypothesis around that thing that I want to change that it is affecting my environment my agent operates in in a negative way.
53:20 In other words, I can see in this file here, like the command pallet, I can see there's a huge comment right next to it saying the command K command pallet mounted inside the active diagrams or rather the shared diagram editor over its canvas. I'm kind of not happy about these large comments and they are kind of everywhere in my codebase because it's more surface that the agent needs to update. And so I'm going to add a comment here. I'm going to say I'm not really a big fan of these comments because they leave a huge surface for the agent to update and they don't really add a lot that isn't already explained by the code. I think I'd like you to add something to coding standards to make these comments much less prevalent. And I think we should have a conversation about maybe banning comments in certain parts of the codebase. So I'm going to comment here and then I'm going to show you what I'll do with those comments later on. For instance, here I really don't like the as keyword in Typescript. It can be used to cheat the TypeScript which I hate. So I want to say a helper function is needed here on to ban all uses of as not inside shared utilities. This is just something I know because I am a you know I suppose an ex typescript expert. I made a course on typescript basically.
54:26 Again these docs here just sort of feel pretty gnarly. I don't like this. You can see how much the diff as we're going through is literally just code comments. It really is brutal. But overall this review didn't take too long and I've noticed a couple of things that we might need to improve. So, next we go to the next PR in the list, which is just a relatively small change. Again, we've got some reducer testers, which I really, really like. If you've never used a reducer before, it's just so nice, so easy to work with. Again, more comments that I just want to kill. Man, this repo is full of comments. There's also another TypeScript thing that I really don't like, which is using this pick and this and here. Prefer using interface extends to using intersections. See if you can find a lint rule for this that we can ratchet that phrasing, by the way. like lint rule. It's asking it to find a deterministic rule that we're not necessarily going to impose on day one, but we're going to ratchet it up over time. Again, so many comments here to review. It's just it's getting pretty disgusting, I have to say. Another one here is that even in code that is not actually touched by the PR, I'm noticing it's calling fetch and then ignoring the result. And I say it feels like a reusable function is needed here. I'm being pretty harsh in these reviews, right? like I'm I'm trying to force it to design APIs that remove all of the nuance, all of the decisions from the agent. Another one here is I can see we have a use search params hook and we're grabbing things using magic strings here. It would be very very easy to just change the name of this highlight or this snapshot even and we would get no type errors from it. Find a more type- safe design for the way that we access search parameters since this feels like a magic strings style hole that we could potentially fall through. Create a new lint rule banning the use of use search params. And then let's create a strategy to ratchet it up. Again, I'm being super ambitious here. I'm saying, okay, everything that we find in here, I never ever want to see this again. Never ever want to loot. Like I want to lint it out of existence. That's my plan. Next PR.
56:21 Again, we're up to 500 lines here. Got to say that apart from the comments here, this is a clean clean PR. We can see it's taken a bunch of like magic conditionals here and it's replaced them with a single source of truth for is diagram search. Phenomenal. Again, just way too many comments here. Too many comments. Okay, so I'm now into the I think penultimate one or maybe last but couple. Let's see. Yeah, this is still a two-way door thing, I think, here. And this is now we're getting up to about 2,500 lines now. Now, I think you've got the idea of what I'm reviewing for here, which is I am trying to give my opinion, give my feel just by looking at the code. And I think reviews are a good surface for this. But I'm not going to consider any of these blocking. In fact, out of all of these PRs, the only one where I would consider reviewing mandatory is this one. This is an additive migration for the thumbnail diagrams concept. And what I want to see is inside schema.ts here. This adds the thumbnail diagram into the thumbnails here. So many freaking comments here, guys. Comments are also an opportunity for the agent to do like two specific text or text that's specific to its session. In other words, this session is or this text is basically just like a note for itself in a future session, which is really frustrating because then that is just going to live forever, that comment, and it's just totally useless. Overall, this looks really solid. So, actually, I'm happy with the one-way stuff as part of this big PR. So, what I'm going to do is go back to my agent session. I'm going to compact. And then I'm going to say, could you merge all of those PRs in order, please? Ignore all of the review comments for now. We're going to tackle those in a minute. Actually, once everything is merged, could you run the merge in a background sub agent so that we can continue chatting? Okay, let's fire this off. So now that we've decided that the merge is happening, like I I'm going to assume that in your version of this you would have actually cloned it locally or actually you know check that it was all working on the final branch.
58:22 I'm fine with checking it in a minute. But what I'm going to do now is I'm going to use this session to fix or make a plan to fix all of the things I found during review. And for that I'm going to use the retro skill. I'm going to say, could you take a look at all of the agent sessions that ran as part of this? And could you also pull in my review comments? And the retroskale essentially runs a retrospective on the process that we just saw. Even though we've run compact, it still has access to all of the sessions that ran before because they're just saved locally on disk. And it's going to use the GitHub CLI to pull in all of my comments. So, it's going to have access to that, too. Now, I will usually run retro after a big chunk of work like this, or I'll also just run it regularly, just checking up on my agent sessions. if you have some kind of software factory setup where you can automate this, then I would save your agent sessions somewhere in the cloud, and then Retro can take a look at those and see what the agents struggled with. So, it's going off and sending agents through the 30 odd session transcripts and your 12 review comments, and it's going to come back with a ranked list. So, we're essentially throwing a bunch of tokens at this and looking for improvements or potential improvements to the environment our agents are operating in. Now, we didn't pay attention at all to the impleers while they were running. I didn't look at the sub agent traces. Haven't looked at that at all. This is our opportunity to apply some tokens to it and actually look at those and get some improvements from it. Okay. And here we go. We have the retro back. So, all 12 of my review comments have one root cause. Nothing in the CVM's written standards cover your points. The existing code in the docs model do the opposite. So existing stuff in coding standards.mmd and docs frontend state show the patterns you rejected and main already has thousands of instances.
60:07 Thousands of instances fly me. Okay. So I am trying to turn an oil tanker around apparently. And also the prototype branch was copied. Okay. So its first recommendation is to turn your comments into ratcheted checks. The first one is as outside shared utilities. Yes, lovely. Sounds good. There, that is 2,000 instances it will find. Okay, brutal intersections into interface extends. Oxlint has no rule for this, but a small passer. So, it's basically saying create a custom lint rule for this rule. Excellent. Next, I said we should kill use effect. Lovely job. We turn it off for a specific directory.
60:45 So, hooks. And there are currently around 230 use effects in 140 files. Next we have use search params and magic strings. So this would point at a new typed search params helper. Lovely. We ban raw fetch and instead we have a typed API client module. And then it's saying too many comments. So here no lint rule fits. Yeah, I don't know what to do about comments. I mean like Lauren Tan potato says they just ban comments.
61:11 No comments allowed. And I kind of I kind of want to go that direction but I wonder whether we do that in a phased approach where we ban comments in certain folders. This is interesting. So 18% of lines of comments in the new features diagrams against a 12% repo average. 12% of code in my repo is comments and 20% of the new feature is comments. It's crazy. Okay, I really like number one. All of those I think should be raised as issues on the repo.
61:38 Can we also start triing the no comments rule in certain folders? And actually, I want you to give me your opinion on what we would lose inside features diagrams if we just deleted all the comments immediately. Is there any information contained within the comments that cannot be divined from the code itself? Okay. Number two, it says fix the docs that teach the rejected patterns. Obviously, yes. Number three, prototype code was copied and not reimplemented. Yeah, this is interesting. So, it's actually recommending a change to my skills about the prototype skill and the implement implement spec implement brief. For number three, could you raise an issue on the map PCO skills repo? By the way, this is often how my skills get improved is I raise issues about my own skills based on what I find in these retros and they get subtly improved. The reviewer can't cover a big diff with one agent. Yep. So, this is the code review skill kind of not being able to perform at its limits. Can you raise an issue for number four, please? And I think there might be an existing issue. So maybe you can just add this as a kind of extra, you know, reason for me to look at it. There's no argument to say that you should do instead of like doing automated review on the spec, you should do it on every single ticket, but I found that that is just, you know, extraordinarily slow. It's absolutely hugely slow approach. But it looks like the code review skill is kind of like, you know, taken under a 400word limit, which doesn't make sense to me. So I think maybe the code review skill might need to change, might need to divide more chunks of it into sub agents so that it can more easily do it. Okay, it's asking some stuff about the implement spec skill with number six. I really like that idea. It's basically saying that in implement spec it creates a merger agent too early. It should just try to like merge it in directly. For number seven, could you raise an issue about this and see if we can hill climb towards a like a faster suite? In number eight, there's a skill I have called verify CVM, which basically kicks in every time I want to verify some code or an implementation on the CVM. It runs it inside a browser.
63:45 does all sorts of stuff. Okay, could you add eight as an issue? And all of number nine, all the smaller items should be added as separate issues. That all looks great. So honestly, this retro was extremely extremely good. We've I think we might get like 20 issues out of this. Things that can go like that we probably don't have to grill on. Things that we can just pass off to agents and get PRs back from that will over time slowly improve the repo. While this has been running, our agent has been merging. It looks like it's just sort of waiting for all of the CI checks to complete and then it just merges each one in turn. All right, while that's going on, we have our comment audit has come back. So, it's saying of the about 2,000 lines of comments, about 940 can go now. And about a thousand explain a reason you can't see in the code. It says seven comments are already stale.
64:35 There you go. And there are no eslint disable or ts expect error directives to worry about. Okay, let me lay into the agent for a second. The thing that concerns me about comments is that they allow workarounds to proliferate and the comments kind of act as a fig leaf that the agent is able to put there and say, "Look, this is fine because we've got an explanatory comment." The, you know, idea behind lots of folks like Lauren Tan is that the comments are actually a safety valve that you are using too often that you're basically saying, "Okay, because I've got this comment, I'm allowed to do the workaround." Whereas, if you were banned from doing the comment, you might actually not take the workound. All this to say, what I would like you to do is to tell me which of these could be moved into ADRs, which of these could actually just become nonworkarounds. In other words, use something you don't need a comment for. And which of them could just disappear because they're not actually needed or you can actually infer it from the code. I want you to be more aggressive here. Let's see what it says here. I don't know. Let's see.
65:40 Okay, guess what? It agrees with me. The comment next to a workaround often marks a place where the code should have been designed differently, not explained. Haha. It's guessing that the TL draw and command K quirks mostly become adapter rappers. The race constraints mostly become test names. Yeah, that's a legitimate place to have some kind of like free text is just like the name of a test. And while that has happened, our PR, the mega PR stack has now been merged to production. So, I've got this loaded up. We should be able to capture my face here. And there we go. We have my face. And we can see that I can add text to the thumbnail like this. So, I can add a big box here that my hand is kind of pointing to. I can go all the way down and I can see that is how it's going to look. There's like a button here saying a dark panel behind the drawing. So, I can take that out or put that in if I want to. And I mean, it's pretty good, guys. Like, that is not bad. If I exit out to here, then we can see my thumbnail is ready to go. I can select it when I then upload it to YouTube. I can click back through and edit it. And back we are should be back to this screen here. Nice. So, you can see exactly how much fidelity it has to the prototype that we created. It seems to be working. Okay. I probably do have some like follow-up feedback here, but overall, yeah, I can insert icons. Let's just add this one for instance. Bam.
66:59 Like that. Put that on my finger. Lovely. And there we go. Just like that, I've built a feature, something that I will enjoy using for the rest of the time that I use this application. And inside our agents view here, we can see that yes, okay, when I tell it to be more aggressive, it says 22 can simply be deleted. There are 18 workarounds that need changing. Look at that. I mean, that is wild. I feel like there might be a skill here, you know, like just looking at all of your comments that are in the repo and just using those as smells and just say, "Okay, sniff sniff sniff. Take a look at that comment. See what workound it's describing. Can we just get rid of the workaround? Get rid of the comment." And it does say there are three ADRs. Yeah, there you go. So, CVM custom shapes are a persistence contract. Facecam centering is tuned by I diagram PGs render in the running app. All three of which I agree make good ADRs. And it's giving me a suggested PR order here. So, let's prompt it one more time just to tie this up. I want you to take all of these findings and put them in one more issue that will be the kind of umbrella issue for this idea. And that, as they say, is that now what I would do next is I would go into the thing that I just created. I would try to find anything that I could improve and QA it. And then those would go into issues which I would then just slam through with an agent, probably not even grill them. I would then go back through the issues, get my agent to take a look at all of them and turn those into codebase improvements and all of those I would expect the diff to be really really small and so I could just one-shot them. But that is it folks. Hopefully you enjoyed this kind of deeper dive of me actually walking through how I do things. And hopefully you get a good sense for like where I am most valuable in this process. I'm most valuable early on in the alignment phase where we talk through everything. We get alignment. I understand exactly what's being built. I create a prototype. We figure that all out together. And then I am really useful at the end where my technical expertise can come in and I can impose my coding standards and I can say no that looks bad. Let's do this instead. In other words, grilling and retro are really the two main points at which I interact with the system. And then of course you know QA and you know putting in my taste, making sure that everything feels right and is working how I want it to. But thank you so much for watching. Hopefully you enjoyed this wow nearly hour and 10 minute video so far and that you learned something from it. I love doing these deep dives.
69:20 I don't get enough time to do them. So you know if you like this then do share it with your friends and that will incentivize me to make more of them. Thanks so much for watching. See you very soon.
Summary
- The presenter shares insights into their development process, showcasing the "grill with docs" skill for aligning on feature requirements.
- A focus on domain-driven design (DDD) helps clarify the language and concepts used in the application.
- The "retro" skill is used to review past sessions and suggest improvements based on a large pull request (PR).
- The presenter emphasizes the importance of clear language and definitions in shaping the data model and feature development.
- Prototyping is highlighted as a crucial step to visualize and iterate on the feature before implementation.
- The video discusses the significance of human review in code quality and the need for coding standards to minimize comments and improve clarity.
- The presenter reflects on the balance between agent assistance and personal expertise in the development process.
- The final feature is demonstrated, showcasing its functionality and alignment with the initial prototype.
Questions Answered
What does the development process look like?
The speaker introduces their development process, focusing on two key skills: grilling with doc skill and retro skill. They emphasize the importance of domain modeling and how understanding the application's language is crucial for building features.
How do you know when to stop a grilling session?
The speaker explains that the user should take charge of the grilling session and can decide when to stop. They emphasize that the conversation should be driven by the user, not the agent.
What are the challenges with using the term 'component' in the glossary?
The speaker discusses the confusion caused by the term 'component' in the glossary, as it overlaps with the concept of components in React. They suggest renaming it to 'diagram component' for clarity.
Why is it important to manage token relationships in agent interactions?
The speaker explains that managing token relationships is about optimizing the agent's performance rather than just avoiding hallucinations. Fewer tokens lead to better quality outputs and reduced costs.
What should be considered during code reviews?
The speaker highlights the importance of providing feedback during code reviews, focusing on eliminating 'magic strings' and ensuring type safety. They emphasize that not all comments are blocking, but some PRs are critical.