Cursor & Claude Code: Professional AI Setup

Running a Plan Through a Subagent

Steve Kinney
Temporal
Cursor & Claude Code: Professional AI Setup

Lesson Description

The "Running a Plan Through a Subagent" Lesson is part of the full, Cursor & Claude Code: Professional AI Setup course featured in this preview video. Here's what you'd learn in this lesson:

Steve uses subagents to evaluate the tRPC refactoring plan discussed earlier in the course. The results are reviewed, and Steve highlights how the question/answer dialog between the subagents helps identify issues or reasons the plan may not be possible and should be abandoned.

Preview
Close

Transcript from the "Running a Plan Through a Subagent" Lesson

[00:00:00]
>> Steve Kinney: Let's try it out. I might have to like. It'll probably take a while. So let's kick it off and we'll kind of check in on it in a little bit. Where's my terminal? Did I make it small? We're not in the right app. All right, let's make that big.

[00:00:17]
Look, it thinks it's ready to do it. Let's make it, I'm just gonna clear this real quick. I'm gonna grab another one of those plans. Let's say. Doesn't really matter which one we pick. Let's actually pick that same TRPC one. Just for funsies. I'll actually open up another window.

[00:01:00]
We'll make an agent as well. But we'll kick this off so we can go check, provide answers to those questions and write both the questions and answers to I don't know TRPC md. This is why no one would like to share Git Repo with me. Cool, so it's gonna go read that.

[00:01:28]
You should see some colors in a second where it passes off. There's junior engineer JavaScript yellow. Felt good. I forget what color I picked for the other one. Doesn't matter. Junior Engineer is going to read all of it. You can see that only Junior Engineer is going to do that at first and then it's going to pass it over to the other one and then we'll see what comes out.

[00:01:45]
I don't know. Well, anything could happen. It could be a waste of everyone's time. Or not. In the meantime, we're going to open up a second one of these just to show you how we can make one of these. So do cod and I'm gonna say /agents, plural.

[00:02:02]
So here you can see all the agents that you have and you can say create new agent. And we can say project or in my home directory, let's say project. In this case, generate with Claude and you kind of just get a sense of what we might want to build.

[00:02:21]
Does anyone have any ideas? Otherwise we're doing DevOps agent. No one's gonna like that. Be a non technical user. Non technical user. A non. What do I have to do that's testing the app or something. All right, let's do it. So then it will go ahead and generate the agent configuration.

[00:02:54]
And so one of the things you can do. So for instance, I'm thinking that our non technical user and we can actually get more granular, should not be able to write or edit any files, right? Maybe they could read plans. They should not be able to get us out of plan mode.

[00:03:14]
Honestly, a non technical user shouldn't be able to do a lot of things. Maybe give it web fetch. No, you're not a product manager. You can do web search. You can't do execute code. No, you cannot. You can give it kind of a set of tasks that you think it should be able to do.

[00:03:38]
And then the most important part is the color. So yeah, it will kind of give you a draft and I'll show you the one thing that I think is a little squirrely about this in a second second. But you can kind of, let's actually just look at the file.

[00:03:57]
So hit enter to save it and then over in agents you can see we have a new one not checked into git. So let's go take a look at that. And I don't know why it decides for a YAML front matter description this is where it should shove the bulk of the content.

[00:04:14]
I don't make the rules around here. That seems like a lot of extra stuff that I can barely read because of the way they chose to format it. But like I don't make the rules around here. And then it Claude generated its Persona. Like this always frame feedback in terms of user impact.

[00:04:34]
Users might get confused because this could frustrate user trying to. And it gives it a nice set of constraints to kind of come in there as well. And now you have access and all you have to really do is mention it by name and then the main agent will farm something out of it.

[00:04:52]
Just as we saw junior agent was engaged in that terminal window we had earlier. And then we probably will see if we go back our friends are done. So again to be clear, I don't know how this is going to go. I'm interested. I've done this before and I've been pleased.

[00:05:13]
But I can't promise you I'm going to like what I see in here. For a feature that came out a few days ago, those are all my crazy tool uses from before. Let's close that, buy ourselves some space. Okay. I'm kind of into it, right? Obviously like you know, one needs to look at this a little closer.

