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
@@ -127,15 +112,8 @@ Use the spawn_agents tool to spawn specialized agents to help you complete the u
127
112
- **Sequence agents properly:** Keep in mind dependencies when spawning different agents. Don't spawn agents in parallel that depend on each other.
128
113
${buildArray(
129
114
'- Spawn context-gathering agents (file pickers, code-searcher, directory-lister, glob-matcher, and web/docs researchers) before making edits.',
130
-
!withImplementorGpt5&&
131
-
`- Spawn a ${isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement the changes after you have gathered all the context you need. You must spawn this agent for non-trivial changes, since it writes much better code than you would with the str_replace or write_file tools. Don't spawn the editor in parallel with context-gathering agents.`,
132
-
withImplementorGpt5&&
133
-
`- Spawn a editor-implementor-gpt-5 agent to implement the changes after you have gathered all the context you need. You must spawn this agent for non-trivial changes, since it writes much better code than you would with the str_replace or write_file tools.`,
115
+
`- Spawn a ${isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement the changes after you have gathered all the context you need. You must spawn this agent for non-trivial changes, since it writes much better code than you would with the str_replace or write_file tools. Don't spawn the editor in parallel with context-gathering agents.`,
134
116
'- Spawn commanders sequentially if the second command depends on the the first.',
135
-
hasCodeReviewer&&
136
-
'- Spawn a code-reviewer agent to review the code changes after you have made them.',
137
-
hasCodeReviewerBestOfN&&
138
-
'- Spawn a code-reviewer-best-of-n agent to review the code changes after you have made them.',
139
117
).join('\n ')}
140
118
- **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.
@@ -227,20 +200,12 @@ function buildImplementationInstructionsPrompt({
227
200
isDefault,
228
201
isMax,
229
202
hasNoValidation,
230
-
hasCodeReviewer,
231
-
hasCodeReviewerBestOfN,
232
-
withImplementorGpt5,
233
-
withDecisionMaker,
234
203
}: {
235
204
isSonnet: boolean
236
205
isFast: boolean
237
206
isDefault: boolean
238
207
isMax: boolean
239
208
hasNoValidation: boolean
240
-
hasCodeReviewer: boolean
241
-
hasCodeReviewerBestOfN: boolean
242
-
withImplementorGpt5: boolean
243
-
withDecisionMaker: boolean
244
209
}){
245
210
return`Act as a helpful assistant and freely respond to the user's request however would be most helpful to the user. Use your judgement to orchestrate the completion of the user's request using your specialized sub-agents and tools as needed. Take your time and be comprehensive.
246
211
@@ -252,23 +217,14 @@ ${buildArray(
252
217
EXPLORE_PROMPT,
253
218
!isFast&&
254
219
`- Important: Read as many files as could possibly be relevant to the task over several steps to improve your understanding of the user's request and produce the best possible code changes. Find more examples within the codebase similar to the user's request, dependencies that help with understanding how things work, tests, etc. This is frequently 12-20 files, depending on the task.`,
255
-
withDecisionMaker&&
256
-
`- Before planning or implementing, spawn decision-maker agents for a few of the most important decisions that need to be made. This will improve the quality of your decisions and your implementation.`,
257
220
!isFast&&
258
-
`- For any task requiring 3+ steps, use the write_todos tool to write out your step-by-step implementation plan. Include ALL of the applicable tasks in the list.${hasCodeReviewer ? ' Include a step to review the code changes with the code-reviewer agent after you have made them.' : ''}${hasCodeReviewerBestOfN ? ' Include a step to review the code changes with the code-reviewer-best-of-n agent after you have made them.' : ''}${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 simple tasks like quick edits or answering questions.`,
221
+
`- For any task requiring 3+ steps, 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 simple tasks like quick edits or answering questions.`,
259
222
isFast&&
260
223
'- Implement the changes in one go. Pause after making all the changes to see the tool results of your edits.',
261
224
isFast&&
262
225
'- Do a single typecheck targeted for your changes at most (if applicable for the project). Or skip this step if the change was small.',
263
226
!isFast&&
264
-
!withImplementorGpt5&&
265
227
`- IMPORTANT: You must spawn the ${isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} 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 straightforward and obvious.`,
266
-
withImplementorGpt5&&
267
-
`- IMPORTANT: You must spawn the editor-implementor-gpt-5 agent to implement non-trivial code changes, since it will generate the best code changes using a smarter reasoning model. 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 straightforward and obvious.`,
268
-
hasCodeReviewer&&
269
-
`- Spawn a code-reviewer agent to review the code changes after you have made them. You can skip this step for small changes that are obvious and don't require a review.`,
270
-
hasCodeReviewerBestOfN&&
271
-
`- Spawn a code-reviewer-best-of-n agent to review the code changes after you have made them. You can skip this step for small changes that are obvious and don't require a review.`,
272
228
!hasNoValidation&&
273
229
`- 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!`,
274
230
`- Inform the user that you have completed the task in one sentence or a few short bullet points.${isSonnet ? " Don't create any markdown summary files or example documentation files, unless asked by the user." : ''}`,
@@ -280,19 +236,17 @@ function buildImplementationStepPrompt({
280
236
isMax,
281
237
hasNoValidation,
282
238
isSonnet,
283
-
withImplementorGpt5,
284
239
}: {
285
240
isFast: boolean
286
241
isMax: boolean
287
242
hasNoValidation: boolean
288
243
isSonnet: boolean
289
-
withImplementorGpt5: boolean
290
244
}){
291
245
returnbuildArray(
292
246
isMax&&
293
247
`Keep working until the user's request is completely satisfied${!hasNoValidation ? ' and validated' : ''}, or until you require more information from the user.`,
294
248
!isFast&&
295
-
`You must spawn the ${withImplementorGpt5 ? 'editor-implementor-gpt-5' : isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement code changes, since it will generate the best code changes.`,
249
+
`You must spawn the ${isMax ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement code changes, since it will generate the best code changes.`,
296
250
`After completing the user request, summarize your changes in a sentence${isFast ? '' : ' or a few short bullet points'}.${isSonnet ? " Don't create any summary markdown files or example documentation files, unless asked by the user." : ''}. Don't repeat yourself -- especially if you already summarized your changes then just end your turn.`,
0 commit comments