Skip to content

Commit ee99042

Browse files
committed
[buffbench] Expand Codelayer agent collection with specialized agents
and comprehensive documentation Adds five new Codelayer agents (spec-parser, completion-verifier, project-context-analyzer, smart-discovery, validation-pipeline) to enhance the foundational agent's capabilities. Includes implementation strategy, improvement plans, evaluation results, and summary documentation for the expanded agent ecosystem. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 227745c commit ee99042

6 files changed

Lines changed: 634 additions & 0 deletions

File tree

.agents/codelayer/codelayer-base.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const definition: SecretAgentDefinition = {
2424
'thoughts-analyzer',
2525
'thoughts-locator',
2626
'web-search-researcher',
27+
'codelayer/spec-parser',
28+
'codelayer/completion-verifier',
29+
'codelayer/project-context-analyzer',
30+
'codelayer/smart-discovery',
31+
'codelayer/validation-pipeline',
2732
],
2833

2934
inputSchema: {
@@ -79,6 +84,8 @@ Always read the command files to get the latest instructions rather than relying
7984

8085
instructionsPrompt:
8186
'As Codelayer Base, you are a foundational agent in the Codelayer collection that provides core functionality and coordination. You can detect trigger phrases in user input and execute corresponding commands by reading markdown files from the commands directory. When you detect triggers, read the appropriate .md file, extract the prompt section, and follow the instructions. Always coordinate with other Codelayer agents as needed and provide clear, helpful responses about command execution and results.',
87+
88+
8289
}
8390

