در حال بارگذاری ...

Chunking vs agent workflows0:08

Up to this point in the course, I have encouraged you to break things down to as smaller chunks as possible. That is because the bigger the task gets, the more steps it is, the worse the LLM is going to perform. Remember the golden rule. Now that being said, I don't want to undermine the hard work that a lot of people have put into agentic processes that are able to handle complex multi-step flows with lots of tool usage. That is what Cursor is. That is what Codex is. That is what Claude code is.

That is what Cursor is. That is what Codex is. That is what Claude code is. These are very, very advanced agents that are getting better and better at multi-step flows. And so the last feature that we built inside of Winder was fairly basic and I wanted to start with something simple. I don't wanna lie to you though and say that every feature that I build is a single shot prompt That is something very

Using plans for complexity0:49

and say that every feature that I build is a single shot prompt That is something very small that you don't need a plan for. When I rail against PRDs, it's really the idea that you can build an entire customer ready product that is anything but super simple from a single prompt in a single PRD. You really can't do that. That being said, I often do employ plans. You can call them technical plans,

I often do employ plans. You can call them technical plans, you can call them PRDs if you want. Although PRDs are a little bit more audience focused than I would like to go into here. We'll just call them plans. I do utilize plans quite a bit when building more advanced features. If we look inside of Window for instance, I have been tinkering with this idea for a feature, um,

Defining Brand Central feature1:23

If we look inside of Window for instance, I have been tinkering with this idea for a feature, um, that we'll call um, something like Brand Central. Um, so the idea is if you look at my document here, I have this made up business that I've created called Josh's Pizza. And it has some resources. It has, you know this name. It has a couple of photos that I've generated inside the product. Uh, if you go inside of images, you can

that I've generated inside the product. Uh, if you go inside of images, you can generate a custom image, you can upload your own images and then additionally inside of the properties panel you can add uh, project context. Here you can describe your brand, describe your company, what it does, the sort of language that you want to use, and even design stuff. You can say your brand colors, you can describe them in there, your voice and tone.

You can say your brand colors, you can describe them in there, your voice and tone. Like anything you want to tell the LLM during generation you can put into these tabs. And I've been thinking that they're a little spread out and it would be nice if I had some sort of brand central button up here that you could just pull up and work on all that stuff at the same time. That is a speculative feature. I'm not sure that I'll ship it,

That is a speculative feature. I'm not sure that I'll ship it, but I would like to play with it. That is the perfect kind of feature that I would build a plan for and that is because it is complex in nature, there is a ton that would go into taking that functionality from the sidebar and then duplicating it or migrating it up to a brand new experience. And so I have written up here the prompt that I would run

or migrating it up to a brand new experience. And so I have written up here the prompt that I would run to generate a plan to do this. Plans are extremely helpful when you're building anything complex, it forces the LLM to be in thinking mode. It forces it to say what am I going to do first and to really do all the research. And so you can either tell it to plan, I often do that. If it's sort of a medium task, I will ask it in Ask mode. Okay, just generate a plan

Prompting for technical plan2:58

If it's sort of a medium task, I will ask it in Ask mode. Okay, just generate a plan and then directly from that chat execute that plan. We've seen me do that a little bit in this course, but I do it more explicitly uh, on a regular basis. In this one though, I wanted to show you the thing that I've told you a couple times, which is that I actually generate a markdown document. So here's the prompt that I have sent for this. I want to make a new feature called Brand Central.

So here's the prompt that I have sent for this. I want to make a new feature called Brand Central. It should be linked to in the top bar of a file in between the Winder logo and the file name. So I'm telling it where to put stuff. The button should open a modal that shows all the images from the images tab and the additional project context feature from the properties tab. And notice how I'm passing those in as I type this prompt.

from the properties tab. And notice how I'm passing those in as I type this prompt. Again, this is where vibe coders unfortunately, sorry, you need to understand the code. At the very least, you need to understand the files that are involved, uh, where the related functionality that you're referencing is because that's just going to make your prompts so much better. You are a context manager. If you don't know where the context

You are a context manager. If you don't know where the context lives, you're going to fail. So I'm doing that. The user should be able to add and remove images and update the additional project contest. All of this functionality is duplicated from the chat sidebar tabs. So we don't want to duplicate all that code. Notice that I'm explicitly telling it. We'll see if it works not to duplicate all the code

