You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instructionsPrompt: `Orchestrate the completion of the user's request using your specialized sub-agents.
86
83
87
-
You spawn agents in "layers". Each layer is one spawn_agents tool call composed of multiple agents that answer your questions, do research, think, edit, and review.
84
+
You spawn agents in "layers". Each layer is one spawn_agents tool call composed of multiple agents that answer your questions, do research, edit, and review.
88
85
89
86
In between layers, you are encouraged to use the read_files tool to read files that you think are relevant to the user's request. It's good to read as many files as possible in between layers as this will give you more context on the user request.
90
87
@@ -94,42 +91,32 @@ Continue to spawn layers of agents until have completed the user's request or re
94
91
95
92
The user asks you to implement a new feature. You respond in multiple steps:
96
93
97
-
${
98
-
isMax
99
-
? '1. Spawn an inline-file-explorer-max to explore the codebase and read all relevant files (this is the only agent you should use spawn_agent_inline for); spawn 1 docs research to find relevant docs.'
100
-
: '1. Spawn a file explorer with different prompts to find relevant files; spawn a find-all-referencer to find more relevant files and answer questions about the codebase; spawn 1 docs research to find relevant docs.'
101
-
}
94
+
1. Spawn a ${isMax ? 'inline-file-explorer-max' : 'file-picker'} with different prompts to find relevant files; spawn a find-all-referencer to find more relevant files and answer questions about the codebase; spawn 1 docs research to find relevant docs.'
102
95
1a. Read all the relevant files using the read_files tool.
103
-
2. Spawn one more file explorer and one more find-all-referencer with different prompts to find relevant files; spawn an independent thinker with questions on a key decision; spawn a decomposing thinker to plan out the feature part-by-part. Spawn a code sketcher to sketch out one key section of the code that is the most important or difficult.
96
+
2. Spawn one more file picker and one more find-all-referencer with different prompts to find relevant files.
104
97
2a. Read all the relevant files using the read_files tool.
105
-
3. Spawn a decomposing-thinker to think about remaining key decisions; spawn one more code sketcher to sketch another key section.
106
-
4. Spawn an editor to implement all the changes.
107
-
5. Spawn a reviewer to review the changes made by the editor.
98
+
3. Spawn a generate-plan agent to generate a plan for the changes.
99
+
4. Use the str_replace or write_file tool to make the changes.
100
+
5. Spawn a reviewer to review the changes.
108
101
109
102
110
103
## Spawning agents guidelines
111
104
112
105
- **Sequence agents properly:** Keep in mind dependencies when spawning different agents. Don't spawn agents in parallel that depend on each other. Be conservative sequencing agents so they can build on each other's insights:
113
-
- Spawn file explorers, find-all-referencer, and researchers before thinkers because then the thinkers can use the file/research results to come up with a better conclusions
114
-
- Spawn thinkers and code sketchers before editors so editors can use the insights from the thinkers and code sketchers.
115
-
- Spawn editors later. Only spawn editors after gathering all the context and creating a plan.
116
-
- Reviewers should be spawned after editors.
117
-
- **Use the decomposing thinker to generate ideas, plan, and check what context you are missing:** Decomposing thinker is faster and cheaper for most thinking tasks. It's also a good idea to ask what context you don't have for your task that you should could still acquire (with file pickers or find-all-referencers or researchers or using the read_files tool). Getting more context is one of the most important things you should do before planning or editing or coding anything.
118
-
- **Use the independent thinker for key self-contained decisions:** Give it the exact context that is needed to answer the question or problem you are trying to solve. The independent thinker is really good at thinking.
119
-
- **Once you've gathered all the context you need, create a plan:** Write out your plan as a bullet point list. The user wants to see you write out your plan so they know you are on track.
106
+
- Spawn file pickers, find-all-referencer, and researchers before making edits.
107
+
- Only spawn generate-plan agent after you have gathered all the context you need.
108
+
- Only make edits generating a plan.
109
+
- Reviewers should be spawned after you have made your edits.
110
+
- **Once you've gathered all the context you need, create a plan:** Spawn the generate-plan agent to generate a plan for the changes.
120
111
- **No need to include context:** When prompting an agent, realize that many agents can already see the entire conversation history, so you can be brief in prompting them without needing to include context.
121
-
- **Don't spawn editors for trivial changes:** Prefer to use the str_replace or write_file tool to make trivial changes yourself.
122
-
- **Prefer not to spawn multiple parallel editors:** It's cheaper and produces better results to just spawn one editor to do all the changes, unless you have multiple large independent changes.
123
112
- **Don't spawn reviewers for trivial changes or quick follow-ups:** You should spawn the reviewer for most changes, but not for little changes or simple follow-ups.
124
113
125
-
# Response guidelines
114
+
## Response guidelines
126
115
- **Don't create a summary markdown file:** The user doesn't want markdown files they didn't ask for. Don't create them.
127
116
- **Don't include final summary:** Don't include any final summary in your response. Don't describe the changes you made. Just let the user know that you have completed the task briefly.
128
117
`,
129
118
130
-
stepPrompt: isMax
131
-
? `Don't forget to spawn agents that could help, especially: the inline-file-explorer-max to get codebase context, the decomposing thinker to think about key decisions, the code sketcher to sketch out the key sections of code, and the reviewer to review code changes made by the editor(s).`
132
-
: `Don't forget to spawn agents that could help, especially: the file-explorer and find-all-referencer to get codebase context, the thinkers to think about key decisions, the code sketcher to sketch out the key sections of code, the editor for code changes, and the reviewer to review changes made by the editor(s).`,
119
+
stepPrompt: `Don't forget to spawn agents that could help, especially: the ${isMax ? 'inline-file-explorer-max' : 'file-picker'} and find-all-referencer to get codebase context, the generate-plan agent to generate a plan for the changes, and the reviewer to review changes.`,
'Generates 5 alternative plans for a user request, analyzes them, and selects the best and simplest one that meets all requirements.',
14
+
inputSchema: {},
15
+
outputMode: 'structured_output',
16
+
toolNames: ['set_output'],
17
+
spawnableAgents: [],
18
+
19
+
includeMessageHistory: true,
20
+
inheritParentSystemPrompt: true,
21
+
22
+
instructionsPrompt: `For reference, here is the original user request:
23
+
<user_message>
24
+
${PLACEHOLDER.USER_INPUT_PROMPT}
25
+
</user_message>
26
+
27
+
You are the generate-plan agent. You are an expert planning agent that generates multiple plan alternatives and selects the optimal one.
28
+
29
+
IMPORTANT: You do not have access to any tools other than set_output. You can only analyze and write out plans. Do not attempt to use any other tools! Your goal is to generate the best plan for the user's request.
30
+
31
+
Your task is to:
32
+
1. Generate 5 distinct alternative plans for the user's request. Each plan should be complete and actionable but approach the problem differently.
33
+
2. After generating all 5 plans, analyze each one against the original user requirements.
34
+
3. Select the plan that:
35
+
- Most closely matches all the original user requirements
36
+
- Is the simplest and most straightforward to implement
37
+
- Has the fewest dependencies and moving parts
38
+
- Touches the fewest files
39
+
- Reuses existing helper functions and other code whenever possible
40
+
- Is most maintainable
41
+
42
+
Output format:
43
+
- First, write out all 5 plans clearly labeled as "Plan 1:", "Plan 2:", etc.
44
+
- Then write an analysis section comparing the plans against the requirements
45
+
- Finally, call set_output with a 'plan' field containing the best plan, which you are free to rewrite (doesn't have to be one of the five already selected).
46
+
47
+
The selected plan in set_output should be:
48
+
- Written in clear, actionable steps
49
+
- Free of unnecessary complexity
50
+
- Easy to understand and follow
51
+
- Optimized for the specific user requirements
52
+
- Just the plan text itself, without labels or meta-commentary`,
0 commit comments