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
Other agents this agent can spawn. Use the fully qualified agent ID from the agent store (publisher/name@version) or the agent ID from a local agent file.
95
142
96
-
**Available Built-in Agents:**
143
+
> **⚠️ Important:** When referencing built-in agents, you **must** specify both publisher and version (e.g., `codebuff/reviewer@0.0.1`). Omit publisher/version only for local agents defined in your `.agents/` directory.
97
144
98
-
-`CodebuffAI/base` - Main coding assistant
99
-
-`CodebuffAI/reviewer` - Code review agent
100
-
-`CodebuffAI/thinker` - Deep thinking agent
101
-
-`CodebuffAI/researcher` - Research and documentation agent
102
-
-`CodebuffAI/planner` - Planning and architecture agent
103
-
-`CodebuffAI/file_picker` - File discovery agent
145
+
**Referencing Agents:**
146
+
- Published/built-in agents: `"codebuff/file-picker@0.0.1"` (publisher and version required!)
147
+
- Local agents: `"my-custom-agent"` (just the agent ID)
148
+
149
+
**Available Built-in Agents:**
150
+
-`codebuff/base` - Main coding assistant
151
+
-`codebuff/reviewer` - Code review agent
152
+
-`codebuff/thinker` - Deep thinking agent
153
+
-`codebuff/researcher` - Research and documentation agent
154
+
-`codebuff/planner` - Planning and architecture agent
@@ -124,19 +176,75 @@ All prompt fields support two formats:
124
176
}
125
177
```
126
178
127
-
#### Required Prompts
179
+
#### Prompt Fields (all optional)
180
+
181
+
#### `systemPrompt` (string or object, optional)
182
+
183
+
Background information for the agent. Fairly optional - prefer using `instructionsPrompt` for agent instructions.
184
+
185
+
#### `instructionsPrompt` (string or object, optional)
186
+
187
+
Instructions for the agent. **This is the best way to shape the agent's behavior** and is inserted after each user input.
188
+
189
+
#### `stepPrompt` (string or object, optional)
190
+
191
+
Prompt inserted at each agent step. Powerful for changing behavior but usually not necessary for smart models.
128
192
129
-
#### `systemPrompt` (string or object, required)
193
+
###Programmatic Control
130
194
131
-
Core instructions that define the agent's behavior and personality.
195
+
#### `handleSteps` (generator function, optional)
132
196
133
-
#### `instructionsPrompt` (string or object, required)
197
+
**🚀 This is what makes Codebuff agents truly powerful!** Unlike traditional prompt-based agents, `handleSteps` lets you write actual code to control agent behavior.
134
198
135
-
Instructions for how to process user input.
199
+
Programmatically control the agent's execution using a TypeScript generator function. This enables:
200
+
-**Dynamic decision making** based on tool results
201
+
-**Complex orchestration** between multiple tools and agents
202
+
-**Conditional branching** based on file contents or agent responses
203
+
-**Iterative refinement** until desired results are achieved
204
+
-**State management** across multiple steps
136
205
137
-
#### `stepPrompt` (string or object, required)
138
206
139
-
Instructions for each step of the agent's execution.
207
+
**What You Can Yield:**
208
+
209
+
| Yield Value | What It Does |
210
+
|------------|-------------|
211
+
| Tool call object | Execute a specific tool and get its result |
212
+
|`'STEP'`| Run agent's LLM for one generation step |
@@ -157,86 +265,81 @@ JSON Schema definitions for validating prompt and params when spawning the agent
157
265
"type": "string",
158
266
"enum": ["markdown", "html"]
159
267
}
160
-
}
161
-
}
162
-
}
163
268
```
164
269
165
-
### Parent Instructions
166
-
167
-
#### `parentInstructions` (object, optional)
168
-
169
-
Defines instructions that this agent provides to other agents when they are spawned. This allows agents to guide the behavior of their sub-agents without creating full overrides.
170
-
171
-
**How it works:**
172
-
173
-
- When an agent spawns another agent, the system looks for any `parentInstructions` targeting that agent type
174
-
- These instructions are automatically injected into the spawned agent's `userInputPrompt`
175
-
- Multiple agents can provide instructions for the same target agent - all will be included
0 commit comments