8491
export default definition
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import type { AgentDefinition } from '../types/agent-definition'
2+
3+
const definition: AgentDefinition = {
4+
id: 'completion-verifier',
5+
publisher: 'codelayer',
6+
model: 'google/gemini-2.5-flash',
7+
displayName: 'Completion Verifier',
8+
9+
toolNames: ['read_files', 'code_search', 'set_output'],
10+
11+
inputSchema: {
12+
prompt: {
13+
type: 'string',
14+
description: 'Context about what should be verified for completion'
15+
},
16+
params: {
17+
type: 'object',
18+
properties: {
19+
requirements: {
20+
type: 'array',
21+
description: 'Original requirements from spec-parser'
22+
},
23+
completedSubgoals: {
24+
type: 'array',
25+
description: 'List of completed subgoal IDs'
26+
}
27+
},
28+
required: ['requirements']
29+
}
30+
},
31+
32+
outputMode: 'structured_output',
33+
outputSchema: {
34+
type: 'object',
35+
properties: {
36+
overallComplete: {
37+
type: 'boolean'
38+
},
39+
completedRequirements: {
40+
type: 'array',
41+
items: { type: 'string' }
42+
},
43+
missingRequirements: {
44+
type: 'array',
45+
items: {
46+
type: 'object',
47+
properties: {
48+
id: { type: 'string' },
49+
description: { type: 'string' },
50+
reason: { type: 'string' }
51+
}
52+
}
53+
},
54+
qualityIssues: {
55+
type: 'array',
56+
items: {
57+
type: 'object',
58+
properties: {
59+
file: { type: 'string' },
60+
issue: { type: 'string' },
61+
severity: { type: 'string', enum: ['critical', 'high', 'medium', 'low'] }
62+
}
63+
}
64+
}
65+
},
66+
required: ['overallComplete', 'completedRequirements', 'missingRequirements']
67+
},
68+
69+
spawnerPrompt: 'Verify that all requirements from a user request have been properly completed and implemented',
70+
71+
systemPrompt: 'You are a completion verifier that ensures all parts of a user request have been properly implemented. Your job is to prevent the common failure mode of dropping requirements.',
72+
73+
instructionsPrompt: `Verify completion by checking each requirement against actual implementation:
74+
75+
**Verification Process:**
76+
1. **Cross-reference requirements** - Check each requirement against completed work
77+
2. **File existence checks** - Verify expected files were created/modified
78+
3. **Test coverage verification** - Ensure test files exist for code changes
79+
4. **Schema/migration checks** - Verify database changes include proper migrations
80+
5. **Documentation updates** - Check for changelog, README, or other doc updates
81+
82+
**Key Verification Points:**
83+
- Code changes: Verify the actual code was modified as required
84+
- Test updates: Check that test files exist and cover new functionality
85+
- Schema updates: Ensure migrations or schema files were updated
86+
- Documentation: Verify any required docs were updated
87+
88+
**Quality Checks:**
89+
- Look for obvious bugs or architectural issues
90+
- Check for incomplete implementations
91+
- Verify imports and dependencies are correct
92+
- Ensure no dead code was left behind
93+
94+
**Output Guidelines:**
95+
- Mark overallComplete as false if ANY requirement is missing
96+
- Provide specific reasons for missing requirements
97+
- Flag quality issues by severity
98+
- Be thorough but efficient in verification
99+
100+
This is a critical safety step - be comprehensive in your verification.`,
101+
}
102+
103+
export default definition
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
import type { AgentDefinition } from '../types/agent-definition'
2+
3+
const definition: AgentDefinition = {
4+
id: 'project-context-analyzer',
5+
publisher: 'codelayer',
6+
model: 'anthropic/claude-4-sonnet-20250522',
7+
displayName: 'Project Context Analyzer',
8+
9+
toolNames: ['read_files', 'code_search', 'set_output', 'spawn_agents'],
10+
spawnableAgents: ['codebase-analyzer', 'codebase-pattern-finder'],
11+
12+
inputSchema: {
13+
prompt: {
14+
type: 'string',
15+
description: 'Context about what architectural analysis is needed'
16+
},
17+
},
18+
19+
outputMode: 'structured_output',
20+
outputSchema: {
21+
type: 'object',
22+
properties: {
23+
framework: {
24+
type: 'string',
25+
description: 'Primary framework (nextjs, express, django, etc.)'
26+
},
27+
architecture: {
28+
type: 'array',
29+
items: {
30+
type: 'object',
31+
properties: {
32+
pattern: { type: 'string' },
33+
locations: { type: 'array', items: { type: 'string' } },
34+
description: { type: 'string' }
35+
}
36+
}
37+
},
38+
conventions: {
39+
type: 'array',
40+
items: {
41+
type: 'object',
42+
properties: {
43+
type: { type: 'string' },
44+
rule: { type: 'string' },
45+
examples: { type: 'array', items: { type: 'string' } }
46+
}
47+
}
48+
},
49+
testingStrategy: {
50+
type: 'object',
51+
properties: {
52+
framework: { type: 'string' },
53+
patterns: { type: 'array', items: { type: 'string' } },
54+
locations: { type: 'array', items: { type: 'string' } }
55+
}
56+
},
57+
fileStructure: {
58+
type: 'object',
59+
properties: {
60+
sourceDirectories: { type: 'array', items: { type: 'string' } },
61+
testDirectories: { type: 'array', items: { type: 'string' } },
62+
configFiles: { type: 'array', items: { type: 'string' } },
63+
schemaFiles: { type: 'array', items: { type: 'string' } }
64+
}
65+
},
66+
packageManager: {
67+
type: 'string',
68+
enum: ['npm', 'yarn', 'pnpm', 'bun']
69+
}
70+
},
71+
required: ['framework', 'architecture', 'conventions', 'testingStrategy', 'fileStructure']
72+
},
73+
74+
spawnerPrompt: 'Analyze project architecture, frameworks, conventions, and patterns to provide context for implementation decisions',
75+
76+
systemPrompt: 'You are a project context analyzer that provides comprehensive architectural understanding to prevent incorrect implementation decisions.',
77+
78+
instructionsPrompt: `Analyze the project to understand its architecture and conventions:
79+
80+
**Framework Detection:**
81+
- Identify the primary framework (Next.js, Express, Django, etc.)
82+
- Look at package.json, framework-specific config files
83+
- Note any meta-frameworks or additional tools
84+
85+
**Architecture Patterns:**
86+
- Identify common patterns (MVC, hexagonal, microservices, etc.)
87+
- Note how modules are organized
88+
- Understand data flow and dependency patterns
89+
90+
**Code Conventions:**
91+
- Naming conventions for files, functions, variables
92+
- Import/export patterns
93+
- Error handling approaches
94+
- Logging and debugging patterns
95+
96+
**Testing Strategy:**
97+
- Testing framework in use (Jest, Vitest, etc.)
98+
- Test file naming and location patterns
99+
- Test coverage expectations
100+
- Mock/stub patterns
101+
102+
**File Structure:**
103+
- Source code organization
104+
- Test file locations
105+
- Configuration file patterns
106+
- Schema/migration file locations
107+
108+
**Package Management:**
109+
- Detect package manager from lock files
110+
- Note any special scripts or tooling
111+
112+
Use the codebase-analyzer and codebase-pattern-finder agents to gather comprehensive information, then synthesize into structured context that can guide implementation decisions.`,
113+
114+
handleSteps: function* ({ prompt }) {
115+
// Parallel analysis of different aspects
116+
const { toolResult } = yield {
117+
toolName: 'spawn_agents',
118+
input: {
119+
agents: [
120+
{
121+
agent_type: 'codebase-analyzer',
122+
prompt: 'Analyze the overall project framework, architecture patterns, and file organization structure'
123+
},
124+
{
125+
agent_type: 'codebase-pattern-finder',
126+
prompt: 'Find common coding patterns, naming conventions, testing strategies, and implementation approaches used throughout the codebase'
127+
}
128+
],
129+
cb_easp: true
130+
}
131+
}
132+
133+
// Process and synthesize the results into structured output
134+
yield 'STEP_ALL'
135+
},
136+
}
137+
138+
export default definition

0 commit comments

Comments
 (0)