@hhsw2015/task-master-ai 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +4072 -0
  2. package/LICENSE +25 -0
  3. package/README-task-master.md +648 -0
  4. package/README.md +415 -0
  5. package/dist/ai-services-unified-BgdcS4fE.js +7 -0
  6. package/dist/ai-services-unified-DVAKOPK0.js +1 -0
  7. package/dist/assets/.windsurfrules +524 -0
  8. package/dist/assets/AGENTS.md +435 -0
  9. package/dist/assets/GEMINI.md +110 -0
  10. package/dist/assets/claude/TM_COMMANDS_GUIDE.md +147 -0
  11. package/dist/assets/config.json +34 -0
  12. package/dist/assets/env.example +12 -0
  13. package/dist/assets/example_prd.txt +47 -0
  14. package/dist/assets/example_prd_rpg.txt +511 -0
  15. package/dist/assets/gitignore +25 -0
  16. package/dist/assets/hamster-art.txt +49 -0
  17. package/dist/assets/kiro-hooks/tm-code-change-task-tracker.kiro.hook +23 -0
  18. package/dist/assets/kiro-hooks/tm-complexity-analyzer.kiro.hook +16 -0
  19. package/dist/assets/kiro-hooks/tm-daily-standup-assistant.kiro.hook +13 -0
  20. package/dist/assets/kiro-hooks/tm-git-commit-task-linker.kiro.hook +13 -0
  21. package/dist/assets/kiro-hooks/tm-pr-readiness-checker.kiro.hook +13 -0
  22. package/dist/assets/kiro-hooks/tm-task-dependency-auto-progression.kiro.hook +17 -0
  23. package/dist/assets/kiro-hooks/tm-test-success-task-completer.kiro.hook +23 -0
  24. package/dist/assets/roocode/.roo/rules-architect/architect-rules +93 -0
  25. package/dist/assets/roocode/.roo/rules-ask/ask-rules +89 -0
  26. package/dist/assets/roocode/.roo/rules-code/code-rules +61 -0
  27. package/dist/assets/roocode/.roo/rules-debug/debug-rules +68 -0
  28. package/dist/assets/roocode/.roo/rules-orchestrator/orchestrator-rules +181 -0
  29. package/dist/assets/roocode/.roo/rules-test/test-rules +61 -0
  30. package/dist/assets/roocode/.roomodes +63 -0
  31. package/dist/assets/rules/cursor_rules.mdc +53 -0
  32. package/dist/assets/rules/dev_workflow.mdc +424 -0
  33. package/dist/assets/rules/hamster.mdc +173 -0
  34. package/dist/assets/rules/self_improve.mdc +72 -0
  35. package/dist/assets/rules/taskmaster.mdc +573 -0
  36. package/dist/assets/rules/taskmaster_hooks_workflow.mdc +59 -0
  37. package/dist/assets/scripts_README.md +445 -0
  38. package/dist/commands-D7m4KWx1.js +329 -0
  39. package/dist/config-manager-CvbfYtIR.js +1 -0
  40. package/dist/config-manager-cjltSxIS.js +270 -0
  41. package/dist/dependency-manager-CyOxi5uo.js +1078 -0
  42. package/dist/git-utils-DllbRE35.js +1 -0
  43. package/dist/git-utils-PBP1PRVP.js +1 -0
  44. package/dist/mcp-server.js +44 -0
  45. package/dist/profiles-DcD-JxPM.js +3528 -0
  46. package/dist/research-DN4RyyJY.js +1 -0
  47. package/dist/response-language-C5AwQSfD.js +1 -0
  48. package/dist/response-language-LzM2RD6-.js +1 -0
  49. package/dist/sentry-CBAZ4LSk.js +1 -0
  50. package/dist/tag-management-6HOtYZMj.js +1 -0
  51. package/dist/task-manager-BtFURFe0.js +1 -0
  52. package/dist/task-master.js +2 -0
  53. package/dist/update-subtask-by-id-DiWMqGfw.js +1 -0
  54. package/dist/update-task-by-id-eyL-PNVX.js +1 -0
  55. package/dist/utils-CGk8TL6x.js +1 -0
  56. package/index.js +160 -0
  57. package/package.json +183 -0
