const agentDefinition = {
id: "implementation-planner-max",
displayName: "Implementation Planner Max",
publisher: "codebuff",
version: "0.0.3",
model: "anthropic/claude-sonnet-4.5",
toolNames: [
"spawn_agents",
"set_output"
],
spawnableAgents: [
"codebuff/implementation-planner@0.0.5",
"codebuff/plan-selector@0.0.3"
],
inputSchema: {
prompt: {
type: "string",
description: "The task to plan for. Include the requirements and expected behavior after implementing the plan. Include quotes from the user of what they expect the plan to accomplish."
}
},
includeMessageHistory: true,
outputMode: "structured_output",
spawnerPrompt: `Creates the best possible implementation plan by generating several different plans in parallel and selecting the best one. Includes full code changes.`,
systemPrompt: ``,
instructionsPrompt: ``,
stepPrompt: ``,
handleSteps: function* ({ prompt }) {
const agents = Array.from({ length: 5 }, () => ({
agent_type: "implementation-planner",
prompt
})), { toolResult: plannerResults } = yield {
toolName: "spawn_agents",
input: {
agents
}
};
if (!Array.isArray(plannerResults)) {
yield {
toolName: "set_output",
input: { error: "Failed to generate plans." }
};
return;
}
const plannerResult = plannerResults[0], letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", plans = plannerResult.type === "json" ? plannerResult.value : [], plansWithIds = plans.map((plan, index) => ({
id: letters[index],
plan: JSON.stringify(plan)
})), { toolResult: selectedPlanResult } = yield {
toolName: "spawn_agents",
input: {
agents: [
{
agent_type: "plan-selector",
prompt: `Choose the best plan from these options for the task: ${prompt}`,
params: {
plans: plansWithIds
}
}
]
}
};
if (!Array.isArray(selectedPlanResult) || selectedPlanResult.length < 1) {
yield {
toolName: "set_output",
input: { error: "Failed to select a plan." }
};
return;
}
const selectedPlan = selectedPlanResult[0], selectedPlanId = selectedPlan.type === "json" && selectedPlan.value ? selectedPlan.value.selectedPlanId : null;
yield {
toolName: "set_output",
input: {
plan: plansWithIds.find((plan) => plan.id === selectedPlanId)?.plan ?? plans[0]
}
};
},
mcpServers: {},
inheritParentSystemPrompt: false
}