Skip to content

Commit 28be9bd

Browse files
committed
Move some agents to .agents-graveyard
1 parent da40c54 commit 28be9bd

23 files changed

+330
-29
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
import { buildArray } from '@codebuff/common/util/array'
2+
3+
import { publisher } from '../.agents/constants'
4+
import {
5+
PLACEHOLDER,
6+
type SecretAgentDefinition,
7+
} from '../.agents/types/secret-agent-definition'
8+
9+
export const createBase2: (mode: 'normal' | 'max') => SecretAgentDefinition = (
10+
mode,
11+
) => {
12+
const isMax = mode === 'max'
13+
return {
14+
id: 'base2-with-context-discoverer',
15+
publisher,
16+
model: 'anthropic/claude-sonnet-4.5',
17+
displayName: 'Buffy the Orchestrator',
18+
spawnerPrompt:
19+
'Advanced base agent that orchestrates planning, editing, and reviewing for complex coding tasks',
20+
inputSchema: {
21+
prompt: {
22+
type: 'string',
23+
description: 'A coding task to complete',
24+
},
25+
params: {
26+
type: 'object',
27+
properties: {
28+
maxContextLength: {
29+
type: 'number',
30+
},
31+
},
32+
required: [],
33+
},
34+
},
35+
outputMode: 'last_message',
36+
includeMessageHistory: true,
37+
toolNames: [
38+
'spawn_agents',
39+
'spawn_agent_inline',
40+
'read_files',
41+
'str_replace',
42+
'write_file',
43+
],
44+
spawnableAgents: buildArray(
45+
isMax && 'inline-file-explorer-max',
46+
'file-picker',
47+
'find-all-referencer',
48+
'researcher-web',
49+
'researcher-docs',
50+
'commander',
51+
'context-discoverer',
52+
'generate-plan',
53+
'reviewer',
54+
'context-pruner',
55+
),
56+
57+
systemPrompt: `You are Buffy, a strategic coding assistant that orchestrates complex coding tasks through specialized sub-agents.
58+
59+
# Core Mandates
60+
61+
- **Tone:** Adopt a professional, direct, and concise tone suitable for a CLI environment.
62+
- **Understand first, act second:** Always gather context and read relevant files BEFORE spawning editors.
63+
- **Quality over speed:** Prioritize correctness over appearing productive. Fewer, well-informed agents are better than many rushed ones.
64+
- **Spawn mentioned agents:** If the user uses "@AgentName" in their message, you must spawn that agent.
65+
- **No final summary:** When the task is complete, inform the user in one sentence.
66+
- **Validate assumptions:** Use researchers, file pickers, and the read_files tool to verify assumptions about libraries and APIs before implementing.
67+
- **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.
68+
- **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.
69+
- **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.
70+
- **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.
71+
- **Do what the user asks:** If the user asks you to do something, even running a risky terminal command, do it.
72+
73+
${PLACEHOLDER.FILE_TREE_PROMPT_SMALL}
74+
${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}
75+
76+
# Starting Git Changes
77+
78+
The following is the state of the git repository at the start of the conversation. Note that it is not updated to reflect any subsequent changes made by the user or the agents.
79+
80+
${PLACEHOLDER.GIT_CHANGES_PROMPT}
81+
`,
82+
83+
instructionsPrompt: `Orchestrate the completion of the user's request using your specialized sub-agents.
84+
85+
You spawn agents in "layers". Each layer is one spawn_agents tool call composed of multiple agents that answer your questions, do research, edit, and review.
86+
87+
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.
88+
89+
Continue to spawn layers of agents until have completed the user's request or require more information from the user.
90+
91+
## Example layers
92+
93+
The user asks you to implement a new feature. You respond in multiple steps:
94+
95+
1. Spawn a ${isMax ? 'inline-file-explorer-max' : 'file-picker'} with different prompts to find relevant files; spawn a find-all-referencer to find more relevant files and answer questions about the codebase; spawn 1 docs research to find relevant docs.'
96+
1a. Read all the relevant files using the read_files tool.
97+
2. Spawn one more file picker and one more find-all-referencer with different prompts to find relevant files.
98+
2a. Read all the relevant files using the read_files tool.
99+
3. Spawn a context-discoverer agent to identify missing context.
100+
4. Spawn a generate-plan agent to generate a plan for the changes.
101+
5. Use the str_replace or write_file tool to make the changes.
102+
6. Spawn a reviewer to review the changes.
103+
104+
105+
## Spawning agents guidelines
106+
107+
- **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:
108+
- Spawn file pickers, find-all-referencer, and researchers before making edits.
109+
- Only spawn generate-plan agent after you have gathered all the context you need.
110+
- Only make edits generating a plan.
111+
- Reviewers should be spawned after you have made your edits.
112+
- **Once you've gathered all the context you need, create a plan:** Spawn the generate-plan agent to generate a plan for the changes.
113+
- **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.
114+
- **Don't spawn reviewers for trivial changes or quick follow-ups:** You should spawn the reviewer for most changes, but not for little changes or simple follow-ups.
115+
116+
## Response guidelines
117+
- **Don't create a summary markdown file:** The user doesn't want markdown files they didn't ask for. Don't create them.
118+
- **Don't include final summary:** Don't include any final summary in your response. Don't describe the changes you made. Just let the user know that you have completed the task briefly.
119+
`,
120+
121+
stepPrompt: `Don't forget to spawn agents that could help, especially: the ${isMax ? 'inline-file-explorer-max' : 'file-picker'} and find-all-referencer to get codebase context, the context-discoverer agent to identify missing context, the generate-plan agent to generate a plan for the changes, and the reviewer to review changes.`,
122+
123+
handleSteps: function* ({ prompt, params }) {
124+
let steps = 0
125+
while (true) {
126+
steps++
127+
// Run context-pruner before each step
128+
yield {
129+
toolName: 'spawn_agent_inline',
130+
input: {
131+
agent_type: 'context-pruner',
132+
params: params ?? {},
133+
},
134+
includeToolCall: false,
135+
} as any
136+
137+
const { stepsComplete } = yield 'STEP'
138+
if (stepsComplete) break
139+
}
140+
},
141+
}
142+
}
143+
144+
const definition = createBase2('normal')
145+
export default definition
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { publisher } from './constants'
1+
import { publisher } from '../.agents/constants'
22

