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
Copy file name to clipboardExpand all lines: .agents/base2/base2.ts
+11-10Lines changed: 11 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ export function createBase2(
89
89
- **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.
90
90
- **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.
91
91
- **Stop and ask for guidance:** You should feel free to stop and ask the user for guidance if you're stuck or don't know what to try next, or need a clarification.
92
-
- **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, running scripts that could alter production environments, installing packages globally, etc). Don't do any of these unless the user explicitly asks you to.
92
+
- **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 do any of these unless the user explicitly asks you to.
93
93
- **Do what the user asks:** If the user asks you to do something, even running a risky terminal command, do it.
94
94
95
95
# Code Editing Mandates
@@ -121,12 +121,11 @@ export function createBase2(
121
121
Use the spawn_agents tool to spawn specialized agents to help you complete the user's request.
122
122
123
123
- **Spawn multiple agents in parallel:** This increases the speed of your response **and** allows you to be more comprehensive by spawning more total agents to synthesize the best response.
124
-
- **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:
124
+
- **Sequence agents properly:** Keep in mind dependencies when spawning different agents. Don't spawn agents in parallel that depend on each other.
125
125
- Spawn file pickers, code-searcher, directory-lister, glob-matcher, commanders, and web/docs researchers before making edits.
126
126
${buildArray(
127
127
`- Spawn a ${isGpt5 ? 'editor-best-of-n-gpt-5' : 'editor-best-of-n'} agent to implement the changes after you have gathered all the context you need.`,
128
128
).join('\n ')}
129
-
- **Spawn with the correct prompt and/or params:** Each agent has a schema for the input it expects. The prompt is a string, and the params is a json object. Some agents require prompts and/or params, and some require you to NOT include any input prompt or params.
130
129
- **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.
131
130
132
131
# Codebuff Meta-information
@@ -139,11 +138,13 @@ The user can use the "/usage" command to see how many credits they have used and
139
138
140
139
For other questions, you can direct them to codebuff.com, or especially codebuff.com/docs for detailed information about the product.
141
140
142
-
143
-
# Response guidelines
141
+
# Other response guidelines
144
142
145
143
${buildArray(
146
-
"- NEVER write out <tool_result> tags in your response. Tools will automatically append the results of their tool calls for you -- it's not something you need to do.",
144
+
'- Your goal is to produce the highest quality results, even if it comes at the cost of more credits used.',
145
+
'- Speed is a secondary goal.',
146
+
'- If a tool fails, try again, or try a different tool or approach.',
147
+
'- Context is managed for you. The context-pruner agent will automatically run as needed. Gather as much context as you need without worrying about it.',
147
148
isSonnet&&
148
149
`- **Don't create a summary markdown file:** The user doesn't want markdown files they didn't ask for. Don't create them.`,
149
150
'- **Keep final summary extremely concise:** Write only a few words for each change you made in the final summary.',
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 find relevant files -- try spawning multiple 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 comprehensive context on the user's request.`
204
+
constEXPLORE_PROMPT=`- Iteratively spawn file pickers, code-searchers, directory-listers, glob-matchers, commanders, and web/docs researchers to gather context as needed. The file-picker agent in particular is very useful to find relevant files -- try spawning multiple in parallel (say, 2-5) to explore different parts of the codebase. Use read_subtree if you need to grok a particular part of the codebase. Read all the relevant files using the read_files tool. Read as many files as possible so that you have comprehensive context on the user's request.`
204
205
205
206
functionbuildImplementationInstructionsPrompt({
206
207
isSonnet,
@@ -225,10 +226,10 @@ The user asks you to implement a new feature. You respond in multiple steps:
225
226
226
227
${buildArray(
227
228
EXPLORE_PROMPT,
228
-
`- 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.`,
229
-
`- 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.`,
229
+
`- 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.`,
230
+
`- For multi-step tasks (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.`,
230
231
!isFast&&
231
-
`- You must spawn the ${isGpt5 ? '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 small and trivial.`,
232
+
`- You must spawn the ${isGpt5 ? '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.`,
232
233
!hasNoValidation&&
233
234
`- 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!`,
234
235
`- 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." : ''}`,
'Edits code by orchestrating multiple implementor agents to generate implementation proposals, selects the best one, and applies the changes. Do not specify an input prompt for this agent; it reads the context from the message history.',
19
+
'Edits code by orchestrating multiple implementor agents to generate implementation proposals, selects the best one, and applies the changes. Do not specify an input prompt for this agent; it inherits the context of the entire conversation with the user. Make sure to read any files intended to be edited before spawning this agent.',
'Mechanically runs multiple code search queries (using ripgrep line-oriented search) and returns all results',
52
+
'Mechanically runs multiple code search queries (using ripgrep line-oriented search) and returns up to 250 results across all source files, showing each line that matches the search pattern. Excludes git-ignored files.',
'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.',
20
+
'Spawn to find relevant files in a codebase related to the prompt. Outputs up to 12 file paths with short summaries for each file. 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.',
Copy file name to clipboardExpand all lines: packages/agent-runtime/src/templates/prompts.ts
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -66,17 +66,20 @@ params: None`
66
66
67
67
return`\n\n## Spawnable Agents
68
68
69
-
Use the spawn_agents tool to spawn agents to help you complete the user request. Below are the *only* available agents by their agent_type. Other agents may be referenced earlier in the conversation, but they are not available to you.
69
+
Use the spawn_agents tool to spawn agents to help you complete the user request.
70
70
71
-
Note: You can not call the agents as tool names directly: you must use the spawn_agents tool with the correct parameters to spawn them!
71
+
Notes:
72
+
- You can not call the agents as tool names directly: you must use the spawn_agents tool with the correct parameters to spawn them!
73
+
- There are two types of input arguments for agents: prompt and params. The prompt is a string, and the params is a json object. Some agents require only one or the other, some require both, and some require none.
74
+
- Below are the *only* available agents by their agent_type. Other agents may be referenced earlier in the conversation, but they are not available to you.
Copy file name to clipboardExpand all lines: packages/agent-runtime/src/tools/definitions/tool/read-subtree.ts
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,5 +13,8 @@ ${getToolCallString(toolName, {
13
13
})}
14
14
15
15
Purpose: Read a directory subtree and return a blob containing subdirectories, file names, and parsed variable/functions names from source files. For files, return only the parsed variable names. If no paths are provided, returns the entire project tree. The output is truncated to fit within the provided token budget.
16
+
17
+
- Use this tool on particular subdirectories when you need to know all the nested files and directories. E.g. for a refactoring task, or to understand a particular part of the codebase.
18
+
- In normal use, don't set maxTokens beyond 10,000.
0 commit comments