analyze_task
Analyze task requirements to evaluate technical feasibility, assess risks, and develop high-level solution concepts. Use pseudocode to outline key steps and logic flow without providing complete code.
Instructions
Deeply analyze task requirements and systematically check the codebase, evaluate technical feasibility and potential risks. If code is needed, use pseudocode format providing only high-level logic flow and key steps, avoiding complete code.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| initialConcept | Yes | At least 50 characters of initial solution concept, including technical solution, architectural design and implementation strategy, if code is needed use pseudocode format and only provide high-level logic flow and key steps avoiding complete code | |
| previousAnalysis | No | Analysis results from previous iterations, used for continuous improvement of solutions (only required for reanalysis) | |
| summary | Yes | Structured task summary including task objectives, scope and key technical challenges, minimum 10 characters |
Implementation Reference
- src/tools/taskTools.ts:143-163 (handler)Core handler function for the "analyze_task" tool. It receives input parameters, calls the prompt generator getAnalyzeTaskPrompt, and returns the generated prompt as standardized tool content.export async function analyzeTask({ summary, initialConcept, previousAnalysis, }: z.infer<typeof analyzeTaskSchema>) { // Use prompt generator to get the final prompt const prompt = getAnalyzeTaskPrompt({ summary, initialConcept, previousAnalysis, }); return { content: [ { type: "text" as const, text: prompt, }, ], }; }
- src/tools/taskTools.ts:119-141 (schema)Zod schema defining the input validation for the analyze_task tool, including summary, initialConcept (with min lengths), and optional previousAnalysis.export const analyzeTaskSchema = z.object({ summary: z .string() .min(10, { message: "Task summary cannot be less than 10 characters, please provide a more detailed description to ensure clear task objectives", }) .describe( "Structured task summary including task objectives, scope and key technical challenges, minimum 10 characters" ), initialConcept: z .string() .min(50, { message: "Initial solution concept cannot be less than 50 characters, please provide more detailed content to ensure the technical solution is clear", }) .describe( "At least 50 characters of initial solution concept, including technical solution, architectural design and implementation strategy, if code is needed use pseudocode format and only provide high-level logic flow and key steps avoiding complete code" ), previousAnalysis: z .string() .optional() .describe("Analysis results from previous iterations, used for continuous improvement of solutions (only required for reanalysis)"), });
- src/index.ts:235-240 (registration)Registration of the analyze_task tool in the ListToolsRequest handler, specifying name, description loaded from MD template, and input schema converted to JSON schema.name: "analyze_task", description: loadPromptFromTemplate( "toolsDescription/analyzeTask.md" ), inputSchema: zodToJsonSchema(analyzeTaskSchema), },
- src/index.ts:396-406 (registration)Dispatch logic in the CallToolRequest handler: parses arguments using analyzeTaskSchema, validates, and invokes the analyzeTask handler function.case "analyze_task": parsedArgs = await analyzeTaskSchema.safeParseAsync( request.params.arguments ); if (!parsedArgs.success) { throw new Error( `Invalid arguments for tool ${request.params.name}: ${parsedArgs.error.message}` ); } result = await analyzeTask(parsedArgs.data); return result;
- Supporting helper function that generates the task analysis prompt by loading and interpolating templates (index.md and optional iteration.md), and applying custom overrides.export function getAnalyzeTaskPrompt(params: AnalyzeTaskPromptParams): string { const indexTemplate = loadPromptFromTemplate("analyzeTask/index.md"); const iterationTemplate = loadPromptFromTemplate("analyzeTask/iteration.md"); let iterationPrompt = ""; if (params.previousAnalysis) { iterationPrompt = generatePrompt(iterationTemplate, { previousAnalysis: params.previousAnalysis, }); } let prompt = generatePrompt(indexTemplate, { summary: params.summary, initialConcept: params.initialConcept, iterationPrompt: iterationPrompt, }); // Load possible custom prompt return loadPrompt(prompt, "ANALYZE_TASK"); }