3-
import type { AgentDefinition } from './types/agent-definition'
3+
import type { AgentDefinition } from '../.agents/types/agent-definition'
44

55
const definition: AgentDefinition = {
66
id: 'brainstormer',
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { publisher } from '../.agents/constants'
2+
import {
3+
PLACEHOLDER,
4+
type SecretAgentDefinition,
5+
} from '../.agents/types/secret-agent-definition'
6+
7+
const definition: SecretAgentDefinition = {
8+
id: 'context-discoverer',
9+
publisher,
10+
model: 'anthropic/claude-sonnet-4.5',
11+
displayName: 'Context Discovery Agent',
12+
spawnerPrompt:
13+
'Identifies missing or helpful context after initial research. Spawns agents to investigate gaps and recommends files to read.',
14+
inputSchema: {},
15+
outputMode: 'structured_output',
16+
outputSchema: {
17+
type: 'object',
18+
properties: {
19+
missingContext: {
20+
type: 'string',
21+
description:
22+
'Extra context that is helpful for the task at hand! Include relevant information from investigations, if any.',
23+
},
24+
recommendedFiles: {
25+
type: 'array',
26+
items: { type: 'string' },
27+
description:
28+
'List of file paths that should be read to fill context gaps. Can be empty if no context is missing.',
29+
},
30+
},
31+
required: ['missingContext', 'recommendedFiles'],
32+
},
33+
inheritParentSystemPrompt: true,
34+
includeMessageHistory: true,
35+
toolNames: ['spawn_agents', 'read_files', 'set_output'],
36+
spawnableAgents: [
37+
'file-picker',
38+
'find-all-referencer',
39+
'researcher-web',
40+
'researcher-docs',
41+
],
42+
43+
instructionsPrompt: `For reference, here is the original user request:
44+
<user_message>
45+
${PLACEHOLDER.USER_INPUT_PROMPT}
46+
</user_message>
47+
48+
Your task:
49+
50+
1. **Spawn agents in parallel** to investigate potential context gaps:
51+
- Spawn file-picker agents with different prompts to find related files (e.g., "find test files", "find configuration", "find related utilities")
52+
- Spawn find-all-referencer to find references to key classes/functions mentioned in the request or search more broadly through the codebase
53+
- Spawn file-q-and-a if you need to check the content of specific files without reading them fully
54+
- Spawn researcher-web or researcher-docs if external documentation might be needed
55+
56+
You may follow up by spawning more agents if needed at any time!
57+
58+
2. Read any new files to see if they are relevant to the task at hand.
59+
60+
3. **After agents return**, analyze their findings to:
61+
- Identify what files would be helpful that haven't been read yet
62+
- Determine what background context is missing
63+
- Consider edge cases or related areas that might be relevant
64+
65+
4. **Call set_output** with the updated missing context and recommended files`,
66+
}
67+
68+
export default definition
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { publisher } from './constants'
1+
import { publisher } from '../.agents/constants'
22

3-
import type { AgentDefinition } from './types/agent-definition'
3+
import type { AgentDefinition } from '../.agents/types/agent-definition'
44

55
const definition: AgentDefinition = {
66
id: 'creative-catalyst',
@@ -152,4 +152,4 @@ You have access to file reading/writing, code search, terminal commands, and can
152152
Let's make software more delightful, one creative feature at a time! ✨`,
153153
}
154154

155-
export default definition
155+
export default definition
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { publisher } from '../constants'
1+
import { publisher } from '../.agents/constants'
22

3-
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
3+
import type { SecretAgentDefinition } from '../.agents/types/secret-agent-definition'
44

55
const definition: SecretAgentDefinition = {
66
id: 'decomposing-reviewer',
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { publisher } from './constants'
1+
import { publisher } from '../.agents/constants'
22

3-
import type { AgentDefinition } from './types/agent-definition'
3+
import type { AgentDefinition } from '../.agents/types/agent-definition'
44

55
const definition: AgentDefinition = {
66
id: 'knowledge-keeper',
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)