add Code Review agent with /review command support

This commit is contained in:
Chris Scott committed 2026-02-27 13:25:21 -05:00
1 parent 2b1dc9f72b
commit 6dc8cab06e
4 files changed
+134 -1

No files matched your search

+20
View File
@@ -13,6 +13,15 @@ const ENHANCED_BUILTIN_AGENTS: Record<string, { tools: Record<string, boolean> }
},
}
const PLUGIN_COMMANDS: Record<string, { template: string; description: string; agent: string; subtask: boolean }> = {
review: {
description: 'Run a code review on current changes',
agent: 'Code Review',
subtask: true,
template: 'Review the current code changes. $ARGUMENTS',
},
}
export function createConfigHandler(agents: Record<AgentRole, AgentDefinition>) {
return async (config: Record<string, unknown>) => {
const agentConfigs = createAgentConfigs(agents)
@@ -45,6 +54,17 @@ export function createConfigHandler(agents: Record<AgentRole, AgentDefinition>)
config.agent = mergedAgents
config.default_agent = 'Code'
const userCommands = config.command as Record<string, unknown> | undefined
const mergedCommands: Record<string, unknown> = { ...PLUGIN_COMMANDS }
if (userCommands) {
for (const [name, userCommand] of Object.entries(userCommands)) {
mergedCommands[name] = userCommand
}
}
config.command = mergedCommands
}
}