transcribe

Why Your AI Coding Agent Keeps Writing Bad Code (It's Not the Prompt)

Boundary · 51m · transcribed Jun 2026
More from Boundary Business
𝕏 Share ▶ YouTube 📥 PDF 🤖 .md

Transcript

0:00 We are going to talk about using AI to build really good product specifications. >> How do you like remove the cognitive burden of reviewing stuff later and how do you move it earlier in the pipeline? >> There's like way too much code and way too many PRs. You should be able to work with a model where the outcome implementation is very likely to be correct. >> By standardizing that, my verification loop got faster. I'm excited cuz like this might make my life easier.

0:26 >> All right, y'all. This week on AI that works, we talked about kind of the evolution of research, plan, implement, and a new technique that we found really useful in doing agentic coding, which is splitting your design phase into product design versus technical design. Vaibhav shared some interesting things that they do for designing the like language surface and the user-facing parts of things and then also stepping into the technical design of the the system architecture and the contracts. We got to work on building some We took a very rough ticket here on like rebuilding this task page in Human Layer and we built some interesting artifacts in terms of both product and understandings, you know, how is this going to look and doing some mock-ups and things like that, as well as the technical design and like how is the program going to be designed and outlining some of the key things that are important for how we're going to do this.

1:18 So, really fun episode, pretty quick one, but if you need if you're thinking about how to do agentic coding and you're doing product and technical work and you want to separate those out, I think you'll have a lot of fun. Thanks for joining us and amazing. Let's get into it, dude. >> Let's do it. >> I'm super stoked. I was just at the the Cursor conference in San Francisco at Fort Mason, hanging out with some very cool people.

1:43 Uh I won't name names, but it's a good good crowd there. Congrats to the Cursor team on this fantastic acquisition. It's big. >> It's got >> Yeah, it's it's it's a great great great outcome right now for them. I'm sure they're excited. >> There's uh at least I've seen at least two tweets today already of people posting screenshots of DMs with Michael Truel where he's inviting them to join the Cursor team in the last like year or two and they say no. They're like, "I'm happy where I'm at, but like thanks for the offer." And they're just like, "Damn, I really dropped the bag on this one."

2:14 >> I mean, if you're if you've been around enough awesome people, at some point you will have missed out on opportunities that would have been fantastic opportunities. >> That's fair. What's an opportunity you missed out on? >> Oh, dude. I don't know if I could say this. So, never mind. >> All right. Well, all right. Well, >> Yeah, you know, I used to let's just say some of my earliest jobs were did not have legal forms of currency uh at that time.

2:37 >> Interesting. >> Some currency uh should should have been held on to much longer than I thought. >> [laughter] >> I'll do it. Um what's up, y'all? This is the AI that Works podcast. I'm Dex. I'm CEO and co-founder of Human Layer. We're building the missing piece of the software factory. Uh great design discussions. Uh keep your great AI coding agents on track. I'm joined by Vaibhav. Vaibhav, please tell us what you've been working on. >> We are building a programming language that's designed to be agent-first and human-second-ish.

3:11 >> That's nice. I mean, the world really should be agent-first, human-second. I think that's where we're going. >> Every single time I use stuff now, I'm like 90% of the tasks are so freaking boring. I just want AI to do it for me. >> There's so many things where I'm like, "I can't believe there's no way my agent can do this for me." Like give me a CLI. Give me an MVP. >> Give me something I can use for my agent. Exactly.

3:30 >> Yeah. I will use shitty software that has a CLI over good software that doesn't. I mean, I've actually been like this for a decade, right? I've always been like, "Dude, if I could put it on a bash script, I will tolerate so much jank if I can script it and automate it." >> Really? >> Oh, yeah. Well, for a while. I got I got over that eventually. Well, as I got In my late In my late 20s, I grew tired of the like I used to run Linux on the desktop, but I had the grind and all of that and takes a lot of grit and I loved it. Uh but now I'm back.

4:01 Now Claude can write my tmux config and I can have the perfect tmux config and my Vim config. I don't have to think about any of this anymore. >> You know what's so interesting? I feel the exact opposite as you and so many situations about this. Like my my philosophy in life has always been like I actually want to learn the least amount of stuff. So anytime there is like these micro optimizations that people can make is like, "Oh, you can type in Vim instead of You can use Vim keyboard bindings instead of just like typing like a human and using your mouse."

4:27 I just like I always did that. So like what's interesting to me is like these optimizations now that like these agent-first things are in some ways optimizing for like the laziest humans out there, which I am one of. >> We are going to do We're going to do an April Fools episode of this show where we do a live stream and you just go through Vim Tutor for an hour and it's going to be really >> dude. I would die. I would >> No, it's it's fun, dude. You're going to like it. It's >> I I do understand Yeah, I do understand JK does stuff and that's about it.

4:57 >> Dude, wait till you find out about HL, dude. >> Oh, yeah. That's all the thing I learned. I forgot about that. >> No, I think uh as someone who really appreciates learning and explaining things and how do you like help someone absorb mental content and build their skills as quickly and efficiently and ideally pleasantly as possible. Something we do on the show all the time is like how do we make this stuff approachable, but also help you make a lot of progress in a short amount of time. You will appreciate the design of Vim Tutor if not anything else. All right, Vibhav was late, but we are 10 minutes in, so I'm going to stop yapping. Uh today we are going to talk about um something's been requested and we've touched on a little bit here and there.

5:34 But basically uh using AI to build really good product specifications. We're going to dive into Human Layer today uh and do it in there, but you can do this with any set of skills with any CLI. lie. to work a lot with HTML and mockups and things like this. Um but I'm going to hop on the whiteboard and Vybhav, let me get you the link to this so you have it. >> How much whiteboard versus real code are we going to or like docs are we going to see today? What do you think?

5:57 >> Probably about 5 minutes on the whiteboard and then we're going to get hands-on. >> Let's do it. >> All right, sick. If I said 20, would you have told me to [ __ ] off? >> No, I'm just mentally thinking how much input I should ever provide based on what your timing is. >> So, uh we have this thing uh this process questions started as like our PI, right? We had research plan and we've talked on this show about how we developed uh implement. Yeah, you're going to do that one, cool.

6:25 >> Yeah, I'll do it for you. >> Thank you. Finally, for once I'm not helping you use the whiteboard. >> Dude, I can do some I can do some ops work. Not very often, but every now and then I'm not too bad at it. >> Yep. Uh So, this is the the update on what's what's great in agenda coding. Um >> Crispy. >> Yes, QRSPI uh which this does not say QR structure outline.

6:57 PI, there you go. The design got dropped cuz it didn't fit in the acronym. >> Well, the D is silent. >> Exactly, the D is silent. >> [laughter] >> Damn, that would be a great shirt. Uh so, one thing we've done actually that I don't know if anybody noticed, but if you've been using Human Layer, we actually dropped the plan step and we just started using a smarter model during implementation. Uh gave you a lot more flexibility if you had to change something.

7:21 Um but the other thing that we've been exploring um and that I've really been like I'll talk about why we did this, but it's basically breaking this design step up into product design. When I say product design, I don't just mean the UI, I mean like the you know, uh this is going to be like uh user experience uh how do we measure success? We talked a little bit about this on the feature flags episode two of like being able to know if you actually made the users experience better.

7:48 >> Yep. >> And then like what does it look like? What's out of scope, etc. Uh and then we would get into the technical design, which is like system architecture contract between systems Uh what else? Uh and then also what I would call like program design. So this is like testing seams, function signatures uh etc. etc. Basically like And the whole idea of this is like at each stage you have less clarity and more leverage.

8:27 So the design you're at like 25k foot view of like, okay, here's kind of like where we want to end up. And then the outline is like the 10k foot view of like, okay, here's the kind of the shape and the order we're going to do the things. And then here's like the like live view of implementing and you actually see the code and things like this, right? Make sense so far? >> Yep. >> So what I want to walk through today is definitely this product design part. Um the reason why we ended up splitting this is because I don't know if you've used our design discussion stuff. It often without steering, it might default to leaning more heavily one way or the other, right? It might take the product input and just take it as given and not kind of verify it with you or it might like just do how does the user experience look? And it says, oh, it's all done. You're like, great, my design discussion is done. And then you get to the outline and you go to the implementation like this code is [ __ ] Like this is not what I expected. And you realize that you skipped the part of aligning on what is the actual like program going to look and how is it going to be laid out and like what files are going to change and all of this stuff. Does that make sense?

9:33 >> Yeah, you know what's really interesting on our team. I I love that you actually split this onto two things. Um I reflecting back on this and how we approach this problem. >> Yeah. >> We haven't split this on our process like this in our actual engineering workflow. We actually just have different things like design tasks and implementation tasks. >> Yeah. >> And what we basically do is our team like some person's job regardless of if they implement it or not is just to go design stuff. You spend like two or three days like iterating with the model and like iterating in like literally the RPI approach or I guess the crispy approach. And instead of the artifact being commits, it's actually a design spec.

10:09 >> And then that becomes the input to someone else's kind of implementation task and they get more into the technical weeds. >> Exactly. But it's like the service area is like well described. So it's very interesting that you But I think like we only do this like >> were doing is So you would see like product surface, the UX, the CLIs, like what is actually expected, and then you would feed that back in to questions, research, etc.

10:33 Except and then you would do a separate type of design where the person knew now they're actually digging into like, you know, preparing for implementation. >> Yeah, and it's like meaty. Like if you guys want to check this out, you can like >> Yeah, share your screen. Show us Show us Show us Show us an example. >> These design docs, let me find one that's actually interesting. Uh yeah, whatever. Let's do like testing asserts or like uh metrics.

10:58 Like these things are like meaty. Like there's 112 comments on this document by other people on the team. You can see like how much design goes into it. There's a lot of like just like There's also like technical conversation that goes into it. But a lot of API surface area gets discussed. A lot of how user interaction gets discussed. And this one is so meaty that we have like seven sub pages on it. And this is very rare. I think this is our biggest design doc today where we actually like literally evaluated against like every other possible way to go do the same thing.

11:28 And then we also have >> like other Eval providers? >> Yeah, yeah. Like we're designing like what we think eval should look like. And we literally then put it together and we then we have like the person on the team like actually putting together like true end-to-end examples that show the full thing. And you can see like the amount of detail that we go into. So, it's like it is basically just a design problem. At this point, we haven't even discussed any implementation details on how this gets >> at like if you're looking at like what do competitors do and you're building a matrix of like what do we want to do that they don't do and what are they going to do? What are we not going to do?

12:00 >> That's all product work. That's all what should the user experience be? What should we enable people to do and what should the like cuz this yeah, this is code, but this is what code would the user write, which is basically like >> Exactly. >> You're building a program. My version of that is like what is the web app look like or what is the CLI look like? But for you, it's like what does the user's code look like?

12:18 >> Yeah, exactly. And it's like it's really spending a lot of time thinking about like what the user's code looks like in like so many different things. Like when we wrote mock, like literally it's writing down what we think mock should be like when we go implement this. And there it's somewhere in there that is like there's something like prior art somewhere in here where we talk about like the heritage of mock. And like we talk about like different syntax and everything.

12:37 >> One challenge of this too is I think it's it's very when when like you're a very good engineer who also understands the customer in the domain and like a lot of dev tools have this have this blessing and curse where it's like well, you not only like understand how to build it, but you also understand what you want cuz you're building a tool that you yourself would lose that you you yourself would use. And I actually think there's like the reason why there's so many dev tools companies especially in SS is like it's cuz engineers that don't actually like care to learn the art of product management. Like the the like very pure like product management idea is like how do you build empathy for people who are different than you? How do you understand the problems of somebody which are not problems that you have?

13:22 And if you build dev tools, you don't have to do that. You don't have to learn how to do that. And it's like it's not good or bad. It's just like where do you want to spend your time? And it's why dev tools is so competitive is because it's uh it's cheaper to build things for yourself because you don't have to go spend a lot of time researching and talking to users versus building something for bankers or for veterinarians or whatever it is, right?

13:44 >> Agreed. Agreed. Um but yeah. >> Cool. You want to look at what we're building today? >> Yeah, show me. I'm excited cuz like this will make my life easier. >> I think you're going to like it. Um okay, we're going to go full screen. Uh AI AI that works circle of trust. If you see something you shouldn't, uh please unsee it and uh tell Vibhav in the chat. Um but this is uh if you've seen it, this is human layer. And um I'm going to kick off this PRD. So, I started doing the research for this already. I'll jump into the ticket, but I'm just going to kick this off so it can get working. Um but one thing that's interesting here is like this is our task page. And so, I can hide this and I can hide the sidebar. And this is kind of like how you look at your bundle of sessions.

14:26 And I've been thinking for a while that this view is like not super useful. Like an app that is just tape data tables is like not that great uh from a I don't know. There's just there's so much more we could do here. And so, we've experimented. We have this graph that kind of shows you the workflow and shows you the sessions and you can kind of like navigate into them here. Um but the ticket I've written is basically like hey look, we want to just like rethink some alternatives. There's like a sketch of one possible thing we could do and like how do how do we make it just a little more rich versus just being a table on the task page. So, maybe a little bit loop uh looping in on itself, but I want to use the tool to improve the tool. And so, what we're going to do is like look at this view holistically and try to see what we could do to um to make this view a little bit better, richer, more useful.

15:15 >> pure product This is a pure product question. So, it makes sense. >> So, I I want to do something that was product rich and was sort of visual. Um so, we've got our PRD skill here, which um you can kind of come here and read. Um but, you know, it's read read what's already in there. Um write the docs here, and then basically like do a minimal skeleton, and then like settle the foundation of like, "Hey, what are we building and what's the problem to solve?" And this is a really interesting one is like, "What does success look like? Like, what is what is business success look like and how can we measure it?" I think uh this is a really powerful concept that you can do when you're working with your agents. If you want to give agents a way to propose improvements and continuously improve your app, um ask them during building to work with you on how can we measure success?

16:05 Because then you give the agent a way to kind of look and see whether it's hey, we made this workflow 10% faster, or we increased conversion on this page, or hey, more people are using this feature, etc. Whatever it is. Um you should have some kind of if you can have not everything fits this model, uh but if you can have some kind of measurable goal, then it makes it a lot easier for you to just spin up an agent and be like, "Hey, go check the numbers and see what happened and like look at what the users are look at what users are doing and then decide if we solved the problem or if we need to keep iterating on this feature.

16:35 Um okay, so this is done. It's written the initial skeleton. >> Can you show us the ticket before you do anything? Like what what exactly did you put in the ticket? >> So, I put, you know, the title is task page session table alternative workflow outline with sessions and artifacts. Um we want to make the task page more than just a collection of sessions. What we really want is it for it to be a holistic view of what's happening and not necessarily need to jump into each session to be able to understand what's going on.

17:00 We'll explore a lot of different UI changes and how to wire wire wire the data in. Let's get creative. And then I just gave it a little bit of guidance on what the research should include. >> I really like how you um you really prompted it with the queue of creativity. I find that whenever I'm doing design tasks like especially like syntax design, yeah. >> And like I somehow have to push the model into the creative zone or else by default it doesn't tend to do that. And actually most most of the best creative ideas so far I haven't yet had a model go do that, but a model proposes really nice inklings.

17:31 And then I take and I assemble a new prompt with those things and I just push it better into the vector space that I need. >> Yeah, threads you can kind of pull on and nudge it. If you give it a broader, less pure thing, have it stay This is the other nice thing about the product side is like you stay high level about like what Okay, what does it look like? What does it feel like?

17:48 >> Yeah, I like this. Cool. >> So, okay, so we have a problem to solve. It's a time ordered list, not a workflow view. Artifacts are disconnected from the work that produced them. RPI phase progression already exists in the data. Understand status means opening sessions, which is like the freak. So, yeah, we want to basically pull more information out of the sessions so you can think about a task more holistically instead of just a bundle of sessions that you have to drill into.

18:13 Um that makes sense. Let's move on. Um and so this skill also we've we've designed it to be a lot more like question focused. So, if you look at this outline, it's actually been written just as a skeleton with the very basic like problem to solve here and we're going to kind of iterate one thing at a time instead of like if you use this before kind of we're experimenting with this. I think that the answer is somewhere in the middle of like okay, do we want to wait for every question to come in or do I want to be able to like scroll down like with one of these research docs, you can just scroll through this and add comments and give feedback and kind of move it through.

18:48 Um but uh we'll see what comes back. So, yeah, now now we're talking about the success definition. So, this is an exploratory UX change the lever should capture can user understand the task state without opening sessions. Um so it's given us a couple options, fewer dives into sessions per task visit. Um adoption engagement of the new view. Um I'm going to just skip measurements since this is a purely UI thing. Qualitative read, we'll do some user interviews.

19:22 With this. So, in this case, I'm skipping the, um I'm skipping the like deep metric stuff because I haven't really thought deeply about it, and you can always come back and stitch that in later. Um so, I'm dis- I'm I'm I'm ignoring my own advice, but this is also like the nuance here is like knowing when to use which tool, and knowing what problem you're solving. And today, we're really doing more exploratory stuff, so I don't care as much about like understanding metrics.

19:51 Does that make sense, Vaibhav? >> Let's do it. I want to see some UIs, man. I'm just excited to see some UIs. >> I know. I know. >> like when I when I whenever I see like, uh, UI stuff, I and this is what's interesting about this approach is like this PRD stuff is so fascinating because when I do syn- and I'll let you keep typing and making progress. >> Keep going. >> But like, whenever you do like language syntax design, what's fascinating to me is like the first thing I want to do is I want to see prior art. But almost instantly, right before I do anything else, like before I actually like actually think about the problem anymore, and I not even like a full prior art study, I just want to see like a rough prior art.

20:28 But then I immediately want to see some syntax right afterwards. And the reason I do that is because I want to see an emotional I want to feel something emotionally about that current status to then decide if I actually need to work on it more. >> Yeah. >> it comes to like this kind of stuff, which is like UI stuff, I feel like I instantly want to feel emotional about something, and the only way I can feel emotional about it is by seeing a new UI.

20:51 So, that's probably like my first thought on this is like I wish it showed me some UI immediately before I even started like chatting with it, so I could feel something, and then it would like almost like compel me to go have a conversation about it, so I'm not like detached. >> So we did we did have we did have that as the first step. Uh is the first thing you would see is a UI mock-up. And what we realized is like this is the classic like if you want to do product thinking, you really you really should start by understanding what problem what problem you want to solve.

21:24 >> Yeah. I agree. I mean, that's why I said I do like background work. With programming language is interesting cuz I have like a prior for most things. Like I know how to do things in almost every language. >> So we do have this one full screen now where it's kind of like okay, we're going to have a research where we have sessions and sessions and here's our artifact and then we have session two and here's our artifact. And so this is its first mock-up that it's done. Um >> Yeah.

21:49 So the task and the next task are grouped by task. >> Yeah. And then there's like an outline here which I don't love that there's an outline here and there's an outline here. So we'll see if it's going to do it again. >> Yeah. I looked at the >> what other what other insight that I would share here is like >> Yeah. >> A task is really not in like multiple phases at once. A task is usually kind of like in a phase and that's like the sub sequences of the phase and like I'm usually working on multiple tasks in parallel.

22:17 >> Yeah. And this is why actually I'll show you really quickly is we actually just added this Kanban board as well. So you can kind of break down your tasks. >> is what I really want to see for my task. >> Yeah. Yeah. Um so it's right in I think it did it write the second one. No, it's still writing the second one. HTML is a little bit slow. There's a lot of tokens here. Um oh actually no, this one's pretty short.

22:40 >> That's fascinating actually. I wonder what is a better way to do like I guess one could use mermaid, but mermaid is not rich enough. So it's really fascinating what if >> We do we do sometimes have mermaid stuff in here and you may see like in this doc which is like architecture of the thing. That was like the first step and then we realized we needed more. Um okay, cool. So it's made this one and then it's also showing me this option here where they're kind of more centralized.

23:07 >> That's definitely better than the previous one. >> Yeah, this one's better. Um so, I'm going to do my notice and then >> probably just tell it to like >> Let's get creative with a bunch more options. Like, task is only going to be in one's like stage at a time, so it probably makes more sense to have the later stages floated to the top. Um I also want to explore a view um where we use >> Um >> How do I say this? Where we have like an artifact-focused workflow where the sessions are kind of secondary and the artifacts are the primary thing that we're looking at. Um this could be tabs across the top for different phases of the workflow, and then you could see the artifact and the sessions for each phase. But, give me at least like three or four more options. Put them all in a single HTML file just for speed, and we can explore the four different options.

23:58 >> All right. >> Does that make sense? >> Yeah, browser Browser says something interesting where it's like what one of the Cloud Code Devs is having agents write HTML over MD files. And like, I agree. Like, MD files are just not rich enough to work on most things. I myself am like I'm hitting the limits of what I can do with MD files because like at some point a mermaid diagram just doesn't have the depth that I need to actually understand software control flow. And I feel like I'm fighting the system and not really understanding it.

24:24 >> I will say >> for something like this, like the research which is primarily designed for the model to consume, uh I do prefer MD because it's much more token efficient. But yes, in general, if you want to if it if you want to be human-facing, HTML is just so much more powerful. >> So, I think the real problem is that there's no standalone UI system that you can actually write like React. >> So, have you tried MDX?

24:49 >> I have. MDX doesn't have a does not have a solid rendering engine that is like shared and universal. It's like a thing, and there's no like spec for it so they're like you can't you basically have to invent Like the fact that you can't like import stuff makes a huge difference in how you go through this. >> MDX. It's like blending so you can blend like markdown with react and so you can just write this once and reuse it in a bunch of places and you get some like templating and this can be like I think some renders will even let you do like tailwind styles on this thing and then you get MDX in there.

25:22 >> I think yeah I think the problem is it's not standardized enough so the model kind of struggles with it in my experience and I don't have like I can't just like export and move my MDX files everywhere so I can like they're like broken half the time. Like my render on GitHub doesn't show it to me correctly like a bunch of stuff like that. >> Yeah. >> I think breaks the workflow for me. >> Yep.

25:41 >> And and that point I'm like [ __ ] I should just have like an MD file it's easy like the universality of an MD file I think is the nice part and that's the same thing with HTML. Like most things have a universal view of rendering HTML. >> Yeah. >> running MDX files requires you to have a react runtime that has an MDX renderer. >> That's true. Yeah it's a lot easier like this is just an HTML file on S3 being rendered in an iframe and anything can render this and I can open this in my editor and then I can let's see if I can actually no um Now I will open this in my editor.

26:15 >> Uh Bowser I hope you mean like MDX files on MD. There's no friction of using MD in my opinion if for like mostly text content. Uh your editor will not render HTML. It doesn't have a browser renderer built in. Cuz you need to have like a you need to have like a browser right? >> Yeah. Sorry I'm I'm taking the long way through this so okay so we have a switcher at the top where we have like the different phases and then you see the artifact. Um maybe a deliverables gallery but this one you can't actually see any of the sessions.

26:46 Um the pipeline stepper this is interesting this is kind of an extension or a like specialization of what we have with the um this like implementation graph here of like, hey, here's the steps we've gone through and stuff. Um but let's see. I don't know. Which one of these do you like the most? >> can you show me them again? Sorry, I cannot. >> Yeah. So, we have the like current whatever's current is like floats to the top.

27:16 >> Oh, is that by task? >> So, this is a No, this is a single task like the sessions and artifacts in a phase basically. >> I don't really care about that. That's like a useless bit of information to me. >> Um and then you have like the stages and the artifacts and then basically in the stage you get the sessions on the side but the artifacts are the primary thing. >> I like this more. >> Yeah.

27:40 >> Deliverable gallery. >> And then you have all the sessions on the right here basically. So, it's artifact primary. Okay. >> and then I can click on click on that. As long as I can click on that and open the artifact, that's probably like the most important part to me. >> Yeah, yeah, yeah, um yeah, where your task is basically artifact focus and the sessions are an implementation detail basically. >> Yeah, that's kind of what I what I find.

28:04 >> Okay, so let's do this. Uh let's settle on number three, deliverables gallery, but I would like it if um the sessions were listed kind of indented under each artifact instead of requiring to have the side side bar open to be able to see them because we may want the workflow graph in the side bar instead. Uh can you try a final uh mock-up with just that uh and then we can lock that in once I'm happy with it?

28:30 >> Also, leave a note to say that I want to be able to like open multiple artifacts in the same UI as well. >> Um >> Like So, like I actually find like opening two artifacts side by side is highly valuable. >> I also find that opening two artifacts side by side is highly valuable. >> Oh, nice. >> You're going to >> taking for gospel. Yeah. >> Anyway. >> Well, what we need is a I need a way to the to to stream your sound into my Superwhisper.

28:57 It would be pairing for This is the thing that we're also talking about building is like a audio uh like audio calling thing where like you can call me through the Human Layer app and we can have a conversation and then the transcript just can be like pasted in or becomes its own artifact. >> Um what Bowser said another interesting thing is like the only reason I don't use HTML over markdown is honestly just the fact that it's so token dense to send something useful over HTML that I can't that my iteration speed is going to drop by like 20%.

29:29 And again, 20% is totally fine if I'm only ever doing like purely asynchronous tasks. >> Yeah. >> But I actually can't work on like like right now I'm doing an extremely hard design task. >> Yeah. >> I literally cannot work on anything in parallel while I do it. It's like two like too much brain power for me to like context switch out. And the only time I can do uh like parallelism is like when um when I have like medium or hard tasks, but like extremely hard design design is like I cannot do it in parallel because like my brain needs to be focused on design.

30:01 >> Yeah. >> And at that point a 20% reduction iteration speed matters a lot. And then if it's easy, I don't often need >> if you're going to be single-threaded, you want to be able to loop as quickly as possible. >> Exactly. And I I will take the token efficiency hit and I will take the iteration speed if I need the richness. But that's like a choice, not a not like a thing that I want by default.

30:23 >> It depends what you're working on, right? If if you want the model to convey information to you in a more dense way that's easier for you to understand then HTML is right. But usually when we're writing these markdown docs, it's a little bit for my understanding, but it's more like I we're basically building the prompt for the next model the next session the next context window. And so if this is going to a model, then I absolutely want it to be uh then I want it to be uh >> Yeah, and I want like the percentage I want the percentage of tokens that are good.

30:52 >> Yep. >> To be like uh letter relevant, to be mostly about the content, not about the formatting. It's like if I need and one other thing that I do is like I actually rarely will actually feed HTML into the model. I'll often turn into an SVG or something else or like a PNG and then paste that in cuz the model will do better with that rather than like the actual HTML. >> Yep. >> Cuz again, HTML's like it's just one of the probably like the if not like information density.

31:18 It's like one of the most information dense formats out in the world. >> Yep. That makes sense. >> But once you render it, it's one of the most rich formats. So it's it's like this interesting thing where the raw file is kind of bad, but the rendered artifact is amazing. >> Yeah. Yeah, and and also the raw file ends up being like I mean, we talked about this even with writing like getting AI to write SQL. It's better to get the AI to write a JSON representation of the AST and then compile that back into SQL than it is to try to have the model write SQL. Or at least this is true a year ago. Obviously, models are very good at writing SQL now.

31:54 But it's like there's this intermediate representation that is like human readable and model friendly that you use and then you deterministically turn it into the final artifact. >> Yeah, like the models are really amazing at writing SQL now. So like um It but if I'm writing extremely a complex query that needs to be query optimized, probably would not expect a model to write that one shot. It's just not what it's good for. >> Yep. Well, that's where we get into the performance testing thing of like let the model benchmark its own work.

32:25 >> Yeah. That's fun. This is really cool. I like this new UI stuff and how you've been approaching this. I think it's very um It sounds very practical. >> Yeah, the also idea here is like we were looking to see it can we can we make this a process approachable for more like less technical people basically is like most of the questions here are not going to be about the tech they're going to be about like what it looked like and it's like okay cool can I make this like make sense to a PM and how they would normally work with a designer and like write up a product spec and use basically like this is obviously not going to replace Figma but it can do a lot of the like early work while it's cheap.

33:06 Um >> [snorts] >> Okay. Let's see. True authorship. I'm actually not going to run through all of these questions cuz I actually want to jump into the next phase here and we can look at the TDD stuff too. So I'm going to go ahead and create TDD here as well even though we haven't like fully finished the PRD I'm going to just like start walking through that one as well.

33:39 Um let's see. So yeah here's our here's our outline and it's got our mock-up in it and then the model's going to go through and it's going to start updating to the latest one by default. >> Um yeah so I told it let's lock this one in and then it put that one in the actually referenced in the doc. So if you if you view the raw here it's just able to like reference and inline these artifacts here with like a special syntax that it knows about.

34:02 >> And that basically tells it to >> this to my teammates and they just read it like they would read a Google Doc or any other kind of spec and they can say you know I can come here and put a comment on on the artifact and say like I don't like that this has etc. etc. >> Yeah I get it I get it. >> Um >> Nice. >> So that's kind of the idea there. Um >> And the idea is now that you've done this now you can have like a technical design discussion right after that.

34:30 >> Yeah and I'm going to skip a couple steps here because I'm going to say let's jump straight to program design. This is another thing we've added in. What's your first question? I take whatever recommendations you want for the >> [snorts] >> the system architecture. We'll just queue that one up. >> So, I have a question. I think this is probably very fascinating to many people. You're generally very good at thinking about agentic systems.

35:02 Where do you How do you and your team actually come up with these new processes, these new ways to break down the problem? Is this a intuition thing? Are you guys measuring this? Are you guys like just like one of your engineers stops using the standard workflow, so then you're like, well, what's the workflow they're doing? You discover this organically. Like what's the process here? >> There's a little bit of that. It's I mean the TDD stuff will come comes a lot from like friction we hit where it's like the design discussion looked good and then we got into the code and it was all wrong and we're like, okay, well, then like we're not doing our job of giving you leverage, right? The whole idea is like you should be able to work with a model to get to a point where you're happy, like where the outcome at implementation is very likely to be correct. Because if you have a situation where like you build a TDD or a design doc and then an engineer looks at it and they say great and then you actually get the pull request and they're like, this isn't what we talked about or like this has a bunch of decisions in it that weren't made. And so like our goal one of our goals is, you know, can we can and like what I think your goal should be as an AI like agentic engineer is like, how do you solve the problem of there's like way too much code and way too many PRs? And one of the answers is have AI review the code, which can only get you so far. Or just merge without review and just don't read the code, which I don't I'm I'm sure you all know I'm not not in favor of.

36:24 Or you have this option of like, okay, how do we make it so that when the PR lands, it's already 99% correct or 95% correct and so it doesn't need a ton of rework and so it's very the review part is very easy. You know you know what I mean? >> Yeah. And I mean I agree with that. As a philosophy thing like like what I what I really like for example, this was probably one of my favorite things in the PR that you guys did that I would I I just wouldn't have done.

36:50 Which is like when you guys make like a pull request out of riptide, part of what you do is you actually like go and see what deviated from the plan and there's like a process to go do that. >> Yep. >> What I actually reviewed was that section of the pull request every single time. I was like I want to know what deviated from the plan and that's just useful for me cuz that's how I found bugs.

37:08 >> Yep. But if your plan's not specific enough or your plan doesn't settle some of the things, then the PR's just going to be whatever the model chose. >> Yeah, but see the thing that's fascinating to me is actually not the plan at all. It's the fact that you chose to add that step as a part of the pull request process where like tell me what's different about the plan than what I implemented. And by standardizing that, that makes it really easy for me to guarantee that I expect that every time and now the quality of my like like you said, my verification loop got faster because instead of having to read all the code, I just look for that and I was like if something ever surprised me, I either throw it all out and start from scratch and make a new plan or I go iterate with it until it's correct or I say oh that's fine like that's I can live with this consequence and like that's actually what I found very fascinating. So it's like I think what I'm really taking away from this and what I think other people should take away is the way that you make these systems better and like invent things like the processes that you are you guys are at human layer is >> Yep.

38:07 >> I think thinking really hard about how do you how do you like remove the cognitive burden of reviewing stuff later and how do you move it earlier in the pipeline? >> How do you move it earlier where you have where you have more leverage and it's also like the long the further you are in the pipeline, whether something's broken or it's just done wrong, the more tokens of surface that you're reasoning through, the the harder it's going to be for the model to get it right or to identify the right problem. You'll notice in both of these, we've made quite a lot of decisions, and we're only at 70k tokens, which means we're like squarely in this and I'm going to be able to go back and forth for a while and still be like under the 200k tokens.

38:48 Um >> Yeah, that's very fascinating. I I hadn't thought of it that way. Um it's just like the things you do at the later stage or is more of like verification more so than anything else. It's like how do you add verification to later stages and how do you add uh like like I think breadth coverage at the earlier layers is kind of like what I'm hearing from your prompt processes. It's like >> Yeah. >> move away to either spectrum and do one of those two things.

39:16 The earlier you are, do more breadth. The later you are, do more verification. That's um that's a really good takeaway. I think uh I'm I feel like I know how to design my um prompt not just like workflow better, but actually like my even like pipeline pro like for my agent, I feel like I would think about my prompts differently now. >> Yeah. That's a good Yeah, you know what I mean? >> Like I think this is legit.

39:42 >> Go ahead. It's a classic AI that works where we're both shouting over each other. That's how you know it's good. >> I I want to hear what you have to say. >> Uh no, I was going to say like the other thing we do to figure out what needs to happen is we go sit with our customers and we watch them use our product and we talk to them and we hear from them where the friction is and where they're like, you know, we have this promise of hey, look, we're going to make your PR review better, but then it doesn't actually happen. There's still a lot of unknowns.

40:07 The model still makes mistakes. And so one of the things we've been doing is like getting into the details of program design. Uh how do we give you high without reading the code, how do we give you something high-level like this that helps you reason about the call stack and where things are being done before you actually go and read all the code because this is going to make sure that it's at least more directionally correct, basically.

40:30 >> Yeah, I like this a lot. This workflow in general is fantastic. I like the way it approaches this problem. >> No provider, use a TanStack DB query, add a new collection if needed. So, I mean, we're rushing through this cuz this is a short episode and like I didn't actually review the system architecture, so it may have made some like mistakes there, but you get the idea of like, hey, look, now I'm going to get into the details of like, how does this actually look and make sure that things like test seams and dependency injection and like where we're making the things and even how the files are going to be laid out on disk are done really cleanly and they're all represented here faithfully in the program design.

41:14 >> This is cool. >> Nice. Yeah, I mean, I I we we can keep going on this, but I'm happy to open up to questions. I will I will pop back and I'll I'll stop sharing and we can just chat and then maybe at the end we can we can go and actually look at the docs. >> How long are you guys spending on this redesign? >> On the redesign, like the the feature we're working on or you you mean the new the new like prompt skills?

41:38 >> Yeah, the new prompt skills. Like, how long does it take for you to like learn and then like deploy and like make these updates? >> So, we like to get a man and start using them immediately. I think the first PRD TDD workflow made it in probably like a couple weeks ago based on some stuff we're chatting with with one of our larger customers where it's like, hey, if we get the PMs to engage here, then we're doing more than just AI for the coding. We're letting AI kind of do code-based grounded decisions about the whole thing.

42:06 I think on Sunday night we shipped this new version, which is a big kind of overhaul to how it works. Um and we added this program design section, which I think is the really interesting one of like, hey look, if you really care about code quality, if you don't you don't give a [ __ ] about the code, you shouldn't use any of this, honestly. But if you care about code quality and you want to like head those decisions off and build a lot of confidence the model's going to do the right thing. Like this first question that it asked me of like, hey, do you want to use a provider or do you want to use a, you know, a um TanStack collection? Like the number of times I've seen the model, like we did the design, we did the outline. I'm like, this all looks good. It goes and implements the first phase. I'm like, why the [ __ ] are you introducing a React provider? Like we don't use React context. We explicitly try to avoid it for almost everything because we have Zustand and because we have these collections and like there must be a very special but the models don't know that. The model's just like, cool, I can use use effect and providers here, which are like patterns that we find make the code base really hard to reason about.

43:03 And so now I'm heading that off earlier on rather than what we used to happen, which is like I would write the whole PR and then be like, oh look, it's done and tested in between each phase and then I go look at the code. I'm like, nah, this is never getting merged. >> Exactly. Yeah. That's fascinating. It's uh and yeah, like Claude MD definitely doesn't suffice for this. Like Claude MD will always become out of date. I actually stopped having Claude MD in our repo because like I don't have Yeah, cuz like stuff just gets out of date, man. It's not worth it.

43:29 >> Do you want to see our Claude MD? >> Show me. >> It's >> Is it make no mistakes? If it's anything more than make no mistakes, >> or ultra think. Let's see, what do we have? So we have the mono repo structure of just like what everything is so that I can I can say linear CLI and it knows what I'm talking about. Um that's like that's actually the biggest part of this is just like what are the names of the projects and where are they?

43:51 Um we have some instructions about like how to run the tests and checks. Uh how to run the tests for a single package, how to like actually do database migrations if you touch a database, how to query against our local dev database, uh how to check the logs in local development, how to use browser automation skills, how we like to think about work trees. Actually, this should be probably removed cuz we don't really do this anymore.

44:19 Um the MCP that we use to research libraries. There's like a little bit here. Um >> That's so fascinating. I have a I have a Yeah, like I have a totally different approach here. Uh and like the main thing is just like I find that having more stuff in the Cloud MD just guarantees failure. And because like >> this import if syntax. This is This is This seems really useful in terms of like giving the model permission to ignore the instruction. Um And basically like it's like activate this in specific cases, but don't otherwise. It's very like the poor man's skills system.

44:58 >> Yeah, yeah. >> But um But yeah, you don't You don't like the Cloud MD, huh? >> I'll show you actually what we do if I have my Like we have so It's not like we don't have files in a repo that are useful. Like we have this arch header MD file. >> Okay. So you can point it to specific files rather than having it always loaded every time. >> Yeah. And the reason for this is like basically it's like I think my theory for this and you'll notice what it actually does. This arch header MD file does not have any context around what it is.

45:27 But it what it makes mostly tries to answer is like this. What lives here or what doesn't? And that's really what it tries to go do. And it gives you examples, but it gives you like what should not live here. And the key part is just like If you add a new language feature, can you decide what part of the code base it should live in? And there's like rules at the bottom. >> Yeah. >> That are like uh What is this? And it talks >> lot of tokens. How often do you end up pulling this into context?

45:51 >> Well, anytime you're doing like a language design, you have to it touches a It basically touches the whole code base. Like you can't Like you go through the entire compiler. Like >> But what if you're not Like what What percentage of your features are new language features versus like fixing bugs? >> never load this in. Exactly. So if you're If you're fixing a bug, you don't have to load this in. But and like there's basically like this is the most important part. It's like it always prefer to add a feature upstream whenever possible.

46:18 And right and it basically like tells it it's like don't do these things. Like don't change these layers. Do not touch them. And like basically never add a new layer. Right? >> All right. Everything lives in the AST. Yep. >> Basically it's like it's just like just move stuff higher up cuz it prevents it and like it just prevents the model from making a mistake. And also like this is a good rule of thumb for a human to also know. It's like very easy to remember. Like add stuff in the AST when possible. If If you need to add the HIR or the TIR, probably don't mess with the MIR or the emit layer. And like definitely almost definitely don't add a new layer.

46:57 >> [laughter] >> All right? And we say almost cuz there are there are times in which you have to and we've had to, but it's like >> Yeah. >> like please pretty please don't kind of thing. >> Yep. >> But this really prevents the model from like skewing, but like this is very important, but it's only conditionally important. So it's way easier to just have an architecture MD file that the model like sometimes reads if it deems important.

47:18 >> Okay. >> And then it has like more tokens. But like I don't really care if it reads the whole thing. Like reading head 100 is like basically gives you all the things on here. And there's like we have a new doc that's coming in that's like our type system. And this prevents the model from like whenever you are making changes or introducing bugs, like this is very important. Like it actually tells you like what the semantics are.

47:36 >> Yeah, cuz every I mean sorry, that's like writing a feature that would just introducing bugs. >> Yeah. >> Adding any feature basically introducing bugs. Uh but anyway, it's like our type system is complicated. And having a model have like a single document that actually describes like the mathematicalness of the type system and where it fails, where it doesn't fail. >> and everything, yeah. >> Uh the grammar actually doesn't matter. It's more about like what are the coherence rules? What makes like what makes a thing representable versus not representable?

48:04 It's kind of tricky and like understanding like what errors that will happen and what like what generics Like that's a baseline system that's useful for the model when developing new test cases and stuff. >> This is cool. >> So it's all like it's like a different kind of approach to this, but I've personally found the like a universal I just haven't found a good universal Claude MD that works for like every type of feature we're working on and therefore like it skews the program more incorrectly than correctly most of the time for me.

48:33 >> I like it. Yeah, I think one of the things that we're looking at is this idea that I got from uh a guy at a big grocery delivery company and they um he he came up with this term he calls context shards where it's like hey when you're building you he has like double digits like 60 or 70 of these things and basically like during the research and design process it's the model's job to identify which context shards are useful from the entire set and then when you do your new session for implementation it loads in those five to 10 shards per phase basically and they're small they're small snippets you know they're like a paragraph or like a couple examples.

49:14 >> You know what I think would be phenomenally good for a model? >> Yeah. >> think you guys should think about this. You know how .env works? >> Yeah, when you go in a directory it loads instructions. >> It loads environment variables for you and like sets that [ __ ] up. >> You know Claude MD does that. >> No, it doesn't. >> Yeah, if your Claude touches files in a directory it loads that directory's Claude MD.

49:36 >> Um but it needs to be conditional and able to override my existing thing. >> What do you mean? >> Does that make sense? >> Oh override envars? Like override other >> Yeah, cuz well that's exactly. >> Oh so you don't just want additional instructions in the sub dir. You basically want to say like okay if you're working in this directory, the system prompt changes and this advice is no longer valid. It gets replaced and you need kind of a like substitution key almost."

50:00 >> Yeah, that's kind of what I want. I think that's what I really want is like and it's I wouldn't even say it as advice changes like maybe the advice becomes more specific. >> Yeah. >> Is like a better way to think about it. It's like you increase specificity as you do things. And I think that's probably what would be like super fascinating to me and like a harness system. It's like how do I like uh make my Claude MDs feel a little bit more dynamic and alive is like the better framing maybe.

50:29 >> Yeah, I mean Cursor has versions of this. Like the I think even Claude rules supports this, but it's a very under adopted feature. I don't know anyone who uses Claude rules. >> Well, it's inspired by Cursor rules and yeah, they both have this like front matter syntax where you have to basically say like, "If you're in a file that matches this glob pattern, then activate this rule." And then it's pretty much your system prompt. >> and then I don't want to think it's like I don't want to like Duran works because I just write exports and like like I do with .n files and just works. I don't think, I just do.

50:58 >> Interesting. So, rather than having a bunch of like front matter with globs, you just want to put them in each folder that matters. >> Yeah, and then as you mess around with things, it just tells you stuff in a very interesting way.

Summary

The podcast episode discusses the integration of AI in developing effective product specifications, emphasizing the importance of separating product design from technical design to streamline the development process. The hosts share their experiences with agentic coding, exploring how to enhance workflows and reduce cognitive load during implementation.

- AI can help create more accurate product specifications by shifting the verification process earlier in the development pipeline.
- The design phase should be split into product design (user experience and success metrics) and technical design (system architecture and implementation details).
- Effective product design involves creating mock-ups and defining measurable success criteria to guide development.
- The hosts emphasize the need for a holistic view of tasks, moving beyond simple data tables to more interactive and informative UI designs.
- Continuous feedback and iteration are crucial for refining product specifications and ensuring alignment between product and technical teams.
- The conversation highlights the importance of understanding user needs and reducing friction in the development process through better design practices.
- The hosts discuss the challenges of maintaining code quality and the role of AI in facilitating better decision-making during the coding process.
- They advocate for a more dynamic approach to documentation, allowing for context-specific instructions that adapt to the development environment.
© transcribe · For agents Built with care and craft by Gokul Rajaram