Codebuff

deep-code-reviewer

v0.0.1
Published Sep 9, 2025

Usage Statistics
v0.0.1

Definition

const agentDefinition = {
id: "deep-code-reviewer",
displayName: "Deep Code Reviewer",
publisher: "codebuff",
version: "0.0.1",
model: "anthropic/claude-sonnet-4",
toolNames: [
"read_files",
"code_search",
"run_terminal_command",
"spawn_agents"
],
spawnableAgents: [
"codebuff/file-explorer@0.0.3",
"codebuff/deep-thinker@0.0.2"
],
inputSchema: {
prompt: {
type: "string",
description: "Please provide a short description of the changes you want to review"
}
},
includeMessageHistory: false,
outputMode: "last_message",
spawnerPrompt: `Spawn when you need to review code changes in the git diff or staged changes`,
systemPrompt: `You are an expert software developer. Your job is to review code changes and provide helpful feedback.`,
instructionsPrompt: `Instructions:
1. Use git diff to get the changes, but also get untracked files.
2. Read the files that have changed.
3. Spawn a file explorer to find all related and relevant files.
4. Read all the files that could be relevant to the changes.
5. Spawn 5 deep-thinker agents to review the changes from different perspectives.
6. Synthesize the insights from the deep-thinker agents into a single review.
Use the following guidelines to review the changes and suggest improvements:
- Find ways to simplify the code
- Reuse existing code as much as possible instead of writing new code
- Preserve as much behavior as possible in the existing code
- Prefer changing as few lines of code as possible
- Look for opportunities to improve the code's readability
- Look for logical errors in the code
- Look for missed cases in the code
- Look for any other bugs`,
stepPrompt: ``,
handleSteps: function* () {
const { toolResult: gitDiffResult } = yield {
toolName: "run_terminal_command",
input: {
command: "git diff HEAD --name-only",
process_type: "SYNC",
timeout_seconds: 30
}
}, { toolResult: gitStatusResult } = yield {
toolName: "run_terminal_command",
input: {
command: "git status --porcelain"
}
};
yield {
toolName: "run_terminal_command",
input: {
command: "git diff HEAD"
}
};
const changedFiles = JSON.stringify(gitDiffResult ?? []).split(`
`).map((line) => line.trim()).filter((line) => line && !line.startsWith("??") && !line.includes("OSC")), untrackedFiles = JSON.stringify(gitStatusResult ?? []).split(`
`).map((line) => line.trim()).filter((line) => line.startsWith("??")).map((line) => line.substring(3).trim()).filter((file) => file), allFilesToRead = [...changedFiles, ...untrackedFiles].filter((file) => file);
if (allFilesToRead.length > 0)
yield {
toolName: "read_files",
input: {
paths: allFilesToRead
}
};
yield "STEP_ALL";
}
}