Codebuff

decomposing-thinker

v0.0.4
Published Oct 27, 2025

Usage Statistics
v0.0.4

Definition

const agentDefinition = {
id: "decomposing-thinker",
displayName: "Decomposing Thinker",
publisher: "codebuff",
version: "0.0.4",
model: "anthropic/claude-sonnet-4.5",
toolNames: [
"spawn_agents",
"set_output"
],
spawnableAgents: [
"codebuff/thinker-with-files-input@0.0.2"
],
inputSchema: {
params: {
type: "object",
required: [
"prompts"
],
properties: {
prompts: {
type: "array",
items: {
type: "string",
description: "A specific problem or topic to analyze"
},
description: "A list of 2-8 specific problems or topics to analyze"
},
filePaths: {
type: "array",
items: {
type: "string",
description: "The path to a file"
},
description: "A list of relevant file paths. Try to provide as many as possible that could be relevant to your request."
}
}
}
},
includeMessageHistory: false,
outputMode: "structured_output",
spawnerPrompt: `Creates comprehensive analysis by decomposing problems into multiple thinking angles and synthesizing insights from parallel thinker agents. Takes a list of files as context.`,
systemPrompt: ``,
instructionsPrompt: ``,
stepPrompt: ``,
handleSteps: function* ({ params }) {
const prompts = params?.prompts ?? [], filePaths = params?.filePaths ?? [];
if (prompts.length > 1)
yield {
toolName: "spawn_agents",
input: {
agents: [
{
agent_type: "thinker-with-files-input",
prompt: "We are prompt caching the above files. This is a warm-up request so that subsequent (parallel!) requests can be cached. Please respond with just the phrase: 'The context is now cached!'. It's important that you don't include any other text or reasoning in your response, since that would increase latency and cost for this request, which is just meant to warm up the cache before firing off the real requests in parallel.",
params: { filePaths }
}
]
}
};
const { toolResult } = yield {
toolName: "spawn_agents",
input: {
agents: prompts.map((promptText) => ({
agent_type: "thinker-with-files-input",
prompt: promptText,
params: {
filePaths
}
}))
}
};
yield {
toolName: "set_output",
input: { thoughts: toolResult ? toolResult.map((result) => result.type === "json" ? result.value : "")[0] : [] }
};
},
mcpServers: {},
inheritParentSystemPrompt: false
}