@@ -0,0 +1,445 @@
1
+ # Meta-Development Script
2
+
3
+ This folder contains a **meta-development script** (`dev.js`) and related utilities that manage tasks for an AI-driven or traditional software development workflow. The script revolves around a `tasks.json` file, which holds an up-to-date list of development tasks.
4
+
5
+ ## Overview
6
+
7
+ In an AI-driven development process—particularly with tools like [Cursor](https://www.cursor.so/)—it's beneficial to have a **single source of truth** for tasks. This script allows you to:
8
+
9
+ 1. **Parse** a PRD or requirements document (`.txt`) to initialize a set of tasks (`tasks.json`).
10
+ 2. **List** all existing tasks (IDs, statuses, titles).
11
+ 3. **Update** tasks to accommodate new prompts or architecture changes (useful if you discover "implementation drift").
12
+ 4. **Generate** individual task files (e.g., `task_001.txt`) for easy reference or to feed into an AI coding workflow.
13
+ 5. **Set task status**—mark tasks as `done`, `pending`, or `deferred` based on progress.
14
+ 6. **Expand** tasks with subtasks—break down complex tasks into smaller, more manageable subtasks.
15
+ 7. **Research-backed subtask generation**—use Perplexity AI to generate more informed and contextually relevant subtasks.
16
+ 8. **Clear subtasks**—remove subtasks from specified tasks to allow regeneration or restructuring.
17
+ 9. **Show task details**—display detailed information about a specific task and its subtasks.
18
+
19
+ ## Configuration (Updated)
20
+
21
+ Task Master configuration is now managed through two primary methods:
22
+
23
+ 1. **`.taskmaster/config.json` File (Project Root - Primary)**
24
+
25
+ - Stores AI model selections (`main`, `research`, `fallback`), model parameters (`maxTokens`, `temperature`), `logLevel`, `defaultSubtasks`, `defaultPriority`, `projectName`, etc.
26
+ - Managed using the `task-master models --setup` command or the `models` MCP tool.
27
+ - This is the main configuration file for most settings.
28
+
29
+ 2. **Environment Variables (`.env` File - API Keys Only)**
30
+ - Used **only** for sensitive **API Keys** (e.g., `ANTHROPIC_API_KEY`, `PERPLEXITY_API_KEY`).
31
+ - Create a `.env` file in your project root for CLI usage.
32
+ - See `assets/env.example` for required key names.
33
+
34
+ **Important:** Settings like `MODEL`, `MAX_TOKENS`, `TEMPERATURE`, `TASKMASTER_LOG_LEVEL`, etc., are **no longer set via `.env`**. Use `task-master models --setup` instead.
35
+
36
+ ## How It Works
37
+
38
+ 1. **`tasks.json`**:
39
+
40
+ - A JSON file at the project root containing an array of tasks (each with `id`, `title`, `description`, `status`, etc.).
41
+ - The `meta` field can store additional info like the project's name, version, or reference to the PRD.
42
+ - Tasks can have `subtasks` for more detailed implementation steps.
43
+ - Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending) to easily track progress.
44
+
45
+ 2. **CLI Commands**
46
+ You can run the commands via:
47
+
48
+ ```bash
49
+ # If installed globally
50
+ task-master [command] [options]
51
+
52
+ # If using locally within the project
53
+ node scripts/dev.js [command] [options]
54
+ ```
55
+
56
+ Available commands:
57
+
58
+ - `init`: Initialize a new project
59
+ - `parse-prd`: Generate tasks from a PRD document
60
+ - `list`: Display all tasks with their status
61
+ - `update`: Update tasks based on new information
62
+ - `generate`: Create individual task files
63
+ - `set-status`: Change a task's status
64
+ - `expand`: Add subtasks to a task or all tasks
65
+ - `clear-subtasks`: Remove subtasks from specified tasks
66
+ - `next`: Determine the next task to work on based on dependencies
67
+ - `show`: Display detailed information about a specific task
68
+ - `analyze-complexity`: Analyze task complexity and generate recommendations
69
+ - `complexity-report`: Display the complexity analysis in a readable format
70
+ - `add-dependency`: Add a dependency between tasks
71
+ - `remove-dependency`: Remove a dependency from a task
72
+ - `validate-dependencies`: Check for invalid dependencies
73
+ - `fix-dependencies`: Fix invalid dependencies automatically
74
+ - `add-task`: Add a new task using AI
75
+
76
+ Run `task-master --help` or `node scripts/dev.js --help` to see detailed usage information.
77
+
78
+ ## Listing Tasks
79
+
80
+ The `list` command allows you to view all tasks and their status:
81
+
82
+ ```bash
83
+ # List all tasks
84
+ task-master list
85
+
86
+ # List tasks with a specific status
87
+ task-master list --status=pending
88
+
89
+ # List tasks and include their subtasks
90
+ task-master list --with-subtasks
91
+
92
+ # List tasks with a specific status and include their subtasks
93
+ task-master list --status=pending --with-subtasks
94
+ ```
95
+
96
+ ## Updating Tasks
97
+
98
+ The `update` command allows you to update tasks based on new information or implementation changes:
99
+
100
+ ```bash
101
+ # Update tasks starting from ID 4 with a new prompt
102
+ task-master update --from=4 --prompt="Refactor tasks from ID 4 onward to use Express instead of Fastify"
103
+
104
+ # Update all tasks (default from=1)
105
+ task-master update --prompt="Add authentication to all relevant tasks"
106
+
107
+ # Specify a different tasks file
108
+ task-master update --file=custom-tasks.json --from=5 --prompt="Change database from MongoDB to PostgreSQL"
109
+ ```
110
+
111
+ Notes:
112
+
113
+ - The `--prompt` parameter is required and should explain the changes or new context
114
+ - Only tasks that aren't marked as 'done' will be updated
115
+ - Tasks with ID >= the specified --from value will be updated
116
+
117
+ ## Setting Task Status
118
+
119
+ The `set-status` command allows you to change a task's status:
120
+
121
+ ```bash
122
+ # Mark a task as done
123
+ task-master set-status --id=3 --status=done
124
+
125
+ # Mark a task as pending
126
+ task-master set-status --id=4 --status=pending
127
+
128
+ # Mark a specific subtask as done
129
+ task-master set-status --id=3.1 --status=done
130
+
131
+ # Mark multiple tasks at once
132
+ task-master set-status --id=1,2,3 --status=done
133
+ ```
134
+
135
+ Notes:
136
+
137
+ - When marking a parent task as "done", all of its subtasks will automatically be marked as "done" as well
138
+ - Common status values are 'done', 'pending', and 'deferred', but any string is accepted
139
+ - You can specify multiple task IDs by separating them with commas
140
+ - Subtask IDs are specified using the format `parentId.subtaskId` (e.g., `3.1`)
141
+ - Dependencies are updated to show completion status (✅ for completed, ⏱️ for pending) throughout the system
142
+
143
+ ## Expanding Tasks
144
+
145
+ The `expand` command allows you to break down tasks into subtasks for more detailed implementation:
146
+
147
+ ```bash
148
+ # Expand a specific task with 3 subtasks (default)
149
+ task-master expand --id=3
150
+
151
+ # Expand a specific task with 5 subtasks
152
+ task-master expand --id=3 --num=5
153
+
154
+ # Expand a task with additional context
155
+ task-master expand --id=3 --prompt="Focus on security aspects"
156
+
157
+ # Expand all pending tasks that don't have subtasks
158
+ task-master expand --all
159
+
160
+ # Force regeneration of subtasks for all pending tasks
161
+ task-master expand --all --force
162
+
163
+ # Use Perplexity AI for research-backed subtask generation
164
+ task-master expand --id=3 --research
165
+
166
+ # Use Perplexity AI for research-backed generation on all pending tasks
167
+ task-master expand --all --research
168
+ ```
169
+
170
+ ## Clearing Subtasks
171
+
172
+ The `clear-subtasks` command allows you to remove subtasks from specified tasks:
173
+
174
+ ```bash
175
+ # Clear subtasks from a specific task
176
+ task-master clear-subtasks --id=3
177
+
178
+ # Clear subtasks from multiple tasks
179
+ task-master clear-subtasks --id=1,2,3
180
+
181
+ # Clear subtasks from all tasks
182
+ task-master clear-subtasks --all
183
+ ```
184
+
185
+ Notes:
186
+
187
+ - After clearing subtasks, task files are automatically regenerated
188
+ - This is useful when you want to regenerate subtasks with a different approach
189
+ - Can be combined with the `expand` command to immediately generate new subtasks
190
+ - Works with both parent tasks and individual subtasks
191
+
192
+ ## AI Integration (Updated)
193
+
194
+ - The script now uses a unified AI service layer (`ai-services-unified.js`).
195
+ - Model selection (e.g., Claude vs. Perplexity for `--research`) is determined by the configuration in `.taskmaster/config.json` based on the requested `role` (`main` or `research`).
196
+ - API keys are automatically resolved from your `.env` file (for CLI) or MCP session environment.
197
+ - To use the research capabilities (e.g., `expand --research`), ensure you have:
198
+ 1. Configured a model for the `research` role using `task-master models --setup` (Perplexity models are recommended).
199
+ 2. Added the corresponding API key (e.g., `PERPLEXITY_API_KEY`) to your `.env` file.
200
+
201
+ ## Logging
202
+
203
+ The script supports different logging levels controlled by the `TASKMASTER_LOG_LEVEL` environment variable:
204
+
205
+ - `debug`: Detailed information, typically useful for troubleshooting
206
+ - `info`: Confirmation that things are working as expected (default)
207
+ - `warn`: Warning messages that don't prevent execution
208
+ - `error`: Error messages that might prevent execution
209
+
210
+ When `DEBUG=true` is set, debug logs are also written to a `dev-debug.log` file in the project root.
211
+
212
+ ## Managing Task Dependencies
213
+
214
+ The `add-dependency` and `remove-dependency` commands allow you to manage task dependencies:
215
+
216
+ ```bash
217
+ # Add a dependency to a task
218
+ task-master add-dependency --id=<id> --depends-on=<id>
219
+
220
+ # Remove a dependency from a task
221
+ task-master remove-dependency --id=<id> --depends-on=<id>
222
+ ```
223
+
224
+ These commands:
225
+
226
+ 1. **Allow precise dependency management**:
227
+
228
+ - Add dependencies between tasks with automatic validation
229
+ - Remove dependencies when they're no longer needed
230
+ - Update task files automatically after changes
231
+
232
+ 2. **Include validation checks**:
233
+
234
+ - Prevent circular dependencies (a task depending on itself)
235
+ - Prevent duplicate dependencies
236
+ - Verify that both tasks exist before adding/removing dependencies
237
+ - Check if dependencies exist before attempting to remove them
238
+
239
+ 3. **Provide clear feedback**:
240
+
241
+ - Success messages confirm when dependencies are added/removed
242
+ - Error messages explain why operations failed (if applicable)
243
+
244
+ 4. **Automatically update task files**:
245
+ - Regenerates task files to reflect dependency changes
246
+ - Ensures tasks and their files stay synchronized
247
+
248
+ ## Dependency Validation and Fixing
249
+
250
+ The script provides two specialized commands to ensure task dependencies remain valid and properly maintained:
251
+
252
+ ### Validating Dependencies
253
+
254
+ The `validate-dependencies` command allows you to check for invalid dependencies without making changes:
255
+
256
+ ```bash
257
+ # Check for invalid dependencies in tasks.json
258
+ task-master validate-dependencies
259
+
260
+ # Specify a different tasks file
261
+ task-master validate-dependencies --file=custom-tasks.json
262
+ ```
263
+
264
+ This command:
265
+
266
+ - Scans all tasks and subtasks for non-existent dependencies
267
+ - Identifies potential self-dependencies (tasks referencing themselves)
268
+ - Reports all found issues without modifying files
269
+ - Provides a comprehensive summary of dependency state
270
+ - Gives detailed statistics on task dependencies
271
+
272
+ Use this command to audit your task structure before applying fixes.
273
+
274
+ ### Fixing Dependencies
275
+
276
+ The `fix-dependencies` command proactively finds and fixes all invalid dependencies:
277
+
278
+ ```bash
279
+ # Find and fix all invalid dependencies
280
+ task-master fix-dependencies
281
+
282
+ # Specify a different tasks file
283
+ task-master fix-dependencies --file=custom-tasks.json
284
+ ```
285
+
286
+ This command:
287
+
288
+ 1. **Validates all dependencies** across tasks and subtasks
289
+ 2. **Automatically removes**:
290
+ - References to non-existent tasks and subtasks
291
+ - Self-dependencies (tasks depending on themselves)
292
+ 3. **Fixes issues in both**:
293
+ - The tasks.json data structure
294
+ - Individual task files during regeneration
295
+ 4. **Provides a detailed report**:
296
+ - Types of issues fixed (non-existent vs. self-dependencies)
297
+ - Number of tasks affected (tasks vs. subtasks)
298
+ - Where fixes were applied (tasks.json vs. task files)
299
+ - List of all individual fixes made
300
+
301
+ This is especially useful when tasks have been deleted or IDs have changed, potentially breaking dependency chains.
302
+
303
+ ## Analyzing Task Complexity
304
+
305
+ The `analyze-complexity` command allows you to automatically assess task complexity and generate expansion recommendations:
306
+
307
+ ```bash
308
+ # Analyze all tasks and generate expansion recommendations
309
+ task-master analyze-complexity
310
+
311
+ # Specify a custom output file
312
+ task-master analyze-complexity --output=custom-report.json
313
+
314
+ # Override the model used for analysis
315
+ task-master analyze-complexity --model=claude-3-opus-20240229
316
+
317
+ # Set a custom complexity threshold (1-10)
318
+ task-master analyze-complexity --threshold=6
319
+
320
+ # Use Perplexity AI for research-backed complexity analysis
321
+ task-master analyze-complexity --research
322
+ ```
323
+
324
+ Notes:
325
+
326
+ - The command uses Claude to analyze each task's complexity (or Perplexity with --research flag)
327
+ - Tasks are scored on a scale of 1-10
328
+ - Each task receives a recommended number of subtasks based on DEFAULT_SUBTASKS configuration
329
+ - The default output path is `scripts/task-complexity-report.json`
330
+ - Each task in the analysis includes a ready-to-use `expansionCommand` that can be copied directly to the terminal or executed programmatically
331
+ - Tasks with complexity scores below the threshold (default: 5) may not need expansion
332
+ - The research flag provides more contextual and informed complexity assessments
333
+
334
+ ### Integration with Expand Command
335
+
336
+ The `expand` command automatically checks for and uses complexity analysis if available:
337
+
338
+ ```bash
339
+ # Expand a task, using complexity report recommendations if available
340
+ task-master expand --id=8
341
+
342
+ # Expand all tasks, prioritizing by complexity score if a report exists
343
+ task-master expand --all
344
+
345
+ # Override recommendations with explicit values
346
+ task-master expand --id=8 --num=5 --prompt="Custom prompt"
347
+ ```
348
+
349
+ When a complexity report exists:
350
+
351
+ - The `expand` command will use the recommended subtask count from the report (unless overridden)
352
+ - It will use the tailored expansion prompt from the report (unless a custom prompt is provided)
353
+ - When using `--all`, tasks are sorted by complexity score (highest first)
354
+ - The `--research` flag is preserved from the complexity analysis to expansion
355
+
356
+ The output report structure is:
357
+
358
+ ```json
359
+ {
360
+ "meta": {
361
+ "generatedAt": "2023-06-15T12:34:56.789Z",
362
+ "tasksAnalyzed": 20,
363
+ "thresholdScore": 5,
364
+ "projectName": "Your Project Name",
365
+ "usedResearch": true
366
+ },
367
+ "complexityAnalysis": [
368
+ {
369
+ "taskId": 8,
370
+ "taskTitle": "Develop Implementation Drift Handling",
371
+ "complexityScore": 9.5,
372
+ "recommendedSubtasks": 6,
373
+ "expansionPrompt": "Create subtasks that handle detecting...",
374
+ "reasoning": "This task requires sophisticated logic...",
375
+ "expansionCommand": "task-master expand --id=8 --num=6 --prompt=\"Create subtasks...\" --research"
376
+ }
377
+ // More tasks sorted by complexity score (highest first)
378
+ ]
379
+ }
380
+ ```
381
+
382
+ ## Finding the Next Task
383
+
384
+ The `next` command helps you determine which task to work on next based on dependencies and status:
385
+
386
+ ```bash
387
+ # Show the next task to work on
388
+ task-master next
389
+
390
+ # Specify a different tasks file
391
+ task-master next --file=custom-tasks.json
392
+ ```
393
+
394
+ This command:
395
+
396
+ 1. Identifies all **eligible tasks** - pending or in-progress tasks whose dependencies are all satisfied (marked as done)
397
+ 2. **Prioritizes** these eligible tasks by:
398
+ - Priority level (high > medium > low)
399
+ - Number of dependencies (fewer dependencies first)
400
+ - Task ID (lower ID first)
401
+ 3. **Displays** comprehensive information about the selected task:
402
+ - Basic task details (ID, title, priority, dependencies)
403
+ - Detailed description and implementation details
404
+ - Subtasks if they exist
405
+ 4. Provides **contextual suggested actions**:
406
+ - Command to mark the task as in-progress
407
+ - Command to mark the task as done when completed
408
+ - Commands for working with subtasks (update status or expand)
409
+
410
+ This feature ensures you're always working on the most appropriate task based on your project's current state and dependency structure.
411
+
412
+ ## Showing Task Details
413
+
414
+ The `show` command allows you to view detailed information about a specific task:
415
+
416
+ ```bash
417
+ # Show details for a specific task
418
+ task-master show 1
419
+
420
+ # Alternative syntax with --id option
421
+ task-master show --id=1
422
+
423
+ # Show details for a subtask
424
+ task-master show --id=1.2
425
+
426
+ # Specify a different tasks file
427
+ task-master show 3 --file=custom-tasks.json
428
+ ```
429
+
430
+ This command:
431
+
432
+ 1. **Displays comprehensive information** about the specified task:
433
+ - Basic task details (ID, title, priority, dependencies, status)
434
+ - Full description and implementation details
435
+ - Test strategy information
436
+ - Subtasks if they exist
437
+ 2. **Handles both regular tasks and subtasks**:
438
+ - For regular tasks, shows all subtasks and their status
439
+ - For subtasks, shows the parent task relationship
440
+ 3. **Provides contextual suggested actions**:
441
+ - Commands to update the task status
442
+ - Commands for working with subtasks
443
+ - For subtasks, provides a link to view the parent task
444
+
445
+ This command is particularly useful when you need to examine a specific task in detail before implementing it or when you want to check the status and details of a particular task.