Notice that I'm explicitly telling it. We'll see if it works not to duplicate all the code 'cause that's what it would do out of the box for sure. It needs to be shared between them. And if you add content at one, it should show up in the other. Here's where I get into the plan. Write a detailed technical plan for how to build this and put it in my ideas folder. I just have a folder that I just recommend that you create.

and put it in my ideas folder. I just have a folder that I just recommend that you create. It's called ideas. I do stuff like this all the time, even if I'm going to get to it later. Sometimes I just wanna be an ideation mode and I create a bunch of plans and throw them in there. So make sure the modal is nicely designed with clear ux. It should look and feel similar to this other modal that I have. I wanted to look at that use similar components and layout.

Switching models for planning4:38

to this other modal that I have. I wanted to look at that use similar components and layout. So I'm going to run this and we'll come back and see what it looks like. Alright, so we're back and we have a plan in place. I did go back and rerun that prompt with Gemini 2.5 Pro. I just like the plans that it creates. I feel like it does a really good job at digging into the technical details. Um, so I didn't like the plan that I came up with at first,

into the technical details. Um, so I didn't like the plan that I came up with at first, so I just changed the model. And the model is Gemini 2.5 Pro. Again, you should play around with different models and their results as often as possible. They're in there and as long as you have access to them and you're not burning tokens, uh, that you pay for per token, uh, you know, with your own API key, there's really no reason to not, uh, play around

for per token, uh, you know, with your own API key, there's really no reason to not, uh, play around and try different models. I personally like Gemini 2.5 Pro as a planning model. It just does really good at that. So it came up with a bunch of stuff here. It talked through state management. Um, it did come up with the, uh, a plan for centralizing some of the logic. This is why I picked this feature

for centralizing some of the logic. This is why I picked this feature because it involves quite a major refactor of logic in a way that LLMs typically fail at in a big code base. And I have well over a hundred thousand lines of code here. Refactoring is pretty tricky. And so moving logic out of one file and into another at this scale is going to, even if a human engineer did it, it's going to leave features behind.

even if a human engineer did it, it's going to leave features behind. It's going to break stuff. And so I'm interested to see if we can get it to plan well enough that it does that. Now I did notice that it doesn't, didn't come up with any tests for that actual functionality and so I might try to uh, change this plan a little bit and say add a few simple unit tests for the image

and say add a few simple unit tests for the image functionality as it currently exists so we don't break it. So I'm gonna say that it should add some unit tests. I'm, I've done a bad job there. I probably don't have any tests around some of that functionality. So if we add some basic tests around that functionality, then we can be more aware that it's, it has broken

So if we add some basic tests around that functionality, then we can be more aware that it's, it has broken or that we've removed a feature unintentionally. So I'm gonna let that run for a second. It should update it pretty quick here. Okay, so skipping ahead, it did includes a Munich test in here. Obviously I need to read through that and all of this in detail before I run it. I need to make sure that it's really good.

and all of this in detail before I run it. I need to make sure that it's really good. So I'm gonna take some time to do that. Make sure that it does what I want. Uh, in my typical flow, I'm also going to see if I can break it down at all. Typically, uh, I'm going to try to one shot this just for fun on this uh, video just because you know, you always try it, you definitely want the dream to be true

because you know, you always try it, you definitely want the dream to be true that you can just make a big project plan for a bunch of stuff that you wanna add. You wanna click a button and then you wanna go eat lunch and come back and it built the feature. That would be great if that's the case. I expect here we'll have some issues with that, but we're gonna try it for fun. What I typically do though is I do try

but we're gonna try it for fun. What I typically do though is I do try to find the individual shipable features if I can. If I can ship an end-to-end flow that's a subpart of a bigger feature, I definitely wanna do that. Maybe you feature flag it to only a specific user, your user or you just ship it to everyone and then wrap it in a larger feature late later. Or at the very least, even before you ship it, you sort of break it down into phases

Executing plan in one shot7:40

Or at the very least, even before you ship it, you sort of break it down into phases that the LLM can focus on, uh, in dedicated chat. So I'm going to in here, try to yellow it. I'm going to start a new chat. You know, you gotta start a new chat. We've talked about that golden rule a bunch of times and why you have to do that. So I'm going to at mention this brand central technical plan.

