Skip to content

Commit 459446c

Browse files
committed
Update more prompts based on Buffy's feedback
1 parent 74429dc commit 459446c

File tree

6 files changed

+24
-19
lines changed

6 files changed

+24
-19
lines changed

.agents/base2/base2.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function createBase2(
8989
- **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.
9090
- **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.
9191
- **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.
9393
- **Do what the user asks:** If the user asks you to do something, even running a risky terminal command, do it.
9494
9595
# Code Editing Mandates
@@ -121,12 +121,11 @@ export function createBase2(
121121
Use the spawn_agents tool to spawn specialized agents to help you complete the user's request.
122122
123123
- **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.
125125
- Spawn file pickers, code-searcher, directory-lister, glob-matcher, commanders, and web/docs researchers before making edits.
126126
${buildArray(
127127
`- 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.`,
128128
).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.
130129
- **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.
131130
132131
# Codebuff Meta-information
@@ -139,11 +138,13 @@ The user can use the "/usage" command to see how many credits they have used and
139138
140139
For other questions, you can direct them to codebuff.com, or especially codebuff.com/docs for detailed information about the product.
141140
142-
143-
# Response guidelines
141+
# Other response guidelines
144142
145143
${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.',
147148
isSonnet &&
148149
`- **Don't create a summary markdown file:** The user doesn't want markdown files they didn't ask for. Don't create them.`,
149150
'- **Keep final summary extremely concise:** Write only a few words for each change you made in the final summary.',
@@ -200,7 +201,7 @@ ${PLACEHOLDER.GIT_CHANGES_PROMPT}
200201
}
201202
}
202203

203-
const EXPLORE_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+
const EXPLORE_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.`
204205

205206
function buildImplementationInstructionsPrompt({
206207
isSonnet,
@@ -225,10 +226,10 @@ The user asks you to implement a new feature. You respond in multiple steps:
225226
226227
${buildArray(
227228
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.`,
230231
!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.`,
232233
!hasNoValidation &&
233234
`- 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!`,
234235
`- 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." : ''}`,

.agents/base2/best-of-n/editor-best-of-n.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ export function createBestOfNEditor(
1414
return {
1515
publisher,
1616
model: isGpt5 ? 'openai/gpt-5' : 'anthropic/claude-sonnet-4.5',
17-
displayName: isGpt5
18-
? 'Best-of-N GPT-5 Implementation Editor'
19-
: 'Best-of-N Fast Implementation Editor',
17+
displayName: isGpt5 ? 'Best-of-N GPT-5 Editor' : 'Best-of-N Editor',
2018
spawnerPrompt:
21-
'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.',
2220

2321
includeMessageHistory: true,
2422
inheritParentSystemPrompt: true,

.agents/file-explorer/code-searcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const codeSearcher: SecretAgentDefinition = {
4949
id: 'code-searcher',
5050
displayName: 'Code Searcher',
5151
spawnerPrompt:
52-
'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.',
5353
model: 'anthropic/claude-sonnet-4.5',
5454
publisher,
5555
includeMessageHistory: false,

.agents/file-explorer/file-picker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const definition: SecretAgentDefinition = {
1717
exclude: false,
1818
},
1919
spawnerPrompt:
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.',
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.',
2121
inputSchema: {
2222
prompt: {
2323
type: 'string',

packages/agent-runtime/src/templates/prompts.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,20 @@ params: None`
6666

6767
return `\n\n## Spawnable Agents
6868
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.
7070
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.
7275
7376
Example:
7477
7578
${getToolCallString('spawn_agents', {
7679
agents: [
7780
{
7881
agent_type: 'example-agent',
79-
prompt: 'Example prompt for the example agent',
82+
prompt: 'Do an example task for me',
8083
},
8184
],
8285
})}

packages/agent-runtime/src/tools/definitions/tool/read-subtree.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ ${getToolCallString(toolName, {
1313
})}
1414
1515
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.
1619
`.trim(),
1720
} satisfies ToolDescription

0 commit comments

Comments
 (0)