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
- **Spawn mentioned agents:** If the user uses "@AgentName" in their message, you must spawn that agent.
87
92
- **Validate assumptions:** Use researchers, file pickers, and the read_files tool to verify assumptions about libraries and APIs before implementing.
88
93
- **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.
89
-
- **Confirm Ambiguity/Expansion:** Do not take significant actions beyond the clear scope of the request without confirming with the user. If asked *how* to do something, explain first, don't just do it.
90
-
- **Ask the user about important decisions or guidance using the ask_user tool:** You should feel free to stop and ask the user for guidance if there's a an important decision to make or you need an important clarification or you're stuck and don't know what to try next. Use the ask_user tool to collaborate with the user to acheive the best possible result! Prefer to gather context first before asking questions in case you end up answering your own question.
94
+
- **Confirm Ambiguity/Expansion:** Do not take significant actions beyond the clear scope of the request without confirming with the user. If asked *how* to do something, explain first, don't just do it.${
95
+
noAskUser
96
+
? ''
97
+
: `
98
+
- **Ask the user about important decisions or guidance using the ask_user tool:** You should feel free to stop and ask the user for guidance if there's a an important decision to make or you need an important clarification or you're stuck and don't know what to try next. Use the ask_user tool to collaborate with the user to acheive the best possible result! Prefer to gather context first before asking questions in case you end up answering your own question.`
99
+
}
91
100
- **Be careful about terminal commands:** Be careful about instructing subagents to run terminal commands that could be destructive or have effects that are hard to undo (e.g. git push, git commit, running any scripts -- especially ones that could alter production environments (!), installing packages globally, etc). Don't run any of these effectful commands unless the user explicitly asks you to.
92
101
- **Do what the user asks:** If the user asks you to do something, even running a risky terminal command, do it.
@@ -275,13 +286,15 @@ function buildImplementationInstructionsPrompt({
275
286
isMax,
276
287
isLite,
277
288
hasNoValidation,
289
+
noAskUser,
278
290
}: {
279
291
isSonnet: boolean
280
292
isFast: boolean
281
293
isDefault: boolean
282
294
isMax: boolean
283
295
isLite: boolean
284
296
hasNoValidation: boolean
297
+
noAskUser: boolean
285
298
}){
286
299
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. Don't surprise the user. For example, don't modify files if the user has not asked you to do so at least implicitly.
287
300
@@ -293,7 +306,8 @@ ${buildArray(
293
306
EXPLORE_PROMPT,
294
307
isMax&&
295
308
`- 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.`,
296
-
isMax&&
309
+
!noAskUser&&
310
+
isMax&&
297
311
'If needed, use the ask_user tool to ask the user for clarification on their request or alternate implementation strategies. It is good to get context on the codebase before asking questions so you can ask informed questions.',
298
312
(isDefault||isMax)&&
299
313
`- 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.${isFast ? '' : ' You should include a step to review the changes after you have implemented the changes.'}:${hasNoValidation ? '' : ' You should include at least one step to validate/test your changes: be specific about whether to typecheck, run tests, run lints, etc.'} You may be able to do reviewing and validation in parallel in the same step. Skip write_todos for simple tasks like quick edits or answering questions.`,
@@ -315,6 +329,7 @@ ${buildArray(
315
329
`- Test your changes by running appropriate validation commands for the project (e.g. typechecks, tests, lints, etc.). Try to run all appropriate commands in parallel. ${isMax ? ' Typecheck and test the specific area of the project that you are editing *AND* then typecheck and test the entire project if necessary.' : ' If you can, only 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!`,
316
330
`- 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." : ''}`,
317
331
!isFast&&
332
+
!noAskUser&&
318
333
`- After successfully completing an implementation, use the suggest_followups tool to suggest ~3 next steps the user might want to take (e.g., "Add unit tests", "Refactor into smaller files", "Continue with the next step").`,
319
334
).join('\n')}`
320
335
}
@@ -326,13 +341,15 @@ function buildImplementationStepPrompt({
326
341
hasNoValidation,
327
342
isSonnet,
328
343
isLite,
344
+
noAskUser,
329
345
}: {
330
346
isDefault: boolean
331
347
isFast: boolean
332
348
isMax: boolean
333
349
hasNoValidation: boolean
334
350
isSonnet: boolean
335
351
isLite: boolean
352
+
noAskUser: boolean
336
353
}){
337
354
returnbuildArray(
338
355
isMax&&
@@ -343,6 +360,7 @@ function buildImplementationStepPrompt({
343
360
'Spawn code-reviewer to review the changes after you have implemented the changes and in parallel with typechecking or testing.',
344
361
`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 have already concluded and summarized the changes in a previous step -- just end your turn.`,
345
362
!isFast&&
363
+
!noAskUser&&
346
364
`After a successful implementation, use the suggest_followups tool to suggest around 3 next steps the user might want to take.`,
0 commit comments