1+ // @ts -nocheck
2+ import type { AgentConfig } from './types/agent-config'
3+
4+ const config : AgentConfig = {
5+ id : 'level-2-test-generator' ,
6+ displayName : 'Tessa the Test Generator (Level 2)' ,
7+ model : 'anthropic/claude-3.5-sonnet-20240620' ,
8+
9+ toolNames : [
10+ 'read_files' ,
11+ 'write_file' ,
12+ 'str_replace' ,
13+ 'code_search' ,
14+ 'run_terminal_command' ,
15+ 'spawn_agents' ,
16+ 'set_output' ,
17+ 'end_turn'
18+ ] ,
19+
20+ subagents : [ 'file-picker' ] ,
21+
22+ inputSchema : {
23+ prompt : {
24+ type : 'string' ,
25+ description : 'Code files or functions you want comprehensive tests generated for'
26+ } ,
27+ params : {
28+ type : 'object' ,
29+ properties : {
30+ testType : {
31+ type : 'string' ,
32+ description : 'Type of tests to generate: unit, integration, or both'
33+ } ,
34+ framework : {
35+ type : 'string' ,
36+ description : 'Testing framework preference (jest, vitest, etc.)'
37+ } ,
38+ coverage : {
39+ type : 'string' ,
40+ description : 'Coverage level: basic, comprehensive, or edge-cases'
41+ }
42+ }
43+ }
44+ } ,
45+
46+ outputMode : 'json' ,
47+ outputSchema : {
48+ type : 'object' ,
49+ properties : {
50+ summary : { type : 'string' } ,
51+ testsCreated : {
52+ type : 'array' ,
53+ items : {
54+ type : 'object' ,
55+ properties : {
56+ file : { type : 'string' } ,
57+ testFile : { type : 'string' } ,
58+ testCount : { type : 'number' } ,
59+ coverage : { type : 'string' }
60+ }
61+ }
62+ } ,
63+ recommendations : {
64+ type : 'array' ,
65+ items : { type : 'string' }
66+ }
67+ }
68+ } ,
69+
70+ parentPrompt : 'Generates comprehensive test suites for code files and functions. Intermediate complexity with multiple testing strategies.' ,
71+
72+ systemPrompt : `# Tessa the Test Generator (Level 2)
73+
74+ You are an expert test engineer who creates comprehensive, maintainable test suites. You understand:
75+
76+ - Multiple testing frameworks and their conventions
77+ - Test-driven development principles
78+ - Edge case identification
79+ - Mock and stub strategies
80+ - Test organization and structure
81+
82+ ## Testing Philosophy
83+ - Write tests that document behavior
84+ - Cover happy paths, edge cases, and error conditions
85+ - Use descriptive test names and clear assertions
86+ - Minimize test coupling and maximize maintainability
87+ - Balance thoroughness with practicality
88+
89+ ## Test Types You Generate
90+ - **Unit Tests**: Individual function/method testing
91+ - **Integration Tests**: Component interaction testing
92+ - **Edge Case Tests**: Boundary and error condition testing
93+ - **Performance Tests**: Basic performance validation
94+
95+ ## Code Analysis Skills
96+ - Identify testable units and their dependencies
97+ - Recognize complex logic that needs thorough testing
98+ - Spot potential failure points and edge cases
99+ - Understand mocking requirements for external dependencies` ,
100+
101+ instructionsPrompt : `Generate comprehensive tests for the provided code. Your process:
102+
103+ 1. **Analyze the codebase** using file-picker if needed to understand structure
104+ 2. **Read target files** to understand functionality and dependencies
105+ 3. **Identify test scenarios** including:
106+ - Happy path cases
107+ - Edge cases and boundary conditions
108+ - Error handling scenarios
109+ - Integration points
110+ 4. **Generate test files** with:
111+ - Proper test framework setup
112+ - Descriptive test names
113+ - Comprehensive assertions
114+ - Appropriate mocks/stubs
115+ 5. **Run tests** to ensure they work
116+ 6. **Provide recommendations** for testing strategy improvements
117+
118+ Focus on creating maintainable, readable tests that serve as documentation.` ,
119+
120+ handleSteps : function * ( { agentState, prompt, params } ) {
121+ // Step 1: Understand the codebase structure
122+ yield {
123+ toolName : 'spawn_agents' ,
124+ args : {
125+ agents : [ {
126+ agent_type : 'file-picker' ,
127+ prompt : `Find files related to: ${ prompt } . Look for source files that need testing and existing test files to understand patterns.`
128+ } ]
129+ }
130+ }
131+
132+ // Step 2: Let the model analyze and generate tests
133+ yield 'STEP_ALL'
134+ }
135+ }
136+
137+ export default config
0 commit comments