An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.
JavaScript aicursorcursor-aicursorailovablelovable-devroocodetask-managertaskstasks-listwindsurfwindsurf-ai
Fix/complexity-prompt-json-output (#1407)
Ralph Khreish0003b6fca6b8
diff --git a/.changeset/fix-complexity-prompt-json-output.md b/.changeset/fix-complexity-prompt-json-output.mdnew file mode 100644index 00000000..16c4b918--- /dev/null+++ b/.changeset/fix-complexity-prompt-json-output.md@@ -0,0 +1,5 @@+---+"@task-master/cli": patch+---++Fix complexity analysis prompt to ensure consistent JSON output formatdiff --git a/src/prompts/analyze-complexity.json b/src/prompts/analyze-complexity.jsonindex f7126591..c31f017d 100644--- a/src/prompts/analyze-complexity.json+++ b/src/prompts/analyze-complexity.json@@ -44,7 +44,7 @@},"prompts": {"default": {- "system": "You are an expert software architect and project manager analyzing task complexity. Your analysis should consider implementation effort, technical challenges, dependencies, and testing requirements.\n\nIMPORTANT: Your response MUST be a JSON object with a \"complexityAnalysis\" property containing an array of analysis objects. Each analysis object must have ALL of the following fields:\n- taskId: The ID of the task being analyzed (positive integer)\n- taskTitle: The title of the task\n- complexityScore: A score from 1-10 indicating complexity\n- recommendedSubtasks: Number of subtasks recommended (non-negative integer; 0 if no expansion needed)\n- expansionPrompt: A prompt to guide subtask generation\n- reasoning: Your reasoning for the complexity score\n\nYou may optionally include a \"metadata\" object. Do not include any other top-level properties.",+ "system": "You are an expert software architect and project manager analyzing task complexity. Your analysis should consider implementation effort, technical challenges, dependencies, and testing requirements.\n\nIMPORTANT: For each task, provide an analysis object with ALL of the following fields:\n- taskId: The ID of the task being analyzed (positive integer)\n- taskTitle: The title of the task\n- complexityScore: A score from 1-10 indicating complexity\n- recommendedSubtasks: Number of subtasks recommended (non-negative integer; 0 if no expansion needed)\n- expansionPrompt: A prompt to guide subtask generation\n- reasoning: Your reasoning for the complexity score\n\nYour response MUST be a JSON object with a single \"complexityAnalysis\" property containing an array of these analysis objects. You may optionally include a \"metadata\" object, but no other top-level properties.","user": "{{#if hasCodebaseAnalysis}}## IMPORTANT: Codebase Analysis Required\n\nYou have access to powerful codebase analysis tools. Before analyzing task complexity:\n\n1. Use the Glob tool to explore the project structure and understand the codebase size\n2. Use the Grep tool to search for existing implementations related to each task\n3. Use the Read tool to examine key files that would be affected by these tasks\n4. Understand the current implementation state, patterns used, and technical debt\n\nBased on your codebase analysis:\n- Assess complexity based on ACTUAL code that needs to be modified/created\n- Consider existing abstractions and patterns that could simplify implementation\n- Identify tasks that require refactoring vs. greenfield development\n- Factor in dependencies between existing code and new features\n- Provide more accurate subtask recommendations based on real code structure\n\nProject Root: {{projectRoot}}\n\n{{/if}}Analyze the following tasks to determine their complexity (1-10 scale) and recommend the number of subtasks for expansion. Provide a brief reasoning and an initial expansion prompt for each.{{#if useResearch}} Consider current best practices, common implementation patterns, and industry standards in your analysis.{{/if}}\n\nTasks:\n{{{json tasks}}}\n{{#if gatheredContext}}\n\n# Project Context\n\n{{gatheredContext}}\n{{/if}}\n"}}