1+ import type { AgentDefinition } from './types/agent-definition'
12import { publisher } from './constants'
23
3- import type {
4- AgentDefinition ,
5- AgentStepContext ,
6- } from './types/agent-definition'
7-
84const definition : AgentDefinition = {
9- id : 'changes -reviewer' ,
5+ id : 'deep-code -reviewer' ,
106 publisher,
11- displayName : 'Changes Reviewer' ,
12- model : 'x-ai/grok -4' ,
7+ displayName : 'Deep Code Reviewer' ,
8+ model : 'anthropic/claude-sonnet -4' ,
139
1410 includeMessageHistory : false ,
1511
1612 spawnerPrompt :
1713 'Spawn when you need to review code changes in the git diff or staged changes' ,
1814
19- toolNames : [ 'read_files' , 'run_terminal_command' , 'spawn_agents' ] ,
20- spawnableAgents : [ 'file-explorer' ] ,
21-
22- inputSchema : {
23- prompt : {
24- type : 'string' ,
25- description :
26- 'Please provide a short description of the changes you want to review' ,
27- } ,
28- } ,
15+ toolNames : [
16+ 'read_files' ,
17+ 'code_search' ,
18+ 'run_terminal_command' ,
19+ 'spawn_agents' ,
20+ ] ,
21+ spawnableAgents : [ 'file-explorer' , 'deep-thinker' ] ,
22+
23+ instructionsPrompt : `Instructions:
24+ 1. Use git diff to get the changes, but also get untracked files.
25+ 2. Read the files that have changed.
26+ 3. Spawn a file explorer to find all related and relevant files.
27+ 4. Read all the files that could be relevant to the changes.
28+ 5. Spawn 5 deep-thinker agents to review the changes from different perspectives.
29+ 6. Synthesize the insights from the deep-thinker agents into a single review.
2930
30- systemPrompt :
31- 'You are an expert software developer. Your job is to review code changes and provide helpful feedback.' ,
32-
33- instructionsPrompt : `
3431Use the following guidelines to review the changes and suggest improvements:
3532- Find ways to simplify the code
3633- Reuse existing code as much as possible instead of writing new code
@@ -42,14 +39,12 @@ Use the following guidelines to review the changes and suggest improvements:
4239- Look for any other bugs
4340 ` . trim ( ) ,
4441
45- handleSteps : function * ( { agentState , prompt , params } : AgentStepContext ) {
42+ handleSteps : function * ( ) {
4643 // Step 1: Get list of changed files from git diff
4744 const { toolResult : gitDiffResult } = yield {
4845 toolName : 'run_terminal_command' ,
4946 input : {
5047 command : 'git diff HEAD --name-only' ,
51- process_type : 'SYNC' ,
52- timeout_seconds : 30 ,
5348 } ,
5449 }
5550
@@ -58,8 +53,6 @@ Use the following guidelines to review the changes and suggest improvements:
5853 toolName : 'run_terminal_command' ,
5954 input : {
6055 command : 'git status --porcelain' ,
61- process_type : 'SYNC' ,
62- timeout_seconds : 30 ,
6356 } ,
6457 }
6558
@@ -68,8 +61,6 @@ Use the following guidelines to review the changes and suggest improvements:
6861 toolName : 'run_terminal_command' ,
6962 input : {
7063 command : 'git diff HEAD' ,
71- process_type : 'SYNC' ,
72- timeout_seconds : 30 ,
7364 } ,
7465 }
7566
@@ -102,17 +93,6 @@ Use the following guidelines to review the changes and suggest improvements:
10293 }
10394 }
10495
105- // Step 5: Put words in the AI's mouth to get it to spawn the file explorer.
106- yield {
107- toolName : 'add_message' ,
108- input : {
109- role : 'assistant' ,
110- content :
111- 'Now I will spawn a file explorer to find any missing codebase context, and then review the changes.' ,
112- } ,
113- includeToolCall : false ,
114- }
115-
11696 yield 'STEP_ALL'
11797 } ,
11898}
0 commit comments