feat: Centralize AI prompts into JSON templates (#882)

* centralize prompt management

* add changeset

* add variant key to determine prompt version

* update tests and add prompt manager test

* determine internal path, don't use projectRoot

* add promptManager mock

* detailed prompt docs

* add schemas and validator packages

* add validate prompts command

* add schema validation

* update tests

* move schemas to src/prompts/schemas

* use this.promptsDir for better semantics

* add prompt schemas

* version schema files & update links

* remove validate command

* expect dependencies

* update docs

* fix test

* remove suggestmode to ensure clean keys

* remove default variant from research and update schema

* now handled by prompt manager

* add manual test to verify prompts

* remove incorrect batch variant

* consolidate variants

* consolidate analyze-complexity to just default variant

* consolidate parse-prd variants

* add eq handler for handlebars

* consolidate research prompt variants

* use brevity

* consolidate variants for update subtask

* add not handler

* consolidate variants for update-task

* consolidate update-tasks variants

* add conditional content to prompt when research used

* update prompt tests

* show correct research variant

* make variant names link to below

* remove changset

* restore gitignore

* Merge branch 'next' of https://github.com/eyaltoledano/claude-task-master into joedanz/centralize-prompts

# Conflicts:
#	package-lock.json
#	scripts/modules/task-manager/expand-task.js
#	scripts/modules/task-manager/parse-prd.js

remove unused

* add else

* update tests

* update biome optional dependencies

* responsive html output for mobile
This commit is contained in:
Joe Danziger
2025-07-10 03:52:11 -04:00
committed by GitHub
parent 4bc8029080
commit a65ad0a47c
36 changed files with 6180 additions and 9034 deletions

View File

@@ -0,0 +1,41 @@
{
"id": "analyze-complexity",
"version": "1.0.0",
"description": "Analyze task complexity and generate expansion recommendations",
"metadata": {
"author": "system",
"created": "2024-01-01T00:00:00Z",
"updated": "2024-01-01T00:00:00Z",
"tags": ["analysis", "complexity", "expansion", "recommendations"]
},
"parameters": {
"tasks": {
"type": "array",
"required": true,
"description": "Array of tasks to analyze"
},
"gatheredContext": {
"type": "string",
"default": "",
"description": "Additional project context"
},
"threshold": {
"type": "number",
"default": 5,
"min": 1,
"max": 10,
"description": "Complexity threshold for expansion recommendation"
},
"useResearch": {
"type": "boolean",
"default": false,
"description": "Use research mode for deeper analysis"
}
},
"prompts": {
"default": {
"system": "You are an expert software architect and project manager analyzing task complexity. Respond only with the requested valid JSON array.",
"user": "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\nRespond ONLY with a valid JSON array matching the schema:\n[\n {\n \"taskId\": <number>,\n \"taskTitle\": \"<string>\",\n \"complexityScore\": <number 1-10>,\n \"recommendedSubtasks\": <number>,\n \"expansionPrompt\": \"<string>\",\n \"reasoning\": \"<string>\"\n },\n ...\n]\n\nDo not include any explanatory text, markdown formatting, or code block markers before or after the JSON array."
}
}
}