So I'm going to at mention this brand central technical plan. So we get all the benefits of doing all of that planning and all of that context that we chewed through. Now we have this technical plan, um, in place that will serve as a lot of the, the tokens for that context. Um, and so I'm just going to say implement this plan in, its in entirety. There's the yolo,

plan in, its in entirety. There's the yolo, I don't know if it'll work, but we're gonna try it. Um, and so I'm gonna go in here GPT five. I've been having a lot of success with it lately. We're gonna give it a shot. Let's see how it goes. Alright, we're back after that one giant prompt. Let's see how it went. Now I will say halfway through, through the prompt, it's stopped. The bot simply said, I'm done with the first part.

through the prompt, it's stopped. The bot simply said, I'm done with the first part. And then when I came back, I actually went away and when I came back it was waiting for me to go to the next one. This is just a testament to how big this sort of lift was for this feature is that it didn't even get all the way through it. But because the plan was nicely organized, this is one of the benefits of creating plans like this, it was able

But because the plan was nicely organized, this is one of the benefits of creating plans like this, it was able to stop at a pretty good point and then pick up where it left off. I think if you just look at what I typed in here, it's let's go. That's what I said. Like it said, okay, we're done with this part and I just said let's go. And then it completed the rest of the steps and it's a little to-do list.

And then it completed the rest of the steps and it's a little to-do list. And so if I jump over to winder, I will just say that at a high level, this is a testament to how fast this technology is developing because when I first started building winder months and months and months ago, there was no model in the world that could do all of this in one shot. I guarantee you what would've failed. Um, but it turns out that in that one shot,

I guarantee you what would've failed. Um, but it turns out that in that one shot, it actually did a really good job. Now I will say it's not where I asked it to put it. I asked it to put it over here somewhere, but it noticed that there were buttons in place here already. Um, you can see I have some buttons in here and so it just put 'em there. That's fine. I can, I can understand

and so it just put 'em there. That's fine. I can, I can understand that it's not exactly where I wanted it. Um, and I will say that it's ugly, so I don't like the way it looks at all, but that kind of doesn't matter. We can in the next video dive into how to get this looking good. How do I design with AI is its own sort of subject. So I think it would be good to visit that

How do I design with AI is its own sort of subject. So I think it would be good to visit that and to not try to fix this right now. Um, just to acknowledge this is ugly. This is not at all what I want it to look like, but in general it does the things that I want it to do in a single shot. And it was a fairly large prompt or a fairly large lift for, you know, getting all that logic into, uh, a different component

or a fairly large lift for, you know, getting all that logic into, uh, a different component that was abstracted and shares the logic between the two. We'll go in and make sure the images tab still looks all right. Obviously I need to do a lot of testing in here, but at a high level this looks like it did a pretty good job in a single prompt. The thing that I want to push here is that it probably would not have done this if I would've just

The thing that I want to push here is that it probably would not have done this if I would've just done a prompt to say go do this. The thing that helped it here is that we created a technical plan. Again, it's not really a PRD 'cause I'm a product manager, so that means something very specific to me. But this is more of a technical plan. This is an engineering plan, um,

But this is more of a technical plan. This is an engineering plan, um, that talked about very specifically the logic that was involved currently and where it needs to go and how it needs to work. And when the LLMs have something like that to go off of, you find that their success rate is much higher, especially in something like GPT five, which is a thinking model. When I first started building winter,

which is a thinking model. When I first started building winter, there was not a GPT model, especially I had to use GLOT all the time because no GPT models were good enough to code with. And so it is just a testament to how fast this stuff is moving. Keep testing all the new models as they come out. You'll find that it gets easier and easier and easier to five code the stuff that you're able to do.

You'll find that it gets easier and easier and easier to five code the stuff that you're able to do. For any skeptic that says this stuff does not work, the stuff that you're able to do really has dramatically increased and only the, the past few months. Um, you can argue all day about whether the models have hit a plateau or not. But as far as I'm concerned from where I'm sitting, every time a big new model release comes out, my job gets easier.

every time a big new model release comes out, my job gets easier. Building winder gets easier. So yeah, I'm super happy with that. Go ahead, build plans for big new features. It's a very useful way to structure out your own thinking, to structure out what the LLM needs to do. Uh, and next video we will look at how to design that thing because it's super ugly right now. All right, see you there.

because it's super ugly right now. All right, see you there.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