Skip to content

Commit f97404c

Browse files
committed
Add decomposing thinker, update base2
1 parent 0fbd407 commit f97404c

File tree

4 files changed

+102
-6
lines changed

4 files changed

+102
-6
lines changed

.agents/base2/base2.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ const definition: SecretAgentDefinition = {
2828
},
2929
outputMode: 'last_message',
3030
includeMessageHistory: true,
31-
toolNames: ['spawn_agents', 'read_files'],
31+
toolNames: ['spawn_agents', 'read_files', 'code_search'],
3232
spawnableAgents: [
3333
'read-only-commander',
3434
'researcher-file-explorer',
3535
'researcher-web',
3636
'researcher-docs',
37+
'decomposing-thinker',
3738
'decomposing-planner',
3839
'editor',
3940
'reviewer-max',
@@ -73,10 +74,11 @@ Use this workflow to solve a medium or complex coding task:
7374
1. Spawn relevant researchers in parallel (researcher-file-explorer, researcher-web, researcher-docs)
7475
2. Read all the relevant files using the read_files tool.
7576
3. Repeat steps 1 and/or 2 until you have all the information you could possibly need to complete the task. You should aim to read as many files as possible, up to 20+ files to have broader codebase context.
76-
4. Spawn a decomposing planner to come up with a plan.
77-
5. Spawn an editor to implement the plan. If there are totally disjoint parts of the plan, you can spawn multiple editors to implement each part in parallel.
78-
6. Spawn a reviewer to review the code. If changes are needed, go back to step 5, but no more than once.
79-
7. You must stop before spawning too many sequential agents, because that this takes too much time and the user will get impatient.
77+
4. Spawn a decomposing thinker to come up with insights.
78+
5. Spawn a decomposing planner to come up with a plan.
79+
6. Spawn an editor to implement the plan. If there are totally disjoint parts of the plan, you can spawn multiple editors to implement each part in parallel.
80+
7. Spawn a reviewer to review the code. If changes are needed, go back to step 5, but no more than once.
81+
8. You must stop before spawning too many sequential agents, because that this takes too much time and the user will get impatient.
8082
8183
Feel free to modify this workflow as needed. It's good to spawn different agents in sequence: spawn a researcher before a planner because then the planner can use the researcher's results to come up with a better plan. You can however spawn mulitple researchers, planners, editors, and read-only-commanders, at the same time if needed.
8284

.agents/read-only-commander.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const readOnlyCommander: SecretAgentDefinition = {
1919
includeMessageHistory: true,
2020
inheritParentSystemPrompt: true,
2121
toolNames: ['run_terminal_command', 'code_search', 'read_files'],
22-
instructionsPrompt: `You are an expert software engineer, however you only execute READ ONLY commands to answer the user's question.
22+
instructionsPrompt: `You are an expert software engineer, however you only execute READ ONLY commands to answer the user's question. You also cannot spawn any agents.
2323
2424
Use the tools to answer the user's question. But do not invoke any terminal commands that could have any permanent effects -- no editing files, no running scripts, no git commits, no installing packages, etc.`,
2525
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { publisher } from '../constants'
2+
3+
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
4+
5+
const definition: SecretAgentDefinition = {
6+
id: 'decomposing-thinker',
7+
publisher,
8+
model: 'anthropic/claude-sonnet-4.5',
9+
displayName: 'Decomposing Thinker',
10+
spawnerPrompt:
11+
'Creates comprehensive analysis by decomposing problems into multiple thinking angles and synthesizing insights from parallel thinker-sonnet agents.',
12+
inputSchema: {
13+
params: {
14+
type: 'object',
15+
properties: {
16+
prompts: {
17+
type: 'array',
18+
items: {
19+
type: 'string',
20+
description: 'A specific problem or topic to analyze',
21+
},
22+
description: 'A list of 2-10 specific problems or topics to analyze',
23+
},
24+
},
25+
required: ['prompts'],
26+
},
27+
},
28+
inheritParentSystemPrompt: true,
29+
includeMessageHistory: true,
30+
outputMode: 'structured_output',
31+
toolNames: ['spawn_agents', 'set_output'],
32+
spawnableAgents: ['thinker-sonnet'],
33+
34+
handleSteps: function* ({ params }) {
35+
const prompts: string[] = params?.prompts ?? []
36+
const { toolResult } = yield {
37+
toolName: 'spawn_agents',
38+
input: {
39+
agents: prompts.map((promptText) => ({
40+
agent_type: 'thinker-sonnet',
41+
prompt: promptText,
42+
})),
43+
},
44+
}
45+
46+
const thoughts = toolResult
47+
? toolResult.map((result) => (result.type === 'json' ? result.value : ''))
48+
: []
49+
yield {
50+
toolName: 'set_output',
51+
input: { results: thoughts },
52+
}
53+
},
54+
}
55+
56+
export default definition

.agents/thinker/thinker-sonnet.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { publisher } from '../constants'
2+
3+
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
4+
5+
const definition: SecretAgentDefinition = {
6+
id: 'thinker-sonnet',
7+
publisher,
8+
model: 'anthropic/claude-sonnet-4.5',
9+
displayName: 'Theo the Theorizer',
10+
spawnerPrompt:
11+
'Does deep thinking given the current messages and a specific prompt to focus on. Use this to help you solve a specific problem.',
12+
inputSchema: {
13+
prompt: {
14+
type: 'string',
15+
description: 'The problem you are trying to solve',
16+
},
17+
},
18+
outputMode: 'last_message',
19+
inheritParentSystemPrompt: true,
20+
includeMessageHistory: true,
21+
spawnableAgents: [],
22+
23+
instructionsPrompt: `
24+
Think deeply, step by step, about the user request and how best to approach it.
25+
26+
Consider edge cases, potential issues, and alternative approaches.
27+
28+
Come up with a list of insights that would help someone arrive at the best solution.
29+
30+
Try not to be too prescriptive or confident in one solution. Instead, give clear arguments and reasoning.
31+
32+
You must be extremely concise and to the point.
33+
34+
**Important**: Do not use any tools! You are only thinking!
35+
`.trim(),
36+
}
37+
38+
export default definition

0 commit comments

Comments
 (0)