[00:05:37]
So like I said before, the test that we gave our sub agent earlier was the junior engineer was told to question everything as the person who's gonna be on the hook for doing it and clarify anything that was unclear. And then theoretically the front end architect answered the questions.

[00:05:54]
Now I think this is useful for me to figure out where. My own thinking is unclear. I wouldn't just feed this in somewhere. This is like the next step is for me to read it. The current auto generated tool system, which I built with eight content tools, poses significant integration challenges.

[00:06:13]
How do we maintain the current bundle and generate tools? Blah blah, blah, blah blah blah. Create a hybrid approach, extends your tool system rather than replacing it and suggests what that code looks like. And again, if you've never seen my code base or TRPC before, don't worry about it.

[00:06:30]
But the interesting part is this is like I've said before, I think generating code with AI is interesting and makes some cool demos and I think it's definitely take some of the side projects and do it for me. The interesting part has been one questioning my own thinking because when I sit down and read this later, I will either be like absolutely not or yeah, or I'm missing something here and I will integrate that into the plan.

[00:07:02]
Like I said before, when I wanted to learn more about how Claude code works, I grabbed the minified code, tossed it into a model that had a giant context window like Gemini or 03 and it was the minified code. I'm like, I can't tell you everything, but I'm like, what is the moving pieces and shape of this?

[00:07:21]
Or some library that you don't fully understand. I'll show you an interesting way to get a synopsis of a library to do this super easily in about one second. But like, or like even just like, hey, given this thing, what are the trade offs of each and what is the best fit for this situation, right?

[00:07:43]
And then like sometimes that will inspire a question for me of like, or should I just use postgres like a normal person, you know what I mean? Or something along those lines. And for me a lot of times asking about things or trying to understand how stuff works, has been even sometimes my own code base, right?

[00:08:01]
Like, you know, in this case, like this is my own code base. This is a plan that I kind of like, you know, I did this full stack type safety thing where we did a lot of TRCs. I was like, I never thought about using it for Chrome's messaging.

[00:08:14]
I was talking about HTTP, I was like, would this work? Is this a thing or am I like overthinking this? And so that's where this whole thing started. And so I can now read this and kind of like go through it later. I know it seems like a lot but like, look at that.

[00:08:29]
The question Service worker lifespan like, hey, manifest V3 service workers can't maintain persistent connections and do the stuff TRPC needs. How are we gonna deal with that? Fun fact, I knew about the fact that they don't stay alive in V3, and I never thought what that means for a TRPC server, right?

[00:08:48]
Like, that's a pretty good idea. I don't know that I love this answer. And so maybe I abandoned this entire plan, right? We can argue that generating code makes you faster, but also even tools that help me consider the implications of what I was considering doing and abandoning a plan makes me way faster because it's slow getting three quarters of the way through a plan and then having to throw it all away, right?

[00:09:14]
And I think that there's a lot of power in using these tools that effectively have a shocking amount of information at disposal. Some of this might be hallucinated, I don't know. But I can at least go ahead and continue thinking about it. I'm already. I don't know. I love this plan.

[00:09:33]
Now granted, as you saw just the demo before, I used probably a ton of sonnet tokens, so opus tokens to planet. So yes, I would do this beforehand normally, but these are good questions, right? What do you do with CSP, right? And the content script boundary and how they, again, if you haven't been working on a Chrome extension, don't worry about it.

[00:09:57]
But I'm like, yeah. And so sometimes just understanding the problem and thinking about it from different angles is wild, especially because I don't have a full team to just riff with right now. And I think if you're newer in your career, being able to just either analyze existing code bases or again, even if you read through this and going like, I don't understand what that word means.

[00:10:22]
I don't understand what that word means. I don't understand what that word means. Amazing, cuz you know what you can do next? Go in and figure out what those things mean. Either use deep research or some of those things and actually get a sense and prompting technique that doesn't that works in any case, both in this tool and everything else.

[00:10:40]
Explain it to me like I'm five. Use [LAUGH] metaphors and pictures. You know, like I did this course like a while back where like, I know all the JavaScript we're playing with Arduinos and occasionally I can remember the difference between voltage, like amperes and like wattage. Occasionally I'm like, explain it to me like I'm five with metaphors about how water flows through a pipe, right?

[00:11:06]
And it works just as well for this shockingly well, which I think is totally worthwhile.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now