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
The user asks you to implement a new feature. You respond in multiple steps:
126
126
127
-
1. Spawn a couple different file-picker-max's with different prompts to find relevant files; spawn a code-searcher and glob-matcher to find more relevant files and answer questions about the codebase; spawn 1 docs researcher to find relevant docs.
127
+
1. Spawn a couple different file-picker's with different prompts to find relevant files; spawn a code-searcher and glob-matcher to find more relevant files and answer questions about the codebase; spawn 1 docs researcher to find relevant docs.
128
128
1a. Read all the relevant files using the read_files tool.
129
-
2. Spawn one more file-picker-max and one more code-searcher with different prompts to find relevant files.
129
+
2. Spawn one more file-picker and one more code-searcher with different prompts to find relevant files.
130
130
2a. Read all the relevant files using the read_files tool.
131
131
3. Important: Spawn a planner-pro agent to generate a plan for the changes.
132
132
4. Use the str_replace or write_file tool to make the changes.
133
133
5. Spawn a code-reviewer to review the changes. Consider making changes suggested by the code-reviewer.
134
134
6. Spawn a validator to run validation commands (tests, typechecks, etc.) to ensure the changes are correct.
135
135
7. Inform the user that you have completed the task in one sentence without a final summary.`,
136
136
137
-
stepPrompt: `Don't forget to spawn agents that could help, especially: the file-picker-max and find-all-referencer to get codebase context, the planner-pro agent to create a plan, the code reviewer to review changes, and the validator to run validation checks.`,
137
+
stepPrompt: `Don't forget to spawn agents that could help, especially: the file-picker and find-all-referencer to get codebase context, the planner-pro agent to create a plan, the code reviewer to review changes, and the validator to run validation checks.`,
constEXPLORE_PROMPT=`- Spawn file pickers, code-searcher, directory-lister, glob-matcher, commanders, and web/docs researchers to gather context as needed. The file-picker agent in particular is very useful to use to find relevant files -- try spawning mulitple in parallel to explore different parts of the codebase. Read all the relevant files using the read_files tool. Read as many files as possible so that you have a comprehensive context on the user's request.`
185
185
186
186
functionbuildImplementationInstructionsPrompt({
187
187
isGpt5,
188
+
isFast,
188
189
isDefault,
189
190
isMax,
190
191
hasNoValidation,
191
192
}: {
192
193
isGpt5: boolean
194
+
isFast: boolean
193
195
isDefault: boolean
194
196
isMax: boolean
195
197
hasNoValidation: boolean
@@ -201,10 +203,11 @@ function buildImplementationInstructionsPrompt({
201
203
The user asks you to implement a new feature. You respond in multiple steps:
202
204
203
205
${buildArray(
204
-
`- Spawn file pickers, code-searcher, directory-lister, glob-matcher, commanders, and web/docs researchers to gather context as needed. The file-picker-max agent in particular is very useful to use to find relevant files. Read all the relevant files using the read_files tool. Read as many files as possible so that you have a comprehensive context on the user's request.`,
206
+
EXPLORE_PROMPT,
205
207
`- Important: Read as many files as could possibly be relevant to the task to improve your understanding of the user's request and produce the best possible code changes. This is frequently 12-20 files, depending on the task.`,
206
208
`- For multi-step tasks, use the write_todos tool to write out your step-by-step implementation plan. Include ALL of the applicable tasks in the list.${hasNoValidation ? '' : ' You should include at least one step to validate/test your changes: be specific about whether to typecheck, run tests, run lints, etc.'} Skip write_todos for trivial tasks like single-line edits or simple questions.`,
207
-
`- You must spawn the ${isGpt5 ? 'best-of-n-editor-gpt-5' : 'best-of-n-editor'} agent to implement non-trivial code changes, since it will generate the best code changes from multiple implementation proposals. This is the best way to make high quality code changes -- strongly prefer using this agent over the str_replace or write_file tools, unless the change is very small and trivial.`,
209
+
!isFast&&
210
+
`- You must spawn the ${isGpt5 ? 'best-of-n-editor-gpt-5' : 'best-of-n-editor'} agent to implement non-trivial code changes, since it will generate the best code changes from multiple implementation proposals. This is the best way to make high quality code changes -- strongly prefer using this agent over the str_replace or write_file tools, unless the change is very small and trivial.`,
208
211
!hasNoValidation&&
209
212
`- Test your changes${isMax ? '' : ' briefly'} by running appropriate validation commands for the project (e.g. typechecks, tests, lints, etc.).${isMax ? ' Start by type checking the specific area of the project that you are editing and then test the entire project if necessary.' : ' If you can, only typecheck/test the area of the project that you are editing, rather than the entire project.'} You may have to explore the project to find the appropriate commands. Don't skip this step!`,
210
213
`- Inform the user that you have completed the task in one sentence or a few short bullet points. Don't create any markdown summary files or example documentation files, unless asked by the user. If you already finished the user request and said you're done, then don't say anything else.`,
@@ -220,7 +223,7 @@ function buildPlanOnlyInstructionsPrompt({}: {}) {
220
223
The user asks you to implement a new feature. You respond in multiple steps:
221
224
222
225
${buildArray(
223
-
`- Spawn file pickers, code-searcher, directory-lister, glob-matcher, commanders, and researchers to gather context as needed. The file-picker-max agent in particular is very useful to use to find relevant files. Read all the relevant files using the read_files tool. Read as many files as possible so that you have a comprehensive context on the user's request.`,
226
+
EXPLORE_PROMPT,
224
227
`- After exploring the codebase, translate the user request into a clear and concise spec. If the user is just asking a question, you can answer it instead of writing a spec.
225
228
226
229
## Creating a spec
@@ -287,3 +290,6 @@ function buildPlanOnlyStepPrompt({}: {}) {
287
290
`Your are in plan mode. Do not make any file changes. Do not call write_file or str_replace. Do not spawn the best-of-n-editor agent to implement. Do not use the write_todos tool.`,
'Lists up to 12 files that are relevant to the prompt within the given directories. Unless you know which directories are relevant, omit the directories parameter. This agent is great for finding files that could be relevant to the prompt.',
11
11
inputSchema: {
@@ -62,7 +62,7 @@ Again: Do not write anything else other than the file paths on new lines.
'Spawn to find relevant files in a codebase related to the prompt. Cannot do string searches on the codebase.',
20
+
'Spawn to find relevant files in a codebase related to the prompt. Cannot do string searches on the codebase, but does a fuzzy search. Unless you know which directories are relevant, omit the directories parameter. This agent is extremely effective at finding files in the codebase that could be relevant to the prompt.',
16
21
inputSchema: {
17
22
prompt: {
18
23
type: 'string',
19
24
description: 'A coding task to complete',
20
25
},
26
+
params: {
27
+
type: 'object'asconst,
28
+
properties: {
29
+
directories: {
30
+
type: 'array'asconst,
31
+
items: {type: 'string'asconst},
32
+
description:
33
+
'Optional list of paths to directories to look within. If omitted, the entire project tree is used.',
34
+
},
35
+
},
36
+
required: [],
37
+
},
21
38
},
22
39
outputMode: 'last_message',
23
40
includeMessageHistory: false,
24
-
toolNames: ['find_files'],
25
-
spawnableAgents: [],
26
-
27
-
systemPrompt: `You are an expert at finding relevant files in a codebase. ${PLACEHOLDER.FILE_TREE_PROMPT_SMALL}`,
41
+
toolNames: ['spawn_agents'],
42
+
spawnableAgents: ['file-lister'],
28
43
44
+
systemPrompt: `You are an expert at finding relevant files in a codebase. ${PLACEHOLDER.FILE_TREE_PROMPT}`,
29
45
instructionsPrompt: `Instructions:
30
-
Provide a short report of the locations in the codebase that could be helpful. Focus on the files that are most relevant to the user prompt.
31
-
In your report, please give a very concise analysis that includes the full paths of files that are relevant and (briefly) how they could be useful.
46
+
Provide an extremely short report of the locations in the codebase that could be helpful. Focus on the files that are most relevant to the user prompt. Leave out irrelevant locations.
47
+
In your report, please give a very concise analysis that includes the full paths of files that are relevant and (extremely briefly) how they could be useful.
0 commit comments