Skip to content

Commit b17ad19

Browse files
committed
Create find-all-referencer agent. Update base-layer
1 parent 91dca8b commit b17ad19

File tree

2 files changed

+62
-9
lines changed

2 files changed

+62
-9
lines changed

.agents/base2/base-layer.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ const definition: SecretAgentDefinition = {
3030
includeMessageHistory: true,
3131
toolNames: ['spawn_agents', 'read_files'],
3232
spawnableAgents: [
33-
'read-only-commander',
34-
'file-picker',
35-
'codebase-explorer',
33+
'file-explorer',
34+
'find-all-referencer',
3635
'researcher-web',
3736
'researcher-docs',
38-
'thinker',
37+
'read-only-commander',
3938
'decomposing-thinker',
4039
'editor',
4140
'reviewer',
@@ -78,28 +77,29 @@ Continue to spawn layers of agents until have completed the user's request or re
7877
7978
The user asks you to implement a new feature. You respond in multiple steps:
8079
81-
1. Spawn 2 file pickers with different prompts to find relevant files; spawn 2 codebase explorers to find more relevant files and answer questions about the codebase; spawn 1 docs research to find relevant docs;
80+
1. Spawn a file explorer 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;
8281
1a. Read all the relevant files using the read_files tool.
83-
2. Spawn 1 more file picker and one more codebase explorer with different prompts to find relevant files; spawn a decomposing thinker with a question on a key decision; spawn a decomposing thinker to plan out the feature part-by-part.
82+
2. Spawn one more file explorer and one more find-all-referencer with different prompts to find relevant files; spawn a decomposing thinker with questions on a key decision; spawn a decomposing thinker to plan out the feature part-by-part.
8483
2a. Read all the relevant files using the read_files tool.
8584
3. Spawn a decomposing thinker to answer final design and implementation questions.
86-
4. Spawn 2 editors to implement all the changes.
85+
4. Spawn two editors to implement all the changes.
8786
5. Spawn a reviewer to review the changes made by the editors.
8887
8988
9089
## Guidelines
9190
9291
- **Sequence agents properly:** Keep in mind dependencies when spawning different agents:
93-
- Spawn file pickers, codebase explorers, and researchers before thinkers because then the thinkers can use the file/research results to come up with a better conclusions
92+
- 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
9493
- Spawn thinkers before editors so editors can use the insights from the thinkers.
9594
- Reviewers should be spawned after editors.
95+
- **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 editing or coding anything.
9696
- **Spawn editors later** Only spawn editors after gathering all the context.
9797
- **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.
9898
- **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.
9999
- **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.
100100
`,
101101

102-
stepPrompt: `Don't forget to spawn agents that could help, especially: the file-explorer to get codebase context, the thinker to think about key decisions, and the reviewer to review code changes made by the editor.`,
102+
stepPrompt: `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, and the reviewer to review code changes made by the editor.`,
103103

104104
handleSteps: function* ({ prompt, params }) {
105105
let steps = 0
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { ToolCall } from 'types/agent-definition'
2+
import { publisher } from '../constants'
3+
4+
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
5+
6+
const definition: SecretAgentDefinition = {
7+
id: 'find-all-referencer',
8+
displayName: 'Find All Referencer',
9+
spawnerPrompt:
10+
'Ask this agent to find all references to something in the codebase or where something is defined or answer any other codebase-wide questions.',
11+
model: 'x-ai/grok-4-fast',
12+
publisher,
13+
outputMode: 'last_message',
14+
includeMessageHistory: false,
15+
toolNames: ['spawn_agents', 'read_files'],
16+
spawnableAgents: [
17+
'file-picker',
18+
'code-searcher',
19+
'directory-lister',
20+
'glob-matcher',
21+
'file-q-and-a',
22+
],
23+
inputSchema: {
24+
prompt: {
25+
type: 'string',
26+
description:
27+
'The function or class or import etc. to find all references to in the codebase. Can accommodate vague requests as well!',
28+
},
29+
},
30+
systemPrompt: `You are a codebase exploration agent that is good at finding all references to something in the codebase or where something is defined.
31+
32+
Strategy:
33+
1. Analyze the user's question to determine what exploration approach would be most effective.
34+
2. Spawn agents to help you answer the user's question. You should spawn multiple agents in parallel to gather information faster.
35+
3. Synthesize all findings into a concise, but comprehensive answer.
36+
`,
37+
38+
instructionsPrompt: `Analyze the user's prompt and spawn appropriate exploration agents.
39+
40+
Use lots of different agents in parallel to gather more information faster.
41+
42+
Finally, synthesize all findings into a comprehensive and concise answer.`,
43+
44+
handleSteps: function* ({ prompt, params }) {
45+
yield {
46+
toolName: 'find_files',
47+
input: { prompt: prompt ?? '' },
48+
} satisfies ToolCall
49+
yield 'STEP_ALL'
50+
},
51+
}
52+
53+
export default definition

0 commit comments

Comments
 (0)