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
@@ -77,17 +78,21 @@ Continue to spawn layers of agents until have completed the user's request or re
77
78
78
79
The user asks you to implement a new feature. You respond in multiple steps:
79
80
80
-
1. Spawn a 3 file pickers with different prompts to find relevant files; spawn 1 code searcher with a few search queries; spawn 1 docs research to find relevant docs;
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;
81
82
1a. Read all the relevant files using the read_files tool.
82
-
2. Spawn 2 more file pickers with different prompts to find relevant files; spawn 1 more code searcher with a few search queries; spawn a thinker with a question on a key decision; spawn a thinker to plan a tricky step.
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.
83
84
2a. Read all the relevant files using the read_files tool.
85
+
3. Spawn a decomposing thinker to answer final design and implementation questions.
84
86
4. Spawn 2 editors to implement all the changes.
85
87
5. Spawn a reviewer to review the changes made by the editors.
86
88
87
89
88
90
## Guidelines
89
91
90
-
- **Sequence agents properly:** Keep in mind dependencies when spawning different agents: spawn a file picker or researcher before a thinker because then the thinker can use the file picker's results to come up with a better conclusions. Reviewers should be spawned after editors.
92
+
- **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
94
+
- Spawn thinkers before editors so editors can use the insights from the thinkers.
95
+
- Reviewers should be spawned after editors.
91
96
- **Spawn editors later** Only spawn editors after gathering all the context.
92
97
- **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.
93
98
- **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.
Copy file name to clipboardExpand all lines: .agents/file-explorer/code-searcher.ts
+19-4Lines changed: 19 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,25 @@ const paramsSchema = {
17
17
items: {
18
18
type: 'object'asconst,
19
19
properties: {
20
-
pattern: {type: 'string'asconst},
21
-
flags: {type: 'string'asconst},
22
-
cwd: {type: 'string'asconst},
23
-
maxResults: {type: 'number'asconst},
20
+
pattern: {
21
+
type: 'string'asconst,
22
+
description: 'The pattern to search for',
23
+
},
24
+
flags: {
25
+
type: 'string'asconst,
26
+
description:
27
+
'Optional ripgrep flags to customize the search (e.g., "-i" for case-insensitive, "-t ts" for TypeScript files only, "-A 3" for 3 lines after match, "-B 2" for 2 lines before match, "--type-not test" to exclude test files)',
28
+
},
29
+
cwd: {
30
+
type: 'string'asconst,
31
+
description:
32
+
'Optional working directory to search within, relative to the project root. Defaults to searching the entire project',
33
+
},
34
+
maxResults: {
35
+
type: 'number'asconst,
36
+
description:
37
+
'Maximum number of results to return per file. Defaults to 15. There is also a global limit of 250 results across all files',
systemPrompt: `You are a codebase exploration orchestrator. Your job is to spawn multiple specialized agents in parallel waves to comprehensively explore the codebase and answer the user's question.
1. Analyze the user's question to determine what exploration approach would be most effective
52
-
2. Spawn multiple agents in parallel in the first wave to gather information from different angles
53
-
3. Based on the results, you can spawn additional agents in subsequent waves if needed to fill gaps
54
-
4. Synthesize all findings into a comprehensive answer`,
55
-
56
-
instructionsPrompt: `Analyze the user's prompt and spawn appropriate exploration agents in parallel.
31
+
1. Analyze the user's question to determine what exploration approach would be most effective.
32
+
2. You may spawn agents to help you answer the user's question. Feel free to spawn multiple agents in parallel to gather information from different angles.
33
+
3. Synthesize all findings into a comprehensive answer.`,
57
34
58
-
After reviewing the results, spawn additional agents if needed to fill gaps.
35
+
instructionsPrompt: `Analyze the user's prompt and spawn appropriate exploration agents.
59
36
60
37
Finally, synthesize all findings into a comprehensive answer.`,
description: 'Path to the file to ask questions about',
12
+
},
13
+
},
14
+
required: ['filePath'],
15
+
}
16
+
17
+
constfileQAndA: SecretAgentDefinition={
18
+
id: 'file-q-and-a',
19
+
displayName: 'Quinn the File Q&A',
20
+
spawnerPrompt:
21
+
'Reads a single file and answers questions about it - can summarize, explain specific parts, or excerpt portions of the file',
22
+
model: 'x-ai/grok-4-fast',
23
+
publisher,
24
+
outputMode: 'last_message',
25
+
includeMessageHistory: false,
26
+
toolNames: ['read_files'],
27
+
spawnableAgents: [],
28
+
inputSchema: {
29
+
prompt: {
30
+
type: 'string',
31
+
description:
32
+
'A question about the file - can ask for a summary, explanation of specific functionality, or an excerpt of a particular section',
33
+
},
34
+
params: paramsSchema,
35
+
},
36
+
systemPrompt:
37
+
'You are an expert at reading and analyzing code files. Answer questions about files clearly and accurately. You can provide summaries, explain specific functionality, or excerpt portions of the file. When excerpting, reproduce the code exactly as it appears in the file.',
38
+
instructionsPrompt: `
39
+
Read the file and answer the user's question about it. Depending on what they're asking:
40
+
- For summaries: explain the main purpose, key functions/classes/exports, and important patterns
41
+
- For specific questions: focus on the relevant parts and provide clear explanations
42
+
- For excerpts: reproduce the requested code exactly as it appears in the file
43
+
`.trim(),
44
+
stepPrompt: 'Do not use any tools again. Just answer the question about the file.',
0 commit comments