Skip to content

Commit 17e3f33

Browse files
committed
Add code sketcher
1 parent e3e1f3e commit 17e3f33

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

.agents/base2/base-layer.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ const definition: SecretAgentDefinition = {
3636
'researcher-docs',
3737
'read-only-commander',
3838
'decomposing-thinker',
39+
'code-sketcher',
3940
'editor',
4041
'decomposing-reviewer',
42+
'reviewer',
4143
'context-pruner',
4244
],
4345

@@ -79,9 +81,9 @@ The user asks you to implement a new feature. You respond in multiple steps:
7981
8082
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;
8183
1a. Read all the relevant files using the read_files tool.
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.
84+
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. Spawn a code sketcher to sketch out one key section of the code that is the most important or difficult.
8385
2a. Read all the relevant files using the read_files tool.
84-
3. Spawn a decomposing thinker to answer final design and implementation questions.
86+
3. Spawn a decomposing thinker to answer final design and implementation questions and critique the code sketch that was produced. Spawn one more code sketcher to sketch another key section.
8587
4. Spawn two editors to implement all the changes.
8688
5. Spawn a reviewer to review the changes made by the editors.
8789
@@ -99,7 +101,7 @@ The user asks you to implement a new feature. You respond in multiple steps:
99101
- **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.
100102
`,
101103

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.`,
104+
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, the code sketcher to sketch out the key sections of code, and the reviewer/decomposing-reviewer to review code changes made by the editor(s).`,
103105

104106
handleSteps: function* ({ prompt, params }) {
105107
let steps = 0
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import { publisher } from '../constants'
22
import { type SecretAgentDefinition } from '../types/secret-agent-definition'
33

44
const definition: SecretAgentDefinition = {
5-
id: 'code-drafter',
6-
displayName: 'Code Drafter',
5+
id: 'code-sketcher',
6+
displayName: 'Code Sketcher',
77
publisher,
88
model: 'anthropic/claude-sonnet-4.5',
99
spawnerPrompt:
10-
'Writes full implementation plans with complete code changes. Cannot use tools to edit files - instead describes all changes using markdown code blocks. Does not spawn other agents.',
10+
'Spawn to sketch the code that will be needed to accomplish the task, focusing on the the key sections of logic or interfaces. Cannot use tools to edit files - instead describes all changes using markdown code blocks. Does not spawn other agents.',
1111
inputSchema: {
1212
prompt: {
1313
type: 'string',
14-
description: 'The coding task to implement',
14+
description: 'The coding task to sketch out, including the key sections of logic or interfaces it should focus on.',
1515
},
1616
},
1717
outputMode: 'last_message',
@@ -20,16 +20,19 @@ const definition: SecretAgentDefinition = {
2020
toolNames: [],
2121
spawnableAgents: [],
2222

23-
instructionsPrompt: `You are an expert programmer who writes complete code implementations.
23+
instructionsPrompt: `You are an expert programmer who sketches out the code that will be needed to accomplish the task.
2424
2525
You do not have access to tools to modify files. Instead, you describe all code changes using markdown code blocks.
2626
2727
Instructions:
2828
- Think about the best way to accomplish the task
29-
- Write out the implementation for each file that needs to be changed
29+
- Write out the sketch for each file that needs to be changed
3030
- Use markdown code blocks with the file path as the language identifier
3131
- For each file, show the only the code changes needed, don't include the entire file
3232
33+
Important: Focus on the key sections of logic or interfaces that are needed to accomplish the task! You don't need to sketch out the more obvious parts of the code.
34+
You can skip over parts of the code using psuedo code or placeholder comments.
35+
3336
Guidelines:
3437
- Pay close attention to the user's request and address all requirements
3538
- Focus on the simplest solution that accomplishes the task
@@ -40,9 +43,12 @@ Guidelines:
4043
- Do not add try/catch blocks unless needed
4144
- Do not write duplicate code that could use existing helpers
4245
43-
Format your response with:
44-
\`\`\`path/to/file.ts
45-
// Complete code for this file
46+
Format your response with file blocks, like this:
47+
path/to/file.ts
48+
\`\`\`typescript
49+
// ... existing code ...
50+
[this is is the key section of code]
51+
// ... existing code ...
4652
\`\`\`
4753
`,
4854
}

0 commit comments

Comments
 (0)