analyze_task_complexity
Analyze task complexity, estimate effort, assess risks, and provide actionable recommendations for GitHub project management using AI-powered analysis.
Instructions
Perform detailed AI-powered analysis of task complexity, effort estimation, risk assessment, and provide actionable recommendations
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskTitle | Yes | ||
| taskDescription | Yes | ||
| currentEstimate | No | ||
| teamExperience | Yes | ||
| projectContext | No | ||
| includeBreakdown | Yes | ||
| includeRisks | Yes | ||
| includeRecommendations | Yes |
Input Schema (JSON Schema)
{
"properties": {
"currentEstimate": {
"type": "number"
},
"includeBreakdown": {
"type": "string"
},
"includeRecommendations": {
"type": "string"
},
"includeRisks": {
"type": "string"
},
"projectContext": {
"type": "string"
},
"taskDescription": {
"type": "string"
},
"taskTitle": {
"type": "string"
},
"teamExperience": {
"type": "string"
}
},
"required": [
"taskTitle",
"taskDescription",
"teamExperience",
"includeBreakdown",
"includeRisks",
"includeRecommendations"
],
"type": "object"
}
Implementation Reference
- Main handler function that executes the analyze_task_complexity tool: creates mock task, performs AI analysis via TaskGenerationService, generates breakdowns/risks/recommendations/confidence, and formats the response.async function executeAnalyzeTaskComplexity(args: AnalyzeTaskComplexityArgs): Promise<MCPResponse> { const taskService = new TaskGenerationService(); try { // Create a mock task for analysis const mockTask = { id: 'analysis-task', title: args.taskTitle, description: args.taskDescription, complexity: 5 as TaskComplexity, // Will be updated by analysis estimatedHours: args.currentEstimate || 0, priority: TaskPriority.MEDIUM, status: TaskStatus.PENDING, dependencies: [], acceptanceCriteria: [], tags: [], aiGenerated: false, subtasks: [], createdAt: new Date().toISOString(), updatedAt: new Date().toISOString() }; // Perform complexity analysis const analysis = await taskService.analyzeTaskComplexity(mockTask); // Generate detailed breakdown const breakdown = generateEffortBreakdown(analysis.estimatedHours, args.teamExperience); // Assess risks const risks = args.includeRisks ? assessTaskRisks(args, analysis) : []; // Generate recommendations const recommendations = args.includeRecommendations ? generateTaskRecommendations(args, analysis, risks) : []; // Calculate confidence level const confidence = calculateConfidenceLevel(args, analysis); // Format response const summary = formatComplexityAnalysis(args, analysis, breakdown, risks, recommendations, confidence); return ToolResultFormatter.formatSuccess('analyze_task_complexity', { summary, analysis: { originalComplexity: mockTask.complexity, newComplexity: analysis.newComplexity, estimatedHours: analysis.estimatedHours, confidence, breakdown, risks, recommendations } }); } catch (error) { process.stderr.write(`Error in analyze_task_complexity tool: ${error}\n`); return ToolResultFormatter.formatSuccess('analyze_task_complexity', { error: `Failed to analyze task complexity: ${error instanceof Error ? error.message : 'Unknown error'}`, success: false }); } }
- Zod schema defining input parameters for the analyze_task_complexity toolconst analyzeTaskComplexitySchema = z.object({ taskTitle: z.string().min(3).describe('Title of the task to analyze'), taskDescription: z.string().min(10).describe('Detailed description of the task'), currentEstimate: z.number().optional().describe('Current effort estimate in hours (if any)'), teamExperience: z.enum(['junior', 'mid', 'senior', 'mixed']).default('mixed') .describe('Team experience level'), projectContext: z.string().optional().describe('Additional project context'), includeBreakdown: z.boolean().default(true).describe('Whether to include effort breakdown'), includeRisks: z.boolean().default(true).describe('Whether to include risk analysis'), includeRecommendations: z.boolean().default(true).describe('Whether to include recommendations') });
- src/infrastructure/tools/ToolRegistry.ts:191-199 (registration)Registration of the analyzeTaskComplexityTool (and other AI tools) in the central ToolRegistry during built-in tools initialization// Register AI task management tools this.registerTool(addFeatureTool); this.registerTool(generatePRDTool); this.registerTool(parsePRDTool); this.registerTool(getNextTaskTool); this.registerTool(analyzeTaskComplexityTool); this.registerTool(expandTaskTool); this.registerTool(enhancePRDTool); this.registerTool(createTraceabilityMatrixTool);
- ToolDefinition export including name, description, schema reference, and usage examplesexport const analyzeTaskComplexityTool: ToolDefinition<AnalyzeTaskComplexityArgs> = { name: "analyze_task_complexity", description: "Perform detailed AI-powered analysis of task complexity, effort estimation, risk assessment, and provide actionable recommendations", schema: analyzeTaskComplexitySchema as unknown as ToolSchema<AnalyzeTaskComplexityArgs>, examples: [ { name: "Analyze complex feature task", description: "Analyze the complexity of implementing a new feature", args: { taskTitle: "Implement real-time chat system", taskDescription: "Build a WebSocket-based real-time chat system with message history, file sharing, user presence indicators, and message encryption", currentEstimate: 20, teamExperience: "mixed", projectContext: "Adding to existing React/Node.js application", includeBreakdown: true, includeRisks: true, includeRecommendations: true } } ] };
- src/index.ts:371-372 (handler)Dispatch handler in main MCP server that routes tool calls to executeAnalyzeTaskComplexitycase "analyze_task_complexity": return await executeAnalyzeTaskComplexity(args);