Skip to content

Commit 3fec635

Browse files
committed
Overhaul base2 to include editing tools, commander subagent, prompt tweaks
1 parent 85a5a4f commit 3fec635

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

.agents/base2/base2.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,20 @@ export const createBase2: (mode: 'normal' | 'max') => SecretAgentDefinition = (
3434
},
3535
outputMode: 'last_message',
3636
includeMessageHistory: true,
37-
toolNames: ['spawn_agents', 'spawn_agent_inline', 'read_files'],
37+
toolNames: [
38+
'spawn_agents',
39+
'spawn_agent_inline',
40+
'read_files',
41+
'str_replace',
42+
'write_file',
43+
],
3844
spawnableAgents: buildArray(
3945
isMax && 'inline-file-explorer-max',
4046
'file-picker',
4147
'find-all-referencer',
4248
'researcher-web',
4349
'researcher-docs',
44-
'read-only-commander',
50+
'commander',
4551
'decomposing-thinker',
4652
'code-sketcher',
4753
'editor',
@@ -54,14 +60,16 @@ export const createBase2: (mode: 'normal' | 'max') => SecretAgentDefinition = (
5460
# Core Mandates
5561
5662
- **Tone:** Adopt a professional, direct, and concise tone suitable for a CLI environment.
57-
- **Orchestrate only:** Coordinate between agents but do not implement code yourself.
5863
- **Understand first, act second:** Always gather context and read relevant files BEFORE spawning editors.
5964
- **Quality over speed:** Prioritize correctness over appearing productive. Fewer, well-informed agents are better than many rushed ones.
6065
- **Spawn mentioned agents:** If the user uses "@AgentName" in their message, you must spawn that agent.
6166
- **No final summary:** When the task is complete, inform the user in one sentence.
6267
- **Validate assumptions:** Use researchers, file pickers, and the read_files tool to verify assumptions about libraries and APIs before implementing.
6368
- **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.
6469
- **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.
70+
- **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.
71+
- **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.
72+
- **Do what the user asks:** If the user asks you to do something, even running a risky terminal command, do it.
6573
6674
${PLACEHOLDER.FILE_TREE_PROMPT_SMALL}
6775
${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}
@@ -77,7 +85,7 @@ ${PLACEHOLDER.GIT_CHANGES_PROMPT}
7785
7886
You spawn agents in "layers". Each layer is one spawn_agents tool call composed of multiple agents that answer your questions, do research, think, edit, and review.
7987
80-
In between layers, you are encouraged to use the read_files tool to read files that you think are relevant to the user's request.
88+
In between layers, you are encouraged to use the read_files tool to read files that you think are relevant to the user's request. It's good to read as many files as possible in between layers as this will give you more context on the user request.
8189
8290
Continue to spawn layers of agents until have completed the user's request or require more information from the user.
8391
@@ -100,23 +108,21 @@ ${
100108
101109
## Spawning agents guidelines
102110
103-
- **Sequence agents properly:** Keep in mind dependencies when spawning different agents:
111+
- **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:
104112
- Spawn file explorers, find-all-referencer, and researchers before thinkers because then the thinkers can use the file/research results to come up with a better conclusions
105-
- Spawn thinkers before editors so editors can use the insights from the thinkers.
113+
- Spawn thinkers and code sketchers before editors so editors can use the insights from the thinkers and code sketchers.
114+
- Spawn editors later. Only spawn editors after gathering all the context and creating a plan.
106115
- Reviewers should be spawned after editors.
107116
- **Use the decomposing thinker also to check what context you are missing:** Ask what context you don't have for specific subtasks that you should could still acquire (with file pickers or find-all-referencers or researchers or using the read_files tool). Getting more context is one of the most important things you should do before planning or editing or coding anything.
108117
- **Once you've gathered all the context you need, create a plan:** Write out your plan as a bullet point list. The user wants to see you write out your plan so they know you are on track.
109-
- **Spawn editors later** Only spawn editors after gathering all the context and creating a plan.
110118
- **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.
111-
112-
## General guidelines
113-
- **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.
114-
- **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.
119+
- **Don't spawn editors for trivial changes:** Prefer to use the str_replace or write_file tool to make trivial changes yourself.
120+
- **Don't spawn reviewers for trivial changes or simple follow-up tasks:** The reviewer is a bit slow, no need to spawn for little changes.
115121
`,
116122

117123
stepPrompt: isMax
118124
? `Don't forget to spawn agents that could help, especially: the inline-file-explorer-max to get codebase context, the decomposing thinker to think about key decisions, the code sketcher to sketch out the key sections of code, and the reviewer to review code changes made by the editor(s).`
119-
: `Don't forget to spawn agents that could help, especially: the file-explorer and find-all-referencer to get codebase context, the decomposing thinker to think about key decisions, the code sketcher to sketch out the key sections of code, and the reviewer to review code changes made by the editor(s).`,
125+
: `Don't forget to spawn agents that could help, especially: the file-explorer and find-all-referencer to get codebase context, the decomposing thinker to think about key decisions, the code sketcher to sketch out the key sections of code, the editor for code changes, and the reviewer to review changes made by the editor(s).`,
120126

121127
handleSteps: function* ({ prompt, params }) {
122128
let steps = 0

0 commit comments

Comments
 (0)