Skip to content

Commit 0e11d8c

Browse files
authored
The Renaming! (#222)
1 parent 34fc480 commit 0e11d8c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+590
-585
lines changed

.agents/templates/brainstormer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ export default {
66
version: '1.0.0',
77
override: false,
88

9-
name: 'Brian the Brainstormer',
10-
purpose:
9+
displayName: 'Brian the Brainstormer',
10+
parentPrompt:
1111
'Acts as a creative thought partner, generating ideas and exploring alternative viewpoints to help think through problems.',
1212
model: 'anthropic/claude-4-sonnet-20250522',
1313
outputMode: 'last_message',
1414
includeMessageHistory: true,
1515
toolNames: ['end_turn'],
16-
spawnableAgents: ['thinker', 'researcher'],
16+
subagents: ['thinker', 'researcher'],
1717
parentInstructions: {
1818
base: 'Spawn brainstormer when you need creative alternatives, want to challenge assumptions, or explore different approaches to implementation problems',
1919
base_lite:
@@ -27,7 +27,7 @@ export default {
2727
reviewer:
2828
'Engage brainstormer for creative problem-solving approaches to code review and innovative improvement suggestions',
2929
},
30-
promptSchema: {
30+
inputSchema: {
3131
prompt: z.toJSONSchema(
3232
z.string().describe('The problem or topic to brainstorm about.')
3333
),
@@ -37,8 +37,8 @@ export default {
3737
path: '.agents/templates/brainstormer-system.md',
3838
},
3939

40-
userInputPrompt:
40+
instructionsPrompt:
4141
'Act as a creative thought partner. Generate multiple perspectives, challenge assumptions, explore alternatives, and ask probing questions to help think through problems more thoroughly.',
42-
agentStepPrompt:
42+
stepPrompt:
4343
"Continue brainstorming and exploring ideas. When you're done, use the end_turn tool: ",
4444
} satisfies DynamicAgentConfig

.agents/templates/example-handlesteps-agent.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import { DynamicAgentConfig } from '@codebuff/common/types/dynamic-agent-templat
33
export default {
44
id: 'example-handlesteps-agent',
55
version: '1.0.0',
6-
name: 'Example HandleSteps Agent',
7-
purpose:
6+
displayName: 'Example HandleSteps Agent',
7+
parentPrompt:
88
'Demonstrates how to use handleSteps generator functions for programmatic agent control',
99
model: 'claude-3-5-sonnet-20241022',
1010
outputMode: 'json',
1111
toolNames: ['spawn_agents', 'set_output', 'end_turn'],
12-
spawnableAgents: ['file_picker'],
12+
subagents: ['file_picker'],
1313

1414
systemPrompt:
1515
'You are an example agent that demonstrates handleSteps functionality.',
16-
userInputPrompt: 'User request: {prompt}',
17-
agentStepPrompt: 'Continue processing the request.',
16+
instructionsPrompt: 'User request: {prompt}',
17+
stepPrompt: 'Continue processing the request.',
1818

1919
// Generator function that defines the agent's execution flow
2020
handleSteps: function* ({ agentState, prompt, params }) {

.agents/templates/git-committer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ export default {
44
id: 'CodebuffAI/git-committer',
55
version: '0.0.1',
66
model: 'anthropic/claude-sonnet-4',
7-
name: 'Git Committer',
8-
purpose:
7+
displayName: 'Git Committer',
8+
parentPrompt:
99
'A git committer agent specialized to commit current changes with an appropriate commit message.',
10-
promptSchema: {
10+
inputSchema: {
1111
prompt: {
1212
type: 'string',
1313
description: 'What changes to commit',
@@ -24,9 +24,9 @@ export default {
2424
],
2525
systemPrompt:
2626
'You are an expert software developer. Your job is to create a git commit with a really good commit message.',
27-
userInputPrompt: {
27+
instructionsPrompt: {
2828
path: './git-committer-user-prompt.md',
2929
},
30-
agentStepPrompt:
30+
stepPrompt:
3131
'Make sure to end your response by using set_output to output a structured summary of what you committed and whether it was successful. Finally, use end_turn to end your turn.',
3232
} satisfies DynamicAgentConfig

.agents/templates/knowledge-keeper.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export default {
44
id: 'knowledge-keeper',
55
version: '1.0.0',
66
override: false,
7-
name: 'Kendra the Knowledge Keeper',
8-
purpose:
7+
displayName: 'Kendra the Knowledge Keeper',
8+
parentPrompt:
99
'Expert at gathering, organizing, and maintaining project knowledge files and documentation.',
1010
model: 'anthropic/claude-4-sonnet-20250522',
1111
outputMode: 'last_message',
@@ -19,8 +19,8 @@ export default {
1919
'spawn_agents',
2020
'end_turn',
2121
],
22-
spawnableAgents: ['file_picker', 'researcher'],
23-
promptSchema: {
22+
subagents: ['file_picker', 'researcher'],
23+
inputSchema: {
2424
prompt: {
2525
type: 'string',
2626
description: 'A request to gather, organize, or update project knowledge',
@@ -43,8 +43,8 @@ export default {
4343
},
4444
systemPrompt:
4545
'You are Kendra the Knowledge Keeper, a specialized agent focused on gathering, organizing, and maintaining project knowledge. Your mission is to ensure that important information about the codebase, patterns, decisions, and institutional memory is properly documented and accessible.\n\nYour core responsibilities:\n1. Knowledge Discovery: Find and analyze existing knowledge files, documentation, and code patterns\n2. Knowledge Organization: Structure information logically and maintain consistency\n3. Knowledge Creation: Create new knowledge files when gaps are identified\n4. Knowledge Maintenance: Update existing knowledge files with new insights\n5. Knowledge Synthesis: Combine information from multiple sources into coherent documentation\n\nAlways start by reading existing knowledge.md files and documentation. Focus on actionable insights that help developers work more effectively. End your response with the end_turn tool.',
46-
userInputPrompt:
46+
instructionsPrompt:
4747
'Analyze the current state of project knowledge and provide recommendations for improvements. Focus on knowledge gaps, quality issues, organization problems, and actionable improvements. Then implement the most important changes.',
48-
agentStepPrompt:
48+
stepPrompt:
4949
'Continue your knowledge management work. Focus on the most impactful improvements and always end with the end_turn tool.',
5050
} satisfies DynamicAgentConfig

backend/knowledge.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ flowchart TD
7272
path?: string, // External file path
7373
content?: string // Inline content
7474
},
75-
userInputPrompt?: { /* same structure */ },
76-
agentStepPrompt?: { /* same structure */ },
75+
instructionsPrompt?: { /* same structure */ },
76+
stepPrompt?: { /* same structure */ },
7777
spawnableAgents?: { // Modify spawnable agents list
7878
type: 'append' | 'replace',
7979
content: string | string[]

backend/src/__tests__/dynamic-agent-loader.test.ts

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ describe('Dynamic Agent Loader', () => {
7777
id: 'brainstormer',
7878
version: '1.0.0',
7979
override: false,
80-
name: 'Brainy',
81-
purpose: 'Creative thought partner',
80+
displayName: 'Brainy',
81+
parentPrompt: 'Creative thought partner',
8282
model: 'anthropic/claude-4-sonnet-20250522',
8383
systemPrompt: 'You are a creative brainstormer.',
84-
userInputPrompt: 'Help brainstorm ideas.',
85-
agentStepPrompt: 'Continue brainstorming.',
84+
instructionsPrompt: 'Help brainstorm ideas.',
85+
stepPrompt: 'Continue brainstorming.',
8686
toolNames: ['end_turn'],
87-
spawnableAgents: ['thinker', 'researcher'],
87+
subagents: ['thinker', 'researcher'],
8888

8989
outputMode: 'last_message',
9090
includeMessageHistory: true,
@@ -96,7 +96,7 @@ describe('Dynamic Agent Loader', () => {
9696

9797
expect(result.validationErrors).toHaveLength(0)
9898
expect(result.templates).toHaveProperty('brainstormer')
99-
expect(result.templates.brainstormer.name).toBe('Brainy')
99+
expect(result.templates.brainstormer.displayName).toBe('Brainy')
100100
expect(result.templates.brainstormer.id).toBe('brainstormer')
101101
})
102102

@@ -108,13 +108,13 @@ describe('Dynamic Agent Loader', () => {
108108
id: 'invalid_agent',
109109
version: '1.0.0',
110110
override: false,
111-
name: 'Invalid',
112-
purpose: 'Invalid agent',
111+
displayName: 'Invalid',
112+
parentPrompt: 'Invalid agent',
113113
model: 'anthropic/claude-4-sonnet-20250522',
114114
systemPrompt: 'Test',
115-
userInputPrompt: 'Test',
116-
agentStepPrompt: 'Test',
117-
spawnableAgents: ['nonexistent_agent'],
115+
instructionsPrompt: 'Test',
116+
stepPrompt: 'Test',
117+
subagents: ['nonexistent_agent'],
118118
outputMode: 'last_message',
119119
includeMessageHistory: true,
120120
toolNames: ['end_turn'],
@@ -126,7 +126,7 @@ describe('Dynamic Agent Loader', () => {
126126

127127
expect(result.validationErrors).toHaveLength(1)
128128
expect(result.validationErrors[0].message).toContain(
129-
'Invalid spawnable agents: nonexistent_agent'
129+
'Invalid subagents: nonexistent_agent'
130130
)
131131
})
132132

@@ -138,16 +138,16 @@ describe('Dynamic Agent Loader', () => {
138138
id: 'custom_agent',
139139
version: '1.0.0',
140140
override: false,
141-
name: 'Custom',
142-
purpose: 'Custom agent',
141+
displayName: 'Custom',
142+
parentPrompt: 'Custom agent',
143143
model: 'anthropic/claude-4-sonnet-20250522',
144144
systemPrompt: 'Custom system prompt',
145-
userInputPrompt: 'Custom user prompt',
146-
agentStepPrompt: 'Custom step prompt',
145+
instructionsPrompt: 'Custom user prompt',
146+
stepPrompt: 'Custom step prompt',
147147
outputMode: 'last_message',
148148
includeMessageHistory: true,
149149
toolNames: ['end_turn'],
150-
spawnableAgents: [],
150+
subagents: [],
151151
},
152152
},
153153
}
@@ -169,13 +169,13 @@ describe('Dynamic Agent Loader', () => {
169169
id: 'schema_agent',
170170
version: '1.0.0',
171171
override: false,
172-
name: 'Schema Agent',
173-
purpose: 'Agent with JSON schemas',
172+
displayName: 'Schema Agent',
173+
parentPrompt: 'Agent with JSON schemas',
174174
model: 'anthropic/claude-4-sonnet-20250522',
175175
systemPrompt: 'Test system prompt',
176-
userInputPrompt: 'Test user prompt',
177-
agentStepPrompt: 'Test step prompt',
178-
promptSchema: {
176+
instructionsPrompt: 'Test user prompt',
177+
stepPrompt: 'Test step prompt',
178+
inputSchema: {
179179
prompt: {
180180
type: 'string',
181181
description: 'A test prompt',
@@ -190,7 +190,7 @@ describe('Dynamic Agent Loader', () => {
190190
outputMode: 'last_message',
191191
includeMessageHistory: true,
192192
toolNames: ['end_turn'],
193-
spawnableAgents: [],
193+
subagents: [],
194194
},
195195
},
196196
}
@@ -199,8 +199,8 @@ describe('Dynamic Agent Loader', () => {
199199

200200
expect(result.validationErrors).toHaveLength(0)
201201
expect(result.templates).toHaveProperty('schema_agent')
202-
expect(result.templates.schema_agent.promptSchema.prompt).toBeDefined()
203-
expect(result.templates.schema_agent.promptSchema.params).toBeDefined()
202+
expect(result.templates.schema_agent.inputSchema.prompt).toBeDefined()
203+
expect(result.templates.schema_agent.inputSchema.params).toBeDefined()
204204
})
205205

206206
it('should return validation errors for invalid schemas', async () => {
@@ -214,21 +214,21 @@ describe('Dynamic Agent Loader', () => {
214214
id: 'invalid_schema_agent',
215215
version: '1.0.0',
216216
override: false,
217-
name: 'Invalid Schema Agent',
218-
purpose: 'Agent with invalid schemas',
217+
displayName: 'Invalid Schema Agent',
218+
parentPrompt: 'Agent with invalid schemas',
219219
model: 'anthropic/claude-4-sonnet-20250522',
220220
systemPrompt: 'Test system prompt',
221-
userInputPrompt: 'Test user prompt',
222-
agentStepPrompt: 'Test step prompt',
223-
promptSchema: {
221+
instructionsPrompt: 'Test user prompt',
222+
stepPrompt: 'Test step prompt',
223+
inputSchema: {
224224
prompt: {
225225
type: 'number', // Invalid - should allow strings
226226
},
227227
},
228228
outputMode: 'last_message',
229229
includeMessageHistory: true,
230230
toolNames: ['end_turn'],
231-
spawnableAgents: [],
231+
subagents: [],
232232
},
233233
},
234234
}
@@ -237,7 +237,7 @@ describe('Dynamic Agent Loader', () => {
237237

238238
expect(result.validationErrors).toHaveLength(1)
239239
expect(result.validationErrors[0].message).toContain(
240-
'Invalid promptSchema.prompt'
240+
'Invalid inputSchema.prompt'
241241
)
242242
expect(result.validationErrors[0].message).toContain(
243243
'Schema must allow string or undefined values'
@@ -255,17 +255,17 @@ describe('Dynamic Agent Loader', () => {
255255
id: 'no_override_agent',
256256
version: '1.0.0',
257257
// No override field - should be treated as non-override
258-
name: 'No Override Agent',
259-
purpose: 'Agent without override field',
258+
displayName: 'No Override Agent',
259+
parentPrompt: 'Agent without override field',
260260
model: 'anthropic/claude-4-sonnet-20250522',
261261
systemPrompt: 'Test system prompt',
262-
userInputPrompt: 'Test user prompt',
263-
agentStepPrompt: 'Test step prompt',
262+
instructionsPrompt: 'Test user prompt',
263+
stepPrompt: 'Test step prompt',
264264
override: false,
265265
outputMode: 'last_message',
266266
includeMessageHistory: true,
267267
toolNames: ['end_turn'],
268-
spawnableAgents: [],
268+
subagents: [],
269269
},
270270
},
271271
}
@@ -286,13 +286,13 @@ describe('Dynamic Agent Loader', () => {
286286
id: 'CodebuffAI/git-committer',
287287
version: '0.0.1',
288288
override: false,
289-
name: 'Git Committer',
290-
purpose: 'A git committer agent',
289+
displayName: 'Git Committer',
290+
parentPrompt: 'A git committer agent',
291291
model: 'google/gemini-2.5-pro',
292292
systemPrompt: 'You are an expert software developer.',
293-
userInputPrompt: 'Create a commit message.',
294-
agentStepPrompt: 'Make sure to end your response.',
295-
spawnableAgents: [], // No spawnable agents
293+
instructionsPrompt: 'Create a commit message.',
294+
stepPrompt: 'Make sure to end your response.',
295+
subagents: [], // No spawnable agents
296296
outputMode: 'last_message',
297297
includeMessageHistory: true,
298298
toolNames: ['end_turn'],
@@ -301,13 +301,13 @@ describe('Dynamic Agent Loader', () => {
301301
id: 'spawner_agent',
302302
version: '1.0.0',
303303
override: false,
304-
name: 'Spawner Agent',
305-
purpose: 'Agent that can spawn git-committer',
304+
displayName: 'Spawner Agent',
305+
parentPrompt: 'Agent that can spawn git-committer',
306306
model: 'anthropic/claude-4-sonnet-20250522',
307307
systemPrompt: 'Test system prompt',
308-
userInputPrompt: 'Test user prompt',
309-
agentStepPrompt: 'Test step prompt',
310-
spawnableAgents: ['CodebuffAI/git-committer'], // Should be valid after first pass
308+
instructionsPrompt: 'Test user prompt',
309+
stepPrompt: 'Test step prompt',
310+
subagents: ['CodebuffAI/git-committer'], // Should be valid after first pass
311311
outputMode: 'last_message',
312312
includeMessageHistory: true,
313313
toolNames: ['end_turn'],
@@ -320,7 +320,7 @@ describe('Dynamic Agent Loader', () => {
320320
expect(result.validationErrors).toHaveLength(0)
321321
expect(result.templates).toHaveProperty('CodebuffAI/git-committer')
322322
expect(result.templates).toHaveProperty('spawner_agent')
323-
expect(result.templates.spawner_agent.spawnableAgents).toContain(
323+
expect(result.templates.spawner_agent.subagents).toContain(
324324
'git-committer' // Normalized without prefix
325325
)
326326
})

0 commit comments

Comments
 (0)