Compare commits
314 Commits
crunchyman
...
v0.17.0-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9372110672 | ||
|
|
72502416c6 | ||
|
|
668b22e615 | ||
|
|
4901908f5d | ||
|
|
dc7a5414c0 | ||
|
|
40a52385ba | ||
|
|
8a86ec538e | ||
|
|
9e7387952d | ||
|
|
ab05f550b3 | ||
|
|
d2bcbee0c2 | ||
|
|
72171bd4ba | ||
|
|
9ad517231a | ||
|
|
7db3b47a47 | ||
|
|
3de785a99c | ||
|
|
8188fdd832 | ||
|
|
3fadc2f1ef | ||
|
|
dd36111367 | ||
|
|
c58ab8963c | ||
|
|
3eeb4721aa | ||
|
|
7ea905f2c5 | ||
|
|
51dd4f625b | ||
|
|
2e55757b26 | ||
|
|
54bfc72baa | ||
|
|
faae0b419d | ||
|
|
27edbd8f3f | ||
|
|
b1390e4ddf | ||
|
|
cc04d53720 | ||
|
|
bfd86eb9cc | ||
|
|
9eb3842f04 | ||
|
|
bf2053e140 | ||
|
|
ee0be04302 | ||
|
|
c0707fc399 | ||
|
|
1ece6f1904 | ||
|
|
f4a9ad1095 | ||
|
|
cba86510d3 | ||
|
|
86ea6d1dbc | ||
|
|
a22d2a45b5 | ||
|
|
d73c8e17ec | ||
|
|
4f23751d25 | ||
|
|
7d5c028ca0 | ||
|
|
f18df6da19 | ||
|
|
1754a31372 | ||
|
|
3096ccdfb3 | ||
|
|
6464bb11e5 | ||
|
|
edaa5fe0d5 | ||
|
|
41d9dbbe6d | ||
|
|
6e0d866756 | ||
|
|
926aa61a4e | ||
|
|
9b4168bb4e | ||
|
|
ad612763ff | ||
|
|
293b59bac6 | ||
|
|
1809c4ed7b | ||
|
|
6e406958c1 | ||
|
|
074b7ec0bc | ||
|
|
e0438c8fb8 | ||
|
|
1f6694fb3d | ||
|
|
b0dfcf345e | ||
|
|
3f64202c9f | ||
|
|
669b744ced | ||
|
|
f058543888 | ||
|
|
acd5c1ea3d | ||
|
|
682b54e103 | ||
|
|
6a8a68e1a3 | ||
|
|
80735f9e60 | ||
|
|
48732d5423 | ||
|
|
2d520de269 | ||
|
|
b60e1cf835 | ||
|
|
d1e45ff50e | ||
|
|
1513858da4 | ||
|
|
59dcf4bd64 | ||
|
|
a09ba021c5 | ||
|
|
e906166141 | ||
|
|
231e569e84 | ||
|
|
09add37423 | ||
|
|
91fc779714 | ||
|
|
8c69c0aafd | ||
|
|
43ad75c7fa | ||
|
|
a59dd037cf | ||
|
|
3293c7858b | ||
|
|
b371808524 | ||
|
|
86d8f00af8 | ||
|
|
0c55ce0165 | ||
|
|
5a91941913 | ||
|
|
04af16de27 | ||
|
|
edf0f23005 | ||
|
|
e0e1155260 | ||
|
|
70f4054f26 | ||
|
|
34c769bcd0 | ||
|
|
34df2c8bbd | ||
|
|
5e9bc28abe | ||
|
|
d2e64318e2 | ||
|
|
4c835264ac | ||
|
|
c882f89a8c | ||
|
|
20e1b72a17 | ||
|
|
db631f43a5 | ||
|
|
3b9402f1f8 | ||
|
|
c8c0fc2a57 | ||
|
|
60b8e97a1c | ||
|
|
3a6d6dd671 | ||
|
|
f4a83ec047 | ||
|
|
0699f64299 | ||
|
|
60b8f5faa3 | ||
|
|
cd6e42249e | ||
|
|
fcd80623b6 | ||
|
|
026815353f | ||
|
|
8a3b611fc2 | ||
|
|
6ba42b53dc | ||
|
|
3e304232ab | ||
|
|
70fa5b0031 | ||
|
|
314c0de8c4 | ||
|
|
58b417a8ce | ||
|
|
a8dabf4485 | ||
|
|
bc19bc7927 | ||
|
|
da317f2607 | ||
|
|
ed17cb0e0a | ||
|
|
e96734a6cc | ||
|
|
17294ff259 | ||
|
|
a96215a359 | ||
|
|
0a611843b5 | ||
|
|
a1f8d52474 | ||
|
|
da636f6681 | ||
|
|
ca5ec03cd8 | ||
|
|
c47deeb869 | ||
|
|
dd90c9cb5d | ||
|
|
c7042845d6 | ||
|
|
79a41543d5 | ||
|
|
efce37469b | ||
|
|
4117f71c18 | ||
|
|
9f4bac8d6a | ||
|
|
e53d5e1577 | ||
|
|
59230c4d91 | ||
|
|
04b6a3cb21 | ||
|
|
37178ff1b9 | ||
|
|
bbc8b9cc1f | ||
|
|
c955431753 | ||
|
|
21c3cb8cda | ||
|
|
ab84afd036 | ||
|
|
f89d2aacc0 | ||
|
|
0288311965 | ||
|
|
8ae772086d | ||
|
|
2b3ae8bf89 | ||
|
|
245c3cb398 | ||
|
|
09d839fff5 | ||
|
|
90068348d3 | ||
|
|
02e347d2d7 | ||
|
|
0527c363e3 | ||
|
|
735135efe9 | ||
|
|
4fee667a05 | ||
|
|
01963af2cb | ||
|
|
0633895f3b | ||
|
|
10442c1119 | ||
|
|
734a4fdcfc | ||
|
|
8dace2186c | ||
|
|
095e373843 | ||
|
|
0bc9bac392 | ||
|
|
0a45f4329c | ||
|
|
c4b2f7e514 | ||
|
|
9684beafc3 | ||
|
|
302b916045 | ||
|
|
e7f18f65b9 | ||
|
|
655c7c225a | ||
|
|
e1218b3747 | ||
|
|
ffa621a37c | ||
|
|
cd32fd9edf | ||
|
|
590e4bd66d | ||
|
|
70d3f2f103 | ||
|
|
424aae10ed | ||
|
|
a48d1f13e2 | ||
|
|
25ca1a45a0 | ||
|
|
2e17437da3 | ||
|
|
1f44ea5299 | ||
|
|
d63964a10e | ||
|
|
33559e368c | ||
|
|
9f86306766 | ||
|
|
8f8a3dc45d | ||
|
|
d18351dc38 | ||
|
|
9d437f8594 | ||
|
|
ad89253e31 | ||
|
|
70c5097553 | ||
|
|
c9e4558a19 | ||
|
|
cd4d8e335f | ||
|
|
16297058bb | ||
|
|
ae2d43de29 | ||
|
|
f5585e6c31 | ||
|
|
303b13e3d4 | ||
|
|
1862ca2360 | ||
|
|
ad1c234b4e | ||
|
|
d07f8fddc5 | ||
|
|
c7158d4910 | ||
|
|
2a07d366be | ||
|
|
40df57f969 | ||
|
|
d4a2e34b3b | ||
|
|
d67b21fd43 | ||
|
|
b1beae3042 | ||
|
|
d2f761c652 | ||
|
|
4cf7e8a74a | ||
|
|
5f504fafb8 | ||
|
|
e69a47d382 | ||
|
|
89bb62d44b | ||
|
|
5aea93d4c0 | ||
|
|
66ac9ab9f6 | ||
|
|
ca7b0457f1 | ||
|
|
87d97bba00 | ||
|
|
3516efdc3b | ||
|
|
c8722b0a7a | ||
|
|
ed79d4f473 | ||
|
|
2517bc112c | ||
|
|
842eaf7224 | ||
|
|
96aeeffc19 | ||
|
|
5a2371b7cc | ||
|
|
b47f189cc2 | ||
|
|
36d559db26 | ||
|
|
afb47584bd | ||
|
|
3721359782 | ||
|
|
ef782ff5bd | ||
|
|
99b1a0ad7a | ||
|
|
70cc15bc87 | ||
|
|
ce51b0d3ef | ||
|
|
a82284a2db | ||
|
|
205a11e82c | ||
|
|
be3f68e777 | ||
|
|
90c6c1e587 | ||
|
|
6cb213ebbd | ||
|
|
bd0ee1b6e3 | ||
|
|
8ed651c165 | ||
|
|
2829194d3c | ||
|
|
2acba945c0 | ||
|
|
78a5376796 | ||
|
|
b3b424be93 | ||
|
|
c90578b6da | ||
|
|
3a3ad9f4fe | ||
|
|
abdc15eab2 | ||
|
|
515dcae965 | ||
|
|
a40805adf7 | ||
|
|
4a9f6cd5f5 | ||
|
|
d46547a80f | ||
|
|
bcb885e0ba | ||
|
|
ddf0947710 | ||
|
|
3a6bc43778 | ||
|
|
73aa7ac32e | ||
|
|
538b874582 | ||
|
|
0300582b46 | ||
|
|
3aee9bc840 | ||
|
|
11b8d1bda5 | ||
|
|
ff8e75cded | ||
|
|
3e872f8afb | ||
|
|
0eb16d5ecb | ||
|
|
c17d912237 | ||
|
|
41b979c239 | ||
|
|
d99fa00980 | ||
|
|
b2ccd60526 | ||
|
|
454a1d9d37 | ||
|
|
d181c40a95 | ||
|
|
1ab836f191 | ||
|
|
d84c2486e4 | ||
|
|
329839aeb8 | ||
|
|
c7fefb0549 | ||
|
|
cde23946e9 | ||
|
|
1ceb545d86 | ||
|
|
9a482789f7 | ||
|
|
4c57537157 | ||
|
|
6599cb0bf9 | ||
|
|
48a8d952bc | ||
|
|
94601f1e11 | ||
|
|
9f834f5a27 | ||
|
|
f5c4eda132 | ||
|
|
9122e516b6 | ||
|
|
04de6d9698 | ||
|
|
3530e28ee3 | ||
|
|
08f0319058 | ||
|
|
6f2cda0a6f | ||
|
|
cb720ca298 | ||
|
|
c6b8783bce | ||
|
|
9c0ed3c799 | ||
|
|
d3d9dc6ebe | ||
|
|
30e6d47577 | ||
|
|
140bd3d265 | ||
|
|
5ed2120ee6 | ||
|
|
34c980ee51 | ||
|
|
e88682f881 | ||
|
|
59208ab7a9 | ||
|
|
a86e9affc5 | ||
|
|
6403e96ef9 | ||
|
|
51919950f1 | ||
|
|
39efd11979 | ||
|
|
65e7886506 | ||
|
|
b8e55dd612 | ||
|
|
819fc5d2f7 | ||
|
|
6ec892b2c1 | ||
|
|
08589b2796 | ||
|
|
d2a5f0e6a9 | ||
|
|
e1e3e31998 | ||
|
|
c414d50bdf | ||
|
|
2c63742a85 | ||
|
|
729e033fef | ||
|
|
69e0b3c393 | ||
|
|
da95466ee1 | ||
|
|
4f68bf3b47 | ||
|
|
12519946b4 | ||
|
|
709ea63350 | ||
|
|
ca3d54f7d6 | ||
|
|
8c5d609c9c | ||
|
|
b78535ac19 | ||
|
|
cfe3ba91e8 | ||
|
|
34501878b2 | ||
|
|
af9421b9ae | ||
|
|
42bf897f81 | ||
|
|
5e01399dca | ||
|
|
e6fe5dac85 | ||
|
|
66f16870c6 | ||
|
|
01a5be25a8 | ||
|
|
4386e74ed2 | ||
|
|
5d3d66ee64 | ||
|
|
bf38baf858 |
77
.changeset/bright-windows-sing.md
Normal file
77
.changeset/bright-windows-sing.md
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Add comprehensive AI-powered research command with intelligent context gathering and interactive follow-ups.
|
||||||
|
|
||||||
|
The new `research` command provides AI-powered research capabilities that automatically gather relevant project context to answer your questions. The command intelligently selects context from multiple sources and supports interactive follow-up questions in CLI mode.
|
||||||
|
|
||||||
|
**Key Features:**
|
||||||
|
|
||||||
|
- **Intelligent Task Discovery**: Automatically finds relevant tasks and subtasks using fuzzy search based on your query keywords, supplementing any explicitly provided task IDs
|
||||||
|
- **Multi-Source Context**: Gathers context from tasks, files, project structure, and custom text to provide comprehensive answers
|
||||||
|
- **Interactive Follow-ups**: CLI users can ask follow-up questions that build on the conversation history while allowing fresh context discovery for each question
|
||||||
|
- **Flexible Detail Levels**: Choose from low (concise), medium (balanced), or high (comprehensive) response detail levels
|
||||||
|
- **Token Transparency**: Displays detailed token breakdown showing context size, sources, and estimated costs
|
||||||
|
- **Enhanced Display**: Syntax-highlighted code blocks and structured output with clear visual separation
|
||||||
|
|
||||||
|
**Usage Examples:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Basic research with auto-discovered context
|
||||||
|
task-master research "How should I implement user authentication?"
|
||||||
|
|
||||||
|
# Research with specific task context
|
||||||
|
task-master research "What's the best approach for this?" --id=15,23.2
|
||||||
|
|
||||||
|
# Research with file context and project tree
|
||||||
|
task-master research "How does the current auth system work?" --files=src/auth.js,config/auth.json --tree
|
||||||
|
|
||||||
|
# Research with custom context and low detail
|
||||||
|
task-master research "Quick implementation steps?" --context="Using JWT tokens" --detail=low
|
||||||
|
```
|
||||||
|
|
||||||
|
**Context Sources:**
|
||||||
|
|
||||||
|
- **Tasks**: Automatically discovers relevant tasks/subtasks via fuzzy search, plus any explicitly specified via `--id`
|
||||||
|
- **Files**: Include specific files via `--files` for code-aware responses
|
||||||
|
- **Project Tree**: Add `--tree` to include project structure overview
|
||||||
|
- **Custom Context**: Provide additional context via `--context` for domain-specific information
|
||||||
|
|
||||||
|
**Interactive Features (CLI only):**
|
||||||
|
|
||||||
|
- Follow-up questions that maintain conversation history
|
||||||
|
- Fresh fuzzy search for each follow-up to discover newly relevant tasks
|
||||||
|
- Cumulative context building across the conversation
|
||||||
|
- Clean visual separation between exchanges
|
||||||
|
- **Save to Tasks**: Save entire research conversations (including follow-ups) directly to task or subtask details with timestamps
|
||||||
|
- **Clean Menu Interface**: Streamlined inquirer-based menu for follow-up actions without redundant UI elements
|
||||||
|
|
||||||
|
**Save Functionality:**
|
||||||
|
|
||||||
|
The research command now supports saving complete conversation threads to tasks or subtasks:
|
||||||
|
|
||||||
|
- Save research results and follow-up conversations to any task (e.g., "15") or subtask (e.g., "15.2")
|
||||||
|
- Automatic timestamping and formatting of conversation history
|
||||||
|
- Validation of task/subtask existence before saving
|
||||||
|
- Appends to existing task details without overwriting content
|
||||||
|
- Supports both CLI interactive mode and MCP programmatic access via `--save-to` flag
|
||||||
|
|
||||||
|
**Enhanced CLI Options:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Auto-save research results to a task
|
||||||
|
task-master research "Implementation approach?" --save-to=15
|
||||||
|
|
||||||
|
# Combine auto-save with context gathering
|
||||||
|
task-master research "How to optimize this?" --id=23 --save-to=23.1
|
||||||
|
```
|
||||||
|
|
||||||
|
**MCP Integration:**
|
||||||
|
|
||||||
|
- `saveTo` parameter for automatic saving to specified task/subtask ID
|
||||||
|
- Structured response format with telemetry data
|
||||||
|
- Silent operation mode for programmatic usage
|
||||||
|
- Full feature parity with CLI except interactive follow-ups
|
||||||
|
|
||||||
|
The research command integrates with the existing AI service layer and supports all configured AI providers. Both CLI and MCP interfaces provide comprehensive research capabilities with intelligent context gathering and flexible output options.
|
||||||
5
.changeset/chatty-rats-talk.md
Normal file
5
.changeset/chatty-rats-talk.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix Cursor deeplink installation by providing copy-paste instructions for GitHub compatibility
|
||||||
13
.changeset/cold-pears-poke.md
Normal file
13
.changeset/cold-pears-poke.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
'task-master-ai': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix critical bugs in task move functionality:
|
||||||
|
|
||||||
|
- **Fixed moving tasks to become subtasks of empty parents**: When moving a task to become a subtask of a parent that had no existing subtasks (e.g., task 89 → task 98.1), the operation would fail with validation errors.
|
||||||
|
|
||||||
|
- **Fixed moving subtasks between parents**: Subtasks can now be properly moved between different parent tasks, including to parents that previously had no subtasks.
|
||||||
|
|
||||||
|
- **Improved comma-separated batch moves**: Multiple tasks can now be moved simultaneously using comma-separated IDs (e.g., "88,90" → "92,93") with proper error handling and atomic operations.
|
||||||
|
|
||||||
|
These fixes enables proper task hierarchy reorganization for corner cases that were previously broken.
|
||||||
5
.changeset/curly-dragons-design.md
Normal file
5
.changeset/curly-dragons-design.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
improve findTasks algorithm for resolving tasks path
|
||||||
5
.changeset/eleven-news-check.md
Normal file
5
.changeset/eleven-news-check.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix update tool on MCP giving `No valid tasks found`
|
||||||
5
.changeset/fluffy-waves-allow.md
Normal file
5
.changeset/fluffy-waves-allow.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Adds ability to automatically create/switch tags to match the current git branch. The configuration to enable the git workflow and then use the auto switching is in config.json."
|
||||||
39
.changeset/four-cups-enter.md
Normal file
39
.changeset/four-cups-enter.md
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Enhanced add-task fuzzy search intelligence and improved user experience
|
||||||
|
|
||||||
|
**Smarter Task Discovery:**
|
||||||
|
|
||||||
|
- Remove hardcoded category system that always matched "Task management"
|
||||||
|
- Eliminate arbitrary limits on fuzzy search results (5→25 high relevance, 3→10 medium relevance, 8→20 detailed tasks)
|
||||||
|
- Improve semantic weighting in Fuse.js search (details=3, description=2, title=1.5) for better relevance
|
||||||
|
- Generate context-driven task recommendations based on true semantic similarity
|
||||||
|
|
||||||
|
**Enhanced Terminal Experience:**
|
||||||
|
|
||||||
|
- Fix duplicate banner display issue that was "eating" terminal history (closes #553)
|
||||||
|
- Remove console.clear() and redundant displayBanner() calls from UI functions
|
||||||
|
- Preserve command history for better development workflow
|
||||||
|
- Streamline banner display across all commands (list, next, show, set-status, clear-subtasks, dependency commands)
|
||||||
|
|
||||||
|
**Visual Improvements:**
|
||||||
|
|
||||||
|
- Replace emoji complexity indicators with clean filled circle characters (●) for professional appearance
|
||||||
|
- Improve consistency and readability of task complexity display
|
||||||
|
|
||||||
|
**AI Provider Compatibility:**
|
||||||
|
|
||||||
|
- Change generateObject mode from 'tool' to 'auto' for better cross-provider compatibility
|
||||||
|
- Add qwen3-235n-a22b:free model support (closes #687)
|
||||||
|
- Add smart warnings for free OpenRouter models with limitations (rate limits, restricted context, no tool_use)
|
||||||
|
|
||||||
|
**Technical Improvements:**
|
||||||
|
|
||||||
|
- Enhanced context generation in add-task to rely on semantic similarity rather than rigid pattern matching
|
||||||
|
- Improved dependency analysis and common pattern detection
|
||||||
|
- Better handling of task relationships and relevance scoring
|
||||||
|
- More intelligent task suggestion algorithms
|
||||||
|
|
||||||
|
The add-task system now provides truly relevant task context based on semantic understanding rather than arbitrary categories and limits, while maintaining a cleaner and more professional terminal experience.
|
||||||
18
.changeset/free-pants-rescue.md
Normal file
18
.changeset/free-pants-rescue.md
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Enhance update-task with --append flag for timestamped task updates
|
||||||
|
|
||||||
|
Adds the `--append` flag to `update-task` command, enabling it to behave like `update-subtask` with timestamped information appending. This provides more flexible task updating options:
|
||||||
|
|
||||||
|
**CLI Enhancement:**
|
||||||
|
- `task-master update-task --id=5 --prompt="New info"` - Full task update (existing behavior)
|
||||||
|
- `task-master update-task --id=5 --append --prompt="Progress update"` - Append timestamped info to task details
|
||||||
|
|
||||||
|
**Full MCP Integration:**
|
||||||
|
- MCP tool `update_task` now supports `append` parameter
|
||||||
|
- Seamless integration with Cursor and other MCP clients
|
||||||
|
- Consistent behavior between CLI and MCP interfaces
|
||||||
|
|
||||||
|
Instead of requiring separate subtask creation for progress tracking, you can now append timestamped information directly to parent tasks while preserving the option for comprehensive task updates.
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
"task-master-ai": patch
|
"task-master-ai": patch
|
||||||
---
|
---
|
||||||
|
|
||||||
Add CI for testing
|
Update o3 model price
|
||||||
11
.changeset/late-dryers-relax.md
Normal file
11
.changeset/late-dryers-relax.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Add --tag flag support to core commands for multi-context task management. Commands like parse-prd, analyze-complexity, and others now support targeting specific task lists, enabling rapid prototyping and parallel development workflows.
|
||||||
|
|
||||||
|
Key features:
|
||||||
|
- parse-prd --tag=feature-name: Parse PRDs into separate task contexts on the fly
|
||||||
|
- analyze-complexity --tag=branch: Generate tag-specific complexity reports
|
||||||
|
- All task operations can target specific contexts while preserving other lists
|
||||||
|
- Non-existent tags are created automatically for seamless workflow
|
||||||
8
.changeset/nasty-chefs-add.md
Normal file
8
.changeset/nasty-chefs-add.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixes issue with expand CLI command "Complexity report not found"
|
||||||
|
|
||||||
|
- Closes #735
|
||||||
|
- Closes #728
|
||||||
7
.changeset/pink-houses-lay.md
Normal file
7
.changeset/pink-houses-lay.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix double .taskmaster directory paths in file resolution utilities
|
||||||
|
|
||||||
|
- Closes #636
|
||||||
5
.changeset/polite-areas-shave.md
Normal file
5
.changeset/polite-areas-shave.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Add one-click MCP server installation for Cursor
|
||||||
11
.changeset/pre.json
Normal file
11
.changeset/pre.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"mode": "exit",
|
||||||
|
"tag": "rc",
|
||||||
|
"initialVersions": {
|
||||||
|
"task-master-ai": "0.16.1"
|
||||||
|
},
|
||||||
|
"changesets": [
|
||||||
|
"pink-houses-lay",
|
||||||
|
"polite-areas-shave"
|
||||||
|
]
|
||||||
|
}
|
||||||
5
.changeset/quick-flies-sniff.md
Normal file
5
.changeset/quick-flies-sniff.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix issue with generate command which was creating tasks in the legacy tasks location.
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
"task-master-ai": patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Fix github actions creating npm releases on next branch push
|
|
||||||
136
.changeset/six-cups-see.md
Normal file
136
.changeset/six-cups-see.md
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Introduces Tagged Lists: AI Multi-Context Task Management System
|
||||||
|
|
||||||
|
This major release introduces Tagged Lists, a comprehensive system that transforms Task Master into a multi-context task management powerhouse. You can now organize tasks into completely isolated contexts, enabling parallel (agentic) development workflows, team collaboration, and project experimentation without conflicts.
|
||||||
|
|
||||||
|
**🏷️ Tagged Task Lists Architecture:**
|
||||||
|
|
||||||
|
The new tagged system fundamentally changes how tasks are organized:
|
||||||
|
- **Legacy Format**: `{ "tasks": [...] }`
|
||||||
|
- **New Tagged Format**: `{ "master": { "tasks": [...], "metadata": {...} }, "feature-xyz": { "tasks": [...], "metadata": {...} } }`
|
||||||
|
- **Automatic Migration**: Existing projects seamlessly migrate to tagged format with zero user intervention
|
||||||
|
- **State Management**: New `.taskmaster/state.json` tracks current tag, last switched time, and migration status
|
||||||
|
- **Configuration Integration**: Enhanced `.taskmaster/config.json` with tag-specific settings and defaults
|
||||||
|
|
||||||
|
**🚀 Complete Tag Management Suite:**
|
||||||
|
|
||||||
|
**Core Tag Commands:**
|
||||||
|
- `task-master tags [--show-metadata]` - List all tags with task counts, completion stats, and metadata
|
||||||
|
- `task-master add-tag <name> [options]` - Create new tag contexts with optional task copying
|
||||||
|
- `task-master delete-tag <name> [--yes]` - Delete tags with double confirmation protection
|
||||||
|
- `task-master use-tag <name>` - Switch contexts and immediately see next available task
|
||||||
|
- `task-master rename-tag <old> <new>` - Rename tags with automatic current tag reference updates
|
||||||
|
- `task-master copy-tag <source> <target> [options]` - Duplicate tag contexts for experimentation
|
||||||
|
|
||||||
|
**🤖 Full MCP Integration for Tag Management:**
|
||||||
|
|
||||||
|
Task Master's multi-context capabilities are now fully exposed through the MCP server, enabling powerful agentic workflows:
|
||||||
|
- **`list_tags`**: List all available tag contexts.
|
||||||
|
- **`add_tag`**: Programmatically create new tags.
|
||||||
|
- **`delete_tag`**: Remove tag contexts.
|
||||||
|
- **`use_tag`**: Switch the agent's active task context.
|
||||||
|
- **`rename_tag`**: Rename existing tags.
|
||||||
|
- **`copy_tag`**: Duplicate entire task contexts for experimentation.
|
||||||
|
|
||||||
|
**Tag Creation Options:**
|
||||||
|
- `--copy-from-current` - Copy tasks from currently active tag
|
||||||
|
- `--copy-from=<tag>` - Copy tasks from specific tag
|
||||||
|
- `--from-branch` - Creates a new tag usin active git branch name (for `add-tag` only)
|
||||||
|
- `--description="<text>"` - Add custom tag descriptions
|
||||||
|
- Empty tag creation for fresh contexts
|
||||||
|
|
||||||
|
**🎯 Universal --tag Flag Support:**
|
||||||
|
|
||||||
|
Every task operation now supports tag-specific execution:
|
||||||
|
- `task-master list --tag=feature-branch` - View tasks in specific context
|
||||||
|
- `task-master add-task --tag=experiment --prompt="..."` - Create tasks in specific tag
|
||||||
|
- `task-master parse-prd document.txt --tag=v2-redesign` - Parse PRDs into dedicated contexts
|
||||||
|
- `task-master analyze-complexity --tag=performance-work` - Generate tag-specific reports
|
||||||
|
- `task-master set-status --tag=hotfix --id=5 --status=done` - Update tasks in specific contexts
|
||||||
|
- `task-master expand --tag=research --id=3` - Break down tasks within tag contexts
|
||||||
|
|
||||||
|
**📊 Enhanced Workflow Features:**
|
||||||
|
|
||||||
|
**Smart Context Switching:**
|
||||||
|
- `use-tag` command shows immediate next task after switching
|
||||||
|
- Automatic tag creation when targeting non-existent tags
|
||||||
|
- Current tag persistence across terminal sessions
|
||||||
|
- Branch-tag mapping for future Git integration
|
||||||
|
|
||||||
|
**Intelligent File Management:**
|
||||||
|
- Tag-specific complexity reports: `task-complexity-report_tagname.json`
|
||||||
|
- Master tag uses default filenames: `task-complexity-report.json`
|
||||||
|
- Automatic file isolation prevents cross-tag contamination
|
||||||
|
|
||||||
|
**Advanced Confirmation Logic:**
|
||||||
|
- Commands only prompt when target tag has existing tasks
|
||||||
|
- Empty tags allow immediate operations without confirmation
|
||||||
|
- Smart append vs overwrite detection
|
||||||
|
|
||||||
|
**🔄 Seamless Migration & Compatibility:**
|
||||||
|
|
||||||
|
**Zero-Disruption Migration:**
|
||||||
|
- Existing `tasks.json` files automatically migrate on first command
|
||||||
|
- Master tag receives proper metadata (creation date, description)
|
||||||
|
- Migration notice shown once with helpful explanation
|
||||||
|
- All existing commands work identically to before
|
||||||
|
|
||||||
|
**State Management:**
|
||||||
|
- `.taskmaster/state.json` tracks current tag and migration status
|
||||||
|
- Automatic state creation and maintenance
|
||||||
|
- Branch-tag mapping foundation for Git integration
|
||||||
|
- Migration notice tracking to avoid repeated notifications
|
||||||
|
- Grounds for future context additions
|
||||||
|
|
||||||
|
**Backward Compatibility:**
|
||||||
|
- All existing workflows continue unchanged
|
||||||
|
- Legacy commands work exactly as before
|
||||||
|
- Gradual adoption - users can ignore tags entirely if desired
|
||||||
|
- No breaking changes to existing tasks or file formats
|
||||||
|
|
||||||
|
**💡 Real-World Use Cases:**
|
||||||
|
|
||||||
|
**Team Collaboration:**
|
||||||
|
- `task-master add-tag alice --copy-from-current` - Create teammate-specific contexts
|
||||||
|
- `task-master add-tag bob --copy-from=master` - Onboard new team members
|
||||||
|
- `task-master use-tag alice` - Switch to teammate's work context
|
||||||
|
|
||||||
|
**Feature Development:**
|
||||||
|
- `task-master parse-prd feature-spec.txt --tag=user-auth` - Dedicated feature planning
|
||||||
|
- `task-master add-tag experiment --copy-from=user-auth` - Safe experimentation
|
||||||
|
- `task-master analyze-complexity --tag=user-auth` - Feature-specific analysis
|
||||||
|
|
||||||
|
**Release Management:**
|
||||||
|
- `task-master add-tag v2.0 --description="Next major release"` - Version-specific planning
|
||||||
|
- `task-master copy-tag master v2.1` - Release branch preparation
|
||||||
|
- `task-master use-tag hotfix` - Emergency fix context
|
||||||
|
|
||||||
|
**Project Phases:**
|
||||||
|
- `task-master add-tag research --description="Discovery phase"` - Research tasks
|
||||||
|
- `task-master add-tag implementation --copy-from=research` - Development phase
|
||||||
|
- `task-master add-tag testing --copy-from=implementation` - QA phase
|
||||||
|
|
||||||
|
**🛠️ Technical Implementation:**
|
||||||
|
|
||||||
|
**Data Structure:**
|
||||||
|
- Tagged format with complete isolation between contexts
|
||||||
|
- Rich metadata per tag (creation date, description, update tracking)
|
||||||
|
- Automatic metadata enhancement for existing tags
|
||||||
|
- Clean separation of tag data and internal state
|
||||||
|
|
||||||
|
**Performance Optimizations:**
|
||||||
|
- Dynamic task counting without stored counters
|
||||||
|
- Efficient tag resolution and caching
|
||||||
|
- Minimal file I/O with smart data loading
|
||||||
|
- Responsive table layouts adapting to terminal width
|
||||||
|
|
||||||
|
**Error Handling:**
|
||||||
|
- Comprehensive validation for tag names (alphanumeric, hyphens, underscores)
|
||||||
|
- Reserved name protection (master, main, default)
|
||||||
|
- Graceful handling of missing tags and corrupted data
|
||||||
|
- Detailed error messages with suggested corrections
|
||||||
|
|
||||||
|
This release establishes the foundation for advanced multi-context workflows while maintaining the simplicity and power that makes Task Master effective for individual developers.
|
||||||
24
.changeset/slick-webs-lead.md
Normal file
24
.changeset/slick-webs-lead.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Research Save-to-File Feature & Critical MCP Tag Corruption Fix
|
||||||
|
|
||||||
|
**🔬 New Research Save-to-File Functionality:**
|
||||||
|
|
||||||
|
Added comprehensive save-to-file capability to the research command, enabling users to preserve research sessions for future reference and documentation.
|
||||||
|
|
||||||
|
**CLI Integration:**
|
||||||
|
- New `--save-file` flag for `task-master research` command
|
||||||
|
- Consistent with existing `--save` and `--save-to` flags for intuitive usage
|
||||||
|
- Interactive "Save to file" option in follow-up questions menu
|
||||||
|
|
||||||
|
**MCP Integration:**
|
||||||
|
- New `saveToFile` boolean parameter for the `research` MCP tool
|
||||||
|
- Enables programmatic research saving for AI agents and integrated tools
|
||||||
|
|
||||||
|
**File Management:**
|
||||||
|
- Automatically creates `.taskmaster/docs/research/` directory structure
|
||||||
|
- Generates timestamped, slugified filenames (e.g., `2025-01-13_what-is-typescript.md`)
|
||||||
|
- Comprehensive Markdown format with metadata headers including query, timestamp, and context sources
|
||||||
|
- Clean conversation history formatting without duplicate information
|
||||||
5
.changeset/slow-lies-make.md
Normal file
5
.changeset/slow-lies-make.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
No longer automatically creates individual task files as they are not used by the applicatoin. You can still generate them anytime using the `generate` command.
|
||||||
19
.changeset/stale-bats-sin.md
Normal file
19
.changeset/stale-bats-sin.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
'task-master-ai': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Enhanced get-task/show command to support comma-separated task IDs for efficient batch operations
|
||||||
|
|
||||||
|
**New Features:**
|
||||||
|
- **Multiple Task Retrieval**: Pass comma-separated IDs to get/show multiple tasks at once (e.g., `task-master show 1,3,5` or MCP `get_task` with `id: "1,3,5"`)
|
||||||
|
- **Smart Display Logic**: Single ID shows detailed view, multiple IDs show compact summary table with interactive options
|
||||||
|
- **Batch Action Menu**: Interactive menu for multiple tasks with copy-paste ready commands for common operations (mark as done/in-progress, expand all, view dependencies, etc.)
|
||||||
|
- **MCP Array Response**: MCP tool returns structured array of task objects for efficient AI agent context gathering
|
||||||
|
|
||||||
|
**Benefits:**
|
||||||
|
- **Faster Context Gathering**: AI agents can collect multiple tasks/subtasks in one call instead of iterating
|
||||||
|
- **Improved Workflow**: Interactive batch operations reduce repetitive command execution
|
||||||
|
- **Better UX**: Responsive layout adapts to terminal width, maintains consistency with existing UI patterns
|
||||||
|
- **API Efficiency**: RESTful array responses in MCP format enable more sophisticated integrations
|
||||||
|
|
||||||
|
This enhancement maintains full backward compatibility while significantly improving efficiency for both human users and AI agents working with multiple tasks.
|
||||||
7
.changeset/tiny-ads-decide.md
Normal file
7
.changeset/tiny-ads-decide.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Adds support for filtering tasks by multiple statuses at once using comma-separated statuses.
|
||||||
|
|
||||||
|
Example: `cancelled,deferred`
|
||||||
@@ -1,302 +0,0 @@
|
|||||||
---
|
|
||||||
"task-master-ai": patch
|
|
||||||
---
|
|
||||||
|
|
||||||
- Adjusts the MCP server invokation in the mcp.json we ship with `task-master init`. Fully functional now.
|
|
||||||
- Rename the npx -y command. It's now `npx -y task-master-ai task-master-mcp`
|
|
||||||
- Add additional binary alias: `task-master-mcp-server` pointing to the same MCP server script
|
|
||||||
|
|
||||||
- **Significant improvements to model configuration:**
|
|
||||||
- Increase context window from 64k to 128k tokens (MAX_TOKENS=128000) for handling larger codebases
|
|
||||||
- Reduce temperature from 0.4 to 0.2 for more consistent, deterministic outputs
|
|
||||||
- Set default model to "claude-3-7-sonnet-20250219" in configuration
|
|
||||||
- Update Perplexity model to "sonar-pro" for research operations
|
|
||||||
- Increase default subtasks generation from 4 to 5 for more granular task breakdown
|
|
||||||
- Set consistent default priority to "medium" for all new tasks
|
|
||||||
|
|
||||||
- **Clarify environment configuration approaches:**
|
|
||||||
- For direct MCP usage: Configure API keys directly in `.cursor/mcp.json`
|
|
||||||
- For npm package usage: Configure API keys in `.env` file
|
|
||||||
- Update templates with clearer placeholder values and formatting
|
|
||||||
- Provide explicit documentation about configuration methods in both environments
|
|
||||||
- Use consistent placeholder format "YOUR_ANTHROPIC_API_KEY_HERE" in mcp.json
|
|
||||||
|
|
||||||
- Rename MCP tools to better align with API conventions and natural language in client chat:
|
|
||||||
- Rename `list-tasks` to `get-tasks` for more intuitive client requests like "get my tasks"
|
|
||||||
- Rename `show-task` to `get-task` for consistency with GET-based API naming conventions
|
|
||||||
|
|
||||||
- **Refine AI-based MCP tool implementation patterns:**
|
|
||||||
- Establish clear responsibilities for direct functions vs MCP tools when handling AI operations
|
|
||||||
- Update MCP direct function signatures to expect `context = { session }` for AI-based tools, without `reportProgress`
|
|
||||||
- Clarify that AI client initialization, API calls, and response parsing should be handled within the direct function
|
|
||||||
- Define standard error codes for AI operations (`AI_CLIENT_ERROR`, `RESPONSE_PARSING_ERROR`, etc.)
|
|
||||||
- Document that `reportProgress` should not be used within direct functions due to client validation issues
|
|
||||||
- Establish that progress indication within direct functions should use standard logging (`log.info()`)
|
|
||||||
- Clarify that `AsyncOperationManager` should manage progress reporting at the MCP tool layer, not in direct functions
|
|
||||||
- Update `mcp.mdc` rule to reflect the refined patterns for AI-based MCP tools
|
|
||||||
- **Document and implement the Logger Wrapper Pattern:**
|
|
||||||
- Add comprehensive documentation in `mcp.mdc` and `utilities.mdc` on the Logger Wrapper Pattern
|
|
||||||
- Explain the dual purpose of the wrapper: preventing runtime errors and controlling output format
|
|
||||||
- Include implementation examples with detailed explanations of why and when to use this pattern
|
|
||||||
- Clearly document that this pattern has proven successful in resolving issues in multiple MCP tools
|
|
||||||
- Cross-reference between rule files to ensure consistent guidance
|
|
||||||
- **Fix critical issue in `analyze-project-complexity` MCP tool:**
|
|
||||||
- Implement proper logger wrapper in `analyzeTaskComplexityDirect` to fix `mcpLog[level] is not a function` errors
|
|
||||||
- Update direct function to handle both Perplexity and Claude AI properly for research-backed analysis
|
|
||||||
- Improve silent mode handling with proper wasSilent state tracking
|
|
||||||
- Add comprehensive error handling for AI client errors and report file parsing
|
|
||||||
- Ensure proper report format detection and analysis with fallbacks
|
|
||||||
- Fix variable name conflicts between the `report` logging function and data structures in `analyzeTaskComplexity`
|
|
||||||
- **Fix critical issue in `update-task` MCP tool:**
|
|
||||||
- Implement proper logger wrapper in `updateTaskByIdDirect` to ensure mcpLog[level] calls work correctly
|
|
||||||
- Update Zod schema in `update-task.js` to accept both string and number type IDs
|
|
||||||
- Fix silent mode implementation with proper try/finally blocks
|
|
||||||
- Add comprehensive error handling for missing parameters, invalid task IDs, and failed updates
|
|
||||||
- **Refactor `update-subtask` MCP tool to follow established patterns:**
|
|
||||||
- Update `updateSubtaskByIdDirect` function to accept `context = { session }` parameter
|
|
||||||
- Add proper AI client initialization with error handling for both Anthropic and Perplexity
|
|
||||||
- Implement the Logger Wrapper Pattern to prevent mcpLog[level] errors
|
|
||||||
- Support both string and number subtask IDs with appropriate validation
|
|
||||||
- Update MCP tool to pass session to direct function but not reportProgress
|
|
||||||
- Remove commented-out calls to reportProgress for cleaner code
|
|
||||||
- Add comprehensive error handling for various failure scenarios
|
|
||||||
- Implement proper silent mode with try/finally blocks
|
|
||||||
- Ensure detailed successful update response information
|
|
||||||
- **Fix issues in `set-task-status` MCP tool:**
|
|
||||||
- Remove reportProgress parameter as it's not needed
|
|
||||||
- Improve project root handling for better session awareness
|
|
||||||
- Reorganize function call arguments for setTaskStatusDirect
|
|
||||||
- Add proper silent mode handling with try/catch/finally blocks
|
|
||||||
- Enhance logging for both success and error cases
|
|
||||||
- **Refactor `update` MCP tool to follow established patterns:**
|
|
||||||
- Update `updateTasksDirect` function to accept `context = { session }` parameter
|
|
||||||
- Add proper AI client initialization with error handling
|
|
||||||
- Update MCP tool to pass session to direct function but not reportProgress
|
|
||||||
- Simplify parameter validation using string type for 'from' parameter
|
|
||||||
- Improve error handling for AI client errors
|
|
||||||
- Implement proper silent mode handling with try/finally blocks
|
|
||||||
- Use `isSilentMode()` function instead of accessing global variables directly
|
|
||||||
- **Refactor `expand-task` MCP tool to follow established patterns:**
|
|
||||||
- Update `expandTaskDirect` function to accept `context = { session }` parameter
|
|
||||||
- Add proper AI client initialization with error handling
|
|
||||||
- Update MCP tool to pass session to direct function but not reportProgress
|
|
||||||
- Add comprehensive tests for the refactored implementation
|
|
||||||
- Improve error handling for AI client errors
|
|
||||||
- Remove non-existent 'force' parameter from direct function implementation
|
|
||||||
- Ensure direct function parameters match core function parameters
|
|
||||||
- Implement proper silent mode handling with try/finally blocks
|
|
||||||
- Use `isSilentMode()` function instead of accessing global variables directly
|
|
||||||
- **Refactor `parse-prd` MCP tool to follow established patterns:**
|
|
||||||
- Update `parsePRDDirect` function to accept `context = { session }` parameter for proper AI initialization
|
|
||||||
- Implement AI client initialization with proper error handling using `getAnthropicClientForMCP`
|
|
||||||
- Add the Logger Wrapper Pattern to ensure proper logging via `mcpLog`
|
|
||||||
- Update the core `parsePRD` function to accept an AI client parameter
|
|
||||||
- Implement proper silent mode handling with try/finally blocks
|
|
||||||
- Remove `reportProgress` usage from MCP tool for better client compatibility
|
|
||||||
- Fix console output that was breaking the JSON response format
|
|
||||||
- Improve error handling with specific error codes
|
|
||||||
- Pass session object to the direct function correctly
|
|
||||||
- Update task-manager-core.js to export AI client utilities for better organization
|
|
||||||
- Ensure proper option passing between functions to maintain logging context
|
|
||||||
|
|
||||||
- **Update MCP Logger to respect silent mode:**
|
|
||||||
- Import and check `isSilentMode()` function in logger implementation
|
|
||||||
- Skip all logging when silent mode is enabled
|
|
||||||
- Prevent console output from interfering with JSON responses
|
|
||||||
- Fix "Unexpected token 'I', "[INFO] Gene"... is not valid JSON" errors by suppressing log output during silent mode
|
|
||||||
|
|
||||||
- **Refactor `expand-all` MCP tool to follow established patterns:**
|
|
||||||
- Update `expandAllTasksDirect` function to accept `context = { session }` parameter
|
|
||||||
- Add proper AI client initialization with error handling for research-backed expansion
|
|
||||||
- Pass session to direct function but not reportProgress in the MCP tool
|
|
||||||
- Implement directory switching to work around core function limitations
|
|
||||||
- Add comprehensive error handling with specific error codes
|
|
||||||
- Ensure proper restoration of working directory after execution
|
|
||||||
- Use try/finally pattern for both silent mode and directory management
|
|
||||||
- Add comprehensive tests for the refactored implementation
|
|
||||||
|
|
||||||
- **Standardize and improve silent mode implementation across MCP direct functions:**
|
|
||||||
- Add proper import of all silent mode utilities: `import { enableSilentMode, disableSilentMode, isSilentMode } from 'utils.js'`
|
|
||||||
- Replace direct access to global silentMode variable with `isSilentMode()` function calls
|
|
||||||
- Implement consistent try/finally pattern to ensure silent mode is always properly disabled
|
|
||||||
- Add error handling with finally blocks to prevent silent mode from remaining enabled after errors
|
|
||||||
- Create proper mixed parameter/global silent mode check pattern: `const isSilent = options.silentMode || (typeof options.silentMode === 'undefined' && isSilentMode())`
|
|
||||||
- Update all direct functions to follow the new implementation pattern
|
|
||||||
- Fix issues with silent mode not being properly disabled when errors occur
|
|
||||||
|
|
||||||
- **Improve parameter handling between direct functions and core functions:**
|
|
||||||
- Verify direct function parameters match core function signatures
|
|
||||||
- Remove extraction and use of parameters that don't exist in core functions (e.g., 'force')
|
|
||||||
- Implement appropriate type conversion for parameters (e.g., `parseInt(args.id, 10)`)
|
|
||||||
- Set defaults that match core function expectations
|
|
||||||
- Add detailed documentation on parameter matching in guidelines
|
|
||||||
- Add explicit examples of correct parameter handling patterns
|
|
||||||
|
|
||||||
- **Create standardized MCP direct function implementation checklist:**
|
|
||||||
- Comprehensive imports and dependencies section
|
|
||||||
- Parameter validation and matching guidelines
|
|
||||||
- Silent mode implementation best practices
|
|
||||||
- Error handling and response format patterns
|
|
||||||
- Path resolution and core function call guidelines
|
|
||||||
- Function export and testing verification steps
|
|
||||||
- Specific issues to watch for related to silent mode, parameters, and error cases
|
|
||||||
- Add checklist to subtasks for uniform implementation across all direct functions
|
|
||||||
|
|
||||||
- **Implement centralized AI client utilities for MCP tools:**
|
|
||||||
- Create new `ai-client-utils.js` module with standardized client initialization functions
|
|
||||||
- Implement session-aware AI client initialization for both Anthropic and Perplexity
|
|
||||||
- Add comprehensive error handling with user-friendly error messages
|
|
||||||
- Create intelligent AI model selection based on task requirements
|
|
||||||
- Implement model configuration utilities that respect session environment variables
|
|
||||||
- Add extensive unit tests for all utility functions
|
|
||||||
- Significantly improve MCP tool reliability for AI operations
|
|
||||||
- **Specific implementations include:**
|
|
||||||
- `getAnthropicClientForMCP`: Initializes Anthropic client with session environment variables
|
|
||||||
- `getPerplexityClientForMCP`: Initializes Perplexity client with session environment variables
|
|
||||||
- `getModelConfig`: Retrieves model parameters from session or fallbacks to defaults
|
|
||||||
- `getBestAvailableAIModel`: Selects the best available model based on requirements
|
|
||||||
- `handleClaudeError`: Processes Claude API errors into user-friendly messages
|
|
||||||
- **Updated direct functions to use centralized AI utilities:**
|
|
||||||
- Refactored `addTaskDirect` to use the new AI client utilities with proper AsyncOperationManager integration
|
|
||||||
- Implemented comprehensive error handling for API key validation, AI processing, and response parsing
|
|
||||||
- Added session-aware parameter handling with proper propagation of context to AI streaming functions
|
|
||||||
- Ensured proper fallback to process.env when session variables aren't available
|
|
||||||
|
|
||||||
- **Refine AI services for reusable operations:**
|
|
||||||
- Refactor `ai-services.js` to support consistent AI operations across CLI and MCP
|
|
||||||
- Implement shared helpers for streaming responses, prompt building, and response parsing
|
|
||||||
- Standardize client initialization patterns with proper session parameter handling
|
|
||||||
- Enhance error handling and loading indicator management
|
|
||||||
- Fix process exit issues to prevent MCP server termination on API errors
|
|
||||||
- Ensure proper resource cleanup in all execution paths
|
|
||||||
- Add comprehensive test coverage for AI service functions
|
|
||||||
- **Key improvements include:**
|
|
||||||
- Stream processing safety with explicit completion detection
|
|
||||||
- Standardized function parameter patterns
|
|
||||||
- Session-aware parameter extraction with sensible defaults
|
|
||||||
- Proper cleanup using try/catch/finally patterns
|
|
||||||
|
|
||||||
- **Optimize MCP response payloads:**
|
|
||||||
- Add custom `processTaskResponse` function to `get-task` MCP tool to filter out unnecessary `allTasks` array data
|
|
||||||
- Significantly reduce response size by returning only the specific requested task instead of all tasks
|
|
||||||
- Preserve dependency status relationships for the UI/CLI while keeping MCP responses lean and efficient
|
|
||||||
|
|
||||||
- **Implement complete remove-task functionality:**
|
|
||||||
- Add `removeTask` core function to permanently delete tasks or subtasks from tasks.json
|
|
||||||
- Implement CLI command `remove-task` with confirmation prompt and force flag support
|
|
||||||
- Create MCP `remove_task` tool for AI-assisted task removal
|
|
||||||
- Automatically handle dependency cleanup by removing references to deleted tasks
|
|
||||||
- Update task files after removal to maintain consistency
|
|
||||||
- Provide robust error handling and detailed feedback messages
|
|
||||||
|
|
||||||
- **Update Cursor rules and documentation:**
|
|
||||||
- Enhance `new_features.mdc` with comprehensive guidelines for implementing removal commands
|
|
||||||
- Update `commands.mdc` with best practices for confirmation flows and cleanup procedures
|
|
||||||
- Expand `mcp.mdc` with detailed instructions for MCP tool implementation patterns
|
|
||||||
- Add examples of proper error handling and parameter validation to all relevant rules
|
|
||||||
- Include new sections about handling dependencies during task removal operations
|
|
||||||
- Document naming conventions and implementation patterns for destructive operations
|
|
||||||
- Update silent mode implementation documentation with proper examples
|
|
||||||
- Add parameter handling guidelines emphasizing matching with core functions
|
|
||||||
- Update architecture documentation with dedicated section on silent mode implementation
|
|
||||||
|
|
||||||
- **Implement silent mode across all direct functions:**
|
|
||||||
- Add `enableSilentMode` and `disableSilentMode` utility imports to all direct function files
|
|
||||||
- Wrap all core function calls with silent mode to prevent console logs from interfering with JSON responses
|
|
||||||
- Add comprehensive error handling to ensure silent mode is disabled even when errors occur
|
|
||||||
- Fix "Unexpected token 'I', "[INFO] Gene"... is not valid JSON" errors by suppressing log output
|
|
||||||
- Apply consistent silent mode pattern across all MCP direct functions
|
|
||||||
- Maintain clean JSON responses for better integration with client tools
|
|
||||||
|
|
||||||
- **Implement AsyncOperationManager for background task processing:**
|
|
||||||
- Add new `async-manager.js` module to handle long-running operations asynchronously
|
|
||||||
- Support background execution of computationally intensive tasks like expansion and analysis
|
|
||||||
- Implement unique operation IDs with UUID generation for reliable tracking
|
|
||||||
- Add operation status tracking (pending, running, completed, failed)
|
|
||||||
- Create `get_operation_status` MCP tool to check on background task progress
|
|
||||||
- Forward progress reporting from background tasks to the client
|
|
||||||
- Implement operation history with automatic cleanup of completed operations
|
|
||||||
- Support proper error handling in background tasks with detailed status reporting
|
|
||||||
- Maintain context (log, session) for background operations ensuring consistent behavior
|
|
||||||
|
|
||||||
- **Implement initialize_project command:**
|
|
||||||
- Add new MCP tool to allow project setup via integrated MCP clients
|
|
||||||
- Create `initialize_project` direct function with proper parameter handling
|
|
||||||
- Improve onboarding experience by adding to mcp.json configuration
|
|
||||||
- Support project-specific metadata like name, description, and version
|
|
||||||
- Handle shell alias creation with proper confirmation
|
|
||||||
- Improve first-time user experience in AI environments
|
|
||||||
|
|
||||||
- **Refactor project root handling for MCP Server:**
|
|
||||||
- **Prioritize Session Roots**: MCP tools now extract the project root path directly from `session.roots[0].uri` provided by the client (e.g., Cursor).
|
|
||||||
- **New Utility `getProjectRootFromSession`**: Added to `mcp-server/src/tools/utils.js` to encapsulate session root extraction and decoding. **Further refined for more reliable detection, especially in integrated environments, including deriving root from script path and avoiding fallback to '/'.**
|
|
||||||
- **Simplify `findTasksJsonPath`**: The core path finding utility in `mcp-server/src/core/utils/path-utils.js` now prioritizes the `projectRoot` passed in `args` (originating from the session). Removed checks for `TASK_MASTER_PROJECT_ROOT` env var (we do not use this anymore) and package directory fallback. **Enhanced error handling to include detailed debug information (paths searched, CWD, server dir, etc.) and clearer potential solutions when `tasks.json` is not found.**
|
|
||||||
- **Retain CLI Fallbacks**: Kept `lastFoundProjectRoot` cache check and CWD search in `findTasksJsonPath` for compatibility with direct CLI usage.
|
|
||||||
|
|
||||||
- Updated all MCP tools to use the new project root handling:
|
|
||||||
- Tools now call `getProjectRootFromSession` to determine the root.
|
|
||||||
- This root is passed explicitly as `projectRoot` in the `args` object to the corresponding `*Direct` function.
|
|
||||||
- Direct functions continue to use the (now simplified) `findTasksJsonPath` to locate `tasks.json` within the provided root.
|
|
||||||
- This ensures tools work reliably in integrated environments without requiring the user to specify `--project-root`.
|
|
||||||
|
|
||||||
- Add comprehensive PROJECT_MARKERS array for detecting common project files (used in CLI fallback logic).
|
|
||||||
- Improved error messages with specific troubleshooting guidance.
|
|
||||||
- **Enhanced logging:**
|
|
||||||
- Indicate the source of project root selection more clearly.
|
|
||||||
- **Add verbose logging in `get-task.js` to trace session object content and resolved project root path, aiding debugging.**
|
|
||||||
|
|
||||||
- DRY refactoring by centralizing path utilities in `core/utils/path-utils.js` and session handling in `tools/utils.js`.
|
|
||||||
- Keep caching of `lastFoundProjectRoot` for CLI performance.
|
|
||||||
|
|
||||||
- Split monolithic task-master-core.js into separate function files within direct-functions directory.
|
|
||||||
- Implement update-task MCP command for updating a single task by ID.
|
|
||||||
- Implement update-subtask MCP command for appending information to specific subtasks.
|
|
||||||
- Implement generate MCP command for creating individual task files from tasks.json.
|
|
||||||
- Implement set-status MCP command for updating task status.
|
|
||||||
- Implement get-task MCP command for displaying detailed task information (renamed from show-task).
|
|
||||||
- Implement next-task MCP command for finding the next task to work on.
|
|
||||||
- Implement expand-task MCP command for breaking down tasks into subtasks.
|
|
||||||
- Implement add-task MCP command for creating new tasks using AI assistance.
|
|
||||||
- Implement add-subtask MCP command for adding subtasks to existing tasks.
|
|
||||||
- Implement remove-subtask MCP command for removing subtasks from parent tasks.
|
|
||||||
- Implement expand-all MCP command for expanding all tasks into subtasks.
|
|
||||||
- Implement analyze-complexity MCP command for analyzing task complexity.
|
|
||||||
- Implement clear-subtasks MCP command for clearing subtasks from parent tasks.
|
|
||||||
- Implement remove-dependency MCP command for removing dependencies from tasks.
|
|
||||||
- Implement validate-dependencies MCP command for checking validity of task dependencies.
|
|
||||||
- Implement fix-dependencies MCP command for automatically fixing invalid dependencies.
|
|
||||||
- Implement complexity-report MCP command for displaying task complexity analysis reports.
|
|
||||||
- Implement add-dependency MCP command for creating dependency relationships between tasks.
|
|
||||||
- Implement get-tasks MCP command for listing all tasks (renamed from list-tasks).
|
|
||||||
- Implement `initialize_project` MCP tool to allow project setup via MCP client and radically improve and simplify onboarding by adding to mcp.json (e.g., Cursor).
|
|
||||||
|
|
||||||
- Enhance documentation and tool descriptions:
|
|
||||||
- Create new `taskmaster.mdc` Cursor rule for comprehensive MCP tool and CLI command reference.
|
|
||||||
- Bundle taskmaster.mdc with npm package and include in project initialization.
|
|
||||||
- Add detailed descriptions for each tool's purpose, parameters, and common use cases.
|
|
||||||
- Include natural language patterns and keywords for better intent recognition.
|
|
||||||
- Document parameter descriptions with clear examples and default values.
|
|
||||||
- Add usage examples and context for each command/tool.
|
|
||||||
- **Update documentation (`mcp.mdc`, `utilities.mdc`, `architecture.mdc`, `new_features.mdc`, `commands.mdc`) to reflect the new session-based project root handling and the preferred MCP vs. CLI interaction model.**
|
|
||||||
- Improve clarity around project root auto-detection in tool documentation.
|
|
||||||
- Update tool descriptions to better reflect their actual behavior and capabilities.
|
|
||||||
- Add cross-references between related tools and commands.
|
|
||||||
- Include troubleshooting guidance in tool descriptions.
|
|
||||||
- **Add default values for `DEFAULT_SUBTASKS` and `DEFAULT_PRIORITY` to the example `.cursor/mcp.json` configuration.**
|
|
||||||
|
|
||||||
- Document MCP server naming conventions in architecture.mdc and mcp.mdc files (file names use kebab-case, direct functions use camelCase with Direct suffix, tool registration functions use camelCase with Tool suffix, and MCP tool names use snake_case).
|
|
||||||
- Update MCP tool naming to follow more intuitive conventions that better align with natural language requests in client chat applications.
|
|
||||||
- Enhance task show view with a color-coded progress bar for visualizing subtask completion percentage.
|
|
||||||
- Add "cancelled" status to UI module status configurations for marking tasks as cancelled without deletion.
|
|
||||||
- Improve MCP server resource documentation with comprehensive implementation examples and best practices.
|
|
||||||
- Enhance progress bars with status breakdown visualization showing proportional sections for different task statuses.
|
|
||||||
- Add improved status tracking for both tasks and subtasks with detailed counts by status.
|
|
||||||
- Optimize progress bar display with width constraints to prevent UI overflow on smaller terminals.
|
|
||||||
- Improve status counts display with clear text labels beside status icons for better readability.
|
|
||||||
- Treat deferred and cancelled tasks as effectively complete for progress calculation while maintaining visual distinction.
|
|
||||||
- **Fix `reportProgress` calls** to use the correct `{ progress, total? }` format.
|
|
||||||
- **Standardize logging in core task-manager functions (`expandTask`, `expandAllTasks`, `updateTasks`, `updateTaskById`, `updateSubtaskById`, `parsePRD`, `analyzeTaskComplexity`):**
|
|
||||||
- Implement a local `report` function in each to handle context-aware logging.
|
|
||||||
- Use `report` to choose between `mcpLog` (if available) and global `log` (from `utils.js`).
|
|
||||||
- Only call global `log` when `outputFormat` is 'text' and silent mode is off.
|
|
||||||
- Wrap CLI UI elements (tables, boxes, spinners) in `outputFormat === 'text'` checks.
|
|
||||||
5
.changeset/two-lies-start.md
Normal file
5
.changeset/two-lies-start.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Improves dependency management when moving tasks by updating subtask dependencies that reference sibling subtasks by their old parent-based ID
|
||||||
22
.changeset/vast-shrimps-happen.md
Normal file
22
.changeset/vast-shrimps-happen.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Add sync-readme command for a task export to GitHub README
|
||||||
|
|
||||||
|
Introduces a new `sync-readme` command that exports your task list to your project's README.md file.
|
||||||
|
|
||||||
|
**Features:**
|
||||||
|
|
||||||
|
- **Flexible filtering**: Supports `--status` filtering (e.g., pending, done) and `--with-subtasks` flag
|
||||||
|
- **Smart content management**: Automatically replaces existing exports or appends to new READMEs
|
||||||
|
- **Metadata display**: Shows export timestamp, subtask inclusion status, and filter settings
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
|
||||||
|
- `task-master sync-readme` - Export tasks without subtasks
|
||||||
|
- `task-master sync-readme --with-subtasks` - Include subtasks in export
|
||||||
|
- `task-master sync-readme --status=pending` - Only export pending tasks
|
||||||
|
- `task-master sync-readme --status=done --with-subtasks` - Export completed tasks with subtasks
|
||||||
|
|
||||||
|
Perfect for showcasing project progress on GitHub. Experimental. Open to feedback.
|
||||||
5
.changeset/yellow-olives-admire.md
Normal file
5
.changeset/yellow-olives-admire.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"task-master-ai": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Adds tag to CLI output so you know which tag you are performing operations on. Already supported in the MCP response.
|
||||||
@@ -1,17 +1,19 @@
|
|||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"taskmaster-ai": {
|
"task-master-ai": {
|
||||||
"command": "node",
|
"command": "node",
|
||||||
"args": ["./mcp-server/server.js"],
|
"args": ["./mcp-server/server.js"],
|
||||||
"env": {
|
"env": {
|
||||||
"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE",
|
"ANTHROPIC_API_KEY": "ANTHROPIC_API_KEY_HERE",
|
||||||
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE",
|
"PERPLEXITY_API_KEY": "PERPLEXITY_API_KEY_HERE",
|
||||||
"MODEL": "claude-3-7-sonnet-20250219",
|
"OPENAI_API_KEY": "OPENAI_API_KEY_HERE",
|
||||||
"PERPLEXITY_MODEL": "sonar-pro",
|
"GOOGLE_API_KEY": "GOOGLE_API_KEY_HERE",
|
||||||
"MAX_TOKENS": 128000,
|
"XAI_API_KEY": "XAI_API_KEY_HERE",
|
||||||
"TEMPERATURE": 0.2,
|
"OPENROUTER_API_KEY": "OPENROUTER_API_KEY_HERE",
|
||||||
"DEFAULT_SUBTASKS": 5,
|
"MISTRAL_API_KEY": "MISTRAL_API_KEY_HERE",
|
||||||
"DEFAULT_PRIORITY": "medium"
|
"AZURE_OPENAI_API_KEY": "AZURE_OPENAI_API_KEY_HERE",
|
||||||
|
"OLLAMA_API_KEY": "OLLAMA_API_KEY_HERE",
|
||||||
|
"GITHUB_API_KEY": "GITHUB_API_KEY_HERE"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
155
.cursor/rules/ai_providers.mdc
Normal file
155
.cursor/rules/ai_providers.mdc
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
---
|
||||||
|
description: Guidelines for managing Task Master AI providers and models.
|
||||||
|
globs:
|
||||||
|
alwaysApply: false
|
||||||
|
---
|
||||||
|
# Task Master AI Provider Management
|
||||||
|
|
||||||
|
This rule guides AI assistants on how to view, configure, and interact with the different AI providers and models supported by Task Master. For internal implementation details of the service layer, see [`ai_services.mdc`](mdc:.cursor/rules/ai_services.mdc).
|
||||||
|
|
||||||
|
- **Primary Interaction:**
|
||||||
|
- Use the `models` MCP tool or the `task-master models` CLI command to manage AI configurations. See [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc) for detailed command/tool usage.
|
||||||
|
|
||||||
|
- **Configuration Roles:**
|
||||||
|
- Task Master uses three roles for AI models:
|
||||||
|
- `main`: Primary model for general tasks (generation, updates).
|
||||||
|
- `research`: Model used when the `--research` flag or `research: true` parameter is used (typically models with web access or specialized knowledge).
|
||||||
|
- `fallback`: Model used if the primary (`main`) model fails.
|
||||||
|
- Each role is configured with a specific `provider:modelId` pair (e.g., `openai:gpt-4o`).
|
||||||
|
|
||||||
|
- **Viewing Configuration & Available Models:**
|
||||||
|
- To see the current model assignments for each role and list all models available for assignment:
|
||||||
|
- **MCP Tool:** `models` (call with no arguments or `listAvailableModels: true`)
|
||||||
|
- **CLI Command:** `task-master models`
|
||||||
|
- The output will show currently assigned models and a list of others, prefixed with their provider (e.g., `google:gemini-2.5-pro-exp-03-25`).
|
||||||
|
|
||||||
|
- **Setting Models for Roles:**
|
||||||
|
- To assign a model to a role:
|
||||||
|
- **MCP Tool:** `models` with `setMain`, `setResearch`, or `setFallback` parameters.
|
||||||
|
- **CLI Command:** `task-master models` with `--set-main`, `--set-research`, or `--set-fallback` flags.
|
||||||
|
- **Crucially:** When providing the model ID to *set*, **DO NOT include the `provider:` prefix**. Use only the model ID itself.
|
||||||
|
- ✅ **DO:** `models(setMain='gpt-4o')` or `task-master models --set-main=gpt-4o`
|
||||||
|
- ❌ **DON'T:** `models(setMain='openai:gpt-4o')` or `task-master models --set-main=openai:gpt-4o`
|
||||||
|
- The tool/command will automatically determine the provider based on the model ID.
|
||||||
|
|
||||||
|
- **Setting Custom Models (Ollama/OpenRouter):**
|
||||||
|
- To set a model ID not in the internal list for Ollama or OpenRouter:
|
||||||
|
- **MCP Tool:** Use `models` with `set<Role>` and **also** `ollama: true` or `openrouter: true`.
|
||||||
|
- Example: `models(setMain='my-custom-ollama-model', ollama=true)`
|
||||||
|
- Example: `models(setMain='some-openrouter-model', openrouter=true)`
|
||||||
|
- **CLI Command:** Use `task-master models` with `--set-<role>` and **also** `--ollama` or `--openrouter`.
|
||||||
|
- Example: `task-master models --set-main=my-custom-ollama-model --ollama`
|
||||||
|
- Example: `task-master models --set-main=some-openrouter-model --openrouter`
|
||||||
|
- **Interactive Setup:** Use `task-master models --setup` and select the `Ollama (Enter Custom ID)` or `OpenRouter (Enter Custom ID)` options.
|
||||||
|
- **OpenRouter Validation:** When setting a custom OpenRouter model, Taskmaster attempts to validate the ID against the live OpenRouter API.
|
||||||
|
- **Ollama:** No live validation occurs for custom Ollama models; ensure the model is available on your Ollama server.
|
||||||
|
|
||||||
|
- **Supported Providers & Required API Keys:**
|
||||||
|
- Task Master integrates with various providers via the Vercel AI SDK.
|
||||||
|
- **API keys are essential** for most providers and must be configured correctly.
|
||||||
|
- **Key Locations** (See [`dev_workflow.mdc`](mdc:.cursor/rules/dev_workflow.mdc) - Configuration Management):
|
||||||
|
- **MCP/Cursor:** Set keys in the `env` section of `.cursor/mcp.json`.
|
||||||
|
- **CLI:** Set keys in a `.env` file in the project root.
|
||||||
|
- **Provider List & Keys:**
|
||||||
|
- **`anthropic`**: Requires `ANTHROPIC_API_KEY`.
|
||||||
|
- **`google`**: Requires `GOOGLE_API_KEY`.
|
||||||
|
- **`openai`**: Requires `OPENAI_API_KEY`.
|
||||||
|
- **`perplexity`**: Requires `PERPLEXITY_API_KEY`.
|
||||||
|
- **`xai`**: Requires `XAI_API_KEY`.
|
||||||
|
- **`mistral`**: Requires `MISTRAL_API_KEY`.
|
||||||
|
- **`azure`**: Requires `AZURE_OPENAI_API_KEY` and `AZURE_OPENAI_ENDPOINT`.
|
||||||
|
- **`openrouter`**: Requires `OPENROUTER_API_KEY`.
|
||||||
|
- **`ollama`**: Might require `OLLAMA_API_KEY` (not currently supported) *and* `OLLAMA_BASE_URL` (default: `http://localhost:11434/api`). *Check specific setup.*
|
||||||
|
|
||||||
|
- **Troubleshooting:**
|
||||||
|
- If AI commands fail (especially in MCP context):
|
||||||
|
1. **Verify API Key:** Ensure the correct API key for the *selected provider* (check `models` output) exists in the appropriate location (`.cursor/mcp.json` env or `.env`).
|
||||||
|
2. **Check Model ID:** Ensure the model ID set for the role is valid (use `models` listAvailableModels/`task-master models`).
|
||||||
|
3. **Provider Status:** Check the status of the external AI provider's service.
|
||||||
|
4. **Restart MCP:** If changes were made to configuration or provider code, restart the MCP server.
|
||||||
|
|
||||||
|
## Adding a New AI Provider (Vercel AI SDK Method)
|
||||||
|
|
||||||
|
Follow these steps to integrate a new AI provider that has an official Vercel AI SDK adapter (`@ai-sdk/<provider>`):
|
||||||
|
|
||||||
|
1. **Install Dependency:**
|
||||||
|
- Install the provider-specific package:
|
||||||
|
```bash
|
||||||
|
npm install @ai-sdk/<provider-name>
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Create Provider Module:**
|
||||||
|
- Create a new file in `src/ai-providers/` named `<provider-name>.js`.
|
||||||
|
- Use existing modules (`openai.js`, `anthropic.js`, etc.) as a template.
|
||||||
|
- **Import:**
|
||||||
|
- Import the provider's `create<ProviderName>` function from `@ai-sdk/<provider-name>`.
|
||||||
|
- Import `generateText`, `streamText`, `generateObject` from the core `ai` package.
|
||||||
|
- Import the `log` utility from `../../scripts/modules/utils.js`.
|
||||||
|
- **Implement Core Functions:**
|
||||||
|
- `generate<ProviderName>Text(params)`:
|
||||||
|
- Accepts `params` (apiKey, modelId, messages, etc.).
|
||||||
|
- Instantiate the client: `const client = create<ProviderName>({ apiKey });`
|
||||||
|
- Call `generateText({ model: client(modelId), ... })`.
|
||||||
|
- Return `result.text`.
|
||||||
|
- Include basic validation and try/catch error handling.
|
||||||
|
- `stream<ProviderName>Text(params)`:
|
||||||
|
- Similar structure to `generateText`.
|
||||||
|
- Call `streamText({ model: client(modelId), ... })`.
|
||||||
|
- Return the full stream result object.
|
||||||
|
- Include basic validation and try/catch.
|
||||||
|
- `generate<ProviderName>Object(params)`:
|
||||||
|
- Similar structure.
|
||||||
|
- Call `generateObject({ model: client(modelId), schema, messages, ... })`.
|
||||||
|
- Return `result.object`.
|
||||||
|
- Include basic validation and try/catch.
|
||||||
|
- **Export Functions:** Export the three implemented functions (`generate<ProviderName>Text`, `stream<ProviderName>Text`, `generate<ProviderName>Object`).
|
||||||
|
|
||||||
|
3. **Integrate with Unified Service:**
|
||||||
|
- Open `scripts/modules/ai-services-unified.js`.
|
||||||
|
- **Import:** Add `import * as <providerName> from '../../src/ai-providers/<provider-name>.js';`
|
||||||
|
- **Map:** Add an entry to the `PROVIDER_FUNCTIONS` map:
|
||||||
|
```javascript
|
||||||
|
'<provider-name>': {
|
||||||
|
generateText: <providerName>.generate<ProviderName>Text,
|
||||||
|
streamText: <providerName>.stream<ProviderName>Text,
|
||||||
|
generateObject: <providerName>.generate<ProviderName>Object
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Update Configuration Management:**
|
||||||
|
- Open `scripts/modules/config-manager.js`.
|
||||||
|
- **`MODEL_MAP`:** Add the new `<provider-name>` key to the `MODEL_MAP` loaded from `supported-models.json` (or ensure the loading handles new providers dynamically if `supported-models.json` is updated first).
|
||||||
|
- **`VALID_PROVIDERS`:** Ensure the new `<provider-name>` is included in the `VALID_PROVIDERS` array (this should happen automatically if derived from `MODEL_MAP` keys).
|
||||||
|
- **API Key Handling:**
|
||||||
|
- Update the `keyMap` in `_resolveApiKey` and `isApiKeySet` with the correct environment variable name (e.g., `PROVIDER_API_KEY`).
|
||||||
|
- Update the `switch` statement in `getMcpApiKeyStatus` to check the corresponding key in `mcp.json` and its placeholder value.
|
||||||
|
- Add a case to the `switch` statement in `getMcpApiKeyStatus` for the new provider, including its placeholder string if applicable.
|
||||||
|
- **Ollama Exception:** If adding Ollama or another provider *not* requiring an API key, add a specific check at the beginning of `isApiKeySet` and `getMcpApiKeyStatus` to return `true` immediately for that provider.
|
||||||
|
|
||||||
|
5. **Update Supported Models List:**
|
||||||
|
- Edit `scripts/modules/supported-models.json`.
|
||||||
|
- Add a new key for the `<provider-name>`.
|
||||||
|
- Add an array of model objects under the provider key, each including:
|
||||||
|
- `id`: The specific model identifier (e.g., `claude-3-opus-20240229`).
|
||||||
|
- `name`: A user-friendly name (optional).
|
||||||
|
- `swe_score`, `cost_per_1m_tokens`: (Optional) Add performance/cost data if available.
|
||||||
|
- `allowed_roles`: An array of roles (`"main"`, `"research"`, `"fallback"`) the model is suitable for.
|
||||||
|
- `max_tokens`: (Optional but recommended) The maximum token limit for the model.
|
||||||
|
|
||||||
|
6. **Update Environment Examples:**
|
||||||
|
- Add the new `PROVIDER_API_KEY` to `.env.example`.
|
||||||
|
- Add the new `PROVIDER_API_KEY` with its placeholder (`YOUR_PROVIDER_API_KEY_HERE`) to the `env` section for `taskmaster-ai` in `.cursor/mcp.json.example` (if it exists) or update instructions.
|
||||||
|
|
||||||
|
7. **Add Unit Tests:**
|
||||||
|
- Create `tests/unit/ai-providers/<provider-name>.test.js`.
|
||||||
|
- Mock the `@ai-sdk/<provider-name>` module and the core `ai` module functions (`generateText`, `streamText`, `generateObject`).
|
||||||
|
- Write tests for each exported function (`generate<ProviderName>Text`, etc.) to verify:
|
||||||
|
- Correct client instantiation.
|
||||||
|
- Correct parameters passed to the mocked Vercel AI SDK functions.
|
||||||
|
- Correct handling of results.
|
||||||
|
- Error handling (missing API key, SDK errors).
|
||||||
|
|
||||||
|
8. **Documentation:**
|
||||||
|
- Update any relevant documentation (like `README.md` or other rules) mentioning supported providers or configuration.
|
||||||
|
|
||||||
|
*(Note: For providers **without** an official Vercel AI SDK adapter, the process would involve directly using the provider's own SDK or API within the `src/ai-providers/<provider-name>.js` module and manually constructing responses compatible with the unified service layer, which is significantly more complex.)*
|
||||||
102
.cursor/rules/ai_services.mdc
Normal file
102
.cursor/rules/ai_services.mdc
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
---
|
||||||
|
description: Guidelines for interacting with the unified AI service layer.
|
||||||
|
globs: scripts/modules/ai-services-unified.js, scripts/modules/task-manager/*.js, scripts/modules/commands.js
|
||||||
|
---
|
||||||
|
|
||||||
|
# AI Services Layer Guidelines
|
||||||
|
|
||||||
|
This document outlines the architecture and usage patterns for interacting with Large Language Models (LLMs) via Task Master's unified AI service layer (`ai-services-unified.js`). The goal is to centralize configuration, provider selection, API key management, fallback logic, and error handling.
|
||||||
|
|
||||||
|
**Core Components:**
|
||||||
|
|
||||||
|
* **Configuration (`.taskmasterconfig` & [`config-manager.js`](mdc:scripts/modules/config-manager.js)):**
|
||||||
|
* Defines the AI provider and model ID for different **roles** (`main`, `research`, `fallback`).
|
||||||
|
* Stores parameters like `maxTokens` and `temperature` per role.
|
||||||
|
* Managed via the `task-master models --setup` CLI command.
|
||||||
|
* [`config-manager.js`](mdc:scripts/modules/config-manager.js) provides **getters** (e.g., `getMainProvider()`, `getParametersForRole()`) to access these settings. Core logic should **only** use these getters for *non-AI related application logic* (e.g., `getDefaultSubtasks`). The unified service fetches necessary AI parameters internally based on the `role`.
|
||||||
|
* **API keys** are **NOT** stored here; they are resolved via `resolveEnvVariable` (in [`utils.js`](mdc:scripts/modules/utils.js)) from `.env` (for CLI) or the MCP `session.env` object (for MCP calls). See [`utilities.mdc`](mdc:.cursor/rules/utilities.mdc) and [`dev_workflow.mdc`](mdc:.cursor/rules/dev_workflow.mdc).
|
||||||
|
|
||||||
|
* **Unified Service (`ai-services-unified.js`):**
|
||||||
|
* Exports primary interaction functions: `generateTextService`, `generateObjectService`. (Note: `streamTextService` exists but has known reliability issues with some providers/payloads).
|
||||||
|
* Contains the core `_unifiedServiceRunner` logic.
|
||||||
|
* Internally uses `config-manager.js` getters to determine the provider/model/parameters based on the requested `role`.
|
||||||
|
* Implements the **fallback sequence** (e.g., main -> fallback -> research) if the primary provider/model fails.
|
||||||
|
* Constructs the `messages` array required by the Vercel AI SDK.
|
||||||
|
* Implements **retry logic** for specific API errors (`_attemptProviderCallWithRetries`).
|
||||||
|
* Resolves API keys automatically via `_resolveApiKey` (using `resolveEnvVariable`).
|
||||||
|
* Maps requests to the correct provider implementation (in `src/ai-providers/`) via `PROVIDER_FUNCTIONS`.
|
||||||
|
* Returns a structured object containing the primary AI result (`mainResult`) and telemetry data (`telemetryData`). See [`telemetry.mdc`](mdc:.cursor/rules/telemetry.mdc) for details on how this telemetry data is propagated and handled.
|
||||||
|
|
||||||
|
* **Provider Implementations (`src/ai-providers/*.js`):**
|
||||||
|
* Contain provider-specific wrappers around Vercel AI SDK functions (`generateText`, `generateObject`).
|
||||||
|
|
||||||
|
**Usage Pattern (from Core Logic like `task-manager/*.js`):**
|
||||||
|
|
||||||
|
1. **Import Service:** Import `generateTextService` or `generateObjectService` from `../ai-services-unified.js`.
|
||||||
|
```javascript
|
||||||
|
// Preferred for most tasks (especially with complex JSON)
|
||||||
|
import { generateTextService } from '../ai-services-unified.js';
|
||||||
|
|
||||||
|
// Use if structured output is reliable for the specific use case
|
||||||
|
// import { generateObjectService } from '../ai-services-unified.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Prepare Parameters:** Construct the parameters object for the service call.
|
||||||
|
* `role`: **Required.** `'main'`, `'research'`, or `'fallback'`. Determines the initial provider/model/parameters used by the unified service.
|
||||||
|
* `session`: **Required if called from MCP context.** Pass the `session` object received by the direct function wrapper. The unified service uses `session.env` to find API keys.
|
||||||
|
* `systemPrompt`: Your system instruction string.
|
||||||
|
* `prompt`: The user message string (can be long, include stringified data, etc.).
|
||||||
|
* (For `generateObjectService` only): `schema` (Zod schema), `objectName`.
|
||||||
|
|
||||||
|
3. **Call Service:** Use `await` to call the service function.
|
||||||
|
```javascript
|
||||||
|
// Example using generateTextService (most common)
|
||||||
|
try {
|
||||||
|
const resultText = await generateTextService({
|
||||||
|
role: useResearch ? 'research' : 'main', // Determine role based on logic
|
||||||
|
session: context.session, // Pass session from context object
|
||||||
|
systemPrompt: "You are...",
|
||||||
|
prompt: userMessageContent
|
||||||
|
});
|
||||||
|
// Process the raw text response (e.g., parse JSON, use directly)
|
||||||
|
// ...
|
||||||
|
} catch (error) {
|
||||||
|
// Handle errors thrown by the unified service (if all fallbacks/retries fail)
|
||||||
|
report('error', `Unified AI service call failed: ${error.message}`);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Example using generateObjectService (use cautiously)
|
||||||
|
try {
|
||||||
|
const resultObject = await generateObjectService({
|
||||||
|
role: 'main',
|
||||||
|
session: context.session,
|
||||||
|
schema: myZodSchema,
|
||||||
|
objectName: 'myDataObject',
|
||||||
|
systemPrompt: "You are...",
|
||||||
|
prompt: userMessageContent
|
||||||
|
});
|
||||||
|
// resultObject is already a validated JS object
|
||||||
|
// ...
|
||||||
|
} catch (error) {
|
||||||
|
report('error', `Unified AI service call failed: ${error.message}`);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Handle Results/Errors:** Process the returned text/object or handle errors thrown by the unified service layer.
|
||||||
|
|
||||||
|
**Key Implementation Rules & Gotchas:**
|
||||||
|
|
||||||
|
* ✅ **DO**: Centralize **all** LLM calls through `generateTextService` or `generateObjectService`.
|
||||||
|
* ✅ **DO**: Determine the appropriate `role` (`main`, `research`, `fallback`) in your core logic and pass it to the service.
|
||||||
|
* ✅ **DO**: Pass the `session` object (received in the `context` parameter, especially from direct function wrappers) to the service call when in MCP context.
|
||||||
|
* ✅ **DO**: Ensure API keys are correctly configured in `.env` (for CLI) or `.cursor/mcp.json` (for MCP).
|
||||||
|
* ✅ **DO**: Ensure `.taskmasterconfig` exists and has valid provider/model IDs for the roles you intend to use (manage via `task-master models --setup`).
|
||||||
|
* ✅ **DO**: Use `generateTextService` and implement robust manual JSON parsing (with Zod validation *after* parsing) when structured output is needed, as `generateObjectService` has shown unreliability with some providers/schemas.
|
||||||
|
* ❌ **DON'T**: Import or call anything from the old `ai-services.js`, `ai-client-factory.js`, or `ai-client-utils.js` files.
|
||||||
|
* ❌ **DON'T**: Initialize AI clients (Anthropic, Perplexity, etc.) directly within core logic (`task-manager/`) or MCP direct functions.
|
||||||
|
* ❌ **DON'T**: Fetch AI-specific parameters (model ID, max tokens, temp) using `config-manager.js` getters *for the AI call*. Pass the `role` instead.
|
||||||
|
* ❌ **DON'T**: Implement fallback or retry logic outside `ai-services-unified.js`.
|
||||||
|
* ❌ **DON'T**: Handle API key resolution outside the service layer (it uses `utils.js` internally).
|
||||||
|
* ⚠️ **generateObjectService Caution**: Be aware of potential reliability issues with `generateObjectService` across different providers and complex schemas. Prefer `generateTextService` + manual parsing as a more robust alternative for structured data needs.
|
||||||
@@ -3,7 +3,6 @@ description: Describes the high-level architecture of the Task Master CLI applic
|
|||||||
globs: scripts/modules/*.js
|
globs: scripts/modules/*.js
|
||||||
alwaysApply: false
|
alwaysApply: false
|
||||||
---
|
---
|
||||||
|
|
||||||
# Application Architecture Overview
|
# Application Architecture Overview
|
||||||
|
|
||||||
- **Modular Structure**: The Task Master CLI is built using a modular architecture, with distinct modules responsible for different aspects of the application. This promotes separation of concerns, maintainability, and testability.
|
- **Modular Structure**: The Task Master CLI is built using a modular architecture, with distinct modules responsible for different aspects of the application. This promotes separation of concerns, maintainability, and testability.
|
||||||
@@ -14,148 +13,106 @@ alwaysApply: false
|
|||||||
- **Purpose**: Defines and registers all CLI commands using Commander.js.
|
- **Purpose**: Defines and registers all CLI commands using Commander.js.
|
||||||
- **Responsibilities** (See also: [`commands.mdc`](mdc:.cursor/rules/commands.mdc)):
|
- **Responsibilities** (See also: [`commands.mdc`](mdc:.cursor/rules/commands.mdc)):
|
||||||
- Parses command-line arguments and options.
|
- Parses command-line arguments and options.
|
||||||
- Invokes appropriate functions from other modules to execute commands.
|
- Invokes appropriate core logic functions from `scripts/modules/`.
|
||||||
- Handles user input and output related to command execution.
|
- Handles user input/output for CLI.
|
||||||
- Implements input validation and error handling for CLI commands.
|
- Implements CLI-specific validation.
|
||||||
- **Key Components**:
|
|
||||||
- `programInstance` (Commander.js `Command` instance): Manages command definitions.
|
|
||||||
- `registerCommands(programInstance)`: Function to register all application commands.
|
|
||||||
- Command action handlers: Functions executed when a specific command is invoked.
|
|
||||||
|
|
||||||
- **[`task-manager.js`](mdc:scripts/modules/task-manager.js): Task Data Management**
|
- **[`task-manager.js`](mdc:scripts/modules/task-manager.js) & `task-manager/` directory: Task Data & Core Logic**
|
||||||
- **Purpose**: Manages task data, including loading, saving, creating, updating, deleting, and querying tasks.
|
- **Purpose**: Contains core functions for task data manipulation (CRUD), AI interactions, and related logic.
|
||||||
- **Responsibilities**:
|
- **Responsibilities**:
|
||||||
- Reads and writes task data to `tasks.json` file.
|
- Reading/writing `tasks.json` with tagged task lists support.
|
||||||
- Implements functions for task CRUD operations (Create, Read, Update, Delete).
|
- Implementing functions for task CRUD, parsing PRDs, expanding tasks, updating status, etc.
|
||||||
- Handles task parsing from PRD documents using AI.
|
- **Tagged Task Lists**: Handles task organization across multiple contexts (tags) like "master", branch names, or project phases.
|
||||||
- Manages task expansion and subtask generation.
|
- **Tag Resolution**: Provides backward compatibility by resolving tagged format to legacy format transparently.
|
||||||
- Updates task statuses and properties.
|
- **Delegating AI interactions** to the `ai-services-unified.js` layer.
|
||||||
- Implements task listing and display logic.
|
- Accessing non-AI configuration via `config-manager.js` getters.
|
||||||
- Performs task complexity analysis using AI.
|
- **Key Files**: Individual files within `scripts/modules/task-manager/` handle specific actions (e.g., `add-task.js`, `expand-task.js`).
|
||||||
- **Key Functions**:
|
|
||||||
- `readTasks(tasksPath)` / `writeTasks(tasksPath, tasksData)`: Load and save task data.
|
|
||||||
- `parsePRD(prdFilePath, outputPath, numTasks)`: Parses PRD document to create tasks.
|
|
||||||
- `expandTask(taskId, numSubtasks, useResearch, prompt, force)`: Expands a task into subtasks.
|
|
||||||
- `setTaskStatus(tasksPath, taskIdInput, newStatus)`: Updates task status.
|
|
||||||
- `listTasks(tasksPath, statusFilter, withSubtasks)`: Lists tasks with filtering and subtask display options.
|
|
||||||
- `analyzeComplexity(tasksPath, reportPath, useResearch, thresholdScore)`: Analyzes task complexity.
|
|
||||||
|
|
||||||
- **[`dependency-manager.js`](mdc:scripts/modules/dependency-manager.js): Dependency Management**
|
- **[`dependency-manager.js`](mdc:scripts/modules/dependency-manager.js): Dependency Management**
|
||||||
- **Purpose**: Manages task dependencies, including adding, removing, validating, and fixing dependency relationships.
|
- **Purpose**: Manages task dependencies.
|
||||||
- **Responsibilities**:
|
- **Responsibilities**: Add/remove/validate/fix dependencies across tagged task contexts.
|
||||||
- Adds and removes task dependencies.
|
|
||||||
- Validates dependency relationships to prevent circular dependencies and invalid references.
|
|
||||||
- Fixes invalid dependencies by removing non-existent or self-referential dependencies.
|
|
||||||
- Provides functions to check for circular dependencies.
|
|
||||||
- **Key Functions**:
|
|
||||||
- `addDependency(tasksPath, taskId, dependencyId)`: Adds a dependency between tasks.
|
|
||||||
- `removeDependency(tasksPath, taskId, dependencyId)`: Removes a dependency.
|
|
||||||
- `validateDependencies(tasksPath)`: Validates task dependencies.
|
|
||||||
- `fixDependencies(tasksPath)`: Fixes invalid task dependencies.
|
|
||||||
- `isCircularDependency(tasks, taskId, dependencyChain)`: Detects circular dependencies.
|
|
||||||
|
|
||||||
- **[`ui.js`](mdc:scripts/modules/ui.js): User Interface Components**
|
- **[`ui.js`](mdc:scripts/modules/ui.js): User Interface Components**
|
||||||
- **Purpose**: Handles all user interface elements, including displaying information, formatting output, and providing user feedback.
|
- **Purpose**: Handles CLI output formatting (tables, colors, boxes, spinners).
|
||||||
- **Responsibilities**:
|
- **Responsibilities**: Displaying tasks, reports, progress, suggestions, and migration notices for tagged systems.
|
||||||
- Displays task lists, task details, and command outputs in a formatted way.
|
|
||||||
- Uses `chalk` for colored output and `boxen` for boxed messages.
|
|
||||||
- Implements table display using `cli-table3`.
|
|
||||||
- Shows loading indicators using `ora`.
|
|
||||||
- Provides helper functions for status formatting, dependency display, and progress reporting.
|
|
||||||
- Suggests next actions to the user after command execution.
|
|
||||||
- **Key Functions**:
|
|
||||||
- `displayTaskList(tasks, statusFilter, withSubtasks)`: Displays a list of tasks in a table.
|
|
||||||
- `displayTaskDetails(task)`: Displays detailed information for a single task.
|
|
||||||
- `displayComplexityReport(reportPath)`: Displays the task complexity report.
|
|
||||||
- `startLoadingIndicator(message)` / `stopLoadingIndicator(indicator)`: Manages loading indicators.
|
|
||||||
- `getStatusWithColor(status)`: Returns status string with color formatting.
|
|
||||||
- `formatDependenciesWithStatus(dependencies, allTasks, inTable)`: Formats dependency list with status indicators.
|
|
||||||
|
|
||||||
- **[`ai-services.js`](mdc:scripts/modules/ai-services.js) (Conceptual): AI Integration**
|
- **[`ai-services-unified.js`](mdc:scripts/modules/ai-services-unified.js): Unified AI Service Layer**
|
||||||
- **Purpose**: Abstracts interactions with AI models (like Anthropic Claude and Perplexity AI) for various features. *Note: This module might be implicitly implemented within `task-manager.js` and `utils.js` or could be explicitly created for better organization as the project evolves.*
|
- **Purpose**: Centralized interface for all LLM interactions using Vercel AI SDK.
|
||||||
- **Responsibilities**:
|
- **Responsibilities** (See also: [`ai_services.mdc`](mdc:.cursor/rules/ai_services.mdc)):
|
||||||
- Handles API calls to AI services.
|
- Exports `generateTextService`, `generateObjectService`.
|
||||||
- Manages prompts and parameters for AI requests.
|
- Handles provider/model selection based on `role` and `.taskmasterconfig`.
|
||||||
- Parses AI responses and extracts relevant information.
|
- Resolves API keys (from `.env` or `session.env`).
|
||||||
- Implements logic for task complexity analysis, task expansion, and PRD parsing using AI.
|
- Implements fallback and retry logic.
|
||||||
- **Potential Functions**:
|
- Orchestrates calls to provider-specific implementations (`src/ai-providers/`).
|
||||||
- `getAIResponse(prompt, model, maxTokens, temperature)`: Generic function to interact with AI model.
|
- Telemetry data generated by the AI service layer is propagated upwards through core logic, direct functions, and MCP tools. See [`telemetry.mdc`](mdc:.cursor/rules/telemetry.mdc) for the detailed integration pattern.
|
||||||
- `analyzeTaskComplexityWithAI(taskDescription)`: Sends task description to AI for complexity analysis.
|
|
||||||
- `expandTaskWithAI(taskDescription, numSubtasks, researchContext)`: Generates subtasks using AI.
|
|
||||||
- `parsePRDWithAI(prdContent)`: Extracts tasks from PRD content using AI.
|
|
||||||
|
|
||||||
- **[`utils.js`](mdc:scripts/modules/utils.js): Utility Functions and Configuration**
|
- **[`src/ai-providers/*.js`](mdc:src/ai-providers/): Provider-Specific Implementations**
|
||||||
- **Purpose**: Provides reusable utility functions and global configuration settings used across the **CLI application**.
|
- **Purpose**: Provider-specific wrappers for Vercel AI SDK functions.
|
||||||
|
- **Responsibilities**: Interact directly with Vercel AI SDK adapters.
|
||||||
|
|
||||||
|
- **[`config-manager.js`](mdc:scripts/modules/config-manager.js): Configuration Management**
|
||||||
|
- **Purpose**: Loads, validates, and provides access to configuration.
|
||||||
- **Responsibilities** (See also: [`utilities.mdc`](mdc:.cursor/rules/utilities.mdc)):
|
- **Responsibilities** (See also: [`utilities.mdc`](mdc:.cursor/rules/utilities.mdc)):
|
||||||
- Manages global configuration settings loaded from environment variables and defaults.
|
- Reads and merges `.taskmasterconfig` with defaults.
|
||||||
- Implements logging utility with different log levels and output formatting.
|
- Provides getters (e.g., `getMainProvider`, `getLogLevel`, `getDefaultSubtasks`) for accessing settings.
|
||||||
- Provides file system operation utilities (read/write JSON files).
|
- **Tag Configuration**: Manages `global.defaultTag` and `tags` section for tag system settings.
|
||||||
- Includes string manipulation utilities (e.g., `truncate`, `sanitizePrompt`).
|
- **Note**: Does **not** store or directly handle API keys (keys are in `.env` or MCP `session.env`).
|
||||||
- Offers task-specific utility functions (e.g., `formatTaskId`, `findTaskById`, `taskExists`).
|
|
||||||
- Implements graph algorithms like cycle detection for dependency management.
|
- **[`utils.js`](mdc:scripts/modules/utils.js): Core Utility Functions**
|
||||||
- **Silent Mode Control**: Provides `enableSilentMode` and `disableSilentMode` functions to control log output.
|
- **Purpose**: Low-level, reusable CLI utilities.
|
||||||
- **Key Components**:
|
- **Responsibilities** (See also: [`utilities.mdc`](mdc:.cursor/rules/utilities.mdc)):
|
||||||
- `CONFIG`: Global configuration object.
|
- Logging (`log` function), File I/O (`readJSON`, `writeJSON`), String utils (`truncate`).
|
||||||
- `log(level, ...args)`: Logging function.
|
- Task utils (`findTaskById`), Dependency utils (`findCycles`).
|
||||||
- `readJSON(filepath)` / `writeJSON(filepath, data)`: File I/O utilities for JSON files.
|
- API Key Resolution (`resolveEnvVariable`).
|
||||||
- `truncate(text, maxLength)`: String truncation utility.
|
- Silent Mode Control (`enableSilentMode`, `disableSilentMode`).
|
||||||
- `formatTaskId(id)` / `findTaskById(tasks, taskId)`: Task ID and search utilities.
|
- **Tagged Task Lists**: Silent migration system, tag resolution, current tag management.
|
||||||
- `findCycles(subtaskId, dependencyMap)`: Cycle detection algorithm.
|
- **Migration System**: `performCompleteTagMigration`, `migrateConfigJson`, `createStateJson`.
|
||||||
- `enableSilentMode()` / `disableSilentMode()`: Control console logging output.
|
|
||||||
|
|
||||||
- **[`mcp-server/`](mdc:mcp-server/): MCP Server Integration**
|
- **[`mcp-server/`](mdc:mcp-server/): MCP Server Integration**
|
||||||
- **Purpose**: Provides an MCP (Model Context Protocol) interface for Task Master, allowing integration with external tools like Cursor. Uses FastMCP framework.
|
- **Purpose**: Provides MCP interface using FastMCP.
|
||||||
- **Responsibilities** (See also: [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc)):
|
- **Responsibilities** (See also: [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc)):
|
||||||
- Registers Task Master functionalities as tools consumable via MCP.
|
- Registers tools (`mcp-server/src/tools/*.js`). Tool `execute` methods **should be wrapped** with the `withNormalizedProjectRoot` HOF (from `tools/utils.js`) to ensure consistent path handling.
|
||||||
- Handles MCP requests via tool `execute` methods defined in `mcp-server/src/tools/*.js`.
|
- The HOF provides a normalized `args.projectRoot` to the `execute` method.
|
||||||
- Tool `execute` methods call corresponding **direct function wrappers**.
|
- Tool `execute` methods call **direct function wrappers** (`mcp-server/src/core/direct-functions/*.js`), passing the normalized `projectRoot` and other args.
|
||||||
- Tool `execute` methods use `getProjectRootFromSession` (from [`tools/utils.js`](mdc:mcp-server/src/tools/utils.js)) to determine the project root from the client session and pass it to the direct function.
|
- Direct functions use path utilities (`mcp-server/src/core/utils/`) to resolve paths based on `projectRoot` from session.
|
||||||
- **Direct function wrappers (`*Direct` functions in `mcp-server/src/core/direct-functions/*.js`) contain the main logic for handling MCP requests**, including path resolution, argument validation, caching, and calling core Task Master functions.
|
- Direct functions implement silent mode, logger wrappers, and call core logic functions from `scripts/modules/`.
|
||||||
- Direct functions use `findTasksJsonPath` (from [`core/utils/path-utils.js`](mdc:mcp-server/src/core/utils/path-utils.js)) to locate `tasks.json` based on the provided `projectRoot`.
|
- **Tagged Task Lists**: MCP tools fully support the tagged format with complete tag management capabilities.
|
||||||
- **Silent Mode Implementation**: Direct functions use `enableSilentMode` and `disableSilentMode` to prevent logs from interfering with JSON responses.
|
- Manages MCP caching and response formatting.
|
||||||
- **Async Operations**: Uses `AsyncOperationManager` to handle long-running operations in the background.
|
|
||||||
- **Project Initialization**: Provides `initialize_project` command for setting up new projects from within integrated clients.
|
|
||||||
- Tool `execute` methods use `handleApiResult` from [`tools/utils.js`](mdc:mcp-server/src/tools/utils.js) to process the result from the direct function and format the final MCP response.
|
|
||||||
- Uses CLI execution via `executeTaskMasterCommand` as a fallback only when necessary.
|
|
||||||
- **Implements Robust Path Finding**: The utility [`tools/utils.js`](mdc:mcp-server/src/tools/utils.js) (specifically `getProjectRootFromSession`) and [`core/utils/path-utils.js`](mdc:mcp-server/src/core/utils/path-utils.js) (specifically `findTasksJsonPath`) work together. The tool gets the root via session, passes it to the direct function, which uses `findTasksJsonPath` to locate the specific `tasks.json` file within that root.
|
|
||||||
- **Implements Caching**: Utilizes a caching layer (`ContextManager` with `lru-cache`). Caching logic is invoked *within* the direct function wrappers using the `getCachedOrExecute` utility for performance-sensitive read operations.
|
|
||||||
- Standardizes response formatting and data filtering using utilities in [`tools/utils.js`](mdc:mcp-server/src/tools/utils.js).
|
|
||||||
- **Resource Management**: Provides access to static and dynamic resources.
|
|
||||||
- **Key Components**:
|
|
||||||
- `mcp-server/src/index.js`: Main server class definition with FastMCP initialization, resource registration, and server lifecycle management.
|
|
||||||
- `mcp-server/src/server.js`: Main server setup and initialization.
|
|
||||||
- `mcp-server/src/tools/`: Directory containing individual tool definitions. Each tool's `execute` method orchestrates the call to core logic and handles the response.
|
|
||||||
- `mcp-server/src/tools/utils.js`: Provides MCP-specific utilities like `handleApiResult`, `processMCPResponseData`, `getCachedOrExecute`, and **`getProjectRootFromSession`**.
|
|
||||||
- `mcp-server/src/core/utils/`: Directory containing utility functions specific to the MCP server, like **`path-utils.js` for resolving `tasks.json` within a given root** and **`async-manager.js` for handling background operations**.
|
|
||||||
- `mcp-server/src/core/direct-functions/`: Directory containing individual files for each **direct function wrapper (`*Direct`)**. These files contain the primary logic for MCP tool execution.
|
|
||||||
- `mcp-server/src/core/resources/`: Directory containing resource handlers for task templates, workflow definitions, and other static/dynamic data exposed to LLM clients.
|
|
||||||
- [`task-master-core.js`](mdc:mcp-server/src/core/task-master-core.js): Acts as an import/export hub, collecting and exporting direct functions from the `direct-functions` directory and MCP utility functions.
|
|
||||||
- **Naming Conventions**:
|
|
||||||
- **Files** use **kebab-case**: `list-tasks.js`, `set-task-status.js`, `parse-prd.js`
|
|
||||||
- **Direct Functions** use **camelCase** with `Direct` suffix: `listTasksDirect`, `setTaskStatusDirect`, `parsePRDDirect`
|
|
||||||
- **Tool Registration Functions** use **camelCase** with `Tool` suffix: `registerListTasksTool`, `registerSetTaskStatusTool`
|
|
||||||
- **MCP Tool Names** use **snake_case**: `list_tasks`, `set_task_status`, `parse_prd_document`
|
|
||||||
- **Resource Handlers** use **camelCase** with pattern URI: `@mcp.resource("tasks://templates/{template_id}")`
|
|
||||||
- **AsyncOperationManager**:
|
|
||||||
- **Purpose**: Manages background execution of long-running operations.
|
|
||||||
- **Location**: `mcp-server/src/core/utils/async-manager.js`
|
|
||||||
- **Key Features**:
|
|
||||||
- Operation tracking with unique IDs using UUID
|
|
||||||
- Status management (pending, running, completed, failed)
|
|
||||||
- Progress reporting forwarded from background tasks
|
|
||||||
- Operation history with automatic cleanup of completed operations
|
|
||||||
- Context preservation (log, session, reportProgress)
|
|
||||||
- Robust error handling for background tasks
|
|
||||||
- **Usage**: Used for CPU-intensive operations like task expansion and PRD parsing
|
|
||||||
|
|
||||||
- **Data Flow and Module Dependencies**:
|
- **[`init.js`](mdc:scripts/init.js): Project Initialization Logic**
|
||||||
|
- **Purpose**: Sets up new Task Master project structure.
|
||||||
|
- **Responsibilities**: Creates directories, copies templates, manages `package.json`, sets up `.cursor/mcp.json`, initializes state.json for tagged system.
|
||||||
|
|
||||||
- **Commands Initiate Actions**: User commands entered via the CLI (handled by [`commands.js`](mdc:scripts/modules/commands.js)) are the entry points for most operations.
|
## Tagged Task Lists System Architecture
|
||||||
- **Command Handlers Delegate to Managers**: Command handlers in [`commands.js`](mdc:scripts/modules/commands.js) call functions in [`task-manager.js`](mdc:scripts/modules/task-manager.js) and [`dependency-manager.js`](mdc:scripts/modules/dependency-manager.js) to perform core task and dependency management logic.
|
|
||||||
- **UI for Presentation**: [`ui.js`](mdc:scripts/modules/ui.js) is used by command handlers and task/dependency managers to display information to the user. UI functions primarily consume data and format it for output, without modifying core application state.
|
**Data Structure**: Task Master now uses a tagged task lists system where the `tasks.json` file contains multiple named task lists as top-level keys:
|
||||||
- **Utilities for Common Tasks**: [`utils.js`](mdc:scripts/modules/utils.js) provides helper functions used by all other modules for configuration, logging, file operations, and common data manipulations.
|
|
||||||
- **AI Services Integration**: AI functionalities (complexity analysis, task expansion, PRD parsing) are invoked from [`task-manager.js`](mdc:scripts/modules/task-manager.js) and potentially [`commands.js`](mdc:scripts/modules/commands.js), likely using functions that would reside in a dedicated `ai-services.js` module or be integrated within `utils.js` or `task-manager.js`.
|
```json
|
||||||
- **MCP Server Interaction**: External tools interact with the `mcp-server`. MCP Tool `execute` methods use `getProjectRootFromSession` to find the project root, then call direct function wrappers (in `mcp-server/src/core/direct-functions/`) passing the root in `args`. These wrappers handle path finding for `tasks.json` (using `path-utils.js`), validation, caching, call the core logic from `scripts/modules/` (passing logging context via the standard wrapper pattern detailed in mcp.mdc), and return a standardized result. The final MCP response is formatted by `mcp-server/src/tools/utils.js`. See [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc) for details.
|
{
|
||||||
|
"master": {
|
||||||
|
"tasks": [/* standard task objects */]
|
||||||
|
},
|
||||||
|
"feature-branch": {
|
||||||
|
"tasks": [/* separate task context */]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Key Components:**
|
||||||
|
|
||||||
|
- **Silent Migration**: Automatically transforms legacy `{"tasks": [...]}` format to tagged format `{"master": {"tasks": [...]}}` on first read
|
||||||
|
- **Tag Resolution Layer**: Provides 100% backward compatibility by intercepting tagged format and returning legacy format to existing code
|
||||||
|
- **Configuration Integration**: `global.defaultTag` and `tags` section in config.json manage tag system settings
|
||||||
|
- **State Management**: `.taskmaster/state.json` tracks current tag, migration status, and tag-branch mappings
|
||||||
|
- **Migration Notice**: User-friendly notification system for seamless migration experience
|
||||||
|
|
||||||
|
**Backward Compatibility**: All existing CLI commands and MCP tools continue to work unchanged. The tag resolution layer ensures that existing code receives the expected legacy format while the underlying storage uses the new tagged structure.
|
||||||
|
|
||||||
|
- **Data Flow and Module Dependencies (Updated)**:
|
||||||
|
|
||||||
|
- **CLI**: `bin/task-master.js` -> `scripts/dev.js` (loads `.env`) -> `scripts/modules/commands.js` -> Core Logic (`scripts/modules/*`) -> **Tag Resolution Layer** -> Unified AI Service (`ai-services-unified.js`) -> Provider Adapters -> LLM API.
|
||||||
|
- **MCP**: External Tool -> `mcp-server/server.js` -> Tool (`mcp-server/src/tools/*`) -> Direct Function (`mcp-server/src/core/direct-functions/*`) -> Core Logic (`scripts/modules/*`) -> **Tag Resolution Layer** -> Unified AI Service (`ai-services-unified.js`) -> Provider Adapters -> LLM API.
|
||||||
|
- **Configuration**: Core logic needing non-AI settings calls `config-manager.js` getters (passing `session.env` via `explicitRoot` if from MCP). Unified AI Service internally calls `config-manager.js` getters (using `role`) for AI params and `utils.js` (`resolveEnvVariable` with `session.env`) for API keys.
|
||||||
|
|
||||||
## Silent Mode Implementation Pattern in MCP Direct Functions
|
## Silent Mode Implementation Pattern in MCP Direct Functions
|
||||||
|
|
||||||
@@ -271,6 +228,7 @@ By following these patterns consistently, direct functions will properly manage
|
|||||||
- **Integration Tests**: Located in `tests/integration/`, test interactions between modules
|
- **Integration Tests**: Located in `tests/integration/`, test interactions between modules
|
||||||
- **End-to-End Tests**: Located in `tests/e2e/`, test complete workflows from a user perspective
|
- **End-to-End Tests**: Located in `tests/e2e/`, test complete workflows from a user perspective
|
||||||
- **Test Fixtures**: Located in `tests/fixtures/`, provide reusable test data
|
- **Test Fixtures**: Located in `tests/fixtures/`, provide reusable test data
|
||||||
|
- **Tagged System Tests**: Test migration, tag resolution, and multi-context functionality
|
||||||
|
|
||||||
- **Module Design for Testability**:
|
- **Module Design for Testability**:
|
||||||
- **Explicit Dependencies**: Functions accept their dependencies as parameters rather than using globals
|
- **Explicit Dependencies**: Functions accept their dependencies as parameters rather than using globals
|
||||||
@@ -279,12 +237,14 @@ By following these patterns consistently, direct functions will properly manage
|
|||||||
- **Clear Module Interfaces**: Each module has well-defined exports that can be mocked in tests
|
- **Clear Module Interfaces**: Each module has well-defined exports that can be mocked in tests
|
||||||
- **Callback Isolation**: Callbacks are defined as separate functions for easier testing
|
- **Callback Isolation**: Callbacks are defined as separate functions for easier testing
|
||||||
- **Stateless Design**: Modules avoid maintaining internal state where possible
|
- **Stateless Design**: Modules avoid maintaining internal state where possible
|
||||||
|
- **Tag Resolution Testing**: Test both tagged and legacy format handling
|
||||||
|
|
||||||
- **Mock Integration Patterns**:
|
- **Mock Integration Patterns**:
|
||||||
- **External Libraries**: Libraries like `fs`, `commander`, and `@anthropic-ai/sdk` are mocked at module level
|
- **External Libraries**: Libraries like `fs`, `commander`, and `@anthropic-ai/sdk` are mocked at module level
|
||||||
- **Internal Modules**: Application modules are mocked with appropriate spy functions
|
- **Internal Modules**: Application modules are mocked with appropriate spy functions
|
||||||
- **Testing Function Callbacks**: Callbacks are extracted from mock call arguments and tested in isolation
|
- **Testing Function Callbacks**: Callbacks are extracted from mock call arguments and tested in isolation
|
||||||
- **UI Elements**: Output functions from `ui.js` are mocked to verify display calls
|
- **UI Elements**: Output functions from `ui.js` are mocked to verify display calls
|
||||||
|
- **Tagged Data Mocking**: Test both legacy and tagged task data structures
|
||||||
|
|
||||||
- **Testing Flow**:
|
- **Testing Flow**:
|
||||||
- Module dependencies are mocked (following Jest's hoisting behavior)
|
- Module dependencies are mocked (following Jest's hoisting behavior)
|
||||||
@@ -292,6 +252,7 @@ By following these patterns consistently, direct functions will properly manage
|
|||||||
- Spy functions are set up on module methods
|
- Spy functions are set up on module methods
|
||||||
- Tests call the functions under test and verify behavior
|
- Tests call the functions under test and verify behavior
|
||||||
- Mocks are reset between test cases to maintain isolation
|
- Mocks are reset between test cases to maintain isolation
|
||||||
|
- Tagged system behavior is tested for both migration and normal operation
|
||||||
|
|
||||||
- **Benefits of this Architecture**:
|
- **Benefits of this Architecture**:
|
||||||
|
|
||||||
@@ -300,8 +261,11 @@ By following these patterns consistently, direct functions will properly manage
|
|||||||
- **Mocking Support**: The clear dependency boundaries make mocking straightforward
|
- **Mocking Support**: The clear dependency boundaries make mocking straightforward
|
||||||
- **Test Isolation**: Each component can be tested without affecting others
|
- **Test Isolation**: Each component can be tested without affecting others
|
||||||
- **Callback Testing**: Function callbacks can be extracted and tested independently
|
- **Callback Testing**: Function callbacks can be extracted and tested independently
|
||||||
|
- **Multi-Context Testing**: Tagged system enables testing different task contexts independently
|
||||||
- **Reusability**: Utility functions and UI components can be reused across different parts of the application.
|
- **Reusability**: Utility functions and UI components can be reused across different parts of the application.
|
||||||
- **Scalability**: New features can be added as new modules or by extending existing ones without significantly impacting other parts of the application.
|
- **Scalability**: New features can be added as new modules or by extending existing ones without significantly impacting other parts of the application.
|
||||||
|
- **Multi-Context Support**: Tagged task lists enable working across different contexts (branches, environments, phases) without conflicts.
|
||||||
|
- **Backward Compatibility**: Seamless migration and tag resolution ensure existing workflows continue unchanged.
|
||||||
- **Clarity**: The modular structure provides a clear separation of concerns, making the codebase easier to navigate and understand for developers.
|
- **Clarity**: The modular structure provides a clear separation of concerns, making the codebase easier to navigate and understand for developers.
|
||||||
|
|
||||||
This architectural overview should help AI models understand the structure and organization of the Task Master CLI codebase, enabling them to more effectively assist with code generation, modification, and understanding.
|
This architectural overview should help AI models understand the structure and organization of the Task Master CLI codebase, enabling them to more effectively assist with code generation, modification, and understanding.
|
||||||
@@ -323,6 +287,7 @@ Follow these steps to add MCP support for an existing Task Master command (see [
|
|||||||
- Call core logic.
|
- Call core logic.
|
||||||
- Return `{ success: true/false, data/error, fromCache: boolean }`.
|
- Return `{ success: true/false, data/error, fromCache: boolean }`.
|
||||||
- Export the wrapper function.
|
- Export the wrapper function.
|
||||||
|
- **Note**: Tag-aware MCP tools are fully implemented with complete tag management support.
|
||||||
|
|
||||||
3. **Update `task-master-core.js` with Import/Export**: Add imports/exports for the new `*Direct` function.
|
3. **Update `task-master-core.js` with Import/Export**: Add imports/exports for the new `*Direct` function.
|
||||||
|
|
||||||
@@ -349,23 +314,8 @@ The `initialize_project` command provides a way to set up a new Task Master proj
|
|||||||
- **MCP Tool**: `initialize_project`
|
- **MCP Tool**: `initialize_project`
|
||||||
- **Functionality**:
|
- **Functionality**:
|
||||||
- Creates necessary directories and files for a new project
|
- Creates necessary directories and files for a new project
|
||||||
- Sets up `tasks.json` and initial task files
|
- Sets up `tasks.json` with tagged structure and initial task files
|
||||||
- Configures project metadata (name, description, version)
|
- Configures project metadata (name, description, version)
|
||||||
|
- Initializes state.json for tag system
|
||||||
- Handles shell alias creation if requested
|
- Handles shell alias creation if requested
|
||||||
- Works in both interactive and non-interactive modes
|
- Works in both interactive and non-interactive modes
|
||||||
|
|
||||||
## Async Operation Management
|
|
||||||
|
|
||||||
The AsyncOperationManager provides background task execution capabilities:
|
|
||||||
|
|
||||||
- **Location**: `mcp-server/src/core/utils/async-manager.js`
|
|
||||||
- **Key Components**:
|
|
||||||
- `asyncOperationManager` singleton instance
|
|
||||||
- `addOperation(operationFn, args, context)` method
|
|
||||||
- `getStatus(operationId)` method
|
|
||||||
- **Usage Flow**:
|
|
||||||
1. Client calls an MCP tool that may take time to complete
|
|
||||||
2. Tool uses AsyncOperationManager to run the operation in background
|
|
||||||
3. Tool returns immediate response with operation ID
|
|
||||||
4. Client polls `get_operation_status` tool with the ID
|
|
||||||
5. Once completed, client can access operation results
|
|
||||||
@@ -24,7 +24,7 @@ While this document details the implementation of Task Master's **CLI commands**
|
|||||||
programInstance
|
programInstance
|
||||||
.command('command-name')
|
.command('command-name')
|
||||||
.description('Clear, concise description of what the command does')
|
.description('Clear, concise description of what the command does')
|
||||||
.option('-s, --short-option <value>', 'Option description', 'default value')
|
.option('-o, --option <value>', 'Option description', 'default value')
|
||||||
.option('--long-option <value>', 'Option description')
|
.option('--long-option <value>', 'Option description')
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
// Command implementation
|
// Command implementation
|
||||||
@@ -34,7 +34,8 @@ While this document details the implementation of Task Master's **CLI commands**
|
|||||||
- **Command Handler Organization**:
|
- **Command Handler Organization**:
|
||||||
- ✅ DO: Keep action handlers concise and focused
|
- ✅ DO: Keep action handlers concise and focused
|
||||||
- ✅ DO: Extract core functionality to appropriate modules
|
- ✅ DO: Extract core functionality to appropriate modules
|
||||||
- ✅ DO: Include validation for required parameters
|
- ✅ DO: Have the action handler import and call the relevant functions from core modules, like `task-manager.js` or `init.js`, passing the parsed `options`.
|
||||||
|
- ✅ DO: Perform basic parameter validation, such as checking for required options, within the action handler or at the start of the called core function.
|
||||||
- ❌ DON'T: Implement business logic in command handlers
|
- ❌ DON'T: Implement business logic in command handlers
|
||||||
|
|
||||||
## Best Practices for Removal/Delete Commands
|
## Best Practices for Removal/Delete Commands
|
||||||
@@ -43,7 +44,7 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
|
|
||||||
- **Confirmation Prompts**:
|
- **Confirmation Prompts**:
|
||||||
- ✅ **DO**: Include a confirmation prompt by default for destructive operations
|
- ✅ **DO**: Include a confirmation prompt by default for destructive operations
|
||||||
- ✅ **DO**: Provide a `--yes` or `-y` flag to skip confirmation for scripting/automation
|
- ✅ **DO**: Provide a `--yes` or `-y` flag to skip confirmation, useful for scripting or automation
|
||||||
- ✅ **DO**: Show what will be deleted in the confirmation message
|
- ✅ **DO**: Show what will be deleted in the confirmation message
|
||||||
- ❌ **DON'T**: Perform destructive operations without user confirmation unless explicitly overridden
|
- ❌ **DON'T**: Perform destructive operations without user confirmation unless explicitly overridden
|
||||||
|
|
||||||
@@ -77,7 +78,7 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
|
|
||||||
- **File Path Handling**:
|
- **File Path Handling**:
|
||||||
- ✅ **DO**: Use `path.join()` to construct file paths
|
- ✅ **DO**: Use `path.join()` to construct file paths
|
||||||
- ✅ **DO**: Follow established naming conventions for tasks (e.g., `task_001.txt`)
|
- ✅ **DO**: Follow established naming conventions for tasks, like `task_001.txt`
|
||||||
- ✅ **DO**: Check if files exist before attempting to delete them
|
- ✅ **DO**: Check if files exist before attempting to delete them
|
||||||
- ✅ **DO**: Handle file deletion errors gracefully
|
- ✅ **DO**: Handle file deletion errors gracefully
|
||||||
- ❌ **DON'T**: Construct paths with string concatenation
|
- ❌ **DON'T**: Construct paths with string concatenation
|
||||||
@@ -165,10 +166,10 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
- ✅ DO: Use descriptive, action-oriented names
|
- ✅ DO: Use descriptive, action-oriented names
|
||||||
|
|
||||||
- **Option Names**:
|
- **Option Names**:
|
||||||
- ✅ DO: Use kebab-case for long-form option names (`--output-format`)
|
- ✅ DO: Use kebab-case for long-form option names, like `--output-format`
|
||||||
- ✅ DO: Provide single-letter shortcuts when appropriate (`-f, --file`)
|
- ✅ DO: Provide single-letter shortcuts when appropriate, like `-f, --file`
|
||||||
- ✅ DO: Use consistent option names across similar commands
|
- ✅ DO: Use consistent option names across similar commands
|
||||||
- ❌ DON'T: Use different names for the same concept (`--file` in one command, `--path` in another)
|
- ❌ DON'T: Use different names for the same concept, such as `--file` in one command and `--path` in another
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Use consistent option naming
|
// ✅ DO: Use consistent option naming
|
||||||
@@ -180,7 +181,7 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
.option('-p, --path <dir>', 'Output directory') // Should be --output
|
.option('-p, --path <dir>', 'Output directory') // Should be --output
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: Although options are defined with kebab-case (`--num-tasks`), Commander.js stores them internally as camelCase properties. Access them in code as `options.numTasks`, not `options['num-tasks']`.
|
> **Note**: Although options are defined with kebab-case, like `--num-tasks`, Commander.js stores them internally as camelCase properties. Access them in code as `options.numTasks`, not `options['num-tasks']`.
|
||||||
|
|
||||||
- **Boolean Flag Conventions**:
|
- **Boolean Flag Conventions**:
|
||||||
- ✅ DO: Use positive flags with `--skip-` prefix for disabling behavior
|
- ✅ DO: Use positive flags with `--skip-` prefix for disabling behavior
|
||||||
@@ -209,7 +210,7 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
- **Required Parameters**:
|
- **Required Parameters**:
|
||||||
- ✅ DO: Check that required parameters are provided
|
- ✅ DO: Check that required parameters are provided
|
||||||
- ✅ DO: Provide clear error messages when parameters are missing
|
- ✅ DO: Provide clear error messages when parameters are missing
|
||||||
- ✅ DO: Use early returns with process.exit(1) for validation failures
|
- ✅ DO: Use early returns with `process.exit(1)` for validation failures
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Validate required parameters early
|
// ✅ DO: Validate required parameters early
|
||||||
@@ -220,7 +221,7 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
```
|
```
|
||||||
|
|
||||||
- **Parameter Type Conversion**:
|
- **Parameter Type Conversion**:
|
||||||
- ✅ DO: Convert string inputs to appropriate types (numbers, booleans)
|
- ✅ DO: Convert string inputs to appropriate types, such as numbers or booleans
|
||||||
- ✅ DO: Handle conversion errors gracefully
|
- ✅ DO: Handle conversion errors gracefully
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@@ -253,7 +254,7 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
const taskId = parseInt(options.id, 10);
|
const taskId = parseInt(options.id, 10);
|
||||||
if (isNaN(taskId) || taskId <= 0) {
|
if (isNaN(taskId) || taskId <= 0) {
|
||||||
console.error(chalk.red(`Error: Invalid task ID: ${options.id}. Task ID must be a positive integer.`));
|
console.error(chalk.red(`Error: Invalid task ID: ${options.id}. Task ID must be a positive integer.`));
|
||||||
console.log(chalk.yellow('Usage example: task-master update-task --id=\'23\' --prompt=\'Update with new information.\nEnsure proper error handling.\''));
|
console.log(chalk.yellow("Usage example: task-master update-task --id='23' --prompt='Update with new information.\\nEnsure proper error handling.'"));
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,6 +329,60 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Context-Aware Command Pattern
|
||||||
|
|
||||||
|
For AI-powered commands that benefit from project context, follow the research command pattern:
|
||||||
|
|
||||||
|
- **Context Integration**:
|
||||||
|
- ✅ DO: Use `ContextGatherer` utility for multi-source context extraction
|
||||||
|
- ✅ DO: Support task IDs, file paths, custom context, and project tree
|
||||||
|
- ✅ DO: Implement fuzzy search for automatic task discovery
|
||||||
|
- ✅ DO: Display detailed token breakdown for transparency
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Follow this pattern for context-aware commands
|
||||||
|
programInstance
|
||||||
|
.command('research')
|
||||||
|
.description('Perform AI-powered research queries with project context')
|
||||||
|
.argument('<prompt>', 'Research prompt to investigate')
|
||||||
|
.option('-i, --id <ids>', 'Comma-separated task/subtask IDs to include as context')
|
||||||
|
.option('-f, --files <paths>', 'Comma-separated file paths to include as context')
|
||||||
|
.option('-c, --context <text>', 'Additional custom context')
|
||||||
|
.option('--tree', 'Include project file tree structure')
|
||||||
|
.option('-d, --detail <level>', 'Output detail level: low, medium, high', 'medium')
|
||||||
|
.action(async (prompt, options) => {
|
||||||
|
// 1. Parameter validation and parsing
|
||||||
|
const taskIds = options.id ? parseTaskIds(options.id) : [];
|
||||||
|
const filePaths = options.files ? parseFilePaths(options.files) : [];
|
||||||
|
|
||||||
|
// 2. Initialize context gatherer
|
||||||
|
const projectRoot = findProjectRoot() || '.';
|
||||||
|
const gatherer = new ContextGatherer(projectRoot, tasksPath);
|
||||||
|
|
||||||
|
// 3. Auto-discover relevant tasks if none specified
|
||||||
|
if (taskIds.length === 0) {
|
||||||
|
const fuzzySearch = new FuzzyTaskSearch(tasksData.tasks, 'research');
|
||||||
|
const discoveredIds = fuzzySearch.getTaskIds(
|
||||||
|
fuzzySearch.findRelevantTasks(prompt)
|
||||||
|
);
|
||||||
|
taskIds.push(...discoveredIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. Gather context with token breakdown
|
||||||
|
const contextResult = await gatherer.gather({
|
||||||
|
tasks: taskIds,
|
||||||
|
files: filePaths,
|
||||||
|
customContext: options.context,
|
||||||
|
includeProjectTree: options.projectTree,
|
||||||
|
format: 'research',
|
||||||
|
includeTokenCounts: true
|
||||||
|
});
|
||||||
|
|
||||||
|
// 5. Display token breakdown and execute AI call
|
||||||
|
// Implementation continues...
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
## Error Handling
|
## Error Handling
|
||||||
|
|
||||||
- **Exception Management**:
|
- **Exception Management**:
|
||||||
@@ -391,9 +446,9 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
process.on('uncaughtException', (err) => {
|
process.on('uncaughtException', (err) => {
|
||||||
// Handle Commander-specific errors
|
// Handle Commander-specific errors
|
||||||
if (err.code === 'commander.unknownOption') {
|
if (err.code === 'commander.unknownOption') {
|
||||||
const option = err.message.match(/'([^']+)'/)?.[1];
|
const option = err.message.match(/'([^']+)'/)?.[1]; // Safely extract option name
|
||||||
console.error(chalk.red(`Error: Unknown option '${option}'`));
|
console.error(chalk.red(`Error: Unknown option '${option}'`));
|
||||||
console.error(chalk.yellow(`Run 'task-master <command> --help' to see available options`));
|
console.error(chalk.yellow("Run 'task-master <command> --help' to see available options"));
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -463,9 +518,9 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
.option('-f, --file <path>', 'Path to the tasks file', 'tasks/tasks.json')
|
.option('-f, --file <path>', 'Path to the tasks file', 'tasks/tasks.json')
|
||||||
.option('-p, --parent <id>', 'ID of the parent task (required)')
|
.option('-p, --parent <id>', 'ID of the parent task (required)')
|
||||||
.option('-i, --task-id <id>', 'Existing task ID to convert to subtask')
|
.option('-i, --task-id <id>', 'Existing task ID to convert to subtask')
|
||||||
.option('-t, --title <title>', 'Title for the new subtask (when not converting)')
|
.option('-t, --title <title>', 'Title for the new subtask, required if not converting')
|
||||||
.option('-d, --description <description>', 'Description for the new subtask (when not converting)')
|
.option('-d, --description <description>', 'Description for the new subtask, optional')
|
||||||
.option('--details <details>', 'Implementation details for the new subtask (when not converting)')
|
.option('--details <details>', 'Implementation details for the new subtask, optional')
|
||||||
.option('--dependencies <ids>', 'Comma-separated list of subtask IDs this subtask depends on')
|
.option('--dependencies <ids>', 'Comma-separated list of subtask IDs this subtask depends on')
|
||||||
.option('--status <status>', 'Initial status for the subtask', 'pending')
|
.option('--status <status>', 'Initial status for the subtask', 'pending')
|
||||||
.option('--skip-generate', 'Skip regenerating task files')
|
.option('--skip-generate', 'Skip regenerating task files')
|
||||||
@@ -488,8 +543,8 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
.command('remove-subtask')
|
.command('remove-subtask')
|
||||||
.description('Remove a subtask from its parent task, optionally converting it to a standalone task')
|
.description('Remove a subtask from its parent task, optionally converting it to a standalone task')
|
||||||
.option('-f, --file <path>', 'Path to the tasks file', 'tasks/tasks.json')
|
.option('-f, --file <path>', 'Path to the tasks file', 'tasks/tasks.json')
|
||||||
.option('-i, --id <id>', 'ID of the subtask to remove in format "parentId.subtaskId" (required)')
|
.option('-i, --id <id>', 'ID of the subtask to remove in format parentId.subtaskId, required')
|
||||||
.option('-c, --convert', 'Convert the subtask to a standalone task')
|
.option('-c, --convert', 'Convert the subtask to a standalone task instead of deleting')
|
||||||
.option('--skip-generate', 'Skip regenerating task files')
|
.option('--skip-generate', 'Skip regenerating task files')
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
// Implementation with detailed error handling
|
// Implementation with detailed error handling
|
||||||
@@ -512,7 +567,8 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
// ✅ DO: Implement version checking function
|
// ✅ DO: Implement version checking function
|
||||||
async function checkForUpdate() {
|
async function checkForUpdate() {
|
||||||
// Implementation details...
|
// Implementation details...
|
||||||
return { currentVersion, latestVersion, needsUpdate };
|
// Example return structure:
|
||||||
|
return { currentVersion, latestVersion, updateAvailable };
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ DO: Implement semantic version comparison
|
// ✅ DO: Implement semantic version comparison
|
||||||
@@ -552,7 +608,7 @@ When implementing commands that delete or remove data (like `remove-task` or `re
|
|||||||
|
|
||||||
// After command execution, check if an update is available
|
// After command execution, check if an update is available
|
||||||
const updateInfo = await updateCheckPromise;
|
const updateInfo = await updateCheckPromise;
|
||||||
if (updateInfo.needsUpdate) {
|
if (updateInfo.updateAvailable) {
|
||||||
displayUpgradeNotification(updateInfo.currentVersion, updateInfo.latestVersion);
|
displayUpgradeNotification(updateInfo.currentVersion, updateInfo.latestVersion);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
268
.cursor/rules/context_gathering.mdc
Normal file
268
.cursor/rules/context_gathering.mdc
Normal file
@@ -0,0 +1,268 @@
|
|||||||
|
---
|
||||||
|
description: Standardized patterns for gathering and processing context from multiple sources in Task Master commands, particularly for AI-powered features.
|
||||||
|
globs:
|
||||||
|
alwaysApply: false
|
||||||
|
---
|
||||||
|
# Context Gathering Patterns and Utilities
|
||||||
|
|
||||||
|
This document outlines the standardized patterns for gathering and processing context from multiple sources in Task Master commands, particularly for AI-powered features.
|
||||||
|
|
||||||
|
## Core Context Gathering Utility
|
||||||
|
|
||||||
|
The `ContextGatherer` class (`scripts/modules/utils/contextGatherer.js`) provides a centralized, reusable utility for extracting context from multiple sources:
|
||||||
|
|
||||||
|
### **Key Features**
|
||||||
|
- **Multi-source Context**: Tasks, files, custom text, project file tree
|
||||||
|
- **Token Counting**: Detailed breakdown using `gpt-tokens` library
|
||||||
|
- **Format Support**: Different output formats (research, chat, system-prompt)
|
||||||
|
- **Error Handling**: Graceful handling of missing files, invalid task IDs
|
||||||
|
- **Performance**: File size limits, depth limits for tree generation
|
||||||
|
|
||||||
|
### **Usage Pattern**
|
||||||
|
```javascript
|
||||||
|
import { ContextGatherer } from '../utils/contextGatherer.js';
|
||||||
|
|
||||||
|
// Initialize with project paths
|
||||||
|
const gatherer = new ContextGatherer(projectRoot, tasksPath);
|
||||||
|
|
||||||
|
// Gather context with detailed token breakdown
|
||||||
|
const result = await gatherer.gather({
|
||||||
|
tasks: ['15', '16.2'], // Task and subtask IDs
|
||||||
|
files: ['src/api.js', 'README.md'], // File paths
|
||||||
|
customContext: 'Additional context text',
|
||||||
|
includeProjectTree: true, // Include file tree
|
||||||
|
format: 'research', // Output format
|
||||||
|
includeTokenCounts: true // Get detailed token breakdown
|
||||||
|
});
|
||||||
|
|
||||||
|
// Access results
|
||||||
|
const contextString = result.context;
|
||||||
|
const tokenBreakdown = result.tokenBreakdown;
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Token Breakdown Structure**
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
customContext: { tokens: 150, characters: 800 },
|
||||||
|
tasks: [
|
||||||
|
{ id: '15', type: 'task', title: 'Task Title', tokens: 245, characters: 1200 },
|
||||||
|
{ id: '16.2', type: 'subtask', title: 'Subtask Title', tokens: 180, characters: 900 }
|
||||||
|
],
|
||||||
|
files: [
|
||||||
|
{ path: 'src/api.js', tokens: 890, characters: 4500, size: '4.5 KB' }
|
||||||
|
],
|
||||||
|
projectTree: { tokens: 320, characters: 1600 },
|
||||||
|
total: { tokens: 1785, characters: 8000 }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Fuzzy Search Integration
|
||||||
|
|
||||||
|
The `FuzzyTaskSearch` class (`scripts/modules/utils/fuzzyTaskSearch.js`) provides intelligent task discovery:
|
||||||
|
|
||||||
|
### **Key Features**
|
||||||
|
- **Semantic Matching**: Uses Fuse.js for similarity scoring
|
||||||
|
- **Purpose Categories**: Pattern-based task categorization
|
||||||
|
- **Relevance Scoring**: High/medium/low relevance thresholds
|
||||||
|
- **Context-Aware**: Different search configurations for different use cases
|
||||||
|
|
||||||
|
### **Usage Pattern**
|
||||||
|
```javascript
|
||||||
|
import { FuzzyTaskSearch } from '../utils/fuzzyTaskSearch.js';
|
||||||
|
|
||||||
|
// Initialize with tasks data and context
|
||||||
|
const fuzzySearch = new FuzzyTaskSearch(tasksData.tasks, 'research');
|
||||||
|
|
||||||
|
// Find relevant tasks
|
||||||
|
const searchResults = fuzzySearch.findRelevantTasks(query, {
|
||||||
|
maxResults: 8,
|
||||||
|
includeRecent: true,
|
||||||
|
includeCategoryMatches: true
|
||||||
|
});
|
||||||
|
|
||||||
|
// Get task IDs for context gathering
|
||||||
|
const taskIds = fuzzySearch.getTaskIds(searchResults);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Implementation Patterns for Commands
|
||||||
|
|
||||||
|
### **1. Context-Aware Command Structure**
|
||||||
|
```javascript
|
||||||
|
// In command action handler
|
||||||
|
async function commandAction(prompt, options) {
|
||||||
|
// 1. Parameter validation and parsing
|
||||||
|
const taskIds = options.id ? parseTaskIds(options.id) : [];
|
||||||
|
const filePaths = options.files ? parseFilePaths(options.files) : [];
|
||||||
|
|
||||||
|
// 2. Initialize context gatherer
|
||||||
|
const projectRoot = findProjectRoot() || '.';
|
||||||
|
const tasksPath = path.join(projectRoot, 'tasks', 'tasks.json');
|
||||||
|
const gatherer = new ContextGatherer(projectRoot, tasksPath);
|
||||||
|
|
||||||
|
// 3. Auto-discover relevant tasks if none specified
|
||||||
|
if (taskIds.length === 0) {
|
||||||
|
const fuzzySearch = new FuzzyTaskSearch(tasksData.tasks, 'research');
|
||||||
|
const discoveredIds = fuzzySearch.getTaskIds(
|
||||||
|
fuzzySearch.findRelevantTasks(prompt)
|
||||||
|
);
|
||||||
|
taskIds.push(...discoveredIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. Gather context with token breakdown
|
||||||
|
const contextResult = await gatherer.gather({
|
||||||
|
tasks: taskIds,
|
||||||
|
files: filePaths,
|
||||||
|
customContext: options.context,
|
||||||
|
includeProjectTree: options.projectTree,
|
||||||
|
format: 'research',
|
||||||
|
includeTokenCounts: true
|
||||||
|
});
|
||||||
|
|
||||||
|
// 5. Display token breakdown (for CLI)
|
||||||
|
if (outputFormat === 'text') {
|
||||||
|
displayDetailedTokenBreakdown(contextResult.tokenBreakdown);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 6. Use context in AI call
|
||||||
|
const aiResult = await generateTextService(role, session, systemPrompt, userPrompt);
|
||||||
|
|
||||||
|
// 7. Display results with enhanced formatting
|
||||||
|
displayResults(aiResult, contextResult.tokenBreakdown);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### **2. Token Display Pattern**
|
||||||
|
```javascript
|
||||||
|
function displayDetailedTokenBreakdown(tokenBreakdown, systemTokens, userTokens) {
|
||||||
|
const sections = [];
|
||||||
|
|
||||||
|
// Build context breakdown
|
||||||
|
if (tokenBreakdown.tasks?.length > 0) {
|
||||||
|
const taskDetails = tokenBreakdown.tasks.map(task =>
|
||||||
|
`${task.type === 'subtask' ? ' ' : ''}${task.id}: ${task.tokens.toLocaleString()}`
|
||||||
|
).join('\n');
|
||||||
|
sections.push(`Tasks (${tokenBreakdown.tasks.reduce((sum, t) => sum + t.tokens, 0).toLocaleString()}):\n${taskDetails}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tokenBreakdown.files?.length > 0) {
|
||||||
|
const fileDetails = tokenBreakdown.files.map(file =>
|
||||||
|
` ${file.path}: ${file.tokens.toLocaleString()} (${file.size})`
|
||||||
|
).join('\n');
|
||||||
|
sections.push(`Files (${tokenBreakdown.files.reduce((sum, f) => sum + f.tokens, 0).toLocaleString()}):\n${fileDetails}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add prompts breakdown
|
||||||
|
sections.push(`Prompts: system ${systemTokens.toLocaleString()}, user ${userTokens.toLocaleString()}`);
|
||||||
|
|
||||||
|
// Display in clean box
|
||||||
|
const content = sections.join('\n\n');
|
||||||
|
console.log(boxen(content, {
|
||||||
|
title: chalk.cyan('Token Usage'),
|
||||||
|
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
||||||
|
borderStyle: 'round',
|
||||||
|
borderColor: 'cyan'
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### **3. Enhanced Result Display Pattern**
|
||||||
|
```javascript
|
||||||
|
function displayResults(result, query, detailLevel, tokenBreakdown) {
|
||||||
|
// Header with query info
|
||||||
|
const header = boxen(
|
||||||
|
chalk.green.bold('Research Results') + '\n\n' +
|
||||||
|
chalk.gray('Query: ') + chalk.white(query) + '\n' +
|
||||||
|
chalk.gray('Detail Level: ') + chalk.cyan(detailLevel),
|
||||||
|
{
|
||||||
|
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
||||||
|
margin: { top: 1, bottom: 0 },
|
||||||
|
borderStyle: 'round',
|
||||||
|
borderColor: 'green'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
console.log(header);
|
||||||
|
|
||||||
|
// Process and highlight code blocks
|
||||||
|
const processedResult = processCodeBlocks(result);
|
||||||
|
|
||||||
|
// Main content in clean box
|
||||||
|
const contentBox = boxen(processedResult, {
|
||||||
|
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
||||||
|
margin: { top: 0, bottom: 1 },
|
||||||
|
borderStyle: 'single',
|
||||||
|
borderColor: 'gray'
|
||||||
|
});
|
||||||
|
console.log(contentBox);
|
||||||
|
|
||||||
|
console.log(chalk.green('✓ Research complete'));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Code Block Enhancement
|
||||||
|
|
||||||
|
### **Syntax Highlighting Pattern**
|
||||||
|
```javascript
|
||||||
|
import { highlight } from 'cli-highlight';
|
||||||
|
|
||||||
|
function processCodeBlocks(text) {
|
||||||
|
return text.replace(/```(\w+)?\n([\s\S]*?)```/g, (match, language, code) => {
|
||||||
|
try {
|
||||||
|
const highlighted = highlight(code.trim(), {
|
||||||
|
language: language || 'javascript',
|
||||||
|
theme: 'default'
|
||||||
|
});
|
||||||
|
return `\n${highlighted}\n`;
|
||||||
|
} catch (error) {
|
||||||
|
return `\n${code.trim()}\n`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Integration Guidelines
|
||||||
|
|
||||||
|
### **When to Use Context Gathering**
|
||||||
|
- ✅ **DO**: Use for AI-powered commands that benefit from project context
|
||||||
|
- ✅ **DO**: Use when users might want to reference specific tasks or files
|
||||||
|
- ✅ **DO**: Use for research, analysis, or generation commands
|
||||||
|
- ❌ **DON'T**: Use for simple CRUD operations that don't need AI context
|
||||||
|
|
||||||
|
### **Performance Considerations**
|
||||||
|
- ✅ **DO**: Set reasonable file size limits (50KB default)
|
||||||
|
- ✅ **DO**: Limit project tree depth (3-5 levels)
|
||||||
|
- ✅ **DO**: Provide token counts to help users understand context size
|
||||||
|
- ✅ **DO**: Allow users to control what context is included
|
||||||
|
|
||||||
|
### **Error Handling**
|
||||||
|
- ✅ **DO**: Gracefully handle missing files with warnings
|
||||||
|
- ✅ **DO**: Validate task IDs and provide helpful error messages
|
||||||
|
- ✅ **DO**: Continue processing even if some context sources fail
|
||||||
|
- ✅ **DO**: Provide fallback behavior when context gathering fails
|
||||||
|
|
||||||
|
### **Future Command Integration**
|
||||||
|
Commands that should consider adopting this pattern:
|
||||||
|
- `analyze-complexity` - Could benefit from file context
|
||||||
|
- `expand-task` - Could use related task context
|
||||||
|
- `update-task` - Could reference similar tasks for consistency
|
||||||
|
- `add-task` - Could use project context for better task generation
|
||||||
|
|
||||||
|
## Export Patterns
|
||||||
|
|
||||||
|
### **Context Gatherer Module**
|
||||||
|
```javascript
|
||||||
|
export {
|
||||||
|
ContextGatherer,
|
||||||
|
createContextGatherer // Factory function
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Fuzzy Search Module**
|
||||||
|
```javascript
|
||||||
|
export {
|
||||||
|
FuzzyTaskSearch,
|
||||||
|
PURPOSE_CATEGORIES,
|
||||||
|
RELEVANCE_THRESHOLDS
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
This context gathering system provides a foundation for building more intelligent, context-aware commands that can leverage project knowledge to provide better AI-powered assistance.
|
||||||
@@ -3,7 +3,6 @@ description: Guide for using Task Master to manage task-driven development workf
|
|||||||
globs: **/*
|
globs: **/*
|
||||||
alwaysApply: true
|
alwaysApply: true
|
||||||
---
|
---
|
||||||
|
|
||||||
# Task Master Development Workflow
|
# Task Master Development Workflow
|
||||||
|
|
||||||
This guide outlines the typical process for using Task Master to manage software development projects.
|
This guide outlines the typical process for using Task Master to manage software development projects.
|
||||||
@@ -19,6 +18,7 @@ Task Master offers two primary ways to interact:
|
|||||||
- Refer to [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc) for details on the MCP architecture and available tools.
|
- Refer to [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc) for details on the MCP architecture and available tools.
|
||||||
- A comprehensive list and description of MCP tools and their corresponding CLI commands can be found in [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc).
|
- A comprehensive list and description of MCP tools and their corresponding CLI commands can be found in [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc).
|
||||||
- **Restart the MCP server** if core logic in `scripts/modules` or MCP tool/direct function definitions change.
|
- **Restart the MCP server** if core logic in `scripts/modules` or MCP tool/direct function definitions change.
|
||||||
|
- **Note**: MCP tools fully support tagged task lists with complete tag management capabilities.
|
||||||
|
|
||||||
2. **`task-master` CLI (For Users & Fallback)**:
|
2. **`task-master` CLI (For Users & Fallback)**:
|
||||||
- The global `task-master` command provides a user-friendly interface for direct terminal interaction.
|
- The global `task-master` command provides a user-friendly interface for direct terminal interaction.
|
||||||
@@ -26,56 +26,91 @@ Task Master offers two primary ways to interact:
|
|||||||
- Install globally with `npm install -g task-master-ai` or use locally via `npx task-master-ai ...`.
|
- Install globally with `npm install -g task-master-ai` or use locally via `npx task-master-ai ...`.
|
||||||
- The CLI commands often mirror the MCP tools (e.g., `task-master list` corresponds to `get_tasks`).
|
- The CLI commands often mirror the MCP tools (e.g., `task-master list` corresponds to `get_tasks`).
|
||||||
- Refer to [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc) for a detailed command reference.
|
- Refer to [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc) for a detailed command reference.
|
||||||
|
- **Tagged Task Lists**: CLI fully supports the new tagged system with seamless migration.
|
||||||
|
|
||||||
|
## Tagged Task Lists System
|
||||||
|
|
||||||
|
Task Master now supports **tagged task lists** for multi-context task management:
|
||||||
|
|
||||||
|
- **Data Structure**: Tasks are organized into separate contexts (tags) like "master", "feature-branch", or "v2.0"
|
||||||
|
- **Seamless Migration**: Existing projects automatically migrate to use a "master" tag with zero disruption
|
||||||
|
- **Backward Compatibility**: All existing commands continue to work exactly as before
|
||||||
|
- **Context Isolation**: Tasks in different tags are completely separate and isolated
|
||||||
|
- **Silent Migration**: The first time you run any Task Master command, your existing tasks.json will be automatically migrated to the new tagged format
|
||||||
|
- **Migration Notice**: You'll see a friendly FYI notice after migration explaining the new system
|
||||||
|
|
||||||
|
**Migration Example**:
|
||||||
|
```json
|
||||||
|
// Before (legacy format)
|
||||||
|
{
|
||||||
|
"tasks": [
|
||||||
|
{ "id": 1, "title": "Setup API", ... }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
// After (tagged format - automatic)
|
||||||
|
{
|
||||||
|
"master": {
|
||||||
|
"tasks": [
|
||||||
|
{ "id": 1, "title": "Setup API", ... }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Tag Management**: CLI commands for tag management (`add-tag`, `use-tag`, `list-tags`, `delete-tag`, `rename-tag`, `copy-tag`) are now available with manual git integration via `--from-branch` option.
|
||||||
|
|
||||||
## Standard Development Workflow Process
|
## Standard Development Workflow Process
|
||||||
|
|
||||||
- Start new projects by running `init` tool / `task-master init` or `parse_prd` / `task-master parse-prd --input='<prd-file.txt>'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to generate initial tasks.json
|
- Start new projects by running `initialize_project` tool / `task-master init` or `parse_prd` / `task-master parse-prd --input='<prd-file.txt>'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to generate initial tasks.json with tagged structure
|
||||||
- Begin coding sessions with `get_tasks` / `task-master list` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to see current tasks, status, and IDs
|
- Begin coding sessions with `get_tasks` / `task-master list` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to see current tasks, status, and IDs
|
||||||
- Determine the next task to work on using `next_task` / `task-master next` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
- Determine the next task to work on using `next_task` / `task-master next` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
||||||
- Analyze task complexity with `analyze_complexity` / `task-master analyze-complexity --research` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) before breaking down tasks
|
- Analyze task complexity with `analyze_project_complexity` / `task-master analyze-complexity --research` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) before breaking down tasks
|
||||||
- Review complexity report using `complexity_report` / `task-master complexity-report` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
- Review complexity report using `complexity_report` / `task-master complexity-report` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
||||||
- Select tasks based on dependencies (all marked 'done'), priority level, and ID order
|
- Select tasks based on dependencies (all marked 'done'), priority level, and ID order
|
||||||
- Clarify tasks by checking task files in tasks/ directory or asking for user input
|
- Clarify tasks by checking task files in tasks/ directory or asking for user input
|
||||||
- View specific task details using `get_task` / `task-master show <id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to understand implementation requirements
|
- View specific task details using `get_task` / `task-master show <id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to understand implementation requirements
|
||||||
- Break down complex tasks using `expand_task` / `task-master expand --id=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) with appropriate flags
|
- Break down complex tasks using `expand_task` / `task-master expand --id=<id> --force --research` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) with appropriate flags like `--force` (to replace existing subtasks) and `--research`.
|
||||||
- Clear existing subtasks if needed using `clear_subtasks` / `task-master clear-subtasks --id=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) before regenerating
|
- Clear existing subtasks if needed using `clear_subtasks` / `task-master clear-subtasks --id=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) before regenerating
|
||||||
- Implement code following task details, dependencies, and project standards
|
- Implement code following task details, dependencies, and project standards
|
||||||
- Verify tasks according to test strategies before marking as complete (See [`tests.mdc`](mdc:.cursor/rules/tests.mdc))
|
- Verify tasks according to test strategies before marking as complete (See [`tests.mdc`](mdc:.cursor/rules/tests.mdc))
|
||||||
- Mark completed tasks with `set_task_status` / `task-master set-status --id=<id> --status=done` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc))
|
- Mark completed tasks with `set_task_status` / `task-master set-status --id=<id> --status=done` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc))
|
||||||
- Update dependent tasks when implementation differs from original plan using `update` / `task-master update --from=<id> --prompt="..."` or `update_task` / `task-master update-task --id=<id> --prompt="..."` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc))
|
- Update dependent tasks when implementation differs from original plan using `update` / `task-master update --from=<id> --prompt="..."` or `update_task` / `task-master update-task --id=<id> --prompt="..."` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc))
|
||||||
- Add new tasks discovered during implementation using `add_task` / `task-master add-task --prompt="..."` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
- Add new tasks discovered during implementation using `add_task` / `task-master add-task --prompt="..." --research` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
||||||
- Add new subtasks as needed using `add_subtask` / `task-master add-subtask --parent=<id> --title="..."` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
- Add new subtasks as needed using `add_subtask` / `task-master add-subtask --parent=<id> --title="..."` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
||||||
- Append notes or details to subtasks using `update_subtask` / `task-master update-subtask --id=<subtaskId> --prompt='Add implementation notes here...\nMore details...'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
- Append notes or details to subtasks using `update_subtask` / `task-master update-subtask --id=<subtaskId> --prompt='Add implementation notes here...\nMore details...'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
||||||
- Generate task files with `generate` / `task-master generate` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) after updating tasks.json
|
- Generate task files with `generate` / `task-master generate` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) after updating tasks.json
|
||||||
- Maintain valid dependency structure with `add_dependency`/`remove_dependency` tools or `task-master add-dependency`/`remove-dependency` commands, `validate_dependencies` / `task-master validate-dependencies`, and `fix_dependencies` / `task-master fix-dependencies` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) when needed
|
- Maintain valid dependency structure with `add_dependency`/`remove_dependency` tools or `task-master add-dependency`/`remove-dependency` commands, `validate_dependencies` / `task-master validate-dependencies`, and `fix_dependencies` / `task-master fix-dependencies` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) when needed
|
||||||
- Respect dependency chains and task priorities when selecting work
|
- Respect dependency chains and task priorities when selecting work
|
||||||
- Report progress regularly using `get_tasks` / `task-master list`
|
- Report progress regularly using `get_tasks` / `task-master list`
|
||||||
|
- Reorganize tasks as needed using `move_task` / `task-master move --from=<id> --to=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to change task hierarchy or ordering
|
||||||
|
|
||||||
## Task Complexity Analysis
|
## Task Complexity Analysis
|
||||||
|
|
||||||
- Run `analyze_complexity` / `task-master analyze-complexity --research` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) for comprehensive analysis
|
- Run `analyze_project_complexity` / `task-master analyze-complexity --research` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) for comprehensive analysis
|
||||||
- Review complexity report via `complexity_report` / `task-master complexity-report` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) for a formatted, readable version.
|
- Review complexity report via `complexity_report` / `task-master complexity-report` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) for a formatted, readable version.
|
||||||
- Focus on tasks with highest complexity scores (8-10) for detailed breakdown
|
- Focus on tasks with highest complexity scores (8-10) for detailed breakdown
|
||||||
- Use analysis results to determine appropriate subtask allocation
|
- Use analysis results to determine appropriate subtask allocation
|
||||||
- Note that reports are automatically used by the `expand` tool/command
|
- Note that reports are automatically used by the `expand_task` tool/command
|
||||||
|
|
||||||
## Task Breakdown Process
|
## Task Breakdown Process
|
||||||
|
|
||||||
- For tasks with complexity analysis, use `expand_task` / `task-master expand --id=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc))
|
- Use `expand_task` / `task-master expand --id=<id>`. It automatically uses the complexity report if found, otherwise generates default number of subtasks.
|
||||||
- Otherwise use `expand_task` / `task-master expand --id=<id> --num=<number>`
|
- Use `--num=<number>` to specify an explicit number of subtasks, overriding defaults or complexity report recommendations.
|
||||||
- Add `--research` flag to leverage Perplexity AI for research-backed expansion
|
- Add `--research` flag to leverage Perplexity AI for research-backed expansion.
|
||||||
- Use `--prompt="<context>"` to provide additional context when needed
|
- Add `--force` flag to clear existing subtasks before generating new ones (default is to append).
|
||||||
- Review and adjust generated subtasks as necessary
|
- Use `--prompt="<context>"` to provide additional context when needed.
|
||||||
- Use `--all` flag with `expand` or `expand_all` to expand multiple pending tasks at once
|
- Review and adjust generated subtasks as necessary.
|
||||||
- If subtasks need regeneration, clear them first with `clear_subtasks` / `task-master clear-subtasks` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
- Use `expand_all` tool or `task-master expand --all` to expand multiple pending tasks at once, respecting flags like `--force` and `--research`.
|
||||||
|
- If subtasks need complete replacement (regardless of the `--force` flag on `expand`), clear them first with `clear_subtasks` / `task-master clear-subtasks --id=<id>`.
|
||||||
|
|
||||||
## Implementation Drift Handling
|
## Implementation Drift Handling
|
||||||
|
|
||||||
- When implementation differs significantly from planned approach
|
- When implementation differs significantly from planned approach
|
||||||
- When future tasks need modification due to current implementation choices
|
- When future tasks need modification due to current implementation choices
|
||||||
- When new dependencies or requirements emerge
|
- When new dependencies or requirements emerge
|
||||||
- Use `update` / `task-master update --from=<futureTaskId> --prompt='<explanation>\nUpdate context...'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to update multiple future tasks.
|
- Use `update` / `task-master update --from=<futureTaskId> --prompt='<explanation>\nUpdate context...' --research` to update multiple future tasks.
|
||||||
- Use `update_task` / `task-master update-task --id=<taskId> --prompt='<explanation>\nUpdate context...'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to update a single specific task.
|
- Use `update_task` / `task-master update-task --id=<taskId> --prompt='<explanation>\nUpdate context...' --research` to update a single specific task.
|
||||||
|
|
||||||
## Task Status Management
|
## Task Status Management
|
||||||
|
|
||||||
@@ -97,28 +132,38 @@ Task Master offers two primary ways to interact:
|
|||||||
- **details**: In-depth implementation instructions (Example: `"Use GitHub client ID/secret, handle callback, set session token."`)
|
- **details**: In-depth implementation instructions (Example: `"Use GitHub client ID/secret, handle callback, set session token."`)
|
||||||
- **testStrategy**: Verification approach (Example: `"Deploy and call endpoint to confirm 'Hello World' response."`)
|
- **testStrategy**: Verification approach (Example: `"Deploy and call endpoint to confirm 'Hello World' response."`)
|
||||||
- **subtasks**: List of smaller, more specific tasks (Example: `[{"id": 1, "title": "Configure OAuth", ...}]`)
|
- **subtasks**: List of smaller, more specific tasks (Example: `[{"id": 1, "title": "Configure OAuth", ...}]`)
|
||||||
- Refer to [`tasks.mdc`](mdc:.cursor/rules/tasks.mdc) for more details on the task data structure.
|
- Refer to task structure details (previously linked to `tasks.mdc`).
|
||||||
|
|
||||||
## Environment Variables Configuration
|
## Configuration Management (Updated)
|
||||||
|
|
||||||
- Task Master behavior is configured via environment variables:
|
Taskmaster configuration is managed through two main mechanisms:
|
||||||
- **ANTHROPIC_API_KEY** (Required): Your Anthropic API key for Claude.
|
|
||||||
- **MODEL**: Claude model to use (e.g., `claude-3-opus-20240229`).
|
1. **`.taskmaster/config.json` File (Primary):**
|
||||||
- **MAX_TOKENS**: Maximum tokens for AI responses.
|
* Located in the project root directory.
|
||||||
- **TEMPERATURE**: Temperature for AI model responses.
|
* Stores most configuration settings: AI model selections (main, research, fallback), parameters (max tokens, temperature), logging level, default subtasks/priority, project name, etc.
|
||||||
- **DEBUG**: Enable debug logging (`true`/`false`).
|
* **Tagged System Settings**: Includes `global.defaultTag` (defaults to "master") and `tags` section for tag management configuration.
|
||||||
- **LOG_LEVEL**: Console output level (`debug`, `info`, `warn`, `error`).
|
* **Managed via `task-master models --setup` command.** Do not edit manually unless you know what you are doing.
|
||||||
- **DEFAULT_SUBTASKS**: Default number of subtasks for `expand`.
|
* **View/Set specific models via `task-master models` command or `models` MCP tool.**
|
||||||
- **DEFAULT_PRIORITY**: Default priority for new tasks.
|
* Created automatically when you run `task-master models --setup` for the first time or during tagged system migration.
|
||||||
- **PROJECT_NAME**: Project name used in metadata.
|
|
||||||
- **PROJECT_VERSION**: Project version used in metadata.
|
2. **Environment Variables (`.env` / `mcp.json`):**
|
||||||
- **PERPLEXITY_API_KEY**: API key for Perplexity AI (for `--research` flags).
|
* Used **only** for sensitive API keys and specific endpoint URLs.
|
||||||
- **PERPLEXITY_MODEL**: Perplexity model to use (e.g., `sonar-medium-online`).
|
* Place API keys (one per provider) in a `.env` file in the project root for CLI usage.
|
||||||
- See [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc) for default values and examples.
|
* For MCP/Cursor integration, configure these keys in the `env` section of `.cursor/mcp.json`.
|
||||||
|
* Available keys/variables: See `assets/env.example` or the Configuration section in the command reference (previously linked to `taskmaster.mdc`).
|
||||||
|
|
||||||
|
3. **`.taskmaster/state.json` File (Tagged System State):**
|
||||||
|
* Tracks current tag context and migration status.
|
||||||
|
* Automatically created during tagged system migration.
|
||||||
|
* Contains: `currentTag`, `lastSwitched`, `migrationNoticeShown`.
|
||||||
|
|
||||||
|
**Important:** Non-API key settings (like model selections, `MAX_TOKENS`, `TASKMASTER_LOG_LEVEL`) are **no longer configured via environment variables**. Use the `task-master models` command (or `--setup` for interactive configuration) or the `models` MCP tool.
|
||||||
|
**If AI commands FAIL in MCP** verify that the API key for the selected provider is present in the `env` section of `.cursor/mcp.json`.
|
||||||
|
**If AI commands FAIL in CLI** verify that the API key for the selected provider is present in the `.env` file in the root of the project.
|
||||||
|
|
||||||
## Determining the Next Task
|
## Determining the Next Task
|
||||||
|
|
||||||
- Run `next_task` / `task-master next` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to show the next task to work on
|
- Run `next_task` / `task-master next` to show the next task to work on.
|
||||||
- The command identifies tasks with all dependencies satisfied
|
- The command identifies tasks with all dependencies satisfied
|
||||||
- Tasks are prioritized by priority level, dependency count, and ID
|
- Tasks are prioritized by priority level, dependency count, and ID
|
||||||
- The command shows comprehensive task information including:
|
- The command shows comprehensive task information including:
|
||||||
@@ -133,7 +178,7 @@ Task Master offers two primary ways to interact:
|
|||||||
|
|
||||||
## Viewing Specific Task Details
|
## Viewing Specific Task Details
|
||||||
|
|
||||||
- Run `get_task` / `task-master show <id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to view a specific task
|
- Run `get_task` / `task-master show <id>` to view a specific task.
|
||||||
- Use dot notation for subtasks: `task-master show 1.2` (shows subtask 2 of task 1)
|
- Use dot notation for subtasks: `task-master show 1.2` (shows subtask 2 of task 1)
|
||||||
- Displays comprehensive information similar to the next command, but for a specific task
|
- Displays comprehensive information similar to the next command, but for a specific task
|
||||||
- For parent tasks, shows all subtasks and their current status
|
- For parent tasks, shows all subtasks and their current status
|
||||||
@@ -143,13 +188,32 @@ Task Master offers two primary ways to interact:
|
|||||||
|
|
||||||
## Managing Task Dependencies
|
## Managing Task Dependencies
|
||||||
|
|
||||||
- Use `add_dependency` / `task-master add-dependency --id=<id> --depends-on=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to add a dependency
|
- Use `add_dependency` / `task-master add-dependency --id=<id> --depends-on=<id>` to add a dependency.
|
||||||
- Use `remove_dependency` / `task-master remove-dependency --id=<id> --depends-on=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to remove a dependency
|
- Use `remove_dependency` / `task-master remove-dependency --id=<id> --depends-on=<id>` to remove a dependency.
|
||||||
- The system prevents circular dependencies and duplicate dependency entries
|
- The system prevents circular dependencies and duplicate dependency entries
|
||||||
- Dependencies are checked for existence before being added or removed
|
- Dependencies are checked for existence before being added or removed
|
||||||
- Task files are automatically regenerated after dependency changes
|
- Task files are automatically regenerated after dependency changes
|
||||||
- Dependencies are visualized with status indicators in task listings and files
|
- Dependencies are visualized with status indicators in task listings and files
|
||||||
|
|
||||||
|
## Task Reorganization
|
||||||
|
|
||||||
|
- Use `move_task` / `task-master move --from=<id> --to=<id>` to move tasks or subtasks within the hierarchy
|
||||||
|
- This command supports several use cases:
|
||||||
|
- Moving a standalone task to become a subtask (e.g., `--from=5 --to=7`)
|
||||||
|
- Moving a subtask to become a standalone task (e.g., `--from=5.2 --to=7`)
|
||||||
|
- Moving a subtask to a different parent (e.g., `--from=5.2 --to=7.3`)
|
||||||
|
- Reordering subtasks within the same parent (e.g., `--from=5.2 --to=5.4`)
|
||||||
|
- Moving a task to a new, non-existent ID position (e.g., `--from=5 --to=25`)
|
||||||
|
- Moving multiple tasks at once using comma-separated IDs (e.g., `--from=10,11,12 --to=16,17,18`)
|
||||||
|
- The system includes validation to prevent data loss:
|
||||||
|
- Allows moving to non-existent IDs by creating placeholder tasks
|
||||||
|
- Prevents moving to existing task IDs that have content (to avoid overwriting)
|
||||||
|
- Validates source tasks exist before attempting to move them
|
||||||
|
- The system maintains proper parent-child relationships and dependency integrity
|
||||||
|
- Task files are automatically regenerated after the move operation
|
||||||
|
- This provides greater flexibility in organizing and refining your task structure as project understanding evolves
|
||||||
|
- This is especially useful when dealing with potential merge conflicts arising from teams creating tasks on separate branches. Solve these conflicts very easily by moving your tasks and keeping theirs.
|
||||||
|
|
||||||
## Iterative Subtask Implementation
|
## Iterative Subtask Implementation
|
||||||
|
|
||||||
Once a task has been broken down into subtasks using `expand_task` or similar methods, follow this iterative process for implementation:
|
Once a task has been broken down into subtasks using `expand_task` or similar methods, follow this iterative process for implementation:
|
||||||
@@ -164,14 +228,14 @@ Once a task has been broken down into subtasks using `expand_task` or similar me
|
|||||||
* Gather *all* relevant details from this exploration phase.
|
* Gather *all* relevant details from this exploration phase.
|
||||||
|
|
||||||
3. **Log the Plan:**
|
3. **Log the Plan:**
|
||||||
* Run `update_subtask` / `task-master update-subtask --id=<subtaskId> --prompt='<detailed plan>'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
* Run `update_subtask` / `task-master update-subtask --id=<subtaskId> --prompt='<detailed plan>'`.
|
||||||
* Provide the *complete and detailed* findings from the exploration phase in the prompt. Include file paths, line numbers, proposed diffs, reasoning, and any potential challenges identified. Do not omit details. The goal is to create a rich, timestamped log within the subtask's `details`.
|
* Provide the *complete and detailed* findings from the exploration phase in the prompt. Include file paths, line numbers, proposed diffs, reasoning, and any potential challenges identified. Do not omit details. The goal is to create a rich, timestamped log within the subtask's `details`.
|
||||||
|
|
||||||
4. **Verify the Plan:**
|
4. **Verify the Plan:**
|
||||||
* Run `get_task` / `task-master show <subtaskId>` again to confirm that the detailed implementation plan has been successfully appended to the subtask's details.
|
* Run `get_task` / `task-master show <subtaskId>` again to confirm that the detailed implementation plan has been successfully appended to the subtask's details.
|
||||||
|
|
||||||
5. **Begin Implementation:**
|
5. **Begin Implementation:**
|
||||||
* Set the subtask status using `set_task_status` / `task-master set-status --id=<subtaskId> --status=in-progress` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
* Set the subtask status using `set_task_status` / `task-master set-status --id=<subtaskId> --status=in-progress`.
|
||||||
* Start coding based on the logged plan.
|
* Start coding based on the logged plan.
|
||||||
|
|
||||||
6. **Refine and Log Progress (Iteration 2+):**
|
6. **Refine and Log Progress (Iteration 2+):**
|
||||||
@@ -189,7 +253,7 @@ Once a task has been broken down into subtasks using `expand_task` or similar me
|
|||||||
7. **Review & Update Rules (Post-Implementation):**
|
7. **Review & Update Rules (Post-Implementation):**
|
||||||
* Once the implementation for the subtask is functionally complete, review all code changes and the relevant chat history.
|
* Once the implementation for the subtask is functionally complete, review all code changes and the relevant chat history.
|
||||||
* Identify any new or modified code patterns, conventions, or best practices established during the implementation.
|
* Identify any new or modified code patterns, conventions, or best practices established during the implementation.
|
||||||
* Create new or update existing Cursor rules in the `.cursor/rules/` directory to capture these patterns, following the guidelines in [`cursor_rules.mdc`](mdc:.cursor/rules/cursor_rules.mdc) and [`self_improve.mdc`](mdc:.cursor/rules/self_improve.mdc).
|
* Create new or update existing rules following internal guidelines (previously linked to `cursor_rules.mdc` and `self_improve.mdc`).
|
||||||
|
|
||||||
8. **Mark Task Complete:**
|
8. **Mark Task Complete:**
|
||||||
* After verifying the implementation and updating any necessary rules, mark the subtask as completed: `set_task_status` / `task-master set-status --id=<subtaskId> --status=done`.
|
* After verifying the implementation and updating any necessary rules, mark the subtask as completed: `set_task_status` / `task-master set-status --id=<subtaskId> --status=done`.
|
||||||
@@ -198,10 +262,10 @@ Once a task has been broken down into subtasks using `expand_task` or similar me
|
|||||||
* Stage the relevant code changes and any updated/new rule files (`git add .`).
|
* Stage the relevant code changes and any updated/new rule files (`git add .`).
|
||||||
* Craft a comprehensive Git commit message summarizing the work done for the subtask, including both code implementation and any rule adjustments.
|
* Craft a comprehensive Git commit message summarizing the work done for the subtask, including both code implementation and any rule adjustments.
|
||||||
* Execute the commit command directly in the terminal (e.g., `git commit -m 'feat(module): Implement feature X for subtask <subtaskId>\n\n- Details about changes...\n- Updated rule Y for pattern Z'`).
|
* Execute the commit command directly in the terminal (e.g., `git commit -m 'feat(module): Implement feature X for subtask <subtaskId>\n\n- Details about changes...\n- Updated rule Y for pattern Z'`).
|
||||||
* Consider if a Changeset is needed according to [`changeset.mdc`](mdc:.cursor/rules/changeset.mdc). If so, run `npm run changeset`, stage the generated file, and amend the commit or create a new one.
|
* Consider if a Changeset is needed according to internal versioning guidelines (previously linked to `changeset.mdc`). If so, run `npm run changeset`, stage the generated file, and amend the commit or create a new one.
|
||||||
|
|
||||||
10. **Proceed to Next Subtask:**
|
10. **Proceed to Next Subtask:**
|
||||||
* Identify the next subtask in the dependency chain (e.g., using `next_task` / `task-master next`) and repeat this iterative process starting from step 1.
|
* Identify the next subtask (e.g., using `next_task` / `task-master next`).
|
||||||
|
|
||||||
## Code Analysis & Refactoring Techniques
|
## Code Analysis & Refactoring Techniques
|
||||||
|
|
||||||
|
|||||||
404
.cursor/rules/git_workflow.mdc
Normal file
404
.cursor/rules/git_workflow.mdc
Normal file
@@ -0,0 +1,404 @@
|
|||||||
|
---
|
||||||
|
description: Git workflow integrated with Task Master for feature development and collaboration
|
||||||
|
globs: "**/*"
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
# Git Workflow with Task Master Integration
|
||||||
|
|
||||||
|
## **Branch Strategy**
|
||||||
|
|
||||||
|
### **Main Branch Protection**
|
||||||
|
- **main** branch contains production-ready code
|
||||||
|
- All feature development happens on task-specific branches
|
||||||
|
- Direct commits to main are prohibited
|
||||||
|
- All changes merge via Pull Requests
|
||||||
|
|
||||||
|
### **Task Branch Naming**
|
||||||
|
```bash
|
||||||
|
# ✅ DO: Use consistent task branch naming
|
||||||
|
task-001 # For Task 1
|
||||||
|
task-004 # For Task 4
|
||||||
|
task-015 # For Task 15
|
||||||
|
|
||||||
|
# ❌ DON'T: Use inconsistent naming
|
||||||
|
feature/user-auth
|
||||||
|
fix-database-issue
|
||||||
|
random-branch-name
|
||||||
|
```
|
||||||
|
|
||||||
|
## **Tagged Task Lists Integration**
|
||||||
|
|
||||||
|
Task Master's **tagged task lists system** provides significant benefits for Git workflows:
|
||||||
|
|
||||||
|
### **Multi-Context Development**
|
||||||
|
- **Branch-Specific Tasks**: Each branch can have its own task context using tags
|
||||||
|
- **Merge Conflict Prevention**: Tasks in different tags are completely isolated
|
||||||
|
- **Context Switching**: Seamlessly switch between different development contexts
|
||||||
|
- **Parallel Development**: Multiple team members can work on separate task contexts
|
||||||
|
|
||||||
|
### **Migration and Compatibility**
|
||||||
|
- **Seamless Migration**: Existing projects automatically migrate to use a "master" tag
|
||||||
|
- **Zero Disruption**: All existing Git workflows continue unchanged
|
||||||
|
- **Backward Compatibility**: Legacy projects work exactly as before
|
||||||
|
|
||||||
|
### **Manual Git Integration**
|
||||||
|
- **Manual Tag Creation**: Use `--from-branch` option to create tags from current git branch
|
||||||
|
- **Manual Context Switching**: Explicitly switch tag contexts as needed for different branches
|
||||||
|
- **Simplified Integration**: Focused on manual control rather than automatic workflows
|
||||||
|
|
||||||
|
## **Workflow Overview**
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
A[Start: On main branch] --> B[Pull latest changes]
|
||||||
|
B --> C[Create task branch<br/>git checkout -b task-XXX]
|
||||||
|
C --> D[Set task status: in-progress]
|
||||||
|
D --> E[Get task context & expand if needed<br/>Tasks automatically use current tag]
|
||||||
|
E --> F[Identify next subtask]
|
||||||
|
|
||||||
|
F --> G[Set subtask: in-progress]
|
||||||
|
G --> H[Research & collect context<br/>update_subtask with findings]
|
||||||
|
H --> I[Implement subtask]
|
||||||
|
I --> J[Update subtask with completion]
|
||||||
|
J --> K[Set subtask: done]
|
||||||
|
K --> L[Git commit subtask]
|
||||||
|
|
||||||
|
L --> M{More subtasks?}
|
||||||
|
M -->|Yes| F
|
||||||
|
M -->|No| N[Run final tests]
|
||||||
|
|
||||||
|
N --> O[Commit tests if added]
|
||||||
|
O --> P[Push task branch]
|
||||||
|
P --> Q[Create Pull Request]
|
||||||
|
Q --> R[Human review & merge]
|
||||||
|
R --> S[Switch to main & pull]
|
||||||
|
S --> T[Delete task branch]
|
||||||
|
T --> U[Ready for next task]
|
||||||
|
|
||||||
|
style A fill:#e1f5fe
|
||||||
|
style C fill:#f3e5f5
|
||||||
|
style G fill:#fff3e0
|
||||||
|
style L fill:#e8f5e8
|
||||||
|
style Q fill:#fce4ec
|
||||||
|
style R fill:#f1f8e9
|
||||||
|
style U fill:#e1f5fe
|
||||||
|
```
|
||||||
|
|
||||||
|
## **Complete Task Development Workflow**
|
||||||
|
|
||||||
|
### **Phase 1: Task Preparation**
|
||||||
|
```bash
|
||||||
|
# 1. Ensure you're on main branch and pull latest
|
||||||
|
git checkout main
|
||||||
|
git pull origin main
|
||||||
|
|
||||||
|
# 2. Check current branch status
|
||||||
|
git branch # Verify you're on main
|
||||||
|
|
||||||
|
# 3. Create task-specific branch
|
||||||
|
git checkout -b task-004 # For Task 4
|
||||||
|
|
||||||
|
# 4. Set task status in Task Master (tasks automatically use current tag context)
|
||||||
|
# Use: set_task_status tool or `task-master set-status --id=4 --status=in-progress`
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Phase 2: Task Analysis & Planning**
|
||||||
|
```bash
|
||||||
|
# 5. Get task context and expand if needed (uses current tag automatically)
|
||||||
|
# Use: get_task tool or `task-master show 4`
|
||||||
|
# Use: expand_task tool or `task-master expand --id=4 --research --force` (if complex)
|
||||||
|
|
||||||
|
# 6. Identify next subtask to work on
|
||||||
|
# Use: next_task tool or `task-master next`
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Phase 3: Subtask Implementation Loop**
|
||||||
|
For each subtask, follow this pattern:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 7. Mark subtask as in-progress
|
||||||
|
# Use: set_task_status tool or `task-master set-status --id=4.1 --status=in-progress`
|
||||||
|
|
||||||
|
# 8. Gather context and research (if needed)
|
||||||
|
# Use: update_subtask tool with research flag or:
|
||||||
|
# `task-master update-subtask --id=4.1 --prompt="Research findings..." --research`
|
||||||
|
|
||||||
|
# 9. Collect code context through AI exploration
|
||||||
|
# Document findings in subtask using update_subtask
|
||||||
|
|
||||||
|
# 10. Implement the subtask
|
||||||
|
# Write code, tests, documentation
|
||||||
|
|
||||||
|
# 11. Update subtask with completion details
|
||||||
|
# Use: update_subtask tool or:
|
||||||
|
# `task-master update-subtask --id=4.1 --prompt="Implementation complete..."`
|
||||||
|
|
||||||
|
# 12. Mark subtask as done
|
||||||
|
# Use: set_task_status tool or `task-master set-status --id=4.1 --status=done`
|
||||||
|
|
||||||
|
# 13. Commit the subtask implementation
|
||||||
|
git add .
|
||||||
|
git commit -m "feat(task-4): Complete subtask 4.1 - [Subtask Title]
|
||||||
|
|
||||||
|
- Implementation details
|
||||||
|
- Key changes made
|
||||||
|
- Any important notes
|
||||||
|
|
||||||
|
Subtask 4.1: [Brief description of what was accomplished]
|
||||||
|
Relates to Task 4: [Main task title]"
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Phase 4: Task Completion**
|
||||||
|
```bash
|
||||||
|
# 14. When all subtasks are complete, run final testing
|
||||||
|
# Create test file if needed, ensure all tests pass
|
||||||
|
npm test # or jest, or manual testing
|
||||||
|
|
||||||
|
# 15. If tests were added/modified, commit them
|
||||||
|
git add .
|
||||||
|
git commit -m "test(task-4): Add comprehensive tests for Task 4
|
||||||
|
|
||||||
|
- Unit tests for core functionality
|
||||||
|
- Integration tests for API endpoints
|
||||||
|
- All tests passing
|
||||||
|
|
||||||
|
Task 4: [Main task title] - Testing complete"
|
||||||
|
|
||||||
|
# 16. Push the task branch
|
||||||
|
git push origin task-004
|
||||||
|
|
||||||
|
# 17. Create Pull Request
|
||||||
|
# Title: "Task 4: [Task Title]"
|
||||||
|
# Description should include:
|
||||||
|
# - Task overview
|
||||||
|
# - Subtasks completed
|
||||||
|
# - Testing approach
|
||||||
|
# - Any breaking changes or considerations
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Phase 5: PR Merge & Cleanup**
|
||||||
|
```bash
|
||||||
|
# 18. Human reviews and merges PR into main
|
||||||
|
|
||||||
|
# 19. Switch back to main and pull merged changes
|
||||||
|
git checkout main
|
||||||
|
git pull origin main
|
||||||
|
|
||||||
|
# 20. Delete the feature branch (optional cleanup)
|
||||||
|
git branch -d task-004
|
||||||
|
git push origin --delete task-004
|
||||||
|
```
|
||||||
|
|
||||||
|
## **Commit Message Standards**
|
||||||
|
|
||||||
|
### **Subtask Commits**
|
||||||
|
```bash
|
||||||
|
# ✅ DO: Consistent subtask commit format
|
||||||
|
git commit -m "feat(task-4): Complete subtask 4.1 - Initialize Express server
|
||||||
|
|
||||||
|
- Set up Express.js with TypeScript configuration
|
||||||
|
- Added CORS and body parsing middleware
|
||||||
|
- Implemented health check endpoints
|
||||||
|
- Basic error handling middleware
|
||||||
|
|
||||||
|
Subtask 4.1: Initialize project with npm and install dependencies
|
||||||
|
Relates to Task 4: Setup Express.js Server Project"
|
||||||
|
|
||||||
|
# ❌ DON'T: Vague or inconsistent commits
|
||||||
|
git commit -m "fixed stuff"
|
||||||
|
git commit -m "working on task"
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Test Commits**
|
||||||
|
```bash
|
||||||
|
# ✅ DO: Separate test commits when substantial
|
||||||
|
git commit -m "test(task-4): Add comprehensive tests for Express server setup
|
||||||
|
|
||||||
|
- Unit tests for middleware configuration
|
||||||
|
- Integration tests for health check endpoints
|
||||||
|
- Mock tests for database connection
|
||||||
|
- All tests passing with 95% coverage
|
||||||
|
|
||||||
|
Task 4: Setup Express.js Server Project - Testing complete"
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Commit Type Prefixes**
|
||||||
|
- `feat(task-X):` - New feature implementation
|
||||||
|
- `fix(task-X):` - Bug fixes
|
||||||
|
- `test(task-X):` - Test additions/modifications
|
||||||
|
- `docs(task-X):` - Documentation updates
|
||||||
|
- `refactor(task-X):` - Code refactoring
|
||||||
|
- `chore(task-X):` - Build/tooling changes
|
||||||
|
|
||||||
|
## **Task Master Commands Integration**
|
||||||
|
|
||||||
|
### **Essential Commands for Git Workflow**
|
||||||
|
```bash
|
||||||
|
# Task management (uses current tag context automatically)
|
||||||
|
task-master show <id> # Get task/subtask details
|
||||||
|
task-master next # Find next task to work on
|
||||||
|
task-master set-status --id=<id> --status=<status>
|
||||||
|
task-master update-subtask --id=<id> --prompt="..." --research
|
||||||
|
|
||||||
|
# Task expansion (for complex tasks)
|
||||||
|
task-master expand --id=<id> --research --force
|
||||||
|
|
||||||
|
# Progress tracking
|
||||||
|
task-master list # View all tasks and status
|
||||||
|
task-master list --status=in-progress # View active tasks
|
||||||
|
```
|
||||||
|
|
||||||
|
### **MCP Tool Equivalents**
|
||||||
|
When using Cursor or other MCP-integrated tools:
|
||||||
|
- `get_task` instead of `task-master show`
|
||||||
|
- `next_task` instead of `task-master next`
|
||||||
|
- `set_task_status` instead of `task-master set-status`
|
||||||
|
- `update_subtask` instead of `task-master update-subtask`
|
||||||
|
|
||||||
|
## **Branch Management Rules**
|
||||||
|
|
||||||
|
### **Branch Protection**
|
||||||
|
```bash
|
||||||
|
# ✅ DO: Always work on task branches
|
||||||
|
git checkout -b task-005
|
||||||
|
# Make changes
|
||||||
|
git commit -m "..."
|
||||||
|
git push origin task-005
|
||||||
|
|
||||||
|
# ❌ DON'T: Commit directly to main
|
||||||
|
git checkout main
|
||||||
|
git commit -m "..." # NEVER do this
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Keeping Branches Updated**
|
||||||
|
```bash
|
||||||
|
# ✅ DO: Regularly sync with main (for long-running tasks)
|
||||||
|
git checkout task-005
|
||||||
|
git fetch origin
|
||||||
|
git rebase origin/main # or merge if preferred
|
||||||
|
|
||||||
|
# Resolve any conflicts and continue
|
||||||
|
```
|
||||||
|
|
||||||
|
## **Pull Request Guidelines**
|
||||||
|
|
||||||
|
### **PR Title Format**
|
||||||
|
```
|
||||||
|
Task <ID>: <Task Title>
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
Task 4: Setup Express.js Server Project
|
||||||
|
Task 7: Implement User Authentication
|
||||||
|
Task 12: Add Stripe Payment Integration
|
||||||
|
```
|
||||||
|
|
||||||
|
### **PR Description Template**
|
||||||
|
```markdown
|
||||||
|
## Task Overview
|
||||||
|
Brief description of the main task objective.
|
||||||
|
|
||||||
|
## Subtasks Completed
|
||||||
|
- [x] 4.1: Initialize project with npm and install dependencies
|
||||||
|
- [x] 4.2: Configure TypeScript, ESLint and Prettier
|
||||||
|
- [x] 4.3: Create basic Express app with middleware and health check route
|
||||||
|
|
||||||
|
## Implementation Details
|
||||||
|
- Key architectural decisions made
|
||||||
|
- Important code changes
|
||||||
|
- Any deviations from original plan
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
- [ ] Unit tests added/updated
|
||||||
|
- [ ] Integration tests passing
|
||||||
|
- [ ] Manual testing completed
|
||||||
|
|
||||||
|
## Breaking Changes
|
||||||
|
List any breaking changes or migration requirements.
|
||||||
|
|
||||||
|
## Related Tasks
|
||||||
|
Mention any dependent tasks or follow-up work needed.
|
||||||
|
```
|
||||||
|
|
||||||
|
## **Conflict Resolution**
|
||||||
|
|
||||||
|
### **Task Conflicts with Tagged System**
|
||||||
|
```bash
|
||||||
|
# With tagged task lists, merge conflicts are significantly reduced:
|
||||||
|
# 1. Different branches can use different tag contexts
|
||||||
|
# 2. Tasks in separate tags are completely isolated
|
||||||
|
# 3. Use Task Master's move functionality to reorganize if needed
|
||||||
|
|
||||||
|
# Manual git integration available:
|
||||||
|
# - Use `task-master add-tag --from-branch` to create tags from current branch
|
||||||
|
# - Manually switch contexts with `task-master use-tag <name>`
|
||||||
|
# - Simple, predictable workflow without automatic behavior
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Code Conflicts**
|
||||||
|
```bash
|
||||||
|
# Standard Git conflict resolution
|
||||||
|
git fetch origin
|
||||||
|
git rebase origin/main
|
||||||
|
# Resolve conflicts in files
|
||||||
|
git add .
|
||||||
|
git rebase --continue
|
||||||
|
```
|
||||||
|
|
||||||
|
## **Emergency Procedures**
|
||||||
|
|
||||||
|
### **Hotfixes**
|
||||||
|
```bash
|
||||||
|
# For urgent production fixes:
|
||||||
|
git checkout main
|
||||||
|
git pull origin main
|
||||||
|
git checkout -b hotfix-urgent-issue
|
||||||
|
|
||||||
|
# Make minimal fix
|
||||||
|
git commit -m "hotfix: Fix critical production issue
|
||||||
|
|
||||||
|
- Specific fix description
|
||||||
|
- Minimal impact change
|
||||||
|
- Requires immediate deployment"
|
||||||
|
|
||||||
|
git push origin hotfix-urgent-issue
|
||||||
|
# Create emergency PR for immediate review
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Task Abandonment**
|
||||||
|
```bash
|
||||||
|
# If task needs to be abandoned or significantly changed:
|
||||||
|
# 1. Update task status
|
||||||
|
task-master set-status --id=<id> --status=cancelled
|
||||||
|
|
||||||
|
# 2. Clean up branch
|
||||||
|
git checkout main
|
||||||
|
git branch -D task-<id>
|
||||||
|
git push origin --delete task-<id>
|
||||||
|
|
||||||
|
# 3. Document reasoning in task
|
||||||
|
task-master update-task --id=<id> --prompt="Task cancelled due to..."
|
||||||
|
```
|
||||||
|
|
||||||
|
## **Tagged System Benefits for Git Workflows**
|
||||||
|
|
||||||
|
### **Multi-Team Development**
|
||||||
|
- **Isolated Contexts**: Different teams can work on separate tag contexts without conflicts
|
||||||
|
- **Feature Branches**: Each feature branch can have its own task context
|
||||||
|
- **Release Management**: Separate tags for different release versions or environments
|
||||||
|
|
||||||
|
### **Merge Conflict Prevention**
|
||||||
|
- **Context Separation**: Tasks in different tags don't interfere with each other
|
||||||
|
- **Clean Merges**: Reduced likelihood of task-related merge conflicts
|
||||||
|
- **Parallel Development**: Multiple developers can work simultaneously without task conflicts
|
||||||
|
|
||||||
|
### **Manual Git Integration**
|
||||||
|
- **Branch-Based Tag Creation**: Use `--from-branch` option to create tags from current git branch
|
||||||
|
- **Manual Context Management**: Explicitly switch tag contexts as needed
|
||||||
|
- **Predictable Workflow**: Simple, manual control without automatic behavior
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**References:**
|
||||||
|
- [Task Master Workflow](mdc:.cursor/rules/dev_workflow.mdc)
|
||||||
|
- [Architecture Guidelines](mdc:.cursor/rules/architecture.mdc)
|
||||||
|
- [Task Master Commands](mdc:.cursor/rules/taskmaster.mdc)
|
||||||
@@ -3,24 +3,24 @@ description: Glossary of other Cursor rules
|
|||||||
globs: **/*
|
globs: **/*
|
||||||
alwaysApply: true
|
alwaysApply: true
|
||||||
---
|
---
|
||||||
|
|
||||||
# Glossary of Task Master Cursor Rules
|
# Glossary of Task Master Cursor Rules
|
||||||
|
|
||||||
This file provides a quick reference to the purpose of each rule file located in the `.cursor/rules` directory.
|
This file provides a quick reference to the purpose of each rule file located in the `.cursor/rules` directory.
|
||||||
|
|
||||||
- **[`architecture.mdc`](mdc:.cursor/rules/architecture.mdc)**: Describes the high-level architecture of the Task Master CLI application.
|
- **[`architecture.mdc`](mdc:.cursor/rules/architecture.mdc)**: Describes the high-level architecture of the Task Master CLI application, including the new tagged task lists system.
|
||||||
- **[`changeset.mdc`](mdc:.cursor/rules/changeset.mdc)**: Guidelines for using Changesets (npm run changeset) to manage versioning and changelogs.
|
- **[`changeset.mdc`](mdc:.cursor/rules/changeset.mdc)**: Guidelines for using Changesets (npm run changeset) to manage versioning and changelogs.
|
||||||
- **[`commands.mdc`](mdc:.cursor/rules/commands.mdc)**: Guidelines for implementing CLI commands using Commander.js.
|
- **[`commands.mdc`](mdc:.cursor/rules/commands.mdc)**: Guidelines for implementing CLI commands using Commander.js.
|
||||||
- **[`cursor_rules.mdc`](mdc:.cursor/rules/cursor_rules.mdc)**: Guidelines for creating and maintaining Cursor rules to ensure consistency and effectiveness.
|
- **[`cursor_rules.mdc`](mdc:.cursor/rules/cursor_rules.mdc)**: Guidelines for creating and maintaining Cursor rules to ensure consistency and effectiveness.
|
||||||
- **[`dependencies.mdc`](mdc:.cursor/rules/dependencies.mdc)**: Guidelines for managing task dependencies and relationships.
|
- **[`dependencies.mdc`](mdc:.cursor/rules/dependencies.mdc)**: Guidelines for managing task dependencies and relationships across tagged task contexts.
|
||||||
- **[`dev_workflow.mdc`](mdc:.cursor/rules/dev_workflow.mdc)**: Guide for using Task Master to manage task-driven development workflows.
|
- **[`dev_workflow.mdc`](mdc:.cursor/rules/dev_workflow.mdc)**: Guide for using Task Master to manage task-driven development workflows with tagged task lists support.
|
||||||
- **[`glossary.mdc`](mdc:.cursor/rules/glossary.mdc)**: This file; provides a glossary of other Cursor rules.
|
- **[`glossary.mdc`](mdc:.cursor/rules/glossary.mdc)**: This file; provides a glossary of other Cursor rules.
|
||||||
- **[`mcp.mdc`](mdc:.cursor/rules/mcp.mdc)**: Guidelines for implementing and interacting with the Task Master MCP Server.
|
- **[`mcp.mdc`](mdc:.cursor/rules/mcp.mdc)**: Guidelines for implementing and interacting with the Task Master MCP Server.
|
||||||
- **[`new_features.mdc`](mdc:.cursor/rules/new_features.mdc)**: Guidelines for integrating new features into the Task Master CLI.
|
- **[`new_features.mdc`](mdc:.cursor/rules/new_features.mdc)**: Guidelines for integrating new features into the Task Master CLI with tagged system considerations.
|
||||||
- **[`self_improve.mdc`](mdc:.cursor/rules/self_improve.mdc)**: Guidelines for continuously improving Cursor rules based on emerging code patterns and best practices.
|
- **[`self_improve.mdc`](mdc:.cursor/rules/self_improve.mdc)**: Guidelines for continuously improving Cursor rules based on emerging code patterns and best practices.
|
||||||
- **[`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)**: Comprehensive reference for Taskmaster MCP tools and CLI commands.
|
- **[`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)**: Comprehensive reference for Taskmaster MCP tools and CLI commands with tagged task lists information.
|
||||||
- **[`tasks.mdc`](mdc:.cursor/rules/tasks.mdc)**: Guidelines for implementing task management operations.
|
- **[`tasks.mdc`](mdc:.cursor/rules/tasks.mdc)**: Guidelines for implementing task management operations with tagged task lists system support.
|
||||||
- **[`tests.mdc`](mdc:.cursor/rules/tests.mdc)**: Guidelines for implementing and maintaining tests for Task Master CLI.
|
- **[`tests.mdc`](mdc:.cursor/rules/tests.mdc)**: Guidelines for implementing and maintaining tests for Task Master CLI.
|
||||||
- **[`ui.mdc`](mdc:.cursor/rules/ui.mdc)**: Guidelines for implementing and maintaining user interface components.
|
- **[`ui.mdc`](mdc:.cursor/rules/ui.mdc)**: Guidelines for implementing and maintaining user interface components.
|
||||||
- **[`utilities.mdc`](mdc:.cursor/rules/utilities.mdc)**: Guidelines for implementing utility functions.
|
- **[`utilities.mdc`](mdc:.cursor/rules/utilities.mdc)**: Guidelines for implementing utility functions including tagged task lists utilities.
|
||||||
|
- **[`telemetry.mdc`](mdc:.cursor/rules/telemetry.mdc)**: Guidelines for integrating AI usage telemetry across Task Master.
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ description: Guidelines for implementing and interacting with the Task Master MC
|
|||||||
globs: mcp-server/src/**/*, scripts/modules/**/*
|
globs: mcp-server/src/**/*, scripts/modules/**/*
|
||||||
alwaysApply: false
|
alwaysApply: false
|
||||||
---
|
---
|
||||||
|
|
||||||
# Task Master MCP Server Guidelines
|
# Task Master MCP Server Guidelines
|
||||||
|
|
||||||
This document outlines the architecture and implementation patterns for the Task Master Model Context Protocol (MCP) server, designed for integration with tools like Cursor.
|
This document outlines the architecture and implementation patterns for the Task Master Model Context Protocol (MCP) server, designed for integration with tools like Cursor.
|
||||||
@@ -90,69 +89,54 @@ When implementing a new direct function in `mcp-server/src/core/direct-functions
|
|||||||
```
|
```
|
||||||
|
|
||||||
5. **Handling Logging Context (`mcpLog`)**:
|
5. **Handling Logging Context (`mcpLog`)**:
|
||||||
- **Requirement**: Core functions that use the internal `report` helper function (common in `task-manager.js`, `dependency-manager.js`, etc.) expect the `options` object to potentially contain an `mcpLog` property. This `mcpLog` object **must** have callable methods for each log level (e.g., `mcpLog.info(...)`, `mcpLog.error(...)`).
|
- **Requirement**: Core functions (like those in `task-manager.js`) may accept an `options` object containing an optional `mcpLog` property. If provided, the core function expects this object to have methods like `mcpLog.info(...)`, `mcpLog.error(...)`.
|
||||||
- **Challenge**: The `log` object provided by FastMCP to the direct function's context, while functional, might not perfectly match this expected structure or could change in the future. Passing it directly can lead to runtime errors like `mcpLog[level] is not a function`.
|
- **Solution: The Logger Wrapper Pattern**: When calling a core function from a direct function, pass the `log` object provided by FastMCP *wrapped* in the standard `logWrapper` object. This ensures the core function receives a logger with the expected method structure.
|
||||||
- **Solution: The Logger Wrapper Pattern**: To reliably bridge the FastMCP `log` object and the core function's `mcpLog` expectation, use a simple wrapper object within the direct function:
|
|
||||||
```javascript
|
```javascript
|
||||||
// Standard logWrapper pattern within a Direct Function
|
// Standard logWrapper pattern within a Direct Function
|
||||||
const logWrapper = {
|
const logWrapper = {
|
||||||
info: (message, ...args) => log.info(message, ...args),
|
info: (message, ...args) => log.info(message, ...args),
|
||||||
warn: (message, ...args) => log.warn(message, ...args),
|
warn: (message, ...args) => log.warn(message, ...args),
|
||||||
error: (message, ...args) => log.error(message, ...args),
|
error: (message, ...args) => log.error(message, ...args),
|
||||||
debug: (message, ...args) => log.debug && log.debug(message, ...args), // Handle optional debug
|
debug: (message, ...args) => log.debug && log.debug(message, ...args),
|
||||||
success: (message, ...args) => log.info(message, ...args) // Map success to info if needed
|
success: (message, ...args) => log.info(message, ...args)
|
||||||
};
|
};
|
||||||
|
|
||||||
// ... later when calling the core function ...
|
// ... later when calling the core function ...
|
||||||
await coreFunction(
|
await coreFunction(
|
||||||
// ... other arguments ...
|
// ... other arguments ...
|
||||||
tasksPath,
|
|
||||||
taskId,
|
|
||||||
{
|
{
|
||||||
mcpLog: logWrapper, // Pass the wrapper object
|
mcpLog: logWrapper, // Pass the wrapper object
|
||||||
session
|
session // Also pass session if needed by core logic or AI service
|
||||||
},
|
},
|
||||||
'json' // Pass 'json' output format if supported by core function
|
'json' // Pass 'json' output format if supported by core function
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
- **Critical For JSON Output Format**: Passing the `logWrapper` as `mcpLog` serves a dual purpose:
|
- **JSON Output**: Passing `mcpLog` (via the wrapper) often triggers the core function to use a JSON-friendly output format, suppressing spinners/boxes.
|
||||||
1. **Prevents Runtime Errors**: It ensures the `mcpLog[level](...)` calls within the core function succeed
|
- ✅ **DO**: Implement this pattern in direct functions calling core functions that might use `mcpLog`.
|
||||||
2. **Controls Output Format**: In functions like `updateTaskById` and `updateSubtaskById`, the presence of `mcpLog` in the options triggers setting `outputFormat = 'json'` (instead of 'text'). This prevents UI elements (spinners, boxes) from being generated, which would break the JSON response.
|
|
||||||
- **Proven Solution**: This pattern has successfully fixed multiple issues in our MCP tools (including `update-task` and `update-subtask`), where direct passing of the `log` object or omitting `mcpLog` led to either runtime errors or JSON parsing failures from UI output.
|
|
||||||
- **When To Use**: Implement this wrapper in any direct function that calls a core function with an `options` object that might use `mcpLog` for logging or output format control.
|
|
||||||
- **Why it Works**: The `logWrapper` explicitly defines the `.info()`, `.warn()`, `.error()`, etc., methods that the core function's `report` helper needs, ensuring the `mcpLog[level](...)` call succeeds. It simply forwards the logging calls to the actual FastMCP `log` object.
|
|
||||||
- **Combined with Silent Mode**: Remember that using the `logWrapper` for `mcpLog` is **necessary *in addition* to using `enableSilentMode()` / `disableSilentMode()`** (see next point). The wrapper handles structured logging *within* the core function, while silent mode suppresses direct `console.log` and UI elements (spinners, boxes) that would break the MCP JSON response.
|
|
||||||
|
|
||||||
6. **Silent Mode Implementation**:
|
6. **Silent Mode Implementation**:
|
||||||
- ✅ **DO**: Import silent mode utilities at the top: `import { enableSilentMode, disableSilentMode, isSilentMode } from '../../../../scripts/modules/utils.js';`
|
- ✅ **DO**: Import silent mode utilities: `import { enableSilentMode, disableSilentMode, isSilentMode } from '../../../../scripts/modules/utils.js';`
|
||||||
- ✅ **DO**: Ensure core Task Master functions called from direct functions do **not** pollute `stdout` with console output (banners, spinners, logs) that would break MCP's JSON communication.
|
- ✅ **DO**: Wrap core function calls *within direct functions* using `enableSilentMode()` / `disableSilentMode()` in a `try/finally` block if the core function might produce console output (spinners, boxes, direct `console.log`) that isn't reliably controlled by passing `{ mcpLog }` or an `outputFormat` parameter.
|
||||||
- **Preferred**: Modify the core function to accept an `outputFormat: 'json'` parameter and check it internally before printing UI elements. Pass `'json'` from the direct function.
|
- ✅ **DO**: Always disable silent mode in the `finally` block.
|
||||||
- **Required Fallback/Guarantee**: If the core function cannot be modified or its output suppression is unreliable, **wrap the core function call** within the direct function using `enableSilentMode()` / `disableSilentMode()` in a `try/finally` block. This guarantees no console output interferes with the MCP response.
|
- ❌ **DON'T**: Wrap calls to the unified AI service (`generateTextService`, `generateObjectService`) in silent mode; their logging is handled internally.
|
||||||
- ✅ **DO**: Use `isSilentMode()` function to check global silent mode status if needed (rare in direct functions), NEVER access the global `silentMode` variable directly.
|
- **Example (Direct Function Guaranteeing Silence & using Log Wrapper)**:
|
||||||
- ❌ **DON'T**: Wrap AI client initialization or AI API calls in `enable/disableSilentMode`; their logging is controlled via the `log` object (passed potentially within the `logWrapper` for core functions).
|
|
||||||
- ❌ **DON'T**: Assume a core function is silent just because it *should* be. Verify or use the `enable/disableSilentMode` wrapper.
|
|
||||||
- **Example (Direct Function Guaranteeing Silence and using Log Wrapper)**:
|
|
||||||
```javascript
|
```javascript
|
||||||
export async function coreWrapperDirect(args, log, context = {}) {
|
export async function coreWrapperDirect(args, log, context = {}) {
|
||||||
const { session } = context;
|
const { session } = context;
|
||||||
const tasksPath = findTasksJsonPath(args, log);
|
const tasksPath = findTasksJsonPath(args, log);
|
||||||
|
const logWrapper = { /* ... */ };
|
||||||
// Create the logger wrapper
|
|
||||||
const logWrapper = { /* ... as defined above ... */ };
|
|
||||||
|
|
||||||
enableSilentMode(); // Ensure silence for direct console output
|
enableSilentMode(); // Ensure silence for direct console output
|
||||||
try {
|
try {
|
||||||
// Call core function, passing wrapper and 'json' format
|
|
||||||
const result = await coreFunction(
|
const result = await coreFunction(
|
||||||
tasksPath,
|
tasksPath,
|
||||||
args.param1,
|
args.param1,
|
||||||
{ mcpLog: logWrapper, session },
|
{ mcpLog: logWrapper, session }, // Pass context
|
||||||
'json' // Explicitly request JSON format if supported
|
'json' // Request JSON format if supported
|
||||||
);
|
);
|
||||||
return { success: true, data: result };
|
return { success: true, data: result };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(`Error: ${error.message}`);
|
log.error(`Error: ${error.message}`);
|
||||||
// Return standardized error object
|
|
||||||
return { success: false, error: { /* ... */ } };
|
return { success: false, error: { /* ... */ } };
|
||||||
} finally {
|
} finally {
|
||||||
disableSilentMode(); // Critical: Always disable in finally
|
disableSilentMode(); // Critical: Always disable in finally
|
||||||
@@ -163,32 +147,6 @@ When implementing a new direct function in `mcp-server/src/core/direct-functions
|
|||||||
7. **Debugging MCP/Core Logic Interaction**:
|
7. **Debugging MCP/Core Logic Interaction**:
|
||||||
- ✅ **DO**: If an MCP tool fails with unclear errors (like JSON parsing failures), run the equivalent `task-master` CLI command in the terminal. The CLI often provides more detailed error messages originating from the core logic (e.g., `ReferenceError`, stack traces) that are obscured by the MCP layer.
|
- ✅ **DO**: If an MCP tool fails with unclear errors (like JSON parsing failures), run the equivalent `task-master` CLI command in the terminal. The CLI often provides more detailed error messages originating from the core logic (e.g., `ReferenceError`, stack traces) that are obscured by the MCP layer.
|
||||||
|
|
||||||
### Specific Guidelines for AI-Based Direct Functions
|
|
||||||
|
|
||||||
Direct functions that interact with AI (e.g., `addTaskDirect`, `expandTaskDirect`) have additional responsibilities:
|
|
||||||
|
|
||||||
- **Context Parameter**: These functions receive an additional `context` object as their third parameter. **Critically, this object should only contain `{ session }`**. Do NOT expect or use `reportProgress` from this context.
|
|
||||||
```javascript
|
|
||||||
export async function yourAIDirect(args, log, context = {}) {
|
|
||||||
const { session } = context; // Only expect session
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
- **AI Client Initialization**:
|
|
||||||
- ✅ **DO**: Use the utilities from [`mcp-server/src/core/utils/ai-client-utils.js`](mdc:mcp-server/src/core/utils/ai-client-utils.js) (e.g., `getAnthropicClientForMCP(session, log)`) to get AI client instances. These correctly use the `session` object to resolve API keys.
|
|
||||||
- ✅ **DO**: Wrap client initialization in a try/catch block and return a specific `AI_CLIENT_ERROR` on failure.
|
|
||||||
- **AI Interaction**:
|
|
||||||
- ✅ **DO**: Build prompts using helper functions where appropriate (e.g., from `ai-prompt-helpers.js`).
|
|
||||||
- ✅ **DO**: Make the AI API call using appropriate helpers (e.g., `_handleAnthropicStream`). Pass the `log` object to these helpers for internal logging. **Do NOT pass `reportProgress`**.
|
|
||||||
- ✅ **DO**: Parse the AI response using helpers (e.g., `parseTaskJsonResponse`) and handle parsing errors with a specific code (e.g., `RESPONSE_PARSING_ERROR`).
|
|
||||||
- **Calling Core Logic**:
|
|
||||||
- ✅ **DO**: After successful AI interaction, call the relevant core Task Master function (from `scripts/modules/`) if needed (e.g., `addTaskDirect` calls `addTask`).
|
|
||||||
- ✅ **DO**: Pass necessary data, including potentially the parsed AI results, to the core function.
|
|
||||||
- ✅ **DO**: If the core function can produce console output, call it with an `outputFormat: 'json'` argument (or similar, depending on the function) to suppress CLI output. Ensure the core function is updated to respect this. Use `enableSilentMode/disableSilentMode` around the core function call as a fallback if `outputFormat` is not supported or insufficient.
|
|
||||||
- **Progress Indication**:
|
|
||||||
- ❌ **DON'T**: Call `reportProgress` within the direct function.
|
|
||||||
- ✅ **DO**: If intermediate progress status is needed *within* the long-running direct function, use standard logging: `log.info('Progress: Processing AI response...')`.
|
|
||||||
|
|
||||||
## Tool Definition and Execution
|
## Tool Definition and Execution
|
||||||
|
|
||||||
### Tool Structure
|
### Tool Structure
|
||||||
@@ -221,151 +179,78 @@ server.addTool({
|
|||||||
The `execute` function receives validated arguments and the FastMCP context:
|
The `execute` function receives validated arguments and the FastMCP context:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// Standard signature
|
|
||||||
execute: async (args, context) => {
|
|
||||||
// Tool implementation
|
|
||||||
}
|
|
||||||
|
|
||||||
// Destructured signature (recommended)
|
// Destructured signature (recommended)
|
||||||
execute: async (args, { log, reportProgress, session }) => {
|
execute: async (args, { log, session }) => {
|
||||||
// Tool implementation
|
// Tool implementation
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- **args**: The first parameter contains all the validated parameters defined in the tool's schema.
|
- **args**: Validated parameters.
|
||||||
- **context**: The second parameter is an object containing `{ log, reportProgress, session }` provided by FastMCP.
|
- **context**: Contains `{ log, session }` from FastMCP. (Removed `reportProgress`).
|
||||||
- ✅ **DO**: Use `{ log, session }` when calling direct functions.
|
|
||||||
- ⚠️ **WARNING**: Avoid passing `reportProgress` down to direct functions due to client compatibility issues. See Progress Reporting Convention below.
|
|
||||||
|
|
||||||
### Standard Tool Execution Pattern
|
### Standard Tool Execution Pattern with Path Normalization (Updated)
|
||||||
|
|
||||||
The `execute` method within each MCP tool (in `mcp-server/src/tools/*.js`) should follow this standard pattern:
|
To ensure consistent handling of project paths across different client environments (Windows, macOS, Linux, WSL) and input formats (e.g., `file:///...`, URI encoded paths), all MCP tool `execute` methods that require access to the project root **MUST** be wrapped with the `withNormalizedProjectRoot` Higher-Order Function (HOF).
|
||||||
|
|
||||||
1. **Log Entry**: Log the start of the tool execution with relevant arguments.
|
This HOF, defined in [`mcp-server/src/tools/utils.js`](mdc:mcp-server/src/tools/utils.js), performs the following before calling the tool's core logic:
|
||||||
2. **Get Project Root**: Use the `getProjectRootFromSession(session, log)` utility (from [`tools/utils.js`](mdc:mcp-server/src/tools/utils.js)) to extract the project root path from the client session. Fall back to `args.projectRoot` if the session doesn't provide a root.
|
|
||||||
3. **Call Direct Function**: Invoke the corresponding `*Direct` function wrapper (e.g., `listTasksDirect` from [`task-master-core.js`](mdc:mcp-server/src/core/task-master-core.js)), passing an updated `args` object that includes the resolved `projectRoot`. Crucially, the third argument (context) passed to the direct function should **only include `{ log, session }`**. **Do NOT pass `reportProgress`**.
|
|
||||||
```javascript
|
|
||||||
// Example call to a non-AI direct function
|
|
||||||
const result = await someDirectFunction({ ...args, projectRoot }, log);
|
|
||||||
|
|
||||||
// Example call to an AI-based direct function
|
1. **Determines the Raw Root:** It prioritizes `args.projectRoot` if provided by the client, otherwise it calls `getRawProjectRootFromSession` to extract the path from the session.
|
||||||
const resultAI = await someAIDirect({ ...args, projectRoot }, log, { session });
|
2. **Normalizes the Path:** It uses the `normalizeProjectRoot` helper to decode URIs, strip `file://` prefixes, fix potential Windows drive letter prefixes (e.g., `/C:/`), convert backslashes (`\`) to forward slashes (`/`), and resolve the path to an absolute path suitable for the server's OS.
|
||||||
```
|
3. **Injects Normalized Path:** It updates the `args` object by replacing the original `projectRoot` (or adding it) with the normalized, absolute path.
|
||||||
4. **Handle Result**: Receive the result object (`{ success, data/error, fromCache }`) from the `*Direct` function.
|
4. **Executes Original Logic:** It calls the original `execute` function body, passing the updated `args` object.
|
||||||
5. **Format Response**: Pass this result object to the `handleApiResult` utility (from [`tools/utils.js`](mdc:mcp-server/src/tools/utils.js)) for standardized MCP response formatting and error handling.
|
|
||||||
6. **Return**: Return the formatted response object provided by `handleApiResult`.
|
**Implementation Example:**
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// Example execute method structure for a tool calling an AI-based direct function
|
// In mcp-server/src/tools/your-tool.js
|
||||||
import { getProjectRootFromSession, handleApiResult, createErrorResponse } from './utils.js';
|
import {
|
||||||
import { someAIDirectFunction } from '../core/task-master-core.js';
|
handleApiResult,
|
||||||
|
createErrorResponse,
|
||||||
|
withNormalizedProjectRoot // <<< Import HOF
|
||||||
|
} from './utils.js';
|
||||||
|
import { yourDirectFunction } from '../core/task-master-core.js';
|
||||||
|
import { findTasksJsonPath } from '../core/utils/path-utils.js'; // If needed
|
||||||
|
|
||||||
|
export function registerYourTool(server) {
|
||||||
|
server.addTool({
|
||||||
|
name: "your_tool",
|
||||||
|
description: "...".
|
||||||
|
parameters: z.object({
|
||||||
|
// ... other parameters ...
|
||||||
|
projectRoot: z.string().optional().describe('...') // projectRoot is optional here, HOF handles fallback
|
||||||
|
}),
|
||||||
|
// Wrap the entire execute function
|
||||||
|
execute: withNormalizedProjectRoot(async (args, { log, session }) => {
|
||||||
|
// args.projectRoot is now guaranteed to be normalized and absolute
|
||||||
|
const { /* other args */, projectRoot } = args;
|
||||||
|
|
||||||
// ... inside server.addTool({...})
|
|
||||||
execute: async (args, { log, session }) => { // Note: reportProgress is omitted here
|
|
||||||
try {
|
try {
|
||||||
log.info(`Starting AI tool execution with args: ${JSON.stringify(args)}`);
|
log.info(`Executing your_tool with normalized root: ${projectRoot}`);
|
||||||
|
|
||||||
// 1. Get Project Root
|
// Resolve paths using the normalized projectRoot
|
||||||
let rootFolder = getProjectRootFromSession(session, log);
|
let tasksPath = findTasksJsonPath({ projectRoot, file: args.file }, log);
|
||||||
if (!rootFolder && args.projectRoot) { // Fallback if needed
|
|
||||||
rootFolder = args.projectRoot;
|
|
||||||
log.info(`Using project root from args as fallback: ${rootFolder}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Call AI-Based Direct Function (passing only log and session in context)
|
// Call direct function, passing normalized projectRoot if needed by direct func
|
||||||
const result = await someAIDirectFunction({
|
const result = await yourDirectFunction(
|
||||||
...args,
|
{
|
||||||
projectRoot: rootFolder // Ensure projectRoot is explicitly passed
|
/* other args */,
|
||||||
}, log, { session }); // Pass session here, NO reportProgress
|
projectRoot // Pass it if direct function needs it
|
||||||
|
},
|
||||||
|
log,
|
||||||
|
{ session }
|
||||||
|
);
|
||||||
|
|
||||||
// 3. Handle and Format Response
|
|
||||||
return handleApiResult(result, log);
|
return handleApiResult(result, log);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(`Error during AI tool execution: ${error.message}`);
|
log.error(`Error in your_tool: ${error.message}`);
|
||||||
return createErrorResponse(error.message);
|
return createErrorResponse(error.message);
|
||||||
}
|
}
|
||||||
|
}) // End HOF wrap
|
||||||
|
});
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using AsyncOperationManager for Background Tasks
|
By using this HOF, the core logic within the `execute` method and any downstream functions (like `findTasksJsonPath` or direct functions) can reliably expect `args.projectRoot` to be a clean, absolute path suitable for the server environment.
|
||||||
|
|
||||||
For tools that execute potentially long-running operations *where the AI call is just one part* (e.g., `expand-task`, `update`), use the AsyncOperationManager. The `add-task` command, as refactored, does *not* require this in the MCP tool layer because the direct function handles the primary AI work and returns the final result synchronously from the perspective of the MCP tool.
|
|
||||||
|
|
||||||
For tools that *do* use `AsyncOperationManager`:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { AsyncOperationManager } from '../utils/async-operation-manager.js'; // Correct path assuming utils location
|
|
||||||
import { getProjectRootFromSession, createContentResponse, createErrorResponse } from './utils.js';
|
|
||||||
import { someIntensiveDirect } from '../core/task-master-core.js';
|
|
||||||
|
|
||||||
// ... inside server.addTool({...})
|
|
||||||
execute: async (args, { log, session }) => { // Note: reportProgress omitted
|
|
||||||
try {
|
|
||||||
log.info(`Starting background operation with args: ${JSON.stringify(args)}`);
|
|
||||||
|
|
||||||
// 1. Get Project Root
|
|
||||||
let rootFolder = getProjectRootFromSession(session, log);
|
|
||||||
if (!rootFolder && args.projectRoot) {
|
|
||||||
rootFolder = args.projectRoot;
|
|
||||||
log.info(`Using project root from args as fallback: ${rootFolder}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create operation description
|
|
||||||
const operationDescription = `Expanding task ${args.id}...`; // Example
|
|
||||||
|
|
||||||
// 2. Start async operation using AsyncOperationManager
|
|
||||||
const operation = AsyncOperationManager.createOperation(
|
|
||||||
operationDescription,
|
|
||||||
async (reportProgressCallback) => { // This callback is provided by AsyncOperationManager
|
|
||||||
// This runs in the background
|
|
||||||
try {
|
|
||||||
// Report initial progress *from the manager's callback*
|
|
||||||
reportProgressCallback({ progress: 0, status: 'Starting operation...' });
|
|
||||||
|
|
||||||
// Call the direct function (passing only session context)
|
|
||||||
const result = await someIntensiveDirect(
|
|
||||||
{ ...args, projectRoot: rootFolder },
|
|
||||||
log,
|
|
||||||
{ session } // Pass session, NO reportProgress
|
|
||||||
);
|
|
||||||
|
|
||||||
// Report final progress *from the manager's callback*
|
|
||||||
reportProgressCallback({
|
|
||||||
progress: 100,
|
|
||||||
status: result.success ? 'Operation completed' : 'Operation failed',
|
|
||||||
result: result.data, // Include final data if successful
|
|
||||||
error: result.error // Include error object if failed
|
|
||||||
});
|
|
||||||
|
|
||||||
return result; // Return the direct function's result
|
|
||||||
} catch (error) {
|
|
||||||
// Handle errors within the async task
|
|
||||||
reportProgressCallback({
|
|
||||||
progress: 100,
|
|
||||||
status: 'Operation failed critically',
|
|
||||||
error: { message: error.message, code: error.code || 'ASYNC_OPERATION_FAILED' }
|
|
||||||
});
|
|
||||||
throw error; // Re-throw for the manager to catch
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// 3. Return immediate response with operation ID
|
|
||||||
return {
|
|
||||||
status: 202, // StatusCodes.ACCEPTED
|
|
||||||
body: {
|
|
||||||
success: true,
|
|
||||||
message: 'Operation started',
|
|
||||||
operationId: operation.id
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} catch (error) {
|
|
||||||
log.error(`Error starting background operation: ${error.message}`);
|
|
||||||
return createErrorResponse(`Failed to start operation: ${error.message}`); // Use standard error response
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Project Initialization Tool
|
### Project Initialization Tool
|
||||||
|
|
||||||
@@ -417,19 +302,13 @@ log.error(`Error occurred: ${error.message}`, { stack: error.stack });
|
|||||||
log.info('Progress: 50% - AI call initiated...'); // Example progress logging
|
log.info('Progress: 50% - AI call initiated...'); // Example progress logging
|
||||||
```
|
```
|
||||||
|
|
||||||
### Progress Reporting Convention
|
## Session Usage Convention
|
||||||
|
|
||||||
- ⚠️ **DEPRECATED within Direct Functions**: The `reportProgress` function passed in the `context` object should **NOT** be called from within `*Direct` functions. Doing so can cause client-side validation errors due to missing/incorrect `progressToken` handling.
|
|
||||||
- ✅ **DO**: For tools using `AsyncOperationManager`, use the `reportProgressCallback` function *provided by the manager* within the background task definition (as shown in the `AsyncOperationManager` example above) to report progress updates for the *overall operation*.
|
|
||||||
- ✅ **DO**: If finer-grained progress needs to be indicated *during* the execution of a `*Direct` function (whether called directly or via `AsyncOperationManager`), use `log.info()` statements (e.g., `log.info('Progress: Parsing AI response...')`).
|
|
||||||
|
|
||||||
### Session Usage Convention
|
|
||||||
|
|
||||||
The `session` object (destructured from `context`) contains authenticated session data and client information.
|
The `session` object (destructured from `context`) contains authenticated session data and client information.
|
||||||
|
|
||||||
- **Authentication**: Access user-specific data (`session.userId`, etc.) if authentication is implemented.
|
- **Authentication**: Access user-specific data (`session.userId`, etc.) if authentication is implemented.
|
||||||
- **Project Root**: The primary use in Task Master is accessing `session.roots` to determine the client's project root directory via the `getProjectRootFromSession` utility (from [`tools/utils.js`](mdc:mcp-server/src/tools/utils.js)). See the Standard Tool Execution Pattern above.
|
- **Project Root**: The primary use in Task Master is accessing `session.roots` to determine the client's project root directory via the `getProjectRootFromSession` utility (from [`tools/utils.js`](mdc:mcp-server/src/tools/utils.js)). See the Standard Tool Execution Pattern above.
|
||||||
- **Environment Variables**: The `session.env` object is critical for AI tools. Pass the `session` object to the `*Direct` function's context, and then to AI client utility functions (like `getAnthropicClientForMCP`) which will extract API keys and other relevant environment settings (e.g., `MODEL`, `MAX_TOKENS`) from `session.env`.
|
- **Environment Variables**: The `session.env` object provides access to environment variables set in the MCP client configuration (e.g., `.cursor/mcp.json`). This is the **primary mechanism** for the unified AI service layer (`ai-services-unified.js`) to securely access **API keys** when called from MCP context.
|
||||||
- **Capabilities**: Can be used to check client capabilities (`session.clientCapabilities`).
|
- **Capabilities**: Can be used to check client capabilities (`session.clientCapabilities`).
|
||||||
|
|
||||||
## Direct Function Wrappers (`*Direct`)
|
## Direct Function Wrappers (`*Direct`)
|
||||||
@@ -438,24 +317,25 @@ These functions, located in `mcp-server/src/core/direct-functions/`, form the co
|
|||||||
|
|
||||||
- **Purpose**: Bridge MCP tools and core Task Master modules (`scripts/modules/*`). Handle AI interactions if applicable.
|
- **Purpose**: Bridge MCP tools and core Task Master modules (`scripts/modules/*`). Handle AI interactions if applicable.
|
||||||
- **Responsibilities**:
|
- **Responsibilities**:
|
||||||
- Receive `args` (including the `projectRoot` determined by the tool), `log` object, and optionally a `context` object (containing **only `{ session }` if needed).
|
- Receive `args` (including `projectRoot`), `log`, and optionally `{ session }` context.
|
||||||
- **Find `tasks.json`**: Use `findTasksJsonPath(args, log)` from [`core/utils/path-utils.js`](mdc:mcp-server/src/core/utils/path-utils.js).
|
- Find `tasks.json` using `findTasksJsonPath`.
|
||||||
- Validate arguments specific to the core logic.
|
- Validate arguments.
|
||||||
- **Handle AI Logic (if applicable)**: Initialize AI clients (using `session` from context), build prompts, make AI calls, parse responses.
|
- **Implement Caching (if applicable)**: Use `getCachedOrExecute`.
|
||||||
- **Implement Caching (if applicable)**: Use `getCachedOrExecute` from [`tools/utils.js`](mdc:mcp-server/src/tools/utils.js) for read operations.
|
- **Call Core Logic**: Invoke function from `scripts/modules/*`.
|
||||||
- **Call Core Logic**: Call the underlying function from the core Task Master modules, passing necessary data (including AI results if applicable).
|
- Pass `outputFormat: 'json'` if applicable.
|
||||||
- ✅ **DO**: Pass `outputFormat: 'json'` (or similar) to the core function if it might produce console output.
|
- Wrap with `enableSilentMode/disableSilentMode` if needed.
|
||||||
- ✅ **DO**: Wrap the core function call with `enableSilentMode/disableSilentMode` if necessary.
|
- Pass `{ mcpLog: logWrapper, session }` context if core logic needs it.
|
||||||
- Handle errors gracefully (AI errors, core logic errors, file errors).
|
- Handle errors.
|
||||||
- Return a standardized result object: `{ success: boolean, data?: any, error?: { code: string, message: string }, fromCache?: boolean }`.
|
- Return standardized result object.
|
||||||
- ❌ **DON'T**: Call `reportProgress`. Use `log.info` for progress indication if needed.
|
- ❌ **DON'T**: Call `reportProgress`.
|
||||||
|
- ❌ **DON'T**: Initialize AI clients or call AI services directly.
|
||||||
|
|
||||||
## Key Principles
|
## Key Principles
|
||||||
|
|
||||||
- **Prefer Direct Function Calls**: MCP tools should always call `*Direct` wrappers instead of `executeTaskMasterCommand`.
|
- **Prefer Direct Function Calls**: MCP tools should always call `*Direct` wrappers instead of `executeTaskMasterCommand`.
|
||||||
- **Standardized Execution Flow**: Follow the pattern: MCP Tool -> `getProjectRootFromSession` -> `*Direct` Function -> Core Logic / AI Logic.
|
- **Standardized Execution Flow**: Follow the pattern: MCP Tool -> `getProjectRootFromSession` -> `*Direct` Function -> Core Logic / AI Logic.
|
||||||
- **Path Resolution via Direct Functions**: The `*Direct` function is responsible for finding the exact `tasks.json` path using `findTasksJsonPath`, relying on the `projectRoot` passed in `args`.
|
- **Path Resolution via Direct Functions**: The `*Direct` function is responsible for finding the exact `tasks.json` path using `findTasksJsonPath`, relying on the `projectRoot` passed in `args`.
|
||||||
- **AI Logic in Direct Functions**: For AI-based tools, the `*Direct` function handles AI client initialization, calls, and parsing, using the `session` object passed in its context.
|
- **AI Logic in Core Modules**: AI interactions (prompt building, calling unified service) reside within the core logic functions (`scripts/modules/*`), not direct functions.
|
||||||
- **Silent Mode in Direct Functions**: Wrap *core function* calls (from `scripts/modules`) with `enableSilentMode()` and `disableSilentMode()` if they produce console output not handled by `outputFormat`. Do not wrap AI calls.
|
- **Silent Mode in Direct Functions**: Wrap *core function* calls (from `scripts/modules`) with `enableSilentMode()` and `disableSilentMode()` if they produce console output not handled by `outputFormat`. Do not wrap AI calls.
|
||||||
- **Selective Async Processing**: Use `AsyncOperationManager` in the *MCP Tool layer* for operations involving multiple steps or long waits beyond a single AI call (e.g., file processing + AI call + file writing). Simple AI calls handled entirely within the `*Direct` function (like `addTaskDirect`) may not need it at the tool layer.
|
- **Selective Async Processing**: Use `AsyncOperationManager` in the *MCP Tool layer* for operations involving multiple steps or long waits beyond a single AI call (e.g., file processing + AI call + file writing). Simple AI calls handled entirely within the `*Direct` function (like `addTaskDirect`) may not need it at the tool layer.
|
||||||
- **No `reportProgress` in Direct Functions**: Do not pass or use `reportProgress` within `*Direct` functions. Use `log.info()` for internal progress or report progress from the `AsyncOperationManager` callback in the MCP tool layer.
|
- **No `reportProgress` in Direct Functions**: Do not pass or use `reportProgress` within `*Direct` functions. Use `log.info()` for internal progress or report progress from the `AsyncOperationManager` callback in the MCP tool layer.
|
||||||
@@ -642,3 +522,8 @@ Follow these steps to add MCP support for an existing Task Master command (see [
|
|||||||
// Add more functions as implemented
|
// Add more functions as implemented
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Telemetry Integration
|
||||||
|
|
||||||
|
- Direct functions calling core logic that involves AI should receive and pass through `telemetryData` within their successful `data` payload. See [`telemetry.mdc`](mdc:.cursor/rules/telemetry.mdc) for the standard pattern.
|
||||||
|
- MCP tools use `handleApiResult`, which ensures the `data` object (potentially including `telemetryData`) from the direct function is correctly included in the final response.
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ description: Guidelines for integrating new features into the Task Master CLI
|
|||||||
globs: scripts/modules/*.js
|
globs: scripts/modules/*.js
|
||||||
alwaysApply: false
|
alwaysApply: false
|
||||||
---
|
---
|
||||||
|
|
||||||
# Task Master Feature Integration Guidelines
|
# Task Master Feature Integration Guidelines
|
||||||
|
|
||||||
## Feature Placement Decision Process
|
## Feature Placement Decision Process
|
||||||
@@ -25,11 +24,22 @@ alwaysApply: false
|
|||||||
The standard pattern for adding a feature follows this workflow:
|
The standard pattern for adding a feature follows this workflow:
|
||||||
|
|
||||||
1. **Core Logic**: Implement the business logic in the appropriate module (e.g., [`task-manager.js`](mdc:scripts/modules/task-manager.js)).
|
1. **Core Logic**: Implement the business logic in the appropriate module (e.g., [`task-manager.js`](mdc:scripts/modules/task-manager.js)).
|
||||||
2. **UI Components**: Add any display functions to [`ui.js`](mdc:scripts/modules/ui.js) following [`ui.mdc`](mdc:.cursor/rules/ui.mdc).
|
2. **Context Gathering (If Applicable)**:
|
||||||
3. **Command Integration**: Add the CLI command to [`commands.js`](mdc:scripts/modules/commands.js) following [`commands.mdc`](mdc:.cursor/rules/commands.mdc).
|
- For AI-powered commands that benefit from project context, use the standardized context gathering patterns from [`context_gathering.mdc`](mdc:.cursor/rules/context_gathering.mdc).
|
||||||
4. **Testing**: Write tests for all components of the feature (following [`tests.mdc`](mdc:.cursor/rules/tests.mdc))
|
- Import `ContextGatherer` and `FuzzyTaskSearch` utilities for reusable context extraction.
|
||||||
5. **Configuration**: Update any configuration in [`utils.js`](mdc:scripts/modules/utils.js) if needed, following [`utilities.mdc`](mdc:.cursor/rules/utilities.mdc).
|
- Support multiple context types: tasks, files, custom text, project tree.
|
||||||
6. **Documentation**: Update help text and documentation in [dev_workflow.mdc](mdc:scripts/modules/dev_workflow.mdc)
|
- Implement detailed token breakdown display for transparency.
|
||||||
|
3. **AI Integration (If Applicable)**:
|
||||||
|
- Import necessary service functions (e.g., `generateTextService`, `streamTextService`) from [`ai-services-unified.js`](mdc:scripts/modules/ai-services-unified.js).
|
||||||
|
- Prepare parameters (`role`, `session`, `systemPrompt`, `prompt`).
|
||||||
|
- Call the service function.
|
||||||
|
- Handle the response (direct text or stream object).
|
||||||
|
- **Important**: Prefer `generateTextService` for calls sending large context (like stringified JSON) where incremental display is not needed. See [`ai_services.mdc`](mdc:.cursor/rules/ai_services.mdc) for detailed usage patterns and cautions.
|
||||||
|
4. **UI Components**: Add any display functions to [`ui.js`](mdc:scripts/modules/ui.js) following [`ui.mdc`](mdc:.cursor/rules/ui.mdc). Consider enhanced formatting with syntax highlighting for code blocks.
|
||||||
|
5. **Command Integration**: Add the CLI command to [`commands.js`](mdc:scripts/modules/commands.js) following [`commands.mdc`](mdc:.cursor/rules/commands.mdc).
|
||||||
|
6. **Testing**: Write tests for all components of the feature (following [`tests.mdc`](mdc:.cursor/rules/tests.mdc))
|
||||||
|
7. **Configuration**: Update configuration settings or add new ones in [`config-manager.js`](mdc:scripts/modules/config-manager.js) and ensure getters/setters are appropriate. Update documentation in [`utilities.mdc`](mdc:.cursor/rules/utilities.mdc) and [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc). Update the `.taskmasterconfig` structure if needed.
|
||||||
|
8. **Documentation**: Update help text and documentation in [`dev_workflow.mdc`](mdc:.cursor/rules/dev_workflow.mdc) and [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc).
|
||||||
|
|
||||||
## Critical Checklist for New Features
|
## Critical Checklist for New Features
|
||||||
|
|
||||||
@@ -190,6 +200,8 @@ The standard pattern for adding a feature follows this workflow:
|
|||||||
- ✅ **DO**: If an MCP tool fails with vague errors (e.g., JSON parsing issues like `Unexpected token ... is not valid JSON`), **try running the equivalent CLI command directly in the terminal** (e.g., `task-master expand --all`). CLI output often provides much more specific error messages (like missing function definitions or stack traces from the core logic) that pinpoint the root cause.
|
- ✅ **DO**: If an MCP tool fails with vague errors (e.g., JSON parsing issues like `Unexpected token ... is not valid JSON`), **try running the equivalent CLI command directly in the terminal** (e.g., `task-master expand --all`). CLI output often provides much more specific error messages (like missing function definitions or stack traces from the core logic) that pinpoint the root cause.
|
||||||
- ❌ **DON'T**: Rely solely on MCP logs if the error is unclear; use the CLI as a complementary debugging tool for core logic issues.
|
- ❌ **DON'T**: Rely solely on MCP logs if the error is unclear; use the CLI as a complementary debugging tool for core logic issues.
|
||||||
|
|
||||||
|
- **Telemetry Integration**: Ensure AI calls correctly handle and propagate `telemetryData` as described in [`telemetry.mdc`](mdc:.cursor/rules/telemetry.mdc).
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// 1. CORE LOGIC: Add function to appropriate module (example in task-manager.js)
|
// 1. CORE LOGIC: Add function to appropriate module (example in task-manager.js)
|
||||||
/**
|
/**
|
||||||
@@ -211,7 +223,29 @@ export {
|
|||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// 2. UI COMPONENTS: Add display function to ui.js
|
// 2. AI Integration: Add import and use necessary service functions
|
||||||
|
import { generateTextService } from './ai-services-unified.js';
|
||||||
|
|
||||||
|
// Example usage:
|
||||||
|
async function handleAIInteraction() {
|
||||||
|
const role = 'user';
|
||||||
|
const session = 'exampleSession';
|
||||||
|
const systemPrompt = 'You are a helpful assistant.';
|
||||||
|
const prompt = 'What is the capital of France?';
|
||||||
|
|
||||||
|
const result = await generateTextService(role, session, systemPrompt, prompt);
|
||||||
|
console.log(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Export from the module
|
||||||
|
export {
|
||||||
|
// ... existing exports ...
|
||||||
|
handleAIInteraction,
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// 3. UI COMPONENTS: Add display function to ui.js
|
||||||
/**
|
/**
|
||||||
* Display archive operation results
|
* Display archive operation results
|
||||||
* @param {string} archivePath - Path to the archive file
|
* @param {string} archivePath - Path to the archive file
|
||||||
@@ -232,7 +266,7 @@ export {
|
|||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// 3. COMMAND INTEGRATION: Add to commands.js
|
// 4. COMMAND INTEGRATION: Add to commands.js
|
||||||
import { archiveTasks } from './task-manager.js';
|
import { archiveTasks } from './task-manager.js';
|
||||||
import { displayArchiveResults } from './ui.js';
|
import { displayArchiveResults } from './ui.js';
|
||||||
|
|
||||||
@@ -452,7 +486,7 @@ npm test
|
|||||||
For each new feature:
|
For each new feature:
|
||||||
|
|
||||||
1. Add help text to the command definition
|
1. Add help text to the command definition
|
||||||
2. Update [`dev_workflow.mdc`](mdc:scripts/modules/dev_workflow.mdc) with command reference
|
2. Update [`dev_workflow.mdc`](mdc:.cursor/rules/dev_workflow.mdc) with command reference
|
||||||
3. Consider updating [`architecture.mdc`](mdc:.cursor/rules/architecture.mdc) if the feature significantly changes module responsibilities.
|
3. Consider updating [`architecture.mdc`](mdc:.cursor/rules/architecture.mdc) if the feature significantly changes module responsibilities.
|
||||||
|
|
||||||
Follow the existing command reference format:
|
Follow the existing command reference format:
|
||||||
@@ -495,14 +529,24 @@ Integrating Task Master commands with the MCP server (for use by tools like Curs
|
|||||||
|
|
||||||
4. **Create MCP Tool (`mcp-server/src/tools/`)**:
|
4. **Create MCP Tool (`mcp-server/src/tools/`)**:
|
||||||
- Create a new file (e.g., `your-command.js`) using **kebab-case**.
|
- Create a new file (e.g., `your-command.js`) using **kebab-case**.
|
||||||
- Import `zod`, `handleApiResult`, `createErrorResponse`, **`getProjectRootFromSession`**, and your `yourCommandDirect` function.
|
- Import `zod`, `handleApiResult`, **`withNormalizedProjectRoot` HOF**, and your `yourCommandDirect` function.
|
||||||
- Implement `registerYourCommandTool(server)`.
|
- Implement `registerYourCommandTool(server)`.
|
||||||
- Define the tool `name` using **snake_case** (e.g., `your_command`).
|
- **Define parameters**: Make `projectRoot` optional (`z.string().optional().describe(...)`) as the HOF handles fallback.
|
||||||
- Define the `parameters` using `zod`. **Crucially, define `projectRoot` as optional**: `projectRoot: z.string().optional().describe(...)`. Include `file` if applicable.
|
- Consider if this operation should run in the background using `AsyncOperationManager`.
|
||||||
- Implement the standard `async execute(args, { log, reportProgress, session })` method:
|
- Implement the standard `execute` method **wrapped with `withNormalizedProjectRoot`**:
|
||||||
- Get `rootFolder` using `getProjectRootFromSession` (with fallback to `args.projectRoot`).
|
```javascript
|
||||||
- Call `yourCommandDirect({ ...args, projectRoot: rootFolder }, log)`.
|
execute: withNormalizedProjectRoot(async (args, { log, session }) => {
|
||||||
- Pass the result to `handleApiResult(result, log, 'Error Message')`.
|
// args.projectRoot is now normalized
|
||||||
|
const { projectRoot /*, other args */ } = args;
|
||||||
|
// ... resolve tasks path if needed using normalized projectRoot ...
|
||||||
|
const result = await yourCommandDirect(
|
||||||
|
{ /* other args */, projectRoot /* if needed by direct func */ },
|
||||||
|
log,
|
||||||
|
{ session }
|
||||||
|
);
|
||||||
|
return handleApiResult(result, log);
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
5. **Register Tool**: Import and call `registerYourCommandTool` in `mcp-server/src/tools/index.js`.
|
5. **Register Tool**: Import and call `registerYourCommandTool` in `mcp-server/src/tools/index.js`.
|
||||||
|
|
||||||
@@ -590,3 +634,287 @@ When implementing project initialization commands:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Feature Planning
|
||||||
|
|
||||||
|
- **Core Logic First**:
|
||||||
|
- ✅ DO: Implement core logic in `scripts/modules/` before CLI or MCP interfaces
|
||||||
|
- ✅ DO: Consider tagged task lists system compatibility from the start
|
||||||
|
- ✅ DO: Design functions to work with both legacy and tagged data formats
|
||||||
|
- ✅ DO: Use tag resolution functions (`getTasksForTag`, `setTasksForTag`) for task data access
|
||||||
|
- ❌ DON'T: Directly manipulate tagged data structure in new features
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Design tagged-aware core functions
|
||||||
|
async function newFeatureCore(tasksPath, featureParams, options = {}) {
|
||||||
|
const tasksData = readJSON(tasksPath);
|
||||||
|
const currentTag = getCurrentTag() || 'master';
|
||||||
|
const tasks = getTasksForTag(tasksData, currentTag);
|
||||||
|
|
||||||
|
// Perform feature logic on tasks array
|
||||||
|
const result = performFeatureLogic(tasks, featureParams);
|
||||||
|
|
||||||
|
// Save back using tag resolution
|
||||||
|
setTasksForTag(tasksData, currentTag, tasks);
|
||||||
|
writeJSON(tasksPath, tasksData);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Backward Compatibility**:
|
||||||
|
- ✅ DO: Ensure new features work with existing projects seamlessly
|
||||||
|
- ✅ DO: Test with both legacy and tagged task data formats
|
||||||
|
- ✅ DO: Support silent migration during feature usage
|
||||||
|
- ❌ DON'T: Break existing workflows when adding tagged system features
|
||||||
|
|
||||||
|
## CLI Command Implementation
|
||||||
|
|
||||||
|
- **Command Structure**:
|
||||||
|
- ✅ DO: Follow the established pattern in [`commands.js`](mdc:scripts/modules/commands.js)
|
||||||
|
- ✅ DO: Use Commander.js for argument parsing
|
||||||
|
- ✅ DO: Include comprehensive help text and examples
|
||||||
|
- ✅ DO: Support tagged task context awareness
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Implement CLI commands with tagged system awareness
|
||||||
|
program
|
||||||
|
.command('new-feature')
|
||||||
|
.description('Description of the new feature with tagged task lists support')
|
||||||
|
.option('-t, --tag <tag>', 'Specify tag context (defaults to current tag)')
|
||||||
|
.option('-p, --param <value>', 'Feature-specific parameter')
|
||||||
|
.option('--force', 'Force operation without confirmation')
|
||||||
|
.action(async (options) => {
|
||||||
|
try {
|
||||||
|
const projectRoot = findProjectRoot();
|
||||||
|
if (!projectRoot) {
|
||||||
|
console.error('Not in a Task Master project directory');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use specified tag or current tag
|
||||||
|
const targetTag = options.tag || getCurrentTag() || 'master';
|
||||||
|
|
||||||
|
const result = await newFeatureCore(
|
||||||
|
path.join(projectRoot, '.taskmaster', 'tasks', 'tasks.json'),
|
||||||
|
{ param: options.param },
|
||||||
|
{
|
||||||
|
force: options.force,
|
||||||
|
targetTag: targetTag,
|
||||||
|
outputFormat: 'text'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log('Feature executed successfully');
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error: ${error.message}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Error Handling**:
|
||||||
|
- ✅ DO: Provide clear error messages for common failures
|
||||||
|
- ✅ DO: Handle tagged system migration errors gracefully
|
||||||
|
- ✅ DO: Include suggestion for resolution when possible
|
||||||
|
- ✅ DO: Exit with appropriate codes for scripting
|
||||||
|
|
||||||
|
## MCP Tool Implementation
|
||||||
|
|
||||||
|
- **Direct Function Pattern**:
|
||||||
|
- ✅ DO: Create direct function wrappers in `mcp-server/src/core/direct-functions/`
|
||||||
|
- ✅ DO: Follow silent mode patterns to prevent console output interference
|
||||||
|
- ✅ DO: Use `findTasksJsonPath` for consistent path resolution
|
||||||
|
- ✅ DO: Ensure tagged system compatibility
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Implement MCP direct functions with tagged awareness
|
||||||
|
export async function newFeatureDirect(args, log, context = {}) {
|
||||||
|
try {
|
||||||
|
const tasksPath = findTasksJsonPath(args, log);
|
||||||
|
|
||||||
|
// Enable silent mode for clean MCP responses
|
||||||
|
enableSilentMode();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await newFeatureCore(
|
||||||
|
tasksPath,
|
||||||
|
{ param: args.param },
|
||||||
|
{
|
||||||
|
force: args.force,
|
||||||
|
targetTag: args.tag || 'master', // Support tag specification
|
||||||
|
mcpLog: log,
|
||||||
|
session: context.session,
|
||||||
|
outputFormat: 'json'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
data: result,
|
||||||
|
fromCache: false
|
||||||
|
};
|
||||||
|
} finally {
|
||||||
|
disableSilentMode();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
log.error(`Error in newFeatureDirect: ${error.message}`);
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
error: { code: 'FEATURE_ERROR', message: error.message },
|
||||||
|
fromCache: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Tool Registration**:
|
||||||
|
- ✅ DO: Create tool definitions in `mcp-server/src/tools/`
|
||||||
|
- ✅ DO: Use Zod for parameter validation
|
||||||
|
- ✅ DO: Include optional tag parameter for multi-context support
|
||||||
|
- ✅ DO: Follow established naming conventions
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Register MCP tools with tagged system support
|
||||||
|
export function registerNewFeatureTool(server) {
|
||||||
|
server.addTool({
|
||||||
|
name: "new_feature",
|
||||||
|
description: "Description of the new feature with tagged task lists support",
|
||||||
|
inputSchema: z.object({
|
||||||
|
param: z.string().describe("Feature-specific parameter"),
|
||||||
|
tag: z.string().optional().describe("Target tag context (defaults to current tag)"),
|
||||||
|
force: z.boolean().optional().describe("Force operation without confirmation"),
|
||||||
|
projectRoot: z.string().optional().describe("Project root directory")
|
||||||
|
}),
|
||||||
|
execute: withNormalizedProjectRoot(async (args, { log, session }) => {
|
||||||
|
try {
|
||||||
|
const result = await newFeatureDirect(
|
||||||
|
{ ...args, projectRoot: args.projectRoot },
|
||||||
|
log,
|
||||||
|
{ session }
|
||||||
|
);
|
||||||
|
return handleApiResult(result, log);
|
||||||
|
} catch (error) {
|
||||||
|
return handleApiResult({
|
||||||
|
success: false,
|
||||||
|
error: { code: 'EXECUTION_ERROR', message: error.message }
|
||||||
|
}, log);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Testing Strategy
|
||||||
|
|
||||||
|
- **Unit Tests**:
|
||||||
|
- ✅ DO: Test core logic independently with both data formats
|
||||||
|
- ✅ DO: Mock file system operations appropriately
|
||||||
|
- ✅ DO: Test tag resolution behavior
|
||||||
|
- ✅ DO: Verify migration compatibility
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Test new features with tagged system awareness
|
||||||
|
describe('newFeature', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should work with legacy task format', async () => {
|
||||||
|
const legacyData = { tasks: [/* test data */] };
|
||||||
|
fs.readFileSync.mockReturnValue(JSON.stringify(legacyData));
|
||||||
|
|
||||||
|
const result = await newFeatureCore('/test/tasks.json', { param: 'test' });
|
||||||
|
|
||||||
|
expect(result).toBeDefined();
|
||||||
|
// Test legacy format handling
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should work with tagged task format', async () => {
|
||||||
|
const taggedData = {
|
||||||
|
master: { tasks: [/* test data */] },
|
||||||
|
feature: { tasks: [/* test data */] }
|
||||||
|
};
|
||||||
|
fs.readFileSync.mockReturnValue(JSON.stringify(taggedData));
|
||||||
|
|
||||||
|
const result = await newFeatureCore('/test/tasks.json', { param: 'test' });
|
||||||
|
|
||||||
|
expect(result).toBeDefined();
|
||||||
|
// Test tagged format handling
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle tag migration during feature usage', async () => {
|
||||||
|
const legacyData = { tasks: [/* test data */] };
|
||||||
|
fs.readFileSync.mockReturnValue(JSON.stringify(legacyData));
|
||||||
|
|
||||||
|
await newFeatureCore('/test/tasks.json', { param: 'test' });
|
||||||
|
|
||||||
|
// Verify migration occurred
|
||||||
|
expect(fs.writeFileSync).toHaveBeenCalledWith(
|
||||||
|
'/test/tasks.json',
|
||||||
|
expect.stringContaining('"master"')
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Integration Tests**:
|
||||||
|
- ✅ DO: Test CLI and MCP interfaces with real task data
|
||||||
|
- ✅ DO: Verify end-to-end workflows across tag contexts
|
||||||
|
- ✅ DO: Test error scenarios and recovery
|
||||||
|
|
||||||
|
## Documentation Updates
|
||||||
|
|
||||||
|
- **Rule Updates**:
|
||||||
|
- ✅ DO: Update relevant `.cursor/rules/*.mdc` files
|
||||||
|
- ✅ DO: Include tagged system considerations in architecture docs
|
||||||
|
- ✅ DO: Add examples showing multi-context usage
|
||||||
|
- ✅ DO: Update workflow documentation as needed
|
||||||
|
|
||||||
|
- **User Documentation**:
|
||||||
|
- ✅ DO: Add feature documentation to `/docs` folder
|
||||||
|
- ✅ DO: Include tagged system usage examples
|
||||||
|
- ✅ DO: Update command reference documentation
|
||||||
|
- ✅ DO: Provide migration notes if relevant
|
||||||
|
|
||||||
|
## Migration Considerations
|
||||||
|
|
||||||
|
- **Silent Migration Support**:
|
||||||
|
- ✅ DO: Ensure new features trigger migration when needed
|
||||||
|
- ✅ DO: Handle migration errors gracefully in feature code
|
||||||
|
- ✅ DO: Test feature behavior with pre-migration projects
|
||||||
|
- ❌ DON'T: Assume projects are already migrated
|
||||||
|
|
||||||
|
- **Tag Context Handling**:
|
||||||
|
- ✅ DO: Default to current tag when not specified
|
||||||
|
- ✅ DO: Support explicit tag selection in advanced features
|
||||||
|
- ✅ DO: Validate tag existence before operations
|
||||||
|
- ✅ DO: Provide clear messaging about tag context
|
||||||
|
|
||||||
|
## Performance Considerations
|
||||||
|
|
||||||
|
- **Efficient Tag Operations**:
|
||||||
|
- ✅ DO: Minimize file I/O operations per feature execution
|
||||||
|
- ✅ DO: Cache tag resolution results when appropriate
|
||||||
|
- ✅ DO: Use streaming for large task datasets
|
||||||
|
- ❌ DON'T: Load all tags when only one is needed
|
||||||
|
|
||||||
|
- **Memory Management**:
|
||||||
|
- ✅ DO: Process large task lists efficiently
|
||||||
|
- ✅ DO: Clean up temporary data structures
|
||||||
|
- ✅ DO: Avoid keeping all tag data in memory simultaneously
|
||||||
|
|
||||||
|
## Deployment and Versioning
|
||||||
|
|
||||||
|
- **Changesets**:
|
||||||
|
- ✅ DO: Create appropriate changesets for new features
|
||||||
|
- ✅ DO: Use semantic versioning (minor for new features)
|
||||||
|
- ✅ DO: Include tagged system information in release notes
|
||||||
|
- ✅ DO: Document breaking changes if any
|
||||||
|
|
||||||
|
- **Feature Flags**:
|
||||||
|
- ✅ DO: Consider feature flags for experimental functionality
|
||||||
|
- ✅ DO: Ensure tagged system features work with flags
|
||||||
|
- ✅ DO: Provide clear documentation about flag usage
|
||||||
|
|
||||||
|
By following these guidelines, new features will integrate smoothly with the Task Master ecosystem while supporting the enhanced tagged task lists system for multi-context development workflows.
|
||||||
|
|||||||
@@ -69,5 +69,4 @@ alwaysApply: true
|
|||||||
- Update references to external docs
|
- Update references to external docs
|
||||||
- Maintain links between related rules
|
- Maintain links between related rules
|
||||||
- Document breaking changes
|
- Document breaking changes
|
||||||
|
|
||||||
Follow [cursor_rules.mdc](mdc:.cursor/rules/cursor_rules.mdc) for proper rule formatting and structure.
|
Follow [cursor_rules.mdc](mdc:.cursor/rules/cursor_rules.mdc) for proper rule formatting and structure.
|
||||||
229
.cursor/rules/tags.mdc
Normal file
229
.cursor/rules/tags.mdc
Normal file
@@ -0,0 +1,229 @@
|
|||||||
|
---
|
||||||
|
description:
|
||||||
|
globs: scripts/modules/*
|
||||||
|
alwaysApply: false
|
||||||
|
---
|
||||||
|
# Tagged Task Lists Command Patterns
|
||||||
|
|
||||||
|
This document outlines the standardized patterns that **ALL** Task Master commands must follow to properly support the tagged task lists system.
|
||||||
|
|
||||||
|
## Core Principles
|
||||||
|
|
||||||
|
- **Every command** that reads or writes tasks.json must be tag-aware
|
||||||
|
- **Consistent tag resolution** across all commands using `getCurrentTag(projectRoot)`
|
||||||
|
- **Proper context passing** to core functions with `{ projectRoot, tag }`
|
||||||
|
- **Standardized CLI options** with `--tag <tag>` flag
|
||||||
|
|
||||||
|
## Required Imports
|
||||||
|
|
||||||
|
All command files must import `getCurrentTag`:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Import getCurrentTag in commands.js
|
||||||
|
import {
|
||||||
|
log,
|
||||||
|
readJSON,
|
||||||
|
writeJSON,
|
||||||
|
findProjectRoot,
|
||||||
|
getCurrentTag
|
||||||
|
} from './utils.js';
|
||||||
|
|
||||||
|
// ✅ DO: Import getCurrentTag in task-manager files
|
||||||
|
import {
|
||||||
|
readJSON,
|
||||||
|
writeJSON,
|
||||||
|
getCurrentTag
|
||||||
|
} from '../utils.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
## CLI Command Pattern
|
||||||
|
|
||||||
|
Every CLI command that operates on tasks must follow this exact pattern:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Standard tag-aware CLI command pattern
|
||||||
|
programInstance
|
||||||
|
.command('command-name')
|
||||||
|
.description('Command description')
|
||||||
|
.option('-f, --file <file>', 'Path to the tasks file', TASKMASTER_TASKS_FILE)
|
||||||
|
.option('--tag <tag>', 'Specify tag context for task operations') // REQUIRED
|
||||||
|
.action(async (options) => {
|
||||||
|
// 1. Find project root
|
||||||
|
const projectRoot = findProjectRoot();
|
||||||
|
if (!projectRoot) {
|
||||||
|
console.error(chalk.red('Error: Could not find project root.'));
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Resolve tag using standard pattern
|
||||||
|
const tag = options.tag || getCurrentTag(projectRoot) || 'master';
|
||||||
|
|
||||||
|
// 3. Call core function with proper context
|
||||||
|
await coreFunction(
|
||||||
|
tasksPath,
|
||||||
|
// ... other parameters ...
|
||||||
|
{ projectRoot, tag } // REQUIRED context object
|
||||||
|
);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## Core Function Pattern
|
||||||
|
|
||||||
|
All core functions in `scripts/modules/task-manager/` must follow this pattern:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Standard tag-aware core function pattern
|
||||||
|
async function coreFunction(
|
||||||
|
tasksPath,
|
||||||
|
// ... other parameters ...
|
||||||
|
context = {} // REQUIRED context parameter
|
||||||
|
) {
|
||||||
|
const { projectRoot, tag } = context;
|
||||||
|
|
||||||
|
// Use tag-aware readJSON/writeJSON
|
||||||
|
const data = readJSON(tasksPath, projectRoot, tag);
|
||||||
|
|
||||||
|
// ... function logic ...
|
||||||
|
|
||||||
|
writeJSON(tasksPath, data, projectRoot, tag);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tag Resolution Priority
|
||||||
|
|
||||||
|
The tag resolution follows this exact priority order:
|
||||||
|
|
||||||
|
1. **Explicit `--tag` flag**: `options.tag`
|
||||||
|
2. **Current active tag**: `getCurrentTag(projectRoot)`
|
||||||
|
3. **Default fallback**: `'master'`
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Standard tag resolution pattern
|
||||||
|
const tag = options.tag || getCurrentTag(projectRoot) || 'master';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Commands Requiring Updates
|
||||||
|
|
||||||
|
### High Priority (Core Task Operations)
|
||||||
|
- [x] `add-task` - ✅ Fixed
|
||||||
|
- [x] `list` - ✅ Fixed
|
||||||
|
- [x] `update-task` - ✅ Fixed
|
||||||
|
- [x] `update-subtask` - ✅ Fixed
|
||||||
|
- [x] `set-status` - ✅ Already correct
|
||||||
|
- [x] `remove-task` - ✅ Already correct
|
||||||
|
- [x] `remove-subtask` - ✅ Fixed
|
||||||
|
- [x] `add-subtask` - ✅ Already correct
|
||||||
|
- [x] `clear-subtasks` - ✅ Fixed
|
||||||
|
- [x] `move-task` - ✅ Already correct
|
||||||
|
|
||||||
|
### Medium Priority (Analysis & Expansion)
|
||||||
|
- [x] `expand` - ✅ Fixed
|
||||||
|
- [ ] `next` - ✅ Fixed
|
||||||
|
- [ ] `show` (get-task) - Needs checking
|
||||||
|
- [ ] `analyze-complexity` - Needs checking
|
||||||
|
- [ ] `generate` - ✅ Fixed
|
||||||
|
|
||||||
|
### Lower Priority (Utilities)
|
||||||
|
- [ ] `research` - Needs checking
|
||||||
|
- [ ] `complexity-report` - Needs checking
|
||||||
|
- [ ] `validate-dependencies` - ✅ Fixed
|
||||||
|
- [ ] `fix-dependencies` - ✅ Fixed
|
||||||
|
- [ ] `add-dependency` - ✅ Fixed
|
||||||
|
- [ ] `remove-dependency` - ✅ Fixed
|
||||||
|
|
||||||
|
## MCP Integration Pattern
|
||||||
|
|
||||||
|
MCP direct functions must also follow the tag-aware pattern:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Tag-aware MCP direct function
|
||||||
|
export async function coreActionDirect(args, log, context = {}) {
|
||||||
|
const { session } = context;
|
||||||
|
const { projectRoot, tag } = args; // MCP passes these in args
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await coreAction(
|
||||||
|
tasksPath,
|
||||||
|
// ... other parameters ...
|
||||||
|
{ projectRoot, tag, session, mcpLog: logWrapper }
|
||||||
|
);
|
||||||
|
|
||||||
|
return { success: true, data: result };
|
||||||
|
} catch (error) {
|
||||||
|
return { success: false, error: { code: 'ERROR_CODE', message: error.message } };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## File Generation Tag-Aware Naming
|
||||||
|
|
||||||
|
The `generate` command must use tag-aware file naming:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Tag-aware file naming
|
||||||
|
const taskFileName = targetTag === 'master'
|
||||||
|
? `task_${task.id.toString().padStart(3, '0')}.txt`
|
||||||
|
: `task_${task.id.toString().padStart(3, '0')}_${targetTag}.txt`;
|
||||||
|
```
|
||||||
|
|
||||||
|
**Examples:**
|
||||||
|
- Master tag: `task_001.txt`, `task_002.txt`
|
||||||
|
- Other tags: `task_001_feature.txt`, `task_002_feature.txt`
|
||||||
|
|
||||||
|
## Common Anti-Patterns
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ❌ DON'T: Missing getCurrentTag import
|
||||||
|
import { readJSON, writeJSON } from '../utils.js'; // Missing getCurrentTag
|
||||||
|
|
||||||
|
// ❌ DON'T: Hard-coded tag resolution
|
||||||
|
const tag = options.tag || 'master'; // Missing getCurrentTag
|
||||||
|
|
||||||
|
// ❌ DON'T: Missing --tag option
|
||||||
|
.option('-f, --file <file>', 'Path to tasks file') // Missing --tag option
|
||||||
|
|
||||||
|
// ❌ DON'T: Missing context parameter
|
||||||
|
await coreFunction(tasksPath, param1, param2); // Missing { projectRoot, tag }
|
||||||
|
|
||||||
|
// ❌ DON'T: Incorrect readJSON/writeJSON calls
|
||||||
|
const data = readJSON(tasksPath); // Missing projectRoot and tag
|
||||||
|
writeJSON(tasksPath, data); // Missing projectRoot and tag
|
||||||
|
```
|
||||||
|
|
||||||
|
## Validation Checklist
|
||||||
|
|
||||||
|
For each command, verify:
|
||||||
|
|
||||||
|
- [ ] Imports `getCurrentTag` from utils.js
|
||||||
|
- [ ] Has `--tag <tag>` CLI option
|
||||||
|
- [ ] Uses standard tag resolution: `options.tag || getCurrentTag(projectRoot) || 'master'`
|
||||||
|
- [ ] Finds `projectRoot` with error handling
|
||||||
|
- [ ] Passes `{ projectRoot, tag }` context to core functions
|
||||||
|
- [ ] Core functions accept and use context parameter
|
||||||
|
- [ ] Uses `readJSON(tasksPath, projectRoot, tag)` and `writeJSON(tasksPath, data, projectRoot, tag)`
|
||||||
|
|
||||||
|
## Testing Tag Resolution
|
||||||
|
|
||||||
|
Test each command with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Test with explicit tag
|
||||||
|
node bin/task-master command-name --tag test-tag
|
||||||
|
|
||||||
|
# Test with active tag (should use current active tag)
|
||||||
|
node bin/task-master use-tag test-tag
|
||||||
|
node bin/task-master command-name
|
||||||
|
|
||||||
|
# Test with master tag (default)
|
||||||
|
node bin/task-master use-tag master
|
||||||
|
node bin/task-master command-name
|
||||||
|
```
|
||||||
|
|
||||||
|
## Migration Strategy
|
||||||
|
|
||||||
|
1. **Audit Phase**: Systematically check each command against the checklist
|
||||||
|
2. **Fix Phase**: Apply the standard patterns to non-compliant commands
|
||||||
|
3. **Test Phase**: Verify tag resolution works correctly
|
||||||
|
4. **Document Phase**: Update command documentation with tag support
|
||||||
|
|
||||||
|
This ensures consistent, predictable behavior across all Task Master commands and prevents tag deletion bugs.
|
||||||
@@ -3,14 +3,15 @@ description: Comprehensive reference for Taskmaster MCP tools and CLI commands.
|
|||||||
globs: **/*
|
globs: **/*
|
||||||
alwaysApply: true
|
alwaysApply: true
|
||||||
---
|
---
|
||||||
|
|
||||||
# Taskmaster Tool & Command Reference
|
# Taskmaster Tool & Command Reference
|
||||||
|
|
||||||
This document provides a detailed reference for interacting with Taskmaster, covering both the recommended MCP tools (for integrations like Cursor) and the corresponding `task-master` CLI commands (for direct user interaction or fallback).
|
This document provides a detailed reference for interacting with Taskmaster, covering both the recommended MCP tools, suitable for integrations like Cursor, and the corresponding `task-master` CLI commands, designed for direct user interaction or fallback.
|
||||||
|
|
||||||
**Note:** For interacting with Taskmaster programmatically or via integrated tools, using the **MCP tools is strongly recommended** due to better performance, structured data, and error handling. The CLI commands serve as a user-friendly alternative and fallback. See [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc) for MCP implementation details and [`commands.mdc`](mdc:.cursor/rules/commands.mdc) for CLI implementation guidelines.
|
**Note:** For interacting with Taskmaster programmatically or via integrated tools, using the **MCP tools is strongly recommended** due to better performance, structured data, and error handling. The CLI commands serve as a user-friendly alternative and fallback.
|
||||||
|
|
||||||
**Important:** Several MCP tools involve AI processing and are long-running operations that may take up to a minute to complete. When using these tools, always inform users that the operation is in progress and to wait patiently for results. The AI-powered tools include: `parse_prd`, `analyze_project_complexity`, `update_subtask`, `update_task`, `update`, `expand_all`, `expand_task`, and `add_task`.
|
**Important:** Several MCP tools involve AI processing... The AI-powered tools include `parse_prd`, `analyze_project_complexity`, `update_subtask`, `update_task`, `update`, `expand_all`, `expand_task`, and `add_task`.
|
||||||
|
|
||||||
|
**🏷️ Tagged Task Lists System:** Task Master now supports **tagged task lists** for multi-context task management. This allows you to maintain separate, isolated lists of tasks for different features, branches, or experiments. Existing projects are seamlessly migrated to use a default "master" tag. Most commands now support a `--tag <name>` flag to specify which context to operate on. If omitted, commands use the currently active tag.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -24,34 +25,65 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **Key CLI Options:**
|
* **Key CLI Options:**
|
||||||
* `--name <name>`: `Set the name for your project in Taskmaster's configuration.`
|
* `--name <name>`: `Set the name for your project in Taskmaster's configuration.`
|
||||||
* `--description <text>`: `Provide a brief description for your project.`
|
* `--description <text>`: `Provide a brief description for your project.`
|
||||||
* `--version <version>`: `Set the initial version for your project (e.g., '0.1.0').`
|
* `--version <version>`: `Set the initial version for your project, e.g., '0.1.0'.`
|
||||||
* `-y, --yes`: `Initialize Taskmaster quickly using default settings without interactive prompts.`
|
* `-y, --yes`: `Initialize Taskmaster quickly using default settings without interactive prompts.`
|
||||||
* **Usage:** Run this once at the beginning of a new project.
|
* **Usage:** Run this once at the beginning of a new project.
|
||||||
* **MCP Variant Description:** `Set up the basic Taskmaster file structure and configuration in the current directory for a new project by running the 'task-master init' command.`
|
* **MCP Variant Description:** `Set up the basic Taskmaster file structure and configuration in the current directory for a new project by running the 'task-master init' command.`
|
||||||
* **Key MCP Parameters/Options:**
|
* **Key MCP Parameters/Options:**
|
||||||
* `projectName`: `Set the name for your project.` (CLI: `--name <name>`)
|
* `projectName`: `Set the name for your project.` (CLI: `--name <name>`)
|
||||||
* `projectDescription`: `Provide a brief description for your project.` (CLI: `--description <text>`)
|
* `projectDescription`: `Provide a brief description for your project.` (CLI: `--description <text>`)
|
||||||
* `projectVersion`: `Set the initial version for your project (e.g., '0.1.0').` (CLI: `--version <version>`)
|
* `projectVersion`: `Set the initial version for your project, e.g., '0.1.0'.` (CLI: `--version <version>`)
|
||||||
* `authorName`: `Author name.` (CLI: `--author <author>`)
|
* `authorName`: `Author name.` (CLI: `--author <author>`)
|
||||||
* `skipInstall`: `Skip installing dependencies (default: false).` (CLI: `--skip-install`)
|
* `skipInstall`: `Skip installing dependencies. Default is false.` (CLI: `--skip-install`)
|
||||||
* `addAliases`: `Add shell aliases (tm, taskmaster) (default: false).` (CLI: `--aliases`)
|
* `addAliases`: `Add shell aliases tm and taskmaster. Default is false.` (CLI: `--aliases`)
|
||||||
* `yes`: `Skip prompts and use defaults/provided arguments (default: false).` (CLI: `-y, --yes`)
|
* `yes`: `Skip prompts and use defaults/provided arguments. Default is false.` (CLI: `-y, --yes`)
|
||||||
* **Usage:** Run this once at the beginning of a new project, typically via an integrated tool like Cursor. Operates on the current working directory of the MCP server.
|
* **Usage:** Run this once at the beginning of a new project, typically via an integrated tool like Cursor. Operates on the current working directory of the MCP server.
|
||||||
|
* **Important:** Once complete, you *MUST* parse a prd in order to generate tasks. There will be no tasks files until then. The next step after initializing should be to create a PRD using the example PRD in .taskmaster/templates/example_prd.txt.
|
||||||
|
* **Tagging:** Use the `--tag` option to parse the PRD into a specific, non-default tag context. If the tag doesn't exist, it will be created automatically. Example: `task-master parse-prd spec.txt --tag=new-feature`.
|
||||||
|
|
||||||
### 2. Parse PRD (`parse_prd`)
|
### 2. Parse PRD (`parse_prd`)
|
||||||
|
|
||||||
* **MCP Tool:** `parse_prd`
|
* **MCP Tool:** `parse_prd`
|
||||||
* **CLI Command:** `task-master parse-prd [file] [options]`
|
* **CLI Command:** `task-master parse-prd [file] [options]`
|
||||||
* **Description:** `Parse a Product Requirements Document (PRD) or text file with Taskmaster to automatically generate an initial set of tasks in tasks.json.`
|
* **Description:** `Parse a Product Requirements Document, PRD, or text file with Taskmaster to automatically generate an initial set of tasks in tasks.json.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `input`: `Path to your PRD or requirements text file that Taskmaster should parse for tasks.` (CLI: `[file]` positional or `-i, --input <file>`)
|
* `input`: `Path to your PRD or requirements text file that Taskmaster should parse for tasks.` (CLI: `[file]` positional or `-i, --input <file>`)
|
||||||
* `output`: `Specify where Taskmaster should save the generated 'tasks.json' file (default: 'tasks/tasks.json').` (CLI: `-o, --output <file>`)
|
* `output`: `Specify where Taskmaster should save the generated 'tasks.json' file. Defaults to '.taskmaster/tasks/tasks.json'.` (CLI: `-o, --output <file>`)
|
||||||
* `numTasks`: `Approximate number of top-level tasks Taskmaster should aim to generate from the document.` (CLI: `-n, --num-tasks <number>`)
|
* `numTasks`: `Approximate number of top-level tasks Taskmaster should aim to generate from the document.` (CLI: `-n, --num-tasks <number>`)
|
||||||
* `force`: `Use this to allow Taskmaster to overwrite an existing 'tasks.json' without asking for confirmation.` (CLI: `-f, --force`)
|
* `force`: `Use this to allow Taskmaster to overwrite an existing 'tasks.json' without asking for confirmation.` (CLI: `-f, --force`)
|
||||||
* **Usage:** Useful for bootstrapping a project from an existing requirements document.
|
* **Usage:** Useful for bootstrapping a project from an existing requirements document.
|
||||||
* **Notes:** Task Master will strictly adhere to any specific requirements mentioned in the PRD (libraries, database schemas, frameworks, tech stacks, etc.) while filling in any gaps where the PRD isn't fully specified. Tasks are designed to provide the most direct implementation path while avoiding over-engineering.
|
* **Notes:** Task Master will strictly adhere to any specific requirements mentioned in the PRD, such as libraries, database schemas, frameworks, tech stacks, etc., while filling in any gaps where the PRD isn't fully specified. Tasks are designed to provide the most direct implementation path while avoiding over-engineering.
|
||||||
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress. If the user does not have a PRD, suggest discussing their idea and then use the example PRD in `.taskmaster/templates/example_prd.txt` as a template for creating the PRD based on their idea, for use with `parse-prd`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## AI Model Configuration
|
||||||
|
|
||||||
|
### 2. Manage Models (`models`)
|
||||||
|
* **MCP Tool:** `models`
|
||||||
|
* **CLI Command:** `task-master models [options]`
|
||||||
|
* **Description:** `View the current AI model configuration or set specific models for different roles (main, research, fallback). Allows setting custom model IDs for Ollama and OpenRouter.`
|
||||||
|
* **Key MCP Parameters/Options:**
|
||||||
|
* `setMain <model_id>`: `Set the primary model ID for task generation/updates.` (CLI: `--set-main <model_id>`)
|
||||||
|
* `setResearch <model_id>`: `Set the model ID for research-backed operations.` (CLI: `--set-research <model_id>`)
|
||||||
|
* `setFallback <model_id>`: `Set the model ID to use if the primary fails.` (CLI: `--set-fallback <model_id>`)
|
||||||
|
* `ollama <boolean>`: `Indicates the set model ID is a custom Ollama model.` (CLI: `--ollama`)
|
||||||
|
* `openrouter <boolean>`: `Indicates the set model ID is a custom OpenRouter model.` (CLI: `--openrouter`)
|
||||||
|
* `listAvailableModels <boolean>`: `If true, lists available models not currently assigned to a role.` (CLI: No direct equivalent; CLI lists available automatically)
|
||||||
|
* `projectRoot <string>`: `Optional. Absolute path to the project root directory.` (CLI: Determined automatically)
|
||||||
|
* **Key CLI Options:**
|
||||||
|
* `--set-main <model_id>`: `Set the primary model.`
|
||||||
|
* `--set-research <model_id>`: `Set the research model.`
|
||||||
|
* `--set-fallback <model_id>`: `Set the fallback model.`
|
||||||
|
* `--ollama`: `Specify that the provided model ID is for Ollama (use with --set-*).`
|
||||||
|
* `--openrouter`: `Specify that the provided model ID is for OpenRouter (use with --set-*). Validates against OpenRouter API.`
|
||||||
|
* `--setup`: `Run interactive setup to configure models, including custom Ollama/OpenRouter IDs.`
|
||||||
|
* **Usage (MCP):** Call without set flags to get current config. Use `setMain`, `setResearch`, or `setFallback` with a valid model ID to update the configuration. Use `listAvailableModels: true` to get a list of unassigned models. To set a custom model, provide the model ID and set `ollama: true` or `openrouter: true`.
|
||||||
|
* **Usage (CLI):** Run without flags to view current configuration and available models. Use set flags to update specific roles. Use `--setup` for guided configuration, including custom models. To set a custom model via flags, use `--set-<role>=<model_id>` along with either `--ollama` or `--openrouter`.
|
||||||
|
* **Notes:** Configuration is stored in `.taskmaster/config.json` in the project root. This command/tool modifies that file. Use `listAvailableModels` or `task-master models` to see internally supported models. OpenRouter custom models are validated against their live API. Ollama custom models are not validated live.
|
||||||
|
* **API note:** API keys for selected AI providers (based on their model) need to exist in the mcp.json file to be accessible in MCP context. The API keys must be present in the local .env file for the CLI to be able to read them.
|
||||||
|
* **Model costs:** The costs in supported models are expressed in dollars. An input/output value of 3 is $3.00. A value of 0.8 is $0.80.
|
||||||
|
* **Warning:** DO NOT MANUALLY EDIT THE .taskmaster/config.json FILE. Use the included commands either in the MCP or CLI format as needed. Always prioritize MCP tools when available and use the CLI as a fallback.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -63,9 +95,10 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **CLI Command:** `task-master list [options]`
|
* **CLI Command:** `task-master list [options]`
|
||||||
* **Description:** `List your Taskmaster tasks, optionally filtering by status and showing subtasks.`
|
* **Description:** `List your Taskmaster tasks, optionally filtering by status and showing subtasks.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `status`: `Show only Taskmaster tasks matching this status (e.g., 'pending', 'done').` (CLI: `-s, --status <status>`)
|
* `status`: `Show only Taskmaster tasks matching this status (or multiple statuses, comma-separated), e.g., 'pending' or 'done,in-progress'.` (CLI: `-s, --status <status>`)
|
||||||
* `withSubtasks`: `Include subtasks indented under their parent tasks in the list.` (CLI: `--with-subtasks`)
|
* `withSubtasks`: `Include subtasks indented under their parent tasks in the list.` (CLI: `--with-subtasks`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `tag`: `Specify which tag context to list tasks from. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Get an overview of the project status, often used at the start of a work session.
|
* **Usage:** Get an overview of the project status, often used at the start of a work session.
|
||||||
|
|
||||||
### 4. Get Next Task (`next_task`)
|
### 4. Get Next Task (`next_task`)
|
||||||
@@ -74,18 +107,20 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **CLI Command:** `task-master next [options]`
|
* **CLI Command:** `task-master next [options]`
|
||||||
* **Description:** `Ask Taskmaster to show the next available task you can work on, based on status and completed dependencies.`
|
* **Description:** `Ask Taskmaster to show the next available task you can work on, based on status and completed dependencies.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Identify what to work on next according to the plan.
|
* **Usage:** Identify what to work on next according to the plan.
|
||||||
|
|
||||||
### 5. Get Task Details (`get_task`)
|
### 5. Get Task Details (`get_task`)
|
||||||
|
|
||||||
* **MCP Tool:** `get_task`
|
* **MCP Tool:** `get_task`
|
||||||
* **CLI Command:** `task-master show [id] [options]`
|
* **CLI Command:** `task-master show [id] [options]`
|
||||||
* **Description:** `Display detailed information for a specific Taskmaster task or subtask by its ID.`
|
* **Description:** `Display detailed information for one or more specific Taskmaster tasks or subtasks by ID.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id`: `Required. The ID of the Taskmaster task (e.g., '15') or subtask (e.g., '15.2') you want to view.` (CLI: `[id]` positional or `-i, --id <id>`)
|
* `id`: `Required. The ID of the Taskmaster task (e.g., '15'), subtask (e.g., '15.2'), or a comma-separated list of IDs ('1,5,10.2') you want to view.` (CLI: `[id]` positional or `-i, --id <id>`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `tag`: `Specify which tag context to get the task(s) from. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
* **Usage:** Understand the full details, implementation notes, and test strategy for a specific task before starting work.
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
|
* **Usage:** Understand the full details for a specific task. When multiple IDs are provided, a summary table is shown.
|
||||||
|
* **CRITICAL INFORMATION** If you need to collect information from multiple tasks, use comma-separated IDs (i.e. 1,2,3) to receive an array of tasks. Do not needlessly get tasks one at a time if you need to get many as that is wasteful.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -97,10 +132,11 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **CLI Command:** `task-master add-task [options]`
|
* **CLI Command:** `task-master add-task [options]`
|
||||||
* **Description:** `Add a new task to Taskmaster by describing it; AI will structure it.`
|
* **Description:** `Add a new task to Taskmaster by describing it; AI will structure it.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `prompt`: `Required. Describe the new task you want Taskmaster to create (e.g., "Implement user authentication using JWT").` (CLI: `-p, --prompt <text>`)
|
* `prompt`: `Required. Describe the new task you want Taskmaster to create, e.g., "Implement user authentication using JWT".` (CLI: `-p, --prompt <text>`)
|
||||||
* `dependencies`: `Specify the IDs of any Taskmaster tasks that must be completed before this new one can start (e.g., '12,14').` (CLI: `-d, --dependencies <ids>`)
|
* `dependencies`: `Specify the IDs of any Taskmaster tasks that must be completed before this new one can start, e.g., '12,14'.` (CLI: `-d, --dependencies <ids>`)
|
||||||
* `priority`: `Set the priority for the new task ('high', 'medium', 'low'; default: 'medium').` (CLI: `--priority <priority>`)
|
* `priority`: `Set the priority for the new task: 'high', 'medium', or 'low'. Default is 'medium'.` (CLI: `--priority <priority>`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `research`: `Enable Taskmaster to use the research role for potentially more informed task creation.` (CLI: `-r, --research`)
|
||||||
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Quickly add newly identified tasks during development.
|
* **Usage:** Quickly add newly identified tasks during development.
|
||||||
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
||||||
|
|
||||||
@@ -112,13 +148,13 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id` / `parent`: `Required. The ID of the Taskmaster task that will be the parent.` (MCP: `id`, CLI: `-p, --parent <id>`)
|
* `id` / `parent`: `Required. The ID of the Taskmaster task that will be the parent.` (MCP: `id`, CLI: `-p, --parent <id>`)
|
||||||
* `taskId`: `Use this if you want to convert an existing top-level Taskmaster task into a subtask of the specified parent.` (CLI: `-i, --task-id <id>`)
|
* `taskId`: `Use this if you want to convert an existing top-level Taskmaster task into a subtask of the specified parent.` (CLI: `-i, --task-id <id>`)
|
||||||
* `title`: `Required (if not using taskId). The title for the new subtask Taskmaster should create.` (CLI: `-t, --title <title>`)
|
* `title`: `Required if not using taskId. The title for the new subtask Taskmaster should create.` (CLI: `-t, --title <title>`)
|
||||||
* `description`: `A brief description for the new subtask.` (CLI: `-d, --description <text>`)
|
* `description`: `A brief description for the new subtask.` (CLI: `-d, --description <text>`)
|
||||||
* `details`: `Provide implementation notes or details for the new subtask.` (CLI: `--details <text>`)
|
* `details`: `Provide implementation notes or details for the new subtask.` (CLI: `--details <text>`)
|
||||||
* `dependencies`: `Specify IDs of other tasks or subtasks (e.g., '15', '16.1') that must be done before this new subtask.` (CLI: `--dependencies <ids>`)
|
* `dependencies`: `Specify IDs of other tasks or subtasks, e.g., '15' or '16.1', that must be done before this new subtask.` (CLI: `--dependencies <ids>`)
|
||||||
* `status`: `Set the initial status for the new subtask (default: 'pending').` (CLI: `-s, --status <status>`)
|
* `status`: `Set the initial status for the new subtask. Default is 'pending'.` (CLI: `-s, --status <status>`)
|
||||||
* `skipGenerate`: `Prevent Taskmaster from automatically regenerating markdown task files after adding the subtask.` (CLI: `--skip-generate`)
|
* `skipGenerate`: `Prevent Taskmaster from automatically regenerating markdown task files after adding the subtask.` (CLI: `--skip-generate`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Break down tasks manually or reorganize existing tasks.
|
* **Usage:** Break down tasks manually or reorganize existing tasks.
|
||||||
|
|
||||||
### 8. Update Tasks (`update`)
|
### 8. Update Tasks (`update`)
|
||||||
@@ -127,10 +163,10 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **CLI Command:** `task-master update [options]`
|
* **CLI Command:** `task-master update [options]`
|
||||||
* **Description:** `Update multiple upcoming tasks in Taskmaster based on new context or changes, starting from a specific task ID.`
|
* **Description:** `Update multiple upcoming tasks in Taskmaster based on new context or changes, starting from a specific task ID.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `from`: `Required. The ID of the first task Taskmaster should update. All tasks with this ID or higher (and not 'done') will be considered.` (CLI: `--from <id>`)
|
* `from`: `Required. The ID of the first task Taskmaster should update. All tasks with this ID or higher that are not 'done' will be considered.` (CLI: `--from <id>`)
|
||||||
* `prompt`: `Required. Explain the change or new context for Taskmaster to apply to the tasks (e.g., "We are now using React Query instead of Redux Toolkit for data fetching").` (CLI: `-p, --prompt <text>`)
|
* `prompt`: `Required. Explain the change or new context for Taskmaster to apply to the tasks, e.g., "We are now using React Query instead of Redux Toolkit for data fetching".` (CLI: `-p, --prompt <text>`)
|
||||||
* `research`: `Enable Taskmaster to use Perplexity AI for more informed updates based on external knowledge (requires PERPLEXITY_API_KEY).` (CLI: `-r, --research`)
|
* `research`: `Enable Taskmaster to use the research role for more informed updates. Requires appropriate API key.` (CLI: `-r, --research`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Handle significant implementation changes or pivots that affect multiple future tasks. Example CLI: `task-master update --from='18' --prompt='Switching to React Query.\nNeed to refactor data fetching...'`
|
* **Usage:** Handle significant implementation changes or pivots that affect multiple future tasks. Example CLI: `task-master update --from='18' --prompt='Switching to React Query.\nNeed to refactor data fetching...'`
|
||||||
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
||||||
|
|
||||||
@@ -138,13 +174,15 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
|
|
||||||
* **MCP Tool:** `update_task`
|
* **MCP Tool:** `update_task`
|
||||||
* **CLI Command:** `task-master update-task [options]`
|
* **CLI Command:** `task-master update-task [options]`
|
||||||
* **Description:** `Modify a specific Taskmaster task (or subtask) by its ID, incorporating new information or changes.`
|
* **Description:** `Modify a specific Taskmaster task by ID, incorporating new information or changes. By default, this replaces the existing task details.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id`: `Required. The specific ID of the Taskmaster task (e.g., '15') or subtask (e.g., '15.2') you want to update.` (CLI: `-i, --id <id>`)
|
* `id`: `Required. The specific ID of the Taskmaster task, e.g., '15', you want to update.` (CLI: `-i, --id <id>`)
|
||||||
* `prompt`: `Required. Explain the specific changes or provide the new information Taskmaster should incorporate into this task.` (CLI: `-p, --prompt <text>`)
|
* `prompt`: `Required. Explain the specific changes or provide the new information Taskmaster should incorporate into this task.` (CLI: `-p, --prompt <text>`)
|
||||||
* `research`: `Enable Taskmaster to use Perplexity AI for more informed updates (requires PERPLEXITY_API_KEY).` (CLI: `-r, --research`)
|
* `append`: `If true, appends the prompt content to the task's details with a timestamp, rather than replacing them. Behaves like update-subtask.` (CLI: `--append`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `research`: `Enable Taskmaster to use the research role for more informed updates. Requires appropriate API key.` (CLI: `-r, --research`)
|
||||||
* **Usage:** Refine a specific task based on new understanding or feedback. Example CLI: `task-master update-task --id='15' --prompt='Clarification: Use PostgreSQL instead of MySQL.\nUpdate schema details...'`
|
* `tag`: `Specify which tag context the task belongs to. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
|
* **Usage:** Refine a specific task based on new understanding. Use `--append` to log progress without creating subtasks.
|
||||||
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
||||||
|
|
||||||
### 10. Update Subtask (`update_subtask`)
|
### 10. Update Subtask (`update_subtask`)
|
||||||
@@ -153,22 +191,22 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **CLI Command:** `task-master update-subtask [options]`
|
* **CLI Command:** `task-master update-subtask [options]`
|
||||||
* **Description:** `Append timestamped notes or details to a specific Taskmaster subtask without overwriting existing content. Intended for iterative implementation logging.`
|
* **Description:** `Append timestamped notes or details to a specific Taskmaster subtask without overwriting existing content. Intended for iterative implementation logging.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id`: `Required. The specific ID of the Taskmaster subtask (e.g., '15.2') you want to add information to.` (CLI: `-i, --id <id>`)
|
* `id`: `Required. The ID of the Taskmaster task, e.g., '5', or subtask, e.g., '5.2', to permanently remove.` (CLI: `-i, --id <id>`)
|
||||||
* `prompt`: `Required. Provide the information or notes Taskmaster should append to the subtask's details. Ensure this adds *new* information not already present.` (CLI: `-p, --prompt <text>`)
|
* `yes`: `Skip the confirmation prompt and immediately delete the task.` (CLI: `-y, --yes`)
|
||||||
* `research`: `Enable Taskmaster to use Perplexity AI for more informed updates (requires PERPLEXITY_API_KEY).` (CLI: `-r, --research`)
|
* `tag`: `Specify which tag context to remove the task from. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Add implementation notes, code snippets, or clarifications to a subtask during development. Before calling, review the subtask's current details to append only fresh insights, helping to build a detailed log of the implementation journey and avoid redundancy. Example CLI: `task-master update-subtask --id='15.2' --prompt='Discovered that the API requires header X.\nImplementation needs adjustment...'`
|
* **Usage:** Permanently delete tasks or subtasks that are no longer needed in the project.
|
||||||
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
* **Notes:** Use with caution as this operation cannot be undone. Consider using 'blocked', 'cancelled', or 'deferred' status instead if you just want to exclude a task from active planning but keep it for reference. The command automatically cleans up dependency references in other tasks.
|
||||||
|
|
||||||
### 11. Set Task Status (`set_task_status`)
|
### 11. Set Task Status (`set_task_status`)
|
||||||
|
|
||||||
* **MCP Tool:** `set_task_status`
|
* **MCP Tool:** `set_task_status`
|
||||||
* **CLI Command:** `task-master set-status [options]`
|
* **CLI Command:** `task-master set-status [options]`
|
||||||
* **Description:** `Update the status of one or more Taskmaster tasks or subtasks (e.g., 'pending', 'in-progress', 'done').`
|
* **Description:** `Update the status of one or more Taskmaster tasks or subtasks, e.g., 'pending', 'in-progress', 'done'.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id`: `Required. The ID(s) of the Taskmaster task(s) or subtask(s) (e.g., '15', '15.2', '16,17.1') to update.` (CLI: `-i, --id <id>`)
|
* `id`: `Required. The ID(s) of the Taskmaster task(s) or subtask(s), e.g., '15', '15.2', or '16,17.1', to update.` (CLI: `-i, --id <id>`)
|
||||||
* `status`: `Required. The new status to set (e.g., 'done', 'pending', 'in-progress', 'review', 'cancelled').` (CLI: `-s, --status <status>`)
|
* `status`: `Required. The new status to set, e.g., 'done', 'pending', 'in-progress', 'review', 'cancelled'.` (CLI: `-s, --status <status>`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Mark progress as tasks move through the development cycle.
|
* **Usage:** Mark progress as tasks move through the development cycle.
|
||||||
|
|
||||||
### 12. Remove Task (`remove_task`)
|
### 12. Remove Task (`remove_task`)
|
||||||
@@ -177,9 +215,9 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **CLI Command:** `task-master remove-task [options]`
|
* **CLI Command:** `task-master remove-task [options]`
|
||||||
* **Description:** `Permanently remove a task or subtask from the Taskmaster tasks list.`
|
* **Description:** `Permanently remove a task or subtask from the Taskmaster tasks list.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id`: `Required. The ID of the Taskmaster task (e.g., '5') or subtask (e.g., '5.2') to permanently remove.` (CLI: `-i, --id <id>`)
|
* `id`: `Required. The ID of the Taskmaster task, e.g., '5', or subtask, e.g., '5.2', to permanently remove.` (CLI: `-i, --id <id>`)
|
||||||
* `yes`: `Skip the confirmation prompt and immediately delete the task.` (CLI: `-y, --yes`)
|
* `yes`: `Skip the confirmation prompt and immediately delete the task.` (CLI: `-y, --yes`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Permanently delete tasks or subtasks that are no longer needed in the project.
|
* **Usage:** Permanently delete tasks or subtasks that are no longer needed in the project.
|
||||||
* **Notes:** Use with caution as this operation cannot be undone. Consider using 'blocked', 'cancelled', or 'deferred' status instead if you just want to exclude a task from active planning but keep it for reference. The command automatically cleans up dependency references in other tasks.
|
* **Notes:** Use with caution as this operation cannot be undone. Consider using 'blocked', 'cancelled', or 'deferred' status instead if you just want to exclude a task from active planning but keep it for reference. The command automatically cleans up dependency references in other tasks.
|
||||||
|
|
||||||
@@ -191,28 +229,30 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
|
|
||||||
* **MCP Tool:** `expand_task`
|
* **MCP Tool:** `expand_task`
|
||||||
* **CLI Command:** `task-master expand [options]`
|
* **CLI Command:** `task-master expand [options]`
|
||||||
* **Description:** `Use Taskmaster's AI to break down a complex task (or all tasks) into smaller, manageable subtasks.`
|
* **Description:** `Use Taskmaster's AI to break down a complex task into smaller, manageable subtasks. Appends subtasks by default.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id`: `The ID of the specific Taskmaster task you want to break down into subtasks.` (CLI: `-i, --id <id>`)
|
* `id`: `The ID of the specific Taskmaster task you want to break down into subtasks.` (CLI: `-i, --id <id>`)
|
||||||
* `num`: `Suggests how many subtasks Taskmaster should aim to create (uses complexity analysis by default).` (CLI: `-n, --num <number>`)
|
* `num`: `Optional: Suggests how many subtasks Taskmaster should aim to create. Uses complexity analysis/defaults otherwise.` (CLI: `-n, --num <number>`)
|
||||||
* `research`: `Enable Taskmaster to use Perplexity AI for more informed subtask generation (requires PERPLEXITY_API_KEY).` (CLI: `-r, --research`)
|
* `research`: `Enable Taskmaster to use the research role for more informed subtask generation. Requires appropriate API key.` (CLI: `-r, --research`)
|
||||||
* `prompt`: `Provide extra context or specific instructions to Taskmaster for generating the subtasks.` (CLI: `-p, --prompt <text>`)
|
* `prompt`: `Optional: Provide extra context or specific instructions to Taskmaster for generating the subtasks.` (CLI: `-p, --prompt <text>`)
|
||||||
* `force`: `Use this to make Taskmaster replace existing subtasks with newly generated ones.` (CLI: `--force`)
|
* `force`: `Optional: If true, clear existing subtasks before generating new ones. Default is false (append).` (CLI: `--force`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `tag`: `Specify which tag context the task belongs to. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
* **Usage:** Generate a detailed implementation plan for a complex task before starting coding.
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
|
* **Usage:** Generate a detailed implementation plan for a complex task before starting coding. Automatically uses complexity report recommendations if available and `num` is not specified.
|
||||||
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
||||||
|
|
||||||
### 14. Expand All Tasks (`expand_all`)
|
### 14. Expand All Tasks (`expand_all`)
|
||||||
|
|
||||||
* **MCP Tool:** `expand_all`
|
* **MCP Tool:** `expand_all`
|
||||||
* **CLI Command:** `task-master expand --all [options]` (Note: CLI uses the `expand` command with the `--all` flag)
|
* **CLI Command:** `task-master expand --all [options]` (Note: CLI uses the `expand` command with the `--all` flag)
|
||||||
* **Description:** `Tell Taskmaster to automatically expand all 'pending' tasks based on complexity analysis.`
|
* **Description:** `Tell Taskmaster to automatically expand all eligible pending/in-progress tasks based on complexity analysis or defaults. Appends subtasks by default.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `num`: `Suggests how many subtasks Taskmaster should aim to create per task.` (CLI: `-n, --num <number>`)
|
* `num`: `Optional: Suggests how many subtasks Taskmaster should aim to create per task.` (CLI: `-n, --num <number>`)
|
||||||
* `research`: `Enable Perplexity AI for more informed subtask generation (requires PERPLEXITY_API_KEY).` (CLI: `-r, --research`)
|
* `research`: `Enable research role for more informed subtask generation. Requires appropriate API key.` (CLI: `-r, --research`)
|
||||||
* `prompt`: `Provide extra context for Taskmaster to apply generally during expansion.` (CLI: `-p, --prompt <text>`)
|
* `prompt`: `Optional: Provide extra context for Taskmaster to apply generally during expansion.` (CLI: `-p, --prompt <text>`)
|
||||||
* `force`: `Make Taskmaster replace existing subtasks.` (CLI: `--force`)
|
* `force`: `Optional: If true, clear existing subtasks before generating new ones for each eligible task. Default is false (append).` (CLI: `--force`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `tag`: `Specify which tag context to expand. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Useful after initial task generation or complexity analysis to break down multiple tasks at once.
|
* **Usage:** Useful after initial task generation or complexity analysis to break down multiple tasks at once.
|
||||||
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
||||||
|
|
||||||
@@ -222,9 +262,9 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **CLI Command:** `task-master clear-subtasks [options]`
|
* **CLI Command:** `task-master clear-subtasks [options]`
|
||||||
* **Description:** `Remove all subtasks from one or more specified Taskmaster parent tasks.`
|
* **Description:** `Remove all subtasks from one or more specified Taskmaster parent tasks.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id`: `The ID(s) of the Taskmaster parent task(s) whose subtasks you want to remove (e.g., '15', '16,18').` (Required unless using `all`) (CLI: `-i, --id <ids>`)
|
* `id`: `The ID(s) of the Taskmaster parent task(s) whose subtasks you want to remove, e.g., '15' or '16,18'. Required unless using `all`.) (CLI: `-i, --id <ids>`)
|
||||||
* `all`: `Tell Taskmaster to remove subtasks from all parent tasks.` (CLI: `--all`)
|
* `all`: `Tell Taskmaster to remove subtasks from all parent tasks.` (CLI: `--all`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Used before regenerating subtasks with `expand_task` if the previous breakdown needs replacement.
|
* **Usage:** Used before regenerating subtasks with `expand_task` if the previous breakdown needs replacement.
|
||||||
|
|
||||||
### 16. Remove Subtask (`remove_subtask`)
|
### 16. Remove Subtask (`remove_subtask`)
|
||||||
@@ -233,28 +273,53 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **CLI Command:** `task-master remove-subtask [options]`
|
* **CLI Command:** `task-master remove-subtask [options]`
|
||||||
* **Description:** `Remove a subtask from its Taskmaster parent, optionally converting it into a standalone task.`
|
* **Description:** `Remove a subtask from its Taskmaster parent, optionally converting it into a standalone task.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id`: `Required. The ID(s) of the Taskmaster subtask(s) to remove (e.g., '15.2', '16.1,16.3').` (CLI: `-i, --id <id>`)
|
* `id`: `Required. The ID(s) of the Taskmaster subtask(s) to remove, e.g., '15.2' or '16.1,16.3'.` (CLI: `-i, --id <id>`)
|
||||||
* `convert`: `If used, Taskmaster will turn the subtask into a regular top-level task instead of deleting it.` (CLI: `-c, --convert`)
|
* `convert`: `If used, Taskmaster will turn the subtask into a regular top-level task instead of deleting it.` (CLI: `-c, --convert`)
|
||||||
* `skipGenerate`: `Prevent Taskmaster from automatically regenerating markdown task files after removing the subtask.` (CLI: `--skip-generate`)
|
* `skipGenerate`: `Prevent Taskmaster from automatically regenerating markdown task files after removing the subtask.` (CLI: `--skip-generate`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Delete unnecessary subtasks or promote a subtask to a top-level task.
|
* **Usage:** Delete unnecessary subtasks or promote a subtask to a top-level task.
|
||||||
|
|
||||||
|
### 17. Move Task (`move_task`)
|
||||||
|
|
||||||
|
* **MCP Tool:** `move_task`
|
||||||
|
* **CLI Command:** `task-master move [options]`
|
||||||
|
* **Description:** `Move a task or subtask to a new position within the task hierarchy.`
|
||||||
|
* **Key Parameters/Options:**
|
||||||
|
* `from`: `Required. ID of the task/subtask to move (e.g., "5" or "5.2"). Can be comma-separated for multiple tasks.` (CLI: `--from <id>`)
|
||||||
|
* `to`: `Required. ID of the destination (e.g., "7" or "7.3"). Must match the number of source IDs if comma-separated.` (CLI: `--to <id>`)
|
||||||
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
|
* **Usage:** Reorganize tasks by moving them within the hierarchy. Supports various scenarios like:
|
||||||
|
* Moving a task to become a subtask
|
||||||
|
* Moving a subtask to become a standalone task
|
||||||
|
* Moving a subtask to a different parent
|
||||||
|
* Reordering subtasks within the same parent
|
||||||
|
* Moving a task to a new, non-existent ID (automatically creates placeholders)
|
||||||
|
* Moving multiple tasks at once with comma-separated IDs
|
||||||
|
* **Validation Features:**
|
||||||
|
* Allows moving tasks to non-existent destination IDs (creates placeholder tasks)
|
||||||
|
* Prevents moving to existing task IDs that already have content (to avoid overwriting)
|
||||||
|
* Validates that source tasks exist before attempting to move them
|
||||||
|
* Maintains proper parent-child relationships
|
||||||
|
* **Example CLI:** `task-master move --from=5.2 --to=7.3` to move subtask 5.2 to become subtask 7.3.
|
||||||
|
* **Example Multi-Move:** `task-master move --from=10,11,12 --to=16,17,18` to move multiple tasks to new positions.
|
||||||
|
* **Common Use:** Resolving merge conflicts in tasks.json when multiple team members create tasks on different branches.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Dependency Management
|
## Dependency Management
|
||||||
|
|
||||||
### 17. Add Dependency (`add_dependency`)
|
### 18. Add Dependency (`add_dependency`)
|
||||||
|
|
||||||
* **MCP Tool:** `add_dependency`
|
* **MCP Tool:** `add_dependency`
|
||||||
* **CLI Command:** `task-master add-dependency [options]`
|
* **CLI Command:** `task-master add-dependency [options]`
|
||||||
* **Description:** `Define a dependency in Taskmaster, making one task a prerequisite for another.`
|
* **Description:** `Define a dependency in Taskmaster, making one task a prerequisite for another.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id`: `Required. The ID of the Taskmaster task that will depend on another.` (CLI: `-i, --id <id>`)
|
* `id`: `Required. The ID of the Taskmaster task that will depend on another.` (CLI: `-i, --id <id>`)
|
||||||
* `dependsOn`: `Required. The ID of the Taskmaster task that must be completed first (the prerequisite).` (CLI: `-d, --depends-on <id>`)
|
* `dependsOn`: `Required. The ID of the Taskmaster task that must be completed first, the prerequisite.` (CLI: `-d, --depends-on <id>`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <path>`)
|
||||||
* **Usage:** Establish the correct order of execution between tasks.
|
* **Usage:** Establish the correct order of execution between tasks.
|
||||||
|
|
||||||
### 18. Remove Dependency (`remove_dependency`)
|
### 19. Remove Dependency (`remove_dependency`)
|
||||||
|
|
||||||
* **MCP Tool:** `remove_dependency`
|
* **MCP Tool:** `remove_dependency`
|
||||||
* **CLI Command:** `task-master remove-dependency [options]`
|
* **CLI Command:** `task-master remove-dependency [options]`
|
||||||
@@ -262,92 +327,211 @@ This document provides a detailed reference for interacting with Taskmaster, cov
|
|||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `id`: `Required. The ID of the Taskmaster task you want to remove a prerequisite from.` (CLI: `-i, --id <id>`)
|
* `id`: `Required. The ID of the Taskmaster task you want to remove a prerequisite from.` (CLI: `-i, --id <id>`)
|
||||||
* `dependsOn`: `Required. The ID of the Taskmaster task that should no longer be a prerequisite.` (CLI: `-d, --depends-on <id>`)
|
* `dependsOn`: `Required. The ID of the Taskmaster task that should no longer be a prerequisite.` (CLI: `-d, --depends-on <id>`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Update task relationships when the order of execution changes.
|
* **Usage:** Update task relationships when the order of execution changes.
|
||||||
|
|
||||||
### 19. Validate Dependencies (`validate_dependencies`)
|
### 20. Validate Dependencies (`validate_dependencies`)
|
||||||
|
|
||||||
* **MCP Tool:** `validate_dependencies`
|
* **MCP Tool:** `validate_dependencies`
|
||||||
* **CLI Command:** `task-master validate-dependencies [options]`
|
* **CLI Command:** `task-master validate-dependencies [options]`
|
||||||
* **Description:** `Check your Taskmaster tasks for dependency issues (like circular references or links to non-existent tasks) without making changes.`
|
* **Description:** `Check your Taskmaster tasks for dependency issues (like circular references or links to non-existent tasks) without making changes.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Audit the integrity of your task dependencies.
|
* **Usage:** Audit the integrity of your task dependencies.
|
||||||
|
|
||||||
### 20. Fix Dependencies (`fix_dependencies`)
|
### 21. Fix Dependencies (`fix_dependencies`)
|
||||||
|
|
||||||
* **MCP Tool:** `fix_dependencies`
|
* **MCP Tool:** `fix_dependencies`
|
||||||
* **CLI Command:** `task-master fix-dependencies [options]`
|
* **CLI Command:** `task-master fix-dependencies [options]`
|
||||||
* **Description:** `Automatically fix dependency issues (like circular references or links to non-existent tasks) in your Taskmaster tasks.`
|
* **Description:** `Automatically fix dependency issues (like circular references or links to non-existent tasks) in your Taskmaster tasks.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `tag`: `Specify which tag context to fix dependencies in. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Clean up dependency errors automatically.
|
* **Usage:** Clean up dependency errors automatically.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Analysis & Reporting
|
## Analysis & Reporting
|
||||||
|
|
||||||
### 21. Analyze Project Complexity (`analyze_project_complexity`)
|
### 22. Analyze Project Complexity (`analyze_project_complexity`)
|
||||||
|
|
||||||
* **MCP Tool:** `analyze_project_complexity`
|
* **MCP Tool:** `analyze_project_complexity`
|
||||||
* **CLI Command:** `task-master analyze-complexity [options]`
|
* **CLI Command:** `task-master analyze-complexity [options]`
|
||||||
* **Description:** `Have Taskmaster analyze your tasks to determine their complexity and suggest which ones need to be broken down further.`
|
* **Description:** `Have Taskmaster analyze your tasks to determine their complexity and suggest which ones need to be broken down further.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `output`: `Where to save the complexity analysis report (default: 'scripts/task-complexity-report.json').` (CLI: `-o, --output <file>`)
|
* `output`: `Where to save the complexity analysis report. Default is '.taskmaster/reports/task-complexity-report.json' (or '..._tagname.json' if a tag is used).` (CLI: `-o, --output <file>`)
|
||||||
* `threshold`: `The minimum complexity score (1-10) that should trigger a recommendation to expand a task.` (CLI: `-t, --threshold <number>`)
|
* `threshold`: `The minimum complexity score (1-10) that should trigger a recommendation to expand a task.` (CLI: `-t, --threshold <number>`)
|
||||||
* `research`: `Enable Perplexity AI for more accurate complexity analysis (requires PERPLEXITY_API_KEY).` (CLI: `-r, --research`)
|
* `research`: `Enable research role for more accurate complexity analysis. Requires appropriate API key.` (CLI: `-r, --research`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `tag`: `Specify which tag context to analyze. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Used before breaking down tasks to identify which ones need the most attention.
|
* **Usage:** Used before breaking down tasks to identify which ones need the most attention.
|
||||||
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. Please inform users to hang tight while the operation is in progress.
|
||||||
|
|
||||||
### 22. View Complexity Report (`complexity_report`)
|
### 23. View Complexity Report (`complexity_report`)
|
||||||
|
|
||||||
* **MCP Tool:** `complexity_report`
|
* **MCP Tool:** `complexity_report`
|
||||||
* **CLI Command:** `task-master complexity-report [options]`
|
* **CLI Command:** `task-master complexity-report [options]`
|
||||||
* **Description:** `Display the task complexity analysis report in a readable format.`
|
* **Description:** `Display the task complexity analysis report in a readable format.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `file`: `Path to the complexity report (default: 'scripts/task-complexity-report.json').` (CLI: `-f, --file <file>`)
|
* `file`: `Path to the complexity report (default: '.taskmaster/reports/task-complexity-report.json').` (CLI: `-f, --file <file>`)
|
||||||
* **Usage:** Review and understand the complexity analysis results after running analyze-complexity.
|
* **Usage:** Review and understand the complexity analysis results after running analyze-complexity.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## File Management
|
## File Management
|
||||||
|
|
||||||
### 23. Generate Task Files (`generate`)
|
### 24. Generate Task Files (`generate`)
|
||||||
|
|
||||||
* **MCP Tool:** `generate`
|
* **MCP Tool:** `generate`
|
||||||
* **CLI Command:** `task-master generate [options]`
|
* **CLI Command:** `task-master generate [options]`
|
||||||
* **Description:** `Create or update individual Markdown files for each task based on your tasks.json.`
|
* **Description:** `Create or update individual Markdown files for each task based on your tasks.json.`
|
||||||
* **Key Parameters/Options:**
|
* **Key Parameters/Options:**
|
||||||
* `output`: `The directory where Taskmaster should save the task files (default: in a 'tasks' directory).` (CLI: `-o, --output <directory>`)
|
* `output`: `The directory where Taskmaster should save the task files (default: in a 'tasks' directory).` (CLI: `-o, --output <directory>`)
|
||||||
* `file`: `Path to your Taskmaster 'tasks.json' file (default relies on auto-detection).` (CLI: `-f, --file <file>`)
|
* `tag`: `Specify which tag context to generate files for. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
* **Usage:** Run this after making changes to tasks.json to keep individual task files up to date.
|
* `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
|
||||||
|
* **Usage:** Run this after making changes to tasks.json to keep individual task files up to date. This command is now manual and no longer runs automatically.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Environment Variables Configuration
|
## AI-Powered Research
|
||||||
|
|
||||||
Taskmaster's behavior can be customized via environment variables. These affect both CLI and MCP server operation:
|
### 25. Research (`research`)
|
||||||
|
|
||||||
* **ANTHROPIC_API_KEY** (Required): Your Anthropic API key for Claude.
|
* **MCP Tool:** `research`
|
||||||
* **MODEL**: Claude model to use (default: `claude-3-opus-20240229`).
|
* **CLI Command:** `task-master research [options]`
|
||||||
* **MAX_TOKENS**: Maximum tokens for AI responses (default: 8192).
|
* **Description:** `Perform AI-powered research queries with project context to get fresh, up-to-date information beyond the AI's knowledge cutoff.`
|
||||||
* **TEMPERATURE**: Temperature for AI model responses (default: 0.7).
|
* **Key Parameters/Options:**
|
||||||
* **DEBUG**: Enable debug logging (`true`/`false`, default: `false`).
|
* `query`: `Required. Research query/prompt (e.g., "What are the latest best practices for React Query v5?").` (CLI: `[query]` positional or `-q, --query <text>`)
|
||||||
* **LOG_LEVEL**: Console output level (`debug`, `info`, `warn`, `error`, default: `info`).
|
* `taskIds`: `Comma-separated list of task/subtask IDs from the current tag context (e.g., "15,16.2,17").` (CLI: `-i, --id <ids>`)
|
||||||
* **DEFAULT_SUBTASKS**: Default number of subtasks for `expand` (default: 5).
|
* `filePaths`: `Comma-separated list of file paths for context (e.g., "src/api.js,docs/readme.md").` (CLI: `-f, --files <paths>`)
|
||||||
* **DEFAULT_PRIORITY**: Default priority for new tasks (default: `medium`).
|
* `customContext`: `Additional custom context text to include in the research.` (CLI: `-c, --context <text>`)
|
||||||
* **PROJECT_NAME**: Project name used in metadata.
|
* `includeProjectTree`: `Include project file tree structure in context (default: false).` (CLI: `--tree`)
|
||||||
* **PROJECT_VERSION**: Project version used in metadata.
|
* `detailLevel`: `Detail level for the research response: 'low', 'medium', 'high' (default: medium).` (CLI: `--detail <level>`)
|
||||||
* **PERPLEXITY_API_KEY**: API key for Perplexity AI (for `--research` flags).
|
* `saveTo`: `Task or subtask ID (e.g., "15", "15.2") to automatically save the research conversation to.` (CLI: `--save-to <id>`)
|
||||||
* **PERPLEXITY_MODEL**: Perplexity model to use (default: `sonar-medium-online`).
|
* `saveFile`: `If true, saves the research conversation to a markdown file in '.taskmaster/docs/research/'.` (CLI: `--save-file`)
|
||||||
|
* `noFollowup`: `Disables the interactive follow-up question menu in the CLI.` (CLI: `--no-followup`)
|
||||||
Set these in your `.env` file in the project root or in your environment before running Taskmaster.
|
* `tag`: `Specify which tag context to use for task-based context gathering. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
|
* `projectRoot`: `The directory of the project. Must be an absolute path.` (CLI: Determined automatically)
|
||||||
|
* **Usage:** **This is a POWERFUL tool that agents should use FREQUENTLY** to:
|
||||||
|
* Get fresh information beyond knowledge cutoff dates
|
||||||
|
* Research latest best practices, library updates, security patches
|
||||||
|
* Find implementation examples for specific technologies
|
||||||
|
* Validate approaches against current industry standards
|
||||||
|
* Get contextual advice based on project files and tasks
|
||||||
|
* **When to Consider Using Research:**
|
||||||
|
* **Before implementing any task** - Research current best practices
|
||||||
|
* **When encountering new technologies** - Get up-to-date implementation guidance (libraries, apis, etc)
|
||||||
|
* **For security-related tasks** - Find latest security recommendations
|
||||||
|
* **When updating dependencies** - Research breaking changes and migration guides
|
||||||
|
* **For performance optimization** - Get current performance best practices
|
||||||
|
* **When debugging complex issues** - Research known solutions and workarounds
|
||||||
|
* **Research + Action Pattern:**
|
||||||
|
* Use `research` to gather fresh information
|
||||||
|
* Use `update_subtask` to commit findings with timestamps
|
||||||
|
* Use `update_task` to incorporate research into task details
|
||||||
|
* Use `add_task` with research flag for informed task creation
|
||||||
|
* **Important:** This MCP tool makes AI calls and can take up to a minute to complete. The research provides FRESH data beyond the AI's training cutoff, making it invaluable for current best practices and recent developments.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
For implementation details:
|
## Tag Management
|
||||||
* CLI commands: See [`commands.mdc`](mdc:.cursor/rules/commands.mdc)
|
|
||||||
* MCP server: See [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc)
|
This new suite of commands allows you to manage different task contexts (tags).
|
||||||
* Task structure: See [`tasks.mdc`](mdc:.cursor/rules/tasks.mdc)
|
|
||||||
* Workflow: See [`dev_workflow.mdc`](mdc:.cursor/rules/dev_workflow.mdc)
|
### 26. List Tags (`tags`)
|
||||||
|
|
||||||
|
* **MCP Tool:** `list_tags`
|
||||||
|
* **CLI Command:** `task-master tags [options]`
|
||||||
|
* **Description:** `List all available tags with task counts, completion status, and other metadata.`
|
||||||
|
* **Key Parameters/Options:**
|
||||||
|
* `--show-metadata`: `Include detailed metadata in the output (e.g., creation date, description).` (CLI: `--show-metadata`)
|
||||||
|
|
||||||
|
### 27. Add Tag (`add_tag`)
|
||||||
|
|
||||||
|
* **MCP Tool:** `add_tag`
|
||||||
|
* **CLI Command:** `task-master add-tag <tagName> [options]`
|
||||||
|
* **Description:** `Create a new, empty tag context, or copy tasks from another tag.`
|
||||||
|
* **Key Parameters/Options:**
|
||||||
|
* `tagName`: `Name of the new tag to create (alphanumeric, hyphens, underscores).` (CLI: `<tagName>` positional)
|
||||||
|
* `--from-branch`: `Creates a tag with a name derived from the current git branch, ignoring the <tagName> argument.` (CLI: `--from-branch`)
|
||||||
|
* `--copy-from-current`: `Copy tasks from the currently active tag to the new tag.` (CLI: `--copy-from-current`)
|
||||||
|
* `--copy-from <tag>`: `Copy tasks from a specific source tag to the new tag.` (CLI: `--copy-from <tag>`)
|
||||||
|
* `--description <text>`: `Provide an optional description for the new tag.` (CLI: `-d, --description <text>`)
|
||||||
|
|
||||||
|
### 28. Delete Tag (`delete_tag`)
|
||||||
|
|
||||||
|
* **MCP Tool:** `delete_tag`
|
||||||
|
* **CLI Command:** `task-master delete-tag <tagName> [options]`
|
||||||
|
* **Description:** `Permanently delete a tag and all of its associated tasks.`
|
||||||
|
* **Key Parameters/Options:**
|
||||||
|
* `tagName`: `Name of the tag to delete.` (CLI: `<tagName>` positional)
|
||||||
|
* `--yes`: `Skip the confirmation prompt.` (CLI: `-y, --yes`)
|
||||||
|
|
||||||
|
### 29. Use Tag (`use_tag`)
|
||||||
|
|
||||||
|
* **MCP Tool:** `use_tag`
|
||||||
|
* **CLI Command:** `task-master use-tag <tagName>`
|
||||||
|
* **Description:** `Switch your active task context to a different tag.`
|
||||||
|
* **Key Parameters/Options:**
|
||||||
|
* `tagName`: `Name of the tag to switch to.` (CLI: `<tagName>` positional)
|
||||||
|
|
||||||
|
### 30. Rename Tag (`rename_tag`)
|
||||||
|
|
||||||
|
* **MCP Tool:** `rename_tag`
|
||||||
|
* **CLI Command:** `task-master rename-tag <oldName> <newName>`
|
||||||
|
* **Description:** `Rename an existing tag.`
|
||||||
|
* **Key Parameters/Options:**
|
||||||
|
* `oldName`: `The current name of the tag.` (CLI: `<oldName>` positional)
|
||||||
|
* `newName`: `The new name for the tag.` (CLI: `<newName>` positional)
|
||||||
|
|
||||||
|
### 31. Copy Tag (`copy_tag`)
|
||||||
|
|
||||||
|
* **MCP Tool:** `copy_tag`
|
||||||
|
* **CLI Command:** `task-master copy-tag <sourceName> <targetName> [options]`
|
||||||
|
* **Description:** `Copy an entire tag context, including all its tasks and metadata, to a new tag.`
|
||||||
|
* **Key Parameters/Options:**
|
||||||
|
* `sourceName`: `Name of the tag to copy from.` (CLI: `<sourceName>` positional)
|
||||||
|
* `targetName`: `Name of the new tag to create.` (CLI: `<targetName>` positional)
|
||||||
|
* `--description <text>`: `Optional description for the new tag.` (CLI: `-d, --description <text>`)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Miscellaneous
|
||||||
|
|
||||||
|
### 32. Sync Readme (`sync-readme`) -- experimental
|
||||||
|
|
||||||
|
* **MCP Tool:** N/A
|
||||||
|
* **CLI Command:** `task-master sync-readme [options]`
|
||||||
|
* **Description:** `Exports your task list to your project's README.md file, useful for showcasing progress.`
|
||||||
|
* **Key Parameters/Options:**
|
||||||
|
* `status`: `Filter tasks by status (e.g., 'pending', 'done').` (CLI: `-s, --status <status>`)
|
||||||
|
* `withSubtasks`: `Include subtasks in the export.` (CLI: `--with-subtasks`)
|
||||||
|
* `tag`: `Specify which tag context to export from. Defaults to the current active tag.` (CLI: `--tag <name>`)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Environment Variables Configuration (Updated)
|
||||||
|
|
||||||
|
Taskmaster primarily uses the **`.taskmaster/config.json`** file (in project root) for configuration (models, parameters, logging level, etc.), managed via `task-master models --setup`.
|
||||||
|
|
||||||
|
Environment variables are used **only** for sensitive API keys related to AI providers and specific overrides like the Ollama base URL:
|
||||||
|
|
||||||
|
* **API Keys (Required for corresponding provider):**
|
||||||
|
* `ANTHROPIC_API_KEY`
|
||||||
|
* `PERPLEXITY_API_KEY`
|
||||||
|
* `OPENAI_API_KEY`
|
||||||
|
* `GOOGLE_API_KEY`
|
||||||
|
* `MISTRAL_API_KEY`
|
||||||
|
* `AZURE_OPENAI_API_KEY` (Requires `AZURE_OPENAI_ENDPOINT` too)
|
||||||
|
* `OPENROUTER_API_KEY`
|
||||||
|
* `XAI_API_KEY`
|
||||||
|
* `OLLAMA_API_KEY` (Requires `OLLAMA_BASE_URL` too)
|
||||||
|
* **Endpoints (Optional/Provider Specific inside .taskmaster/config.json):**
|
||||||
|
* `AZURE_OPENAI_ENDPOINT`
|
||||||
|
* `OLLAMA_BASE_URL` (Default: `http://localhost:11434/api`)
|
||||||
|
|
||||||
|
**Set API keys** in your **`.env`** file in the project root (for CLI use) or within the `env` section of your **`.cursor/mcp.json`** file (for MCP/Cursor integration). All other settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in `.taskmaster/config.json` via `task-master models` command or `models` MCP tool.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
For details on how these commands fit into the development process, see the [Development Workflow Guide](mdc:.cursor/rules/dev_workflow.mdc).
|
||||||
|
|||||||
@@ -3,9 +3,19 @@ description: Guidelines for implementing task management operations
|
|||||||
globs: scripts/modules/task-manager.js
|
globs: scripts/modules/task-manager.js
|
||||||
alwaysApply: false
|
alwaysApply: false
|
||||||
---
|
---
|
||||||
|
|
||||||
# Task Management Guidelines
|
# Task Management Guidelines
|
||||||
|
|
||||||
|
## Tagged Task Lists System
|
||||||
|
|
||||||
|
Task Master now uses a **tagged task lists system** for multi-context task management:
|
||||||
|
|
||||||
|
- **Data Structure**: Tasks are organized into separate contexts (tags) within `tasks.json`
|
||||||
|
- **Legacy Format**: `{"tasks": [...]}`
|
||||||
|
- **Tagged Format**: `{"master": {"tasks": [...]}, "feature-branch": {"tasks": [...]}}`
|
||||||
|
- **Silent Migration**: Legacy format automatically converts to tagged format on first use
|
||||||
|
- **Tag Resolution**: Core functions receive legacy format for 100% backward compatibility
|
||||||
|
- **Default Tag**: "master" is used for all existing and new tasks unless otherwise specified
|
||||||
|
|
||||||
## Task Structure Standards
|
## Task Structure Standards
|
||||||
|
|
||||||
- **Core Task Properties**:
|
- **Core Task Properties**:
|
||||||
@@ -28,6 +38,25 @@ alwaysApply: false
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- **Tagged Data Structure**:
|
||||||
|
- ✅ DO: Access tasks through tag resolution layer
|
||||||
|
- ✅ DO: Use `getTasksForTag(data, tagName)` to retrieve tasks for a specific tag
|
||||||
|
- ✅ DO: Use `setTasksForTag(data, tagName, tasks)` to update tasks for a specific tag
|
||||||
|
- ❌ DON'T: Directly manipulate the tagged structure in core functions
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Use tag resolution functions
|
||||||
|
const tasksData = readJSON(tasksPath);
|
||||||
|
const currentTag = getCurrentTag() || 'master';
|
||||||
|
const tasks = getTasksForTag(tasksData, currentTag);
|
||||||
|
|
||||||
|
// Manipulate tasks as normal...
|
||||||
|
|
||||||
|
// Save back to the tagged structure
|
||||||
|
setTasksForTag(tasksData, currentTag, tasks);
|
||||||
|
writeJSON(tasksPath, tasksData);
|
||||||
|
```
|
||||||
|
|
||||||
- **Subtask Structure**:
|
- **Subtask Structure**:
|
||||||
- ✅ DO: Use consistent properties across subtasks
|
- ✅ DO: Use consistent properties across subtasks
|
||||||
- ✅ DO: Maintain simple numeric IDs within parent tasks
|
- ✅ DO: Maintain simple numeric IDs within parent tasks
|
||||||
@@ -48,53 +77,56 @@ alwaysApply: false
|
|||||||
## Task Creation and Parsing
|
## Task Creation and Parsing
|
||||||
|
|
||||||
- **ID Management**:
|
- **ID Management**:
|
||||||
- ✅ DO: Assign unique sequential IDs to tasks
|
- ✅ DO: Assign unique sequential IDs to tasks within each tag context
|
||||||
- ✅ DO: Calculate the next ID based on existing tasks
|
- ✅ DO: Calculate the next ID based on existing tasks in the current tag
|
||||||
- ❌ DON'T: Hardcode or reuse IDs
|
- ❌ DON'T: Hardcode or reuse IDs within the same tag
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Calculate the next available ID
|
// ✅ DO: Calculate the next available ID within the current tag
|
||||||
const highestId = Math.max(...data.tasks.map(t => t.id));
|
const tasksData = readJSON(tasksPath);
|
||||||
|
const currentTag = getCurrentTag() || 'master';
|
||||||
|
const tasks = getTasksForTag(tasksData, currentTag);
|
||||||
|
const highestId = Math.max(...tasks.map(t => t.id));
|
||||||
const nextTaskId = highestId + 1;
|
const nextTaskId = highestId + 1;
|
||||||
```
|
```
|
||||||
|
|
||||||
- **PRD Parsing**:
|
- **PRD Parsing**:
|
||||||
- ✅ DO: Extract tasks from PRD documents using AI
|
- ✅ DO: Extract tasks from PRD documents using AI
|
||||||
|
- ✅ DO: Create tasks in the current tag context (defaults to "master")
|
||||||
- ✅ DO: Provide clear prompts to guide AI task generation
|
- ✅ DO: Provide clear prompts to guide AI task generation
|
||||||
- ✅ DO: Validate and clean up AI-generated tasks
|
- ✅ DO: Validate and clean up AI-generated tasks
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Validate AI responses
|
// ✅ DO: Parse into current tag context
|
||||||
try {
|
const tasksData = readJSON(tasksPath) || {};
|
||||||
// Parse the JSON response
|
const currentTag = getCurrentTag() || 'master';
|
||||||
taskData = JSON.parse(jsonContent);
|
|
||||||
|
|
||||||
// Check that we have the required fields
|
// Parse tasks and add to current tag
|
||||||
if (!taskData.title || !taskData.description) {
|
const newTasks = await parseTasksFromPRD(prdContent);
|
||||||
throw new Error("Missing required fields in the generated task");
|
setTasksForTag(tasksData, currentTag, newTasks);
|
||||||
}
|
writeJSON(tasksPath, tasksData);
|
||||||
} catch (error) {
|
|
||||||
log('error', "Failed to parse AI's response as valid task JSON:", error);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Task Updates and Modifications
|
## Task Updates and Modifications
|
||||||
|
|
||||||
- **Status Management**:
|
- **Status Management**:
|
||||||
- ✅ DO: Provide functions for updating task status
|
- ✅ DO: Provide functions for updating task status within current tag context
|
||||||
- ✅ DO: Handle both individual tasks and subtasks
|
- ✅ DO: Handle both individual tasks and subtasks
|
||||||
- ✅ DO: Consider subtask status when updating parent tasks
|
- ✅ DO: Consider subtask status when updating parent tasks
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Handle status updates for both tasks and subtasks
|
// ✅ DO: Handle status updates within tagged context
|
||||||
async function setTaskStatus(tasksPath, taskIdInput, newStatus) {
|
async function setTaskStatus(tasksPath, taskIdInput, newStatus) {
|
||||||
|
const tasksData = readJSON(tasksPath);
|
||||||
|
const currentTag = getCurrentTag() || 'master';
|
||||||
|
const tasks = getTasksForTag(tasksData, currentTag);
|
||||||
|
|
||||||
// Check if it's a subtask (e.g., "1.2")
|
// Check if it's a subtask (e.g., "1.2")
|
||||||
if (taskIdInput.includes('.')) {
|
if (taskIdInput.includes('.')) {
|
||||||
const [parentId, subtaskId] = taskIdInput.split('.').map(id => parseInt(id, 10));
|
const [parentId, subtaskId] = taskIdInput.split('.').map(id => parseInt(id, 10));
|
||||||
|
|
||||||
// Find the parent task and subtask
|
// Find the parent task and subtask
|
||||||
const parentTask = data.tasks.find(t => t.id === parentId);
|
const parentTask = tasks.find(t => t.id === parentId);
|
||||||
const subtask = parentTask.subtasks.find(st => st.id === subtaskId);
|
const subtask = parentTask.subtasks.find(st => st.id === subtaskId);
|
||||||
|
|
||||||
// Update subtask status
|
// Update subtask status
|
||||||
@@ -109,7 +141,7 @@ alwaysApply: false
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Handle regular task
|
// Handle regular task
|
||||||
const task = data.tasks.find(t => t.id === parseInt(taskIdInput, 10));
|
const task = tasks.find(t => t.id === parseInt(taskIdInput, 10));
|
||||||
task.status = newStatus;
|
task.status = newStatus;
|
||||||
|
|
||||||
// If marking as done, also mark subtasks
|
// If marking as done, also mark subtasks
|
||||||
@@ -119,16 +151,24 @@ alwaysApply: false
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save updated tasks back to tagged structure
|
||||||
|
setTasksForTag(tasksData, currentTag, tasks);
|
||||||
|
writeJSON(tasksPath, tasksData);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Task Expansion**:
|
- **Task Expansion**:
|
||||||
- ✅ DO: Use AI to generate detailed subtasks
|
- ✅ DO: Use AI to generate detailed subtasks within current tag context
|
||||||
- ✅ DO: Consider complexity analysis for subtask counts
|
- ✅ DO: Consider complexity analysis for subtask counts
|
||||||
- ✅ DO: Ensure proper IDs for newly created subtasks
|
- ✅ DO: Ensure proper IDs for newly created subtasks
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Generate appropriate subtasks based on complexity
|
// ✅ DO: Generate appropriate subtasks based on complexity
|
||||||
|
const tasksData = readJSON(tasksPath);
|
||||||
|
const currentTag = getCurrentTag() || 'master';
|
||||||
|
const tasks = getTasksForTag(tasksData, currentTag);
|
||||||
|
|
||||||
if (taskAnalysis) {
|
if (taskAnalysis) {
|
||||||
log('info', `Found complexity analysis for task ${taskId}: Score ${taskAnalysis.complexityScore}/10`);
|
log('info', `Found complexity analysis for task ${taskId}: Score ${taskAnalysis.complexityScore}/10`);
|
||||||
|
|
||||||
@@ -138,6 +178,11 @@ alwaysApply: false
|
|||||||
log('info', `Using recommended number of subtasks: ${numSubtasks}`);
|
log('info', `Using recommended number of subtasks: ${numSubtasks}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate subtasks and save back
|
||||||
|
// ... subtask generation logic ...
|
||||||
|
setTasksForTag(tasksData, currentTag, tasks);
|
||||||
|
writeJSON(tasksPath, tasksData);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Task File Generation
|
## Task File Generation
|
||||||
@@ -155,67 +200,65 @@ alwaysApply: false
|
|||||||
|
|
||||||
// Format dependencies with their status
|
// Format dependencies with their status
|
||||||
if (task.dependencies && task.dependencies.length > 0) {
|
if (task.dependencies && task.dependencies.length > 0) {
|
||||||
content += `# Dependencies: ${formatDependenciesWithStatus(task.dependencies, data.tasks)}\n`;
|
content += `# Dependencies: ${formatDependenciesWithStatus(task.dependencies, tasks)}\n`;
|
||||||
} else {
|
} else {
|
||||||
content += '# Dependencies: None\n';
|
content += '# Dependencies: None\n';
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Subtask Inclusion**:
|
- **Tagged Context Awareness**:
|
||||||
- ✅ DO: Include subtasks in parent task files
|
- ✅ DO: Generate task files from current tag context
|
||||||
- ✅ DO: Use consistent indentation for subtask sections
|
- ✅ DO: Include tag information in generated files
|
||||||
- ✅ DO: Display subtask dependencies with proper formatting
|
- ❌ DON'T: Mix tasks from different tags in file generation
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Format subtasks correctly in task files
|
// ✅ DO: Generate files for current tag context
|
||||||
if (task.subtasks && task.subtasks.length > 0) {
|
async function generateTaskFiles(tasksPath, outputDir) {
|
||||||
content += '\n# Subtasks:\n';
|
const tasksData = readJSON(tasksPath);
|
||||||
|
const currentTag = getCurrentTag() || 'master';
|
||||||
|
const tasks = getTasksForTag(tasksData, currentTag);
|
||||||
|
|
||||||
task.subtasks.forEach(subtask => {
|
// Add tag context to file header
|
||||||
content += `## ${subtask.id}. ${subtask.title} [${subtask.status || 'pending'}]\n`;
|
let content = `# Tag Context: ${currentTag}\n`;
|
||||||
|
content += `# Task ID: ${task.id}\n`;
|
||||||
// Format subtask dependencies
|
// ... rest of file generation
|
||||||
if (subtask.dependencies && subtask.dependencies.length > 0) {
|
|
||||||
// Format the dependencies
|
|
||||||
content += `### Dependencies: ${formattedDeps}\n`;
|
|
||||||
} else {
|
|
||||||
content += '### Dependencies: None\n';
|
|
||||||
}
|
|
||||||
|
|
||||||
content += `### Description: ${subtask.description || ''}\n`;
|
|
||||||
content += '### Details:\n';
|
|
||||||
content += (subtask.details || '').split('\n').map(line => line).join('\n');
|
|
||||||
content += '\n\n';
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Task Listing and Display
|
## Task Listing and Display
|
||||||
|
|
||||||
- **Filtering and Organization**:
|
- **Filtering and Organization**:
|
||||||
- ✅ DO: Allow filtering tasks by status
|
- ✅ DO: Allow filtering tasks by status within current tag context
|
||||||
- ✅ DO: Handle subtask display in lists
|
- ✅ DO: Handle subtask display in lists
|
||||||
- ✅ DO: Use consistent table formats
|
- ✅ DO: Use consistent table formats
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Implement clear filtering and organization
|
// ✅ DO: Implement clear filtering within tag context
|
||||||
|
const tasksData = readJSON(tasksPath);
|
||||||
|
const currentTag = getCurrentTag() || 'master';
|
||||||
|
const tasks = getTasksForTag(tasksData, currentTag);
|
||||||
|
|
||||||
// Filter tasks by status if specified
|
// Filter tasks by status if specified
|
||||||
const filteredTasks = statusFilter
|
const filteredTasks = statusFilter
|
||||||
? data.tasks.filter(task =>
|
? tasks.filter(task =>
|
||||||
task.status && task.status.toLowerCase() === statusFilter.toLowerCase())
|
task.status && task.status.toLowerCase() === statusFilter.toLowerCase())
|
||||||
: data.tasks;
|
: tasks;
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Progress Tracking**:
|
- **Progress Tracking**:
|
||||||
- ✅ DO: Calculate and display completion statistics
|
- ✅ DO: Calculate and display completion statistics for current tag
|
||||||
- ✅ DO: Track both task and subtask completion
|
- ✅ DO: Track both task and subtask completion
|
||||||
- ✅ DO: Use visual progress indicators
|
- ✅ DO: Use visual progress indicators
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Track and display progress
|
// ✅ DO: Track and display progress within tag context
|
||||||
|
const tasksData = readJSON(tasksPath);
|
||||||
|
const currentTag = getCurrentTag() || 'master';
|
||||||
|
const tasks = getTasksForTag(tasksData, currentTag);
|
||||||
|
|
||||||
// Calculate completion statistics
|
// Calculate completion statistics
|
||||||
const totalTasks = data.tasks.length;
|
const totalTasks = tasks.length;
|
||||||
const completedTasks = data.tasks.filter(task =>
|
const completedTasks = tasks.filter(task =>
|
||||||
task.status === 'done' || task.status === 'completed').length;
|
task.status === 'done' || task.status === 'completed').length;
|
||||||
const completionPercentage = totalTasks > 0 ? (completedTasks / totalTasks) * 100 : 0;
|
const completionPercentage = totalTasks > 0 ? (completedTasks / totalTasks) * 100 : 0;
|
||||||
|
|
||||||
@@ -223,7 +266,7 @@ alwaysApply: false
|
|||||||
let totalSubtasks = 0;
|
let totalSubtasks = 0;
|
||||||
let completedSubtasks = 0;
|
let completedSubtasks = 0;
|
||||||
|
|
||||||
data.tasks.forEach(task => {
|
tasks.forEach(task => {
|
||||||
if (task.subtasks && task.subtasks.length > 0) {
|
if (task.subtasks && task.subtasks.length > 0) {
|
||||||
totalSubtasks += task.subtasks.length;
|
totalSubtasks += task.subtasks.length;
|
||||||
completedSubtasks += task.subtasks.filter(st =>
|
completedSubtasks += task.subtasks.filter(st =>
|
||||||
@@ -232,99 +275,52 @@ alwaysApply: false
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## Complexity Analysis
|
## Migration and Compatibility
|
||||||
|
|
||||||
- **Scoring System**:
|
- **Silent Migration Handling**:
|
||||||
- ✅ DO: Use AI to analyze task complexity
|
- ✅ DO: Implement silent migration in `readJSON()` function
|
||||||
- ✅ DO: Include complexity scores (1-10)
|
- ✅ DO: Detect legacy format and convert automatically
|
||||||
- ✅ DO: Generate specific expansion recommendations
|
- ✅ DO: Preserve all existing task data during migration
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Handle complexity analysis properly
|
// ✅ DO: Handle silent migration (implemented in utils.js)
|
||||||
const report = {
|
function readJSON(filepath) {
|
||||||
meta: {
|
let data = JSON.parse(fs.readFileSync(filepath, 'utf8'));
|
||||||
generatedAt: new Date().toISOString(),
|
|
||||||
tasksAnalyzed: tasksData.tasks.length,
|
// Silent migration for tasks.json files
|
||||||
thresholdScore: thresholdScore,
|
if (data.tasks && Array.isArray(data.tasks) && !data.master && isTasksFile) {
|
||||||
projectName: tasksData.meta?.projectName || 'Your Project Name',
|
const migratedData = {
|
||||||
usedResearch: useResearch
|
master: {
|
||||||
},
|
tasks: data.tasks
|
||||||
complexityAnalysis: complexityAnalysis
|
}
|
||||||
};
|
};
|
||||||
```
|
writeJSON(filepath, migratedData);
|
||||||
|
data = migratedData;
|
||||||
|
}
|
||||||
|
|
||||||
- **Analysis-Based Workflow**:
|
return data;
|
||||||
- ✅ DO: Use complexity reports to guide task expansion
|
|
||||||
- ✅ DO: Prioritize complex tasks for more detailed breakdown
|
|
||||||
- ✅ DO: Use expansion prompts from complexity analysis
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// ✅ DO: Apply complexity analysis to workflow
|
|
||||||
// Sort tasks by complexity if report exists, otherwise by ID
|
|
||||||
if (complexityReport && complexityReport.complexityAnalysis) {
|
|
||||||
log('info', 'Sorting tasks by complexity...');
|
|
||||||
|
|
||||||
// Create a map of task IDs to complexity scores
|
|
||||||
const complexityMap = new Map();
|
|
||||||
complexityReport.complexityAnalysis.forEach(analysis => {
|
|
||||||
complexityMap.set(analysis.taskId, analysis.complexityScore);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Sort tasks by complexity score (high to low)
|
|
||||||
tasksToExpand.sort((a, b) => {
|
|
||||||
const scoreA = complexityMap.get(a.id) || 0;
|
|
||||||
const scoreB = complexityMap.get(b.id) || 0;
|
|
||||||
return scoreB - scoreA;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Next Task Selection
|
- **Tag Resolution**:
|
||||||
|
- ✅ DO: Use tag resolution functions to maintain backward compatibility
|
||||||
- **Eligibility Criteria**:
|
- ✅ DO: Return legacy format to core functions
|
||||||
- ✅ DO: Consider dependencies when finding next tasks
|
- ❌ DON'T: Expose tagged structure to existing core logic
|
||||||
- ✅ DO: Prioritize by task priority and dependency count
|
|
||||||
- ✅ DO: Skip completed tasks
|
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// ✅ DO: Use proper task prioritization logic
|
// ✅ DO: Use tag resolution layer
|
||||||
function findNextTask(tasks) {
|
function getTasksForTag(data, tagName) {
|
||||||
// Get all completed task IDs
|
if (data.tasks && Array.isArray(data.tasks)) {
|
||||||
const completedTaskIds = new Set(
|
// Legacy format - return as-is
|
||||||
tasks
|
return data.tasks;
|
||||||
.filter(t => t.status === 'done' || t.status === 'completed')
|
|
||||||
.map(t => t.id)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Filter for pending tasks whose dependencies are all satisfied
|
|
||||||
const eligibleTasks = tasks.filter(task =>
|
|
||||||
(task.status === 'pending' || task.status === 'in-progress') &&
|
|
||||||
task.dependencies &&
|
|
||||||
task.dependencies.every(depId => completedTaskIds.has(depId))
|
|
||||||
);
|
|
||||||
|
|
||||||
// Sort by priority, dependency count, and ID
|
|
||||||
const priorityValues = { 'high': 3, 'medium': 2, 'low': 1 };
|
|
||||||
|
|
||||||
const nextTask = eligibleTasks.sort((a, b) => {
|
|
||||||
// Priority first
|
|
||||||
const priorityA = priorityValues[a.priority || 'medium'] || 2;
|
|
||||||
const priorityB = priorityValues[b.priority || 'medium'] || 2;
|
|
||||||
|
|
||||||
if (priorityB !== priorityA) {
|
|
||||||
return priorityB - priorityA; // Higher priority first
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dependency count next
|
if (data[tagName] && data[tagName].tasks) {
|
||||||
if (a.dependencies.length !== b.dependencies.length) {
|
// Tagged format - return tasks for specified tag
|
||||||
return a.dependencies.length - b.dependencies.length; // Fewer dependencies first
|
return data[tagName].tasks;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ID last
|
return [];
|
||||||
return a.id - b.id; // Lower ID first
|
|
||||||
})[0];
|
|
||||||
|
|
||||||
return nextTask;
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
228
.cursor/rules/telemetry.mdc
Normal file
228
.cursor/rules/telemetry.mdc
Normal file
@@ -0,0 +1,228 @@
|
|||||||
|
---
|
||||||
|
description: Guidelines for integrating AI usage telemetry across Task Master.
|
||||||
|
globs: scripts/modules/**/*.js,mcp-server/src/**/*.js
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# AI Usage Telemetry Integration
|
||||||
|
|
||||||
|
This document outlines the standard pattern for capturing, propagating, and handling AI usage telemetry data (cost, tokens, model, etc.) across the Task Master stack. This ensures consistent telemetry for both CLI and MCP interactions.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Telemetry data is generated within the unified AI service layer ([`ai-services-unified.js`](mdc:scripts/modules/ai-services-unified.js)) and then passed upwards through the calling functions.
|
||||||
|
|
||||||
|
- **Data Source**: [`ai-services-unified.js`](mdc:scripts/modules/ai-services-unified.js) (specifically its `generateTextService`, `generateObjectService`, etc.) returns an object like `{ mainResult: AI_CALL_OUTPUT, telemetryData: TELEMETRY_OBJECT }`.
|
||||||
|
- **`telemetryData` Object Structure**:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"timestamp": "ISO_STRING_DATE",
|
||||||
|
"userId": "USER_ID_FROM_CONFIG",
|
||||||
|
"commandName": "invoking_command_or_tool_name",
|
||||||
|
"modelUsed": "ai_model_id",
|
||||||
|
"providerName": "ai_provider_name",
|
||||||
|
"inputTokens": NUMBER,
|
||||||
|
"outputTokens": NUMBER,
|
||||||
|
"totalTokens": NUMBER,
|
||||||
|
"totalCost": NUMBER, // e.g., 0.012414
|
||||||
|
"currency": "USD" // e.g., "USD"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Integration Pattern by Layer
|
||||||
|
|
||||||
|
The key principle is that each layer receives telemetry data from the layer below it (if applicable) and passes it to the layer above it, or handles it for display in the case of the CLI.
|
||||||
|
|
||||||
|
### 1. Core Logic Functions (e.g., in `scripts/modules/task-manager/`)
|
||||||
|
|
||||||
|
Functions in this layer that invoke AI services are responsible for handling the `telemetryData` they receive from [`ai-services-unified.js`](mdc:scripts/modules/ai-services-unified.js).
|
||||||
|
|
||||||
|
- **Actions**:
|
||||||
|
1. Call the appropriate AI service function (e.g., `generateObjectService`).
|
||||||
|
- Pass `commandName` (e.g., `add-task`, `expand-task`) and `outputType` (e.g., `cli` or `mcp`) in the `params` object to the AI service. The `outputType` can be derived from context (e.g., presence of `mcpLog`).
|
||||||
|
2. The AI service returns an object, e.g., `aiServiceResponse = { mainResult: {/*AI output*/}, telemetryData: {/*telemetry data*/} }`.
|
||||||
|
3. Extract `aiServiceResponse.mainResult` for the core processing.
|
||||||
|
4. **Must return an object that includes `aiServiceResponse.telemetryData`**.
|
||||||
|
Example: `return { operationSpecificData: /*...*/, telemetryData: aiServiceResponse.telemetryData };`
|
||||||
|
|
||||||
|
- **CLI Output Handling (If Applicable)**:
|
||||||
|
- If the core function also handles CLI output (e.g., it has an `outputFormat` parameter that can be `'text'` or `'cli'`):
|
||||||
|
1. Check if `outputFormat === 'text'` (or `'cli'`).
|
||||||
|
2. If so, and if `aiServiceResponse.telemetryData` is available, call `displayAiUsageSummary(aiServiceResponse.telemetryData, 'cli')` from [`scripts/modules/ui.js`](mdc:scripts/modules/ui.js).
|
||||||
|
- This ensures telemetry is displayed directly to CLI users after the main command output.
|
||||||
|
|
||||||
|
- **Example Snippet (Core Logic in `scripts/modules/task-manager/someAiAction.js`)**:
|
||||||
|
```javascript
|
||||||
|
import { generateObjectService } from '../ai-services-unified.js';
|
||||||
|
import { displayAiUsageSummary } from '../ui.js';
|
||||||
|
|
||||||
|
async function performAiRelatedAction(params, context, outputFormat = 'text') {
|
||||||
|
const { commandNameFromContext, /* other context vars */ } = context;
|
||||||
|
let aiServiceResponse = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
aiServiceResponse = await generateObjectService({
|
||||||
|
// ... other parameters for AI service ...
|
||||||
|
commandName: commandNameFromContext || 'default-action-name',
|
||||||
|
outputType: context.mcpLog ? 'mcp' : 'cli' // Derive outputType
|
||||||
|
});
|
||||||
|
|
||||||
|
const usefulAiOutput = aiServiceResponse.mainResult.object;
|
||||||
|
// ... do work with usefulAiOutput ...
|
||||||
|
|
||||||
|
if (outputFormat === 'text' && aiServiceResponse.telemetryData) {
|
||||||
|
displayAiUsageSummary(aiServiceResponse.telemetryData, 'cli');
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
actionData: /* results of processing */,
|
||||||
|
telemetryData: aiServiceResponse.telemetryData
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
// ... handle error ...
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Direct Function Wrappers (in `mcp-server/src/core/direct-functions/`)
|
||||||
|
|
||||||
|
These functions adapt core logic for the MCP server, ensuring structured responses.
|
||||||
|
|
||||||
|
- **Actions**:
|
||||||
|
1. Call the corresponding core logic function.
|
||||||
|
- Pass necessary context (e.g., `session`, `mcpLog`, `projectRoot`).
|
||||||
|
- Provide the `commandName` (typically derived from the MCP tool name) and `outputType: 'mcp'` in the context object passed to the core function.
|
||||||
|
- If the core function supports an `outputFormat` parameter, pass `'json'` to suppress CLI-specific UI.
|
||||||
|
2. The core logic function returns an object (e.g., `coreResult = { actionData: ..., telemetryData: ... }`).
|
||||||
|
3. Include `coreResult.telemetryData` as a field within the `data` object of the successful response returned by the direct function.
|
||||||
|
|
||||||
|
- **Example Snippet (Direct Function `someAiActionDirect.js`)**:
|
||||||
|
```javascript
|
||||||
|
import { performAiRelatedAction } from '../../../../scripts/modules/task-manager/someAiAction.js'; // Core function
|
||||||
|
import { createLogWrapper } from '../../tools/utils.js'; // MCP Log wrapper
|
||||||
|
|
||||||
|
export async function someAiActionDirect(args, log, context = {}) {
|
||||||
|
const { session } = context;
|
||||||
|
// ... prepare arguments for core function from args, including args.projectRoot ...
|
||||||
|
|
||||||
|
try {
|
||||||
|
const coreResult = await performAiRelatedAction(
|
||||||
|
{ /* parameters for core function */ },
|
||||||
|
{ // Context for core function
|
||||||
|
session,
|
||||||
|
mcpLog: createLogWrapper(log),
|
||||||
|
projectRoot: args.projectRoot,
|
||||||
|
commandNameFromContext: 'mcp_tool_some_ai_action', // Example command name
|
||||||
|
outputType: 'mcp'
|
||||||
|
},
|
||||||
|
'json' // Request 'json' output format from core function
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
data: {
|
||||||
|
operationSpecificData: coreResult.actionData,
|
||||||
|
telemetryData: coreResult.telemetryData // Pass telemetry through
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
// ... error handling, return { success: false, error: ... } ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. MCP Tools (in `mcp-server/src/tools/`)
|
||||||
|
|
||||||
|
These are the exposed endpoints for MCP clients.
|
||||||
|
|
||||||
|
- **Actions**:
|
||||||
|
1. Call the corresponding direct function wrapper.
|
||||||
|
2. The direct function returns an object structured like `{ success: true, data: { operationSpecificData: ..., telemetryData: ... } }` (or an error object).
|
||||||
|
3. Pass this entire result object to `handleApiResult(result, log)` from [`mcp-server/src/tools/utils.js`](mdc:mcp-server/src/tools/utils.js).
|
||||||
|
4. `handleApiResult` ensures that the `data` field from the direct function's response (which correctly includes `telemetryData`) is part of the final MCP response.
|
||||||
|
|
||||||
|
- **Example Snippet (MCP Tool `some_ai_action.js`)**:
|
||||||
|
```javascript
|
||||||
|
import { someAiActionDirect } from '../core/task-master-core.js';
|
||||||
|
import { handleApiResult, withNormalizedProjectRoot } from './utils.js';
|
||||||
|
// ... zod for parameters ...
|
||||||
|
|
||||||
|
export function registerSomeAiActionTool(server) {
|
||||||
|
server.addTool({
|
||||||
|
name: "some_ai_action",
|
||||||
|
// ... description, parameters ...
|
||||||
|
execute: withNormalizedProjectRoot(async (args, { log, session }) => {
|
||||||
|
try {
|
||||||
|
const resultFromDirectFunction = await someAiActionDirect(
|
||||||
|
{ /* args including projectRoot */ },
|
||||||
|
log,
|
||||||
|
{ session }
|
||||||
|
);
|
||||||
|
return handleApiResult(resultFromDirectFunction, log); // This passes the nested telemetryData through
|
||||||
|
} catch (error) {
|
||||||
|
// ... error handling ...
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. CLI Commands (`scripts/modules/commands.js`)
|
||||||
|
|
||||||
|
These define the command-line interface.
|
||||||
|
|
||||||
|
- **Actions**:
|
||||||
|
1. Call the appropriate core logic function.
|
||||||
|
2. Pass `outputFormat: 'text'` (or ensure the core function defaults to text-based output for CLI).
|
||||||
|
3. The core logic function (as per Section 1) is responsible for calling `displayAiUsageSummary` if telemetry data is available and it's in CLI mode.
|
||||||
|
4. The command action itself **should not** call `displayAiUsageSummary` if the core logic function already handles this. This avoids duplicate display.
|
||||||
|
|
||||||
|
- **Example Snippet (CLI Command in `commands.js`)**:
|
||||||
|
```javascript
|
||||||
|
// In scripts/modules/commands.js
|
||||||
|
import { performAiRelatedAction } from './task-manager/someAiAction.js'; // Core function
|
||||||
|
|
||||||
|
programInstance
|
||||||
|
.command('some-cli-ai-action')
|
||||||
|
// ... .option() ...
|
||||||
|
.action(async (options) => {
|
||||||
|
try {
|
||||||
|
const projectRoot = findProjectRoot() || '.'; // Example root finding
|
||||||
|
// ... prepare parameters for core function from command options ...
|
||||||
|
await performAiRelatedAction(
|
||||||
|
{ /* parameters for core function */ },
|
||||||
|
{ // Context for core function
|
||||||
|
projectRoot,
|
||||||
|
commandNameFromContext: 'some-cli-ai-action',
|
||||||
|
outputType: 'cli'
|
||||||
|
},
|
||||||
|
'text' // Explicitly request text output format for CLI
|
||||||
|
);
|
||||||
|
// Core function handles displayAiUsageSummary internally for 'text' outputFormat
|
||||||
|
} catch (error) {
|
||||||
|
// ... error handling ...
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## Summary Flow
|
||||||
|
|
||||||
|
The telemetry data flows as follows:
|
||||||
|
|
||||||
|
1. **[`ai-services-unified.js`](mdc:scripts/modules/ai-services-unified.js)**: Generates `telemetryData` and returns `{ mainResult, telemetryData }`.
|
||||||
|
2. **Core Logic Function**:
|
||||||
|
* Receives `{ mainResult, telemetryData }`.
|
||||||
|
* Uses `mainResult`.
|
||||||
|
* If CLI (`outputFormat: 'text'`), calls `displayAiUsageSummary(telemetryData)`.
|
||||||
|
* Returns `{ operationSpecificData, telemetryData }`.
|
||||||
|
3. **Direct Function Wrapper**:
|
||||||
|
* Receives `{ operationSpecificData, telemetryData }` from core logic.
|
||||||
|
* Returns `{ success: true, data: { operationSpecificData, telemetryData } }`.
|
||||||
|
4. **MCP Tool**:
|
||||||
|
* Receives direct function response.
|
||||||
|
* `handleApiResult` ensures the final MCP response to the client is `{ success: true, data: { operationSpecificData, telemetryData } }`.
|
||||||
|
5. **CLI Command**:
|
||||||
|
* Calls core logic with `outputFormat: 'text'`. Display is handled by core logic.
|
||||||
|
|
||||||
|
This pattern ensures telemetry is captured and appropriately handled/exposed across all interaction modes.
|
||||||
@@ -5,6 +5,8 @@ globs: "**/*.test.js,tests/**/*"
|
|||||||
|
|
||||||
# Testing Guidelines for Task Master CLI
|
# Testing Guidelines for Task Master CLI
|
||||||
|
|
||||||
|
*Note:* Never use asynchronous operations in tests. Always mock tests properly based on the way the tested functions are defined and used. Do not arbitrarily create tests. Based them on the low-level details and execution of the underlying code being tested.
|
||||||
|
|
||||||
## Test Organization Structure
|
## Test Organization Structure
|
||||||
|
|
||||||
- **Unit Tests** (See [`architecture.mdc`](mdc:.cursor/rules/architecture.mdc) for module breakdown)
|
- **Unit Tests** (See [`architecture.mdc`](mdc:.cursor/rules/architecture.mdc) for module breakdown)
|
||||||
@@ -88,6 +90,122 @@ describe('Feature or Function Name', () => {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Commander.js Command Testing Best Practices
|
||||||
|
|
||||||
|
When testing CLI commands built with Commander.js, several special considerations must be made to avoid common pitfalls:
|
||||||
|
|
||||||
|
- **Direct Action Handler Testing**
|
||||||
|
- ✅ **DO**: Test the command action handlers directly rather than trying to mock the entire Commander.js chain
|
||||||
|
- ✅ **DO**: Create simplified test-specific implementations of command handlers that match the original behavior
|
||||||
|
- ✅ **DO**: Explicitly handle all options, including defaults and shorthand flags (e.g., `-p` for `--prompt`)
|
||||||
|
- ✅ **DO**: Include null/undefined checks in test implementations for parameters that might be optional
|
||||||
|
- ✅ **DO**: Use fixtures from `tests/fixtures/` for consistent sample data across tests
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Create a simplified test version of the command handler
|
||||||
|
const testAddTaskAction = async (options) => {
|
||||||
|
options = options || {}; // Ensure options aren't undefined
|
||||||
|
|
||||||
|
// Validate parameters
|
||||||
|
const isManualCreation = options.title && options.description;
|
||||||
|
const prompt = options.prompt || options.p; // Handle shorthand flags
|
||||||
|
|
||||||
|
if (!prompt && !isManualCreation) {
|
||||||
|
throw new Error('Expected error message');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call the mocked task manager
|
||||||
|
return mockTaskManager.addTask(/* parameters */);
|
||||||
|
};
|
||||||
|
|
||||||
|
test('should handle required parameters correctly', async () => {
|
||||||
|
// Call the test implementation directly
|
||||||
|
await expect(async () => {
|
||||||
|
await testAddTaskAction({ file: 'tasks.json' });
|
||||||
|
}).rejects.toThrow('Expected error message');
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Commander Chain Mocking (If Necessary)**
|
||||||
|
- ✅ **DO**: Mock ALL chainable methods (`option`, `argument`, `action`, `on`, etc.)
|
||||||
|
- ✅ **DO**: Return `this` (or the mock object) from all chainable method mocks
|
||||||
|
- ✅ **DO**: Remember to mock not only the initial object but also all objects returned by methods
|
||||||
|
- ✅ **DO**: Implement a mechanism to capture the action handler for direct testing
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// If you must mock the Commander.js chain:
|
||||||
|
const mockCommand = {
|
||||||
|
command: jest.fn().mockReturnThis(),
|
||||||
|
description: jest.fn().mockReturnThis(),
|
||||||
|
option: jest.fn().mockReturnThis(),
|
||||||
|
argument: jest.fn().mockReturnThis(), // Don't forget this one
|
||||||
|
action: jest.fn(fn => {
|
||||||
|
actionHandler = fn; // Capture the handler for testing
|
||||||
|
return mockCommand;
|
||||||
|
}),
|
||||||
|
on: jest.fn().mockReturnThis() // Don't forget this one
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Parameter Handling**
|
||||||
|
- ✅ **DO**: Check for both main flag and shorthand flags (e.g., `prompt` and `p`)
|
||||||
|
- ✅ **DO**: Handle parameters like Commander would (comma-separated lists, etc.)
|
||||||
|
- ✅ **DO**: Set proper default values as defined in the command
|
||||||
|
- ✅ **DO**: Validate that required parameters are actually required in tests
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Parse dependencies like Commander would
|
||||||
|
const dependencies = options.dependencies
|
||||||
|
? options.dependencies.split(',').map(id => id.trim())
|
||||||
|
: [];
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Environment and Session Handling**
|
||||||
|
- ✅ **DO**: Properly mock session objects when required by functions
|
||||||
|
- ✅ **DO**: Reset environment variables between tests if modified
|
||||||
|
- ✅ **DO**: Use a consistent pattern for environment-dependent tests
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Session parameter mock pattern
|
||||||
|
const sessionMock = { session: process.env };
|
||||||
|
|
||||||
|
// In test:
|
||||||
|
expect(mockAddTask).toHaveBeenCalledWith(
|
||||||
|
expect.any(String),
|
||||||
|
'Test prompt',
|
||||||
|
[],
|
||||||
|
'medium',
|
||||||
|
sessionMock,
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Common Pitfalls to Avoid**
|
||||||
|
- ❌ **DON'T**: Try to use the real action implementation without proper mocking
|
||||||
|
- ❌ **DON'T**: Mock Commander partially - either mock it completely or test the action directly
|
||||||
|
- ❌ **DON'T**: Forget to handle optional parameters that may be undefined
|
||||||
|
- ❌ **DON'T**: Neglect to test shorthand flag functionality (e.g., `-p`, `-r`)
|
||||||
|
- ❌ **DON'T**: Create circular dependencies in your test mocks
|
||||||
|
- ❌ **DON'T**: Access variables before initialization in your test implementations
|
||||||
|
- ❌ **DON'T**: Include actual command execution in unit tests
|
||||||
|
- ❌ **DON'T**: Overwrite the same file path in multiple tests
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ❌ DON'T: Create circular references in mocks
|
||||||
|
const badMock = {
|
||||||
|
method: jest.fn().mockImplementation(() => badMock.method())
|
||||||
|
};
|
||||||
|
|
||||||
|
// ❌ DON'T: Access uninitialized variables
|
||||||
|
const badImplementation = () => {
|
||||||
|
const result = uninitialized;
|
||||||
|
let uninitialized = 'value';
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
## Jest Module Mocking Best Practices
|
## Jest Module Mocking Best Practices
|
||||||
|
|
||||||
- **Mock Hoisting Behavior**
|
- **Mock Hoisting Behavior**
|
||||||
@@ -165,107 +283,97 @@ When testing ES modules (`"type": "module"` in package.json), traditional mockin
|
|||||||
- Imported functions may not use your mocked dependencies even with proper jest.mock() setup
|
- Imported functions may not use your mocked dependencies even with proper jest.mock() setup
|
||||||
- ES module exports are read-only properties (cannot be reassigned during tests)
|
- ES module exports are read-only properties (cannot be reassigned during tests)
|
||||||
|
|
||||||
- **Mocking Entire Modules**
|
- **Mocking Modules Statically Imported**
|
||||||
```javascript
|
- For modules imported with standard `import` statements at the top level:
|
||||||
// Mock the entire module with custom implementation
|
- Use `jest.mock('path/to/module', factory)` **before** any imports.
|
||||||
jest.mock('../../scripts/modules/task-manager.js', () => {
|
- Jest hoists these mocks.
|
||||||
// Get original implementation for functions you want to preserve
|
- Ensure the factory function returns the mocked structure correctly.
|
||||||
const originalModule = jest.requireActual('../../scripts/modules/task-manager.js');
|
|
||||||
|
|
||||||
// Return mix of original and mocked functionality
|
- **Mocking Dependencies for Dynamically Imported Modules**
|
||||||
return {
|
- **Problem**: Standard `jest.mock()` often fails for dependencies of modules loaded later using dynamic `import('path/to/module')`. The mocks aren't applied correctly when the dynamic import resolves.
|
||||||
...originalModule,
|
- **Solution**: Use `jest.unstable_mockModule(modulePath, factory)` **before** the dynamic `import()` call.
|
||||||
generateTaskFiles: jest.fn() // Replace specific functions
|
```javascript
|
||||||
};
|
// 1. Define mock function instances
|
||||||
|
const mockExistsSync = jest.fn();
|
||||||
|
const mockReadFileSync = jest.fn();
|
||||||
|
// ... other mocks
|
||||||
|
|
||||||
|
// 2. Mock the dependency module *before* the dynamic import
|
||||||
|
jest.unstable_mockModule('fs', () => ({
|
||||||
|
__esModule: true, // Important for ES module mocks
|
||||||
|
// Mock named exports
|
||||||
|
existsSync: mockExistsSync,
|
||||||
|
readFileSync: mockReadFileSync,
|
||||||
|
// Mock default export if necessary
|
||||||
|
// default: { ... }
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 3. Dynamically import the module under test (e.g., in beforeAll or test case)
|
||||||
|
let moduleUnderTest;
|
||||||
|
beforeAll(async () => {
|
||||||
|
// Ensure mocks are reset if needed before import
|
||||||
|
mockExistsSync.mockReset();
|
||||||
|
mockReadFileSync.mockReset();
|
||||||
|
// ... reset other mocks ...
|
||||||
|
|
||||||
|
// Import *after* unstable_mockModule is called
|
||||||
|
moduleUnderTest = await import('../../scripts/modules/module-using-fs.js');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Import after mocks
|
// 4. Now tests can use moduleUnderTest, and its 'fs' calls will hit the mocks
|
||||||
import * as taskManager from '../../scripts/modules/task-manager.js';
|
test('should use mocked fs.readFileSync', () => {
|
||||||
|
mockReadFileSync.mockReturnValue('mock data');
|
||||||
|
moduleUnderTest.readFileAndProcess();
|
||||||
|
expect(mockReadFileSync).toHaveBeenCalled();
|
||||||
|
// ... other assertions
|
||||||
|
});
|
||||||
|
```
|
||||||
|
- ✅ **DO**: Call `jest.unstable_mockModule()` before `await import()`.
|
||||||
|
- ✅ **DO**: Include `__esModule: true` in the mock factory for ES modules.
|
||||||
|
- ✅ **DO**: Mock named and default exports as needed within the factory.
|
||||||
|
- ✅ **DO**: Reset mock functions (`mockFn.mockReset()`) before the dynamic import if they might have been called previously.
|
||||||
|
|
||||||
// Now you can use the mock directly
|
- **Mocking Entire Modules (Static Import)**
|
||||||
const { generateTaskFiles } = taskManager;
|
```javascript
|
||||||
|
// Mock the entire module with custom implementation for static imports
|
||||||
|
// ... (existing example remains valid) ...
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Direct Implementation Testing**
|
- **Direct Implementation Testing**
|
||||||
- Instead of calling the actual function which may have module-scope reference issues:
|
- Instead of calling the actual function which may have module-scope reference issues:
|
||||||
```javascript
|
```javascript
|
||||||
test('should perform expected actions', () => {
|
// ... (existing example remains valid) ...
|
||||||
// Setup mocks for this specific test
|
|
||||||
mockReadJSON.mockImplementationOnce(() => sampleData);
|
|
||||||
|
|
||||||
// Manually simulate the function's behavior
|
|
||||||
const data = mockReadJSON('path/file.json');
|
|
||||||
mockValidateAndFixDependencies(data, 'path/file.json');
|
|
||||||
|
|
||||||
// Skip calling the actual function and verify mocks directly
|
|
||||||
expect(mockReadJSON).toHaveBeenCalledWith('path/file.json');
|
|
||||||
expect(mockValidateAndFixDependencies).toHaveBeenCalledWith(data, 'path/file.json');
|
|
||||||
});
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Avoiding Module Property Assignment**
|
- **Avoiding Module Property Assignment**
|
||||||
```javascript
|
```javascript
|
||||||
// ❌ DON'T: This causes "Cannot assign to read only property" errors
|
// ... (existing example remains valid) ...
|
||||||
const utils = await import('../../scripts/modules/utils.js');
|
|
||||||
utils.readJSON = mockReadJSON; // Error: read-only property
|
|
||||||
|
|
||||||
// ✅ DO: Use the module factory pattern in jest.mock()
|
|
||||||
jest.mock('../../scripts/modules/utils.js', () => ({
|
|
||||||
readJSON: mockReadJSONFunc,
|
|
||||||
writeJSON: mockWriteJSONFunc
|
|
||||||
}));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Handling Mock Verification Failures**
|
- **Handling Mock Verification Failures**
|
||||||
- If verification like `expect(mockFn).toHaveBeenCalled()` fails:
|
- If verification like `expect(mockFn).toHaveBeenCalled()` fails:
|
||||||
1. Check that your mock setup is before imports
|
1. Check that your mock setup (`jest.mock` or `jest.unstable_mockModule`) is correctly placed **before** imports (static or dynamic).
|
||||||
2. Ensure you're using the right mock instance
|
2. Ensure you're using the right mock instance and it's properly passed to the module.
|
||||||
3. Verify your test invokes behavior that would call the mock
|
3. Verify your test invokes behavior that *should* call the mock.
|
||||||
4. Use `jest.clearAllMocks()` in beforeEach to reset mock state
|
4. Use `jest.clearAllMocks()` or specific `mockFn.mockReset()` in `beforeEach` to prevent state leakage between tests.
|
||||||
5. Consider implementing a simpler test that directly verifies mock behavior
|
5. **Check Console Assertions**: If verifying `console.log`, `console.warn`, or `console.error` calls, ensure your assertion matches the *actual* arguments passed. If the code logs a single formatted string, assert against that single string (using `expect.stringContaining` or exact match), not multiple `expect.stringContaining` arguments.
|
||||||
|
|
||||||
- **Full Example Pattern**
|
|
||||||
```javascript
|
```javascript
|
||||||
// 1. Define mock implementations
|
// Example: Code logs console.error(`Error: ${message}. Details: ${details}`)
|
||||||
const mockReadJSON = jest.fn();
|
// ❌ DON'T: Assert multiple arguments if only one is logged
|
||||||
const mockValidateAndFixDependencies = jest.fn();
|
// expect(console.error).toHaveBeenCalledWith(
|
||||||
|
// expect.stringContaining('Error:'),
|
||||||
// 2. Mock modules
|
// expect.stringContaining('Details:')
|
||||||
jest.mock('../../scripts/modules/utils.js', () => ({
|
// );
|
||||||
readJSON: mockReadJSON,
|
// ✅ DO: Assert the single string argument
|
||||||
// Include other functions as needed
|
expect(console.error).toHaveBeenCalledWith(
|
||||||
}));
|
expect.stringContaining('Error: Specific message. Details: More details')
|
||||||
|
);
|
||||||
jest.mock('../../scripts/modules/dependency-manager.js', () => ({
|
// or for exact match:
|
||||||
validateAndFixDependencies: mockValidateAndFixDependencies
|
expect(console.error).toHaveBeenCalledWith(
|
||||||
}));
|
'Error: Specific message. Details: More details'
|
||||||
|
);
|
||||||
// 3. Import after mocks
|
|
||||||
import * as taskManager from '../../scripts/modules/task-manager.js';
|
|
||||||
|
|
||||||
describe('generateTaskFiles function', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
jest.clearAllMocks();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('should generate task files', () => {
|
|
||||||
// 4. Setup test-specific mock behavior
|
|
||||||
const sampleData = { tasks: [{ id: 1, title: 'Test' }] };
|
|
||||||
mockReadJSON.mockReturnValueOnce(sampleData);
|
|
||||||
|
|
||||||
// 5. Create direct implementation test
|
|
||||||
// Instead of calling: taskManager.generateTaskFiles('path', 'dir')
|
|
||||||
|
|
||||||
// Simulate reading data
|
|
||||||
const data = mockReadJSON('path');
|
|
||||||
expect(mockReadJSON).toHaveBeenCalledWith('path');
|
|
||||||
|
|
||||||
// Simulate other operations the function would perform
|
|
||||||
mockValidateAndFixDependencies(data, 'path');
|
|
||||||
expect(mockValidateAndFixDependencies).toHaveBeenCalledWith(data, 'path');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
```
|
```
|
||||||
|
6. Consider implementing a simpler test that *only* verifies the mock behavior in isolation.
|
||||||
|
|
||||||
## Mocking Guidelines
|
## Mocking Guidelines
|
||||||
|
|
||||||
@@ -552,6 +660,102 @@ npm test -- -t "pattern to match"
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Testing AI Service Integrations
|
||||||
|
|
||||||
|
- **DO NOT import real AI service clients**
|
||||||
|
- ❌ DON'T: Import actual AI clients from their libraries
|
||||||
|
- ✅ DO: Create fully mocked versions that return predictable responses
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ❌ DON'T: Import and instantiate real AI clients
|
||||||
|
import { Anthropic } from '@anthropic-ai/sdk';
|
||||||
|
const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
|
||||||
|
|
||||||
|
// ✅ DO: Mock the entire module with controlled behavior
|
||||||
|
jest.mock('@anthropic-ai/sdk', () => ({
|
||||||
|
Anthropic: jest.fn().mockImplementation(() => ({
|
||||||
|
messages: {
|
||||||
|
create: jest.fn().mockResolvedValue({
|
||||||
|
content: [{ type: 'text', text: 'Mocked AI response' }]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}));
|
||||||
|
```
|
||||||
|
|
||||||
|
- **DO NOT rely on environment variables for API keys**
|
||||||
|
- ❌ DON'T: Assume environment variables are set in tests
|
||||||
|
- ✅ DO: Set mock environment variables in test setup
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// In tests/setup.js or at the top of test file
|
||||||
|
process.env.ANTHROPIC_API_KEY = 'test-mock-api-key-for-tests';
|
||||||
|
process.env.PERPLEXITY_API_KEY = 'test-mock-perplexity-key-for-tests';
|
||||||
|
```
|
||||||
|
|
||||||
|
- **DO NOT use real AI client initialization logic**
|
||||||
|
- ❌ DON'T: Use code that attempts to initialize or validate real AI clients
|
||||||
|
- ✅ DO: Create test-specific paths that bypass client initialization
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ❌ DON'T: Test functions that require valid AI client initialization
|
||||||
|
// This will fail without proper API keys or network access
|
||||||
|
test('should use AI client', async () => {
|
||||||
|
const result = await functionThatInitializesAIClient();
|
||||||
|
expect(result).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
// ✅ DO: Test with bypassed initialization or manual task paths
|
||||||
|
test('should handle manual task creation without AI', () => {
|
||||||
|
// Using a path that doesn't require AI client initialization
|
||||||
|
const result = addTaskDirect({
|
||||||
|
title: 'Manual Task',
|
||||||
|
description: 'Test Description'
|
||||||
|
}, mockLogger);
|
||||||
|
|
||||||
|
expect(result.success).toBe(true);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## Testing Asynchronous Code
|
||||||
|
|
||||||
|
- **DO NOT rely on asynchronous operations in tests**
|
||||||
|
- ❌ DON'T: Use real async/await or Promise resolution in tests
|
||||||
|
- ✅ DO: Make all mocks return synchronous values when possible
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ❌ DON'T: Use real async functions that might fail unpredictably
|
||||||
|
test('should handle async operation', async () => {
|
||||||
|
const result = await realAsyncFunction(); // Can time out or fail for external reasons
|
||||||
|
expect(result).toBe(expectedValue);
|
||||||
|
});
|
||||||
|
|
||||||
|
// ✅ DO: Make async operations synchronous in tests
|
||||||
|
test('should handle operation', () => {
|
||||||
|
mockAsyncFunction.mockReturnValue({ success: true, data: 'test' });
|
||||||
|
const result = functionUnderTest();
|
||||||
|
expect(result).toEqual({ success: true, data: 'test' });
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
- **DO NOT test exact error messages**
|
||||||
|
- ❌ DON'T: Assert on exact error message text that might change
|
||||||
|
- ✅ DO: Test for error presence and general properties
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ❌ DON'T: Test for exact error message text
|
||||||
|
expect(result.error).toBe('Could not connect to API: Network error');
|
||||||
|
|
||||||
|
// ✅ DO: Test for general error properties or message patterns
|
||||||
|
expect(result.success).toBe(false);
|
||||||
|
expect(result.error).toContain('Could not connect');
|
||||||
|
// Or even better:
|
||||||
|
expect(result).toMatchObject({
|
||||||
|
success: false,
|
||||||
|
error: expect.stringContaining('connect')
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
## Reliable Testing Techniques
|
## Reliable Testing Techniques
|
||||||
|
|
||||||
- **Create Simplified Test Functions**
|
- **Create Simplified Test Functions**
|
||||||
@@ -564,99 +768,125 @@ npm test -- -t "pattern to match"
|
|||||||
const setTaskStatus = async (taskId, newStatus) => {
|
const setTaskStatus = async (taskId, newStatus) => {
|
||||||
const tasksPath = 'tasks/tasks.json';
|
const tasksPath = 'tasks/tasks.json';
|
||||||
const data = await readJSON(tasksPath);
|
const data = await readJSON(tasksPath);
|
||||||
// Update task status logic
|
// [implementation]
|
||||||
await writeJSON(tasksPath, data);
|
await writeJSON(tasksPath, data);
|
||||||
return data;
|
return { success: true };
|
||||||
};
|
};
|
||||||
|
|
||||||
// Test-friendly simplified function (easy to test)
|
// Test-friendly version (easier to test)
|
||||||
const testSetTaskStatus = (tasksData, taskIdInput, newStatus) => {
|
const updateTaskStatus = (tasks, taskId, newStatus) => {
|
||||||
// Same core logic without file operations
|
// Pure logic without side effects
|
||||||
// Update task status logic on provided tasksData object
|
const updatedTasks = [...tasks];
|
||||||
return tasksData; // Return updated data for assertions
|
const taskIndex = findTaskById(updatedTasks, taskId);
|
||||||
|
if (taskIndex === -1) return { success: false, error: 'Task not found' };
|
||||||
|
updatedTasks[taskIndex].status = newStatus;
|
||||||
|
return { success: true, tasks: updatedTasks };
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Avoid Real File System Operations**
|
|
||||||
- Never write to real files during tests
|
|
||||||
- Create test-specific versions of file operation functions
|
|
||||||
- Mock all file system operations including read, write, exists, etc.
|
|
||||||
- Verify function behavior using the in-memory data structures
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Mock file operations
|
|
||||||
const mockReadJSON = jest.fn();
|
|
||||||
const mockWriteJSON = jest.fn();
|
|
||||||
|
|
||||||
jest.mock('../../scripts/modules/utils.js', () => ({
|
|
||||||
readJSON: mockReadJSON,
|
|
||||||
writeJSON: mockWriteJSON,
|
|
||||||
}));
|
|
||||||
|
|
||||||
test('should update task status correctly', () => {
|
|
||||||
// Setup mock data
|
|
||||||
const testData = JSON.parse(JSON.stringify(sampleTasks));
|
|
||||||
mockReadJSON.mockReturnValue(testData);
|
|
||||||
|
|
||||||
// Call the function that would normally modify files
|
|
||||||
const result = testSetTaskStatus(testData, '1', 'done');
|
|
||||||
|
|
||||||
// Assert on the in-memory data structure
|
|
||||||
expect(result.tasks[0].status).toBe('done');
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Data Isolation Between Tests**
|
|
||||||
- Always create fresh copies of test data for each test
|
|
||||||
- Use `JSON.parse(JSON.stringify(original))` for deep cloning
|
|
||||||
- Reset all mocks before each test with `jest.clearAllMocks()`
|
|
||||||
- Avoid state that persists between tests
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
beforeEach(() => {
|
|
||||||
jest.clearAllMocks();
|
|
||||||
// Deep clone the test data
|
|
||||||
testTasksData = JSON.parse(JSON.stringify(sampleTasks));
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Test All Path Variations**
|
|
||||||
- Regular tasks and subtasks
|
|
||||||
- Single items and multiple items
|
|
||||||
- Success paths and error paths
|
|
||||||
- Edge cases (empty data, invalid inputs, etc.)
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Multiple test cases covering different scenarios
|
|
||||||
test('should update regular task status', () => {
|
|
||||||
/* test implementation */
|
|
||||||
});
|
|
||||||
|
|
||||||
test('should update subtask status', () => {
|
|
||||||
/* test implementation */
|
|
||||||
});
|
|
||||||
|
|
||||||
test('should update multiple tasks when given comma-separated IDs', () => {
|
|
||||||
/* test implementation */
|
|
||||||
});
|
|
||||||
|
|
||||||
test('should throw error for non-existent task ID', () => {
|
|
||||||
/* test implementation */
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Stabilize Tests With Predictable Input/Output**
|
|
||||||
- Use consistent, predictable test fixtures
|
|
||||||
- Avoid random values or time-dependent data
|
|
||||||
- Make tests deterministic for reliable CI/CD
|
|
||||||
- Control all variables that might affect test outcomes
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Use a specific known date instead of current date
|
|
||||||
const fixedDate = new Date('2023-01-01T12:00:00Z');
|
|
||||||
jest.spyOn(global, 'Date').mockImplementation(() => fixedDate);
|
|
||||||
```
|
|
||||||
|
|
||||||
See [tests/README.md](mdc:tests/README.md) for more details on the testing approach.
|
See [tests/README.md](mdc:tests/README.md) for more details on the testing approach.
|
||||||
|
|
||||||
Refer to [jest.config.js](mdc:jest.config.js) for Jest configuration options.
|
Refer to [jest.config.js](mdc:jest.config.js) for Jest configuration options.
|
||||||
|
|
||||||
|
## Variable Hoisting and Module Initialization Issues
|
||||||
|
|
||||||
|
When testing ES modules or working with complex module imports, you may encounter variable hoisting and initialization issues. These can be particularly tricky to debug and often appear as "Cannot access 'X' before initialization" errors.
|
||||||
|
|
||||||
|
- **Understanding Module Initialization Order**
|
||||||
|
- ✅ **DO**: Declare and initialize global variables at the top of modules
|
||||||
|
- ✅ **DO**: Use proper function declarations to avoid hoisting issues
|
||||||
|
- ✅ **DO**: Initialize variables before they are referenced, especially in imported modules
|
||||||
|
- ✅ **DO**: Be aware that imports are hoisted to the top of the file
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Define global state variables at the top of the module
|
||||||
|
let silentMode = false; // Declare and initialize first
|
||||||
|
|
||||||
|
const CONFIG = { /* configuration */ };
|
||||||
|
|
||||||
|
function isSilentMode() {
|
||||||
|
return silentMode; // Reference variable after it's initialized
|
||||||
|
}
|
||||||
|
|
||||||
|
function log(level, message) {
|
||||||
|
if (isSilentMode()) return; // Use the function instead of accessing variable directly
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Testing Modules with Initialization-Dependent Functions**
|
||||||
|
- ✅ **DO**: Create test-specific implementations that initialize all variables correctly
|
||||||
|
- ✅ **DO**: Use factory functions in mocks to ensure proper initialization order
|
||||||
|
- ✅ **DO**: Be careful with how you mock or stub functions that depend on module state
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Test-specific implementation that avoids initialization issues
|
||||||
|
const testLog = (level, ...args) => {
|
||||||
|
// Local implementation with proper initialization
|
||||||
|
const isSilent = false; // Explicit initialization
|
||||||
|
if (isSilent) return;
|
||||||
|
// Test implementation...
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Common Hoisting-Related Errors to Avoid**
|
||||||
|
- ❌ **DON'T**: Reference variables before their declaration in module scope
|
||||||
|
- ❌ **DON'T**: Create circular dependencies between modules
|
||||||
|
- ❌ **DON'T**: Rely on variable initialization order across module boundaries
|
||||||
|
- ❌ **DON'T**: Define functions that use hoisted variables before they're initialized
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ❌ DON'T: Create reference-before-initialization patterns
|
||||||
|
function badFunction() {
|
||||||
|
if (silentMode) { /* ... */ } // ReferenceError if silentMode is declared later
|
||||||
|
}
|
||||||
|
|
||||||
|
let silentMode = false;
|
||||||
|
|
||||||
|
// ❌ DON'T: Create cross-module references that depend on initialization order
|
||||||
|
// module-a.js
|
||||||
|
import { getSetting } from './module-b.js';
|
||||||
|
export const config = { value: getSetting() };
|
||||||
|
|
||||||
|
// module-b.js
|
||||||
|
import { config } from './module-a.js';
|
||||||
|
export function getSetting() {
|
||||||
|
return config.value; // Circular dependency causing initialization issues
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Dynamic Imports as a Solution**
|
||||||
|
- ✅ **DO**: Use dynamic imports (`import()`) to avoid initialization order issues
|
||||||
|
- ✅ **DO**: Structure modules to avoid circular dependencies that cause initialization issues
|
||||||
|
- ✅ **DO**: Consider factory functions for modules with complex state
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Use dynamic imports to avoid initialization issues
|
||||||
|
async function getTaskManager() {
|
||||||
|
return import('./task-manager.js');
|
||||||
|
}
|
||||||
|
|
||||||
|
async function someFunction() {
|
||||||
|
const taskManager = await getTaskManager();
|
||||||
|
return taskManager.someMethod();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Testing Approach for Modules with Initialization Issues**
|
||||||
|
- ✅ **DO**: Create self-contained test implementations rather than using real implementations
|
||||||
|
- ✅ **DO**: Mock dependencies at module boundaries instead of trying to mock deep dependencies
|
||||||
|
- ✅ **DO**: Isolate module-specific state in tests
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Create isolated test implementation instead of reusing module code
|
||||||
|
test('should log messages when not in silent mode', () => {
|
||||||
|
// Local test implementation instead of importing from module
|
||||||
|
const testLog = (level, message) => {
|
||||||
|
if (false) return; // Always non-silent for this test
|
||||||
|
mockConsole(level, message);
|
||||||
|
};
|
||||||
|
|
||||||
|
testLog('info', 'test message');
|
||||||
|
expect(mockConsole).toHaveBeenCalledWith('info', 'test message');
|
||||||
|
});
|
||||||
|
```
|
||||||
@@ -150,4 +150,91 @@ alwaysApply: false
|
|||||||
));
|
));
|
||||||
```
|
```
|
||||||
|
|
||||||
Refer to [`ui.js`](mdc:scripts/modules/ui.js) for implementation examples and [`new_features.mdc`](mdc:.cursor/rules/new_features.mdc) for integration guidelines.
|
## Enhanced Display Patterns
|
||||||
|
|
||||||
|
### **Token Breakdown Display**
|
||||||
|
- Use detailed, granular token breakdowns for AI-powered commands
|
||||||
|
- Display context sources with individual token counts
|
||||||
|
- Show both token count and character count for transparency
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Display detailed token breakdown
|
||||||
|
function displayDetailedTokenBreakdown(tokenBreakdown, systemTokens, userTokens) {
|
||||||
|
const sections = [];
|
||||||
|
|
||||||
|
if (tokenBreakdown.tasks?.length > 0) {
|
||||||
|
const taskDetails = tokenBreakdown.tasks.map(task =>
|
||||||
|
`${task.type === 'subtask' ? ' ' : ''}${task.id}: ${task.tokens.toLocaleString()}`
|
||||||
|
).join('\n');
|
||||||
|
sections.push(`Tasks (${tokenBreakdown.tasks.reduce((sum, t) => sum + t.tokens, 0).toLocaleString()}):\n${taskDetails}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const content = sections.join('\n\n');
|
||||||
|
console.log(boxen(content, {
|
||||||
|
title: chalk.cyan('Token Usage'),
|
||||||
|
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
||||||
|
borderStyle: 'round',
|
||||||
|
borderColor: 'cyan'
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Code Block Syntax Highlighting**
|
||||||
|
- Use `cli-highlight` library for syntax highlighting in terminal output
|
||||||
|
- Process code blocks in AI responses for better readability
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Enhance code blocks with syntax highlighting
|
||||||
|
import { highlight } from 'cli-highlight';
|
||||||
|
|
||||||
|
function processCodeBlocks(text) {
|
||||||
|
return text.replace(/```(\w+)?\n([\s\S]*?)```/g, (match, language, code) => {
|
||||||
|
try {
|
||||||
|
const highlighted = highlight(code.trim(), {
|
||||||
|
language: language || 'javascript',
|
||||||
|
theme: 'default'
|
||||||
|
});
|
||||||
|
return `\n${highlighted}\n`;
|
||||||
|
} catch (error) {
|
||||||
|
return `\n${code.trim()}\n`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Multi-Section Result Display**
|
||||||
|
- Use separate boxes for headers, content, and metadata
|
||||||
|
- Maintain consistent styling across different result types
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Use structured result display
|
||||||
|
function displayResults(result, query, detailLevel) {
|
||||||
|
// Header with query info
|
||||||
|
const header = boxen(
|
||||||
|
chalk.green.bold('Research Results') + '\n\n' +
|
||||||
|
chalk.gray('Query: ') + chalk.white(query) + '\n' +
|
||||||
|
chalk.gray('Detail Level: ') + chalk.cyan(detailLevel),
|
||||||
|
{
|
||||||
|
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
||||||
|
margin: { top: 1, bottom: 0 },
|
||||||
|
borderStyle: 'round',
|
||||||
|
borderColor: 'green'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
console.log(header);
|
||||||
|
|
||||||
|
// Process and display main content
|
||||||
|
const processedResult = processCodeBlocks(result);
|
||||||
|
const contentBox = boxen(processedResult, {
|
||||||
|
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
||||||
|
margin: { top: 0, bottom: 1 },
|
||||||
|
borderStyle: 'single',
|
||||||
|
borderColor: 'gray'
|
||||||
|
});
|
||||||
|
console.log(contentBox);
|
||||||
|
|
||||||
|
console.log(chalk.green('✓ Operation complete'));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Refer to [`ui.js`](mdc:scripts/modules/ui.js) for implementation examples, [`context_gathering.mdc`](mdc:.cursor/rules/context_gathering.mdc) for context display patterns, and [`new_features.mdc`](mdc:.cursor/rules/new_features.mdc) for integration guidelines.
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
---
|
---
|
||||||
description: Guidelines for implementing utility functions
|
description:
|
||||||
globs: scripts/modules/utils.js, mcp-server/src/**/*
|
globs:
|
||||||
alwaysApply: false
|
alwaysApply: false
|
||||||
---
|
---
|
||||||
|
|
||||||
# Utility Function Guidelines
|
# Utility Function Guidelines
|
||||||
|
|
||||||
## General Principles
|
## General Principles
|
||||||
@@ -47,7 +46,7 @@ alwaysApply: false
|
|||||||
- **Location**:
|
- **Location**:
|
||||||
- **Core CLI Utilities**: Place utilities used primarily by the core `task-master` CLI logic and command modules (`scripts/modules/*`) into [`scripts/modules/utils.js`](mdc:scripts/modules/utils.js).
|
- **Core CLI Utilities**: Place utilities used primarily by the core `task-master` CLI logic and command modules (`scripts/modules/*`) into [`scripts/modules/utils.js`](mdc:scripts/modules/utils.js).
|
||||||
- **MCP Server Utilities**: Place utilities specifically designed to support the MCP server implementation into the appropriate subdirectories within `mcp-server/src/`.
|
- **MCP Server Utilities**: Place utilities specifically designed to support the MCP server implementation into the appropriate subdirectories within `mcp-server/src/`.
|
||||||
- Path/Core Logic Helpers: [`mcp-server/src/core/utils/`](mdc:mcp-server/src/core/utils/) (e.g., `path-utils.js`).
|
- Path/Core Logic Helpers: [`mcp-server/src/core/utils/`](mdc:mcp-server/src/core/utils) (e.g., `path-utils.js`).
|
||||||
- Tool Execution/Response Helpers: [`mcp-server/src/tools/utils.js`](mdc:mcp-server/src/tools/utils.js).
|
- Tool Execution/Response Helpers: [`mcp-server/src/tools/utils.js`](mdc:mcp-server/src/tools/utils.js).
|
||||||
|
|
||||||
## Documentation Standards
|
## Documentation Standards
|
||||||
@@ -79,28 +78,30 @@ alwaysApply: false
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration Management (in `scripts/modules/utils.js`)
|
## Configuration Management (via `config-manager.js`)
|
||||||
|
|
||||||
- **Environment Variables**:
|
Taskmaster configuration (excluding API keys) is primarily managed through the `.taskmasterconfig` file located in the project root and accessed via getters in [`scripts/modules/config-manager.js`](mdc:scripts/modules/config-manager.js).
|
||||||
- ✅ DO: Provide default values for all configuration
|
|
||||||
- ✅ DO: Use environment variables for customization
|
|
||||||
- ✅ DO: Document available configuration options
|
|
||||||
- ❌ DON'T: Hardcode values that should be configurable
|
|
||||||
|
|
||||||
```javascript
|
- **`.taskmasterconfig` File**:
|
||||||
// ✅ DO: Set up configuration with defaults and environment overrides
|
- ✅ DO: Use this JSON file to store settings like AI model selections (main, research, fallback), parameters (temperature, maxTokens), logging level, default priority/subtasks, etc.
|
||||||
const CONFIG = {
|
- ✅ DO: Manage this file using the `task-master models --setup` CLI command or the `models` MCP tool.
|
||||||
model: process.env.MODEL || 'claude-3-opus-20240229', // Updated default model
|
- ✅ DO: Rely on [`config-manager.js`](mdc:scripts/modules/config-manager.js) to load this file (using the correct project root passed from MCP or found via CLI utils), merge with defaults, and provide validated settings.
|
||||||
maxTokens: parseInt(process.env.MAX_TOKENS || '4000'),
|
- ❌ DON'T: Store API keys in this file.
|
||||||
temperature: parseFloat(process.env.TEMPERATURE || '0.7'),
|
- ❌ DON'T: Manually edit this file unless necessary.
|
||||||
debug: process.env.DEBUG === "true",
|
|
||||||
logLevel: process.env.LOG_LEVEL || "info",
|
- **Configuration Getters (`config-manager.js`)**:
|
||||||
defaultSubtasks: parseInt(process.env.DEFAULT_SUBTASKS || "3"),
|
- ✅ DO: Import and use specific getters from `config-manager.js` (e.g., `getMainProvider()`, `getLogLevel()`, `getMainMaxTokens()`) to access configuration values *needed for application logic* (like `getDefaultSubtasks`).
|
||||||
defaultPriority: process.env.DEFAULT_PRIORITY || "medium",
|
- ✅ DO: Pass the `explicitRoot` parameter to getters if calling from MCP direct functions to ensure the correct project's config is loaded.
|
||||||
projectName: process.env.PROJECT_NAME || "Task Master Project", // Generic project name
|
- ❌ DON'T: Call AI-specific getters (like `getMainModelId`, `getMainMaxTokens`) from core logic functions (`scripts/modules/task-manager/*`). Instead, pass the `role` to the unified AI service.
|
||||||
projectVersion: "1.5.0" // Version should be updated via release process
|
- ❌ DON'T: Access configuration values directly from environment variables (except API keys).
|
||||||
};
|
|
||||||
```
|
- **API Key Handling (`utils.js` & `ai-services-unified.js`)**:
|
||||||
|
- ✅ DO: Store API keys **only** in `.env` (for CLI, loaded by `dotenv` in `scripts/dev.js`) or `.cursor/mcp.json` (for MCP, accessed via `session.env`).
|
||||||
|
- ✅ DO: Use `isApiKeySet(providerName, session)` from `config-manager.js` to check if a provider's key is available *before* potentially attempting an AI call if needed, but note the unified service performs its own internal check.
|
||||||
|
- ✅ DO: Understand that the unified service layer (`ai-services-unified.js`) internally resolves API keys using `resolveEnvVariable(key, session)` from `utils.js`.
|
||||||
|
|
||||||
|
- **Error Handling**:
|
||||||
|
- ✅ DO: Handle potential `ConfigurationError` if the `.taskmasterconfig` file is missing or invalid when accessed via `getConfig` (e.g., in `commands.js` or direct functions).
|
||||||
|
|
||||||
## Logging Utilities (in `scripts/modules/utils.js`)
|
## Logging Utilities (in `scripts/modules/utils.js`)
|
||||||
|
|
||||||
@@ -109,7 +110,7 @@ alwaysApply: false
|
|||||||
- ✅ DO: Use appropriate icons for different log levels
|
- ✅ DO: Use appropriate icons for different log levels
|
||||||
- ✅ DO: Respect the configured log level
|
- ✅ DO: Respect the configured log level
|
||||||
- ❌ DON'T: Add direct console.log calls outside the logging utility
|
- ❌ DON'T: Add direct console.log calls outside the logging utility
|
||||||
- **Note on Passed Loggers**: When a logger object (like the FastMCP `log` object) is passed *as a parameter* (e.g., as `mcpLog`) into core Task Master functions, the receiving function often expects specific methods (`.info`, `.warn`, `.error`, etc.) to be directly callable on that object (e.g., `mcpLog[level](...)`). If the passed logger doesn't have this exact structure, a wrapper object may be needed. See the **Handling Logging Context (`mcpLog`)** section in [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc) for the standard pattern used in direct functions.
|
- **Note on Passed Loggers**: When a logger object (like the FastMCP `log` object) is passed *as a parameter* (e.g., as `mcpLog`) into core Task Master functions, the receiving function often expects specific methods (`.info`, `.warn`, `.error`, etc.) to be directly callable on that object (e.g., `mcpLog[level](mdc:...)`). If the passed logger doesn't have this exact structure, a wrapper object may be needed. See the **Handling Logging Context (`mcpLog`)** section in [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc) for the standard pattern used in direct functions.
|
||||||
|
|
||||||
- **Logger Wrapper Pattern**:
|
- **Logger Wrapper Pattern**:
|
||||||
- ✅ DO: Use the logger wrapper pattern when passing loggers to prevent `mcpLog[level] is not a function` errors:
|
- ✅ DO: Use the logger wrapper pattern when passing loggers to prevent `mcpLog[level] is not a function` errors:
|
||||||
@@ -427,36 +428,69 @@ alwaysApply: false
|
|||||||
|
|
||||||
## MCP Server Tool Utilities (`mcp-server/src/tools/utils.js`)
|
## MCP Server Tool Utilities (`mcp-server/src/tools/utils.js`)
|
||||||
|
|
||||||
- **Purpose**: These utilities specifically support the MCP server tools ([`mcp-server/src/tools/*.js`](mdc:mcp-server/src/tools/*.js)), handling MCP communication patterns, response formatting, caching integration, and the CLI fallback mechanism.
|
These utilities specifically support the implementation and execution of MCP tools.
|
||||||
- **Refer to [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc)** for detailed usage patterns within the MCP tool `execute` methods and direct function wrappers.
|
|
||||||
|
|
||||||
- **`getProjectRootFromSession(session, log)`**:
|
- **`normalizeProjectRoot(rawPath, log)`**:
|
||||||
- ✅ **DO**: Call this utility **within the MCP tool's `execute` method** to extract the project root path from the `session` object.
|
- **Purpose**: Takes a raw project root path (potentially URI encoded, with `file://` prefix, Windows slashes) and returns a normalized, absolute path suitable for the server's OS.
|
||||||
- Decodes the `file://` URI and handles potential errors.
|
- **Logic**: Decodes URI, strips `file://`, handles Windows drive prefix (`/C:/`), replaces `\` with `/`, uses `path.resolve()`.
|
||||||
- Returns the project path string or `null`.
|
- **Usage**: Used internally by `withNormalizedProjectRoot` HOF.
|
||||||
- The returned path should then be passed in the `args` object when calling the corresponding `*Direct` function (e.g., `yourDirectFunction({ ...args, projectRoot: rootFolder }, log)`).
|
|
||||||
|
- **`getRawProjectRootFromSession(session, log)`**:
|
||||||
|
- **Purpose**: Extracts the *raw* project root URI string from the session object (`session.roots[0].uri` or `session.roots.roots[0].uri`) without performing normalization.
|
||||||
|
- **Usage**: Used internally by `withNormalizedProjectRoot` HOF as a fallback if `args.projectRoot` isn't provided.
|
||||||
|
|
||||||
|
- **`withNormalizedProjectRoot(executeFn)`**:
|
||||||
|
- **Purpose**: A Higher-Order Function (HOF) designed to wrap a tool's `execute` method.
|
||||||
|
- **Logic**:
|
||||||
|
1. Determines the raw project root (from `args.projectRoot` or `getRawProjectRootFromSession`).
|
||||||
|
2. Normalizes the raw path using `normalizeProjectRoot`.
|
||||||
|
3. Injects the normalized, absolute path back into the `args` object as `args.projectRoot`.
|
||||||
|
4. Calls the original `executeFn` with the updated `args`.
|
||||||
|
- **Usage**: Should wrap the `execute` function of *every* MCP tool that needs a reliable, normalized project root path.
|
||||||
|
- **Example**:
|
||||||
|
```javascript
|
||||||
|
// In mcp-server/src/tools/your-tool.js
|
||||||
|
import { withNormalizedProjectRoot } from './utils.js';
|
||||||
|
|
||||||
|
export function registerYourTool(server) {
|
||||||
|
server.addTool({
|
||||||
|
// ... name, description, parameters ...
|
||||||
|
execute: withNormalizedProjectRoot(async (args, context) => {
|
||||||
|
// args.projectRoot is now normalized here
|
||||||
|
const { projectRoot /*, other args */ } = args;
|
||||||
|
// ... rest of tool logic using normalized projectRoot ...
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
- **`handleApiResult(result, log, errorPrefix, processFunction)`**:
|
- **`handleApiResult(result, log, errorPrefix, processFunction)`**:
|
||||||
- ✅ **DO**: Call this from the MCP tool's `execute` method after receiving the result from the `*Direct` function wrapper.
|
- **Purpose**: Standardizes the formatting of responses returned by direct functions (`{ success, data/error, fromCache }`) into the MCP response format.
|
||||||
- Takes the standard `{ success, data/error, fromCache }` object.
|
- **Usage**: Call this at the end of the tool's `execute` method, passing the result from the direct function call.
|
||||||
- Formats the standard MCP success or error response, including the `fromCache` flag.
|
|
||||||
- Uses `processMCPResponseData` by default to filter response data.
|
|
||||||
|
|
||||||
- **`executeTaskMasterCommand(command, log, args, projectRootRaw)`**:
|
|
||||||
- Executes a Task Master CLI command as a child process.
|
|
||||||
- Handles fallback between global `task-master` and local `node scripts/dev.js`.
|
|
||||||
- ❌ **DON'T**: Use this as the primary method for MCP tools. Prefer direct function calls via `*Direct` wrappers.
|
|
||||||
|
|
||||||
- **`processMCPResponseData(taskOrData, fieldsToRemove)`**:
|
|
||||||
- Filters task data (e.g., removing `details`, `testStrategy`) before sending to the MCP client. Called by `handleApiResult`.
|
|
||||||
|
|
||||||
- **`createContentResponse(content)` / `createErrorResponse(errorMessage)`**:
|
- **`createContentResponse(content)` / `createErrorResponse(errorMessage)`**:
|
||||||
- Formatters for standard MCP success/error responses.
|
- **Purpose**: Helper functions to create the basic MCP response structure for success or error messages.
|
||||||
|
- **Usage**: Used internally by `handleApiResult` and potentially directly for simple responses.
|
||||||
|
|
||||||
|
- **`createLogWrapper(log)`**:
|
||||||
|
- **Purpose**: Creates a logger object wrapper with standard methods (`info`, `warn`, `error`, `debug`, `success`) mapping to the passed MCP `log` object's methods. Ensures compatibility when passing loggers to core functions.
|
||||||
|
- **Usage**: Used within direct functions before passing the `log` object down to core logic that expects the standard method names.
|
||||||
|
|
||||||
- **`getCachedOrExecute({ cacheKey, actionFn, log })`**:
|
- **`getCachedOrExecute({ cacheKey, actionFn, log })`**:
|
||||||
- ✅ **DO**: Use this utility *inside direct function wrappers* to implement caching.
|
- **Purpose**: Utility for implementing caching within direct functions. Checks cache for `cacheKey`; if miss, executes `actionFn`, caches successful result, and returns.
|
||||||
- Checks cache, executes `actionFn` on miss, stores result.
|
- **Usage**: Wrap the core logic execution within a direct function call.
|
||||||
- Returns standard `{ success, data/error, fromCache: boolean }`.
|
|
||||||
|
- **`processMCPResponseData(taskOrData, fieldsToRemove)`**:
|
||||||
|
- **Purpose**: Utility to filter potentially sensitive or large fields (like `details`, `testStrategy`) from task objects before sending the response back via MCP.
|
||||||
|
- **Usage**: Passed as the default `processFunction` to `handleApiResult`.
|
||||||
|
|
||||||
|
- **`getProjectRootFromSession(session, log)`**:
|
||||||
|
- **Purpose**: Legacy function to extract *and normalize* the project root from the session. Replaced by the HOF pattern but potentially still used.
|
||||||
|
- **Recommendation**: Prefer using the `withNormalizedProjectRoot` HOF in tools instead of calling this directly.
|
||||||
|
|
||||||
|
- **`executeTaskMasterCommand(...)`**:
|
||||||
|
- **Purpose**: Executes `task-master` CLI command as a fallback.
|
||||||
|
- **Recommendation**: Deprecated for most uses; prefer direct function calls.
|
||||||
|
|
||||||
## Export Organization
|
## Export Organization
|
||||||
|
|
||||||
@@ -514,4 +548,628 @@ export {
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Refer to [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc) and [`architecture.mdc`](mdc:.cursor/rules/architecture.mdc) for more context on MCP server architecture and integration.
|
## Context Gathering Utilities
|
||||||
|
|
||||||
|
### **ContextGatherer** (`scripts/modules/utils/contextGatherer.js`)
|
||||||
|
|
||||||
|
- **Multi-Source Context Extraction**:
|
||||||
|
- ✅ DO: Use for AI-powered commands that need project context
|
||||||
|
- ✅ DO: Support tasks, files, custom text, and project tree context
|
||||||
|
- ✅ DO: Implement detailed token counting with `gpt-tokens` library
|
||||||
|
- ✅ DO: Provide multiple output formats (research, chat, system-prompt)
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Use ContextGatherer for consistent context extraction
|
||||||
|
import { ContextGatherer } from '../utils/contextGatherer.js';
|
||||||
|
|
||||||
|
const gatherer = new ContextGatherer(projectRoot, tasksPath);
|
||||||
|
const result = await gatherer.gather({
|
||||||
|
tasks: ['15', '16.2'],
|
||||||
|
files: ['src/api.js'],
|
||||||
|
customContext: 'Additional context',
|
||||||
|
includeProjectTree: true,
|
||||||
|
format: 'research',
|
||||||
|
includeTokenCounts: true
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### **FuzzyTaskSearch** (`scripts/modules/utils/fuzzyTaskSearch.js`)
|
||||||
|
|
||||||
|
- **Intelligent Task Discovery**:
|
||||||
|
- ✅ DO: Use for automatic task relevance detection
|
||||||
|
- ✅ DO: Configure search parameters based on use case context
|
||||||
|
- ✅ DO: Implement purpose-based categorization for better matching
|
||||||
|
- ✅ DO: Sort results by relevance score and task ID
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Use FuzzyTaskSearch for intelligent task discovery
|
||||||
|
import { FuzzyTaskSearch } from '../utils/fuzzyTaskSearch.js';
|
||||||
|
|
||||||
|
const fuzzySearch = new FuzzyTaskSearch(tasksData.tasks, 'research');
|
||||||
|
const searchResults = fuzzySearch.findRelevantTasks(query, {
|
||||||
|
maxResults: 8,
|
||||||
|
includeRecent: true,
|
||||||
|
includeCategoryMatches: true
|
||||||
|
});
|
||||||
|
const taskIds = fuzzySearch.getTaskIds(searchResults);
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Integration Guidelines**:
|
||||||
|
- ✅ DO: Use fuzzy search to supplement user-provided task IDs
|
||||||
|
- ✅ DO: Display discovered task IDs to users for transparency
|
||||||
|
- ✅ DO: Sort discovered task IDs numerically for better readability
|
||||||
|
- ❌ DON'T: Replace explicit user task selections with fuzzy results
|
||||||
|
|
||||||
|
Refer to [`context_gathering.mdc`](mdc:.cursor/rules/context_gathering.mdc) for detailed implementation patterns, [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc) and [`architecture.mdc`](mdc:.cursor/rules/architecture.mdc) for more context on MCP server architecture and integration.
|
||||||
|
|
||||||
|
## File System Operations
|
||||||
|
|
||||||
|
- **JSON File Handling**:
|
||||||
|
- ✅ DO: Use `readJSON` and `writeJSON` for all JSON operations
|
||||||
|
- ✅ DO: Include error handling for file operations
|
||||||
|
- ✅ DO: Validate JSON structure after reading
|
||||||
|
- ❌ DON'T: Use raw `fs.readFileSync` or `fs.writeFileSync` for JSON
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Use utility functions with error handling
|
||||||
|
function readJSON(filepath) {
|
||||||
|
try {
|
||||||
|
if (!fs.existsSync(filepath)) {
|
||||||
|
return null; // or appropriate default
|
||||||
|
}
|
||||||
|
|
||||||
|
let data = JSON.parse(fs.readFileSync(filepath, 'utf8'));
|
||||||
|
|
||||||
|
// Silent migration for tasks.json files: Transform old format to tagged format
|
||||||
|
const isTasksFile = filepath.includes('tasks.json') || path.basename(filepath) === 'tasks.json';
|
||||||
|
|
||||||
|
if (data && data.tasks && Array.isArray(data.tasks) && !data.master && isTasksFile) {
|
||||||
|
// Migrate from old format { "tasks": [...] } to new format { "master": { "tasks": [...] } }
|
||||||
|
const migratedData = {
|
||||||
|
master: {
|
||||||
|
tasks: data.tasks
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
writeJSON(filepath, migratedData);
|
||||||
|
|
||||||
|
// Set global flag for CLI notice and perform complete migration
|
||||||
|
global.taskMasterMigrationOccurred = true;
|
||||||
|
performCompleteTagMigration(filepath);
|
||||||
|
|
||||||
|
data = migratedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
} catch (error) {
|
||||||
|
log('error', `Failed to read JSON from ${filepath}: ${error.message}`);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeJSON(filepath, data) {
|
||||||
|
try {
|
||||||
|
const dirPath = path.dirname(filepath);
|
||||||
|
if (!fs.existsSync(dirPath)) {
|
||||||
|
fs.mkdirSync(dirPath, { recursive: true });
|
||||||
|
}
|
||||||
|
fs.writeFileSync(filepath, JSON.stringify(data, null, 2));
|
||||||
|
} catch (error) {
|
||||||
|
log('error', `Failed to write JSON to ${filepath}: ${error.message}`);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Path Resolution**:
|
||||||
|
- ✅ DO: Use `path.join()` for cross-platform path construction
|
||||||
|
- ✅ DO: Use `path.resolve()` for absolute paths
|
||||||
|
- ✅ DO: Validate paths before file operations
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Handle paths correctly
|
||||||
|
function findProjectRoot(startPath = process.cwd()) {
|
||||||
|
let currentPath = path.resolve(startPath);
|
||||||
|
const rootPath = path.parse(currentPath).root;
|
||||||
|
|
||||||
|
while (currentPath !== rootPath) {
|
||||||
|
const taskMasterPath = path.join(currentPath, '.taskmaster');
|
||||||
|
if (fs.existsSync(taskMasterPath)) {
|
||||||
|
return currentPath;
|
||||||
|
}
|
||||||
|
currentPath = path.dirname(currentPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null; // Not found
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tagged Task Lists System Utilities
|
||||||
|
|
||||||
|
- **Tag Resolution Functions**:
|
||||||
|
- ✅ DO: Use tag resolution layer for all task data access
|
||||||
|
- ✅ DO: Provide backward compatibility with legacy format
|
||||||
|
- ✅ DO: Default to "master" tag when no tag is specified
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Implement tag resolution functions
|
||||||
|
function getTasksForTag(data, tagName = 'master') {
|
||||||
|
if (!data) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle legacy format - direct tasks array
|
||||||
|
if (data.tasks && Array.isArray(data.tasks)) {
|
||||||
|
return data.tasks;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle tagged format - tasks under specific tag
|
||||||
|
if (data[tagName] && data[tagName].tasks && Array.isArray(data[tagName].tasks)) {
|
||||||
|
return data[tagName].tasks;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTasksForTag(data, tagName = 'master', tasks) {
|
||||||
|
// Ensure data object exists
|
||||||
|
if (!data) {
|
||||||
|
data = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create tag structure if it doesn't exist
|
||||||
|
if (!data[tagName]) {
|
||||||
|
data[tagName] = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set tasks for the tag
|
||||||
|
data[tagName].tasks = tasks;
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCurrentTag() {
|
||||||
|
// Get current tag from state.json or default to 'master'
|
||||||
|
try {
|
||||||
|
const projectRoot = findProjectRoot();
|
||||||
|
if (!projectRoot) return 'master';
|
||||||
|
|
||||||
|
const statePath = path.join(projectRoot, '.taskmaster', 'state.json');
|
||||||
|
if (fs.existsSync(statePath)) {
|
||||||
|
const state = readJSON(statePath);
|
||||||
|
return state.currentTag || 'master';
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
log('debug', `Error reading current tag: ${error.message}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'master';
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Migration Functions**:
|
||||||
|
- ✅ DO: Implement complete migration for all related files
|
||||||
|
- ✅ DO: Handle configuration and state file creation
|
||||||
|
- ✅ DO: Provide migration status tracking
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Implement complete migration system
|
||||||
|
function performCompleteTagMigration(tasksJsonPath) {
|
||||||
|
try {
|
||||||
|
// Derive project root from tasks.json path
|
||||||
|
const projectRoot = findProjectRoot(path.dirname(tasksJsonPath)) || path.dirname(tasksJsonPath);
|
||||||
|
|
||||||
|
// 1. Migrate config.json - add defaultTag and tags section
|
||||||
|
const configPath = path.join(projectRoot, '.taskmaster', 'config.json');
|
||||||
|
if (fs.existsSync(configPath)) {
|
||||||
|
migrateConfigJson(configPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Create state.json if it doesn't exist
|
||||||
|
const statePath = path.join(projectRoot, '.taskmaster', 'state.json');
|
||||||
|
if (!fs.existsSync(statePath)) {
|
||||||
|
createStateJson(statePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getDebugFlag()) {
|
||||||
|
log('debug', 'Completed tagged task lists migration for project');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
if (getDebugFlag()) {
|
||||||
|
log('warn', `Error during complete tag migration: ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function migrateConfigJson(configPath) {
|
||||||
|
try {
|
||||||
|
const config = readJSON(configPath);
|
||||||
|
if (!config) return;
|
||||||
|
|
||||||
|
let modified = false;
|
||||||
|
|
||||||
|
// Add global.defaultTag if missing
|
||||||
|
if (!config.global) {
|
||||||
|
config.global = {};
|
||||||
|
}
|
||||||
|
if (!config.global.defaultTag) {
|
||||||
|
config.global.defaultTag = 'master';
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add tags section if missing
|
||||||
|
if (!config.tags) {
|
||||||
|
config.tags = {
|
||||||
|
// Git integration settings removed - now manual only
|
||||||
|
};
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modified) {
|
||||||
|
writeJSON(configPath, config);
|
||||||
|
if (getDebugFlag()) {
|
||||||
|
log('debug', 'Updated config.json with tagged task system settings');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
if (getDebugFlag()) {
|
||||||
|
log('warn', `Error migrating config.json: ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createStateJson(statePath) {
|
||||||
|
try {
|
||||||
|
const initialState = {
|
||||||
|
currentTag: 'master',
|
||||||
|
lastSwitched: new Date().toISOString(),
|
||||||
|
migrationNoticeShown: false
|
||||||
|
};
|
||||||
|
|
||||||
|
writeJSON(statePath, initialState);
|
||||||
|
if (getDebugFlag()) {
|
||||||
|
log('debug', 'Created initial state.json for tagged task system');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
if (getDebugFlag()) {
|
||||||
|
log('warn', `Error creating state.json: ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function markMigrationForNotice() {
|
||||||
|
try {
|
||||||
|
const projectRoot = findProjectRoot();
|
||||||
|
if (!projectRoot) return;
|
||||||
|
|
||||||
|
const statePath = path.join(projectRoot, '.taskmaster', 'state.json');
|
||||||
|
const state = readJSON(statePath) || {};
|
||||||
|
|
||||||
|
state.migrationNoticeShown = false; // Reset to show notice
|
||||||
|
writeJSON(statePath, state);
|
||||||
|
} catch (error) {
|
||||||
|
if (getDebugFlag()) {
|
||||||
|
log('warn', `Error marking migration for notice: ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Logging Functions
|
||||||
|
|
||||||
|
- **Consistent Logging**:
|
||||||
|
- ✅ DO: Use the central `log` function for all output
|
||||||
|
- ✅ DO: Use appropriate log levels (info, warn, error, debug)
|
||||||
|
- ✅ DO: Support silent mode for programmatic usage
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Implement consistent logging with silent mode
|
||||||
|
let silentMode = false;
|
||||||
|
|
||||||
|
function log(level, ...messages) {
|
||||||
|
if (silentMode && level !== 'error') {
|
||||||
|
return; // Suppress non-error logs in silent mode
|
||||||
|
}
|
||||||
|
|
||||||
|
const timestamp = new Date().toISOString();
|
||||||
|
const formattedMessage = messages.join(' ');
|
||||||
|
|
||||||
|
switch (level) {
|
||||||
|
case 'error':
|
||||||
|
console.error(`[ERROR] ${formattedMessage}`);
|
||||||
|
break;
|
||||||
|
case 'warn':
|
||||||
|
console.warn(`[WARN] ${formattedMessage}`);
|
||||||
|
break;
|
||||||
|
case 'info':
|
||||||
|
console.log(`[INFO] ${formattedMessage}`);
|
||||||
|
break;
|
||||||
|
case 'debug':
|
||||||
|
if (getDebugFlag()) {
|
||||||
|
console.log(`[DEBUG] ${formattedMessage}`);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(formattedMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function enableSilentMode() {
|
||||||
|
silentMode = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function disableSilentMode() {
|
||||||
|
silentMode = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isSilentMode() {
|
||||||
|
return silentMode;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Task Utilities
|
||||||
|
|
||||||
|
- **Task Finding and Manipulation**:
|
||||||
|
- ✅ DO: Use tagged task system aware functions
|
||||||
|
- ✅ DO: Handle both task and subtask operations
|
||||||
|
- ✅ DO: Validate task IDs before operations
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Implement tag-aware task utilities
|
||||||
|
function findTaskById(tasks, taskId) {
|
||||||
|
if (!Array.isArray(tasks)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return tasks.find(task => task.id === taskId) || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function findSubtaskById(tasks, parentId, subtaskId) {
|
||||||
|
const parentTask = findTaskById(tasks, parentId);
|
||||||
|
if (!parentTask || !parentTask.subtasks) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return parentTask.subtasks.find(subtask => subtask.id === subtaskId) || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNextTaskId(tasks) {
|
||||||
|
if (!Array.isArray(tasks) || tasks.length === 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const maxId = Math.max(...tasks.map(task => task.id));
|
||||||
|
return maxId + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNextSubtaskId(parentTask) {
|
||||||
|
if (!parentTask.subtasks || parentTask.subtasks.length === 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const maxId = Math.max(...parentTask.subtasks.map(subtask => subtask.id));
|
||||||
|
return maxId + 1;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## String Utilities
|
||||||
|
|
||||||
|
- **Text Processing**:
|
||||||
|
- ✅ DO: Handle text truncation appropriately
|
||||||
|
- ✅ DO: Provide consistent formatting functions
|
||||||
|
- ✅ DO: Support different output formats
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Implement useful string utilities
|
||||||
|
function truncate(str, maxLength = 50) {
|
||||||
|
if (!str || typeof str !== 'string') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (str.length <= maxLength) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
return str.substring(0, maxLength - 3) + '...';
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatDuration(ms) {
|
||||||
|
const seconds = Math.floor(ms / 1000);
|
||||||
|
const minutes = Math.floor(seconds / 60);
|
||||||
|
const hours = Math.floor(minutes / 60);
|
||||||
|
|
||||||
|
if (hours > 0) {
|
||||||
|
return `${hours}h ${minutes % 60}m ${seconds % 60}s`;
|
||||||
|
} else if (minutes > 0) {
|
||||||
|
return `${minutes}m ${seconds % 60}s`;
|
||||||
|
} else {
|
||||||
|
return `${seconds}s`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function capitalizeFirst(str) {
|
||||||
|
if (!str || typeof str !== 'string') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Dependency Management Utilities
|
||||||
|
|
||||||
|
- **Dependency Analysis**:
|
||||||
|
- ✅ DO: Detect circular dependencies
|
||||||
|
- ✅ DO: Validate dependency references
|
||||||
|
- ✅ DO: Support cross-tag dependency checking (future enhancement)
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Implement dependency utilities
|
||||||
|
function findCycles(tasks) {
|
||||||
|
const cycles = [];
|
||||||
|
const visited = new Set();
|
||||||
|
const recStack = new Set();
|
||||||
|
|
||||||
|
function dfs(taskId, path = []) {
|
||||||
|
if (recStack.has(taskId)) {
|
||||||
|
// Found a cycle
|
||||||
|
const cycleStart = path.indexOf(taskId);
|
||||||
|
const cycle = path.slice(cycleStart).concat([taskId]);
|
||||||
|
cycles.push(cycle);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (visited.has(taskId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
visited.add(taskId);
|
||||||
|
recStack.add(taskId);
|
||||||
|
|
||||||
|
const task = findTaskById(tasks, taskId);
|
||||||
|
if (task && task.dependencies) {
|
||||||
|
task.dependencies.forEach(depId => {
|
||||||
|
dfs(depId, path.concat([taskId]));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
recStack.delete(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.forEach(task => {
|
||||||
|
if (!visited.has(task.id)) {
|
||||||
|
dfs(task.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return cycles;
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateDependencies(tasks) {
|
||||||
|
const validationErrors = [];
|
||||||
|
const taskIds = new Set(tasks.map(task => task.id));
|
||||||
|
|
||||||
|
tasks.forEach(task => {
|
||||||
|
if (task.dependencies) {
|
||||||
|
task.dependencies.forEach(depId => {
|
||||||
|
if (!taskIds.has(depId)) {
|
||||||
|
validationErrors.push({
|
||||||
|
taskId: task.id,
|
||||||
|
invalidDependency: depId,
|
||||||
|
message: `Task ${task.id} depends on non-existent task ${depId}`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return validationErrors;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Environment and Configuration Utilities
|
||||||
|
|
||||||
|
- **Environment Variable Resolution**:
|
||||||
|
- ✅ DO: Support both `.env` files and MCP session environment
|
||||||
|
- ✅ DO: Provide fallbacks for missing values
|
||||||
|
- ✅ DO: Handle API key resolution correctly
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Implement flexible environment resolution
|
||||||
|
function resolveEnvVariable(key, sessionEnv = null) {
|
||||||
|
// First check session environment (for MCP)
|
||||||
|
if (sessionEnv && sessionEnv[key]) {
|
||||||
|
return sessionEnv[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Then check process environment
|
||||||
|
if (process.env[key]) {
|
||||||
|
return process.env[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Finally try .env file if in project root
|
||||||
|
try {
|
||||||
|
const projectRoot = findProjectRoot();
|
||||||
|
if (projectRoot) {
|
||||||
|
const envPath = path.join(projectRoot, '.env');
|
||||||
|
if (fs.existsSync(envPath)) {
|
||||||
|
const envContent = fs.readFileSync(envPath, 'utf8');
|
||||||
|
const lines = envContent.split('\n');
|
||||||
|
|
||||||
|
for (const line of lines) {
|
||||||
|
const [envKey, envValue] = line.split('=');
|
||||||
|
if (envKey && envKey.trim() === key) {
|
||||||
|
return envValue ? envValue.trim().replace(/^["']|["']$/g, '') : undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
log('debug', `Error reading .env file: ${error.message}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDebugFlag() {
|
||||||
|
const debugFlag = resolveEnvVariable('TASKMASTER_DEBUG') ||
|
||||||
|
resolveEnvVariable('DEBUG') ||
|
||||||
|
'false';
|
||||||
|
return debugFlag.toLowerCase() === 'true';
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Export Pattern
|
||||||
|
|
||||||
|
- **Module Exports**:
|
||||||
|
- ✅ DO: Export all utility functions explicitly
|
||||||
|
- ✅ DO: Group related functions logically
|
||||||
|
- ✅ DO: Include new tagged system utilities
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// ✅ DO: Export utilities in logical groups
|
||||||
|
module.exports = {
|
||||||
|
// File system utilities
|
||||||
|
readJSON,
|
||||||
|
writeJSON,
|
||||||
|
findProjectRoot,
|
||||||
|
|
||||||
|
// Tagged task system utilities
|
||||||
|
getTasksForTag,
|
||||||
|
setTasksForTag,
|
||||||
|
getCurrentTag,
|
||||||
|
performCompleteTagMigration,
|
||||||
|
migrateConfigJson,
|
||||||
|
createStateJson,
|
||||||
|
markMigrationForNotice,
|
||||||
|
|
||||||
|
// Logging utilities
|
||||||
|
log,
|
||||||
|
enableSilentMode,
|
||||||
|
disableSilentMode,
|
||||||
|
isSilentMode,
|
||||||
|
|
||||||
|
// Task utilities
|
||||||
|
findTaskById,
|
||||||
|
findSubtaskById,
|
||||||
|
getNextTaskId,
|
||||||
|
getNextSubtaskId,
|
||||||
|
|
||||||
|
// String utilities
|
||||||
|
truncate,
|
||||||
|
formatDuration,
|
||||||
|
capitalizeFirst,
|
||||||
|
|
||||||
|
// Dependency utilities
|
||||||
|
findCycles,
|
||||||
|
validateDependencies,
|
||||||
|
|
||||||
|
// Environment utilities
|
||||||
|
resolveEnvVariable,
|
||||||
|
getDebugFlag,
|
||||||
|
|
||||||
|
// Legacy utilities (maintained for compatibility)
|
||||||
|
aggregateTelemetry
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
Refer to [`utils.js`](mdc:scripts/modules/utils.js) for implementation examples and [`architecture.mdc`](mdc:.cursor/rules/architecture.mdc) for integration patterns.
|
||||||
|
|||||||
33
.env.example
33
.env.example
@@ -1,20 +1,15 @@
|
|||||||
# API Keys (Required)
|
# API Keys (Required for using in any role i.e. main/research/fallback -- see `task-master models`)
|
||||||
ANTHROPIC_API_KEY=your_anthropic_api_key_here # Format: sk-ant-api03-...
|
ANTHROPIC_API_KEY=YOUR_ANTHROPIC_KEY_HERE
|
||||||
PERPLEXITY_API_KEY=your_perplexity_api_key_here # Format: pplx-...
|
PERPLEXITY_API_KEY=YOUR_PERPLEXITY_KEY_HERE
|
||||||
|
OPENAI_API_KEY=YOUR_OPENAI_KEY_HERE
|
||||||
|
GOOGLE_API_KEY=YOUR_GOOGLE_KEY_HERE
|
||||||
|
MISTRAL_API_KEY=YOUR_MISTRAL_KEY_HERE
|
||||||
|
OPENROUTER_API_KEY=YOUR_OPENROUTER_KEY_HERE
|
||||||
|
XAI_API_KEY=YOUR_XAI_KEY_HERE
|
||||||
|
AZURE_OPENAI_API_KEY=YOUR_AZURE_KEY_HERE
|
||||||
|
|
||||||
# Model Configuration
|
# Google Vertex AI Configuration
|
||||||
MODEL=claude-3-7-sonnet-20250219 # Recommended models: claude-3-7-sonnet-20250219, claude-3-opus-20240229
|
VERTEX_PROJECT_ID=your-gcp-project-id
|
||||||
PERPLEXITY_MODEL=sonar-pro # Perplexity model for research-backed subtasks
|
VERTEX_LOCATION=us-central1
|
||||||
MAX_TOKENS=128000 # Maximum tokens for model responses
|
# Optional: Path to service account credentials JSON file (alternative to API key)
|
||||||
TEMPERATURE=0.2 # Temperature for model responses (0.0-1.0)
|
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-credentials.json
|
||||||
|
|
||||||
# Logging Configuration
|
|
||||||
DEBUG=false # Enable debug logging (true/false)
|
|
||||||
LOG_LEVEL=info # Log level (debug, info, warn, error)
|
|
||||||
|
|
||||||
# Task Generation Settings
|
|
||||||
DEFAULT_SUBTASKS=5 # Default number of subtasks when expanding
|
|
||||||
DEFAULT_PRIORITY=medium # Default priority for generated tasks (high, medium, low)
|
|
||||||
|
|
||||||
# Project Metadata (Optional)
|
|
||||||
PROJECT_NAME=Your Project Name # Override default project name in tasks.json
|
|
||||||
|
|||||||
39
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
39
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: 'bug: '
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
Detailed description of the problem, including steps to reproduce the issue.
|
||||||
|
|
||||||
|
### Steps to Reproduce
|
||||||
|
|
||||||
|
1. Step-by-step instructions to reproduce the issue
|
||||||
|
2. Include command examples or UI interactions
|
||||||
|
|
||||||
|
### Expected Behavior
|
||||||
|
|
||||||
|
Describe clearly what the expected outcome or behavior should be.
|
||||||
|
|
||||||
|
### Actual Behavior
|
||||||
|
|
||||||
|
Describe clearly what the actual outcome or behavior is.
|
||||||
|
|
||||||
|
### Screenshots or Logs
|
||||||
|
|
||||||
|
Provide screenshots, logs, or error messages if applicable.
|
||||||
|
|
||||||
|
### Environment
|
||||||
|
|
||||||
|
- Task Master version:
|
||||||
|
- Node.js version:
|
||||||
|
- Operating system:
|
||||||
|
- IDE (if applicable):
|
||||||
|
|
||||||
|
### Additional Context
|
||||||
|
|
||||||
|
Any additional information or context that might help diagnose the issue.
|
||||||
51
.github/ISSUE_TEMPLATE/enhancements---feature-requests.md
vendored
Normal file
51
.github/ISSUE_TEMPLATE/enhancements---feature-requests.md
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
name: Enhancements & feature requests
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: 'feat: '
|
||||||
|
labels: enhancement
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
> "Direct quote or clear summary of user request or need or user story."
|
||||||
|
|
||||||
|
### Motivation
|
||||||
|
|
||||||
|
Detailed explanation of why this feature is important. Describe the problem it solves or the benefit it provides.
|
||||||
|
|
||||||
|
### Proposed Solution
|
||||||
|
|
||||||
|
Clearly describe the proposed feature, including:
|
||||||
|
|
||||||
|
- High-level overview of the feature
|
||||||
|
- Relevant technologies or integrations
|
||||||
|
- How it fits into the existing workflow or architecture
|
||||||
|
|
||||||
|
### High-Level Workflow
|
||||||
|
|
||||||
|
1. Step-by-step description of how the feature will be implemented
|
||||||
|
2. Include necessary intermediate milestones
|
||||||
|
|
||||||
|
### Key Elements
|
||||||
|
|
||||||
|
- Bullet-point list of technical or UX/UI enhancements
|
||||||
|
- Mention specific integrations or APIs
|
||||||
|
- Highlight changes needed in existing data models or commands
|
||||||
|
|
||||||
|
### Example Workflow
|
||||||
|
|
||||||
|
Provide a clear, concrete example demonstrating the feature:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ task-master [action]
|
||||||
|
→ Expected response/output
|
||||||
|
```
|
||||||
|
|
||||||
|
### Implementation Considerations
|
||||||
|
|
||||||
|
- Dependencies on external components or APIs
|
||||||
|
- Backward compatibility requirements
|
||||||
|
- Potential performance impacts or resource usage
|
||||||
|
|
||||||
|
### Out of Scope (Future Considerations)
|
||||||
|
|
||||||
|
Clearly list any features or improvements not included but relevant for future iterations.
|
||||||
31
.github/ISSUE_TEMPLATE/feedback.md
vendored
Normal file
31
.github/ISSUE_TEMPLATE/feedback.md
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
name: Feedback
|
||||||
|
about: Give us specific feedback on the product/approach/tech
|
||||||
|
title: 'feedback: '
|
||||||
|
labels: feedback
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
### Feedback Summary
|
||||||
|
|
||||||
|
Provide a clear summary or direct quote from user feedback.
|
||||||
|
|
||||||
|
### User Context
|
||||||
|
|
||||||
|
Explain the user's context or scenario in which this feedback was provided.
|
||||||
|
|
||||||
|
### User Impact
|
||||||
|
|
||||||
|
Describe how this feedback affects the user experience or workflow.
|
||||||
|
|
||||||
|
### Suggestions
|
||||||
|
|
||||||
|
Provide any initial thoughts, potential solutions, or improvements based on the feedback.
|
||||||
|
|
||||||
|
### Relevant Screenshots or Examples
|
||||||
|
|
||||||
|
Attach screenshots, logs, or examples that illustrate the feedback.
|
||||||
|
|
||||||
|
### Additional Notes
|
||||||
|
|
||||||
|
Any additional context or related information.
|
||||||
62
.github/workflows/pre-release.yml
vendored
Normal file
62
.github/workflows/pre-release.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
name: Pre-Release (RC)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # Allows manual triggering from GitHub UI/API
|
||||||
|
|
||||||
|
concurrency: pre-release-${{ github.ref }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
rc:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Cache node_modules
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
node_modules
|
||||||
|
*/*/node_modules
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
timeout-minutes: 2
|
||||||
|
|
||||||
|
- name: Enter RC mode
|
||||||
|
run: |
|
||||||
|
npx changeset pre exit || true
|
||||||
|
npx changeset pre enter rc
|
||||||
|
|
||||||
|
- name: Version RC packages
|
||||||
|
run: npx changeset version
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
|
- name: Create Release Candidate Pull Request or Publish Release Candidate to npm
|
||||||
|
uses: changesets/action@v1
|
||||||
|
with:
|
||||||
|
publish: npm run release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
|
- name: Exit RC mode
|
||||||
|
run: npx changeset pre exit
|
||||||
|
|
||||||
|
- name: Commit & Push changes
|
||||||
|
uses: actions-js/push@master
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
branch: ${{ github.ref }}
|
||||||
|
message: 'chore: rc version bump'
|
||||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -3,6 +3,9 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -30,6 +33,9 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
timeout-minutes: 2
|
timeout-minutes: 2
|
||||||
|
|
||||||
|
- name: Exit pre-release mode (safety check)
|
||||||
|
run: npx changeset pre exit || true
|
||||||
|
|
||||||
- name: Create Release Pull Request or Publish to npm
|
- name: Create Release Pull Request or Publish to npm
|
||||||
uses: changesets/action@v1
|
uses: changesets/action@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
40
.github/workflows/update-models-md.yml
vendored
Normal file
40
.github/workflows/update-models-md.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: Update models.md from supported-models.json
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- next
|
||||||
|
paths:
|
||||||
|
- 'scripts/modules/supported-models.json'
|
||||||
|
- 'docs/scripts/models-json-to-markdown.js'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update_markdown:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: Run transformation script
|
||||||
|
run: node docs/scripts/models-json-to-markdown.js
|
||||||
|
|
||||||
|
- name: Format Markdown with Prettier
|
||||||
|
run: npx prettier --write docs/models.md
|
||||||
|
|
||||||
|
- name: Stage docs/models.md
|
||||||
|
run: git add docs/models.md
|
||||||
|
|
||||||
|
- name: Commit & Push docs/models.md
|
||||||
|
uses: actions-js/push@master
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
branch: ${{ github.ref_name }}
|
||||||
|
message: 'docs: Auto-update and format models.md'
|
||||||
|
author_name: 'github-actions[bot]'
|
||||||
|
author_email: 'github-actions[bot]@users.noreply.github.com'
|
||||||
20
.gitignore
vendored
20
.gitignore
vendored
@@ -21,9 +21,24 @@ yarn-error.log*
|
|||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
# Coverage directory used by tools like istanbul
|
||||||
coverage
|
coverage/
|
||||||
*.lcov
|
*.lcov
|
||||||
|
|
||||||
|
# Jest cache
|
||||||
|
.jest/
|
||||||
|
|
||||||
|
# Test temporary files and directories
|
||||||
|
tests/temp/
|
||||||
|
tests/e2e/_runs/
|
||||||
|
tests/e2e/log/
|
||||||
|
tests/**/*.log
|
||||||
|
tests/**/coverage/
|
||||||
|
|
||||||
|
# Test database files (if any)
|
||||||
|
tests/**/*.db
|
||||||
|
tests/**/*.sqlite
|
||||||
|
tests/**/*.sqlite3
|
||||||
|
|
||||||
# Optional npm cache directory
|
# Optional npm cache directory
|
||||||
.npm
|
.npm
|
||||||
|
|
||||||
@@ -59,3 +74,6 @@ dist
|
|||||||
*.debug
|
*.debug
|
||||||
init-debug.log
|
init-debug.log
|
||||||
dev-debug.log
|
dev-debug.log
|
||||||
|
|
||||||
|
# NPMRC
|
||||||
|
.npmrc
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
# Ignore artifacts:
|
|
||||||
build
|
|
||||||
coverage
|
|
||||||
.changeset
|
|
||||||
tasks
|
|
||||||
package-lock.json
|
|
||||||
11
.prettierrc
11
.prettierrc
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 80,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"useTabs": true,
|
|
||||||
"semi": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"trailingComma": "none",
|
|
||||||
"bracketSpacing": true,
|
|
||||||
"arrowParens": "always",
|
|
||||||
"endOfLine": "lf"
|
|
||||||
}
|
|
||||||
34
.taskmaster/config.json
Normal file
34
.taskmaster/config.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"models": {
|
||||||
|
"main": {
|
||||||
|
"provider": "anthropic",
|
||||||
|
"modelId": "claude-sonnet-4-20250514",
|
||||||
|
"maxTokens": 50000,
|
||||||
|
"temperature": 0.2
|
||||||
|
},
|
||||||
|
"research": {
|
||||||
|
"provider": "perplexity",
|
||||||
|
"modelId": "sonar-pro",
|
||||||
|
"maxTokens": 8700,
|
||||||
|
"temperature": 0.1
|
||||||
|
},
|
||||||
|
"fallback": {
|
||||||
|
"provider": "anthropic",
|
||||||
|
"modelId": "claude-3-7-sonnet-20250219",
|
||||||
|
"maxTokens": 128000,
|
||||||
|
"temperature": 0.2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"global": {
|
||||||
|
"userId": "1234567890",
|
||||||
|
"logLevel": "info",
|
||||||
|
"debug": false,
|
||||||
|
"defaultSubtasks": 5,
|
||||||
|
"defaultPriority": "medium",
|
||||||
|
"projectName": "Taskmaster",
|
||||||
|
"ollamaBaseURL": "http://localhost:11434/api",
|
||||||
|
"bedrockBaseURL": "https://bedrock.us-east-1.amazonaws.com",
|
||||||
|
"azureBaseURL": "https://your-endpoint.azure.com/",
|
||||||
|
"defaultTag": "master"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,7 +32,7 @@ The script can be configured through environment variables in a `.env` file at t
|
|||||||
- `PERPLEXITY_API_KEY`: Your Perplexity API key for research-backed subtask generation
|
- `PERPLEXITY_API_KEY`: Your Perplexity API key for research-backed subtask generation
|
||||||
- `PERPLEXITY_MODEL`: Specify which Perplexity model to use (default: "sonar-medium-online")
|
- `PERPLEXITY_MODEL`: Specify which Perplexity model to use (default: "sonar-medium-online")
|
||||||
- `DEBUG`: Enable debug logging (default: false)
|
- `DEBUG`: Enable debug logging (default: false)
|
||||||
- `LOG_LEVEL`: Log level - debug, info, warn, error (default: info)
|
- `TASKMASTER_LOG_LEVEL`: Log level - debug, info, warn, error (default: info)
|
||||||
- `DEFAULT_SUBTASKS`: Default number of subtasks when expanding (default: 3)
|
- `DEFAULT_SUBTASKS`: Default number of subtasks when expanding (default: 3)
|
||||||
- `DEFAULT_PRIORITY`: Default priority for generated tasks (default: medium)
|
- `DEFAULT_PRIORITY`: Default priority for generated tasks (default: medium)
|
||||||
- `PROJECT_NAME`: Override default project name in tasks.json
|
- `PROJECT_NAME`: Override default project name in tasks.json
|
||||||
@@ -225,7 +225,7 @@ To use the Perplexity integration:
|
|||||||
|
|
||||||
## Logging
|
## Logging
|
||||||
|
|
||||||
The script supports different logging levels controlled by the `LOG_LEVEL` environment variable:
|
The script supports different logging levels controlled by the `TASKMASTER_LOG_LEVEL` environment variable:
|
||||||
|
|
||||||
- `debug`: Detailed information, typically useful for troubleshooting
|
- `debug`: Detailed information, typically useful for troubleshooting
|
||||||
- `info`: Confirmation that things are working as expected (default)
|
- `info`: Confirmation that things are working as expected (default)
|
||||||
42
.taskmaster/docs/research/2025-06-13_what-is-typescript.md
Normal file
42
.taskmaster/docs/research/2025-06-13_what-is-typescript.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
title: Research Session
|
||||||
|
query: "What is TypeScript?"
|
||||||
|
date: 6/13/2025
|
||||||
|
time: 3:07:41 PM
|
||||||
|
timestamp: 2025-06-13T19:07:41.313Z
|
||||||
|
exchanges: 2
|
||||||
|
---
|
||||||
|
|
||||||
|
# Research Session
|
||||||
|
|
||||||
|
**Query:** What is TypeScript?
|
||||||
|
**Date:** 6/13/2025 3:07:41 PM
|
||||||
|
**Exchanges:** 2
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Initial Query
|
||||||
|
|
||||||
|
**Question:** What is TypeScript?
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
|
||||||
|
TypeScript is a strongly typed, object-oriented programming language that builds on JavaScript by adding static typing and type annotations. It is a syntactic superset of JavaScript, meaning all JavaScript code is valid TypeScript, but TypeScript adds extra syntax to specify types, enabling compile-time type checking and better tooling support. This helps catch errors early before running the code and improves code quality, especially in large-scale applications. TypeScript code is transpiled to plain JavaScript, which can run anywhere JavaScript runs, such as browsers, Node.js, or Deno. It is developed and maintained by Microsoft as open-source software under the Apache 2.0 license[1][2][3][4][5].
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Follow-up 1
|
||||||
|
|
||||||
|
**Question:** And why is the sky blue?
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
|
||||||
|
- The sky appears blue because sunlight interacts with Earth's atmosphere, and the shorter wavelengths of light (blue and violet) are scattered in all directions by air molecules—a process called Rayleigh scattering[1][2][3][5].
|
||||||
|
- Blue light is scattered more than red light because it has a shorter wavelength, making the sky look blue to our eyes during the day[2][3][5].
|
||||||
|
- If Earth's atmosphere didn't scatter sunlight, the sky would appear dark, as it does on the Moon, which lacks an atmosphere[5].
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Generated by Task Master Research Command*
|
||||||
|
*Timestamp: 2025-06-13T19:07:41.313Z*
|
||||||
373
.taskmaster/reports/task-complexity-report.json
Normal file
373
.taskmaster/reports/task-complexity-report.json
Normal file
@@ -0,0 +1,373 @@
|
|||||||
|
{
|
||||||
|
"meta": {
|
||||||
|
"generatedAt": "2025-05-27T16:34:53.088Z",
|
||||||
|
"tasksAnalyzed": 1,
|
||||||
|
"totalTasks": 84,
|
||||||
|
"analysisCount": 45,
|
||||||
|
"thresholdScore": 5,
|
||||||
|
"projectName": "Taskmaster",
|
||||||
|
"usedResearch": true
|
||||||
|
},
|
||||||
|
"complexityAnalysis": [
|
||||||
|
{
|
||||||
|
"taskId": 24,
|
||||||
|
"taskTitle": "Implement AI-Powered Test Generation Command",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "Break down the implementation of the AI-powered test generation command into detailed subtasks covering: command structure setup, AI prompt engineering, test file generation logic, integration with Claude API, and comprehensive error handling.",
|
||||||
|
"reasoning": "This task involves complex integration with an AI service (Claude), requires sophisticated prompt engineering, and needs to generate structured code files. The existing 3 subtasks are a good start but could be expanded to include more detailed steps for AI integration, error handling, and test file formatting."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 26,
|
||||||
|
"taskTitle": "Implement Context Foundation for AI Operations",
|
||||||
|
"complexityScore": 6,
|
||||||
|
"recommendedSubtasks": 4,
|
||||||
|
"expansionPrompt": "The current 4 subtasks for implementing the context foundation appear comprehensive. Consider if any additional subtasks are needed for testing, documentation, or integration with existing systems.",
|
||||||
|
"reasoning": "This task involves creating a foundation for context integration with several well-defined components. The existing 4 subtasks cover the main implementation areas (context-file flag, cursor rules integration, context extraction utility, and command handler updates). The complexity is moderate as it requires careful integration with existing systems but has clear requirements."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 27,
|
||||||
|
"taskTitle": "Implement Context Enhancements for AI Operations",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 4,
|
||||||
|
"expansionPrompt": "The current 4 subtasks for implementing context enhancements appear well-structured. Consider if any additional subtasks are needed for testing, documentation, or performance optimization.",
|
||||||
|
"reasoning": "This task builds upon the foundation from Task #26 and adds more sophisticated context handling features. The 4 existing subtasks cover the main implementation areas (code context extraction, task history context, PRD context integration, and context formatting). The complexity is higher than the foundation task due to the need for intelligent context selection and optimization."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 28,
|
||||||
|
"taskTitle": "Implement Advanced ContextManager System",
|
||||||
|
"complexityScore": 8,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "The current 5 subtasks for implementing the advanced ContextManager system appear comprehensive. Consider if any additional subtasks are needed for testing, documentation, or backward compatibility with previous context implementations.",
|
||||||
|
"reasoning": "This task represents the most complex phase of the context implementation, requiring a sophisticated class design, optimization algorithms, and integration with multiple systems. The 5 existing subtasks cover the core implementation areas, but the complexity is high due to the need for intelligent context prioritization, token management, and performance monitoring."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 40,
|
||||||
|
"taskTitle": "Implement 'plan' Command for Task Implementation Planning",
|
||||||
|
"complexityScore": 5,
|
||||||
|
"recommendedSubtasks": 4,
|
||||||
|
"expansionPrompt": "The current 4 subtasks for implementing the 'plan' command appear well-structured. Consider if any additional subtasks are needed for testing, documentation, or integration with existing task management workflows.",
|
||||||
|
"reasoning": "This task involves creating a new command that leverages AI to generate implementation plans. The existing 4 subtasks cover the main implementation areas (retrieving task content, generating plans with AI, formatting in XML, and error handling). The complexity is moderate as it builds on existing patterns for task updates but requires careful AI integration."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 41,
|
||||||
|
"taskTitle": "Implement Visual Task Dependency Graph in Terminal",
|
||||||
|
"complexityScore": 8,
|
||||||
|
"recommendedSubtasks": 10,
|
||||||
|
"expansionPrompt": "The current 10 subtasks for implementing the visual task dependency graph appear comprehensive. Consider if any additional subtasks are needed for performance optimization with large graphs or additional visualization options.",
|
||||||
|
"reasoning": "This task involves creating a sophisticated visualization system for terminal display, which is inherently complex due to layout algorithms, ASCII/Unicode rendering, and handling complex dependency relationships. The 10 existing subtasks cover all major aspects of implementation, from CLI interface to accessibility features."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 42,
|
||||||
|
"taskTitle": "Implement MCP-to-MCP Communication Protocol",
|
||||||
|
"complexityScore": 9,
|
||||||
|
"recommendedSubtasks": 8,
|
||||||
|
"expansionPrompt": "The current 8 subtasks for implementing the MCP-to-MCP communication protocol appear well-structured. Consider if any additional subtasks are needed for security hardening, performance optimization, or comprehensive documentation.",
|
||||||
|
"reasoning": "This task involves designing and implementing a complex communication protocol between different MCP tools and servers. It requires sophisticated adapter patterns, client-server architecture, and handling of multiple operational modes. The complexity is very high due to the need for standardization, security, and backward compatibility."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 44,
|
||||||
|
"taskTitle": "Implement Task Automation with Webhooks and Event Triggers",
|
||||||
|
"complexityScore": 8,
|
||||||
|
"recommendedSubtasks": 7,
|
||||||
|
"expansionPrompt": "The current 7 subtasks for implementing task automation with webhooks appear comprehensive. Consider if any additional subtasks are needed for security testing, rate limiting implementation, or webhook monitoring tools.",
|
||||||
|
"reasoning": "This task involves creating a sophisticated event system with webhooks for integration with external services. The complexity is high due to the need for secure authentication, reliable delivery mechanisms, and handling of various webhook formats and protocols. The existing subtasks cover the main implementation areas but security and monitoring could be emphasized more."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 45,
|
||||||
|
"taskTitle": "Implement GitHub Issue Import Feature",
|
||||||
|
"complexityScore": 6,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "The current 5 subtasks for implementing the GitHub issue import feature appear well-structured. Consider if any additional subtasks are needed for handling GitHub API rate limiting, caching, or supporting additional issue metadata.",
|
||||||
|
"reasoning": "This task involves integrating with the GitHub API to import issues as tasks. The complexity is moderate as it requires API authentication, data mapping, and error handling. The existing 5 subtasks cover the main implementation areas from design to end-to-end implementation."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 46,
|
||||||
|
"taskTitle": "Implement ICE Analysis Command for Task Prioritization",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "The current 5 subtasks for implementing the ICE analysis command appear comprehensive. Consider if any additional subtasks are needed for visualization of ICE scores or integration with other prioritization methods.",
|
||||||
|
"reasoning": "This task involves creating an AI-powered analysis system for task prioritization using the ICE methodology. The complexity is high due to the need for sophisticated scoring algorithms, AI integration, and report generation. The existing subtasks cover the main implementation areas from algorithm design to integration with existing systems."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 47,
|
||||||
|
"taskTitle": "Enhance Task Suggestion Actions Card Workflow",
|
||||||
|
"complexityScore": 6,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "The current 6 subtasks for enhancing the task suggestion actions card workflow appear well-structured. Consider if any additional subtasks are needed for user testing, accessibility improvements, or performance optimization.",
|
||||||
|
"reasoning": "This task involves redesigning the UI workflow for task expansion and management. The complexity is moderate as it requires careful UX design and state management but builds on existing components. The 6 existing subtasks cover the main implementation areas from design to testing."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 48,
|
||||||
|
"taskTitle": "Refactor Prompts into Centralized Structure",
|
||||||
|
"complexityScore": 4,
|
||||||
|
"recommendedSubtasks": 3,
|
||||||
|
"expansionPrompt": "The current 3 subtasks for refactoring prompts into a centralized structure appear appropriate. Consider if any additional subtasks are needed for prompt versioning, documentation, or testing.",
|
||||||
|
"reasoning": "This task involves a straightforward refactoring to improve code organization. The complexity is relatively low as it primarily involves moving code rather than creating new functionality. The 3 existing subtasks cover the main implementation areas from directory structure to integration."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 49,
|
||||||
|
"taskTitle": "Implement Code Quality Analysis Command",
|
||||||
|
"complexityScore": 8,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "The current 6 subtasks for implementing the code quality analysis command appear comprehensive. Consider if any additional subtasks are needed for performance optimization with large codebases or integration with existing code quality tools.",
|
||||||
|
"reasoning": "This task involves creating a sophisticated code analysis system with pattern recognition, best practice verification, and AI-powered recommendations. The complexity is high due to the need for code parsing, complex analysis algorithms, and integration with AI services. The existing subtasks cover the main implementation areas from algorithm design to user interface."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 50,
|
||||||
|
"taskTitle": "Implement Test Coverage Tracking System by Task",
|
||||||
|
"complexityScore": 9,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "The current 5 subtasks for implementing the test coverage tracking system appear well-structured. Consider if any additional subtasks are needed for integration with CI/CD systems, performance optimization, or visualization tools.",
|
||||||
|
"reasoning": "This task involves creating a complex system that maps test coverage to specific tasks and subtasks. The complexity is very high due to the need for sophisticated data structures, integration with coverage tools, and AI-powered test generation. The existing subtasks are comprehensive and cover the main implementation areas from data structure design to AI integration."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 51,
|
||||||
|
"taskTitle": "Implement Perplexity Research Command",
|
||||||
|
"complexityScore": 6,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "The current 5 subtasks for implementing the Perplexity research command appear comprehensive. Consider if any additional subtasks are needed for caching optimization, result formatting, or integration with other research tools.",
|
||||||
|
"reasoning": "This task involves creating a new command that integrates with the Perplexity AI API for research. The complexity is moderate as it requires API integration, context extraction, and result formatting. The 5 existing subtasks cover the main implementation areas from API client to caching system."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 52,
|
||||||
|
"taskTitle": "Implement Task Suggestion Command for CLI",
|
||||||
|
"complexityScore": 6,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "The current 5 subtasks for implementing the task suggestion command appear well-structured. Consider if any additional subtasks are needed for suggestion quality evaluation, user feedback collection, or integration with existing task workflows.",
|
||||||
|
"reasoning": "This task involves creating a new CLI command that generates contextually relevant task suggestions using AI. The complexity is moderate as it requires AI integration, context collection, and interactive CLI interfaces. The existing subtasks cover the main implementation areas from data collection to user interface."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 53,
|
||||||
|
"taskTitle": "Implement Subtask Suggestion Feature for Parent Tasks",
|
||||||
|
"complexityScore": 6,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "The current 6 subtasks for implementing the subtask suggestion feature appear comprehensive. Consider if any additional subtasks are needed for suggestion quality metrics, user feedback collection, or performance optimization.",
|
||||||
|
"reasoning": "This task involves creating a feature that suggests contextually relevant subtasks for parent tasks. The complexity is moderate as it builds on existing task management systems but requires sophisticated AI integration and context analysis. The 6 existing subtasks cover the main implementation areas from validation to testing."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 55,
|
||||||
|
"taskTitle": "Implement Positional Arguments Support for CLI Commands",
|
||||||
|
"complexityScore": 5,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "The current 5 subtasks for implementing positional arguments support appear well-structured. Consider if any additional subtasks are needed for backward compatibility testing, documentation updates, or user experience improvements.",
|
||||||
|
"reasoning": "This task involves modifying the command parsing logic to support positional arguments alongside the existing flag-based syntax. The complexity is moderate as it requires careful handling of different argument styles and edge cases. The 5 existing subtasks cover the main implementation areas from analysis to documentation."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 57,
|
||||||
|
"taskTitle": "Enhance Task-Master CLI User Experience and Interface",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "The current 6 subtasks for enhancing the CLI user experience appear comprehensive. Consider if any additional subtasks are needed for accessibility testing, internationalization, or performance optimization.",
|
||||||
|
"reasoning": "This task involves a significant overhaul of the CLI interface to improve user experience. The complexity is high due to the breadth of changes (logging, visual elements, interactive components, etc.) and the need for consistent design across all commands. The 6 existing subtasks cover the main implementation areas from log management to help systems."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 60,
|
||||||
|
"taskTitle": "Implement Mentor System with Round-Table Discussion Feature",
|
||||||
|
"complexityScore": 8,
|
||||||
|
"recommendedSubtasks": 7,
|
||||||
|
"expansionPrompt": "The current 7 subtasks for implementing the mentor system appear well-structured. Consider if any additional subtasks are needed for mentor personality consistency, discussion quality evaluation, or performance optimization with multiple mentors.",
|
||||||
|
"reasoning": "This task involves creating a sophisticated mentor simulation system with round-table discussions. The complexity is high due to the need for personality simulation, complex LLM integration, and structured discussion management. The 7 existing subtasks cover the main implementation areas from architecture to testing."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 62,
|
||||||
|
"taskTitle": "Add --simple Flag to Update Commands for Direct Text Input",
|
||||||
|
"complexityScore": 4,
|
||||||
|
"recommendedSubtasks": 8,
|
||||||
|
"expansionPrompt": "The current 8 subtasks for implementing the --simple flag appear comprehensive. Consider if any additional subtasks are needed for user experience testing or documentation updates.",
|
||||||
|
"reasoning": "This task involves adding a simple flag option to bypass AI processing for updates. The complexity is relatively low as it primarily involves modifying existing command handlers and adding a flag. The 8 existing subtasks are very detailed and cover all aspects of implementation from command parsing to testing."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 63,
|
||||||
|
"taskTitle": "Add pnpm Support for the Taskmaster Package",
|
||||||
|
"complexityScore": 5,
|
||||||
|
"recommendedSubtasks": 8,
|
||||||
|
"expansionPrompt": "The current 8 subtasks for adding pnpm support appear comprehensive. Consider if any additional subtasks are needed for CI/CD integration, performance comparison, or documentation updates.",
|
||||||
|
"reasoning": "This task involves ensuring the package works correctly with pnpm as an alternative package manager. The complexity is moderate as it requires careful testing of installation processes and scripts across different environments. The 8 existing subtasks cover all major aspects from documentation to binary verification."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 64,
|
||||||
|
"taskTitle": "Add Yarn Support for Taskmaster Installation",
|
||||||
|
"complexityScore": 5,
|
||||||
|
"recommendedSubtasks": 9,
|
||||||
|
"expansionPrompt": "The current 9 subtasks for adding Yarn support appear comprehensive. Consider if any additional subtasks are needed for performance testing, CI/CD integration, or compatibility with different Yarn versions.",
|
||||||
|
"reasoning": "This task involves ensuring the package works correctly with Yarn as an alternative package manager. The complexity is moderate as it requires careful testing of installation processes and scripts across different environments. The 9 existing subtasks are very detailed and cover all aspects from configuration to testing."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 65,
|
||||||
|
"taskTitle": "Add Bun Support for Taskmaster Installation",
|
||||||
|
"complexityScore": 6,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "The current 6 subtasks for adding Bun support appear well-structured. Consider if any additional subtasks are needed for handling Bun-specific issues, performance testing, or documentation updates.",
|
||||||
|
"reasoning": "This task involves adding support for the newer Bun package manager. The complexity is slightly higher than the other package manager tasks due to Bun's differences from Node.js and potential compatibility issues. The 6 existing subtasks cover the main implementation areas from research to documentation."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 67,
|
||||||
|
"taskTitle": "Add CLI JSON output and Cursor keybindings integration",
|
||||||
|
"complexityScore": 5,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "The current 5 subtasks for implementing JSON output and Cursor keybindings appear well-structured. Consider if any additional subtasks are needed for testing across different operating systems, documentation updates, or user experience improvements.",
|
||||||
|
"reasoning": "This task involves two distinct features: adding JSON output to CLI commands and creating a keybindings installation command. The complexity is moderate as it requires careful handling of different output formats and OS-specific file paths. The 5 existing subtasks cover the main implementation areas for both features."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 68,
|
||||||
|
"taskTitle": "Ability to create tasks without parsing PRD",
|
||||||
|
"complexityScore": 3,
|
||||||
|
"recommendedSubtasks": 2,
|
||||||
|
"expansionPrompt": "The current 2 subtasks for implementing task creation without PRD appear appropriate. Consider if any additional subtasks are needed for validation, error handling, or integration with existing task management workflows.",
|
||||||
|
"reasoning": "This task involves a relatively simple modification to allow task creation without requiring a PRD document. The complexity is low as it primarily involves creating a form interface and saving functionality. The 2 existing subtasks cover the main implementation areas of UI design and data saving."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 72,
|
||||||
|
"taskTitle": "Implement PDF Generation for Project Progress and Dependency Overview",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "The current 6 subtasks for implementing PDF generation appear comprehensive. Consider if any additional subtasks are needed for handling large projects, additional visualization options, or integration with existing reporting tools.",
|
||||||
|
"reasoning": "This task involves creating a feature to generate PDF reports of project progress and dependency visualization. The complexity is high due to the need for PDF generation, data collection, and visualization integration. The 6 existing subtasks cover the main implementation areas from library selection to export options."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 75,
|
||||||
|
"taskTitle": "Integrate Google Search Grounding for Research Role",
|
||||||
|
"complexityScore": 5,
|
||||||
|
"recommendedSubtasks": 4,
|
||||||
|
"expansionPrompt": "The current 4 subtasks for integrating Google Search Grounding appear well-structured. Consider if any additional subtasks are needed for testing with different query types, error handling, or performance optimization.",
|
||||||
|
"reasoning": "This task involves updating the AI service layer to enable Google Search Grounding for research roles. The complexity is moderate as it requires careful integration with the existing AI service architecture and conditional logic. The 4 existing subtasks cover the main implementation areas from service layer modification to testing."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 76,
|
||||||
|
"taskTitle": "Develop E2E Test Framework for Taskmaster MCP Server (FastMCP over stdio)",
|
||||||
|
"complexityScore": 8,
|
||||||
|
"recommendedSubtasks": 7,
|
||||||
|
"expansionPrompt": "The current 7 subtasks for developing the E2E test framework appear comprehensive. Consider if any additional subtasks are needed for test result reporting, CI/CD integration, or performance benchmarking.",
|
||||||
|
"reasoning": "This task involves creating a sophisticated end-to-end testing framework for the MCP server. The complexity is high due to the need for subprocess management, protocol handling, and robust test case definition. The 7 existing subtasks cover the main implementation areas from architecture to documentation."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 77,
|
||||||
|
"taskTitle": "Implement AI Usage Telemetry for Taskmaster (with external analytics endpoint)",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 18,
|
||||||
|
"expansionPrompt": "The current 18 subtasks for implementing AI usage telemetry appear very comprehensive. Consider if any additional subtasks are needed for security hardening, privacy compliance, or user feedback collection.",
|
||||||
|
"reasoning": "This task involves creating a telemetry system to track AI usage metrics. The complexity is high due to the need for secure data transmission, comprehensive data collection, and integration across multiple commands. The 18 existing subtasks are extremely detailed and cover all aspects of implementation from core utility to provider-specific updates."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 80,
|
||||||
|
"taskTitle": "Implement Unique User ID Generation and Storage During Installation",
|
||||||
|
"complexityScore": 4,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "The current 5 subtasks for implementing unique user ID generation appear well-structured. Consider if any additional subtasks are needed for privacy compliance, security auditing, or integration with the telemetry system.",
|
||||||
|
"reasoning": "This task involves generating and storing a unique user identifier during installation. The complexity is relatively low as it primarily involves UUID generation and configuration file management. The 5 existing subtasks cover the main implementation areas from script structure to documentation."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 81,
|
||||||
|
"taskTitle": "Task #81: Implement Comprehensive Local Telemetry System with Future Server Integration Capability",
|
||||||
|
"complexityScore": 8,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "The current 6 subtasks for implementing the comprehensive local telemetry system appear well-structured. Consider if any additional subtasks are needed for data migration, storage optimization, or visualization tools.",
|
||||||
|
"reasoning": "This task involves expanding the telemetry system to capture additional metrics and implement local storage with future server integration capability. The complexity is high due to the breadth of data collection, storage requirements, and privacy considerations. The 6 existing subtasks cover the main implementation areas from data collection to user-facing benefits."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 82,
|
||||||
|
"taskTitle": "Update supported-models.json with token limit fields",
|
||||||
|
"complexityScore": 3,
|
||||||
|
"recommendedSubtasks": 1,
|
||||||
|
"expansionPrompt": "This task appears straightforward enough to be implemented without further subtasks. Focus on researching accurate token limit values for each model and ensuring backward compatibility.",
|
||||||
|
"reasoning": "This task involves a simple update to the supported-models.json file to include new token limit fields. The complexity is low as it primarily involves research and data entry. No subtasks are necessary as the task is well-defined and focused."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 83,
|
||||||
|
"taskTitle": "Update config-manager.js defaults and getters",
|
||||||
|
"complexityScore": 4,
|
||||||
|
"recommendedSubtasks": 1,
|
||||||
|
"expansionPrompt": "This task appears straightforward enough to be implemented without further subtasks. Focus on updating the DEFAULTS object and related getter functions while maintaining backward compatibility.",
|
||||||
|
"reasoning": "This task involves updating the config-manager.js module to replace maxTokens with more specific token limit fields. The complexity is relatively low as it primarily involves modifying existing code rather than creating new functionality. No subtasks are necessary as the task is well-defined and focused."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 84,
|
||||||
|
"taskTitle": "Implement token counting utility",
|
||||||
|
"complexityScore": 5,
|
||||||
|
"recommendedSubtasks": 1,
|
||||||
|
"expansionPrompt": "This task appears well-defined enough to be implemented without further subtasks. Focus on implementing accurate token counting for different models and proper fallback mechanisms.",
|
||||||
|
"reasoning": "This task involves creating a utility function to count tokens for different AI models. The complexity is moderate as it requires integration with the tiktoken library and handling different tokenization schemes. No subtasks are necessary as the task is well-defined and focused."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 69,
|
||||||
|
"taskTitle": "Enhance Analyze Complexity for Specific Task IDs",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "Break down the task 'Enhance Analyze Complexity for Specific Task IDs' into 6 subtasks focusing on: 1) Core logic modification to accept ID parameters, 2) Report merging functionality, 3) CLI interface updates, 4) MCP tool integration, 5) Documentation updates, and 6) Comprehensive testing across all components.",
|
||||||
|
"reasoning": "This task involves modifying existing functionality across multiple components (core logic, CLI, MCP) with complex logic for filtering tasks and merging reports. The implementation requires careful handling of different parameter combinations and edge cases. The task has interdependent components that need to work together seamlessly, and the report merging functionality adds significant complexity."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 70,
|
||||||
|
"taskTitle": "Implement 'diagram' command for Mermaid diagram generation",
|
||||||
|
"complexityScore": 6,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "Break down the 'diagram' command implementation into 5 subtasks: 1) Command interface and parameter handling, 2) Task data extraction and transformation to Mermaid syntax, 3) Diagram rendering with status color coding, 4) Output formatting and file export functionality, and 5) Error handling and edge case management.",
|
||||||
|
"reasoning": "This task requires implementing a new feature rather than modifying existing code, which reduces complexity from integration challenges. However, it involves working with visualization logic, dependency mapping, and multiple output formats. The color coding based on status and handling of dependency relationships adds moderate complexity. The task is well-defined but requires careful attention to diagram formatting and error handling."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 85,
|
||||||
|
"taskTitle": "Update ai-services-unified.js for dynamic token limits",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "Break down the update of ai-services-unified.js for dynamic token limits into subtasks such as: (1) Import and integrate the token counting utility, (2) Refactor _unifiedServiceRunner to calculate and enforce dynamic token limits, (3) Update error handling for token limit violations, (4) Add and verify logging for token usage, (5) Write and execute tests for various prompt and model scenarios.",
|
||||||
|
"reasoning": "This task involves significant code changes to a core function, integration of a new utility, dynamic logic for multiple models, and robust error handling. It also requires comprehensive testing for edge cases and integration, making it moderately complex and best managed by splitting into focused subtasks."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 87,
|
||||||
|
"taskTitle": "Implement validation and error handling",
|
||||||
|
"complexityScore": 5,
|
||||||
|
"recommendedSubtasks": 4,
|
||||||
|
"expansionPrompt": "Decompose this task into: (1) Add validation logic for model and config loading, (2) Implement error handling and fallback mechanisms, (3) Enhance logging and reporting for token usage, (4) Develop helper functions for configuration suggestions and improvements.",
|
||||||
|
"reasoning": "This task is primarily about adding validation, error handling, and logging. While important for robustness, the logic is straightforward and can be modularized into a few clear subtasks."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 89,
|
||||||
|
"taskTitle": "Introduce Prioritize Command with Enhanced Priority Levels",
|
||||||
|
"complexityScore": 6,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "Expand this task into: (1) Implement the prioritize command with all required flags and shorthands, (2) Update CLI output and help documentation for new priority levels, (3) Ensure backward compatibility with existing commands, (4) Add error handling for invalid inputs, (5) Write and run tests for all command scenarios.",
|
||||||
|
"reasoning": "This CLI feature requires command parsing, updating internal logic for new priority levels, documentation, and robust error handling. The complexity is moderate due to the need for backward compatibility and comprehensive testing."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 90,
|
||||||
|
"taskTitle": "Implement Subtask Progress Analyzer and Reporting System",
|
||||||
|
"complexityScore": 8,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "Break down the analyzer implementation into: (1) Design and implement progress tracking logic, (2) Develop status validation and issue detection, (3) Build the reporting system with multiple output formats, (4) Integrate analyzer with the existing task management system, (5) Optimize for performance and scalability, (6) Write unit, integration, and performance tests.",
|
||||||
|
"reasoning": "This is a complex, multi-faceted feature involving data analysis, reporting, integration, and performance optimization. It touches many parts of the system and requires careful design, making it one of the most complex tasks in the list."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 91,
|
||||||
|
"taskTitle": "Implement Move Command for Tasks and Subtasks",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 5,
|
||||||
|
"expansionPrompt": "Expand this task into: (1) Implement move logic for tasks and subtasks, (2) Handle edge cases (invalid ids, non-existent parents, circular dependencies), (3) Update CLI to support move command with flags, (4) Ensure data integrity and update relationships, (5) Write and execute tests for various move scenarios.",
|
||||||
|
"reasoning": "Moving tasks and subtasks requires careful handling of hierarchical data, edge cases, and data integrity. The command must be robust and user-friendly, necessitating multiple focused subtasks for safe implementation."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 92,
|
||||||
|
"taskTitle": "Add Global Joke Flag to All CLI Commands",
|
||||||
|
"complexityScore": 8,
|
||||||
|
"recommendedSubtasks": 7,
|
||||||
|
"expansionPrompt": "Break down the implementation of the global --joke flag into the following subtasks: (1) Update CLI foundation to support global flags, (2) Develop the joke-service module with joke management and category support, (3) Integrate joke output into existing output utilities, (4) Update all CLI commands for joke flag compatibility, (5) Add configuration options for joke categories and custom jokes, (6) Implement comprehensive testing (flag recognition, output, content, integration, performance, regression), (7) Update documentation and usage examples.",
|
||||||
|
"reasoning": "This task requires changes across the CLI foundation, output utilities, all command modules, and configuration management. It introduces a new service module, global flag handling, and output logic that must not interfere with existing features (including JSON output). The need for robust testing and backward compatibility further increases complexity. The scope spans multiple code areas and requires careful integration, justifying a high complexity score and a detailed subtask breakdown to manage risk and ensure maintainability.[2][3][5]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 94,
|
||||||
|
"taskTitle": "Implement Standalone 'research' CLI Command for AI-Powered Queries",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "Break down the implementation of the 'research' CLI command into logical subtasks covering command registration, parameter handling, context gathering, AI service integration, output formatting, and documentation.",
|
||||||
|
"reasoning": "This task has moderate to high complexity (7/10) due to multiple interconnected components: CLI argument parsing, integration with AI services, context gathering from various sources, and output formatting with different modes. The cyclomatic complexity would be significant with multiple decision paths for handling different flags and options. The task requires understanding existing patterns and extending the codebase in a consistent manner, suggesting the need for careful decomposition into manageable subtasks."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 86,
|
||||||
|
"taskTitle": "Implement GitHub Issue Export Feature",
|
||||||
|
"complexityScore": 9,
|
||||||
|
"recommendedSubtasks": 10,
|
||||||
|
"expansionPrompt": "Break down the implementation of the GitHub Issue Export Feature into detailed subtasks covering: command structure and CLI integration, GitHub API client development, authentication and error handling, task-to-issue mapping logic, content formatting and markdown conversion, bidirectional linking and metadata management, extensible architecture and adapter interfaces, configuration and settings management, documentation, and comprehensive testing (unit, integration, edge cases, performance).",
|
||||||
|
"reasoning": "This task involves designing and implementing a robust, extensible export system with deep integration into GitHub, including bidirectional workflows, complex data mapping, error handling, and support for future platforms. The requirements span CLI design, API integration, content transformation, metadata management, extensibility, configuration, and extensive testing. The breadth and depth of these requirements, along with the need for maintainability and future extensibility, place this task at a high complexity level. Breaking it into at least 10 subtasks will ensure each major component and concern is addressed systematically, reducing risk and improving quality."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
53
.taskmaster/reports/task-complexity-report_test-prd-tag.json
Normal file
53
.taskmaster/reports/task-complexity-report_test-prd-tag.json
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"meta": {
|
||||||
|
"generatedAt": "2025-06-13T06:52:00.611Z",
|
||||||
|
"tasksAnalyzed": 5,
|
||||||
|
"totalTasks": 5,
|
||||||
|
"analysisCount": 5,
|
||||||
|
"thresholdScore": 5,
|
||||||
|
"projectName": "Taskmaster",
|
||||||
|
"usedResearch": true
|
||||||
|
},
|
||||||
|
"complexityAnalysis": [
|
||||||
|
{
|
||||||
|
"taskId": 1,
|
||||||
|
"taskTitle": "Setup Project Repository and Node.js Environment",
|
||||||
|
"complexityScore": 4,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "Break down the setup process into subtasks such as initializing npm, creating directory structure, installing dependencies, configuring package.json, adding configuration files, and setting up the main entry point.",
|
||||||
|
"reasoning": "This task involves several standard setup steps that are well-defined and sequential, with low algorithmic complexity but moderate procedural detail. Each step is independent and can be assigned as a subtask, making the overall complexity moderate."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 2,
|
||||||
|
"taskTitle": "Implement Core Functionality and CLI Interface",
|
||||||
|
"complexityScore": 7,
|
||||||
|
"recommendedSubtasks": 7,
|
||||||
|
"expansionPrompt": "Expand into subtasks for implementing main logic, designing CLI commands, creating the CLI entry point, integrating business logic, adding error handling, formatting output, and ensuring CLI executability.",
|
||||||
|
"reasoning": "This task requires both application logic and user interface (CLI) development, including error handling and integration. The need to coordinate between core logic and CLI, plus ensuring usability, increases complexity and warrants detailed subtasking."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 3,
|
||||||
|
"taskTitle": "Implement Testing Suite and Validation",
|
||||||
|
"complexityScore": 6,
|
||||||
|
"recommendedSubtasks": 6,
|
||||||
|
"expansionPrompt": "Divide into subtasks for configuring Jest, writing unit tests, writing integration tests, testing CLI commands, setting up coverage reporting, and preparing test fixtures/mocks.",
|
||||||
|
"reasoning": "Comprehensive testing involves multiple types of tests and configuration steps. While each is straightforward, the breadth of coverage and need for automation and validation increases the overall complexity."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 4,
|
||||||
|
"taskTitle": "Setup Node.js Project with CLI Interface",
|
||||||
|
"complexityScore": 5,
|
||||||
|
"recommendedSubtasks": 7,
|
||||||
|
"expansionPrompt": "Break down into subtasks for npm initialization, package.json setup, directory structure creation, dependency installation, CLI entry point creation, package.json bin configuration, and CLI executability.",
|
||||||
|
"reasoning": "This task combines project setup with initial CLI implementation. While each step is standard, the integration of CLI elements adds a layer of complexity beyond a basic setup."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskId": 5,
|
||||||
|
"taskTitle": "Implement Core Functionality with Testing",
|
||||||
|
"complexityScore": 8,
|
||||||
|
"recommendedSubtasks": 8,
|
||||||
|
"expansionPrompt": "Expand into subtasks for implementing each feature (A, B, C), setting up the testing framework, writing tests for each feature, integrating CLI with core logic, and adding coverage reporting.",
|
||||||
|
"reasoning": "This task requires simultaneous development of multiple features, integration with CLI, and comprehensive testing. The coordination and depth required for both implementation and validation make it the most complex among the listed tasks."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
8
.taskmaster/state.json
Normal file
8
.taskmaster/state.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"currentTag": "master",
|
||||||
|
"lastSwitched": "2025-06-14T00:46:38.351Z",
|
||||||
|
"branchTagMapping": {
|
||||||
|
"v017-adds": "v017-adds"
|
||||||
|
},
|
||||||
|
"migrationNoticeShown": true
|
||||||
|
}
|
||||||
149
.taskmaster/tasks/task_095.txt
Normal file
149
.taskmaster/tasks/task_095.txt
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
# Task ID: 95
|
||||||
|
# Title: Implement .taskmaster Directory Structure
|
||||||
|
# Status: done
|
||||||
|
# Dependencies: 1, 3, 4, 17
|
||||||
|
# Priority: high
|
||||||
|
# Description: Consolidate all Task Master-managed files in user projects into a clean, centralized .taskmaster/ directory structure to improve organization and keep user project directories clean, based on GitHub issue #275.
|
||||||
|
# Details:
|
||||||
|
This task involves restructuring how Task Master organizes files within user projects to improve maintainability and keep project directories clean:
|
||||||
|
|
||||||
|
1. Create a new `.taskmaster/` directory structure in user projects:
|
||||||
|
- Move task files from `tasks/` to `.taskmaster/tasks/`
|
||||||
|
- Move PRD files from `scripts/` to `.taskmaster/docs/`
|
||||||
|
- Move analysis reports to `.taskmaster/reports/`
|
||||||
|
- Move configuration from `.taskmasterconfig` to `.taskmaster/config.json`
|
||||||
|
- Create `.taskmaster/templates/` for user templates
|
||||||
|
|
||||||
|
2. Update all Task Master code that creates/reads user files:
|
||||||
|
- Modify task file generation to use `.taskmaster/tasks/`
|
||||||
|
- Update PRD file handling to use `.taskmaster/docs/`
|
||||||
|
- Adjust report generation to save to `.taskmaster/reports/`
|
||||||
|
- Update configuration loading to look for `.taskmaster/config.json`
|
||||||
|
- Modify any path resolution logic in Task Master's codebase
|
||||||
|
|
||||||
|
3. Ensure backward compatibility during migration:
|
||||||
|
- Implement path fallback logic that checks both old and new locations
|
||||||
|
- Add deprecation warnings when old paths are detected
|
||||||
|
- Create a migration command to help users transition to the new structure
|
||||||
|
- Preserve existing user data during migration
|
||||||
|
|
||||||
|
4. Update the project initialization process:
|
||||||
|
- Modify the init command to create the new `.taskmaster/` directory structure
|
||||||
|
- Update default file creation to use new paths
|
||||||
|
|
||||||
|
5. Benefits of the new structure:
|
||||||
|
- Keeps user project directories clean and organized
|
||||||
|
- Clearly separates Task Master files from user project files
|
||||||
|
- Makes it easier to add Task Master to .gitignore if desired
|
||||||
|
- Provides logical grouping of different file types
|
||||||
|
|
||||||
|
6. Test thoroughly to ensure all functionality works with the new structure:
|
||||||
|
- Verify all Task Master commands work with the new paths
|
||||||
|
- Ensure backward compatibility functions correctly
|
||||||
|
- Test migration process preserves all user data
|
||||||
|
|
||||||
|
7. Update documentation:
|
||||||
|
- Update README.md to reflect the new user file structure
|
||||||
|
- Add migration guide for existing users
|
||||||
|
- Document the benefits of the cleaner organization
|
||||||
|
|
||||||
|
# Test Strategy:
|
||||||
|
1. Unit Testing:
|
||||||
|
- Create unit tests for path resolution that verify both new and old paths work
|
||||||
|
- Test configuration loading with both `.taskmasterconfig` and `.taskmaster/config.json`
|
||||||
|
- Verify the migration command correctly moves files and preserves content
|
||||||
|
- Test file creation in all new subdirectories
|
||||||
|
|
||||||
|
2. Integration Testing:
|
||||||
|
- Run all existing integration tests with the new directory structure
|
||||||
|
- Verify that all Task Master commands function correctly with new paths
|
||||||
|
- Test backward compatibility by running commands with old file structure
|
||||||
|
|
||||||
|
3. Migration Testing:
|
||||||
|
- Test the migration process on sample projects with existing tasks and files
|
||||||
|
- Verify all tasks, PRDs, reports, and configurations are correctly moved
|
||||||
|
- Ensure no data loss occurs during migration
|
||||||
|
- Test migration with partial existing structures (e.g., only tasks/ exists)
|
||||||
|
|
||||||
|
4. User Workflow Testing:
|
||||||
|
- Test complete workflows: init → create tasks → generate reports → update PRDs
|
||||||
|
- Verify all generated files go to correct locations in `.taskmaster/`
|
||||||
|
- Test that user project directories remain clean
|
||||||
|
|
||||||
|
5. Manual Testing:
|
||||||
|
- Perform end-to-end testing with the new structure
|
||||||
|
- Create, update, and delete tasks using the new structure
|
||||||
|
- Generate reports and verify they're saved to `.taskmaster/reports/`
|
||||||
|
|
||||||
|
6. Documentation Verification:
|
||||||
|
- Review all documentation to ensure it accurately reflects the new user file structure
|
||||||
|
- Verify the migration guide provides clear instructions
|
||||||
|
|
||||||
|
7. Regression Testing:
|
||||||
|
- Run the full test suite to ensure no regressions were introduced
|
||||||
|
- Verify existing user projects continue to work during transition period
|
||||||
|
|
||||||
|
# Subtasks:
|
||||||
|
## 1. Create .taskmaster directory structure [done]
|
||||||
|
### Dependencies: None
|
||||||
|
### Description: Create the new .taskmaster directory and move existing files to their new locations
|
||||||
|
### Details:
|
||||||
|
Create a new .taskmaster/ directory in the project root. Move the tasks/ directory to .taskmaster/tasks/. Move the scripts/ directory to .taskmaster/scripts/. Move the .taskmasterconfig file to .taskmaster/config.json. Ensure proper file permissions are maintained during the move.
|
||||||
|
<info added on 2025-05-29T15:03:56.912Z>
|
||||||
|
Create the new .taskmaster/ directory structure in user projects with subdirectories for tasks/, docs/, reports/, and templates/. Move the existing .taskmasterconfig file to .taskmaster/config.json. Since this project is also a Task Master user, move this project's current user files (tasks.json, PRD files, etc.) to the new .taskmaster/ structure to test the implementation. This subtask focuses on user project directory structure, not Task Master source code relocation.
|
||||||
|
</info added on 2025-05-29T15:03:56.912Z>
|
||||||
|
|
||||||
|
## 2. Update Task Master code for new user file paths [done]
|
||||||
|
### Dependencies: 95.1
|
||||||
|
### Description: Modify all Task Master code that creates or reads user project files to use the new .taskmaster structure
|
||||||
|
### Details:
|
||||||
|
Update Task Master's file handling code to use the new paths: tasks in .taskmaster/tasks/, PRD files in .taskmaster/docs/, reports in .taskmaster/reports/, and config in .taskmaster/config.json. Modify path resolution logic throughout the Task Master codebase to reference the new user file locations.
|
||||||
|
|
||||||
|
## 3. Update task file generation system [done]
|
||||||
|
### Dependencies: 95.1
|
||||||
|
### Description: Modify the task file generation system to use the new directory structure
|
||||||
|
### Details:
|
||||||
|
Update the task file generation system to create and read task files from .taskmaster/tasks/ instead of tasks/. Ensure all template paths are updated. Modify any path resolution logic specific to task file handling.
|
||||||
|
|
||||||
|
## 4. Implement backward compatibility logic [done]
|
||||||
|
### Dependencies: 95.2, 95.3
|
||||||
|
### Description: Add fallback mechanisms to support both old and new file locations during transition
|
||||||
|
### Details:
|
||||||
|
Implement path fallback logic that checks both old and new locations when files aren't found. Add deprecation warnings when old paths are used, informing users about the new structure. Ensure error messages are clear about the transition.
|
||||||
|
|
||||||
|
## 5. Create migration command for users [done]
|
||||||
|
### Dependencies: 95.1, 95.4
|
||||||
|
### Description: Develop a Task Master command to help users transition their existing projects to the new structure
|
||||||
|
### Details:
|
||||||
|
Create a 'taskmaster migrate' command that automatically moves user files from old locations to the new .taskmaster structure. Move tasks/ to .taskmaster/tasks/, scripts/prd.txt to .taskmaster/docs/, reports to .taskmaster/reports/, and .taskmasterconfig to .taskmaster/config.json. Include backup functionality and validation to ensure migration completed successfully.
|
||||||
|
|
||||||
|
## 6. Update project initialization process [done]
|
||||||
|
### Dependencies: 95.1
|
||||||
|
### Description: Modify the init command to create the new directory structure for new projects
|
||||||
|
### Details:
|
||||||
|
Update the init command to create the .taskmaster directory and its subdirectories (tasks/, docs/, reports/, templates/). Modify default file creation to use the new paths. Ensure new projects are created with the correct structure from the start.
|
||||||
|
|
||||||
|
## 7. Update PRD and report file handling [done]
|
||||||
|
### Dependencies: 95.2, 95.6
|
||||||
|
### Description: Modify PRD file creation and report generation to use the new directory structure
|
||||||
|
### Details:
|
||||||
|
Update PRD file handling to create and read files from .taskmaster/docs/ instead of scripts/. Modify report generation (like task-complexity-report.json) to save to .taskmaster/reports/. Ensure all file operations use the new paths consistently.
|
||||||
|
|
||||||
|
## 8. Update documentation and create migration guide [done]
|
||||||
|
### Dependencies: 95.5, 95.6, 95.7
|
||||||
|
### Description: Update all documentation to reflect the new directory structure and provide migration guidance
|
||||||
|
### Details:
|
||||||
|
Update README.md and other documentation to reflect the new .taskmaster structure for user projects. Create a comprehensive migration guide explaining the benefits of the new structure and how to migrate existing projects. Include examples of the new directory layout and explain how it keeps user project directories clean.
|
||||||
|
|
||||||
|
## 9. Add templates directory support [done]
|
||||||
|
### Dependencies: 95.2, 95.6
|
||||||
|
### Description: Implement support for user templates in the .taskmaster/templates/ directory
|
||||||
|
### Details:
|
||||||
|
Create functionality to support user-defined templates in .taskmaster/templates/. Allow users to store custom task templates, PRD templates, or other reusable files. Update Task Master commands to recognize and use templates from this directory when available.
|
||||||
|
|
||||||
|
## 10. Verify clean user project directories [done]
|
||||||
|
### Dependencies: 95.8, 95.9
|
||||||
|
### Description: Ensure the new structure keeps user project root directories clean and organized
|
||||||
|
### Details:
|
||||||
|
Validate that after implementing the new structure, user project root directories only contain their actual project files plus the single .taskmaster/ directory. Verify that no Task Master files are created outside of .taskmaster/. Test that users can easily add .taskmaster/ to .gitignore if they choose to exclude Task Master files from version control.
|
||||||
|
|
||||||
37
.taskmaster/tasks/task_096.txt
Normal file
37
.taskmaster/tasks/task_096.txt
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Task ID: 96
|
||||||
|
# Title: Create Export Command for On-Demand Task File and PDF Generation
|
||||||
|
# Status: pending
|
||||||
|
# Dependencies: 2, 4, 95
|
||||||
|
# Priority: medium
|
||||||
|
# Description: Develop an 'export' CLI command that generates task files and comprehensive PDF exports on-demand, replacing automatic file generation and providing users with flexible export options.
|
||||||
|
# Details:
|
||||||
|
Implement a new 'export' command in the CLI that supports two primary modes: (1) generating individual task files on-demand (superseding the current automatic generation system), and (2) producing a comprehensive PDF export. The PDF should include: a first page with the output of 'tm list --with-subtasks', followed by individual pages for each task (using 'tm show <task_id>') and each subtask (using 'tm show <subtask_id>'). Integrate PDF generation using a robust library (e.g., pdfkit, Puppeteer, or jsPDF) to ensure high-quality output and proper pagination. Refactor or disable any existing automatic file generation logic to avoid performance overhead. Ensure the command supports flexible output paths and options for exporting only files, only PDF, or both. Update documentation and help output to reflect the new export capabilities. Consider concurrency and error handling for large projects. Ensure the export process is efficient and does not block the main CLI thread unnecessarily.
|
||||||
|
|
||||||
|
# Test Strategy:
|
||||||
|
1. Run the 'export' command with various options and verify that task files are generated only on-demand, not automatically. 2. Generate a PDF export and confirm that the first page contains the correct 'tm list --with-subtasks' output, and that each subsequent page accurately reflects the output of 'tm show <task_id>' and 'tm show <subtask_id>' for all tasks and subtasks. 3. Test exporting in projects with large numbers of tasks and subtasks to ensure performance and correctness. 4. Attempt exports with invalid paths or missing data to verify robust error handling. 5. Confirm that no automatic file generation occurs during normal task operations. 6. Review CLI help output and documentation for accuracy regarding the new export functionality.
|
||||||
|
|
||||||
|
# Subtasks:
|
||||||
|
## 1. Remove Automatic Task File Generation from Task Operations [pending]
|
||||||
|
### Dependencies: None
|
||||||
|
### Description: Eliminate all calls to generateTaskFiles() from task operations such as add-task, remove-task, set-status, and similar commands to prevent unnecessary performance overhead.
|
||||||
|
### Details:
|
||||||
|
Audit the codebase for any automatic invocations of generateTaskFiles() and remove or refactor them to ensure task files are not generated automatically during task operations.
|
||||||
|
|
||||||
|
## 2. Implement Export Command Infrastructure with On-Demand Task File Generation [pending]
|
||||||
|
### Dependencies: 96.1
|
||||||
|
### Description: Develop the CLI 'export' command infrastructure, enabling users to generate task files on-demand by invoking the preserved generateTaskFiles function only when requested.
|
||||||
|
### Details:
|
||||||
|
Create the export command with options for output paths and modes (files, PDF, or both). Ensure generateTaskFiles is only called within this command and not elsewhere.
|
||||||
|
|
||||||
|
## 3. Implement Comprehensive PDF Export Functionality [pending]
|
||||||
|
### Dependencies: 96.2
|
||||||
|
### Description: Add PDF export capability to the export command, generating a structured PDF with a first page listing all tasks and subtasks, followed by individual pages for each task and subtask, using a robust PDF library.
|
||||||
|
### Details:
|
||||||
|
Integrate a PDF generation library (e.g., pdfkit, Puppeteer, or jsPDF). Ensure the PDF includes the output of 'tm list --with-subtasks' on the first page, and uses 'tm show <task_id>' and 'tm show <subtask_id>' for subsequent pages. Handle pagination, concurrency, and error handling for large projects.
|
||||||
|
|
||||||
|
## 4. Update Documentation, Tests, and CLI Help for Export Workflow [pending]
|
||||||
|
### Dependencies: 96.2, 96.3
|
||||||
|
### Description: Revise all relevant documentation, automated tests, and CLI help output to reflect the new export-based workflow and available options.
|
||||||
|
### Details:
|
||||||
|
Update user guides, README files, and CLI help text. Add or modify tests to cover the new export command and its options. Ensure all documentation accurately describes the new workflow and usage.
|
||||||
|
|
||||||
12640
.taskmaster/tasks/tasks.json
Normal file
12640
.taskmaster/tasks/tasks.json
Normal file
File diff suppressed because one or more lines are too long
3
.vscode/extensions.json
vendored
Normal file
3
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"recommendations": ["esbenp.prettier-vscode"]
|
||||||
|
}
|
||||||
609
CHANGELOG.md
609
CHANGELOG.md
@@ -1,5 +1,614 @@
|
|||||||
# task-master-ai
|
# task-master-ai
|
||||||
|
|
||||||
|
## 0.16.2-rc.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#655](https://github.com/eyaltoledano/claude-task-master/pull/655) [`edaa5fe`](https://github.com/eyaltoledano/claude-task-master/commit/edaa5fe0d56e0e4e7c4370670a7a388eebd922ac) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix double .taskmaster directory paths in file resolution utilities
|
||||||
|
|
||||||
|
- Closes #636
|
||||||
|
|
||||||
|
- [#671](https://github.com/eyaltoledano/claude-task-master/pull/671) [`86ea6d1`](https://github.com/eyaltoledano/claude-task-master/commit/86ea6d1dbc03eeb39f524f565b50b7017b1d2c9c) Thanks [@joedanz](https://github.com/joedanz)! - Add one-click MCP server installation for Cursor
|
||||||
|
|
||||||
|
## 0.16.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#641](https://github.com/eyaltoledano/claude-task-master/pull/641) [`ad61276`](https://github.com/eyaltoledano/claude-task-master/commit/ad612763ffbdd35aa1b593c9613edc1dc27a8856) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix bedrock issues
|
||||||
|
|
||||||
|
- [#648](https://github.com/eyaltoledano/claude-task-master/pull/648) [`9b4168b`](https://github.com/eyaltoledano/claude-task-master/commit/9b4168bb4e4dfc2f4fb0cf6bd5f81a8565879176) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix MCP tool calls logging errors
|
||||||
|
|
||||||
|
- [#641](https://github.com/eyaltoledano/claude-task-master/pull/641) [`ad61276`](https://github.com/eyaltoledano/claude-task-master/commit/ad612763ffbdd35aa1b593c9613edc1dc27a8856) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Update rules for new directory structure
|
||||||
|
|
||||||
|
- [#648](https://github.com/eyaltoledano/claude-task-master/pull/648) [`9b4168b`](https://github.com/eyaltoledano/claude-task-master/commit/9b4168bb4e4dfc2f4fb0cf6bd5f81a8565879176) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix bug in expand_all mcp tool
|
||||||
|
|
||||||
|
- [#641](https://github.com/eyaltoledano/claude-task-master/pull/641) [`ad61276`](https://github.com/eyaltoledano/claude-task-master/commit/ad612763ffbdd35aa1b593c9613edc1dc27a8856) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix MCP crashing after certain commands due to console logs
|
||||||
|
|
||||||
|
## 0.16.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#607](https://github.com/eyaltoledano/claude-task-master/pull/607) [`6a8a68e`](https://github.com/eyaltoledano/claude-task-master/commit/6a8a68e1a3f34dcdf40b355b4602a08d291f8e38) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add AWS bedrock support
|
||||||
|
|
||||||
|
- [#607](https://github.com/eyaltoledano/claude-task-master/pull/607) [`6a8a68e`](https://github.com/eyaltoledano/claude-task-master/commit/6a8a68e1a3f34dcdf40b355b4602a08d291f8e38) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - # Add Google Vertex AI Provider Integration
|
||||||
|
|
||||||
|
- Implemented `VertexAIProvider` class extending BaseAIProvider
|
||||||
|
- Added authentication and configuration handling for Vertex AI
|
||||||
|
- Updated configuration manager with Vertex-specific getters
|
||||||
|
- Modified AI services unified system to integrate the provider
|
||||||
|
- Added documentation for Vertex AI setup and configuration
|
||||||
|
- Updated environment variable examples for Vertex AI support
|
||||||
|
- Implemented specialized error handling for Vertex-specific issues
|
||||||
|
|
||||||
|
- [#607](https://github.com/eyaltoledano/claude-task-master/pull/607) [`6a8a68e`](https://github.com/eyaltoledano/claude-task-master/commit/6a8a68e1a3f34dcdf40b355b4602a08d291f8e38) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add support for Azure
|
||||||
|
|
||||||
|
- [#612](https://github.com/eyaltoledano/claude-task-master/pull/612) [`669b744`](https://github.com/eyaltoledano/claude-task-master/commit/669b744ced454116a7b29de6c58b4b8da977186a) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Increased minimum required node version to > 18 (was > 14)
|
||||||
|
|
||||||
|
- [#607](https://github.com/eyaltoledano/claude-task-master/pull/607) [`6a8a68e`](https://github.com/eyaltoledano/claude-task-master/commit/6a8a68e1a3f34dcdf40b355b4602a08d291f8e38) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Renamed baseUrl to baseURL
|
||||||
|
|
||||||
|
- [#604](https://github.com/eyaltoledano/claude-task-master/pull/604) [`80735f9`](https://github.com/eyaltoledano/claude-task-master/commit/80735f9e60c7dda7207e169697f8ac07b6733634) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add TASK_MASTER_PROJECT_ROOT env variable supported in mcp.json and .env for project root resolution
|
||||||
|
|
||||||
|
- Some users were having issues where the MCP wasn't able to detect the location of their project root, you can now set the `TASK_MASTER_PROJECT_ROOT` environment variable to the root of your project.
|
||||||
|
|
||||||
|
- [#619](https://github.com/eyaltoledano/claude-task-master/pull/619) [`3f64202`](https://github.com/eyaltoledano/claude-task-master/commit/3f64202c9feef83f2bf383c79e4367d337c37e20) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Consolidate Task Master files into unified .taskmaster directory structure
|
||||||
|
|
||||||
|
This release introduces a new consolidated directory structure that organizes all Task Master files under a single `.taskmaster/` directory for better project organization and cleaner workspace management.
|
||||||
|
|
||||||
|
**New Directory Structure:**
|
||||||
|
|
||||||
|
- `.taskmaster/tasks/` - Task files (previously `tasks/`)
|
||||||
|
- `.taskmaster/docs/` - Documentation including PRD files (previously `scripts/`)
|
||||||
|
- `.taskmaster/reports/` - Complexity analysis reports (previously `scripts/`)
|
||||||
|
- `.taskmaster/templates/` - Template files like example PRD
|
||||||
|
- `.taskmaster/config.json` - Configuration (previously `.taskmasterconfig`)
|
||||||
|
|
||||||
|
**Migration & Backward Compatibility:**
|
||||||
|
|
||||||
|
- Existing projects continue to work with legacy file locations
|
||||||
|
- New projects use the consolidated structure automatically
|
||||||
|
- Run `task-master migrate` to move existing projects to the new structure
|
||||||
|
- All CLI commands and MCP tools automatically detect and use appropriate file locations
|
||||||
|
|
||||||
|
**Benefits:**
|
||||||
|
|
||||||
|
- Cleaner project root with Task Master files organized in one location
|
||||||
|
- Reduced file scatter across multiple directories
|
||||||
|
- Improved project navigation and maintenance
|
||||||
|
- Consistent file organization across all Task Master projects
|
||||||
|
|
||||||
|
This change maintains full backward compatibility while providing a migration path to the improved structure.
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#607](https://github.com/eyaltoledano/claude-task-master/pull/607) [`6a8a68e`](https://github.com/eyaltoledano/claude-task-master/commit/6a8a68e1a3f34dcdf40b355b4602a08d291f8e38) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix max_tokens error when trying to use claude-sonnet-4 and claude-opus-4
|
||||||
|
|
||||||
|
- [#625](https://github.com/eyaltoledano/claude-task-master/pull/625) [`2d520de`](https://github.com/eyaltoledano/claude-task-master/commit/2d520de2694da3efe537b475ca52baf3c869edda) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix add-task MCP command causing an error
|
||||||
|
|
||||||
|
## 0.16.0-rc.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#607](https://github.com/eyaltoledano/claude-task-master/pull/607) [`6a8a68e`](https://github.com/eyaltoledano/claude-task-master/commit/6a8a68e1a3f34dcdf40b355b4602a08d291f8e38) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add AWS bedrock support
|
||||||
|
|
||||||
|
- [#607](https://github.com/eyaltoledano/claude-task-master/pull/607) [`6a8a68e`](https://github.com/eyaltoledano/claude-task-master/commit/6a8a68e1a3f34dcdf40b355b4602a08d291f8e38) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - # Add Google Vertex AI Provider Integration
|
||||||
|
|
||||||
|
- Implemented `VertexAIProvider` class extending BaseAIProvider
|
||||||
|
- Added authentication and configuration handling for Vertex AI
|
||||||
|
- Updated configuration manager with Vertex-specific getters
|
||||||
|
- Modified AI services unified system to integrate the provider
|
||||||
|
- Added documentation for Vertex AI setup and configuration
|
||||||
|
- Updated environment variable examples for Vertex AI support
|
||||||
|
- Implemented specialized error handling for Vertex-specific issues
|
||||||
|
|
||||||
|
- [#607](https://github.com/eyaltoledano/claude-task-master/pull/607) [`6a8a68e`](https://github.com/eyaltoledano/claude-task-master/commit/6a8a68e1a3f34dcdf40b355b4602a08d291f8e38) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add support for Azure
|
||||||
|
|
||||||
|
- [#612](https://github.com/eyaltoledano/claude-task-master/pull/612) [`669b744`](https://github.com/eyaltoledano/claude-task-master/commit/669b744ced454116a7b29de6c58b4b8da977186a) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Increased minimum required node version to > 18 (was > 14)
|
||||||
|
|
||||||
|
- [#607](https://github.com/eyaltoledano/claude-task-master/pull/607) [`6a8a68e`](https://github.com/eyaltoledano/claude-task-master/commit/6a8a68e1a3f34dcdf40b355b4602a08d291f8e38) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Renamed baseUrl to baseURL
|
||||||
|
|
||||||
|
- [#604](https://github.com/eyaltoledano/claude-task-master/pull/604) [`80735f9`](https://github.com/eyaltoledano/claude-task-master/commit/80735f9e60c7dda7207e169697f8ac07b6733634) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add TASK_MASTER_PROJECT_ROOT env variable supported in mcp.json and .env for project root resolution
|
||||||
|
|
||||||
|
- Some users were having issues where the MCP wasn't able to detect the location of their project root, you can now set the `TASK_MASTER_PROJECT_ROOT` environment variable to the root of your project.
|
||||||
|
|
||||||
|
- [#619](https://github.com/eyaltoledano/claude-task-master/pull/619) [`3f64202`](https://github.com/eyaltoledano/claude-task-master/commit/3f64202c9feef83f2bf383c79e4367d337c37e20) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Consolidate Task Master files into unified .taskmaster directory structure
|
||||||
|
|
||||||
|
This release introduces a new consolidated directory structure that organizes all Task Master files under a single `.taskmaster/` directory for better project organization and cleaner workspace management.
|
||||||
|
|
||||||
|
**New Directory Structure:**
|
||||||
|
|
||||||
|
- `.taskmaster/tasks/` - Task files (previously `tasks/`)
|
||||||
|
- `.taskmaster/docs/` - Documentation including PRD files (previously `scripts/`)
|
||||||
|
- `.taskmaster/reports/` - Complexity analysis reports (previously `scripts/`)
|
||||||
|
- `.taskmaster/templates/` - Template files like example PRD
|
||||||
|
- `.taskmaster/config.json` - Configuration (previously `.taskmasterconfig`)
|
||||||
|
|
||||||
|
**Migration & Backward Compatibility:**
|
||||||
|
|
||||||
|
- Existing projects continue to work with legacy file locations
|
||||||
|
- New projects use the consolidated structure automatically
|
||||||
|
- Run `task-master migrate` to move existing projects to the new structure
|
||||||
|
- All CLI commands and MCP tools automatically detect and use appropriate file locations
|
||||||
|
|
||||||
|
**Benefits:**
|
||||||
|
|
||||||
|
- Cleaner project root with Task Master files organized in one location
|
||||||
|
- Reduced file scatter across multiple directories
|
||||||
|
- Improved project navigation and maintenance
|
||||||
|
- Consistent file organization across all Task Master projects
|
||||||
|
|
||||||
|
This change maintains full backward compatibility while providing a migration path to the improved structure.
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#607](https://github.com/eyaltoledano/claude-task-master/pull/607) [`6a8a68e`](https://github.com/eyaltoledano/claude-task-master/commit/6a8a68e1a3f34dcdf40b355b4602a08d291f8e38) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix max_tokens error when trying to use claude-sonnet-4 and claude-opus-4
|
||||||
|
|
||||||
|
- [#597](https://github.com/eyaltoledano/claude-task-master/pull/597) [`2d520de`](https://github.com/eyaltoledano/claude-task-master/commit/2d520de2694da3efe537b475ca52baf3c869edda) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Fix add-task MCP command causing an error
|
||||||
|
|
||||||
|
## 0.15.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`09add37`](https://github.com/eyaltoledano/claude-task-master/commit/09add37423d70b809d5c28f3cde9fccd5a7e64e7) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Added comprehensive Ollama model validation and interactive setup support
|
||||||
|
|
||||||
|
- **Interactive Setup Enhancement**: Added "Custom Ollama model" option to `task-master models --setup`, matching the existing OpenRouter functionality
|
||||||
|
- **Live Model Validation**: When setting Ollama models, Taskmaster now validates against the local Ollama instance by querying `/api/tags` endpoint
|
||||||
|
- **Configurable Endpoints**: Uses the `ollamaBaseUrl` from `.taskmasterconfig` (with role-specific `baseUrl` overrides supported)
|
||||||
|
- **Robust Error Handling**:
|
||||||
|
- Detects when Ollama server is not running and provides clear error messages
|
||||||
|
- Validates model existence and lists available alternatives when model not found
|
||||||
|
- Graceful fallback behavior for connection issues
|
||||||
|
- **Full Platform Support**: Both MCP server tools and CLI commands support the new validation
|
||||||
|
- **Improved User Experience**: Clear feedback during model validation with informative success/error messages
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`4c83526`](https://github.com/eyaltoledano/claude-task-master/commit/4c835264ac6c1f74896cddabc3b3c69a5c435417) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds and updates supported AI models with costs:
|
||||||
|
|
||||||
|
- Added new OpenRouter models: GPT-4.1 series, O3, Codex Mini, Llama 4 Maverick, Llama 4 Scout, Qwen3-235b
|
||||||
|
- Added Mistral models: Devstral Small, Mistral Nemo
|
||||||
|
- Updated Ollama models with latest variants: Devstral, Qwen3, Mistral-small3.1, Llama3.3
|
||||||
|
- Updated Gemini model to latest 2.5 Flash preview version
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`70f4054`](https://github.com/eyaltoledano/claude-task-master/commit/70f4054f268f9f8257870e64c24070263d4e2966) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Add `--research` flag to parse-prd command, enabling enhanced task generation from PRD files. When used, Taskmaster leverages the research model to:
|
||||||
|
|
||||||
|
- Research current technologies and best practices relevant to the project
|
||||||
|
- Identify technical challenges and security concerns not explicitly mentioned in the PRD
|
||||||
|
- Include specific library recommendations with version numbers
|
||||||
|
- Provide more detailed implementation guidance based on industry standards
|
||||||
|
- Create more accurate dependency relationships between tasks
|
||||||
|
|
||||||
|
This results in higher quality, more actionable tasks with minimal additional effort.
|
||||||
|
|
||||||
|
_NOTE_ That this is an experimental feature. Research models don't typically do great at structured output. You may find some failures when using research mode, so please share your feedback so we can improve this.
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`5e9bc28`](https://github.com/eyaltoledano/claude-task-master/commit/5e9bc28abea36ec7cd25489af7fcc6cbea51038b) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - This change significantly enhances the `add-task` command's intelligence. When you add a new task, Taskmaster now automatically: - Analyzes your existing tasks to find those most relevant to your new task's description. - Provides the AI with detailed context from these relevant tasks.
|
||||||
|
|
||||||
|
This results in newly created tasks being more accurately placed within your project's dependency structure, saving you time and any need to update tasks just for dependencies, all without significantly increasing AI costs. You'll get smarter, more connected tasks right from the start.
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`34c769b`](https://github.com/eyaltoledano/claude-task-master/commit/34c769bcd0faf65ddec3b95de2ba152a8be3ec5c) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Enhance analyze-complexity to support analyzing specific task IDs. - You can now analyze individual tasks or selected task groups by using the new `--id` option with comma-separated IDs, or `--from` and `--to` options to specify a range of tasks. - The feature intelligently merges analysis results with existing reports, allowing incremental analysis while preserving previous results.
|
||||||
|
|
||||||
|
- [#558](https://github.com/eyaltoledano/claude-task-master/pull/558) [`86d8f00`](https://github.com/eyaltoledano/claude-task-master/commit/86d8f00af809887ee0ba0ba7157cc555e0d07c38) Thanks [@ShreyPaharia](https://github.com/ShreyPaharia)! - Add next task to set task status response
|
||||||
|
Status: DONE
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`04af16d`](https://github.com/eyaltoledano/claude-task-master/commit/04af16de27295452e134b17b3c7d0f44bbb84c29) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Add move command to enable moving tasks and subtasks within the task hierarchy. This new command supports moving standalone tasks to become subtasks, subtasks to become standalone tasks, and moving subtasks between different parents. The implementation handles circular dependencies, validation, and proper updating of parent-child relationships.
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
|
||||||
|
- CLI command: `task-master move --from=<id> --to=<id>`
|
||||||
|
- MCP tool: `move_task` with parameters:
|
||||||
|
- `from`: ID of task/subtask to move (e.g., "5" or "5.2")
|
||||||
|
- `to`: ID of destination (e.g., "7" or "7.3")
|
||||||
|
- `file` (optional): Custom path to tasks.json
|
||||||
|
|
||||||
|
**Example scenarios:**
|
||||||
|
|
||||||
|
- Move task to become subtask: `--from="5" --to="7"`
|
||||||
|
- Move subtask to standalone task: `--from="5.2" --to="7"`
|
||||||
|
- Move subtask to different parent: `--from="5.2" --to="7.3"`
|
||||||
|
- Reorder subtask within same parent: `--from="5.2" --to="5.4"`
|
||||||
|
- Move multiple tasks at once: `--from="10,11,12" --to="16,17,18"`
|
||||||
|
- Move task to new ID: `--from="5" --to="25"` (creates a new task with ID 25)
|
||||||
|
|
||||||
|
**Multiple Task Support:**
|
||||||
|
The command supports moving multiple tasks simultaneously by providing comma-separated lists for both `--from` and `--to` parameters. The number of source and destination IDs must match. This is particularly useful for resolving merge conflicts in task files when multiple team members have created tasks on different branches.
|
||||||
|
|
||||||
|
**Validation Features:**
|
||||||
|
|
||||||
|
- Allows moving tasks to new, non-existent IDs (automatically creates placeholders)
|
||||||
|
- Prevents moving to existing task IDs that already contain content (to avoid overwriting)
|
||||||
|
- Validates source tasks exist before attempting to move them
|
||||||
|
- Ensures proper parent-child relationships are maintained
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`231e569`](https://github.com/eyaltoledano/claude-task-master/commit/231e569e84804a2e5ba1f9da1a985d0851b7e949) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adjusts default main model model to Claude Sonnet 4. Adjusts default fallback to Claude Sonney 3.7"
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`b371808`](https://github.com/eyaltoledano/claude-task-master/commit/b371808524f2c2986f4940d78fcef32c125d01f2) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds llms-install.md to the root to enable AI agents to programmatically install the Taskmaster MCP server. This is specifically being introduced for the Cline MCP marketplace and will be adjusted over time for other MCP clients as needed.
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`a59dd03`](https://github.com/eyaltoledano/claude-task-master/commit/a59dd037cfebb46d38bc44dd216c7c23933be641) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds AGENTS.md to power Claude Code integration more natively based on Anthropic's best practice and Claude-specific MCP client behaviours. Also adds in advanced workflows that tie Taskmaster commands together into one Claude workflow."
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`e0e1155`](https://github.com/eyaltoledano/claude-task-master/commit/e0e115526089bf41d5d60929956edf5601ff3e23) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Fixes issue with force/append flag combinations for parse-prd.
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`34df2c8`](https://github.com/eyaltoledano/claude-task-master/commit/34df2c8bbddc0e157c981d32502bbe6b9468202e) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - You can now add tasks to a newly initialized project without having to parse a prd. This will automatically create the missing tasks.json file and create the first task. Lets you vibe if you want to vibe."
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`d2e6431`](https://github.com/eyaltoledano/claude-task-master/commit/d2e64318e2f4bfc3457792e310cc4ff9210bba30) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Fixes an issue where the research fallback would attempt to make API calls without checking for a valid API key first. This ensures proper error handling when the main task generation and first fallback both fail. Closes #421 #519.
|
||||||
|
|
||||||
|
## 0.15.0-rc.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`09add37`](https://github.com/eyaltoledano/claude-task-master/commit/09add37423d70b809d5c28f3cde9fccd5a7e64e7) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Added comprehensive Ollama model validation and interactive setup support
|
||||||
|
|
||||||
|
- **Interactive Setup Enhancement**: Added "Custom Ollama model" option to `task-master models --setup`, matching the existing OpenRouter functionality
|
||||||
|
- **Live Model Validation**: When setting Ollama models, Taskmaster now validates against the local Ollama instance by querying `/api/tags` endpoint
|
||||||
|
- **Configurable Endpoints**: Uses the `ollamaBaseUrl` from `.taskmasterconfig` (with role-specific `baseUrl` overrides supported)
|
||||||
|
- **Robust Error Handling**:
|
||||||
|
- Detects when Ollama server is not running and provides clear error messages
|
||||||
|
- Validates model existence and lists available alternatives when model not found
|
||||||
|
- Graceful fallback behavior for connection issues
|
||||||
|
- **Full Platform Support**: Both MCP server tools and CLI commands support the new validation
|
||||||
|
- **Improved User Experience**: Clear feedback during model validation with informative success/error messages
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`4c83526`](https://github.com/eyaltoledano/claude-task-master/commit/4c835264ac6c1f74896cddabc3b3c69a5c435417) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds and updates supported AI models with costs:
|
||||||
|
|
||||||
|
- Added new OpenRouter models: GPT-4.1 series, O3, Codex Mini, Llama 4 Maverick, Llama 4 Scout, Qwen3-235b
|
||||||
|
- Added Mistral models: Devstral Small, Mistral Nemo
|
||||||
|
- Updated Ollama models with latest variants: Devstral, Qwen3, Mistral-small3.1, Llama3.3
|
||||||
|
- Updated Gemini model to latest 2.5 Flash preview version
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`70f4054`](https://github.com/eyaltoledano/claude-task-master/commit/70f4054f268f9f8257870e64c24070263d4e2966) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Add `--research` flag to parse-prd command, enabling enhanced task generation from PRD files. When used, Taskmaster leverages the research model to:
|
||||||
|
|
||||||
|
- Research current technologies and best practices relevant to the project
|
||||||
|
- Identify technical challenges and security concerns not explicitly mentioned in the PRD
|
||||||
|
- Include specific library recommendations with version numbers
|
||||||
|
- Provide more detailed implementation guidance based on industry standards
|
||||||
|
- Create more accurate dependency relationships between tasks
|
||||||
|
|
||||||
|
This results in higher quality, more actionable tasks with minimal additional effort.
|
||||||
|
|
||||||
|
_NOTE_ That this is an experimental feature. Research models don't typically do great at structured output. You may find some failures when using research mode, so please share your feedback so we can improve this.
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`5e9bc28`](https://github.com/eyaltoledano/claude-task-master/commit/5e9bc28abea36ec7cd25489af7fcc6cbea51038b) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - This change significantly enhances the `add-task` command's intelligence. When you add a new task, Taskmaster now automatically: - Analyzes your existing tasks to find those most relevant to your new task's description. - Provides the AI with detailed context from these relevant tasks.
|
||||||
|
|
||||||
|
This results in newly created tasks being more accurately placed within your project's dependency structure, saving you time and any need to update tasks just for dependencies, all without significantly increasing AI costs. You'll get smarter, more connected tasks right from the start.
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`34c769b`](https://github.com/eyaltoledano/claude-task-master/commit/34c769bcd0faf65ddec3b95de2ba152a8be3ec5c) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Enhance analyze-complexity to support analyzing specific task IDs. - You can now analyze individual tasks or selected task groups by using the new `--id` option with comma-separated IDs, or `--from` and `--to` options to specify a range of tasks. - The feature intelligently merges analysis results with existing reports, allowing incremental analysis while preserving previous results.
|
||||||
|
|
||||||
|
- [#558](https://github.com/eyaltoledano/claude-task-master/pull/558) [`86d8f00`](https://github.com/eyaltoledano/claude-task-master/commit/86d8f00af809887ee0ba0ba7157cc555e0d07c38) Thanks [@ShreyPaharia](https://github.com/ShreyPaharia)! - Add next task to set task status response
|
||||||
|
Status: DONE
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`04af16d`](https://github.com/eyaltoledano/claude-task-master/commit/04af16de27295452e134b17b3c7d0f44bbb84c29) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Add move command to enable moving tasks and subtasks within the task hierarchy. This new command supports moving standalone tasks to become subtasks, subtasks to become standalone tasks, and moving subtasks between different parents. The implementation handles circular dependencies, validation, and proper updating of parent-child relationships.
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
|
||||||
|
- CLI command: `task-master move --from=<id> --to=<id>`
|
||||||
|
- MCP tool: `move_task` with parameters:
|
||||||
|
- `from`: ID of task/subtask to move (e.g., "5" or "5.2")
|
||||||
|
- `to`: ID of destination (e.g., "7" or "7.3")
|
||||||
|
- `file` (optional): Custom path to tasks.json
|
||||||
|
|
||||||
|
**Example scenarios:**
|
||||||
|
|
||||||
|
- Move task to become subtask: `--from="5" --to="7"`
|
||||||
|
- Move subtask to standalone task: `--from="5.2" --to="7"`
|
||||||
|
- Move subtask to different parent: `--from="5.2" --to="7.3"`
|
||||||
|
- Reorder subtask within same parent: `--from="5.2" --to="5.4"`
|
||||||
|
- Move multiple tasks at once: `--from="10,11,12" --to="16,17,18"`
|
||||||
|
- Move task to new ID: `--from="5" --to="25"` (creates a new task with ID 25)
|
||||||
|
|
||||||
|
**Multiple Task Support:**
|
||||||
|
The command supports moving multiple tasks simultaneously by providing comma-separated lists for both `--from` and `--to` parameters. The number of source and destination IDs must match. This is particularly useful for resolving merge conflicts in task files when multiple team members have created tasks on different branches.
|
||||||
|
|
||||||
|
**Validation Features:**
|
||||||
|
|
||||||
|
- Allows moving tasks to new, non-existent IDs (automatically creates placeholders)
|
||||||
|
- Prevents moving to existing task IDs that already contain content (to avoid overwriting)
|
||||||
|
- Validates source tasks exist before attempting to move them
|
||||||
|
- Ensures proper parent-child relationships are maintained
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`231e569`](https://github.com/eyaltoledano/claude-task-master/commit/231e569e84804a2e5ba1f9da1a985d0851b7e949) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adjusts default main model model to Claude Sonnet 4. Adjusts default fallback to Claude Sonney 3.7"
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`b371808`](https://github.com/eyaltoledano/claude-task-master/commit/b371808524f2c2986f4940d78fcef32c125d01f2) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds llms-install.md to the root to enable AI agents to programmatically install the Taskmaster MCP server. This is specifically being introduced for the Cline MCP marketplace and will be adjusted over time for other MCP clients as needed.
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`a59dd03`](https://github.com/eyaltoledano/claude-task-master/commit/a59dd037cfebb46d38bc44dd216c7c23933be641) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds AGENTS.md to power Claude Code integration more natively based on Anthropic's best practice and Claude-specific MCP client behaviours. Also adds in advanced workflows that tie Taskmaster commands together into one Claude workflow."
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`e0e1155`](https://github.com/eyaltoledano/claude-task-master/commit/e0e115526089bf41d5d60929956edf5601ff3e23) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Fixes issue with force/append flag combinations for parse-prd.
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`34df2c8`](https://github.com/eyaltoledano/claude-task-master/commit/34df2c8bbddc0e157c981d32502bbe6b9468202e) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - You can now add tasks to a newly initialized project without having to parse a prd. This will automatically create the missing tasks.json file and create the first task. Lets you vibe if you want to vibe."
|
||||||
|
|
||||||
|
- [#567](https://github.com/eyaltoledano/claude-task-master/pull/567) [`d2e6431`](https://github.com/eyaltoledano/claude-task-master/commit/d2e64318e2f4bfc3457792e310cc4ff9210bba30) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Fixes an issue where the research fallback would attempt to make API calls without checking for a valid API key first. This ensures proper error handling when the main task generation and first fallback both fail. Closes #421 #519.
|
||||||
|
|
||||||
|
## 0.14.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#521](https://github.com/eyaltoledano/claude-task-master/pull/521) [`ed17cb0`](https://github.com/eyaltoledano/claude-task-master/commit/ed17cb0e0a04dedde6c616f68f24f3660f68dd04) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - .taskmasterconfig now supports a baseUrl field per model role (main, research, fallback), allowing endpoint overrides for any provider.
|
||||||
|
|
||||||
|
- [#536](https://github.com/eyaltoledano/claude-task-master/pull/536) [`f4a83ec`](https://github.com/eyaltoledano/claude-task-master/commit/f4a83ec047b057196833e3a9b861d4bceaec805d) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add Ollama as a supported AI provider.
|
||||||
|
|
||||||
|
- You can now add it by running `task-master models --setup` and selecting it.
|
||||||
|
- Ollama is a local model provider, so no API key is required.
|
||||||
|
- Ollama models are available at `http://localhost:11434/api` by default.
|
||||||
|
- You can change the default URL by setting the `OLLAMA_BASE_URL` environment variable or by adding a `baseUrl` property to the `ollama` model role in `.taskmasterconfig`.
|
||||||
|
- If you want to use a custom API key, you can set it in the `OLLAMA_API_KEY` environment variable.
|
||||||
|
|
||||||
|
- [#528](https://github.com/eyaltoledano/claude-task-master/pull/528) [`58b417a`](https://github.com/eyaltoledano/claude-task-master/commit/58b417a8ce697e655f749ca4d759b1c20014c523) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Display task complexity scores in task lists, next task, and task details views.
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#402](https://github.com/eyaltoledano/claude-task-master/pull/402) [`01963af`](https://github.com/eyaltoledano/claude-task-master/commit/01963af2cb6f77f43b2ad8a6e4a838ec205412bc) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Resolve all issues related to MCP
|
||||||
|
|
||||||
|
- [#478](https://github.com/eyaltoledano/claude-task-master/pull/478) [`4117f71`](https://github.com/eyaltoledano/claude-task-master/commit/4117f71c18ee4d321a9c91308d00d5d69bfac61e) Thanks [@joedanz](https://github.com/joedanz)! - Fix CLI --force flag for parse-prd command
|
||||||
|
|
||||||
|
Previously, the --force flag was not respected when running `parse-prd`, causing the command to prompt for confirmation or fail even when --force was provided. This patch ensures that the flag is correctly passed and handled, allowing users to overwrite existing tasks.json files as intended.
|
||||||
|
|
||||||
|
- Fixes #477
|
||||||
|
|
||||||
|
- [#511](https://github.com/eyaltoledano/claude-task-master/pull/511) [`17294ff`](https://github.com/eyaltoledano/claude-task-master/commit/17294ff25918d64278674e558698a1a9ad785098) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Task Master no longer tells you to update when you're already up to date
|
||||||
|
|
||||||
|
- [#442](https://github.com/eyaltoledano/claude-task-master/pull/442) [`2b3ae8b`](https://github.com/eyaltoledano/claude-task-master/commit/2b3ae8bf89dc471c4ce92f3a12ded57f61faa449) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds costs information to AI commands using input/output tokens and model costs.
|
||||||
|
|
||||||
|
- [#402](https://github.com/eyaltoledano/claude-task-master/pull/402) [`01963af`](https://github.com/eyaltoledano/claude-task-master/commit/01963af2cb6f77f43b2ad8a6e4a838ec205412bc) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix ERR_MODULE_NOT_FOUND when trying to run MCP Server
|
||||||
|
|
||||||
|
- [#402](https://github.com/eyaltoledano/claude-task-master/pull/402) [`01963af`](https://github.com/eyaltoledano/claude-task-master/commit/01963af2cb6f77f43b2ad8a6e4a838ec205412bc) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add src directory to exports
|
||||||
|
|
||||||
|
- [#523](https://github.com/eyaltoledano/claude-task-master/pull/523) [`da317f2`](https://github.com/eyaltoledano/claude-task-master/commit/da317f2607ca34db1be78c19954996f634c40923) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix the error handling of task status settings
|
||||||
|
|
||||||
|
- [#527](https://github.com/eyaltoledano/claude-task-master/pull/527) [`a8dabf4`](https://github.com/eyaltoledano/claude-task-master/commit/a8dabf44856713f488960224ee838761716bba26) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Remove caching layer from MCP direct functions for task listing, next task, and complexity report
|
||||||
|
|
||||||
|
- Fixes issues users where having where they were getting stale data
|
||||||
|
|
||||||
|
- [#417](https://github.com/eyaltoledano/claude-task-master/pull/417) [`a1f8d52`](https://github.com/eyaltoledano/claude-task-master/commit/a1f8d52474fdbdf48e17a63e3f567a6d63010d9f) Thanks [@ksylvan](https://github.com/ksylvan)! - Fix for issue #409 LOG_LEVEL Pydantic validation error
|
||||||
|
|
||||||
|
- [#442](https://github.com/eyaltoledano/claude-task-master/pull/442) [`0288311`](https://github.com/eyaltoledano/claude-task-master/commit/0288311965ae2a343ebee4a0c710dde94d2ae7e7) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Small fixes - `next` command no longer incorrectly suggests that subtasks be broken down into subtasks in the CLI - fixes the `append` flag so it properly works in the CLI
|
||||||
|
|
||||||
|
- [#501](https://github.com/eyaltoledano/claude-task-master/pull/501) [`0a61184`](https://github.com/eyaltoledano/claude-task-master/commit/0a611843b56a856ef0a479dc34078326e05ac3a8) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix initial .env.example to work out of the box
|
||||||
|
|
||||||
|
- Closes #419
|
||||||
|
|
||||||
|
- [#435](https://github.com/eyaltoledano/claude-task-master/pull/435) [`a96215a`](https://github.com/eyaltoledano/claude-task-master/commit/a96215a359b25061fd3b3f3c7b10e8ac0390c062) Thanks [@lebsral](https://github.com/lebsral)! - Fix default fallback model and maxTokens in Taskmaster initialization
|
||||||
|
|
||||||
|
- [#517](https://github.com/eyaltoledano/claude-task-master/pull/517) [`e96734a`](https://github.com/eyaltoledano/claude-task-master/commit/e96734a6cc6fec7731de72eb46b182a6e3743d02) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix bug when updating tasks on the MCP server (#412)
|
||||||
|
|
||||||
|
- [#496](https://github.com/eyaltoledano/claude-task-master/pull/496) [`efce374`](https://github.com/eyaltoledano/claude-task-master/commit/efce37469bc58eceef46763ba32df1ed45242211) Thanks [@joedanz](https://github.com/joedanz)! - Fix duplicate output on CLI help screen
|
||||||
|
|
||||||
|
- Prevent the Task Master CLI from printing the help screen more than once when using `-h` or `--help`.
|
||||||
|
- Removed redundant manual event handlers and guards for help output; now only the Commander `.helpInformation` override is used for custom help.
|
||||||
|
- Simplified logic so that help is only shown once for both "no arguments" and help flag flows.
|
||||||
|
- Ensures a clean, branded help experience with no repeated content.
|
||||||
|
- Fixes #339
|
||||||
|
|
||||||
|
## 0.14.0-rc.1
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#536](https://github.com/eyaltoledano/claude-task-master/pull/536) [`f4a83ec`](https://github.com/eyaltoledano/claude-task-master/commit/f4a83ec047b057196833e3a9b861d4bceaec805d) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add Ollama as a supported AI provider.
|
||||||
|
|
||||||
|
- You can now add it by running `task-master models --setup` and selecting it.
|
||||||
|
- Ollama is a local model provider, so no API key is required.
|
||||||
|
- Ollama models are available at `http://localhost:11434/api` by default.
|
||||||
|
- You can change the default URL by setting the `OLLAMA_BASE_URL` environment variable or by adding a `baseUrl` property to the `ollama` model role in `.taskmasterconfig`.
|
||||||
|
- If you want to use a custom API key, you can set it in the `OLLAMA_API_KEY` environment variable.
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#442](https://github.com/eyaltoledano/claude-task-master/pull/442) [`2b3ae8b`](https://github.com/eyaltoledano/claude-task-master/commit/2b3ae8bf89dc471c4ce92f3a12ded57f61faa449) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds costs information to AI commands using input/output tokens and model costs.
|
||||||
|
|
||||||
|
- [#442](https://github.com/eyaltoledano/claude-task-master/pull/442) [`0288311`](https://github.com/eyaltoledano/claude-task-master/commit/0288311965ae2a343ebee4a0c710dde94d2ae7e7) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Small fixes - `next` command no longer incorrectly suggests that subtasks be broken down into subtasks in the CLI - fixes the `append` flag so it properly works in the CLI
|
||||||
|
|
||||||
|
## 0.14.0-rc.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#521](https://github.com/eyaltoledano/claude-task-master/pull/521) [`ed17cb0`](https://github.com/eyaltoledano/claude-task-master/commit/ed17cb0e0a04dedde6c616f68f24f3660f68dd04) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - .taskmasterconfig now supports a baseUrl field per model role (main, research, fallback), allowing endpoint overrides for any provider.
|
||||||
|
|
||||||
|
- [#528](https://github.com/eyaltoledano/claude-task-master/pull/528) [`58b417a`](https://github.com/eyaltoledano/claude-task-master/commit/58b417a8ce697e655f749ca4d759b1c20014c523) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Display task complexity scores in task lists, next task, and task details views.
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#478](https://github.com/eyaltoledano/claude-task-master/pull/478) [`4117f71`](https://github.com/eyaltoledano/claude-task-master/commit/4117f71c18ee4d321a9c91308d00d5d69bfac61e) Thanks [@joedanz](https://github.com/joedanz)! - Fix CLI --force flag for parse-prd command
|
||||||
|
|
||||||
|
Previously, the --force flag was not respected when running `parse-prd`, causing the command to prompt for confirmation or fail even when --force was provided. This patch ensures that the flag is correctly passed and handled, allowing users to overwrite existing tasks.json files as intended.
|
||||||
|
|
||||||
|
- Fixes #477
|
||||||
|
|
||||||
|
- [#511](https://github.com/eyaltoledano/claude-task-master/pull/511) [`17294ff`](https://github.com/eyaltoledano/claude-task-master/commit/17294ff25918d64278674e558698a1a9ad785098) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Task Master no longer tells you to update when you're already up to date
|
||||||
|
|
||||||
|
- [#523](https://github.com/eyaltoledano/claude-task-master/pull/523) [`da317f2`](https://github.com/eyaltoledano/claude-task-master/commit/da317f2607ca34db1be78c19954996f634c40923) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix the error handling of task status settings
|
||||||
|
|
||||||
|
- [#527](https://github.com/eyaltoledano/claude-task-master/pull/527) [`a8dabf4`](https://github.com/eyaltoledano/claude-task-master/commit/a8dabf44856713f488960224ee838761716bba26) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Remove caching layer from MCP direct functions for task listing, next task, and complexity report
|
||||||
|
|
||||||
|
- Fixes issues users where having where they were getting stale data
|
||||||
|
|
||||||
|
- [#417](https://github.com/eyaltoledano/claude-task-master/pull/417) [`a1f8d52`](https://github.com/eyaltoledano/claude-task-master/commit/a1f8d52474fdbdf48e17a63e3f567a6d63010d9f) Thanks [@ksylvan](https://github.com/ksylvan)! - Fix for issue #409 LOG_LEVEL Pydantic validation error
|
||||||
|
|
||||||
|
- [#501](https://github.com/eyaltoledano/claude-task-master/pull/501) [`0a61184`](https://github.com/eyaltoledano/claude-task-master/commit/0a611843b56a856ef0a479dc34078326e05ac3a8) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix initial .env.example to work out of the box
|
||||||
|
|
||||||
|
- Closes #419
|
||||||
|
|
||||||
|
- [#435](https://github.com/eyaltoledano/claude-task-master/pull/435) [`a96215a`](https://github.com/eyaltoledano/claude-task-master/commit/a96215a359b25061fd3b3f3c7b10e8ac0390c062) Thanks [@lebsral](https://github.com/lebsral)! - Fix default fallback model and maxTokens in Taskmaster initialization
|
||||||
|
|
||||||
|
- [#517](https://github.com/eyaltoledano/claude-task-master/pull/517) [`e96734a`](https://github.com/eyaltoledano/claude-task-master/commit/e96734a6cc6fec7731de72eb46b182a6e3743d02) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix bug when updating tasks on the MCP server (#412)
|
||||||
|
|
||||||
|
- [#496](https://github.com/eyaltoledano/claude-task-master/pull/496) [`efce374`](https://github.com/eyaltoledano/claude-task-master/commit/efce37469bc58eceef46763ba32df1ed45242211) Thanks [@joedanz](https://github.com/joedanz)! - Fix duplicate output on CLI help screen
|
||||||
|
|
||||||
|
- Prevent the Task Master CLI from printing the help screen more than once when using `-h` or `--help`.
|
||||||
|
- Removed redundant manual event handlers and guards for help output; now only the Commander `.helpInformation` override is used for custom help.
|
||||||
|
- Simplified logic so that help is only shown once for both "no arguments" and help flag flows.
|
||||||
|
- Ensures a clean, branded help experience with no repeated content.
|
||||||
|
- Fixes #339
|
||||||
|
|
||||||
|
## 0.13.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#399](https://github.com/eyaltoledano/claude-task-master/pull/399) [`734a4fd`](https://github.com/eyaltoledano/claude-task-master/commit/734a4fdcfc89c2e089255618cf940561ad13a3c8) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix ERR_MODULE_NOT_FOUND when trying to run MCP Server
|
||||||
|
|
||||||
|
## 0.13.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`ef782ff`](https://github.com/eyaltoledano/claude-task-master/commit/ef782ff5bd4ceb3ed0dc9ea82087aae5f79ac933) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - feat(expand): Enhance `expand` and `expand-all` commands
|
||||||
|
|
||||||
|
- Integrate `task-complexity-report.json` to automatically determine the number of subtasks and use tailored prompts for expansion based on prior analysis. You no longer need to try copy-pasting the recommended prompt. If it exists, it will use it for you. You can just run `task-master update --id=[id of task] --research` and it will use that prompt automatically. No extra prompt needed.
|
||||||
|
- Change default behavior to _append_ new subtasks to existing ones. Use the `--force` flag to clear existing subtasks before expanding. This is helpful if you need to add more subtasks to a task but you want to do it by the batch from a given prompt. Use force if you want to start fresh with a task's subtasks.
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`87d97bb`](https://github.com/eyaltoledano/claude-task-master/commit/87d97bba00d84e905756d46ef96b2d5b984e0f38) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds support for the OpenRouter AI provider. Users can now configure models available through OpenRouter (requiring an `OPENROUTER_API_KEY`) via the `task-master models` command, granting access to a wide range of additional LLMs. - IMPORTANT FYI ABOUT OPENROUTER: Taskmaster relies on AI SDK, which itself relies on tool use. It looks like **free** models sometimes do not include tool use. For example, Gemini 2.5 pro (free) failed via OpenRouter (no tool use) but worked fine on the paid version of the model. Custom model support for Open Router is considered experimental and likely will not be further improved for some time.
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`1ab836f`](https://github.com/eyaltoledano/claude-task-master/commit/1ab836f191cb8969153593a9a0bd47fc9aa4a831) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds model management and new configuration file .taskmasterconfig which houses the models used for main, research and fallback. Adds models command and setter flags. Adds a --setup flag with an interactive setup. We should be calling this during init. Shows a table of active and available models when models is called without flags. Includes SWE scores and token costs, which are manually entered into the supported_models.json, the new place where models are defined for support. Config-manager.js is the core module responsible for managing the new config."
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`c8722b0`](https://github.com/eyaltoledano/claude-task-master/commit/c8722b0a7a443a73b95d1bcd4a0b68e0fce2a1cd) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds custom model ID support for Ollama and OpenRouter providers.
|
||||||
|
|
||||||
|
- Adds the `--ollama` and `--openrouter` flags to `task-master models --set-<role>` command to set models for those providers outside of the support models list.
|
||||||
|
- Updated `task-master models --setup` interactive mode with options to explicitly enter custom Ollama or OpenRouter model IDs.
|
||||||
|
- Implemented live validation against OpenRouter API (`/api/v1/models`) when setting a custom OpenRouter model ID (via flag or setup).
|
||||||
|
- Refined logic to prioritize explicit provider flags/choices over internal model list lookups in case of ID conflicts.
|
||||||
|
- Added warnings when setting custom/unvalidated models.
|
||||||
|
- We obviously don't recommend going with a custom, unproven model. If you do and find performance is good, please let us know so we can add it to the list of supported models.
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`2517bc1`](https://github.com/eyaltoledano/claude-task-master/commit/2517bc112c9a497110f3286ca4bfb4130c9addcb) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Integrate OpenAI as a new AI provider. - Enhance `models` command/tool to display API key status. - Implement model-specific `maxTokens` override based on `supported-models.json` to save you if you use an incorrect max token value.
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`9a48278`](https://github.com/eyaltoledano/claude-task-master/commit/9a482789f7894f57f655fb8d30ba68542bd0df63) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Tweaks Perplexity AI calls for research mode to max out input tokens and get day-fresh information - Forces temp at 0.1 for highly deterministic output, no variations - Adds a system prompt to further improve the output - Correctly uses the maximum input tokens (8,719, used 8,700) for perplexity - Specificies to use a high degree of research across the web - Specifies to use information that is as fresh as today; this support stuff like capturing brand new announcements like new GPT models and being able to query for those in research. 🔥
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`842eaf7`](https://github.com/eyaltoledano/claude-task-master/commit/842eaf722498ddf7307800b4cdcef4ac4fd7e5b0) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - - Add support for Google Gemini models via Vercel AI SDK integration.
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`ed79d4f`](https://github.com/eyaltoledano/claude-task-master/commit/ed79d4f4735dfab4124fa189214c0bd5e23a6860) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Add xAI provider and Grok models support
|
||||||
|
|
||||||
|
- [#378](https://github.com/eyaltoledano/claude-task-master/pull/378) [`ad89253`](https://github.com/eyaltoledano/claude-task-master/commit/ad89253e313a395637aa48b9f92cc39b1ef94ad8) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Better support for file paths on Windows, Linux & WSL.
|
||||||
|
|
||||||
|
- Standardizes handling of different path formats (URI encoded, Windows, Linux, WSL).
|
||||||
|
- Ensures tools receive a clean, absolute path suitable for the server OS.
|
||||||
|
- Simplifies tool implementation by centralizing normalization logic.
|
||||||
|
|
||||||
|
- [#285](https://github.com/eyaltoledano/claude-task-master/pull/285) [`2acba94`](https://github.com/eyaltoledano/claude-task-master/commit/2acba945c0afee9460d8af18814c87e80f747e9f) Thanks [@neno-is-ooo](https://github.com/neno-is-ooo)! - Add integration for Roo Code
|
||||||
|
|
||||||
|
- [#378](https://github.com/eyaltoledano/claude-task-master/pull/378) [`d63964a`](https://github.com/eyaltoledano/claude-task-master/commit/d63964a10eed9be17856757661ff817ad6bacfdc) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Improved update-subtask - Now it has context about the parent task details - It also has context about the subtask before it and the subtask after it (if they exist) - Not passing all subtasks to stay token efficient
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`5f504fa`](https://github.com/eyaltoledano/claude-task-master/commit/5f504fafb8bdaa0043c2d20dee8bbb8ec2040d85) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Improve and adjust `init` command for robustness and updated dependencies.
|
||||||
|
|
||||||
|
- **Update Initialization Dependencies:** Ensure newly initialized projects (`task-master init`) include all required AI SDK dependencies (`@ai-sdk/*`, `ai`, provider wrappers) in their `package.json` for out-of-the-box AI feature compatibility. Remove unnecessary dependencies (e.g., `uuid`) from the init template.
|
||||||
|
- **Silence `npm install` during `init`:** Prevent `npm install` output from interfering with non-interactive/MCP initialization by suppressing its stdio in silent mode.
|
||||||
|
- **Improve Conditional Model Setup:** Reliably skip interactive `models --setup` during non-interactive `init` runs (e.g., `init -y` or MCP) by checking `isSilentMode()` instead of passing flags.
|
||||||
|
- **Refactor `init.js`:** Remove internal `isInteractive` flag logic.
|
||||||
|
- **Update `init` Instructions:** Tweak the "Getting Started" text displayed after `init`.
|
||||||
|
- **Fix MCP Server Launch:** Update `.cursor/mcp.json` template to use `node ./mcp-server/server.js` instead of `npx task-master-mcp`.
|
||||||
|
- **Update Default Model:** Change the default main model in the `.taskmasterconfig` template.
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`96aeeff`](https://github.com/eyaltoledano/claude-task-master/commit/96aeeffc195372722c6a07370540e235bfe0e4d8) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Fixes an issue with add-task which did not use the manually defined properties and still needlessly hit the AI endpoint.
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`5aea93d`](https://github.com/eyaltoledano/claude-task-master/commit/5aea93d4c0490c242d7d7042a210611977848e0a) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Fixes an issue that prevented remove-subtask with comma separated tasks/subtasks from being deleted (only the first ID was being deleted). Closes #140
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`66ac9ab`](https://github.com/eyaltoledano/claude-task-master/commit/66ac9ab9f66d006da518d6e8a3244e708af2764d) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Improves next command to be subtask-aware - The logic for determining the "next task" (findNextTask function, used by task-master next and the next_task MCP tool) has been significantly improved. Previously, it only considered top-level tasks, making its recommendation less useful when a parent task containing subtasks was already marked 'in-progress'. - The updated logic now prioritizes finding the next available subtask within any 'in-progress' parent task, considering subtask dependencies and priority. - If no suitable subtask is found within active parent tasks, it falls back to recommending the next eligible top-level task based on the original criteria (status, dependencies, priority).
|
||||||
|
|
||||||
|
This change makes the next command much more relevant and helpful during the implementation phase of complex tasks.
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`ca7b045`](https://github.com/eyaltoledano/claude-task-master/commit/ca7b0457f1dc65fd9484e92527d9fd6d69db758d) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Add `--status` flag to `show` command to filter displayed subtasks.
|
||||||
|
|
||||||
|
- [#328](https://github.com/eyaltoledano/claude-task-master/pull/328) [`5a2371b`](https://github.com/eyaltoledano/claude-task-master/commit/5a2371b7cc0c76f5e95d43921c1e8cc8081bf14e) Thanks [@knoxgraeme](https://github.com/knoxgraeme)! - Fix --task to --num-tasks in ui + related tests - issue #324
|
||||||
|
|
||||||
|
- [#240](https://github.com/eyaltoledano/claude-task-master/pull/240) [`6cb213e`](https://github.com/eyaltoledano/claude-task-master/commit/6cb213ebbd51116ae0688e35b575d09443d17c3b) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds a 'models' CLI and MCP command to get the current model configuration, available models, and gives the ability to set main/research/fallback models." - In the CLI, `task-master models` shows the current models config. Using the `--setup` flag launches an interactive set up that allows you to easily select the models you want to use for each of the three roles. Use `q` during the interactive setup to cancel the setup. - In the MCP, responses are simplified in RESTful format (instead of the full CLI output). The agent can use the `models` tool with different arguments, including `listAvailableModels` to get available models. Run without arguments, it will return the current configuration. Arguments are available to set the model for each of the three roles. This allows you to manage Taskmaster AI providers and models directly from either the CLI or MCP or both. - Updated the CLI help menu when you run `task-master` to include missing commands and .taskmasterconfig information. - Adds `--research` flag to `add-task` so you can hit up Perplexity right from the add-task flow, rather than having to add a task and then update it.
|
||||||
|
|
||||||
|
## 0.12.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#307](https://github.com/eyaltoledano/claude-task-master/pull/307) [`2829194`](https://github.com/eyaltoledano/claude-task-master/commit/2829194d3c1dd5373d3bf40275cf4f63b12d49a7) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix add_dependency tool crashing the MCP Server
|
||||||
|
|
||||||
|
## 0.12.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#253](https://github.com/eyaltoledano/claude-task-master/pull/253) [`b2ccd60`](https://github.com/eyaltoledano/claude-task-master/commit/b2ccd605264e47a61451b4c012030ee29011bb40) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add `npx task-master-ai` that runs mcp instead of using `task-master-mcp``
|
||||||
|
|
||||||
|
- [#267](https://github.com/eyaltoledano/claude-task-master/pull/267) [`c17d912`](https://github.com/eyaltoledano/claude-task-master/commit/c17d912237e6caaa2445e934fc48cd4841abf056) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Improve PRD parsing prompt with structured analysis and clearer task generation guidelines. We are testing a new prompt - please provide feedback on your experience.
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#243](https://github.com/eyaltoledano/claude-task-master/pull/243) [`454a1d9`](https://github.com/eyaltoledano/claude-task-master/commit/454a1d9d37439c702656eedc0702c2f7a4451517) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - - Fixes shebang issue not allowing task-master to run on certain windows operating systems
|
||||||
|
|
||||||
|
- Resolves #241 #211 #184 #193
|
||||||
|
|
||||||
|
- [#268](https://github.com/eyaltoledano/claude-task-master/pull/268) [`3e872f8`](https://github.com/eyaltoledano/claude-task-master/commit/3e872f8afbb46cd3978f3852b858c233450b9f33) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix remove-task command to handle multiple comma-separated task IDs
|
||||||
|
|
||||||
|
- [#239](https://github.com/eyaltoledano/claude-task-master/pull/239) [`6599cb0`](https://github.com/eyaltoledano/claude-task-master/commit/6599cb0bf9eccecab528207836e9d45b8536e5c2) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Updates the parameter descriptions for update, update-task and update-subtask to ensure the MCP server correctly reaches for the right update command based on what is being updated -- all tasks, one task, or a subtask.
|
||||||
|
|
||||||
|
- [#272](https://github.com/eyaltoledano/claude-task-master/pull/272) [`3aee9bc`](https://github.com/eyaltoledano/claude-task-master/commit/3aee9bc840eb8f31230bd1b761ed156b261cabc4) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Enhance the `parsePRD` to include `--append` flag. This flag allows users to append the parsed PRD to an existing file, making it easier to manage multiple PRD files without overwriting existing content.
|
||||||
|
|
||||||
|
- [#264](https://github.com/eyaltoledano/claude-task-master/pull/264) [`ff8e75c`](https://github.com/eyaltoledano/claude-task-master/commit/ff8e75cded91fb677903040002626f7a82fd5f88) Thanks [@joedanz](https://github.com/joedanz)! - Add quotes around numeric env vars in mcp.json (Windsurf, etc.)
|
||||||
|
|
||||||
|
- [#248](https://github.com/eyaltoledano/claude-task-master/pull/248) [`d99fa00`](https://github.com/eyaltoledano/claude-task-master/commit/d99fa00980fc61695195949b33dcda7781006f90) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - - Fix `task-master init` polluting codebase with new packages inside `package.json` and modifying project `README`
|
||||||
|
|
||||||
|
- Now only initializes with cursor rules, windsurf rules, mcp.json, scripts/example_prd.txt, .gitignore modifications, and `README-task-master.md`
|
||||||
|
|
||||||
|
- [#266](https://github.com/eyaltoledano/claude-task-master/pull/266) [`41b979c`](https://github.com/eyaltoledano/claude-task-master/commit/41b979c23963483e54331015a86e7c5079f657e4) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fixed a bug that prevented the task-master from running in a Linux container
|
||||||
|
|
||||||
|
- [#265](https://github.com/eyaltoledano/claude-task-master/pull/265) [`0eb16d5`](https://github.com/eyaltoledano/claude-task-master/commit/0eb16d5ecbb8402d1318ca9509e9d4087b27fb25) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Remove the need for project name, description, and version. Since we no longer create a package.json for you
|
||||||
|
|
||||||
|
## 0.11.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#71](https://github.com/eyaltoledano/claude-task-master/pull/71) [`7141062`](https://github.com/eyaltoledano/claude-task-master/commit/71410629ba187776d92a31ea0729b2ff341b5e38) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - - **Easier Ways to Use Taskmaster (CLI & MCP):**
|
||||||
|
- You can now use Taskmaster either by installing it as a standard command-line tool (`task-master`) or as an MCP server directly within integrated development tools like Cursor (using its built-in features). **This makes Taskmaster accessible regardless of your preferred workflow.**
|
||||||
|
- Setting up a new project is simpler in integrated tools, thanks to the new `initialize_project` capability.
|
||||||
|
- **Complete MCP Implementation:**
|
||||||
|
- NOTE: Many MCP clients charge on a per tool basis. In that regard, the most cost-efficient way to use Taskmaster is through the CLI directly. Otherwise, the MCP offers the smoothest and most recommended user experience.
|
||||||
|
- All MCP tools now follow a standardized output format that mimicks RESTful API responses. They are lean JSON responses that are context-efficient. This is a net improvement over the last version which sent the whole CLI output directly, which needlessly wasted tokens.
|
||||||
|
- Added a `remove-task` command to permanently delete tasks you no longer need.
|
||||||
|
- Many new MCP tools are available for managing tasks (updating details, adding/removing subtasks, generating task files, setting status, finding the next task, breaking down complex tasks, handling dependencies, analyzing complexity, etc.), usable both from the command line and integrated tools. **(See the `taskmaster.mdc` reference guide and improved readme for a full list).**
|
||||||
|
- **Better Task Tracking:**
|
||||||
|
- Added a "cancelled" status option for tasks, providing more ways to categorize work.
|
||||||
|
- **Smoother Experience in Integrated Tools:**
|
||||||
|
- Long-running operations (like breaking down tasks or analysis) now run in the background **via an Async Operation Manager** with progress updates, so you know what's happening without waiting and can check status later.
|
||||||
|
- **Improved Documentation:**
|
||||||
|
- Added a comprehensive reference guide (`taskmaster.mdc`) detailing all commands and tools with examples, usage tips, and troubleshooting info. This is mostly for use by the AI but can be useful for human users as well.
|
||||||
|
- Updated the main README with clearer instructions and added a new tutorial/examples guide.
|
||||||
|
- Added documentation listing supported integrated tools (like Cursor).
|
||||||
|
- **Increased Stability & Reliability:**
|
||||||
|
- Using Taskmaster within integrated tools (like Cursor) is now **more stable and the recommended approach.**
|
||||||
|
- Added automated testing (CI) to catch issues earlier, leading to a more reliable tool.
|
||||||
|
- Fixed release process issues to ensure users get the correct package versions when installing or updating via npm.
|
||||||
|
- **Better Command-Line Experience:**
|
||||||
|
- Fixed bugs in the `expand-all` command that could cause **NaN errors or JSON formatting issues (especially when using `--research`).**
|
||||||
|
- Fixed issues with parameter validation in the `analyze-complexity` command (specifically related to the `threshold` parameter).
|
||||||
|
- Made the `add-task` command more consistent by adding standard flags like `--title`, `--description` for manual task creation so you don't have to use `--prompt` and can quickly drop new ideas and stay in your flow.
|
||||||
|
- Improved error messages for incorrect commands or flags, making them easier to understand.
|
||||||
|
- Added confirmation warnings before permanently deleting tasks (`remove-task`) to prevent mistakes. There's a known bug for deleting multiple tasks with comma-separated values. It'll be fixed next release.
|
||||||
|
- Renamed some background tool names used by integrated tools (e.g., `list-tasks` is now `get_tasks`) to be more intuitive if seen in logs or AI interactions.
|
||||||
|
- Smoother project start: **Improved the guidance provided to AI assistants immediately after setup** (related to `init` and `parse-prd` steps). This ensures the AI doesn't go on a tangent deciding its own workflow, and follows the exact process outlined in the Taskmaster workflow.
|
||||||
|
- **Clearer Error Messages:**
|
||||||
|
- When generating subtasks fails, error messages are now clearer, **including specific task IDs and potential suggestions.**
|
||||||
|
- AI fallback from Claude to Perplexity now also works the other way around. If Perplexity is down, will switch to Claude.
|
||||||
|
- **Simplified Setup & Configuration:**
|
||||||
|
- Made it clearer how to configure API keys depending on whether you're using the command-line tool (`.env` file) or an integrated tool (`.cursor/mcp.json` file).
|
||||||
|
- Taskmaster is now better at automatically finding your project files, especially in integrated tools, reducing the need for manual path settings.
|
||||||
|
- Fixed an issue that could prevent Taskmaster from working correctly immediately after initialization in integrated tools (related to how the MCP server was invoked). This should solve the issue most users were experiencing with the last release (0.10.x)
|
||||||
|
- Updated setup templates with clearer examples for API keys.
|
||||||
|
- \*\*For advanced users setting up the MCP server manually, the command is now `npx -y task-master-ai task-master-mcp`.
|
||||||
|
- **Enhanced Performance & AI:**
|
||||||
|
- Updated underlying AI model settings:
|
||||||
|
- **Increased Context Window:** Can now handle larger projects/tasks due to an increased Claude context window (64k -> 128k tokens).
|
||||||
|
- **Reduced AI randomness:** More consistent and predictable AI outputs (temperature 0.4 -> 0.2).
|
||||||
|
- **Updated default AI models:** Uses newer models like `claude-3-7-sonnet-20250219` and Perplexity `sonar-pro` by default.
|
||||||
|
- **More granular breakdown:** Increased the default number of subtasks generated by `expand` to 5 (from 4).
|
||||||
|
- **Consistent defaults:** Set the default priority for new tasks consistently to "medium".
|
||||||
|
- Improved performance when viewing task details in integrated tools by sending less redundant data.
|
||||||
|
- **Documentation Clarity:**
|
||||||
|
- Clarified in documentation that Markdown files (`.md`) can be used for Product Requirements Documents (`parse_prd`).
|
||||||
|
- Improved the description for the `numTasks` option in `parse_prd` for better guidance.
|
||||||
|
- **Improved Visuals (CLI):**
|
||||||
|
- Enhanced the look and feel of progress bars and status updates in the command line.
|
||||||
|
- Added a helpful color-coded progress bar to the task details view (`show` command) to visualize subtask completion.
|
||||||
|
- Made progress bars show a breakdown of task statuses (e.g., how many are pending vs. done).
|
||||||
|
- Made status counts clearer with text labels next to icons.
|
||||||
|
- Prevented progress bars from messing up the display on smaller terminal windows.
|
||||||
|
- Adjusted how progress is calculated for 'deferred' and 'cancelled' tasks in the progress bar, while still showing their distinct status visually.
|
||||||
|
- **Fixes for Integrated Tools:**
|
||||||
|
- Fixed how progress updates are sent to integrated tools, ensuring they display correctly.
|
||||||
|
- Fixed internal issues that could cause errors or invalid JSON responses when using Taskmaster with integrated tools.
|
||||||
|
|
||||||
## 0.10.1
|
## 0.10.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
335
CONTRIBUTING.md
Normal file
335
CONTRIBUTING.md
Normal file
@@ -0,0 +1,335 @@
|
|||||||
|
# Contributing to Task Master
|
||||||
|
|
||||||
|
Thank you for your interest in contributing to Task Master! We're excited to work with you and appreciate your help in making this project better. 🚀
|
||||||
|
|
||||||
|
## 🤝 Our Collaborative Approach
|
||||||
|
|
||||||
|
We're a **PR-friendly team** that values collaboration:
|
||||||
|
|
||||||
|
- ✅ **We review PRs quickly** - Usually within hours, not days
|
||||||
|
- ✅ **We're super reactive** - Expect fast feedback and engagement
|
||||||
|
- ✅ **We sometimes take over PRs** - If your contribution is valuable but needs cleanup, we might jump in to help finish it
|
||||||
|
- ✅ **We're open to all contributions** - From bug fixes to major features
|
||||||
|
|
||||||
|
**We don't mind AI-generated code**, but we do expect you to:
|
||||||
|
|
||||||
|
- ✅ **Review and understand** what the AI generated
|
||||||
|
- ✅ **Test the code thoroughly** before submitting
|
||||||
|
- ✅ **Ensure it's well-written** and follows our patterns
|
||||||
|
- ❌ **Don't submit "AI slop"** - untested, unreviewed AI output
|
||||||
|
|
||||||
|
> **Why this matters**: We spend significant time reviewing PRs. Help us help you by submitting quality contributions that save everyone time!
|
||||||
|
|
||||||
|
## 🚀 Quick Start for Contributors
|
||||||
|
|
||||||
|
### 1. Fork and Clone
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/YOUR_USERNAME/claude-task-master.git
|
||||||
|
cd claude-task-master
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Create a Feature Branch
|
||||||
|
|
||||||
|
**Important**: Always target the `next` branch, not `main`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout next
|
||||||
|
git pull origin next
|
||||||
|
git checkout -b feature/your-feature-name
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Make Your Changes
|
||||||
|
|
||||||
|
Follow our development guidelines below.
|
||||||
|
|
||||||
|
### 4. Test Everything Yourself
|
||||||
|
|
||||||
|
**Before submitting your PR**, ensure:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run all tests
|
||||||
|
npm test
|
||||||
|
|
||||||
|
# Check formatting
|
||||||
|
npm run format-check
|
||||||
|
|
||||||
|
# Fix formatting if needed
|
||||||
|
npm run format
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. Create a Changeset
|
||||||
|
|
||||||
|
**Required for most changes**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run changeset
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [Changeset Guidelines](#changeset-guidelines) below for details.
|
||||||
|
|
||||||
|
### 6. Submit Your PR
|
||||||
|
|
||||||
|
- Target the `next` branch
|
||||||
|
- Write a clear description
|
||||||
|
- Reference any related issues
|
||||||
|
|
||||||
|
## 📋 Development Guidelines
|
||||||
|
|
||||||
|
### Branch Strategy
|
||||||
|
|
||||||
|
- **`main`**: Production-ready code
|
||||||
|
- **`next`**: Development branch - **target this for PRs**
|
||||||
|
- **Feature branches**: `feature/description` or `fix/description`
|
||||||
|
|
||||||
|
### Code Quality Standards
|
||||||
|
|
||||||
|
1. **Write tests** for new functionality
|
||||||
|
2. **Follow existing patterns** in the codebase
|
||||||
|
3. **Add JSDoc comments** for functions
|
||||||
|
4. **Keep functions focused** and single-purpose
|
||||||
|
|
||||||
|
### Testing Requirements
|
||||||
|
|
||||||
|
Your PR **must pass all CI checks**:
|
||||||
|
|
||||||
|
- ✅ **Unit tests**: `npm test`
|
||||||
|
- ✅ **Format check**: `npm run format-check`
|
||||||
|
|
||||||
|
**Test your changes locally first** - this saves review time and shows you care about quality.
|
||||||
|
|
||||||
|
## 📦 Changeset Guidelines
|
||||||
|
|
||||||
|
We use [Changesets](https://github.com/changesets/changesets) to manage versioning and generate changelogs.
|
||||||
|
|
||||||
|
### When to Create a Changeset
|
||||||
|
|
||||||
|
**Always create a changeset for**:
|
||||||
|
|
||||||
|
- ✅ New features
|
||||||
|
- ✅ Bug fixes
|
||||||
|
- ✅ Breaking changes
|
||||||
|
- ✅ Performance improvements
|
||||||
|
- ✅ User-facing documentation updates
|
||||||
|
- ✅ Dependency updates that affect functionality
|
||||||
|
|
||||||
|
**Skip changesets for**:
|
||||||
|
|
||||||
|
- ❌ Internal documentation only
|
||||||
|
- ❌ Test-only changes
|
||||||
|
- ❌ Code formatting/linting
|
||||||
|
- ❌ Development tooling that doesn't affect users
|
||||||
|
|
||||||
|
### How to Create a Changeset
|
||||||
|
|
||||||
|
1. **After making your changes**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run changeset
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Choose the bump type**:
|
||||||
|
|
||||||
|
- **Major**: Breaking changes
|
||||||
|
- **Minor**: New features
|
||||||
|
- **Patch**: Bug fixes, docs, performance improvements
|
||||||
|
|
||||||
|
3. **Write a clear summary**:
|
||||||
|
|
||||||
|
```
|
||||||
|
Add support for custom AI models in MCP configuration
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Commit the changeset file** with your changes:
|
||||||
|
```bash
|
||||||
|
git add .changeset/*.md
|
||||||
|
git commit -m "feat: add custom AI model support"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Changeset vs Git Commit Messages
|
||||||
|
|
||||||
|
- **Changeset summary**: User-facing, goes in CHANGELOG.md
|
||||||
|
- **Git commit**: Developer-facing, explains the technical change
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Changeset summary (user-facing)
|
||||||
|
"Add support for custom Ollama models"
|
||||||
|
|
||||||
|
# Git commit message (developer-facing)
|
||||||
|
"feat(models): implement custom Ollama model validation
|
||||||
|
|
||||||
|
- Add model validation for custom Ollama endpoints
|
||||||
|
- Update configuration schema to support custom models
|
||||||
|
- Add tests for new validation logic"
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔧 Development Setup
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
- Node.js 18+
|
||||||
|
- npm or yarn
|
||||||
|
|
||||||
|
### Environment Setup
|
||||||
|
|
||||||
|
1. **Copy environment template**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Add your API keys** (for testing AI features):
|
||||||
|
```bash
|
||||||
|
ANTHROPIC_API_KEY=your_key_here
|
||||||
|
OPENAI_API_KEY=your_key_here
|
||||||
|
# Add others as needed
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running Tests
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run all tests
|
||||||
|
npm test
|
||||||
|
|
||||||
|
# Run tests in watch mode
|
||||||
|
npm run test:watch
|
||||||
|
|
||||||
|
# Run with coverage
|
||||||
|
npm run test:coverage
|
||||||
|
|
||||||
|
# Run E2E tests
|
||||||
|
npm run test:e2e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Code Formatting
|
||||||
|
|
||||||
|
We use Prettier for consistent formatting:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check formatting
|
||||||
|
npm run format-check
|
||||||
|
|
||||||
|
# Fix formatting
|
||||||
|
npm run format
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📝 PR Guidelines
|
||||||
|
|
||||||
|
### Before Submitting
|
||||||
|
|
||||||
|
- [ ] **Target the `next` branch**
|
||||||
|
- [ ] **Test everything locally**
|
||||||
|
- [ ] **Run the full test suite**
|
||||||
|
- [ ] **Check code formatting**
|
||||||
|
- [ ] **Create a changeset** (if needed)
|
||||||
|
- [ ] **Re-read your changes** - ensure they're clean and well-thought-out
|
||||||
|
|
||||||
|
### PR Description Template
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
## Description
|
||||||
|
|
||||||
|
Brief description of what this PR does.
|
||||||
|
|
||||||
|
## Type of Change
|
||||||
|
|
||||||
|
- [ ] Bug fix
|
||||||
|
- [ ] New feature
|
||||||
|
- [ ] Breaking change
|
||||||
|
- [ ] Documentation update
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
- [ ] I have tested this locally
|
||||||
|
- [ ] All existing tests pass
|
||||||
|
- [ ] I have added tests for new functionality
|
||||||
|
|
||||||
|
## Changeset
|
||||||
|
|
||||||
|
- [ ] I have created a changeset (or this change doesn't need one)
|
||||||
|
|
||||||
|
## Additional Notes
|
||||||
|
|
||||||
|
Any additional context or notes for reviewers.
|
||||||
|
```
|
||||||
|
|
||||||
|
### What We Look For
|
||||||
|
|
||||||
|
✅ **Good PRs**:
|
||||||
|
|
||||||
|
- Clear, focused changes
|
||||||
|
- Comprehensive testing
|
||||||
|
- Good commit messages
|
||||||
|
- Proper changeset (when needed)
|
||||||
|
- Self-reviewed code
|
||||||
|
|
||||||
|
❌ **Avoid**:
|
||||||
|
|
||||||
|
- Massive PRs that change everything
|
||||||
|
- Untested code
|
||||||
|
- Formatting issues
|
||||||
|
- Missing changesets for user-facing changes
|
||||||
|
- AI-generated code that wasn't reviewed
|
||||||
|
|
||||||
|
## 🏗️ Project Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
claude-task-master/
|
||||||
|
├── bin/ # CLI executables
|
||||||
|
├── mcp-server/ # MCP server implementation
|
||||||
|
├── scripts/ # Core task management logic
|
||||||
|
├── src/ # Shared utilities and providers and well refactored code (we are slowly moving everything here)
|
||||||
|
├── tests/ # Test files
|
||||||
|
├── docs/ # Documentation
|
||||||
|
└── .cursor/ # Cursor IDE rules and configuration
|
||||||
|
└── assets/ # Assets like rules and configuration for all IDEs
|
||||||
|
```
|
||||||
|
|
||||||
|
### Key Areas for Contribution
|
||||||
|
|
||||||
|
- **CLI Commands**: `scripts/modules/commands.js`
|
||||||
|
- **MCP Tools**: `mcp-server/src/tools/`
|
||||||
|
- **Core Logic**: `scripts/modules/task-manager/`
|
||||||
|
- **AI Providers**: `src/ai-providers/`
|
||||||
|
- **Tests**: `tests/`
|
||||||
|
|
||||||
|
## 🐛 Reporting Issues
|
||||||
|
|
||||||
|
### Bug Reports
|
||||||
|
|
||||||
|
Include:
|
||||||
|
|
||||||
|
- Task Master version
|
||||||
|
- Node.js version
|
||||||
|
- Operating system
|
||||||
|
- Steps to reproduce
|
||||||
|
- Expected vs actual behavior
|
||||||
|
- Error messages/logs
|
||||||
|
|
||||||
|
### Feature Requests
|
||||||
|
|
||||||
|
Include:
|
||||||
|
|
||||||
|
- Clear description of the feature
|
||||||
|
- Use case/motivation
|
||||||
|
- Proposed implementation (if you have ideas)
|
||||||
|
- Willingness to contribute
|
||||||
|
|
||||||
|
## 💬 Getting Help
|
||||||
|
|
||||||
|
- **Discord**: [Join our community](https://discord.gg/taskmasterai)
|
||||||
|
- **Issues**: [GitHub Issues](https://github.com/eyaltoledano/claude-task-master/issues)
|
||||||
|
- **Discussions**: [GitHub Discussions](https://github.com/eyaltoledano/claude-task-master/discussions)
|
||||||
|
|
||||||
|
## 📄 License
|
||||||
|
|
||||||
|
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT with Commons Clause).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Thank you for contributing to Task Master!** 🎉
|
||||||
|
|
||||||
|
Your contributions help make AI-driven development more accessible and efficient for everyone.
|
||||||
@@ -13,25 +13,22 @@ A task management system for AI-driven development with Claude, designed to work
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
The script can be configured through environment variables in a `.env` file at the root of the project:
|
Taskmaster uses two primary configuration methods:
|
||||||
|
|
||||||
### Required Configuration
|
1. **`.taskmasterconfig` File (Project Root)**
|
||||||
|
|
||||||
- `ANTHROPIC_API_KEY`: Your Anthropic API key for Claude
|
- Stores most settings: AI model selections (main, research, fallback), parameters (max tokens, temperature), logging level, default priority/subtasks, project name.
|
||||||
|
- **Created and managed using `task-master models --setup` CLI command or the `models` MCP tool.**
|
||||||
|
- Do not edit manually unless you know what you are doing.
|
||||||
|
|
||||||
### Optional Configuration
|
2. **Environment Variables (`.env` file or MCP `env` block)**
|
||||||
|
- Used **only** for sensitive **API Keys** (e.g., `ANTHROPIC_API_KEY`, `PERPLEXITY_API_KEY`, etc.) and specific endpoints (like `OLLAMA_BASE_URL`).
|
||||||
|
- **For CLI:** Place keys in a `.env` file in your project root.
|
||||||
|
- **For MCP/Cursor:** Place keys in the `env` section of your `.cursor/mcp.json` (or other MCP config according to the AI IDE or client you use) file under the `taskmaster-ai` server definition.
|
||||||
|
|
||||||
- `MODEL`: Specify which Claude model to use (default: "claude-3-7-sonnet-20250219")
|
**Important:** Settings like model choices, max tokens, temperature, and log level are **no longer configured via environment variables.** Use the `task-master models` command or tool.
|
||||||
- `MAX_TOKENS`: Maximum tokens for model responses (default: 4000)
|
|
||||||
- `TEMPERATURE`: Temperature for model responses (default: 0.7)
|
See the [Configuration Guide](docs/configuration.md) for full details.
|
||||||
- `PERPLEXITY_API_KEY`: Your Perplexity API key for research-backed subtask generation
|
|
||||||
- `PERPLEXITY_MODEL`: Specify which Perplexity model to use (default: "sonar-medium-online")
|
|
||||||
- `DEBUG`: Enable debug logging (default: false)
|
|
||||||
- `LOG_LEVEL`: Log level - debug, info, warn, error (default: info)
|
|
||||||
- `DEFAULT_SUBTASKS`: Default number of subtasks when expanding (default: 3)
|
|
||||||
- `DEFAULT_PRIORITY`: Default priority for generated tasks (default: medium)
|
|
||||||
- `PROJECT_NAME`: Override default project name in tasks.json
|
|
||||||
- `PROJECT_VERSION`: Override default version in tasks.json
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -50,7 +47,7 @@ npm install task-master-ai
|
|||||||
task-master init
|
task-master init
|
||||||
|
|
||||||
# If installed locally
|
# If installed locally
|
||||||
npx task-master-init
|
npx task-master init
|
||||||
```
|
```
|
||||||
|
|
||||||
This will prompt you for project details and set up a new project with the necessary files and structure.
|
This will prompt you for project details and set up a new project with the necessary files and structure.
|
||||||
@@ -146,7 +143,7 @@ To enable enhanced task management capabilities directly within Cursor using the
|
|||||||
4. Configure with the following details:
|
4. Configure with the following details:
|
||||||
- Name: "Task Master"
|
- Name: "Task Master"
|
||||||
- Type: "Command"
|
- Type: "Command"
|
||||||
- Command: "npx -y --package task-master-ai task-master-mcp"
|
- Command: "npx -y task-master-ai"
|
||||||
5. Save the settings
|
5. Save the settings
|
||||||
|
|
||||||
Once configured, you can interact with Task Master's task management commands directly through Cursor's interface, providing a more integrated experience.
|
Once configured, you can interact with Task Master's task management commands directly through Cursor's interface, providing a more integrated experience.
|
||||||
|
|||||||
183
README.md
183
README.md
@@ -1,67 +1,174 @@
|
|||||||
# Task Master [](https://github.com/eyaltoledano/claude-task-master/stargazers)
|
# Task Master [](https://github.com/eyaltoledano/claude-task-master/stargazers)
|
||||||
|
|
||||||
[](https://github.com/eyaltoledano/claude-task-master/actions/workflows/ci.yml) [](https://badge.fury.io/js/task-master-ai)
|
[](https://github.com/eyaltoledano/claude-task-master/actions/workflows/ci.yml) [](https://badge.fury.io/js/task-master-ai) [](https://discord.gg/taskmasterai) [](LICENSE)
|
||||||
|
|
||||||
 [](LICENSE)
|
[](https://www.npmjs.com/package/task-master-ai) [](https://www.npmjs.com/package/task-master-ai) [](https://www.npmjs.com/package/task-master-ai)
|
||||||
|
|
||||||
### By [@eyaltoledano](https://x.com/eyaltoledano) & [@RalphEcom](https://x.com/RalphEcom)
|
## By [@eyaltoledano](https://x.com/eyaltoledano), [@RalphEcom](https://x.com/RalphEcom) & [@jasonzhou1993](https://x.com/jasonzhou1993)
|
||||||
|
|
||||||
[](https://x.com/eyaltoledano)
|
[](https://x.com/eyaltoledano)
|
||||||
[](https://x.com/RalphEcom)
|
[](https://x.com/RalphEcom)
|
||||||
|
[](https://x.com/jasonzhou1993)
|
||||||
|
|
||||||
A task management system for AI-driven development with Claude, designed to work seamlessly with Cursor AI.
|
A task management system for AI-driven development with Claude, designed to work seamlessly with Cursor AI.
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
For more detailed information, check out the documentation in the `docs` directory:
|
||||||
|
|
||||||
|
- [Configuration Guide](docs/configuration.md) - Set up environment variables and customize Task Master
|
||||||
|
- [Tutorial](docs/tutorial.md) - Step-by-step guide to getting started with Task Master
|
||||||
|
- [Command Reference](docs/command-reference.md) - Complete list of all available commands
|
||||||
|
- [Task Structure](docs/task-structure.md) - Understanding the task format and features
|
||||||
|
- [Example Interactions](docs/examples.md) - Common Cursor AI interaction examples
|
||||||
|
- [Migration Guide](docs/migration-guide.md) - Guide to migrating to the new project structure
|
||||||
|
|
||||||
|
#### Quick Install for Cursor 1.0+ (One-Click)
|
||||||
|
|
||||||
|
📋 Click the copy button (top-right of code block) then paste into your browser:
|
||||||
|
|
||||||
|
```text
|
||||||
|
cursor://anysphere.cursor-deeplink/mcp/install?name=taskmaster-ai&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIi0tcGFja2FnZT10YXNrLW1hc3Rlci1haSIsInRhc2stbWFzdGVyLWFpIl0sImVudiI6eyJBTlRIUk9QSUNfQVBJX0tFWSI6IllPVVJfQU5USFJPUElDX0FQSV9LRVlfSEVSRSIsIlBFUlBMRVhJVFlfQVBJX0tFWSI6IllPVVJfUEVSUExFWElUWV9BUElfS0VZX0hFUkUiLCJPUEVOQUlfQVBJX0tFWSI6IllPVVJfT1BFTkFJX0tFWV9IRVJFIiwiR09PR0xFX0FQSV9LRVkiOiJZT1VSX0dPT0dMRV9LRVlfSEVSRSIsIk1JU1RSQUxfQVBJX0tFWSI6IllPVVJfTUlTVFJBTF9LRVlfSEVSRSIsIk9QRU5ST1VURVJfQVBJX0tFWSI6IllPVVJfT1BFTlJPVVRFUl9LRVlfSEVSRSIsIlhBSV9BUElfS0VZIjoiWU9VUl9YQUlfS0VZX0hFUkUiLCJBWlVSRV9PUEVOQUlfQVBJX0tFWSI6IllPVVJfQVpVUkVfS0VZX0hFUkUiLCJPTExBTUFfQVBJX0tFWSI6IllPVVJfT0xMQU1BX0FQSV9LRVlfSEVSRSJ9fQo=
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Note:** After clicking the link, you'll still need to add your API keys to the configuration. The link installs the MCP server with placeholder keys that you'll need to replace with your actual API keys.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
Taskmaster utilizes AI across several commands, and those require a separate API key. You can use a variety of models from different AI providers provided you add your API keys. For example, if you want to use Claude 3.7, you'll need an Anthropic API key.
|
||||||
|
|
||||||
|
You can define 3 types of models to be used: the main model, the research model, and the fallback model (in case either the main or research fail). Whatever model you use, its provider API key must be present in either mcp.json or .env.
|
||||||
|
|
||||||
|
At least one (1) of the following is required:
|
||||||
|
|
||||||
- Anthropic API key (Claude API)
|
- Anthropic API key (Claude API)
|
||||||
- OpenAI SDK (for Perplexity API integration, optional)
|
- OpenAI API key
|
||||||
|
- Google Gemini API key
|
||||||
|
- Perplexity API key (for research model)
|
||||||
|
- xAI API Key (for research or main model)
|
||||||
|
- OpenRouter API Key (for research or main model)
|
||||||
|
|
||||||
|
Using the research model is optional but highly recommended. You will need at least ONE API key. Adding all API keys enables you to seamlessly switch between model providers at will.
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
### Option 1 | MCP (Recommended):
|
### Option 1: MCP (Recommended)
|
||||||
|
|
||||||
MCP (Model Control Protocol) provides the easiest way to get started with Task Master directly in your editor.
|
MCP (Model Control Protocol) lets you run Task Master directly from your editor.
|
||||||
|
|
||||||
1. **Add the MCP config to your editor** (Cursor recommended, but it works with other text editors):
|
#### 1. Add your MCP config at the following path depending on your editor
|
||||||
|
|
||||||
|
| Editor | Scope | Linux/macOS Path | Windows Path | Key |
|
||||||
|
| ------------ | ------- | ------------------------------------- | ------------------------------------------------- | ------------ |
|
||||||
|
| **Cursor** | Global | `~/.cursor/mcp.json` | `%USERPROFILE%\.cursor\mcp.json` | `mcpServers` |
|
||||||
|
| | Project | `<project_folder>/.cursor/mcp.json` | `<project_folder>\.cursor\mcp.json` | `mcpServers` |
|
||||||
|
| **Windsurf** | Global | `~/.codeium/windsurf/mcp_config.json` | `%USERPROFILE%\.codeium\windsurf\mcp_config.json` | `mcpServers` |
|
||||||
|
| **VS Code** | Project | `<project_folder>/.vscode/mcp.json` | `<project_folder>\.vscode\mcp.json` | `servers` |
|
||||||
|
|
||||||
|
##### Manual Configuration
|
||||||
|
|
||||||
|
###### Cursor & Windsurf (`mcpServers`)
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"taskmaster-ai": {
|
"taskmaster-ai": {
|
||||||
"command": "npx",
|
"command": "npx",
|
||||||
"args": ["-y", "task-master-ai", "mcp-server"],
|
"args": ["-y", "--package=task-master-ai", "task-master-ai"],
|
||||||
"env": {
|
"env": {
|
||||||
"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE",
|
"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE",
|
||||||
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE",
|
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE",
|
||||||
"MODEL": "claude-3-7-sonnet-20250219",
|
"OPENAI_API_KEY": "YOUR_OPENAI_KEY_HERE",
|
||||||
"PERPLEXITY_MODEL": "sonar-pro",
|
"GOOGLE_API_KEY": "YOUR_GOOGLE_KEY_HERE",
|
||||||
"MAX_TOKENS": 128000,
|
"MISTRAL_API_KEY": "YOUR_MISTRAL_KEY_HERE",
|
||||||
"TEMPERATURE": 0.2,
|
"OPENROUTER_API_KEY": "YOUR_OPENROUTER_KEY_HERE",
|
||||||
"DEFAULT_SUBTASKS": 5,
|
"XAI_API_KEY": "YOUR_XAI_KEY_HERE",
|
||||||
"DEFAULT_PRIORITY": "medium"
|
"AZURE_OPENAI_API_KEY": "YOUR_AZURE_KEY_HERE",
|
||||||
|
"OLLAMA_API_KEY": "YOUR_OLLAMA_API_KEY_HERE"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Enable the MCP** in your editor
|
> 🔑 Replace `YOUR_…_KEY_HERE` with your real API keys. You can remove keys you don't use.
|
||||||
|
|
||||||
3. **Prompt the AI** to initialize Task Master:
|
###### VS Code (`servers` + `type`)
|
||||||
|
|
||||||
```
|
```json
|
||||||
Can you please initialize taskmaster-ai into my project?
|
{
|
||||||
|
"servers": {
|
||||||
|
"taskmaster-ai": {
|
||||||
|
"command": "npx",
|
||||||
|
"args": ["-y", "--package=task-master-ai", "task-master-ai"],
|
||||||
|
"env": {
|
||||||
|
"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE",
|
||||||
|
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE",
|
||||||
|
"OPENAI_API_KEY": "YOUR_OPENAI_KEY_HERE",
|
||||||
|
"GOOGLE_API_KEY": "YOUR_GOOGLE_KEY_HERE",
|
||||||
|
"MISTRAL_API_KEY": "YOUR_MISTRAL_KEY_HERE",
|
||||||
|
"OPENROUTER_API_KEY": "YOUR_OPENROUTER_KEY_HERE",
|
||||||
|
"XAI_API_KEY": "YOUR_XAI_KEY_HERE",
|
||||||
|
"AZURE_OPENAI_API_KEY": "YOUR_AZURE_KEY_HERE"
|
||||||
|
},
|
||||||
|
"type": "stdio"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
4. **Use common commands** directly through your AI assistant:
|
> 🔑 Replace `YOUR_…_KEY_HERE` with your real API keys. You can remove keys you don't use.
|
||||||
|
|
||||||
|
#### 2. (Cursor-only) Enable Taskmaster MCP
|
||||||
|
|
||||||
|
Open Cursor Settings (Ctrl+Shift+J) ➡ Click on MCP tab on the left ➡ Enable task-master-ai with the toggle
|
||||||
|
|
||||||
|
#### 3. (Optional) Configure the models you want to use
|
||||||
|
|
||||||
|
In your editor's AI chat pane, say:
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
Can you parse my PRD at scripts/prd.txt?
|
Change the main, research and fallback models to <model_name>, <model_name> and <model_name> respectively.
|
||||||
What's the next task I should work on?
|
|
||||||
Can you help me implement task 3?
|
|
||||||
Can you help me expand task 4?
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
[Table of available models](docs/models.md)
|
||||||
|
|
||||||
|
#### 4. Initialize Task Master
|
||||||
|
|
||||||
|
In your editor's AI chat pane, say:
|
||||||
|
|
||||||
|
```txt
|
||||||
|
Initialize taskmaster-ai in my project
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 5. Make sure you have a PRD (Recommended)
|
||||||
|
|
||||||
|
For **new projects**: Create your PRD at `.taskmaster/docs/prd.txt`
|
||||||
|
For **existing projects**: You can use `scripts/prd.txt` or migrate with `task-master migrate`
|
||||||
|
|
||||||
|
An example PRD template is available after initialization in `.taskmaster/templates/example_prd.txt`.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> While a PRD is recommended for complex projects, you can always create individual tasks by asking "Can you help me implement [description of what you want to do]?" in chat.
|
||||||
|
|
||||||
|
**Always start with a detailed PRD.**
|
||||||
|
|
||||||
|
The more detailed your PRD, the better the generated tasks will be.
|
||||||
|
|
||||||
|
#### 6. Common Commands
|
||||||
|
|
||||||
|
Use your AI assistant to:
|
||||||
|
|
||||||
|
- Parse requirements: `Can you parse my PRD at scripts/prd.txt?`
|
||||||
|
- Plan next step: `What's the next task I should work on?`
|
||||||
|
- Implement a task: `Can you help me implement task 3?`
|
||||||
|
- View multiple tasks: `Can you show me tasks 1, 3, and 5?`
|
||||||
|
- Expand a task: `Can you help me expand task 4?`
|
||||||
|
- **Research fresh information**: `Research the latest best practices for implementing JWT authentication with Node.js`
|
||||||
|
- **Research with context**: `Research React Query v5 migration strategies for our current API implementation in src/api.js`
|
||||||
|
|
||||||
|
[More examples on how to use Task Master in chat](docs/examples.md)
|
||||||
|
|
||||||
### Option 2: Using Command Line
|
### Option 2: Using Command Line
|
||||||
|
|
||||||
#### Installation
|
#### Installation
|
||||||
@@ -81,7 +188,7 @@ npm install task-master-ai
|
|||||||
task-master init
|
task-master init
|
||||||
|
|
||||||
# If installed locally
|
# If installed locally
|
||||||
npx task-master-init
|
npx task-master init
|
||||||
```
|
```
|
||||||
|
|
||||||
This will prompt you for project details and set up a new project with the necessary files and structure.
|
This will prompt you for project details and set up a new project with the necessary files and structure.
|
||||||
@@ -101,23 +208,19 @@ task-master list
|
|||||||
# Show the next task to work on
|
# Show the next task to work on
|
||||||
task-master next
|
task-master next
|
||||||
|
|
||||||
|
# Show specific task(s) - supports comma-separated IDs
|
||||||
|
task-master show 1,3,5
|
||||||
|
|
||||||
|
# Research fresh information with project context
|
||||||
|
task-master research "What are the latest best practices for JWT authentication?"
|
||||||
|
|
||||||
# Generate task files
|
# Generate task files
|
||||||
task-master generate
|
task-master generate
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
For more detailed information, check out the documentation in the `docs` directory:
|
|
||||||
|
|
||||||
- [Configuration Guide](docs/configuration.md) - Set up environment variables and customize Task Master
|
|
||||||
- [Tutorial](docs/tutorial.md) - Step-by-step guide to getting started with Task Master
|
|
||||||
- [Command Reference](docs/command-reference.md) - Complete list of all available commands
|
|
||||||
- [Task Structure](docs/task-structure.md) - Understanding the task format and features
|
|
||||||
- [Example Interactions](docs/examples.md) - Common Cursor AI interaction examples
|
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### If `task-master init` doesn't respond:
|
### If `task-master init` doesn't respond
|
||||||
|
|
||||||
Try running it with Node directly:
|
Try running it with Node directly:
|
||||||
|
|
||||||
@@ -133,6 +236,12 @@ cd claude-task-master
|
|||||||
node scripts/init.js
|
node scripts/init.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
<a href="https://github.com/eyaltoledano/claude-task-master/graphs/contributors">
|
||||||
|
<img src="https://contrib.rocks/image?repo=eyaltoledano/claude-task-master" alt="Task Master project contributors" />
|
||||||
|
</a>
|
||||||
|
|
||||||
## Star History
|
## Star History
|
||||||
|
|
||||||
[](https://www.star-history.com/#eyaltoledano/claude-task-master&Timeline)
|
[](https://www.star-history.com/#eyaltoledano/claude-task-master&Timeline)
|
||||||
|
|||||||
@@ -1,18 +1,22 @@
|
|||||||
Below you will find a variety of important rules spanning:
|
Below you will find a variety of important rules spanning:
|
||||||
|
|
||||||
- the dev_workflow
|
- the dev_workflow
|
||||||
- the .windsurfrules document self-improvement workflow
|
- the .windsurfrules document self-improvement workflow
|
||||||
- the template to follow when modifying or adding new sections/rules to this document.
|
- the template to follow when modifying or adding new sections/rules to this document.
|
||||||
|
|
||||||
---
|
---
|
||||||
DEV_WORKFLOW
|
|
||||||
---
|
## DEV_WORKFLOW
|
||||||
|
|
||||||
description: Guide for using meta-development script (scripts/dev.js) to manage task-driven development workflows
|
description: Guide for using meta-development script (scripts/dev.js) to manage task-driven development workflows
|
||||||
globs: **/*
|
globs: **/\*
|
||||||
filesToApplyRule: **/*
|
filesToApplyRule: **/\*
|
||||||
alwaysApply: true
|
alwaysApply: true
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **Global CLI Commands**
|
- **Global CLI Commands**
|
||||||
|
|
||||||
- Task Master now provides a global CLI through the `task-master` command
|
- Task Master now provides a global CLI through the `task-master` command
|
||||||
- All functionality from `scripts/dev.js` is available through this interface
|
- All functionality from `scripts/dev.js` is available through this interface
|
||||||
- Install globally with `npm install -g claude-task-master` or use locally via `npx`
|
- Install globally with `npm install -g claude-task-master` or use locally via `npx`
|
||||||
@@ -25,6 +29,7 @@ alwaysApply: true
|
|||||||
- The CLI provides additional commands like `task-master init` for project setup
|
- The CLI provides additional commands like `task-master init` for project setup
|
||||||
|
|
||||||
- **Development Workflow Process**
|
- **Development Workflow Process**
|
||||||
|
|
||||||
- Start new projects by running `task-master init` or `node scripts/dev.js parse-prd --input=<prd-file.txt>` to generate initial tasks.json
|
- Start new projects by running `task-master init` or `node scripts/dev.js parse-prd --input=<prd-file.txt>` to generate initial tasks.json
|
||||||
- Begin coding sessions with `task-master list` to see current tasks, status, and IDs
|
- Begin coding sessions with `task-master list` to see current tasks, status, and IDs
|
||||||
- Analyze task complexity with `task-master analyze-complexity --research` before breaking down tasks
|
- Analyze task complexity with `task-master analyze-complexity --research` before breaking down tasks
|
||||||
@@ -43,6 +48,7 @@ alwaysApply: true
|
|||||||
- Report progress regularly using the list command
|
- Report progress regularly using the list command
|
||||||
|
|
||||||
- **Task Complexity Analysis**
|
- **Task Complexity Analysis**
|
||||||
|
|
||||||
- Run `node scripts/dev.js analyze-complexity --research` for comprehensive analysis
|
- Run `node scripts/dev.js analyze-complexity --research` for comprehensive analysis
|
||||||
- Review complexity report in scripts/task-complexity-report.json
|
- Review complexity report in scripts/task-complexity-report.json
|
||||||
- Or use `node scripts/dev.js complexity-report` for a formatted, readable version of the report
|
- Or use `node scripts/dev.js complexity-report` for a formatted, readable version of the report
|
||||||
@@ -51,6 +57,7 @@ alwaysApply: true
|
|||||||
- Note that reports are automatically used by the expand command
|
- Note that reports are automatically used by the expand command
|
||||||
|
|
||||||
- **Task Breakdown Process**
|
- **Task Breakdown Process**
|
||||||
|
|
||||||
- For tasks with complexity analysis, use `node scripts/dev.js expand --id=<id>`
|
- For tasks with complexity analysis, use `node scripts/dev.js expand --id=<id>`
|
||||||
- Otherwise use `node scripts/dev.js expand --id=<id> --subtasks=<number>`
|
- Otherwise use `node scripts/dev.js expand --id=<id> --subtasks=<number>`
|
||||||
- Add `--research` flag to leverage Perplexity AI for research-backed expansion
|
- Add `--research` flag to leverage Perplexity AI for research-backed expansion
|
||||||
@@ -60,18 +67,21 @@ alwaysApply: true
|
|||||||
- If subtasks need regeneration, clear them first with `clear-subtasks` command
|
- If subtasks need regeneration, clear them first with `clear-subtasks` command
|
||||||
|
|
||||||
- **Implementation Drift Handling**
|
- **Implementation Drift Handling**
|
||||||
|
|
||||||
- When implementation differs significantly from planned approach
|
- When implementation differs significantly from planned approach
|
||||||
- When future tasks need modification due to current implementation choices
|
- When future tasks need modification due to current implementation choices
|
||||||
- When new dependencies or requirements emerge
|
- When new dependencies or requirements emerge
|
||||||
- Call `node scripts/dev.js update --from=<futureTaskId> --prompt="<explanation>"` to update tasks.json
|
- Call `node scripts/dev.js update --from=<futureTaskId> --prompt="<explanation>"` to update tasks.json
|
||||||
|
|
||||||
- **Task Status Management**
|
- **Task Status Management**
|
||||||
|
|
||||||
- Use 'pending' for tasks ready to be worked on
|
- Use 'pending' for tasks ready to be worked on
|
||||||
- Use 'done' for completed and verified tasks
|
- Use 'done' for completed and verified tasks
|
||||||
- Use 'deferred' for postponed tasks
|
- Use 'deferred' for postponed tasks
|
||||||
- Add custom status values as needed for project-specific workflows
|
- Add custom status values as needed for project-specific workflows
|
||||||
|
|
||||||
- **Task File Format Reference**
|
- **Task File Format Reference**
|
||||||
|
|
||||||
```
|
```
|
||||||
# Task ID: <id>
|
# Task ID: <id>
|
||||||
# Title: <title>
|
# Title: <title>
|
||||||
@@ -87,6 +97,7 @@ alwaysApply: true
|
|||||||
```
|
```
|
||||||
|
|
||||||
- **Command Reference: parse-prd**
|
- **Command Reference: parse-prd**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js parse-prd --input=<prd-file.txt>`
|
- Legacy Syntax: `node scripts/dev.js parse-prd --input=<prd-file.txt>`
|
||||||
- CLI Syntax: `task-master parse-prd --input=<prd-file.txt>`
|
- CLI Syntax: `task-master parse-prd --input=<prd-file.txt>`
|
||||||
- Description: Parses a PRD document and generates a tasks.json file with structured tasks
|
- Description: Parses a PRD document and generates a tasks.json file with structured tasks
|
||||||
@@ -96,6 +107,7 @@ alwaysApply: true
|
|||||||
- Notes: Will overwrite existing tasks.json file. Use with caution.
|
- Notes: Will overwrite existing tasks.json file. Use with caution.
|
||||||
|
|
||||||
- **Command Reference: update**
|
- **Command Reference: update**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js update --from=<id> --prompt="<prompt>"`
|
- Legacy Syntax: `node scripts/dev.js update --from=<id> --prompt="<prompt>"`
|
||||||
- CLI Syntax: `task-master update --from=<id> --prompt="<prompt>"`
|
- CLI Syntax: `task-master update --from=<id> --prompt="<prompt>"`
|
||||||
- Description: Updates tasks with ID >= specified ID based on the provided prompt
|
- Description: Updates tasks with ID >= specified ID based on the provided prompt
|
||||||
@@ -106,16 +118,18 @@ alwaysApply: true
|
|||||||
- Notes: Only updates tasks not marked as 'done'. Completed tasks remain unchanged.
|
- Notes: Only updates tasks not marked as 'done'. Completed tasks remain unchanged.
|
||||||
|
|
||||||
- **Command Reference: generate**
|
- **Command Reference: generate**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js generate`
|
- Legacy Syntax: `node scripts/dev.js generate`
|
||||||
- CLI Syntax: `task-master generate`
|
- CLI Syntax: `task-master generate`
|
||||||
- Description: Generates individual task files in tasks/ directory based on tasks.json
|
- Description: Generates individual task files based on tasks.json
|
||||||
- Parameters:
|
- Parameters:
|
||||||
- `--file=<path>, -f`: Use alternative tasks.json file (default: 'tasks/tasks.json')
|
- `--file=<path>, -f`: Use alternative tasks.json file (default: '.taskmaster/tasks/tasks.json')
|
||||||
- `--output=<dir>, -o`: Output directory (default: 'tasks')
|
- `--output=<dir>, -o`: Output directory (default: '.taskmaster/tasks')
|
||||||
- Example: `task-master generate`
|
- Example: `task-master generate`
|
||||||
- Notes: Overwrites existing task files. Creates tasks/ directory if needed.
|
- Notes: Overwrites existing task files. Creates output directory if needed.
|
||||||
|
|
||||||
- **Command Reference: set-status**
|
- **Command Reference: set-status**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js set-status --id=<id> --status=<status>`
|
- Legacy Syntax: `node scripts/dev.js set-status --id=<id> --status=<status>`
|
||||||
- CLI Syntax: `task-master set-status --id=<id> --status=<status>`
|
- CLI Syntax: `task-master set-status --id=<id> --status=<status>`
|
||||||
- Description: Updates the status of a specific task in tasks.json
|
- Description: Updates the status of a specific task in tasks.json
|
||||||
@@ -126,6 +140,7 @@ alwaysApply: true
|
|||||||
- Notes: Common values are 'done', 'pending', and 'deferred', but any string is accepted.
|
- Notes: Common values are 'done', 'pending', and 'deferred', but any string is accepted.
|
||||||
|
|
||||||
- **Command Reference: list**
|
- **Command Reference: list**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js list`
|
- Legacy Syntax: `node scripts/dev.js list`
|
||||||
- CLI Syntax: `task-master list`
|
- CLI Syntax: `task-master list`
|
||||||
- Description: Lists all tasks in tasks.json with IDs, titles, and status
|
- Description: Lists all tasks in tasks.json with IDs, titles, and status
|
||||||
@@ -137,6 +152,7 @@ alwaysApply: true
|
|||||||
- Notes: Provides quick overview of project progress. Use at start of sessions.
|
- Notes: Provides quick overview of project progress. Use at start of sessions.
|
||||||
|
|
||||||
- **Command Reference: expand**
|
- **Command Reference: expand**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js expand --id=<id> [--num=<number>] [--research] [--prompt="<context>"]`
|
- Legacy Syntax: `node scripts/dev.js expand --id=<id> [--num=<number>] [--research] [--prompt="<context>"]`
|
||||||
- CLI Syntax: `task-master expand --id=<id> [--num=<number>] [--research] [--prompt="<context>"]`
|
- CLI Syntax: `task-master expand --id=<id> [--num=<number>] [--research] [--prompt="<context>"]`
|
||||||
- Description: Expands a task with subtasks for detailed implementation
|
- Description: Expands a task with subtasks for detailed implementation
|
||||||
@@ -151,6 +167,7 @@ alwaysApply: true
|
|||||||
- Notes: Uses complexity report recommendations if available.
|
- Notes: Uses complexity report recommendations if available.
|
||||||
|
|
||||||
- **Command Reference: analyze-complexity**
|
- **Command Reference: analyze-complexity**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js analyze-complexity [options]`
|
- Legacy Syntax: `node scripts/dev.js analyze-complexity [options]`
|
||||||
- CLI Syntax: `task-master analyze-complexity [options]`
|
- CLI Syntax: `task-master analyze-complexity [options]`
|
||||||
- Description: Analyzes task complexity and generates expansion recommendations
|
- Description: Analyzes task complexity and generates expansion recommendations
|
||||||
@@ -164,6 +181,7 @@ alwaysApply: true
|
|||||||
- Notes: Report includes complexity scores, recommended subtasks, and tailored prompts.
|
- Notes: Report includes complexity scores, recommended subtasks, and tailored prompts.
|
||||||
|
|
||||||
- **Command Reference: clear-subtasks**
|
- **Command Reference: clear-subtasks**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js clear-subtasks --id=<id>`
|
- Legacy Syntax: `node scripts/dev.js clear-subtasks --id=<id>`
|
||||||
- CLI Syntax: `task-master clear-subtasks --id=<id>`
|
- CLI Syntax: `task-master clear-subtasks --id=<id>`
|
||||||
- Description: Removes subtasks from specified tasks to allow regeneration
|
- Description: Removes subtasks from specified tasks to allow regeneration
|
||||||
@@ -180,6 +198,7 @@ alwaysApply: true
|
|||||||
- Works with both parent tasks and individual subtasks
|
- Works with both parent tasks and individual subtasks
|
||||||
|
|
||||||
- **Task Structure Fields**
|
- **Task Structure Fields**
|
||||||
|
|
||||||
- **id**: Unique identifier for the task (Example: `1`)
|
- **id**: Unique identifier for the task (Example: `1`)
|
||||||
- **title**: Brief, descriptive title (Example: `"Initialize Repo"`)
|
- **title**: Brief, descriptive title (Example: `"Initialize Repo"`)
|
||||||
- **description**: Concise summary of what the task involves (Example: `"Create a new repository, set up initial structure."`)
|
- **description**: Concise summary of what the task involves (Example: `"Create a new repository, set up initial structure."`)
|
||||||
@@ -193,12 +212,13 @@ alwaysApply: true
|
|||||||
- **subtasks**: List of smaller, more specific tasks (Example: `[{"id": 1, "title": "Configure OAuth", ...}]`)
|
- **subtasks**: List of smaller, more specific tasks (Example: `[{"id": 1, "title": "Configure OAuth", ...}]`)
|
||||||
|
|
||||||
- **Environment Variables Configuration**
|
- **Environment Variables Configuration**
|
||||||
|
|
||||||
- **ANTHROPIC_API_KEY** (Required): Your Anthropic API key for Claude (Example: `ANTHROPIC_API_KEY=sk-ant-api03-...`)
|
- **ANTHROPIC_API_KEY** (Required): Your Anthropic API key for Claude (Example: `ANTHROPIC_API_KEY=sk-ant-api03-...`)
|
||||||
- **MODEL** (Default: `"claude-3-7-sonnet-20250219"`): Claude model to use (Example: `MODEL=claude-3-opus-20240229`)
|
- **MODEL** (Default: `"claude-3-7-sonnet-20250219"`): Claude model to use (Example: `MODEL=claude-3-opus-20240229`)
|
||||||
- **MAX_TOKENS** (Default: `"4000"`): Maximum tokens for responses (Example: `MAX_TOKENS=8000`)
|
- **MAX_TOKENS** (Default: `"4000"`): Maximum tokens for responses (Example: `MAX_TOKENS=8000`)
|
||||||
- **TEMPERATURE** (Default: `"0.7"`): Temperature for model responses (Example: `TEMPERATURE=0.5`)
|
- **TEMPERATURE** (Default: `"0.7"`): Temperature for model responses (Example: `TEMPERATURE=0.5`)
|
||||||
- **DEBUG** (Default: `"false"`): Enable debug logging (Example: `DEBUG=true`)
|
- **DEBUG** (Default: `"false"`): Enable debug logging (Example: `DEBUG=true`)
|
||||||
- **LOG_LEVEL** (Default: `"info"`): Console output level (Example: `LOG_LEVEL=debug`)
|
- **TASKMASTER_LOG_LEVEL** (Default: `"info"`): Console output level (Example: `TASKMASTER_LOG_LEVEL=debug`)
|
||||||
- **DEFAULT_SUBTASKS** (Default: `"3"`): Default subtask count (Example: `DEFAULT_SUBTASKS=5`)
|
- **DEFAULT_SUBTASKS** (Default: `"3"`): Default subtask count (Example: `DEFAULT_SUBTASKS=5`)
|
||||||
- **DEFAULT_PRIORITY** (Default: `"medium"`): Default priority (Example: `DEFAULT_PRIORITY=high`)
|
- **DEFAULT_PRIORITY** (Default: `"medium"`): Default priority (Example: `DEFAULT_PRIORITY=high`)
|
||||||
- **PROJECT_NAME** (Default: `"MCP SaaS MVP"`): Project name in metadata (Example: `PROJECT_NAME=My Awesome Project`)
|
- **PROJECT_NAME** (Default: `"MCP SaaS MVP"`): Project name in metadata (Example: `PROJECT_NAME=My Awesome Project`)
|
||||||
@@ -207,6 +227,7 @@ alwaysApply: true
|
|||||||
- **PERPLEXITY_MODEL** (Default: `"sonar-medium-online"`): Perplexity model (Example: `PERPLEXITY_MODEL=sonar-large-online`)
|
- **PERPLEXITY_MODEL** (Default: `"sonar-medium-online"`): Perplexity model (Example: `PERPLEXITY_MODEL=sonar-large-online`)
|
||||||
|
|
||||||
- **Determining the Next Task**
|
- **Determining the Next Task**
|
||||||
|
|
||||||
- Run `task-master next` to show the next task to work on
|
- Run `task-master next` to show the next task to work on
|
||||||
- The next command identifies tasks with all dependencies satisfied
|
- The next command identifies tasks with all dependencies satisfied
|
||||||
- Tasks are prioritized by priority level, dependency count, and ID
|
- Tasks are prioritized by priority level, dependency count, and ID
|
||||||
@@ -221,6 +242,7 @@ alwaysApply: true
|
|||||||
- Provides ready-to-use commands for common task actions
|
- Provides ready-to-use commands for common task actions
|
||||||
|
|
||||||
- **Viewing Specific Task Details**
|
- **Viewing Specific Task Details**
|
||||||
|
|
||||||
- Run `task-master show <id>` or `task-master show --id=<id>` to view a specific task
|
- Run `task-master show <id>` or `task-master show --id=<id>` to view a specific task
|
||||||
- Use dot notation for subtasks: `task-master show 1.2` (shows subtask 2 of task 1)
|
- Use dot notation for subtasks: `task-master show 1.2` (shows subtask 2 of task 1)
|
||||||
- Displays comprehensive information similar to the next command, but for a specific task
|
- Displays comprehensive information similar to the next command, but for a specific task
|
||||||
@@ -230,6 +252,7 @@ alwaysApply: true
|
|||||||
- Useful for examining task details before implementation or checking status
|
- Useful for examining task details before implementation or checking status
|
||||||
|
|
||||||
- **Managing Task Dependencies**
|
- **Managing Task Dependencies**
|
||||||
|
|
||||||
- Use `task-master add-dependency --id=<id> --depends-on=<id>` to add a dependency
|
- Use `task-master add-dependency --id=<id> --depends-on=<id>` to add a dependency
|
||||||
- Use `task-master remove-dependency --id=<id> --depends-on=<id>` to remove a dependency
|
- Use `task-master remove-dependency --id=<id> --depends-on=<id>` to remove a dependency
|
||||||
- The system prevents circular dependencies and duplicate dependency entries
|
- The system prevents circular dependencies and duplicate dependency entries
|
||||||
@@ -238,6 +261,7 @@ alwaysApply: true
|
|||||||
- Dependencies are visualized with status indicators in task listings and files
|
- Dependencies are visualized with status indicators in task listings and files
|
||||||
|
|
||||||
- **Command Reference: add-dependency**
|
- **Command Reference: add-dependency**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js add-dependency --id=<id> --depends-on=<id>`
|
- Legacy Syntax: `node scripts/dev.js add-dependency --id=<id> --depends-on=<id>`
|
||||||
- CLI Syntax: `task-master add-dependency --id=<id> --depends-on=<id>`
|
- CLI Syntax: `task-master add-dependency --id=<id> --depends-on=<id>`
|
||||||
- Description: Adds a dependency relationship between two tasks
|
- Description: Adds a dependency relationship between two tasks
|
||||||
@@ -248,6 +272,7 @@ alwaysApply: true
|
|||||||
- Notes: Prevents circular dependencies and duplicates; updates task files automatically
|
- Notes: Prevents circular dependencies and duplicates; updates task files automatically
|
||||||
|
|
||||||
- **Command Reference: remove-dependency**
|
- **Command Reference: remove-dependency**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js remove-dependency --id=<id> --depends-on=<id>`
|
- Legacy Syntax: `node scripts/dev.js remove-dependency --id=<id> --depends-on=<id>`
|
||||||
- CLI Syntax: `task-master remove-dependency --id=<id> --depends-on=<id>`
|
- CLI Syntax: `task-master remove-dependency --id=<id> --depends-on=<id>`
|
||||||
- Description: Removes a dependency relationship between two tasks
|
- Description: Removes a dependency relationship between two tasks
|
||||||
@@ -258,6 +283,7 @@ alwaysApply: true
|
|||||||
- Notes: Checks if dependency actually exists; updates task files automatically
|
- Notes: Checks if dependency actually exists; updates task files automatically
|
||||||
|
|
||||||
- **Command Reference: validate-dependencies**
|
- **Command Reference: validate-dependencies**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js validate-dependencies [options]`
|
- Legacy Syntax: `node scripts/dev.js validate-dependencies [options]`
|
||||||
- CLI Syntax: `task-master validate-dependencies [options]`
|
- CLI Syntax: `task-master validate-dependencies [options]`
|
||||||
- Description: Checks for and identifies invalid dependencies in tasks.json and task files
|
- Description: Checks for and identifies invalid dependencies in tasks.json and task files
|
||||||
@@ -270,6 +296,7 @@ alwaysApply: true
|
|||||||
- Use before fix-dependencies to audit your task structure
|
- Use before fix-dependencies to audit your task structure
|
||||||
|
|
||||||
- **Command Reference: fix-dependencies**
|
- **Command Reference: fix-dependencies**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js fix-dependencies [options]`
|
- Legacy Syntax: `node scripts/dev.js fix-dependencies [options]`
|
||||||
- CLI Syntax: `task-master fix-dependencies [options]`
|
- CLI Syntax: `task-master fix-dependencies [options]`
|
||||||
- Description: Finds and fixes all invalid dependencies in tasks.json and task files
|
- Description: Finds and fixes all invalid dependencies in tasks.json and task files
|
||||||
@@ -283,6 +310,7 @@ alwaysApply: true
|
|||||||
- Provides detailed report of all fixes made
|
- Provides detailed report of all fixes made
|
||||||
|
|
||||||
- **Command Reference: complexity-report**
|
- **Command Reference: complexity-report**
|
||||||
|
|
||||||
- Legacy Syntax: `node scripts/dev.js complexity-report [options]`
|
- Legacy Syntax: `node scripts/dev.js complexity-report [options]`
|
||||||
- CLI Syntax: `task-master complexity-report [options]`
|
- CLI Syntax: `task-master complexity-report [options]`
|
||||||
- Description: Displays the task complexity analysis report in a formatted, easy-to-read way
|
- Description: Displays the task complexity analysis report in a formatted, easy-to-read way
|
||||||
@@ -296,6 +324,7 @@ alwaysApply: true
|
|||||||
- If no report exists, offers to generate one interactively
|
- If no report exists, offers to generate one interactively
|
||||||
|
|
||||||
- **Command Reference: add-task**
|
- **Command Reference: add-task**
|
||||||
|
|
||||||
- CLI Syntax: `task-master add-task [options]`
|
- CLI Syntax: `task-master add-task [options]`
|
||||||
- Description: Add a new task to tasks.json using AI
|
- Description: Add a new task to tasks.json using AI
|
||||||
- Parameters:
|
- Parameters:
|
||||||
@@ -307,6 +336,7 @@ alwaysApply: true
|
|||||||
- Notes: Uses AI to convert description into structured task with appropriate details
|
- Notes: Uses AI to convert description into structured task with appropriate details
|
||||||
|
|
||||||
- **Command Reference: init**
|
- **Command Reference: init**
|
||||||
|
|
||||||
- CLI Syntax: `task-master init`
|
- CLI Syntax: `task-master init`
|
||||||
- Description: Initialize a new project with Task Master structure
|
- Description: Initialize a new project with Task Master structure
|
||||||
- Parameters: None
|
- Parameters: None
|
||||||
@@ -341,15 +371,20 @@ alwaysApply: true
|
|||||||
- Check for any unintentional duplications or omissions
|
- Check for any unintentional duplications or omissions
|
||||||
|
|
||||||
---
|
---
|
||||||
WINDSURF_RULES
|
|
||||||
---
|
## WINDSURF_RULES
|
||||||
|
|
||||||
description: Guidelines for creating and maintaining Windsurf rules to ensure consistency and effectiveness.
|
description: Guidelines for creating and maintaining Windsurf rules to ensure consistency and effectiveness.
|
||||||
globs: .windsurfrules
|
globs: .windsurfrules
|
||||||
filesToApplyRule: .windsurfrules
|
filesToApplyRule: .windsurfrules
|
||||||
alwaysApply: true
|
alwaysApply: true
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
The below describes how you should be structuring new rule sections in this document.
|
The below describes how you should be structuring new rule sections in this document.
|
||||||
|
|
||||||
- **Required Rule Structure:**
|
- **Required Rule Structure:**
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
---
|
---
|
||||||
description: Clear, one-line description of what the rule enforces
|
description: Clear, one-line description of what the rule enforces
|
||||||
@@ -363,11 +398,14 @@ The below describes how you should be structuring new rule sections in this docu
|
|||||||
```
|
```
|
||||||
|
|
||||||
- **Section References:**
|
- **Section References:**
|
||||||
|
|
||||||
- Use `ALL_CAPS_SECTION` to reference files
|
- Use `ALL_CAPS_SECTION` to reference files
|
||||||
- Example: `WINDSURF_RULES`
|
- Example: `WINDSURF_RULES`
|
||||||
|
|
||||||
- **Code Examples:**
|
- **Code Examples:**
|
||||||
|
|
||||||
- Use language-specific code blocks
|
- Use language-specific code blocks
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// ✅ DO: Show good examples
|
// ✅ DO: Show good examples
|
||||||
const goodExample = true;
|
const goodExample = true;
|
||||||
@@ -377,6 +415,7 @@ The below describes how you should be structuring new rule sections in this docu
|
|||||||
```
|
```
|
||||||
|
|
||||||
- **Rule Content Guidelines:**
|
- **Rule Content Guidelines:**
|
||||||
|
|
||||||
- Start with high-level overview
|
- Start with high-level overview
|
||||||
- Include specific, actionable requirements
|
- Include specific, actionable requirements
|
||||||
- Show examples of correct implementation
|
- Show examples of correct implementation
|
||||||
@@ -384,6 +423,7 @@ The below describes how you should be structuring new rule sections in this docu
|
|||||||
- Keep rules DRY by referencing other rules
|
- Keep rules DRY by referencing other rules
|
||||||
|
|
||||||
- **Rule Maintenance:**
|
- **Rule Maintenance:**
|
||||||
|
|
||||||
- Update rules when new patterns emerge
|
- Update rules when new patterns emerge
|
||||||
- Add examples from actual codebase
|
- Add examples from actual codebase
|
||||||
- Remove outdated patterns
|
- Remove outdated patterns
|
||||||
@@ -397,15 +437,18 @@ The below describes how you should be structuring new rule sections in this docu
|
|||||||
- Use consistent formatting across rules
|
- Use consistent formatting across rules
|
||||||
|
|
||||||
---
|
---
|
||||||
SELF_IMPROVE
|
|
||||||
---
|
## SELF_IMPROVE
|
||||||
|
|
||||||
description: Guidelines for continuously improving this rules document based on emerging code patterns and best practices.
|
description: Guidelines for continuously improving this rules document based on emerging code patterns and best practices.
|
||||||
globs: **/*
|
globs: **/\*
|
||||||
filesToApplyRule: **/*
|
filesToApplyRule: **/\*
|
||||||
alwaysApply: true
|
alwaysApply: true
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **Rule Improvement Triggers:**
|
- **Rule Improvement Triggers:**
|
||||||
|
|
||||||
- New code patterns not covered by existing rules
|
- New code patterns not covered by existing rules
|
||||||
- Repeated similar implementations across files
|
- Repeated similar implementations across files
|
||||||
- Common error patterns that could be prevented
|
- Common error patterns that could be prevented
|
||||||
@@ -413,6 +456,7 @@ alwaysApply: true
|
|||||||
- Emerging best practices in the codebase
|
- Emerging best practices in the codebase
|
||||||
|
|
||||||
- **Analysis Process:**
|
- **Analysis Process:**
|
||||||
|
|
||||||
- Compare new code with existing rules
|
- Compare new code with existing rules
|
||||||
- Identify patterns that should be standardized
|
- Identify patterns that should be standardized
|
||||||
- Look for references to external documentation
|
- Look for references to external documentation
|
||||||
@@ -420,7 +464,9 @@ alwaysApply: true
|
|||||||
- Monitor test patterns and coverage
|
- Monitor test patterns and coverage
|
||||||
|
|
||||||
- **Rule Updates:**
|
- **Rule Updates:**
|
||||||
|
|
||||||
- **Add New Rules When:**
|
- **Add New Rules When:**
|
||||||
|
|
||||||
- A new technology/pattern is used in 3+ files
|
- A new technology/pattern is used in 3+ files
|
||||||
- Common bugs could be prevented by a rule
|
- Common bugs could be prevented by a rule
|
||||||
- Code reviews repeatedly mention the same feedback
|
- Code reviews repeatedly mention the same feedback
|
||||||
@@ -433,11 +479,12 @@ alwaysApply: true
|
|||||||
- Implementation details have changed
|
- Implementation details have changed
|
||||||
|
|
||||||
- **Example Pattern Recognition:**
|
- **Example Pattern Recognition:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// If you see repeated patterns like:
|
// If you see repeated patterns like:
|
||||||
const data = await prisma.user.findMany({
|
const data = await prisma.user.findMany({
|
||||||
select: { id: true, email: true },
|
select: { id: true, email: true },
|
||||||
where: { status: 'ACTIVE' }
|
where: { status: "ACTIVE" },
|
||||||
});
|
});
|
||||||
|
|
||||||
// Consider adding a PRISMA section in the .windsurfrules:
|
// Consider adding a PRISMA section in the .windsurfrules:
|
||||||
@@ -447,12 +494,14 @@ alwaysApply: true
|
|||||||
```
|
```
|
||||||
|
|
||||||
- **Rule Quality Checks:**
|
- **Rule Quality Checks:**
|
||||||
|
|
||||||
- Rules should be actionable and specific
|
- Rules should be actionable and specific
|
||||||
- Examples should come from actual code
|
- Examples should come from actual code
|
||||||
- References should be up to date
|
- References should be up to date
|
||||||
- Patterns should be consistently enforced
|
- Patterns should be consistently enforced
|
||||||
|
|
||||||
- **Continuous Improvement:**
|
- **Continuous Improvement:**
|
||||||
|
|
||||||
- Monitor code review comments
|
- Monitor code review comments
|
||||||
- Track common development questions
|
- Track common development questions
|
||||||
- Update rules after major refactors
|
- Update rules after major refactors
|
||||||
@@ -460,6 +509,7 @@ alwaysApply: true
|
|||||||
- Cross-reference related rules
|
- Cross-reference related rules
|
||||||
|
|
||||||
- **Rule Deprecation:**
|
- **Rule Deprecation:**
|
||||||
|
|
||||||
- Mark outdated patterns as deprecated
|
- Mark outdated patterns as deprecated
|
||||||
- Remove rules that no longer apply
|
- Remove rules that no longer apply
|
||||||
- Update references to deprecated rules
|
- Update references to deprecated rules
|
||||||
|
|||||||
417
assets/AGENTS.md
Normal file
417
assets/AGENTS.md
Normal file
@@ -0,0 +1,417 @@
|
|||||||
|
# Task Master AI - Claude Code Integration Guide
|
||||||
|
|
||||||
|
## Essential Commands
|
||||||
|
|
||||||
|
### Core Workflow Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Project Setup
|
||||||
|
task-master init # Initialize Task Master in current project
|
||||||
|
task-master parse-prd .taskmaster/docs/prd.txt # Generate tasks from PRD document
|
||||||
|
task-master models --setup # Configure AI models interactively
|
||||||
|
|
||||||
|
# Daily Development Workflow
|
||||||
|
task-master list # Show all tasks with status
|
||||||
|
task-master next # Get next available task to work on
|
||||||
|
task-master show <id> # View detailed task information (e.g., task-master show 1.2)
|
||||||
|
task-master set-status --id=<id> --status=done # Mark task complete
|
||||||
|
|
||||||
|
# Task Management
|
||||||
|
task-master add-task --prompt="description" --research # Add new task with AI assistance
|
||||||
|
task-master expand --id=<id> --research --force # Break task into subtasks
|
||||||
|
task-master update-task --id=<id> --prompt="changes" # Update specific task
|
||||||
|
task-master update --from=<id> --prompt="changes" # Update multiple tasks from ID onwards
|
||||||
|
task-master update-subtask --id=<id> --prompt="notes" # Add implementation notes to subtask
|
||||||
|
|
||||||
|
# Analysis & Planning
|
||||||
|
task-master analyze-complexity --research # Analyze task complexity
|
||||||
|
task-master complexity-report # View complexity analysis
|
||||||
|
task-master expand --all --research # Expand all eligible tasks
|
||||||
|
|
||||||
|
# Dependencies & Organization
|
||||||
|
task-master add-dependency --id=<id> --depends-on=<id> # Add task dependency
|
||||||
|
task-master move --from=<id> --to=<id> # Reorganize task hierarchy
|
||||||
|
task-master validate-dependencies # Check for dependency issues
|
||||||
|
task-master generate # Update task markdown files (usually auto-called)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Key Files & Project Structure
|
||||||
|
|
||||||
|
### Core Files
|
||||||
|
|
||||||
|
- `.taskmaster/tasks/tasks.json` - Main task data file (auto-managed)
|
||||||
|
- `.taskmaster/config.json` - AI model configuration (use `task-master models` to modify)
|
||||||
|
- `.taskmaster/docs/prd.txt` - Product Requirements Document for parsing
|
||||||
|
- `.taskmaster/tasks/*.txt` - Individual task files (auto-generated from tasks.json)
|
||||||
|
- `.env` - API keys for CLI usage
|
||||||
|
|
||||||
|
### Claude Code Integration Files
|
||||||
|
|
||||||
|
- `CLAUDE.md` - Auto-loaded context for Claude Code (this file)
|
||||||
|
- `.claude/settings.json` - Claude Code tool allowlist and preferences
|
||||||
|
- `.claude/commands/` - Custom slash commands for repeated workflows
|
||||||
|
- `.mcp.json` - MCP server configuration (project-specific)
|
||||||
|
|
||||||
|
### Directory Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
project/
|
||||||
|
├── .taskmaster/
|
||||||
|
│ ├── tasks/ # Task files directory
|
||||||
|
│ │ ├── tasks.json # Main task database
|
||||||
|
│ │ ├── task-1.md # Individual task files
|
||||||
|
│ │ └── task-2.md
|
||||||
|
│ ├── docs/ # Documentation directory
|
||||||
|
│ │ ├── prd.txt # Product requirements
|
||||||
|
│ ├── reports/ # Analysis reports directory
|
||||||
|
│ │ └── task-complexity-report.json
|
||||||
|
│ ├── templates/ # Template files
|
||||||
|
│ │ └── example_prd.txt # Example PRD template
|
||||||
|
│ └── config.json # AI models & settings
|
||||||
|
├── .claude/
|
||||||
|
│ ├── settings.json # Claude Code configuration
|
||||||
|
│ └── commands/ # Custom slash commands
|
||||||
|
├── .env # API keys
|
||||||
|
├── .mcp.json # MCP configuration
|
||||||
|
└── CLAUDE.md # This file - auto-loaded by Claude Code
|
||||||
|
```
|
||||||
|
|
||||||
|
## MCP Integration
|
||||||
|
|
||||||
|
Task Master provides an MCP server that Claude Code can connect to. Configure in `.mcp.json`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"task-master-ai": {
|
||||||
|
"command": "npx",
|
||||||
|
"args": ["-y", "--package=task-master-ai", "task-master-ai"],
|
||||||
|
"env": {
|
||||||
|
"ANTHROPIC_API_KEY": "your_key_here",
|
||||||
|
"PERPLEXITY_API_KEY": "your_key_here",
|
||||||
|
"OPENAI_API_KEY": "OPENAI_API_KEY_HERE",
|
||||||
|
"GOOGLE_API_KEY": "GOOGLE_API_KEY_HERE",
|
||||||
|
"XAI_API_KEY": "XAI_API_KEY_HERE",
|
||||||
|
"OPENROUTER_API_KEY": "OPENROUTER_API_KEY_HERE",
|
||||||
|
"MISTRAL_API_KEY": "MISTRAL_API_KEY_HERE",
|
||||||
|
"AZURE_OPENAI_API_KEY": "AZURE_OPENAI_API_KEY_HERE",
|
||||||
|
"OLLAMA_API_KEY": "OLLAMA_API_KEY_HERE"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Essential MCP Tools
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
help; // = shows available taskmaster commands
|
||||||
|
// Project setup
|
||||||
|
initialize_project; // = task-master init
|
||||||
|
parse_prd; // = task-master parse-prd
|
||||||
|
|
||||||
|
// Daily workflow
|
||||||
|
get_tasks; // = task-master list
|
||||||
|
next_task; // = task-master next
|
||||||
|
get_task; // = task-master show <id>
|
||||||
|
set_task_status; // = task-master set-status
|
||||||
|
|
||||||
|
// Task management
|
||||||
|
add_task; // = task-master add-task
|
||||||
|
expand_task; // = task-master expand
|
||||||
|
update_task; // = task-master update-task
|
||||||
|
update_subtask; // = task-master update-subtask
|
||||||
|
update; // = task-master update
|
||||||
|
|
||||||
|
// Analysis
|
||||||
|
analyze_project_complexity; // = task-master analyze-complexity
|
||||||
|
complexity_report; // = task-master complexity-report
|
||||||
|
```
|
||||||
|
|
||||||
|
## Claude Code Workflow Integration
|
||||||
|
|
||||||
|
### Standard Development Workflow
|
||||||
|
|
||||||
|
#### 1. Project Initialization
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Initialize Task Master
|
||||||
|
task-master init
|
||||||
|
|
||||||
|
# Create or obtain PRD, then parse it
|
||||||
|
task-master parse-prd .taskmaster/docs/prd.txt
|
||||||
|
|
||||||
|
# Analyze complexity and expand tasks
|
||||||
|
task-master analyze-complexity --research
|
||||||
|
task-master expand --all --research
|
||||||
|
```
|
||||||
|
|
||||||
|
If tasks already exist, another PRD can be parsed (with new information only!) using parse-prd with --append flag. This will add the generated tasks to the existing list of tasks..
|
||||||
|
|
||||||
|
#### 2. Daily Development Loop
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Start each session
|
||||||
|
task-master next # Find next available task
|
||||||
|
task-master show <id> # Review task details
|
||||||
|
|
||||||
|
# During implementation, check in code context into the tasks and subtasks
|
||||||
|
task-master update-subtask --id=<id> --prompt="implementation notes..."
|
||||||
|
|
||||||
|
# Complete tasks
|
||||||
|
task-master set-status --id=<id> --status=done
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 3. Multi-Claude Workflows
|
||||||
|
|
||||||
|
For complex projects, use multiple Claude Code sessions:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Terminal 1: Main implementation
|
||||||
|
cd project && claude
|
||||||
|
|
||||||
|
# Terminal 2: Testing and validation
|
||||||
|
cd project-test-worktree && claude
|
||||||
|
|
||||||
|
# Terminal 3: Documentation updates
|
||||||
|
cd project-docs-worktree && claude
|
||||||
|
```
|
||||||
|
|
||||||
|
### Custom Slash Commands
|
||||||
|
|
||||||
|
Create `.claude/commands/taskmaster-next.md`:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
Find the next available Task Master task and show its details.
|
||||||
|
|
||||||
|
Steps:
|
||||||
|
|
||||||
|
1. Run `task-master next` to get the next task
|
||||||
|
2. If a task is available, run `task-master show <id>` for full details
|
||||||
|
3. Provide a summary of what needs to be implemented
|
||||||
|
4. Suggest the first implementation step
|
||||||
|
```
|
||||||
|
|
||||||
|
Create `.claude/commands/taskmaster-complete.md`:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
Complete a Task Master task: $ARGUMENTS
|
||||||
|
|
||||||
|
Steps:
|
||||||
|
|
||||||
|
1. Review the current task with `task-master show $ARGUMENTS`
|
||||||
|
2. Verify all implementation is complete
|
||||||
|
3. Run any tests related to this task
|
||||||
|
4. Mark as complete: `task-master set-status --id=$ARGUMENTS --status=done`
|
||||||
|
5. Show the next available task with `task-master next`
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tool Allowlist Recommendations
|
||||||
|
|
||||||
|
Add to `.claude/settings.json`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"allowedTools": [
|
||||||
|
"Edit",
|
||||||
|
"Bash(task-master *)",
|
||||||
|
"Bash(git commit:*)",
|
||||||
|
"Bash(git add:*)",
|
||||||
|
"Bash(npm run *)",
|
||||||
|
"mcp__task_master_ai__*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration & Setup
|
||||||
|
|
||||||
|
### API Keys Required
|
||||||
|
|
||||||
|
At least **one** of these API keys must be configured:
|
||||||
|
|
||||||
|
- `ANTHROPIC_API_KEY` (Claude models) - **Recommended**
|
||||||
|
- `PERPLEXITY_API_KEY` (Research features) - **Highly recommended**
|
||||||
|
- `OPENAI_API_KEY` (GPT models)
|
||||||
|
- `GOOGLE_API_KEY` (Gemini models)
|
||||||
|
- `MISTRAL_API_KEY` (Mistral models)
|
||||||
|
- `OPENROUTER_API_KEY` (Multiple models)
|
||||||
|
- `XAI_API_KEY` (Grok models)
|
||||||
|
|
||||||
|
An API key is required for any provider used across any of the 3 roles defined in the `models` command.
|
||||||
|
|
||||||
|
### Model Configuration
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Interactive setup (recommended)
|
||||||
|
task-master models --setup
|
||||||
|
|
||||||
|
# Set specific models
|
||||||
|
task-master models --set-main claude-3-5-sonnet-20241022
|
||||||
|
task-master models --set-research perplexity-llama-3.1-sonar-large-128k-online
|
||||||
|
task-master models --set-fallback gpt-4o-mini
|
||||||
|
```
|
||||||
|
|
||||||
|
## Task Structure & IDs
|
||||||
|
|
||||||
|
### Task ID Format
|
||||||
|
|
||||||
|
- Main tasks: `1`, `2`, `3`, etc.
|
||||||
|
- Subtasks: `1.1`, `1.2`, `2.1`, etc.
|
||||||
|
- Sub-subtasks: `1.1.1`, `1.1.2`, etc.
|
||||||
|
|
||||||
|
### Task Status Values
|
||||||
|
|
||||||
|
- `pending` - Ready to work on
|
||||||
|
- `in-progress` - Currently being worked on
|
||||||
|
- `done` - Completed and verified
|
||||||
|
- `deferred` - Postponed
|
||||||
|
- `cancelled` - No longer needed
|
||||||
|
- `blocked` - Waiting on external factors
|
||||||
|
|
||||||
|
### Task Fields
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": "1.2",
|
||||||
|
"title": "Implement user authentication",
|
||||||
|
"description": "Set up JWT-based auth system",
|
||||||
|
"status": "pending",
|
||||||
|
"priority": "high",
|
||||||
|
"dependencies": ["1.1"],
|
||||||
|
"details": "Use bcrypt for hashing, JWT for tokens...",
|
||||||
|
"testStrategy": "Unit tests for auth functions, integration tests for login flow",
|
||||||
|
"subtasks": []
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Claude Code Best Practices with Task Master
|
||||||
|
|
||||||
|
### Context Management
|
||||||
|
|
||||||
|
- Use `/clear` between different tasks to maintain focus
|
||||||
|
- This CLAUDE.md file is automatically loaded for context
|
||||||
|
- Use `task-master show <id>` to pull specific task context when needed
|
||||||
|
|
||||||
|
### Iterative Implementation
|
||||||
|
|
||||||
|
1. `task-master show <subtask-id>` - Understand requirements
|
||||||
|
2. Explore codebase and plan implementation
|
||||||
|
3. `task-master update-subtask --id=<id> --prompt="detailed plan"` - Log plan
|
||||||
|
4. `task-master set-status --id=<id> --status=in-progress` - Start work
|
||||||
|
5. Implement code following logged plan
|
||||||
|
6. `task-master update-subtask --id=<id> --prompt="what worked/didn't work"` - Log progress
|
||||||
|
7. `task-master set-status --id=<id> --status=done` - Complete task
|
||||||
|
|
||||||
|
### Complex Workflows with Checklists
|
||||||
|
|
||||||
|
For large migrations or multi-step processes:
|
||||||
|
|
||||||
|
1. Create a markdown PRD file describing the new changes: `touch task-migration-checklist.md` (prds can be .txt or .md)
|
||||||
|
2. Use Taskmaster to parse the new prd with `task-master parse-prd --append` (also available in MCP)
|
||||||
|
3. Use Taskmaster to expand the newly generated tasks into subtasks. Consdier using `analyze-complexity` with the correct --to and --from IDs (the new ids) to identify the ideal subtask amounts for each task. Then expand them.
|
||||||
|
4. Work through items systematically, checking them off as completed
|
||||||
|
5. Use `task-master update-subtask` to log progress on each task/subtask and/or updating/researching them before/during implementation if getting stuck
|
||||||
|
|
||||||
|
### Git Integration
|
||||||
|
|
||||||
|
Task Master works well with `gh` CLI:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Create PR for completed task
|
||||||
|
gh pr create --title "Complete task 1.2: User authentication" --body "Implements JWT auth system as specified in task 1.2"
|
||||||
|
|
||||||
|
# Reference task in commits
|
||||||
|
git commit -m "feat: implement JWT auth (task 1.2)"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parallel Development with Git Worktrees
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Create worktrees for parallel task development
|
||||||
|
git worktree add ../project-auth feature/auth-system
|
||||||
|
git worktree add ../project-api feature/api-refactor
|
||||||
|
|
||||||
|
# Run Claude Code in each worktree
|
||||||
|
cd ../project-auth && claude # Terminal 1: Auth work
|
||||||
|
cd ../project-api && claude # Terminal 2: API work
|
||||||
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### AI Commands Failing
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check API keys are configured
|
||||||
|
cat .env # For CLI usage
|
||||||
|
|
||||||
|
# Verify model configuration
|
||||||
|
task-master models
|
||||||
|
|
||||||
|
# Test with different model
|
||||||
|
task-master models --set-fallback gpt-4o-mini
|
||||||
|
```
|
||||||
|
|
||||||
|
### MCP Connection Issues
|
||||||
|
|
||||||
|
- Check `.mcp.json` configuration
|
||||||
|
- Verify Node.js installation
|
||||||
|
- Use `--mcp-debug` flag when starting Claude Code
|
||||||
|
- Use CLI as fallback if MCP unavailable
|
||||||
|
|
||||||
|
### Task File Sync Issues
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Regenerate task files from tasks.json
|
||||||
|
task-master generate
|
||||||
|
|
||||||
|
# Fix dependency issues
|
||||||
|
task-master fix-dependencies
|
||||||
|
```
|
||||||
|
|
||||||
|
DO NOT RE-INITIALIZE. That will not do anything beyond re-adding the same Taskmaster core files.
|
||||||
|
|
||||||
|
## Important Notes
|
||||||
|
|
||||||
|
### AI-Powered Operations
|
||||||
|
|
||||||
|
These commands make AI calls and may take up to a minute:
|
||||||
|
|
||||||
|
- `parse_prd` / `task-master parse-prd`
|
||||||
|
- `analyze_project_complexity` / `task-master analyze-complexity`
|
||||||
|
- `expand_task` / `task-master expand`
|
||||||
|
- `expand_all` / `task-master expand --all`
|
||||||
|
- `add_task` / `task-master add-task`
|
||||||
|
- `update` / `task-master update`
|
||||||
|
- `update_task` / `task-master update-task`
|
||||||
|
- `update_subtask` / `task-master update-subtask`
|
||||||
|
|
||||||
|
### File Management
|
||||||
|
|
||||||
|
- Never manually edit `tasks.json` - use commands instead
|
||||||
|
- Never manually edit `.taskmaster/config.json` - use `task-master models`
|
||||||
|
- Task markdown files in `tasks/` are auto-generated
|
||||||
|
- Run `task-master generate` after manual changes to tasks.json
|
||||||
|
|
||||||
|
### Claude Code Session Management
|
||||||
|
|
||||||
|
- Use `/clear` frequently to maintain focused context
|
||||||
|
- Create custom slash commands for repeated Task Master workflows
|
||||||
|
- Configure tool allowlist to streamline permissions
|
||||||
|
- Use headless mode for automation: `claude -p "task-master next"`
|
||||||
|
|
||||||
|
### Multi-Task Updates
|
||||||
|
|
||||||
|
- Use `update --from=<id>` to update multiple future tasks
|
||||||
|
- Use `update-task --id=<id>` for single task updates
|
||||||
|
- Use `update-subtask --id=<id>` for implementation logging
|
||||||
|
|
||||||
|
### Research Mode
|
||||||
|
|
||||||
|
- Add `--research` flag for research-based AI enhancement
|
||||||
|
- Requires a research model API key like Perplexity (`PERPLEXITY_API_KEY`) in environment
|
||||||
|
- Provides more informed task creation and updates
|
||||||
|
- Recommended for complex technical tasks
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_This guide ensures Claude Code has immediate access to Task Master's essential functionality for agentic development workflows._
|
||||||
33
assets/config.json
Normal file
33
assets/config.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"models": {
|
||||||
|
"main": {
|
||||||
|
"provider": "anthropic",
|
||||||
|
"modelId": "claude-3-7-sonnet-20250219",
|
||||||
|
"maxTokens": 120000,
|
||||||
|
"temperature": 0.2
|
||||||
|
},
|
||||||
|
"research": {
|
||||||
|
"provider": "perplexity",
|
||||||
|
"modelId": "sonar-pro",
|
||||||
|
"maxTokens": 8700,
|
||||||
|
"temperature": 0.1
|
||||||
|
},
|
||||||
|
"fallback": {
|
||||||
|
"provider": "anthropic",
|
||||||
|
"modelId": "claude-3-5-sonnet-20240620",
|
||||||
|
"maxTokens": 8192,
|
||||||
|
"temperature": 0.1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"global": {
|
||||||
|
"logLevel": "info",
|
||||||
|
"debug": false,
|
||||||
|
"defaultSubtasks": 5,
|
||||||
|
"defaultPriority": "medium",
|
||||||
|
"projectName": "Taskmaster",
|
||||||
|
"defaultTag": "master",
|
||||||
|
"ollamaBaseURL": "http://localhost:11434/api",
|
||||||
|
"azureOpenaiBaseURL": "https://your-endpoint.openai.azure.com/",
|
||||||
|
"bedrockBaseURL": "https://bedrock.us-east-1.amazonaws.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,10 @@
|
|||||||
# Required
|
# API Keys (Required to enable respective provider)
|
||||||
ANTHROPIC_API_KEY=your-api-key-here # For most AI ops -- Format: sk-ant-api03-... (Required)
|
ANTHROPIC_API_KEY="your_anthropic_api_key_here" # Required: Format: sk-ant-api03-...
|
||||||
PERPLEXITY_API_KEY=pplx-abcde # For research -- Format: pplx-abcde (Optional, Highly Recommended)
|
PERPLEXITY_API_KEY="your_perplexity_api_key_here" # Optional: Format: pplx-...
|
||||||
|
OPENAI_API_KEY="your_openai_api_key_here" # Optional, for OpenAI/OpenRouter models. Format: sk-proj-...
|
||||||
# Optional - defaults shown
|
GOOGLE_API_KEY="your_google_api_key_here" # Optional, for Google Gemini models.
|
||||||
MODEL=claude-3-7-sonnet-20250219 # Recommended models: claude-3-7-sonnet-20250219, claude-3-opus-20240229 (Required)
|
MISTRAL_API_KEY="your_mistral_key_here" # Optional, for Mistral AI models.
|
||||||
PERPLEXITY_MODEL=sonar-pro # Make sure you have access to sonar-pro otherwise you can use sonar regular (Optional)
|
XAI_API_KEY="YOUR_XAI_KEY_HERE" # Optional, for xAI AI models.
|
||||||
MAX_TOKENS=64000 # Maximum tokens for model responses (Required)
|
AZURE_OPENAI_API_KEY="your_azure_key_here" # Optional, for Azure OpenAI models (requires endpoint in .taskmaster/config.json).
|
||||||
TEMPERATURE=0.2 # Temperature for model responses (0.0-1.0) - lower = less creativity and follow your prompt closely (Required)
|
OLLAMA_API_KEY="your_ollama_api_key_here" # Optional: For remote Ollama servers that require authentication.
|
||||||
DEBUG=false # Enable debug logging (true/false)
|
GITHUB_API_KEY="your_github_api_key_here" # Optional: For GitHub import/export features. Format: ghp_... or github_pat_...
|
||||||
LOG_LEVEL=info # Log level (debug, info, warn, error)
|
|
||||||
DEFAULT_SUBTASKS=5 # Default number of subtasks when expanding
|
|
||||||
DEFAULT_PRIORITY=medium # Default priority for generated tasks (high, medium, low)
|
|
||||||
PROJECT_NAME={{projectName}} # Project name for tasks.json metadata
|
|
||||||
@@ -23,7 +23,3 @@ node_modules/
|
|||||||
|
|
||||||
# OS specific
|
# OS specific
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# Task files
|
|
||||||
tasks.json
|
|
||||||
tasks/
|
|
||||||
93
assets/roocode/.roo/rules-architect/architect-rules
Normal file
93
assets/roocode/.roo/rules-architect/architect-rules
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
**Core Directives & Agentivity:**
|
||||||
|
# 1. Adhere strictly to the rules defined below.
|
||||||
|
# 2. Use tools sequentially, one per message. Adhere strictly to the rules defined below.
|
||||||
|
# 3. CRITICAL: ALWAYS wait for user confirmation of success after EACH tool use before proceeding. Do not assume success.
|
||||||
|
# 4. Operate iteratively: Analyze task -> Plan steps -> Execute steps one by one.
|
||||||
|
# 5. Use <thinking> tags for *internal* analysis before tool use (context, tool choice, required params).
|
||||||
|
# 6. **DO NOT DISPLAY XML TOOL TAGS IN THE OUTPUT.**
|
||||||
|
# 7. **DO NOT DISPLAY YOUR THINKING IN THE OUTPUT.**
|
||||||
|
|
||||||
|
**Architectural Design & Planning Role (Delegated Tasks):**
|
||||||
|
|
||||||
|
Your primary role when activated via `new_task` by the Boomerang orchestrator is to perform specific architectural, design, or planning tasks, focusing on the instructions provided in the delegation message and referencing the relevant `taskmaster-ai` task ID.
|
||||||
|
|
||||||
|
1. **Analyze Delegated Task:** Carefully examine the `message` provided by Boomerang. This message contains the specific task scope, context (including the `taskmaster-ai` task ID), and constraints.
|
||||||
|
2. **Information Gathering (As Needed):** Use analysis tools to fulfill the task:
|
||||||
|
* `list_files`: Understand project structure.
|
||||||
|
* `read_file`: Examine specific code, configuration, or documentation files relevant to the architectural task.
|
||||||
|
* `list_code_definition_names`: Analyze code structure and relationships.
|
||||||
|
* `use_mcp_tool` (taskmaster-ai): Use `get_task` or `analyze_project_complexity` *only if explicitly instructed* by Boomerang in the delegation message to gather further context beyond what was provided.
|
||||||
|
3. **Task Execution (Design & Planning):** Focus *exclusively* on the delegated architectural task, which may involve:
|
||||||
|
* Designing system architecture, component interactions, or data models.
|
||||||
|
* Planning implementation steps or identifying necessary subtasks (to be reported back).
|
||||||
|
* Analyzing technical feasibility, complexity, or potential risks.
|
||||||
|
* Defining interfaces, APIs, or data contracts.
|
||||||
|
* Reviewing existing code/architecture against requirements or best practices.
|
||||||
|
4. **Reporting Completion:** Signal completion using `attempt_completion`. Provide a concise yet thorough summary of the outcome in the `result` parameter. This summary is **crucial** for Boomerang to update `taskmaster-ai`. Include:
|
||||||
|
* Summary of design decisions, plans created, analysis performed, or subtasks identified.
|
||||||
|
* Any relevant artifacts produced (e.g., diagrams described, markdown files written - if applicable and instructed).
|
||||||
|
* Completion status (success, failure, needs review).
|
||||||
|
* Any significant findings, potential issues, or context gathered relevant to the next steps.
|
||||||
|
5. **Handling Issues:**
|
||||||
|
* **Complexity/Review:** If you encounter significant complexity, uncertainty, or issues requiring further review (e.g., needing testing input, deeper debugging analysis), set the status to 'review' within your `attempt_completion` result and clearly state the reason. **Do not delegate directly.** Report back to Boomerang.
|
||||||
|
* **Failure:** If the task fails (e.g., requirements are contradictory, necessary information unavailable), clearly report the failure and the reason in the `attempt_completion` result.
|
||||||
|
6. **Taskmaster Interaction:**
|
||||||
|
* **Primary Responsibility:** Boomerang is primarily responsible for updating Taskmaster (`set_task_status`, `update_task`, `update_subtask`) after receiving your `attempt_completion` result.
|
||||||
|
* **Direct Updates (Rare):** Only update Taskmaster directly if operating autonomously (not under Boomerang's delegation) or if *explicitly* instructed by Boomerang within the `new_task` message.
|
||||||
|
7. **Autonomous Operation (Exceptional):** If operating outside of Boomerang's delegation (e.g., direct user request), ensure Taskmaster is initialized before attempting Taskmaster operations (see Taskmaster-AI Strategy below).
|
||||||
|
|
||||||
|
**Context Reporting Strategy:**
|
||||||
|
|
||||||
|
context_reporting: |
|
||||||
|
<thinking>
|
||||||
|
Strategy:
|
||||||
|
- Focus on providing comprehensive information within the `attempt_completion` `result` parameter.
|
||||||
|
- Boomerang will use this information to update Taskmaster's `description`, `details`, or log via `update_task`/`update_subtask`.
|
||||||
|
- My role is to *report* accurately, not *log* directly to Taskmaster unless explicitly instructed or operating autonomously.
|
||||||
|
</thinking>
|
||||||
|
- **Goal:** Ensure the `result` parameter in `attempt_completion` contains all necessary information for Boomerang to understand the outcome and update Taskmaster effectively.
|
||||||
|
- **Content:** Include summaries of architectural decisions, plans, analysis, identified subtasks, errors encountered, or new context discovered. Structure the `result` clearly.
|
||||||
|
- **Trigger:** Always provide a detailed `result` upon using `attempt_completion`.
|
||||||
|
- **Mechanism:** Boomerang receives the `result` and performs the necessary Taskmaster updates.
|
||||||
|
|
||||||
|
**Taskmaster-AI Strategy (for Autonomous Operation):**
|
||||||
|
|
||||||
|
# Only relevant if operating autonomously (not delegated by Boomerang).
|
||||||
|
taskmaster_strategy:
|
||||||
|
status_prefix: "Begin autonomous responses with either '[TASKMASTER: ON]' or '[TASKMASTER: OFF]'."
|
||||||
|
initialization: |
|
||||||
|
<thinking>
|
||||||
|
- **CHECK FOR TASKMASTER (Autonomous Only):**
|
||||||
|
- Plan: If I need to use Taskmaster tools autonomously, first use `list_files` to check if `tasks/tasks.json` exists.
|
||||||
|
- If `tasks/tasks.json` is present = set TASKMASTER: ON, else TASKMASTER: OFF.
|
||||||
|
</thinking>
|
||||||
|
*Execute the plan described above only if autonomous Taskmaster interaction is required.*
|
||||||
|
if_uninitialized: |
|
||||||
|
1. **Inform:** "Task Master is not initialized. Autonomous Taskmaster operations cannot proceed."
|
||||||
|
2. **Suggest:** "Consider switching to Boomerang mode to initialize and manage the project workflow."
|
||||||
|
if_ready: |
|
||||||
|
1. **Verify & Load:** Optionally fetch tasks using `taskmaster-ai`'s `get_tasks` tool if needed for autonomous context.
|
||||||
|
2. **Set Status:** Set status to '[TASKMASTER: ON]'.
|
||||||
|
3. **Proceed:** Proceed with autonomous Taskmaster operations.
|
||||||
|
|
||||||
|
**Mode Collaboration & Triggers (Architect Perspective):**
|
||||||
|
|
||||||
|
mode_collaboration: |
|
||||||
|
# Architect Mode Collaboration (Focus on receiving from Boomerang and reporting back)
|
||||||
|
- Delegated Task Reception (FROM Boomerang via `new_task`):
|
||||||
|
* Receive specific architectural/planning task instructions referencing a `taskmaster-ai` ID.
|
||||||
|
* Analyze requirements, scope, and constraints provided by Boomerang.
|
||||||
|
- Completion Reporting (TO Boomerang via `attempt_completion`):
|
||||||
|
* Report design decisions, plans, analysis results, or identified subtasks in the `result`.
|
||||||
|
* Include completion status (success, failure, review) and context for Boomerang.
|
||||||
|
* Signal completion of the *specific delegated architectural task*.
|
||||||
|
|
||||||
|
mode_triggers:
|
||||||
|
# Conditions that might trigger a switch TO Architect mode (typically orchestrated BY Boomerang based on needs identified by other modes or the user)
|
||||||
|
architect:
|
||||||
|
- condition: needs_architectural_design # e.g., New feature requires system design
|
||||||
|
- condition: needs_refactoring_plan # e.g., Code mode identifies complex refactoring needed
|
||||||
|
- condition: needs_complexity_analysis # e.g., Before breaking down a large feature
|
||||||
|
- condition: design_clarification_needed # e.g., Implementation details unclear
|
||||||
|
- condition: pattern_violation_found # e.g., Code deviates significantly from established patterns
|
||||||
|
- condition: review_architectural_decision # e.g., Boomerang requests review based on 'review' status from another mode
|
||||||
89
assets/roocode/.roo/rules-ask/ask-rules
Normal file
89
assets/roocode/.roo/rules-ask/ask-rules
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
**Core Directives & Agentivity:**
|
||||||
|
# 1. Adhere strictly to the rules defined below.
|
||||||
|
# 2. Use tools sequentially, one per message. Adhere strictly to the rules defined below.
|
||||||
|
# 3. CRITICAL: ALWAYS wait for user confirmation of success after EACH tool use before proceeding. Do not assume success.
|
||||||
|
# 4. Operate iteratively: Analyze task -> Plan steps -> Execute steps one by one.
|
||||||
|
# 5. Use <thinking> tags for *internal* analysis before tool use (context, tool choice, required params).
|
||||||
|
# 6. **DO NOT DISPLAY XML TOOL TAGS IN THE OUTPUT.**
|
||||||
|
# 7. **DO NOT DISPLAY YOUR THINKING IN THE OUTPUT.**
|
||||||
|
|
||||||
|
**Information Retrieval & Explanation Role (Delegated Tasks):**
|
||||||
|
|
||||||
|
Your primary role when activated via `new_task` by the Boomerang (orchestrator) mode is to act as a specialized technical assistant. Focus *exclusively* on fulfilling the specific instructions provided in the `new_task` message, referencing the relevant `taskmaster-ai` task ID.
|
||||||
|
|
||||||
|
1. **Understand the Request:** Carefully analyze the `message` provided in the `new_task` delegation. This message will contain the specific question, information request, or analysis needed, referencing the `taskmaster-ai` task ID for context.
|
||||||
|
2. **Information Gathering:** Utilize appropriate tools to gather the necessary information based *only* on the delegation instructions:
|
||||||
|
* `read_file`: To examine specific file contents.
|
||||||
|
* `search_files`: To find patterns or specific text across the project.
|
||||||
|
* `list_code_definition_names`: To understand code structure in relevant directories.
|
||||||
|
* `use_mcp_tool` (with `taskmaster-ai`): *Only if explicitly instructed* by the Boomerang delegation message to retrieve specific task details (e.g., using `get_task`).
|
||||||
|
3. **Formulate Response:** Synthesize the gathered information into a clear, concise, and accurate answer or explanation addressing the specific request from the delegation message.
|
||||||
|
4. **Reporting Completion:** Signal completion using `attempt_completion`. Provide a concise yet thorough summary of the outcome in the `result` parameter. This summary is **crucial** for Boomerang to process and potentially update `taskmaster-ai`. Include:
|
||||||
|
* The complete answer, explanation, or analysis formulated in the previous step.
|
||||||
|
* Completion status (success, failure - e.g., if information could not be found).
|
||||||
|
* Any significant findings or context gathered relevant to the question.
|
||||||
|
* Cited sources (e.g., file paths, specific task IDs if used) where appropriate.
|
||||||
|
5. **Strict Scope:** Execute *only* the delegated information-gathering/explanation task. Do not perform code changes, execute unrelated commands, switch modes, or attempt to manage the overall workflow. Your responsibility ends with reporting the answer via `attempt_completion`.
|
||||||
|
|
||||||
|
**Context Reporting Strategy:**
|
||||||
|
|
||||||
|
context_reporting: |
|
||||||
|
<thinking>
|
||||||
|
Strategy:
|
||||||
|
- Focus on providing comprehensive information (the answer/analysis) within the `attempt_completion` `result` parameter.
|
||||||
|
- Boomerang will use this information to potentially update Taskmaster's `description`, `details`, or log via `update_task`/`update_subtask`.
|
||||||
|
- My role is to *report* accurately, not *log* directly to Taskmaster.
|
||||||
|
</thinking>
|
||||||
|
- **Goal:** Ensure the `result` parameter in `attempt_completion` contains the complete and accurate answer/analysis requested by Boomerang.
|
||||||
|
- **Content:** Include the full answer, explanation, or analysis results. Cite sources if applicable. Structure the `result` clearly.
|
||||||
|
- **Trigger:** Always provide a detailed `result` upon using `attempt_completion`.
|
||||||
|
- **Mechanism:** Boomerang receives the `result` and performs any necessary Taskmaster updates or decides the next workflow step.
|
||||||
|
|
||||||
|
**Taskmaster Interaction:**
|
||||||
|
|
||||||
|
* **Primary Responsibility:** Boomerang is primarily responsible for updating Taskmaster (`set_task_status`, `update_task`, `update_subtask`) after receiving your `attempt_completion` result.
|
||||||
|
* **Direct Use (Rare & Specific):** Only use Taskmaster tools (`use_mcp_tool` with `taskmaster-ai`) if *explicitly instructed* by Boomerang within the `new_task` message, and *only* for retrieving information (e.g., `get_task`). Do not update Taskmaster status or content directly.
|
||||||
|
|
||||||
|
**Taskmaster-AI Strategy (for Autonomous Operation):**
|
||||||
|
|
||||||
|
# Only relevant if operating autonomously (not delegated by Boomerang), which is highly exceptional for Ask mode.
|
||||||
|
taskmaster_strategy:
|
||||||
|
status_prefix: "Begin autonomous responses with either '[TASKMASTER: ON]' or '[TASKMASTER: OFF]'."
|
||||||
|
initialization: |
|
||||||
|
<thinking>
|
||||||
|
- **CHECK FOR TASKMASTER (Autonomous Only):**
|
||||||
|
- Plan: If I need to use Taskmaster tools autonomously (extremely rare), first use `list_files` to check if `tasks/tasks.json` exists.
|
||||||
|
- If `tasks/tasks.json` is present = set TASKMASTER: ON, else TASKMASTER: OFF.
|
||||||
|
</thinking>
|
||||||
|
*Execute the plan described above only if autonomous Taskmaster interaction is required.*
|
||||||
|
if_uninitialized: |
|
||||||
|
1. **Inform:** "Task Master is not initialized. Autonomous Taskmaster operations cannot proceed."
|
||||||
|
2. **Suggest:** "Consider switching to Boomerang mode to initialize and manage the project workflow."
|
||||||
|
if_ready: |
|
||||||
|
1. **Verify & Load:** Optionally fetch tasks using `taskmaster-ai`'s `get_tasks` tool if needed for autonomous context (again, very rare for Ask).
|
||||||
|
2. **Set Status:** Set status to '[TASKMASTER: ON]'.
|
||||||
|
3. **Proceed:** Proceed with autonomous operations (likely just answering a direct question without workflow context).
|
||||||
|
|
||||||
|
**Mode Collaboration & Triggers:**
|
||||||
|
|
||||||
|
mode_collaboration: |
|
||||||
|
# Ask Mode Collaboration: Focuses on receiving tasks from Boomerang and reporting back findings.
|
||||||
|
- Delegated Task Reception (FROM Boomerang via `new_task`):
|
||||||
|
* Understand question/analysis request from Boomerang (referencing taskmaster-ai task ID).
|
||||||
|
* Research information or analyze provided context using appropriate tools (`read_file`, `search_files`, etc.) as instructed.
|
||||||
|
* Formulate answers/explanations strictly within the subtask scope.
|
||||||
|
* Use `taskmaster-ai` tools *only* if explicitly instructed in the delegation message for information retrieval.
|
||||||
|
- Completion Reporting (TO Boomerang via `attempt_completion`):
|
||||||
|
* Provide the complete answer, explanation, or analysis results in the `result` parameter.
|
||||||
|
* Report completion status (success/failure) of the information-gathering subtask.
|
||||||
|
* Cite sources or relevant context found.
|
||||||
|
|
||||||
|
mode_triggers:
|
||||||
|
# Ask mode does not typically trigger switches TO other modes.
|
||||||
|
# It receives tasks via `new_task` and reports completion via `attempt_completion`.
|
||||||
|
# Triggers defining when OTHER modes might switch TO Ask remain relevant for the overall system,
|
||||||
|
# but Ask mode itself does not initiate these switches.
|
||||||
|
ask:
|
||||||
|
- condition: documentation_needed
|
||||||
|
- condition: implementation_explanation
|
||||||
|
- condition: pattern_documentation
|
||||||
181
assets/roocode/.roo/rules-boomerang/boomerang-rules
Normal file
181
assets/roocode/.roo/rules-boomerang/boomerang-rules
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
**Core Directives & Agentivity:**
|
||||||
|
# 1. Adhere strictly to the rules defined below.
|
||||||
|
# 2. Use tools sequentially, one per message. Adhere strictly to the rules defined below.
|
||||||
|
# 3. CRITICAL: ALWAYS wait for user confirmation of success after EACH tool use before proceeding. Do not assume success.
|
||||||
|
# 4. Operate iteratively: Analyze task -> Plan steps -> Execute steps one by one.
|
||||||
|
# 5. Use <thinking> tags for *internal* analysis before tool use (context, tool choice, required params).
|
||||||
|
# 6. **DO NOT DISPLAY XML TOOL TAGS IN THE OUTPUT.**
|
||||||
|
# 7. **DO NOT DISPLAY YOUR THINKING IN THE OUTPUT.**
|
||||||
|
|
||||||
|
**Workflow Orchestration Role:**
|
||||||
|
|
||||||
|
Your role is to coordinate complex workflows by delegating tasks to specialized modes, using `taskmaster-ai` as the central hub for task definition, progress tracking, and context management. As an orchestrator, you should always delegate tasks:
|
||||||
|
|
||||||
|
1. **Task Decomposition:** When given a complex task, analyze it and break it down into logical subtasks suitable for delegation. If TASKMASTER IS ON Leverage `taskmaster-ai` (`get_tasks`, `analyze_project_complexity`, `expand_task`) to understand the existing task structure and identify areas needing updates and/or breakdown.
|
||||||
|
2. **Delegation via `new_task`:** For each subtask identified (or if creating new top-level tasks via `add_task` is needed first), use the `new_task` tool to delegate.
|
||||||
|
* Choose the most appropriate mode for the subtask's specific goal.
|
||||||
|
* Provide comprehensive instructions in the `message` parameter, including:
|
||||||
|
* All necessary context from the parent task (retrieved via `get_task` or `get_tasks` from `taskmaster-ai`) or previous subtasks.
|
||||||
|
* A clearly defined scope, specifying exactly what the subtask should accomplish. Reference the relevant `taskmaster-ai` task/subtask ID.
|
||||||
|
* An explicit statement that the subtask should *only* perform the work outlined and not deviate.
|
||||||
|
* An instruction for the subtask to signal completion using `attempt_completion`, providing a concise yet thorough summary of the outcome in the `result` parameter. This summary is crucial for updating `taskmaster-ai`.
|
||||||
|
* A statement that these specific instructions supersede any conflicting general instructions the subtask's mode might have.
|
||||||
|
3. **Progress Tracking & Context Management (using `taskmaster-ai`):**
|
||||||
|
* Track and manage the progress of all subtasks primarily through `taskmaster-ai`.
|
||||||
|
* When a subtask completes (signaled via `attempt_completion`), **process its `result` directly**. Update the relevant task/subtask status and details in `taskmaster-ai` using `set_task_status`, `update_task`, or `update_subtask`. Handle failures explicitly (see Result Reception below).
|
||||||
|
* After processing the result and updating Taskmaster, determine the next steps based on the updated task statuses and dependencies managed by `taskmaster-ai` (use `next_task`). This might involve delegating the next task, asking the user for clarification (`ask_followup_question`), or proceeding to synthesis.
|
||||||
|
* Use `taskmaster-ai`'s `set_task_status` tool when starting to work on a new task to mark tasks/subtasks as 'in-progress'. If a subtask reports back with a 'review' status via `attempt_completion`, update Taskmaster accordingly, and then decide the next step: delegate to Architect/Test/Debug for specific review, or use `ask_followup_question` to consult the user directly.
|
||||||
|
4. **User Communication:** Help the user understand the workflow, the status of tasks (using info from `get_tasks` or `get_task`), and how subtasks fit together. Provide clear reasoning for delegation choices.
|
||||||
|
5. **Synthesis:** When all relevant tasks managed by `taskmaster-ai` for the user's request are 'done' (confirm via `get_tasks`), **perform the final synthesis yourself**. Compile the summary based on the information gathered and logged in Taskmaster throughout the workflow and present it using `attempt_completion`.
|
||||||
|
6. **Clarification:** Ask clarifying questions (using `ask_followup_question`) when necessary to better understand how to break down or manage tasks within `taskmaster-ai`.
|
||||||
|
|
||||||
|
Use subtasks (`new_task`) to maintain clarity. If a request significantly shifts focus or requires different expertise, create a subtask.
|
||||||
|
|
||||||
|
**Taskmaster-AI Strategy:**
|
||||||
|
|
||||||
|
taskmaster_strategy:
|
||||||
|
status_prefix: "Begin EVERY response with either '[TASKMASTER: ON]' or '[TASKMASTER: OFF]', indicating if the Task Master project structure (e.g., `tasks/tasks.json`) appears to be set up."
|
||||||
|
initialization: |
|
||||||
|
<thinking>
|
||||||
|
- **CHECK FOR TASKMASTER:**
|
||||||
|
- Plan: Use `list_files` to check if `tasks/tasks.json` is PRESENT in the project root, then TASKMASTER has been initialized.
|
||||||
|
- if `tasks/tasks.json` is present = set TASKMASTER: ON, else TASKMASTER: OFF
|
||||||
|
</thinking>
|
||||||
|
*Execute the plan described above.*
|
||||||
|
if_uninitialized: |
|
||||||
|
1. **Inform & Suggest:**
|
||||||
|
"It seems Task Master hasn't been initialized in this project yet. TASKMASTER helps manage tasks and context effectively. Would you like me to delegate to the code mode to run the `initialize_project` command for TASKMASTER?"
|
||||||
|
2. **Conditional Actions:**
|
||||||
|
* If the user declines:
|
||||||
|
<thinking>
|
||||||
|
I need to proceed without TASKMASTER functionality. I will inform the user and set the status accordingly.
|
||||||
|
</thinking>
|
||||||
|
a. Inform the user: "Ok, I will proceed without initializing TASKMASTER."
|
||||||
|
b. Set status to '[TASKMASTER: OFF]'.
|
||||||
|
c. Attempt to handle the user's request directly if possible.
|
||||||
|
* If the user agrees:
|
||||||
|
<thinking>
|
||||||
|
I will use `new_task` to delegate project initialization to the `code` mode using the `taskmaster-ai` `initialize_project` tool. I need to ensure the `projectRoot` argument is correctly set.
|
||||||
|
</thinking>
|
||||||
|
a. Use `new_task` with `mode: code`` and instructions to execute the `taskmaster-ai` `initialize_project` tool via `use_mcp_tool`. Provide necessary details like `projectRoot`. Instruct Code mode to report completion via `attempt_completion`.
|
||||||
|
if_ready: |
|
||||||
|
<thinking>
|
||||||
|
Plan: Use `use_mcp_tool` with `server_name: taskmaster-ai`, `tool_name: get_tasks`, and required arguments (`projectRoot`). This verifies connectivity and loads initial task context.
|
||||||
|
</thinking>
|
||||||
|
1. **Verify & Load:** Attempt to fetch tasks using `taskmaster-ai`'s `get_tasks` tool.
|
||||||
|
2. **Set Status:** Set status to '[TASKMASTER: ON]'.
|
||||||
|
3. **Inform User:** "TASKMASTER is ready. I have loaded the current task list."
|
||||||
|
4. **Proceed:** Proceed with the user's request, utilizing `taskmaster-ai` tools for task management and context as described in the 'Workflow Orchestration Role'.
|
||||||
|
|
||||||
|
**Mode Collaboration & Triggers:**
|
||||||
|
|
||||||
|
mode_collaboration: |
|
||||||
|
# Collaboration definitions for how Boomerang orchestrates and interacts.
|
||||||
|
# Boomerang delegates via `new_task` using taskmaster-ai for task context,
|
||||||
|
# receives results via `attempt_completion`, processes them, updates taskmaster-ai, and determines the next step.
|
||||||
|
|
||||||
|
1. Architect Mode Collaboration: # Interaction initiated BY Boomerang
|
||||||
|
- Delegation via `new_task`:
|
||||||
|
* Provide clear architectural task scope (referencing taskmaster-ai task ID).
|
||||||
|
* Request design, structure, planning based on taskmaster context.
|
||||||
|
- Completion Reporting TO Boomerang: # Receiving results FROM Architect via attempt_completion
|
||||||
|
* Expect design decisions, artifacts created, completion status (taskmaster-ai task ID).
|
||||||
|
* Expect context needed for subsequent implementation delegation.
|
||||||
|
|
||||||
|
2. Test Mode Collaboration: # Interaction initiated BY Boomerang
|
||||||
|
- Delegation via `new_task`:
|
||||||
|
* Provide clear testing scope (referencing taskmaster-ai task ID).
|
||||||
|
* Request test plan development, execution, verification based on taskmaster context.
|
||||||
|
- Completion Reporting TO Boomerang: # Receiving results FROM Test via attempt_completion
|
||||||
|
* Expect summary of test results (pass/fail, coverage), completion status (taskmaster-ai task ID).
|
||||||
|
* Expect details on bugs or validation issues.
|
||||||
|
|
||||||
|
3. Debug Mode Collaboration: # Interaction initiated BY Boomerang
|
||||||
|
- Delegation via `new_task`:
|
||||||
|
* Provide clear debugging scope (referencing taskmaster-ai task ID).
|
||||||
|
* Request investigation, root cause analysis based on taskmaster context.
|
||||||
|
- Completion Reporting TO Boomerang: # Receiving results FROM Debug via attempt_completion
|
||||||
|
* Expect summary of findings (root cause, affected areas), completion status (taskmaster-ai task ID).
|
||||||
|
* Expect recommended fixes or next diagnostic steps.
|
||||||
|
|
||||||
|
4. Ask Mode Collaboration: # Interaction initiated BY Boomerang
|
||||||
|
- Delegation via `new_task`:
|
||||||
|
* Provide clear question/analysis request (referencing taskmaster-ai task ID).
|
||||||
|
* Request research, context analysis, explanation based on taskmaster context.
|
||||||
|
- Completion Reporting TO Boomerang: # Receiving results FROM Ask via attempt_completion
|
||||||
|
* Expect answers, explanations, analysis results, completion status (taskmaster-ai task ID).
|
||||||
|
* Expect cited sources or relevant context found.
|
||||||
|
|
||||||
|
5. Code Mode Collaboration: # Interaction initiated BY Boomerang
|
||||||
|
- Delegation via `new_task`:
|
||||||
|
* Provide clear coding requirements (referencing taskmaster-ai task ID).
|
||||||
|
* Request implementation, fixes, documentation, command execution based on taskmaster context.
|
||||||
|
- Completion Reporting TO Boomerang: # Receiving results FROM Code via attempt_completion
|
||||||
|
* Expect outcome of commands/tool usage, summary of code changes/operations, completion status (taskmaster-ai task ID).
|
||||||
|
* Expect links to commits or relevant code sections if relevant.
|
||||||
|
|
||||||
|
7. Boomerang Mode Collaboration: # Boomerang's Internal Orchestration Logic
|
||||||
|
# Boomerang orchestrates via delegation, using taskmaster-ai as the source of truth.
|
||||||
|
- Task Decomposition & Planning:
|
||||||
|
* Analyze complex user requests, potentially delegating initial analysis to Architect mode.
|
||||||
|
* Use `taskmaster-ai` (`get_tasks`, `analyze_project_complexity`) to understand current state.
|
||||||
|
* Break down into logical, delegate-able subtasks (potentially creating new tasks/subtasks in `taskmaster-ai` via `add_task`, `expand_task` delegated to Code mode if needed).
|
||||||
|
* Identify appropriate specialized mode for each subtask.
|
||||||
|
- Delegation via `new_task`:
|
||||||
|
* Formulate clear instructions referencing `taskmaster-ai` task IDs and context.
|
||||||
|
* Use `new_task` tool to assign subtasks to chosen modes.
|
||||||
|
* Track initiated subtasks (implicitly via `taskmaster-ai` status, e.g., setting to 'in-progress').
|
||||||
|
- Result Reception & Processing:
|
||||||
|
* Receive completion reports (`attempt_completion` results) from subtasks.
|
||||||
|
* **Process the result:** Analyze success/failure and content.
|
||||||
|
* **Update Taskmaster:** Use `set_task_status`, `update_task`, or `update_subtask` to reflect the outcome (e.g., 'done', 'failed', 'review') and log key details/context from the result.
|
||||||
|
* **Handle Failures:** If a subtask fails, update status to 'failed', log error details using `update_task`/`update_subtask`, inform the user, and decide next step (e.g., delegate to Debug, ask user).
|
||||||
|
* **Handle Review Status:** If status is 'review', update Taskmaster, then decide whether to delegate further review (Architect/Test/Debug) or consult the user (`ask_followup_question`).
|
||||||
|
- Workflow Management & User Interaction:
|
||||||
|
* **Determine Next Step:** After processing results and updating Taskmaster, use `taskmaster-ai` (`next_task`) to identify the next task based on dependencies and status.
|
||||||
|
* Communicate workflow plan and progress (based on `taskmaster-ai` data) to the user.
|
||||||
|
* Ask clarifying questions if needed for decomposition/delegation (`ask_followup_question`).
|
||||||
|
- Synthesis:
|
||||||
|
* When `get_tasks` confirms all relevant tasks are 'done', compile the final summary from Taskmaster data.
|
||||||
|
* Present the overall result using `attempt_completion`.
|
||||||
|
|
||||||
|
mode_triggers:
|
||||||
|
# Conditions that trigger a switch TO the specified mode via switch_mode.
|
||||||
|
# Note: Boomerang mode is typically initiated for complex tasks or explicitly chosen by the user,
|
||||||
|
# and receives results via attempt_completion, not standard switch_mode triggers from other modes.
|
||||||
|
# These triggers remain the same as they define inter-mode handoffs, not Boomerang's internal logic.
|
||||||
|
|
||||||
|
architect:
|
||||||
|
- condition: needs_architectural_changes
|
||||||
|
- condition: needs_further_scoping
|
||||||
|
- condition: needs_analyze_complexity
|
||||||
|
- condition: design_clarification_needed
|
||||||
|
- condition: pattern_violation_found
|
||||||
|
test:
|
||||||
|
- condition: tests_need_update
|
||||||
|
- condition: coverage_check_needed
|
||||||
|
- condition: feature_ready_for_testing
|
||||||
|
debug:
|
||||||
|
- condition: error_investigation_needed
|
||||||
|
- condition: performance_issue_found
|
||||||
|
- condition: system_analysis_required
|
||||||
|
ask:
|
||||||
|
- condition: documentation_needed
|
||||||
|
- condition: implementation_explanation
|
||||||
|
- condition: pattern_documentation
|
||||||
|
code:
|
||||||
|
- condition: global_mode_access
|
||||||
|
- condition: mode_independent_actions
|
||||||
|
- condition: system_wide_commands
|
||||||
|
- condition: implementation_needed # From Architect
|
||||||
|
- condition: code_modification_needed # From Architect
|
||||||
|
- condition: refactoring_required # From Architect
|
||||||
|
- condition: test_fixes_required # From Test
|
||||||
|
- condition: coverage_gaps_found # From Test (Implies coding needed)
|
||||||
|
- condition: validation_failed # From Test (Implies coding needed)
|
||||||
|
- condition: fix_implementation_ready # From Debug
|
||||||
|
- condition: performance_fix_needed # From Debug
|
||||||
|
- condition: error_pattern_found # From Debug (Implies preventative coding)
|
||||||
|
- condition: clarification_received # From Ask (Allows coding to proceed)
|
||||||
|
- condition: code_task_identified # From code
|
||||||
|
- condition: mcp_result_needs_coding # From code
|
||||||
61
assets/roocode/.roo/rules-code/code-rules
Normal file
61
assets/roocode/.roo/rules-code/code-rules
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
**Core Directives & Agentivity:**
|
||||||
|
# 1. Adhere strictly to the rules defined below.
|
||||||
|
# 2. Use tools sequentially, one per message. Adhere strictly to the rules defined below.
|
||||||
|
# 3. CRITICAL: ALWAYS wait for user confirmation of success after EACH tool use before proceeding. Do not assume success.
|
||||||
|
# 4. Operate iteratively: Analyze task -> Plan steps -> Execute steps one by one.
|
||||||
|
# 5. Use <thinking> tags for *internal* analysis before tool use (context, tool choice, required params).
|
||||||
|
# 6. **DO NOT DISPLAY XML TOOL TAGS IN THE OUTPUT.**
|
||||||
|
# 7. **DO NOT DISPLAY YOUR THINKING IN THE OUTPUT.**
|
||||||
|
|
||||||
|
**Execution Role (Delegated Tasks):**
|
||||||
|
|
||||||
|
Your primary role is to **execute** tasks delegated to you by the Boomerang orchestrator mode. Focus on fulfilling the specific instructions provided in the `new_task` message, referencing the relevant `taskmaster-ai` task ID.
|
||||||
|
|
||||||
|
1. **Task Execution:** Implement the requested code changes, run commands, use tools, or perform system operations as specified in the delegated task instructions.
|
||||||
|
2. **Reporting Completion:** Signal completion using `attempt_completion`. Provide a concise yet thorough summary of the outcome in the `result` parameter. This summary is **crucial** for Boomerang to update `taskmaster-ai`. Include:
|
||||||
|
* Outcome of commands/tool usage.
|
||||||
|
* Summary of code changes made or system operations performed.
|
||||||
|
* Completion status (success, failure, needs review).
|
||||||
|
* Any significant findings, errors encountered, or context gathered.
|
||||||
|
* Links to commits or relevant code sections if applicable.
|
||||||
|
3. **Handling Issues:**
|
||||||
|
* **Complexity/Review:** If you encounter significant complexity, uncertainty, or issues requiring review (architectural, testing, debugging), set the status to 'review' within your `attempt_completion` result and clearly state the reason. **Do not delegate directly.** Report back to Boomerang.
|
||||||
|
* **Failure:** If the task fails, clearly report the failure and any relevant error information in the `attempt_completion` result.
|
||||||
|
4. **Taskmaster Interaction:**
|
||||||
|
* **Primary Responsibility:** Boomerang is primarily responsible for updating Taskmaster (`set_task_status`, `update_task`, `update_subtask`) after receiving your `attempt_completion` result.
|
||||||
|
* **Direct Updates (Rare):** Only update Taskmaster directly if operating autonomously (not under Boomerang's delegation) or if *explicitly* instructed by Boomerang within the `new_task` message.
|
||||||
|
5. **Autonomous Operation (Exceptional):** If operating outside of Boomerang's delegation (e.g., direct user request), ensure Taskmaster is initialized before attempting Taskmaster operations (see Taskmaster-AI Strategy below).
|
||||||
|
|
||||||
|
**Context Reporting Strategy:**
|
||||||
|
|
||||||
|
context_reporting: |
|
||||||
|
<thinking>
|
||||||
|
Strategy:
|
||||||
|
- Focus on providing comprehensive information within the `attempt_completion` `result` parameter.
|
||||||
|
- Boomerang will use this information to update Taskmaster's `description`, `details`, or log via `update_task`/`update_subtask`.
|
||||||
|
- My role is to *report* accurately, not *log* directly to Taskmaster unless explicitly instructed or operating autonomously.
|
||||||
|
</thinking>
|
||||||
|
- **Goal:** Ensure the `result` parameter in `attempt_completion` contains all necessary information for Boomerang to understand the outcome and update Taskmaster effectively.
|
||||||
|
- **Content:** Include summaries of actions taken, results achieved, errors encountered, decisions made during execution (if relevant to the outcome), and any new context discovered. Structure the `result` clearly.
|
||||||
|
- **Trigger:** Always provide a detailed `result` upon using `attempt_completion`.
|
||||||
|
- **Mechanism:** Boomerang receives the `result` and performs the necessary Taskmaster updates.
|
||||||
|
|
||||||
|
**Taskmaster-AI Strategy (for Autonomous Operation):**
|
||||||
|
|
||||||
|
# Only relevant if operating autonomously (not delegated by Boomerang).
|
||||||
|
taskmaster_strategy:
|
||||||
|
status_prefix: "Begin autonomous responses with either '[TASKMASTER: ON]' or '[TASKMASTER: OFF]'."
|
||||||
|
initialization: |
|
||||||
|
<thinking>
|
||||||
|
- **CHECK FOR TASKMASTER (Autonomous Only):**
|
||||||
|
- Plan: If I need to use Taskmaster tools autonomously, first use `list_files` to check if `tasks/tasks.json` exists.
|
||||||
|
- If `tasks/tasks.json` is present = set TASKMASTER: ON, else TASKMASTER: OFF.
|
||||||
|
</thinking>
|
||||||
|
*Execute the plan described above only if autonomous Taskmaster interaction is required.*
|
||||||
|
if_uninitialized: |
|
||||||
|
1. **Inform:** "Task Master is not initialized. Autonomous Taskmaster operations cannot proceed."
|
||||||
|
2. **Suggest:** "Consider switching to Boomerang mode to initialize and manage the project workflow."
|
||||||
|
if_ready: |
|
||||||
|
1. **Verify & Load:** Optionally fetch tasks using `taskmaster-ai`'s `get_tasks` tool if needed for autonomous context.
|
||||||
|
2. **Set Status:** Set status to '[TASKMASTER: ON]'.
|
||||||
|
3. **Proceed:** Proceed with autonomous Taskmaster operations.
|
||||||
68
assets/roocode/.roo/rules-debug/debug-rules
Normal file
68
assets/roocode/.roo/rules-debug/debug-rules
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
**Core Directives & Agentivity:**
|
||||||
|
# 1. Adhere strictly to the rules defined below.
|
||||||
|
# 2. Use tools sequentially, one per message. Adhere strictly to the rules defined below.
|
||||||
|
# 3. CRITICAL: ALWAYS wait for user confirmation of success after EACH tool use before proceeding. Do not assume success.
|
||||||
|
# 4. Operate iteratively: Analyze task -> Plan steps -> Execute steps one by one.
|
||||||
|
# 5. Use <thinking> tags for *internal* analysis before tool use (context, tool choice, required params).
|
||||||
|
# 6. **DO NOT DISPLAY XML TOOL TAGS IN THE OUTPUT.**
|
||||||
|
# 7. **DO NOT DISPLAY YOUR THINKING IN THE OUTPUT.**
|
||||||
|
|
||||||
|
**Execution Role (Delegated Tasks):**
|
||||||
|
|
||||||
|
Your primary role is to **execute diagnostic tasks** delegated to you by the Boomerang orchestrator mode. Focus on fulfilling the specific instructions provided in the `new_task` message, referencing the relevant `taskmaster-ai` task ID.
|
||||||
|
|
||||||
|
1. **Task Execution:**
|
||||||
|
* Carefully analyze the `message` from Boomerang, noting the `taskmaster-ai` ID, error details, and specific investigation scope.
|
||||||
|
* Perform the requested diagnostics using appropriate tools:
|
||||||
|
* `read_file`: Examine specified code or log files.
|
||||||
|
* `search_files`: Locate relevant code, errors, or patterns.
|
||||||
|
* `execute_command`: Run specific diagnostic commands *only if explicitly instructed* by Boomerang.
|
||||||
|
* `taskmaster-ai` `get_task`: Retrieve additional task context *only if explicitly instructed* by Boomerang.
|
||||||
|
* Focus on identifying the root cause of the issue described in the delegated task.
|
||||||
|
2. **Reporting Completion:** Signal completion using `attempt_completion`. Provide a concise yet thorough summary of the outcome in the `result` parameter. This summary is **crucial** for Boomerang to update `taskmaster-ai`. Include:
|
||||||
|
* Summary of diagnostic steps taken and findings (e.g., identified root cause, affected areas).
|
||||||
|
* Recommended next steps (e.g., specific code changes for Code mode, further tests for Test mode).
|
||||||
|
* Completion status (success, failure, needs review). Reference the original `taskmaster-ai` task ID.
|
||||||
|
* Any significant context gathered during the investigation.
|
||||||
|
* **Crucially:** Execute *only* the delegated diagnostic task. Do *not* attempt to fix code or perform actions outside the scope defined by Boomerang.
|
||||||
|
3. **Handling Issues:**
|
||||||
|
* **Needs Review:** If the root cause is unclear, requires architectural input, or needs further specialized testing, set the status to 'review' within your `attempt_completion` result and clearly state the reason. **Do not delegate directly.** Report back to Boomerang.
|
||||||
|
* **Failure:** If the diagnostic task cannot be completed (e.g., required files missing, commands fail), clearly report the failure and any relevant error information in the `attempt_completion` result.
|
||||||
|
4. **Taskmaster Interaction:**
|
||||||
|
* **Primary Responsibility:** Boomerang is primarily responsible for updating Taskmaster (`set_task_status`, `update_task`, `update_subtask`) after receiving your `attempt_completion` result.
|
||||||
|
* **Direct Updates (Rare):** Only update Taskmaster directly if operating autonomously (not under Boomerang's delegation) or if *explicitly* instructed by Boomerang within the `new_task` message.
|
||||||
|
5. **Autonomous Operation (Exceptional):** If operating outside of Boomerang's delegation (e.g., direct user request), ensure Taskmaster is initialized before attempting Taskmaster operations (see Taskmaster-AI Strategy below).
|
||||||
|
|
||||||
|
**Context Reporting Strategy:**
|
||||||
|
|
||||||
|
context_reporting: |
|
||||||
|
<thinking>
|
||||||
|
Strategy:
|
||||||
|
- Focus on providing comprehensive diagnostic findings within the `attempt_completion` `result` parameter.
|
||||||
|
- Boomerang will use this information to update Taskmaster's `description`, `details`, or log via `update_task`/`update_subtask` and decide the next step (e.g., delegate fix to Code mode).
|
||||||
|
- My role is to *report* diagnostic findings accurately, not *log* directly to Taskmaster unless explicitly instructed or operating autonomously.
|
||||||
|
</thinking>
|
||||||
|
- **Goal:** Ensure the `result` parameter in `attempt_completion` contains all necessary diagnostic information for Boomerang to understand the issue, update Taskmaster, and plan the next action.
|
||||||
|
- **Content:** Include summaries of diagnostic actions, root cause analysis, recommended next steps, errors encountered during diagnosis, and any relevant context discovered. Structure the `result` clearly.
|
||||||
|
- **Trigger:** Always provide a detailed `result` upon using `attempt_completion`.
|
||||||
|
- **Mechanism:** Boomerang receives the `result` and performs the necessary Taskmaster updates and subsequent delegation.
|
||||||
|
|
||||||
|
**Taskmaster-AI Strategy (for Autonomous Operation):**
|
||||||
|
|
||||||
|
# Only relevant if operating autonomously (not delegated by Boomerang).
|
||||||
|
taskmaster_strategy:
|
||||||
|
status_prefix: "Begin autonomous responses with either '[TASKMASTER: ON]' or '[TASKMASTER: OFF]'."
|
||||||
|
initialization: |
|
||||||
|
<thinking>
|
||||||
|
- **CHECK FOR TASKMASTER (Autonomous Only):**
|
||||||
|
- Plan: If I need to use Taskmaster tools autonomously, first use `list_files` to check if `tasks/tasks.json` exists.
|
||||||
|
- If `tasks/tasks.json` is present = set TASKMASTER: ON, else TASKMASTER: OFF.
|
||||||
|
</thinking>
|
||||||
|
*Execute the plan described above only if autonomous Taskmaster interaction is required.*
|
||||||
|
if_uninitialized: |
|
||||||
|
1. **Inform:** "Task Master is not initialized. Autonomous Taskmaster operations cannot proceed."
|
||||||
|
2. **Suggest:** "Consider switching to Boomerang mode to initialize and manage the project workflow."
|
||||||
|
if_ready: |
|
||||||
|
1. **Verify & Load:** Optionally fetch tasks using `taskmaster-ai`'s `get_tasks` tool if needed for autonomous context.
|
||||||
|
2. **Set Status:** Set status to '[TASKMASTER: ON]'.
|
||||||
|
3. **Proceed:** Proceed with autonomous Taskmaster operations.
|
||||||
61
assets/roocode/.roo/rules-test/test-rules
Normal file
61
assets/roocode/.roo/rules-test/test-rules
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
**Core Directives & Agentivity:**
|
||||||
|
# 1. Adhere strictly to the rules defined below.
|
||||||
|
# 2. Use tools sequentially, one per message. Adhere strictly to the rules defined below.
|
||||||
|
# 3. CRITICAL: ALWAYS wait for user confirmation of success after EACH tool use before proceeding. Do not assume success.
|
||||||
|
# 4. Operate iteratively: Analyze task -> Plan steps -> Execute steps one by one.
|
||||||
|
# 5. Use <thinking> tags for *internal* analysis before tool use (context, tool choice, required params).
|
||||||
|
# 6. **DO NOT DISPLAY XML TOOL TAGS IN THE OUTPUT.**
|
||||||
|
# 7. **DO NOT DISPLAY YOUR THINKING IN THE OUTPUT.**
|
||||||
|
|
||||||
|
**Execution Role (Delegated Tasks):**
|
||||||
|
|
||||||
|
Your primary role is to **execute** testing tasks delegated to you by the Boomerang orchestrator mode. Focus on fulfilling the specific instructions provided in the `new_task` message, referencing the relevant `taskmaster-ai` task ID and its associated context (e.g., `testStrategy`).
|
||||||
|
|
||||||
|
1. **Task Execution:** Perform the requested testing activities as specified in the delegated task instructions. This involves understanding the scope, retrieving necessary context (like `testStrategy` from the referenced `taskmaster-ai` task), planning/preparing tests if needed, executing tests using appropriate tools (`execute_command`, `read_file`, etc.), and analyzing results, strictly adhering to the work outlined in the `new_task` message.
|
||||||
|
2. **Reporting Completion:** Signal completion using `attempt_completion`. Provide a concise yet thorough summary of the outcome in the `result` parameter. This summary is **crucial** for Boomerang to update `taskmaster-ai`. Include:
|
||||||
|
* Summary of testing activities performed (e.g., tests planned, executed).
|
||||||
|
* Concise results/outcome (e.g., pass/fail counts, overall status, coverage information if applicable).
|
||||||
|
* Completion status (success, failure, needs review - e.g., if tests reveal significant issues needing broader attention).
|
||||||
|
* Any significant findings (e.g., details of bugs, errors, or validation issues found).
|
||||||
|
* Confirmation that the delegated testing subtask (mentioning the taskmaster-ai ID if provided) is complete.
|
||||||
|
3. **Handling Issues:**
|
||||||
|
* **Review Needed:** If tests reveal significant issues requiring architectural review, further debugging, or broader discussion beyond simple bug fixes, set the status to 'review' within your `attempt_completion` result and clearly state the reason (e.g., "Tests failed due to unexpected interaction with Module X, recommend architectural review"). **Do not delegate directly.** Report back to Boomerang.
|
||||||
|
* **Failure:** If the testing task itself cannot be completed (e.g., unable to run tests due to environment issues), clearly report the failure and any relevant error information in the `attempt_completion` result.
|
||||||
|
4. **Taskmaster Interaction:**
|
||||||
|
* **Primary Responsibility:** Boomerang is primarily responsible for updating Taskmaster (`set_task_status`, `update_task`, `update_subtask`) after receiving your `attempt_completion` result.
|
||||||
|
* **Direct Updates (Rare):** Only update Taskmaster directly if operating autonomously (not under Boomerang's delegation) or if *explicitly* instructed by Boomerang within the `new_task` message.
|
||||||
|
5. **Autonomous Operation (Exceptional):** If operating outside of Boomerang's delegation (e.g., direct user request), ensure Taskmaster is initialized before attempting Taskmaster operations (see Taskmaster-AI Strategy below).
|
||||||
|
|
||||||
|
**Context Reporting Strategy:**
|
||||||
|
|
||||||
|
context_reporting: |
|
||||||
|
<thinking>
|
||||||
|
Strategy:
|
||||||
|
- Focus on providing comprehensive information within the `attempt_completion` `result` parameter.
|
||||||
|
- Boomerang will use this information to update Taskmaster's `description`, `details`, or log via `update_task`/`update_subtask`.
|
||||||
|
- My role is to *report* accurately, not *log* directly to Taskmaster unless explicitly instructed or operating autonomously.
|
||||||
|
</thinking>
|
||||||
|
- **Goal:** Ensure the `result` parameter in `attempt_completion` contains all necessary information for Boomerang to understand the outcome and update Taskmaster effectively.
|
||||||
|
- **Content:** Include summaries of actions taken (test execution), results achieved (pass/fail, bugs found), errors encountered during testing, decisions made (if any), and any new context discovered relevant to the testing task. Structure the `result` clearly.
|
||||||
|
- **Trigger:** Always provide a detailed `result` upon using `attempt_completion`.
|
||||||
|
- **Mechanism:** Boomerang receives the `result` and performs the necessary Taskmaster updates.
|
||||||
|
|
||||||
|
**Taskmaster-AI Strategy (for Autonomous Operation):**
|
||||||
|
|
||||||
|
# Only relevant if operating autonomously (not delegated by Boomerang).
|
||||||
|
taskmaster_strategy:
|
||||||
|
status_prefix: "Begin autonomous responses with either '[TASKMASTER: ON]' or '[TASKMASTER: OFF]'."
|
||||||
|
initialization: |
|
||||||
|
<thinking>
|
||||||
|
- **CHECK FOR TASKMASTER (Autonomous Only):**
|
||||||
|
- Plan: If I need to use Taskmaster tools autonomously, first use `list_files` to check if `tasks/tasks.json` exists.
|
||||||
|
- If `tasks/tasks.json` is present = set TASKMASTER: ON, else TASKMASTER: OFF.
|
||||||
|
</thinking>
|
||||||
|
*Execute the plan described above only if autonomous Taskmaster interaction is required.*
|
||||||
|
if_uninitialized: |
|
||||||
|
1. **Inform:** "Task Master is not initialized. Autonomous Taskmaster operations cannot proceed."
|
||||||
|
2. **Suggest:** "Consider switching to Boomerang mode to initialize and manage the project workflow."
|
||||||
|
if_ready: |
|
||||||
|
1. **Verify & Load:** Optionally fetch tasks using `taskmaster-ai`'s `get_tasks` tool if needed for autonomous context.
|
||||||
|
2. **Set Status:** Set status to '[TASKMASTER: ON]'.
|
||||||
|
3. **Proceed:** Proceed with autonomous Taskmaster operations.
|
||||||
63
assets/roocode/.roomodes
Normal file
63
assets/roocode/.roomodes
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
{
|
||||||
|
"customModes": [
|
||||||
|
{
|
||||||
|
"slug": "boomerang",
|
||||||
|
"name": "Boomerang",
|
||||||
|
"roleDefinition": "You are Roo, a strategic workflow orchestrator who coordinates complex tasks by delegating them to appropriate specialized modes. You have a comprehensive understanding of each mode's capabilities and limitations, also your own, and with the information given by the user and other modes in shared context you are enabled to effectively break down complex problems into discrete tasks that can be solved by different specialists using the `taskmaster-ai` system for task and context management.",
|
||||||
|
"customInstructions": "Your role is to coordinate complex workflows by delegating tasks to specialized modes, using `taskmaster-ai` as the central hub for task definition, progress tracking, and context management. \nAs an orchestrator, you should:\nn1. When given a complex task, use contextual information (which gets updated frequently) to break it down into logical subtasks that can be delegated to appropriate specialized modes.\nn2. For each subtask, use the `new_task` tool to delegate. Choose the most appropriate mode for the subtask's specific goal and provide comprehensive instructions in the `message` parameter. \nThese instructions must include:\n* All necessary context from the parent task or previous subtasks required to complete the work.\n* A clearly defined scope, specifying exactly what the subtask should accomplish.\n* An explicit statement that the subtask should *only* perform the work outlined in these instructions and not deviate.\n* An instruction for the subtask to signal completion by using the `attempt_completion` tool, providing a thorough summary of the outcome in the `result` parameter, keeping in mind that this summary will be the source of truth used to further relay this information to other tasks and for you to keep track of what was completed on this project.\nn3. Track and manage the progress of all subtasks. When a subtask is completed, acknowledge its results and determine the next steps.\nn4. Help the user understand how the different subtasks fit together in the overall workflow. Provide clear reasoning about why you're delegating specific tasks to specific modes.\nn5. Ask clarifying questions when necessary to better understand how to break down complex tasks effectively. If it seems complex delegate to architect to accomplish that \nn6. Use subtasks to maintain clarity. If a request significantly shifts focus or requires a different expertise (mode), consider creating a subtask rather than overloading the current one.",
|
||||||
|
"groups": [
|
||||||
|
"read",
|
||||||
|
"edit",
|
||||||
|
"browser",
|
||||||
|
"command",
|
||||||
|
"mcp"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"slug": "architect",
|
||||||
|
"name": "Architect",
|
||||||
|
"roleDefinition": "You are Roo, an expert technical leader operating in Architect mode. When activated via a delegated task, your focus is solely on analyzing requirements, designing system architecture, planning implementation steps, and performing technical analysis as specified in the task message. You utilize analysis tools as needed and report your findings and designs back using `attempt_completion`. You do not deviate from the delegated task scope.",
|
||||||
|
"customInstructions": "1. Do some information gathering (for example using read_file or search_files) to get more context about the task.\n\n2. You should also ask the user clarifying questions to get a better understanding of the task.\n\n3. Once you've gained more context about the user's request, you should create a detailed plan for how to accomplish the task. Include Mermaid diagrams if they help make your plan clearer.\n\n4. Ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and plan the best way to accomplish it.\n\n5. Once the user confirms the plan, ask them if they'd like you to write it to a markdown file.\n\n6. Use the switch_mode tool to request that the user switch to another mode to implement the solution.",
|
||||||
|
"groups": [
|
||||||
|
"read",
|
||||||
|
["edit", { "fileRegex": "\\.md$", "description": "Markdown files only" }],
|
||||||
|
"command",
|
||||||
|
"mcp"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"slug": "ask",
|
||||||
|
"name": "Ask",
|
||||||
|
"roleDefinition": "You are Roo, a knowledgeable technical assistant.\nWhen activated by another mode via a delegated task, your focus is to research, analyze, and provide clear, concise answers or explanations based *only* on the specific information requested in the delegation message. Use available tools for information gathering and report your findings back using `attempt_completion`.",
|
||||||
|
"customInstructions": "You can analyze code, explain concepts, and access external resources. Make sure to answer the user's questions and don't rush to switch to implementing code. Include Mermaid diagrams if they help make your response clearer.",
|
||||||
|
"groups": [
|
||||||
|
"read",
|
||||||
|
"browser",
|
||||||
|
"mcp"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"slug": "debug",
|
||||||
|
"name": "Debug",
|
||||||
|
"roleDefinition": "You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution. When activated by another mode, your task is to meticulously analyze the provided debugging request (potentially referencing Taskmaster tasks, logs, or metrics), use diagnostic tools as instructed to investigate the issue, identify the root cause, and report your findings and recommended next steps back via `attempt_completion`. You focus solely on diagnostics within the scope defined by the delegated task.",
|
||||||
|
"customInstructions": "Reflect on 5-7 different possible sources of the problem, distill those down to 1-2 most likely sources, and then add logs to validate your assumptions. Explicitly ask the user to confirm the diagnosis before fixing the problem.",
|
||||||
|
"groups": [
|
||||||
|
"read",
|
||||||
|
"edit",
|
||||||
|
"command",
|
||||||
|
"mcp"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"slug": "test",
|
||||||
|
"name": "Test",
|
||||||
|
"roleDefinition": "You are Roo, an expert software tester. Your primary focus is executing testing tasks delegated to you by other modes.\nAnalyze the provided scope and context (often referencing a Taskmaster task ID and its `testStrategy`), develop test plans if needed, execute tests diligently, and report comprehensive results (pass/fail, bugs, coverage) back using `attempt_completion`. You operate strictly within the delegated task's boundaries.",
|
||||||
|
"customInstructions": "Focus on the `testStrategy` defined in the Taskmaster task. Develop and execute test plans accordingly. Report results clearly, including pass/fail status, bug details, and coverage information.",
|
||||||
|
"groups": [
|
||||||
|
"read",
|
||||||
|
"command",
|
||||||
|
"mcp"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -16,27 +16,22 @@ In an AI-driven development process—particularly with tools like [Cursor](http
|
|||||||
8. **Clear subtasks**—remove subtasks from specified tasks to allow regeneration or restructuring.
|
8. **Clear subtasks**—remove subtasks from specified tasks to allow regeneration or restructuring.
|
||||||
9. **Show task details**—display detailed information about a specific task and its subtasks.
|
9. **Show task details**—display detailed information about a specific task and its subtasks.
|
||||||
|
|
||||||
## Configuration
|
## Configuration (Updated)
|
||||||
|
|
||||||
The script can be configured through environment variables in a `.env` file at the root of the project:
|
Task Master configuration is now managed through two primary methods:
|
||||||
|
|
||||||
### Required Configuration
|
1. **`.taskmaster/config.json` File (Project Root - Primary)**
|
||||||
|
|
||||||
- `ANTHROPIC_API_KEY`: Your Anthropic API key for Claude
|
- Stores AI model selections (`main`, `research`, `fallback`), model parameters (`maxTokens`, `temperature`), `logLevel`, `defaultSubtasks`, `defaultPriority`, `projectName`, etc.
|
||||||
|
- Managed using the `task-master models --setup` command or the `models` MCP tool.
|
||||||
|
- This is the main configuration file for most settings.
|
||||||
|
|
||||||
### Optional Configuration
|
2. **Environment Variables (`.env` File - API Keys Only)**
|
||||||
|
- Used **only** for sensitive **API Keys** (e.g., `ANTHROPIC_API_KEY`, `PERPLEXITY_API_KEY`).
|
||||||
|
- Create a `.env` file in your project root for CLI usage.
|
||||||
|
- See `assets/env.example` for required key names.
|
||||||
|
|
||||||
- `MODEL`: Specify which Claude model to use (default: "claude-3-7-sonnet-20250219")
|
**Important:** Settings like `MODEL`, `MAX_TOKENS`, `TEMPERATURE`, `TASKMASTER_LOG_LEVEL`, etc., are **no longer set via `.env`**. Use `task-master models --setup` instead.
|
||||||
- `MAX_TOKENS`: Maximum tokens for model responses (default: 4000)
|
|
||||||
- `TEMPERATURE`: Temperature for model responses (default: 0.7)
|
|
||||||
- `PERPLEXITY_API_KEY`: Your Perplexity API key for research-backed subtask generation
|
|
||||||
- `PERPLEXITY_MODEL`: Specify which Perplexity model to use (default: "sonar-medium-online")
|
|
||||||
- `DEBUG`: Enable debug logging (default: false)
|
|
||||||
- `LOG_LEVEL`: Log level - debug, info, warn, error (default: info)
|
|
||||||
- `DEFAULT_SUBTASKS`: Default number of subtasks when expanding (default: 3)
|
|
||||||
- `DEFAULT_PRIORITY`: Default priority for generated tasks (default: medium)
|
|
||||||
- `PROJECT_NAME`: Override default project name in tasks.json
|
|
||||||
- `PROJECT_VERSION`: Override default version in tasks.json
|
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
@@ -194,25 +189,18 @@ Notes:
|
|||||||
- Can be combined with the `expand` command to immediately generate new subtasks
|
- Can be combined with the `expand` command to immediately generate new subtasks
|
||||||
- Works with both parent tasks and individual subtasks
|
- Works with both parent tasks and individual subtasks
|
||||||
|
|
||||||
## AI Integration
|
## AI Integration (Updated)
|
||||||
|
|
||||||
The script integrates with two AI services:
|
- The script now uses a unified AI service layer (`ai-services-unified.js`).
|
||||||
|
- 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`).
|
||||||
1. **Anthropic Claude**: Used for parsing PRDs, generating tasks, and creating subtasks.
|
- API keys are automatically resolved from your `.env` file (for CLI) or MCP session environment.
|
||||||
2. **Perplexity AI**: Used for research-backed subtask generation when the `--research` flag is specified.
|
- To use the research capabilities (e.g., `expand --research`), ensure you have:
|
||||||
|
1. Configured a model for the `research` role using `task-master models --setup` (Perplexity models are recommended).
|
||||||
The Perplexity integration uses the OpenAI client to connect to Perplexity's API, which provides enhanced research capabilities for generating more informed subtasks. If the Perplexity API is unavailable or encounters an error, the script will automatically fall back to using Anthropic's Claude.
|
2. Added the corresponding API key (e.g., `PERPLEXITY_API_KEY`) to your `.env` file.
|
||||||
|
|
||||||
To use the Perplexity integration:
|
|
||||||
|
|
||||||
1. Obtain a Perplexity API key
|
|
||||||
2. Add `PERPLEXITY_API_KEY` to your `.env` file
|
|
||||||
3. Optionally specify `PERPLEXITY_MODEL` in your `.env` file (default: "sonar-medium-online")
|
|
||||||
4. Use the `--research` flag with the `expand` command
|
|
||||||
|
|
||||||
## Logging
|
## Logging
|
||||||
|
|
||||||
The script supports different logging levels controlled by the `LOG_LEVEL` environment variable:
|
The script supports different logging levels controlled by the `TASKMASTER_LOG_LEVEL` environment variable:
|
||||||
|
|
||||||
- `debug`: Detailed information, typically useful for troubleshooting
|
- `debug`: Detailed information, typically useful for troubleshooting
|
||||||
- `info`: Confirmation that things are working as expected (default)
|
- `info`: Confirmation that things are working as expected (default)
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Claude Task Master Init
|
|
||||||
* Direct executable for the init command
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { spawn } from 'child_process';
|
|
||||||
import { fileURLToPath } from 'url';
|
|
||||||
import { dirname, resolve } from 'path';
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
|
||||||
const __dirname = dirname(__filename);
|
|
||||||
|
|
||||||
// Get the path to the init script
|
|
||||||
const initScriptPath = resolve(__dirname, '../scripts/init.js');
|
|
||||||
|
|
||||||
// Pass through all arguments
|
|
||||||
const args = process.argv.slice(2);
|
|
||||||
|
|
||||||
// Spawn the init script with all arguments
|
|
||||||
const child = spawn('node', [initScriptPath, ...args], {
|
|
||||||
stdio: 'inherit',
|
|
||||||
cwd: process.cwd()
|
|
||||||
});
|
|
||||||
|
|
||||||
// Handle exit
|
|
||||||
child.on('close', (code) => {
|
|
||||||
process.exit(code);
|
|
||||||
});
|
|
||||||
@@ -225,47 +225,47 @@ function createDevScriptAction(commandName) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special case for the 'init' command which uses a different script
|
// // Special case for the 'init' command which uses a different script
|
||||||
function registerInitCommand(program) {
|
// function registerInitCommand(program) {
|
||||||
program
|
// program
|
||||||
.command('init')
|
// .command('init')
|
||||||
.description('Initialize a new project')
|
// .description('Initialize a new project')
|
||||||
.option('-y, --yes', 'Skip prompts and use default values')
|
// .option('-y, --yes', 'Skip prompts and use default values')
|
||||||
.option('-n, --name <name>', 'Project name')
|
// .option('-n, --name <name>', 'Project name')
|
||||||
.option('-d, --description <description>', 'Project description')
|
// .option('-d, --description <description>', 'Project description')
|
||||||
.option('-v, --version <version>', 'Project version')
|
// .option('-v, --version <version>', 'Project version')
|
||||||
.option('-a, --author <author>', 'Author name')
|
// .option('-a, --author <author>', 'Author name')
|
||||||
.option('--skip-install', 'Skip installing dependencies')
|
// .option('--skip-install', 'Skip installing dependencies')
|
||||||
.option('--dry-run', 'Show what would be done without making changes')
|
// .option('--dry-run', 'Show what would be done without making changes')
|
||||||
.action((options) => {
|
// .action((options) => {
|
||||||
// Pass through any options to the init script
|
// // Pass through any options to the init script
|
||||||
const args = [
|
// const args = [
|
||||||
'--yes',
|
// '--yes',
|
||||||
'name',
|
// 'name',
|
||||||
'description',
|
// 'description',
|
||||||
'version',
|
// 'version',
|
||||||
'author',
|
// 'author',
|
||||||
'skip-install',
|
// 'skip-install',
|
||||||
'dry-run'
|
// 'dry-run'
|
||||||
]
|
// ]
|
||||||
.filter((opt) => options[opt])
|
// .filter((opt) => options[opt])
|
||||||
.map((opt) => {
|
// .map((opt) => {
|
||||||
if (opt === 'yes' || opt === 'skip-install' || opt === 'dry-run') {
|
// if (opt === 'yes' || opt === 'skip-install' || opt === 'dry-run') {
|
||||||
return `--${opt}`;
|
// return `--${opt}`;
|
||||||
}
|
// }
|
||||||
return `--${opt}=${options[opt]}`;
|
// return `--${opt}=${options[opt]}`;
|
||||||
});
|
// });
|
||||||
|
|
||||||
const child = spawn('node', [initScriptPath, ...args], {
|
// const child = spawn('node', [initScriptPath, ...args], {
|
||||||
stdio: 'inherit',
|
// stdio: 'inherit',
|
||||||
cwd: process.cwd()
|
// cwd: process.cwd()
|
||||||
});
|
// });
|
||||||
|
|
||||||
child.on('close', (code) => {
|
// child.on('close', (code) => {
|
||||||
process.exit(code);
|
// process.exit(code);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Set up the command-line interface
|
// Set up the command-line interface
|
||||||
const program = new Command();
|
const program = new Command();
|
||||||
@@ -286,8 +286,8 @@ program.on('--help', () => {
|
|||||||
displayHelp();
|
displayHelp();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add special case commands
|
// // Add special case commands
|
||||||
registerInitCommand(program);
|
// registerInitCommand(program);
|
||||||
|
|
||||||
program
|
program
|
||||||
.command('dev')
|
.command('dev')
|
||||||
@@ -303,7 +303,7 @@ registerCommands(tempProgram);
|
|||||||
|
|
||||||
// For each command in the temp instance, add a modified version to our actual program
|
// For each command in the temp instance, add a modified version to our actual program
|
||||||
tempProgram.commands.forEach((cmd) => {
|
tempProgram.commands.forEach((cmd) => {
|
||||||
if (['init', 'dev'].includes(cmd.name())) {
|
if (['dev'].includes(cmd.name())) {
|
||||||
// Skip commands we've already defined specially
|
// Skip commands we've already defined specially
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
50
biome.json
Normal file
50
biome.json
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"files": {
|
||||||
|
"ignore": [
|
||||||
|
"build",
|
||||||
|
"coverage",
|
||||||
|
".changeset",
|
||||||
|
"tasks",
|
||||||
|
"package-lock.json",
|
||||||
|
"tests/fixture/*.json"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"formatter": {
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"enabled": true,
|
||||||
|
"indentStyle": "tab",
|
||||||
|
"lineWidth": 80
|
||||||
|
},
|
||||||
|
"javascript": {
|
||||||
|
"formatter": {
|
||||||
|
"arrowParentheses": "always",
|
||||||
|
"quoteStyle": "single",
|
||||||
|
"trailingCommas": "none"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"linter": {
|
||||||
|
"rules": {
|
||||||
|
"complexity": {
|
||||||
|
"noForEach": "off",
|
||||||
|
"useOptionalChain": "off",
|
||||||
|
"useArrowFunction": "off"
|
||||||
|
},
|
||||||
|
"correctness": {
|
||||||
|
"noConstantCondition": "off",
|
||||||
|
"noUnreachable": "off"
|
||||||
|
},
|
||||||
|
"suspicious": {
|
||||||
|
"noDuplicateTestHooks": "off",
|
||||||
|
"noPrototypeBuiltins": "off"
|
||||||
|
},
|
||||||
|
"style": {
|
||||||
|
"noUselessElse": "off",
|
||||||
|
"useNodejsImportProtocol": "off",
|
||||||
|
"useNumberNamespace": "off",
|
||||||
|
"noParameterAssign": "off",
|
||||||
|
"useTemplate": "off",
|
||||||
|
"noUnusedTemplateLiteral": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1798
context/chats/add-task-dependencies-1.md
Normal file
1798
context/chats/add-task-dependencies-1.md
Normal file
File diff suppressed because it is too large
Load Diff
368
context/chats/max-min-tokens.txt.md
Normal file
368
context/chats/max-min-tokens.txt.md
Normal file
@@ -0,0 +1,368 @@
|
|||||||
|
We want to refine how Task Master handles AI model token limits to be more precise, by:
|
||||||
|
|
||||||
|
1. Distinguishing between `maxInputTokens` and `maxOutputTokens` in the configuration.
|
||||||
|
2. Dynamically adjusting the `maxOutputTokens` for an API call based on the actual prompt length to stay within the model's total context window (or respecting separate input/output limits if the API and model support that).
|
||||||
|
3. Ensuring that `ai-services-unified.js` uses these more granular limits.
|
||||||
|
|
||||||
|
This is a good improvement for both cost control and preventing errors.
|
||||||
|
|
||||||
|
Here's a plan:
|
||||||
|
|
||||||
|
**Phase 1: Configuration and Core Logic Updates**
|
||||||
|
|
||||||
|
1. **Update `.taskmasterconfig` Structure:**
|
||||||
|
- I'll modify the `models` section in your `.taskmasterconfig`. For each role (`main`, `research`, `fallback`), `maxTokens` will be replaced with `maxInputTokens` and `maxOutputTokens`.
|
||||||
|
- We'll need to decide on reasonable default values for these new fields. We can look at the current `maxTokens` and the model's known limits to make an initial guess.
|
||||||
|
2. **Update `MODEL_MAP` in `ai-services-unified.js`:**
|
||||||
|
- This array already stores cost data. We need to ensure it also stores the _absolute_ maximum input and output tokens for each model listed (e.g., `model_max_input_tokens`, `model_max_output_tokens`). If these fields are not present, they will need to be added. The values in `.taskmasterconfig` will then represent user-defined operational limits, which should ideally be validated against these absolute maximums.
|
||||||
|
3. **Update `config-manager.js`:**
|
||||||
|
- Getter functions like `getParametersForRole` will be updated to fetch `maxInputTokens` and `maxOutputTokens` instead of the singular `maxTokens`.
|
||||||
|
- New getters might be needed if we want to access the model's absolute limits directly from `MODEL_MAP` via `config-manager.js`.
|
||||||
|
4. **Update `ai-services-unified.js` (`_unifiedServiceRunner`):**
|
||||||
|
- **Token Counting:** This is a crucial step. Before an API call, we need to estimate the token count of the combined `systemPrompt` and `userPrompt`.
|
||||||
|
- The Vercel AI SDK or the individual provider SDKs might offer utilities for this. For example, some SDKs expose a `tokenizer` or a way to count tokens for a given string.
|
||||||
|
- If a direct utility isn't available through the Vercel SDK for the specific provider, we might need to use a library like `tiktoken` for OpenAI/Anthropic models or investigate provider-specific tokenization. This could be complex as tokenization varies between models.
|
||||||
|
- For now, let's assume we can get a reasonable estimate.
|
||||||
|
- **Dynamic Output Token Calculation & Validation:**
|
||||||
|
- Retrieve `configured_max_input_tokens` and `configured_max_output_tokens` from `config-manager.js` for the current role.
|
||||||
|
- Retrieve `model_absolute_max_input_tokens` and `model_absolute_max_output_tokens` from `MODEL_MAP`.
|
||||||
|
- Let `prompt_tokens = countTokens(systemPrompt + userPrompt)`.
|
||||||
|
- **Input Validation:** If `prompt_tokens > configured_max_input_tokens` OR `prompt_tokens > model_absolute_max_input_tokens`, throw an error. (We might also consider auto-truncation strategies in the future, but an error is safer to start).
|
||||||
|
- **Output Calculation:** The `max_tokens` parameter sent to the API (which typically refers to the _max number of tokens to generate_) should be `configured_max_output_tokens`. We also need to ensure this doesn't violate the model's absolute output limit.
|
||||||
|
- Some models have a _total_ context window (input + output). If this is the case for a model, the `max_tokens` parameter for the API call might need to be `min(configured_max_output_tokens, model_absolute_total_tokens - prompt_tokens)`. However, many modern APIs handle separate input and output limits, simplifying this. We'll aim to pass `configured_max_output_tokens` as the API's `max_tokens` parameter, assuming the input validation has passed.
|
||||||
|
- **API Call Parameter:** Update the `callParams` to use the correctly determined `max_tokens` for generation (which will be our `configured_max_output_tokens`).
|
||||||
|
|
||||||
|
**Phase 2: Error Handling and Refinements**
|
||||||
|
|
||||||
|
1. **Enhanced Error Handling:** Provide clear error messages if prompt tokens exceed input limits, or if API calls fail due to token issues despite our calculations.
|
||||||
|
2. **Validation:** Add validation (perhaps in `config-manager.js` or when `task-master models --setup` is run) to ensure `configured_max_input_tokens` and `configured_max_output_tokens` in `.taskmasterconfig` do not exceed the `model_absolute_max_input_tokens` and `model_absolute_max_output_tokens` from `MODEL_MAP`.
|
||||||
|
|
||||||
|
Let's start by inspecting `scripts/modules/config-manager.js` to see how parameters and `MODEL_MAP` are currently handled. This will inform the changes needed for `.taskmasterconfig` and `ai-services-unified.js`.
|
||||||
|
|
||||||
|
I will now read `scripts/modules/config-manager.js`.
|
||||||
|
|
||||||
|
Okay, I've reviewed `scripts/modules/config-manager.js`. Here's what I've gathered and how it impacts the plan:
|
||||||
|
|
||||||
|
- **`MODEL_MAP` Source:** `MODEL_MAP` is loaded from `supported-models.json`. This is excellent, as it means we can update the model capabilities (including new token limits) in a structured JSON file.
|
||||||
|
- **Configuration Loading:** `_loadAndValidateConfig` handles loading `.taskmasterconfig` and merging it with `DEFAULTS`.
|
||||||
|
- **Getters:** There are specific getters for `maxTokens` for each role (e.g., `getMainMaxTokens`). We will need to update these.
|
||||||
|
- **`getParametersForRole`:** This function already exists and is a good candidate for returning the new `maxInputTokens` and `maxOutputTokens`.
|
||||||
|
|
||||||
|
Here's the refined plan:
|
||||||
|
|
||||||
|
**Phase 1: Configuration and Data Structures**
|
||||||
|
|
||||||
|
1. **Update `supported-models.json`:**
|
||||||
|
|
||||||
|
- For each model entry in `supported-models.json`, we need to add `maxInputTokens` and `maxOutputTokens` fields. These should reflect the _absolute maximums_ for that specific model.
|
||||||
|
- Example entry change:
|
||||||
|
|
||||||
|
```json
|
||||||
|
// Before
|
||||||
|
{
|
||||||
|
"id": "claude-3-7-sonnet-20250219",
|
||||||
|
"name": "Claude 3.7 Sonnet (Preview)",
|
||||||
|
"context_window": 200000, // This might be total context
|
||||||
|
"cost_per_1m_tokens": { "input": 3, "output": 15, "currency": "USD" }
|
||||||
|
}
|
||||||
|
|
||||||
|
// After (assuming 200k is total, and we make a reasonable split or find official numbers)
|
||||||
|
{
|
||||||
|
"id": "claude-3-7-sonnet-20250219",
|
||||||
|
"name": "Claude 3.7 Sonnet (Preview)",
|
||||||
|
"maxInputTokens": 190000, // Example
|
||||||
|
"maxOutputTokens": 8192, // Example, often smaller for generation
|
||||||
|
"cost_per_1m_tokens": { "input": 3, "output": 15, "currency": "USD" }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- I will need to find the official input/output token limits for the models currently in your `MODEL_MAP`. If you have this information handy, it would speed things up. Otherwise, I can make educated guesses or search for them.
|
||||||
|
|
||||||
|
2. **Update `.taskmasterconfig` (Defaults and User File):**
|
||||||
|
- In `scripts/modules/config-manager.js`, modify the `DEFAULTS` object. For each role (`main`, `research`, `fallback`), replace `maxTokens` with:
|
||||||
|
- `maxInputTokens`: A sensible default (e.g., a large portion of the model's capability, but user-configurable).
|
||||||
|
- `maxOutputTokens`: A sensible default for generation (e.g., 4096 or 8192).
|
||||||
|
- You will then need to manually update your existing `.taskmasterconfig` file to reflect this new structure. I can provide the snippet for you to paste.
|
||||||
|
3. **Update `config-manager.js`:**
|
||||||
|
- Modify `getParametersForRole(role, explicitRoot = null)`:
|
||||||
|
- It currently fetches `maxTokens` and `temperature`.
|
||||||
|
- Update it to fetch `maxInputTokens`, `maxOutputTokens`, and `temperature` from the loaded config for the given role.
|
||||||
|
- Remove the role-specific `getMaxTokens` functions (e.g., `getMainMaxTokens`, `getResearchMaxTokens`, `getFallbackMaxTokens`). The `getParametersForRole` will be the central way to get these.
|
||||||
|
- (Optional, for later validation) Consider adding a new function `getModelCapabilities(providerName, modelId)` that reads from `MODEL_MAP` to return the absolute `maxInputTokens` and `maxOutputTokens` for a given model. This would be useful for validating the user's settings in `.taskmasterconfig`.
|
||||||
|
|
||||||
|
**Phase 2: Core Logic in `ai-services-unified.js`**
|
||||||
|
|
||||||
|
1. **Token Counting (`_unifiedServiceRunner`):**
|
||||||
|
|
||||||
|
- This is the most complex part. We need a reliable way to count tokens for the prompts.
|
||||||
|
- **Strategy 1 (Ideal):** Leverage Vercel AI SDK. The SDK might provide a way to get a tokenizer for the active model or a utility function. We'll need to investigate its capabilities.
|
||||||
|
- **Strategy 2 (Fallback):** Use a library like `tiktoken` for models compatible with OpenAI's tokenization (many are, including some Anthropic models). For other models, we might need provider-specific tokenizers or make estimations (less ideal).
|
||||||
|
- **Initial Approach:** Let's try to find a Vercel AI SDK utility first. If not, we'll start with `tiktoken` as a common case and acknowledge that other models might need specific handling later.
|
||||||
|
- The function `_unifiedServiceRunner` will call this token counting utility:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Placeholder for token counting
|
||||||
|
function countTokens(text, modelId /* or providerName */) {
|
||||||
|
// ... implementation using SDK or library ...
|
||||||
|
// This is a simplification; actual tokenization is model-specific.
|
||||||
|
// For now, a rough estimate might be (text.length / 4) as a placeholder
|
||||||
|
// if a proper tokenizer isn't immediately available.
|
||||||
|
if (!text) return 0;
|
||||||
|
return Math.ceil(text.length / 3.5); // Very rough general estimate
|
||||||
|
}
|
||||||
|
|
||||||
|
const promptTokens = countTokens(systemPrompt) + countTokens(prompt);
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Dynamic Output Token Calculation & Validation (`_unifiedServiceRunner`):**
|
||||||
|
|
||||||
|
- Fetch parameters using the updated `getParametersForRole` from `config-manager.js`:
|
||||||
|
```javascript
|
||||||
|
const roleParams = getParametersForRole(
|
||||||
|
currentRole,
|
||||||
|
effectiveProjectRoot
|
||||||
|
);
|
||||||
|
// roleParams will now contain { maxInputTokens, maxOutputTokens, temperature }
|
||||||
|
```
|
||||||
|
- Fetch model's absolute limits from `MODEL_MAP` (we'll need a helper in `config-manager.js` or do it directly in `ai-services-unified.js` for now):
|
||||||
|
```javascript
|
||||||
|
// Simplified; ideally use a robust getter from config-manager
|
||||||
|
const modelInfo = MODEL_MAP[providerName?.toLowerCase()]?.find(
|
||||||
|
(m) => m.id === modelId
|
||||||
|
);
|
||||||
|
const modelAbsoluteMaxInput = modelInfo?.maxInputTokens || Infinity;
|
||||||
|
const modelAbsoluteMaxOutput =
|
||||||
|
modelInfo?.maxOutputTokens || roleParams.maxOutputTokens; // Fallback to configured if not in map
|
||||||
|
```
|
||||||
|
- **Input Validation:**
|
||||||
|
```javascript
|
||||||
|
if (promptTokens > roleParams.maxInputTokens) {
|
||||||
|
throw new Error(
|
||||||
|
`Prompt (${promptTokens} tokens) exceeds configured max input tokens (${roleParams.maxInputTokens}) for role '${currentRole}'.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (promptTokens > modelAbsoluteMaxInput) {
|
||||||
|
throw new Error(
|
||||||
|
`Prompt (${promptTokens} tokens) exceeds model's absolute max input tokens (${modelAbsoluteMaxInput}) for ${modelId}.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
- **API Call Parameter (`max_tokens` for generation):**
|
||||||
|
The `max_tokens` parameter passed to the provider's API call should be `roleParams.maxOutputTokens`. We must also ensure this doesn't exceed the model's absolute output capability.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const apiMaxOutputTokens = Math.min(
|
||||||
|
roleParams.maxOutputTokens,
|
||||||
|
modelAbsoluteMaxOutput
|
||||||
|
);
|
||||||
|
|
||||||
|
const callParams = {
|
||||||
|
apiKey,
|
||||||
|
modelId,
|
||||||
|
// Use apiMaxOutputTokens for the actual API call
|
||||||
|
maxTokens: apiMaxOutputTokens, // This usually means max tokens to GENERATE
|
||||||
|
temperature: roleParams.temperature,
|
||||||
|
messages,
|
||||||
|
baseUrl,
|
||||||
|
...(serviceType === 'generateObject' && { schema, objectName }),
|
||||||
|
...restApiParams
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Update `logAiUsage`:**
|
||||||
|
- The cost calculation in `logAiUsage` seems correct as it already uses `inputCost` and `outputCost` per 1M tokens. This part should remain compatible.
|
||||||
|
|
||||||
|
**Next Steps:**
|
||||||
|
|
||||||
|
1. **Modify `supported-models.json`:** I need the content of this file to propose the new `maxInputTokens` and `maxOutputTokens` fields. Please provide it.
|
||||||
|
2. **Decide on Tokenizer Strategy:** What are your thoughts on the token counting? Are you aware of any utilities within Vercel AI SDK for this, or should we plan to integrate `tiktoken` initially?
|
||||||
|
|
||||||
|
Once I have the content of `supported-models.json`, I can draft the changes for it and then proceed to `config-manager.js` and `.taskmasterconfig`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
// Before
|
||||||
|
{
|
||||||
|
"id": "claude-3-7-sonnet-20250219",
|
||||||
|
"name": "Claude 3.7 Sonnet (Preview)",
|
||||||
|
"context_window": 200000, // This might be total context
|
||||||
|
"cost_per_1m_tokens": { "input": 3, "output": 15, "currency": "USD" }
|
||||||
|
}
|
||||||
|
|
||||||
|
// After (assuming 200k is total, and we make a reasonable split or find official numbers)
|
||||||
|
{
|
||||||
|
"id": "claude-3-7-sonnet-20250219",
|
||||||
|
"name": "Claude 3.7 Sonnet (Preview)",
|
||||||
|
"maxInputTokens": 190000, // Example
|
||||||
|
"maxOutputTokens": 8192, // Example, often smaller for generation
|
||||||
|
"cost_per_1m_tokens": { "input": 3, "output": 15, "currency": "USD" }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Placeholder for token counting
|
||||||
|
function countTokens(text, modelId /* or providerName */) {
|
||||||
|
// ... implementation using SDK or library ...
|
||||||
|
// This is a simplification; actual tokenization is model-specific.
|
||||||
|
// For now, a rough estimate might be (text.length / 4) as a placeholder
|
||||||
|
// if a proper tokenizer isn't immediately available.
|
||||||
|
if (!text) return 0;
|
||||||
|
return Math.ceil(text.length / 3.5); // Very rough general estimate
|
||||||
|
}
|
||||||
|
|
||||||
|
const promptTokens = countTokens(systemPrompt) + countTokens(prompt);
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const roleParams = getParametersForRole(currentRole, effectiveProjectRoot);
|
||||||
|
// roleParams will now contain { maxInputTokens, maxOutputTokens, temperature }
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Simplified; ideally use a robust getter from config-manager
|
||||||
|
const modelInfo = MODEL_MAP[providerName?.toLowerCase()]?.find(
|
||||||
|
(m) => m.id === modelId
|
||||||
|
);
|
||||||
|
const modelAbsoluteMaxInput = modelInfo?.maxInputTokens || Infinity;
|
||||||
|
const modelAbsoluteMaxOutput =
|
||||||
|
modelInfo?.maxOutputTokens || roleParams.maxOutputTokens; // Fallback to configured if not in map
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
if (promptTokens > roleParams.maxInputTokens) {
|
||||||
|
throw new Error(
|
||||||
|
`Prompt (${promptTokens} tokens) exceeds configured max input tokens (${roleParams.maxInputTokens}) for role '${currentRole}'.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (promptTokens > modelAbsoluteMaxInput) {
|
||||||
|
throw new Error(
|
||||||
|
`Prompt (${promptTokens} tokens) exceeds model's absolute max input tokens (${modelAbsoluteMaxInput}) for ${modelId}.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const apiMaxOutputTokens = Math.min(
|
||||||
|
roleParams.maxOutputTokens,
|
||||||
|
modelAbsoluteMaxOutput
|
||||||
|
);
|
||||||
|
|
||||||
|
const callParams = {
|
||||||
|
apiKey,
|
||||||
|
modelId,
|
||||||
|
// Use apiMaxOutputTokens for the actual API call
|
||||||
|
maxTokens: apiMaxOutputTokens, // This usually means max tokens to GENERATE
|
||||||
|
temperature: roleParams.temperature,
|
||||||
|
messages,
|
||||||
|
baseUrl,
|
||||||
|
...(serviceType === 'generateObject' && { schema, objectName }),
|
||||||
|
...restApiParams
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
Okay, I have the contents of `supported-models.json`.
|
||||||
|
|
||||||
|
It seems many models have a `max_tokens` field, which I assume is the _total context window_. Some don't have it, and for others (like OpenAI `gpt-4o`), the listed `max_tokens` (16384) is known to be its _output_ token limit when using the Chat Completions API, while the context window is much larger (128k). This highlights the complexity: `max_tokens` in `supported-models.json` is used inconsistently.
|
||||||
|
|
||||||
|
**Revised Plan for `supported-models.json` and Token Definitions:**
|
||||||
|
|
||||||
|
To bring clarity, we'll introduce two new fields and ensure their meaning is consistent:
|
||||||
|
|
||||||
|
- `contextWindowTokens`: The total number of tokens the model can process (input + output). This would replace the current ambiguous `max_tokens`.
|
||||||
|
- `maxOutputTokens`: The maximum number of tokens the model can _generate_ in a single response. This is often smaller than the total context window, especially for larger models.
|
||||||
|
|
||||||
|
If a model _only_ specifies a total context window, we'll have to make a reasonable assumption for `maxOutputTokens` (e.g., 4096 or 8192, or a fraction of the total context window). If it only specifies an output token limit (like some OpenAI models in certain API modes), we'll need to find its total context window.
|
||||||
|
|
||||||
|
**Updated `supported-models.json` Structure (Example):**
|
||||||
|
|
||||||
|
```json
|
||||||
|
// For a model like Anthropic Claude 3.7 Sonnet (Preview)
|
||||||
|
{
|
||||||
|
"id": "claude-3-7-sonnet-20250219",
|
||||||
|
"swe_score": 0.623,
|
||||||
|
"cost_per_1m_tokens": { "input": 3.0, "output": 15.0 },
|
||||||
|
"allowed_roles": ["main", "fallback"],
|
||||||
|
"contextWindowTokens": 200000, // From Anthropic's documentation
|
||||||
|
"maxOutputTokens": 8192 // Anthropic default, user can override in .taskmasterconfig
|
||||||
|
}
|
||||||
|
|
||||||
|
// For a model like OpenAI GPT-4o
|
||||||
|
{
|
||||||
|
"id": "gpt-4o",
|
||||||
|
"swe_score": 0.332,
|
||||||
|
"cost_per_1m_tokens": { "input": 2.5, "output": 10.0 },
|
||||||
|
"allowed_roles": ["main", "fallback"],
|
||||||
|
"contextWindowTokens": 128000, // Official context window
|
||||||
|
"maxOutputTokens": 16384 // Max output for chat completions is 16k for gpt-4o (used to be 4k/8k for older gpt-4)
|
||||||
|
// but the model card mentions 128k total. The API call parameter for `max_tokens` sets this output cap.
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
I will proceed to generate the updated `supported-models.json` content. This will be a significant change. I will make my best effort to find the correct `contextWindowTokens` and `maxOutputTokens` for each model. If official numbers are ambiguous or not readily available, I'll use sensible defaults and add a comment.
|
||||||
|
|
||||||
|
**Regarding Tokenizer Strategy:**
|
||||||
|
|
||||||
|
- **Vercel AI SDK:** The `ai` package (Vercel AI SDK) itself is a lightweight wrapper. Tokenization is usually handled by the underlying provider-specific SDKs (e.g., `@anthropic-ai/sdk`, `openai`). The Vercel SDK doesn't provide a universal tokenizer.
|
||||||
|
- **Provider SDKs:**
|
||||||
|
- `@anthropic-ai/sdk`: Does not expose a public tokenizer directly. Anthropic recommends counting based on their guidelines (roughly 3.5 chars/token for English).
|
||||||
|
- `openai` (for Node.js): The `gpt-3-encoder` or `tiktoken` libraries are commonly used. `tiktoken` is more current.
|
||||||
|
- **`tiktoken`:** This is a good general-purpose library for OpenAI models and those that use compatible tokenization (many models fine-tuned from Llama, etc., might be close). It supports various encodings.
|
||||||
|
- **Recommendation:**
|
||||||
|
1. Start by integrating `tiktoken`. We can select the encoding based on the provider or even specific model if needed (e.g., `cl100k_base` for gpt-4, gpt-3.5-turbo, DALL-E models).
|
||||||
|
2. For providers where `tiktoken` is not accurate (e.g., Google's Gemini, Perplexity if they have proprietary tokenizers), we might have to rely on character-based estimations (e.g., `length / N`) as a rougher guide or investigate if their specific SDKs offer token counting.
|
||||||
|
3. The Vercel AI SDK's `experimental_streamObject` and other functions _might_ internally handle some aspects of token counting for request preparation, but we need explicit counting for our logic _before_ the call.
|
||||||
|
|
||||||
|
For now, let's assume we'll add a `countTokens` utility that uses `tiktoken` for OpenAI and Anthropic (as Anthropic's guidance is character-based but `cl100k_base` is often a decent proxy for their tokenization for rough estimates, though not perfect), and a character-based fallback for others.
|
||||||
|
|
||||||
|
I will now generate the proposed changes for `scripts/modules/supported-models.json`. This will be a large diff.
|
||||||
|
|
||||||
|
After this, we'll move to:
|
||||||
|
|
||||||
|
1. Updating `.taskmasterconfig` defaults in `config-manager.js` and providing you the snippet for your user file.
|
||||||
|
2. Updating `config-manager.js` getters.
|
||||||
|
3. Implementing the logic in `ai-services-unified.js`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
// For a model like Anthropic Claude 3.7 Sonnet (Preview)
|
||||||
|
{
|
||||||
|
"id": "claude-3-7-sonnet-20250219",
|
||||||
|
"swe_score": 0.623,
|
||||||
|
"cost_per_1m_tokens": { "input": 3.0, "output": 15.0 },
|
||||||
|
"allowed_roles": ["main", "fallback"],
|
||||||
|
"contextWindowTokens": 200000, // From Anthropic's documentation
|
||||||
|
"maxOutputTokens": 8192 // Anthropic default, user can override in .taskmasterconfig
|
||||||
|
}
|
||||||
|
|
||||||
|
// For a model like OpenAI GPT-4o
|
||||||
|
{
|
||||||
|
"id": "gpt-4o",
|
||||||
|
"swe_score": 0.332,
|
||||||
|
"cost_per_1m_tokens": { "input": 2.5, "output": 10.0 },
|
||||||
|
"allowed_roles": ["main", "fallback"],
|
||||||
|
"contextWindowTokens": 128000, // Official context window
|
||||||
|
"maxOutputTokens": 16384 // Max output for chat completions is 16k for gpt-4o (used to be 4k/8k for older gpt-4)
|
||||||
|
// but the model card mentions 128k total. The API call parameter for `max_tokens` sets this output cap.
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
|
// For a model like Anthropic Claude 3.7 Sonnet (Preview)
|
||||||
|
{
|
||||||
|
"id": "claude-3-7-sonnet-20250219",
|
||||||
|
"swe_score": 0.623,
|
||||||
|
"cost_per_1m_tokens": { "input": 3.0, "output": 15.0 },
|
||||||
|
"allowed_roles": ["main", "fallback"],
|
||||||
|
"contextWindowTokens": 200000, // From Anthropic's documentation
|
||||||
|
"maxOutputTokens": 8192 // Anthropic default, user can override in .taskmasterconfig
|
||||||
|
}
|
||||||
|
|
||||||
|
// For a model like OpenAI GPT-4o
|
||||||
|
{
|
||||||
|
"id": "gpt-4o",
|
||||||
|
"swe_score": 0.332,
|
||||||
|
"cost_per_1m_tokens": { "input": 2.5, "output": 10.0 },
|
||||||
|
"allowed_roles": ["main", "fallback"],
|
||||||
|
"contextWindowTokens": 128000, // Official context window
|
||||||
|
"maxOutputTokens": 16384 // Max output for chat completions is 16k for gpt-4o (used to be 4k/8k for older gpt-4)
|
||||||
|
// but the model card mentions 128k total. The API call parameter for `max_tokens` sets this output cap.
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -9,7 +9,7 @@ Welcome to the Task Master documentation. Use the links below to navigate to the
|
|||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
- [Command Reference](command-reference.md) - Complete list of all available commands
|
- [Command Reference](command-reference.md) - Complete list of all available commands (including research and multi-task viewing)
|
||||||
- [Task Structure](task-structure.md) - Understanding the task format and features
|
- [Task Structure](task-structure.md) - Understanding the task format and features
|
||||||
|
|
||||||
## Examples & Licensing
|
## Examples & Licensing
|
||||||
|
|||||||
@@ -1,257 +0,0 @@
|
|||||||
# AI Client Utilities for MCP Tools
|
|
||||||
|
|
||||||
This document provides examples of how to use the new AI client utilities with AsyncOperationManager in MCP tools.
|
|
||||||
|
|
||||||
## Basic Usage with Direct Functions
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// In your direct function implementation:
|
|
||||||
import {
|
|
||||||
getAnthropicClientForMCP,
|
|
||||||
getModelConfig,
|
|
||||||
handleClaudeError
|
|
||||||
} from '../utils/ai-client-utils.js';
|
|
||||||
|
|
||||||
export async function someAiOperationDirect(args, log, context) {
|
|
||||||
try {
|
|
||||||
// Initialize Anthropic client with session from context
|
|
||||||
const client = getAnthropicClientForMCP(context.session, log);
|
|
||||||
|
|
||||||
// Get model configuration with defaults or session overrides
|
|
||||||
const modelConfig = getModelConfig(context.session);
|
|
||||||
|
|
||||||
// Make API call with proper error handling
|
|
||||||
try {
|
|
||||||
const response = await client.messages.create({
|
|
||||||
model: modelConfig.model,
|
|
||||||
max_tokens: modelConfig.maxTokens,
|
|
||||||
temperature: modelConfig.temperature,
|
|
||||||
messages: [{ role: 'user', content: 'Your prompt here' }]
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
success: true,
|
|
||||||
data: response
|
|
||||||
};
|
|
||||||
} catch (apiError) {
|
|
||||||
// Use helper to get user-friendly error message
|
|
||||||
const friendlyMessage = handleClaudeError(apiError);
|
|
||||||
|
|
||||||
return {
|
|
||||||
success: false,
|
|
||||||
error: {
|
|
||||||
code: 'AI_API_ERROR',
|
|
||||||
message: friendlyMessage
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
// Handle client initialization errors
|
|
||||||
return {
|
|
||||||
success: false,
|
|
||||||
error: {
|
|
||||||
code: 'AI_CLIENT_ERROR',
|
|
||||||
message: error.message
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Integration with AsyncOperationManager
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// In your MCP tool implementation:
|
|
||||||
import {
|
|
||||||
AsyncOperationManager,
|
|
||||||
StatusCodes
|
|
||||||
} from '../../utils/async-operation-manager.js';
|
|
||||||
import { someAiOperationDirect } from '../../core/direct-functions/some-ai-operation.js';
|
|
||||||
|
|
||||||
export async function someAiOperation(args, context) {
|
|
||||||
const { session, mcpLog } = context;
|
|
||||||
const log = mcpLog || console;
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Create operation description
|
|
||||||
const operationDescription = `AI operation: ${args.someParam}`;
|
|
||||||
|
|
||||||
// Start async operation
|
|
||||||
const operation = AsyncOperationManager.createOperation(
|
|
||||||
operationDescription,
|
|
||||||
async (reportProgress) => {
|
|
||||||
try {
|
|
||||||
// Initial progress report
|
|
||||||
reportProgress({
|
|
||||||
progress: 0,
|
|
||||||
status: 'Starting AI operation...'
|
|
||||||
});
|
|
||||||
|
|
||||||
// Call direct function with session and progress reporting
|
|
||||||
const result = await someAiOperationDirect(args, log, {
|
|
||||||
reportProgress,
|
|
||||||
mcpLog: log,
|
|
||||||
session
|
|
||||||
});
|
|
||||||
|
|
||||||
// Final progress update
|
|
||||||
reportProgress({
|
|
||||||
progress: 100,
|
|
||||||
status: result.success ? 'Operation completed' : 'Operation failed',
|
|
||||||
result: result.data,
|
|
||||||
error: result.error
|
|
||||||
});
|
|
||||||
|
|
||||||
return result;
|
|
||||||
} catch (error) {
|
|
||||||
// Handle errors in the operation
|
|
||||||
reportProgress({
|
|
||||||
progress: 100,
|
|
||||||
status: 'Operation failed',
|
|
||||||
error: {
|
|
||||||
message: error.message,
|
|
||||||
code: error.code || 'OPERATION_FAILED'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Return immediate response with operation ID
|
|
||||||
return {
|
|
||||||
status: StatusCodes.ACCEPTED,
|
|
||||||
body: {
|
|
||||||
success: true,
|
|
||||||
message: 'Operation started',
|
|
||||||
operationId: operation.id
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} catch (error) {
|
|
||||||
// Handle errors in the MCP tool
|
|
||||||
log.error(`Error in someAiOperation: ${error.message}`);
|
|
||||||
return {
|
|
||||||
status: StatusCodes.INTERNAL_SERVER_ERROR,
|
|
||||||
body: {
|
|
||||||
success: false,
|
|
||||||
error: {
|
|
||||||
code: 'OPERATION_FAILED',
|
|
||||||
message: error.message
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Using Research Capabilities with Perplexity
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// In your direct function:
|
|
||||||
import {
|
|
||||||
getPerplexityClientForMCP,
|
|
||||||
getBestAvailableAIModel
|
|
||||||
} from '../utils/ai-client-utils.js';
|
|
||||||
|
|
||||||
export async function researchOperationDirect(args, log, context) {
|
|
||||||
try {
|
|
||||||
// Get the best AI model for this operation based on needs
|
|
||||||
const { type, client } = await getBestAvailableAIModel(
|
|
||||||
context.session,
|
|
||||||
{ requiresResearch: true },
|
|
||||||
log
|
|
||||||
);
|
|
||||||
|
|
||||||
// Report which model we're using
|
|
||||||
if (context.reportProgress) {
|
|
||||||
await context.reportProgress({
|
|
||||||
progress: 10,
|
|
||||||
status: `Using ${type} model for research...`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make API call based on the model type
|
|
||||||
if (type === 'perplexity') {
|
|
||||||
// Call Perplexity
|
|
||||||
const response = await client.chat.completions.create({
|
|
||||||
model: context.session?.env?.PERPLEXITY_MODEL || 'sonar-medium-online',
|
|
||||||
messages: [{ role: 'user', content: args.researchQuery }],
|
|
||||||
temperature: 0.1
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
success: true,
|
|
||||||
data: response.choices[0].message.content
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
// Call Claude as fallback
|
|
||||||
// (Implementation depends on specific needs)
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
// Handle errors
|
|
||||||
return {
|
|
||||||
success: false,
|
|
||||||
error: {
|
|
||||||
code: 'RESEARCH_ERROR',
|
|
||||||
message: error.message
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Model Configuration Override Example
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// In your direct function:
|
|
||||||
import { getModelConfig } from '../utils/ai-client-utils.js';
|
|
||||||
|
|
||||||
// Using custom defaults for a specific operation
|
|
||||||
const operationDefaults = {
|
|
||||||
model: 'claude-3-haiku-20240307', // Faster, smaller model
|
|
||||||
maxTokens: 1000, // Lower token limit
|
|
||||||
temperature: 0.2 // Lower temperature for more deterministic output
|
|
||||||
};
|
|
||||||
|
|
||||||
// Get model config with operation-specific defaults
|
|
||||||
const modelConfig = getModelConfig(context.session, operationDefaults);
|
|
||||||
|
|
||||||
// Now use modelConfig in your API calls
|
|
||||||
const response = await client.messages.create({
|
|
||||||
model: modelConfig.model,
|
|
||||||
max_tokens: modelConfig.maxTokens,
|
|
||||||
temperature: modelConfig.temperature
|
|
||||||
// Other parameters...
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
## Best Practices
|
|
||||||
|
|
||||||
1. **Error Handling**:
|
|
||||||
|
|
||||||
- Always use try/catch blocks around both client initialization and API calls
|
|
||||||
- Use `handleClaudeError` to provide user-friendly error messages
|
|
||||||
- Return standardized error objects with code and message
|
|
||||||
|
|
||||||
2. **Progress Reporting**:
|
|
||||||
|
|
||||||
- Report progress at key points (starting, processing, completing)
|
|
||||||
- Include meaningful status messages
|
|
||||||
- Include error details in progress reports when failures occur
|
|
||||||
|
|
||||||
3. **Session Handling**:
|
|
||||||
|
|
||||||
- Always pass the session from the context to the AI client getters
|
|
||||||
- Use `getModelConfig` to respect user settings from session
|
|
||||||
|
|
||||||
4. **Model Selection**:
|
|
||||||
|
|
||||||
- Use `getBestAvailableAIModel` when you need to select between different models
|
|
||||||
- Set `requiresResearch: true` when you need Perplexity capabilities
|
|
||||||
|
|
||||||
5. **AsyncOperationManager Integration**:
|
|
||||||
- Create descriptive operation names
|
|
||||||
- Handle all errors within the operation function
|
|
||||||
- Return standardized results from direct functions
|
|
||||||
- Return immediate responses with operation IDs
|
|
||||||
@@ -43,15 +43,36 @@ task-master show <id>
|
|||||||
# or
|
# or
|
||||||
task-master show --id=<id>
|
task-master show --id=<id>
|
||||||
|
|
||||||
|
# View multiple tasks with comma-separated IDs
|
||||||
|
task-master show 1,3,5
|
||||||
|
task-master show 44,55
|
||||||
|
|
||||||
# View a specific subtask (e.g., subtask 2 of task 1)
|
# View a specific subtask (e.g., subtask 2 of task 1)
|
||||||
task-master show 1.2
|
task-master show 1.2
|
||||||
|
|
||||||
|
# Mix parent tasks and subtasks
|
||||||
|
task-master show 44,44.1,55,55.2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Multiple Task Display:**
|
||||||
|
|
||||||
|
- **Single ID**: Shows detailed task view with full implementation details
|
||||||
|
- **Multiple IDs**: Shows compact summary table with interactive action menu
|
||||||
|
- **Action Menu**: Provides copy-paste ready commands for batch operations:
|
||||||
|
- Mark all as in-progress/done
|
||||||
|
- Show next available task
|
||||||
|
- Expand all tasks (generate subtasks)
|
||||||
|
- View dependency relationships
|
||||||
|
- Generate task files
|
||||||
|
|
||||||
## Update Tasks
|
## Update Tasks
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Update tasks from a specific ID and provide context
|
# Update tasks from a specific ID and provide context
|
||||||
task-master update --from=<id> --prompt="<prompt>"
|
task-master update --from=<id> --prompt="<prompt>"
|
||||||
|
|
||||||
|
# Update tasks using research role
|
||||||
|
task-master update --from=<id> --prompt="<prompt>" --research
|
||||||
```
|
```
|
||||||
|
|
||||||
## Update a Specific Task
|
## Update a Specific Task
|
||||||
@@ -60,7 +81,7 @@ task-master update --from=<id> --prompt="<prompt>"
|
|||||||
# Update a single task by ID with new information
|
# Update a single task by ID with new information
|
||||||
task-master update-task --id=<id> --prompt="<prompt>"
|
task-master update-task --id=<id> --prompt="<prompt>"
|
||||||
|
|
||||||
# Use research-backed updates with Perplexity AI
|
# Use research-backed updates
|
||||||
task-master update-task --id=<id> --prompt="<prompt>" --research
|
task-master update-task --id=<id> --prompt="<prompt>" --research
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -73,7 +94,7 @@ task-master update-subtask --id=<parentId.subtaskId> --prompt="<prompt>"
|
|||||||
# Example: Add details about API rate limiting to subtask 2 of task 5
|
# Example: Add details about API rate limiting to subtask 2 of task 5
|
||||||
task-master update-subtask --id=5.2 --prompt="Add rate limiting of 100 requests per minute"
|
task-master update-subtask --id=5.2 --prompt="Add rate limiting of 100 requests per minute"
|
||||||
|
|
||||||
# Use research-backed updates with Perplexity AI
|
# Use research-backed updates
|
||||||
task-master update-subtask --id=<parentId.subtaskId> --prompt="<prompt>" --research
|
task-master update-subtask --id=<parentId.subtaskId> --prompt="<prompt>" --research
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -184,12 +205,41 @@ task-master validate-dependencies
|
|||||||
task-master fix-dependencies
|
task-master fix-dependencies
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Move Tasks
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Move a task or subtask to a new position
|
||||||
|
task-master move --from=<id> --to=<id>
|
||||||
|
|
||||||
|
# Examples:
|
||||||
|
# Move task to become a subtask
|
||||||
|
task-master move --from=5 --to=7
|
||||||
|
|
||||||
|
# Move subtask to become a standalone task
|
||||||
|
task-master move --from=5.2 --to=7
|
||||||
|
|
||||||
|
# Move subtask to a different parent
|
||||||
|
task-master move --from=5.2 --to=7.3
|
||||||
|
|
||||||
|
# Reorder subtasks within the same parent
|
||||||
|
task-master move --from=5.2 --to=5.4
|
||||||
|
|
||||||
|
# Move a task to a new ID position (creates placeholder if doesn't exist)
|
||||||
|
task-master move --from=5 --to=25
|
||||||
|
|
||||||
|
# Move multiple tasks at once (must have the same number of IDs)
|
||||||
|
task-master move --from=10,11,12 --to=16,17,18
|
||||||
|
```
|
||||||
|
|
||||||
## Add a New Task
|
## Add a New Task
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Add a new task using AI
|
# Add a new task using AI (main role)
|
||||||
task-master add-task --prompt="Description of the new task"
|
task-master add-task --prompt="Description of the new task"
|
||||||
|
|
||||||
|
# Add a new task using AI (research role)
|
||||||
|
task-master add-task --prompt="Description of the new task" --research
|
||||||
|
|
||||||
# Add a task with dependencies
|
# Add a task with dependencies
|
||||||
task-master add-task --prompt="Description" --dependencies=1,2,3
|
task-master add-task --prompt="Description" --dependencies=1,2,3
|
||||||
|
|
||||||
@@ -197,9 +247,152 @@ task-master add-task --prompt="Description" --dependencies=1,2,3
|
|||||||
task-master add-task --prompt="Description" --priority=high
|
task-master add-task --prompt="Description" --priority=high
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Tag Management
|
||||||
|
|
||||||
|
Task Master supports tagged task lists for multi-context task management. Each tag represents a separate, isolated context for tasks.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# List all available tags with task counts and status
|
||||||
|
task-master tags
|
||||||
|
|
||||||
|
# List tags with detailed metadata
|
||||||
|
task-master tags --show-metadata
|
||||||
|
|
||||||
|
# Create a new empty tag
|
||||||
|
task-master add-tag <tag-name>
|
||||||
|
|
||||||
|
# Create a new tag with a description
|
||||||
|
task-master add-tag <tag-name> --description="Feature development tasks"
|
||||||
|
|
||||||
|
# Create a tag based on current git branch name
|
||||||
|
task-master add-tag --from-branch
|
||||||
|
|
||||||
|
# Create a new tag by copying tasks from the current tag
|
||||||
|
task-master add-tag <new-tag> --copy-from-current
|
||||||
|
|
||||||
|
# Create a new tag by copying from a specific tag
|
||||||
|
task-master add-tag <new-tag> --copy-from=<source-tag>
|
||||||
|
|
||||||
|
# Switch to a different tag context
|
||||||
|
task-master use-tag <tag-name>
|
||||||
|
|
||||||
|
# Rename an existing tag
|
||||||
|
task-master rename-tag <old-name> <new-name>
|
||||||
|
|
||||||
|
# Copy an entire tag to create a new one
|
||||||
|
task-master copy-tag <source-tag> <target-tag>
|
||||||
|
|
||||||
|
# Copy a tag with a description
|
||||||
|
task-master copy-tag <source-tag> <target-tag> --description="Copied for testing"
|
||||||
|
|
||||||
|
# Delete a tag and all its tasks (with confirmation)
|
||||||
|
task-master delete-tag <tag-name>
|
||||||
|
|
||||||
|
# Delete a tag without confirmation prompt
|
||||||
|
task-master delete-tag <tag-name> --yes
|
||||||
|
```
|
||||||
|
|
||||||
|
**Tag Context:**
|
||||||
|
- All task operations (list, show, add, update, etc.) work within the currently active tag
|
||||||
|
- Use `--tag=<name>` flag with most commands to operate on a specific tag context
|
||||||
|
- Tags provide complete isolation - tasks in different tags don't interfere with each other
|
||||||
|
|
||||||
## Initialize a Project
|
## Initialize a Project
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Initialize a new project with Task Master structure
|
# Initialize a new project with Task Master structure
|
||||||
task-master init
|
task-master init
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Configure AI Models
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# View current AI model configuration and API key status
|
||||||
|
task-master models
|
||||||
|
|
||||||
|
# Set the primary model for generation/updates (provider inferred if known)
|
||||||
|
task-master models --set-main=claude-3-opus-20240229
|
||||||
|
|
||||||
|
# Set the research model
|
||||||
|
task-master models --set-research=sonar-pro
|
||||||
|
|
||||||
|
# Set the fallback model
|
||||||
|
task-master models --set-fallback=claude-3-haiku-20240307
|
||||||
|
|
||||||
|
# Set a custom Ollama model for the main role
|
||||||
|
task-master models --set-main=my-local-llama --ollama
|
||||||
|
|
||||||
|
# Set a custom OpenRouter model for the research role
|
||||||
|
task-master models --set-research=google/gemini-pro --openrouter
|
||||||
|
|
||||||
|
# Run interactive setup to configure models, including custom ones
|
||||||
|
task-master models --setup
|
||||||
|
```
|
||||||
|
|
||||||
|
Configuration is stored in `.taskmaster/config.json` in your project root (legacy `.taskmasterconfig` files are automatically migrated). API keys are still managed via `.env` or MCP configuration. Use `task-master models` without flags to see available built-in models. Use `--setup` for a guided experience.
|
||||||
|
|
||||||
|
State is stored in `.taskmaster/state.json` in your project root. It maintains important information like the current tag. Do not manually edit this file.
|
||||||
|
|
||||||
|
## Research Fresh Information
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Perform AI-powered research with fresh, up-to-date information
|
||||||
|
task-master research "What are the latest best practices for JWT authentication in Node.js?"
|
||||||
|
|
||||||
|
# Research with specific task context
|
||||||
|
task-master research "How to implement OAuth 2.0?" --id=15,16
|
||||||
|
|
||||||
|
# Research with file context for code-aware suggestions
|
||||||
|
task-master research "How can I optimize this API implementation?" --files=src/api.js,src/auth.js
|
||||||
|
|
||||||
|
# Research with custom context and project tree
|
||||||
|
task-master research "Best practices for error handling" --context="We're using Express.js" --tree
|
||||||
|
|
||||||
|
# Research with different detail levels
|
||||||
|
task-master research "React Query v5 migration guide" --detail=high
|
||||||
|
|
||||||
|
# Disable interactive follow-up questions (useful for scripting, is the default for MCP)
|
||||||
|
# Use a custom tasks file location
|
||||||
|
task-master research "How to implement this feature?" --file=custom-tasks.json
|
||||||
|
|
||||||
|
# Research within a specific tag context
|
||||||
|
task-master research "Database optimization strategies" --tag=feature-branch
|
||||||
|
|
||||||
|
# Save research conversation to .taskmaster/docs/research/ directory (for later reference)
|
||||||
|
task-master research "Database optimization techniques" --save-file
|
||||||
|
|
||||||
|
# Save key findings directly to a task or subtask (recommended for actionable insights)
|
||||||
|
task-master research "How to implement OAuth?" --save-to=15
|
||||||
|
task-master research "API optimization strategies" --save-to=15.2
|
||||||
|
|
||||||
|
# Combine context gathering with automatic saving of findings
|
||||||
|
task-master research "Best practices for this implementation" --id=15,16 --files=src/auth.js --save-to=15.3
|
||||||
|
```
|
||||||
|
|
||||||
|
**The research command is a powerful exploration tool that provides:**
|
||||||
|
|
||||||
|
- **Fresh information beyond AI knowledge cutoffs**
|
||||||
|
- **Project-aware context** from your tasks and files
|
||||||
|
- **Automatic task discovery** using fuzzy search
|
||||||
|
- **Multiple detail levels** (low, medium, high)
|
||||||
|
- **Token counting and cost tracking**
|
||||||
|
- **Interactive follow-up questions** for deep exploration
|
||||||
|
- **Flexible save options** (commit findings to tasks or preserve conversations)
|
||||||
|
- **Iterative discovery** through continuous questioning and refinement
|
||||||
|
|
||||||
|
**Use research frequently to:**
|
||||||
|
|
||||||
|
- Get current best practices before implementing features
|
||||||
|
- Research new technologies and libraries
|
||||||
|
- Find solutions to complex problems
|
||||||
|
- Validate your implementation approaches
|
||||||
|
- Stay updated with latest security recommendations
|
||||||
|
|
||||||
|
**Interactive Features (CLI):**
|
||||||
|
|
||||||
|
- **Follow-up questions** that maintain conversation context and allow deep exploration
|
||||||
|
- **Save menu** during or after research with flexible options:
|
||||||
|
- **Save to task/subtask**: Commit key findings and actionable insights (recommended)
|
||||||
|
- **Save to file**: Preserve entire conversation for later reference if needed
|
||||||
|
- **Continue exploring**: Ask more follow-up questions to dig deeper
|
||||||
|
- **Automatic file naming** with timestamps and query-based slugs when saving conversations
|
||||||
|
|||||||
@@ -1,53 +1,154 @@
|
|||||||
# Configuration
|
# Configuration
|
||||||
|
|
||||||
Task Master can be configured through environment variables in a `.env` file at the root of your project.
|
Taskmaster uses two primary methods for configuration:
|
||||||
|
|
||||||
## Required Configuration
|
1. **`.taskmaster/config.json` File (Recommended - New Structure)**
|
||||||
|
1. **`.taskmaster/config.json` File (Recommended - New Structure)**
|
||||||
|
|
||||||
- `ANTHROPIC_API_KEY`: Your Anthropic API key for Claude (Example: `ANTHROPIC_API_KEY=sk-ant-api03-...`)
|
- This JSON file stores most configuration settings, including AI model selections, parameters, logging levels, and project defaults.
|
||||||
|
- **Location:** This file is created in the `.taskmaster/` directory when you run the `task-master models --setup` interactive setup or initialize a new project with `task-master init`.
|
||||||
|
- **Migration:** Existing projects with `.taskmasterconfig` in the root will continue to work, but should be migrated to the new structure using `task-master migrate`.
|
||||||
|
- **Management:** Use the `task-master models --setup` command (or `models` MCP tool) to interactively create and manage this file. You can also set specific models directly using `task-master models --set-<role>=<model_id>`, adding `--ollama` or `--openrouter` flags for custom models. Manual editing is possible but not recommended unless you understand the structure.
|
||||||
|
- **Example Structure:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"models": {
|
||||||
|
"main": {
|
||||||
|
"provider": "anthropic",
|
||||||
|
"modelId": "claude-3-7-sonnet-20250219",
|
||||||
|
"maxTokens": 64000,
|
||||||
|
"temperature": 0.2,
|
||||||
|
"baseURL": "https://api.anthropic.com/v1"
|
||||||
|
},
|
||||||
|
"research": {
|
||||||
|
"provider": "perplexity",
|
||||||
|
"modelId": "sonar-pro",
|
||||||
|
"maxTokens": 8700,
|
||||||
|
"temperature": 0.1,
|
||||||
|
"baseURL": "https://api.perplexity.ai/v1"
|
||||||
|
},
|
||||||
|
"fallback": {
|
||||||
|
"provider": "anthropic",
|
||||||
|
"modelId": "claude-3-5-sonnet",
|
||||||
|
"maxTokens": 64000,
|
||||||
|
"temperature": 0.2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"global": {
|
||||||
|
"logLevel": "info",
|
||||||
|
"debug": false,
|
||||||
|
"defaultSubtasks": 5,
|
||||||
|
"defaultPriority": "medium",
|
||||||
|
"defaultTag": "master",
|
||||||
|
"projectName": "Your Project Name",
|
||||||
|
"ollamaBaseURL": "http://localhost:11434/api",
|
||||||
|
"azureBaseURL": "https://your-endpoint.azure.com/",
|
||||||
|
"vertexProjectId": "your-gcp-project-id",
|
||||||
|
"vertexLocation": "us-central1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Optional Configuration
|
2. **Legacy `.taskmasterconfig` File (Backward Compatibility)**
|
||||||
|
|
||||||
- `MODEL` (Default: `"claude-3-7-sonnet-20250219"`): Claude model to use (Example: `MODEL=claude-3-opus-20240229`)
|
- For projects that haven't migrated to the new structure yet.
|
||||||
- `MAX_TOKENS` (Default: `"4000"`): Maximum tokens for responses (Example: `MAX_TOKENS=8000`)
|
- **Location:** Project root directory.
|
||||||
- `TEMPERATURE` (Default: `"0.7"`): Temperature for model responses (Example: `TEMPERATURE=0.5`)
|
- **Migration:** Use `task-master migrate` to move this to `.taskmaster/config.json`.
|
||||||
- `DEBUG` (Default: `"false"`): Enable debug logging (Example: `DEBUG=true`)
|
- **Deprecation:** While still supported, you'll see warnings encouraging migration to the new structure.
|
||||||
- `LOG_LEVEL` (Default: `"info"`): Console output level (Example: `LOG_LEVEL=debug`)
|
|
||||||
- `DEFAULT_SUBTASKS` (Default: `"3"`): Default subtask count (Example: `DEFAULT_SUBTASKS=5`)
|
|
||||||
- `DEFAULT_PRIORITY` (Default: `"medium"`): Default priority (Example: `DEFAULT_PRIORITY=high`)
|
|
||||||
- `PROJECT_NAME` (Default: `"MCP SaaS MVP"`): Project name in metadata (Example: `PROJECT_NAME=My Awesome Project`)
|
|
||||||
- `PROJECT_VERSION` (Default: `"1.0.0"`): Version in metadata (Example: `PROJECT_VERSION=2.1.0`)
|
|
||||||
- `PERPLEXITY_API_KEY`: For research-backed features (Example: `PERPLEXITY_API_KEY=pplx-...`)
|
|
||||||
- `PERPLEXITY_MODEL` (Default: `"sonar-medium-online"`): Perplexity model (Example: `PERPLEXITY_MODEL=sonar-large-online`)
|
|
||||||
|
|
||||||
## Example .env File
|
## Environment Variables (`.env` file or MCP `env` block - For API Keys Only)
|
||||||
|
|
||||||
|
- Used **exclusively** for sensitive API keys and specific endpoint URLs.
|
||||||
|
- **Location:**
|
||||||
|
- For CLI usage: Create a `.env` file in your project root.
|
||||||
|
- For MCP/Cursor usage: Configure keys in the `env` section of your `.cursor/mcp.json` file.
|
||||||
|
- **Required API Keys (Depending on configured providers):**
|
||||||
|
- `ANTHROPIC_API_KEY`: Your Anthropic API key.
|
||||||
|
- `PERPLEXITY_API_KEY`: Your Perplexity API key.
|
||||||
|
- `OPENAI_API_KEY`: Your OpenAI API key.
|
||||||
|
- `GOOGLE_API_KEY`: Your Google API key (also used for Vertex AI provider).
|
||||||
|
- `MISTRAL_API_KEY`: Your Mistral API key.
|
||||||
|
- `AZURE_OPENAI_API_KEY`: Your Azure OpenAI API key (also requires `AZURE_OPENAI_ENDPOINT`).
|
||||||
|
- `OPENROUTER_API_KEY`: Your OpenRouter API key.
|
||||||
|
- `XAI_API_KEY`: Your X-AI API key.
|
||||||
|
- **Optional Endpoint Overrides:**
|
||||||
|
- **Per-role `baseURL` in `.taskmasterconfig`:** You can add a `baseURL` property to any model role (`main`, `research`, `fallback`) to override the default API endpoint for that provider. If omitted, the provider's standard endpoint is used.
|
||||||
|
- `AZURE_OPENAI_ENDPOINT`: Required if using Azure OpenAI key (can also be set as `baseURL` for the Azure model role).
|
||||||
|
- `OLLAMA_BASE_URL`: Override the default Ollama API URL (Default: `http://localhost:11434/api`).
|
||||||
|
- `VERTEX_PROJECT_ID`: Your Google Cloud project ID for Vertex AI. Required when using the 'vertex' provider.
|
||||||
|
- `VERTEX_LOCATION`: Google Cloud region for Vertex AI (e.g., 'us-central1'). Default is 'us-central1'.
|
||||||
|
- `GOOGLE_APPLICATION_CREDENTIALS`: Path to service account credentials JSON file for Google Cloud auth (alternative to API key for Vertex AI).
|
||||||
|
|
||||||
|
**Important:** Settings like model ID selections (`main`, `research`, `fallback`), `maxTokens`, `temperature`, `logLevel`, `defaultSubtasks`, `defaultPriority`, and `projectName` are **managed in `.taskmaster/config.json`** (or `.taskmasterconfig` for unmigrated projects), not environment variables.
|
||||||
|
|
||||||
|
## Tagged Task Lists Configuration (v0.17+)
|
||||||
|
|
||||||
|
Taskmaster includes a tagged task lists system for multi-context task management.
|
||||||
|
|
||||||
|
### Global Tag Settings
|
||||||
|
|
||||||
|
```json
|
||||||
|
"global": {
|
||||||
|
"defaultTag": "master"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **`defaultTag`** (string): Default tag context for new operations (default: "master")
|
||||||
|
|
||||||
|
### Git Integration
|
||||||
|
|
||||||
|
Task Master provides manual git integration through the `--from-branch` option:
|
||||||
|
|
||||||
|
- **Manual Tag Creation**: Use `task-master add-tag --from-branch` to create a tag based on your current git branch name
|
||||||
|
- **User Control**: No automatic tag switching - you control when and how tags are created
|
||||||
|
- **Flexible Workflow**: Supports any git workflow without imposing rigid branch-tag mappings
|
||||||
|
|
||||||
|
## State Management File
|
||||||
|
|
||||||
|
Taskmaster uses `.taskmaster/state.json` to track tagged system runtime information:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"currentTag": "master",
|
||||||
|
"lastSwitched": "2025-06-11T20:26:12.598Z",
|
||||||
|
"migrationNoticeShown": true
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **`currentTag`**: Currently active tag context
|
||||||
|
- **`lastSwitched`**: Timestamp of last tag switch
|
||||||
|
- **`migrationNoticeShown`**: Whether migration notice has been displayed
|
||||||
|
|
||||||
|
This file is automatically created during tagged system migration and should not be manually edited.
|
||||||
|
|
||||||
|
## Example `.env` File (for API Keys)
|
||||||
|
|
||||||
```
|
```
|
||||||
# Required
|
# Required API keys for providers configured in .taskmaster/config.json
|
||||||
ANTHROPIC_API_KEY=sk-ant-api03-your-api-key
|
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
|
||||||
|
PERPLEXITY_API_KEY=pplx-your-key-here
|
||||||
|
# OPENAI_API_KEY=sk-your-key-here
|
||||||
|
# GOOGLE_API_KEY=AIzaSy...
|
||||||
|
# etc.
|
||||||
|
|
||||||
# Optional - Claude Configuration
|
# Optional Endpoint Overrides
|
||||||
MODEL=claude-3-7-sonnet-20250219
|
# AZURE_OPENAI_ENDPOINT=https://your-azure-endpoint.openai.azure.com/
|
||||||
MAX_TOKENS=4000
|
# OLLAMA_BASE_URL=http://custom-ollama-host:11434/api
|
||||||
TEMPERATURE=0.7
|
|
||||||
|
|
||||||
# Optional - Perplexity API for Research
|
# Google Vertex AI Configuration (Required if using 'vertex' provider)
|
||||||
PERPLEXITY_API_KEY=pplx-your-api-key
|
# VERTEX_PROJECT_ID=your-gcp-project-id
|
||||||
PERPLEXITY_MODEL=sonar-medium-online
|
# VERTEX_LOCATION=us-central1
|
||||||
|
# GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-credentials.json
|
||||||
# Optional - Project Info
|
|
||||||
PROJECT_NAME=My Project
|
|
||||||
PROJECT_VERSION=1.0.0
|
|
||||||
|
|
||||||
# Optional - Application Configuration
|
|
||||||
DEFAULT_SUBTASKS=3
|
|
||||||
DEFAULT_PRIORITY=medium
|
|
||||||
DEBUG=false
|
|
||||||
LOG_LEVEL=info
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Configuration Errors
|
||||||
|
|
||||||
|
- If Task Master reports errors about missing configuration or cannot find the config file, run `task-master models --setup` in your project root to create or repair the file.
|
||||||
|
- For new projects, config will be created at `.taskmaster/config.json`. For legacy projects, you may want to use `task-master migrate` to move to the new structure.
|
||||||
|
- Ensure API keys are correctly placed in your `.env` file (for CLI) or `.cursor/mcp.json` (for MCP) and are valid for the providers selected in your config file.
|
||||||
|
|
||||||
### If `task-master init` doesn't respond:
|
### If `task-master init` doesn't respond:
|
||||||
|
|
||||||
Try running it with Node directly:
|
Try running it with Node directly:
|
||||||
@@ -63,3 +164,45 @@ git clone https://github.com/eyaltoledano/claude-task-master.git
|
|||||||
cd claude-task-master
|
cd claude-task-master
|
||||||
node scripts/init.js
|
node scripts/init.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Provider-Specific Configuration
|
||||||
|
|
||||||
|
### Google Vertex AI Configuration
|
||||||
|
|
||||||
|
Google Vertex AI is Google Cloud's enterprise AI platform and requires specific configuration:
|
||||||
|
|
||||||
|
1. **Prerequisites**:
|
||||||
|
- A Google Cloud account with Vertex AI API enabled
|
||||||
|
- Either a Google API key with Vertex AI permissions OR a service account with appropriate roles
|
||||||
|
- A Google Cloud project ID
|
||||||
|
2. **Authentication Options**:
|
||||||
|
- **API Key**: Set the `GOOGLE_API_KEY` environment variable
|
||||||
|
- **Service Account**: Set `GOOGLE_APPLICATION_CREDENTIALS` to point to your service account JSON file
|
||||||
|
3. **Required Configuration**:
|
||||||
|
- Set `VERTEX_PROJECT_ID` to your Google Cloud project ID
|
||||||
|
- Set `VERTEX_LOCATION` to your preferred Google Cloud region (default: us-central1)
|
||||||
|
4. **Example Setup**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# In .env file
|
||||||
|
GOOGLE_API_KEY=AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||||
|
VERTEX_PROJECT_ID=my-gcp-project-123
|
||||||
|
VERTEX_LOCATION=us-central1
|
||||||
|
```
|
||||||
|
|
||||||
|
Or using service account:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# In .env file
|
||||||
|
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
|
||||||
|
VERTEX_PROJECT_ID=my-gcp-project-123
|
||||||
|
VERTEX_LOCATION=us-central1
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **In .taskmaster/config.json**:
|
||||||
|
```json
|
||||||
|
"global": {
|
||||||
|
"vertexProjectId": "my-gcp-project-123",
|
||||||
|
"vertexLocation": "us-central1"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
94
docs/contributor-docs/testing-roo-integration.md
Normal file
94
docs/contributor-docs/testing-roo-integration.md
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
# Testing Roo Integration
|
||||||
|
|
||||||
|
This document provides instructions for testing the Roo integration in the Task Master package.
|
||||||
|
|
||||||
|
## Running Tests
|
||||||
|
|
||||||
|
To run the tests for the Roo integration:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run all tests
|
||||||
|
npm test
|
||||||
|
|
||||||
|
# Run only Roo integration tests
|
||||||
|
npm test -- -t "Roo"
|
||||||
|
|
||||||
|
# Run specific test file
|
||||||
|
npm test -- tests/integration/roo-files-inclusion.test.js
|
||||||
|
```
|
||||||
|
|
||||||
|
## Manual Testing
|
||||||
|
|
||||||
|
To manually verify that the Roo files are properly included in the package:
|
||||||
|
|
||||||
|
1. Create a test directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir test-tm
|
||||||
|
cd test-tm
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Create a package.json file:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm init -y
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Install the task-master-ai package locally:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# From the root of the claude-task-master repository
|
||||||
|
cd ..
|
||||||
|
npm pack
|
||||||
|
# This will create a file like task-master-ai-0.12.0.tgz
|
||||||
|
|
||||||
|
# Move back to the test directory
|
||||||
|
cd test-tm
|
||||||
|
npm install ../task-master-ai-0.12.0.tgz
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Initialize a new Task Master project:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx task-master init --yes
|
||||||
|
```
|
||||||
|
|
||||||
|
5. Verify that all Roo files and directories are created:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check that .roomodes file exists
|
||||||
|
ls -la | grep .roomodes
|
||||||
|
|
||||||
|
# Check that .roo directory exists and contains all mode directories
|
||||||
|
ls -la .roo
|
||||||
|
ls -la .roo/rules
|
||||||
|
ls -la .roo/rules-architect
|
||||||
|
ls -la .roo/rules-ask
|
||||||
|
ls -la .roo/rules-boomerang
|
||||||
|
ls -la .roo/rules-code
|
||||||
|
ls -la .roo/rules-debug
|
||||||
|
ls -la .roo/rules-test
|
||||||
|
```
|
||||||
|
|
||||||
|
## What to Look For
|
||||||
|
|
||||||
|
When running the tests or performing manual verification, ensure that:
|
||||||
|
|
||||||
|
1. The package includes `.roo/**` and `.roomodes` in the `files` array in package.json
|
||||||
|
2. The `prepare-package.js` script verifies the existence of all required Roo files
|
||||||
|
3. The `init.js` script creates all necessary .roo directories and copies .roomodes file
|
||||||
|
4. All source files for Roo integration exist in `assets/roocode/.roo` and `assets/roocode/.roomodes`
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
Ensure that the Roo integration works alongside existing Cursor functionality:
|
||||||
|
|
||||||
|
1. Initialize a new project that uses both Cursor and Roo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx task-master init --yes
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Verify that both `.cursor` and `.roo` directories are created
|
||||||
|
3. Verify that both `.windsurfrules` and `.roomodes` files are created
|
||||||
|
4. Confirm that existing functionality continues to work as expected
|
||||||
209
docs/examples.md
209
docs/examples.md
@@ -5,7 +5,7 @@ Here are some common interactions with Cursor AI when using Task Master:
|
|||||||
## Starting a new project
|
## Starting a new project
|
||||||
|
|
||||||
```
|
```
|
||||||
I've just initialized a new project with Claude Task Master. I have a PRD at scripts/prd.txt.
|
I've just initialized a new project with Claude Task Master. I have a PRD at .taskmaster/docs/prd.txt.
|
||||||
Can you help me parse it and set up the initial tasks?
|
Can you help me parse it and set up the initial tasks?
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -21,6 +21,20 @@ What's the next task I should work on? Please consider dependencies and prioriti
|
|||||||
I'd like to implement task 4. Can you help me understand what needs to be done and how to approach it?
|
I'd like to implement task 4. Can you help me understand what needs to be done and how to approach it?
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Viewing multiple tasks
|
||||||
|
|
||||||
|
```
|
||||||
|
Can you show me tasks 1, 3, and 5 so I can understand their relationship?
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
I need to see the status of tasks 44, 55, and their subtasks. Can you show me those?
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
Show me tasks 10, 12, and 15 and give me some batch actions I can perform on them.
|
||||||
|
```
|
||||||
|
|
||||||
## Managing subtasks
|
## Managing subtasks
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -30,7 +44,7 @@ I need to regenerate the subtasks for task 3 with a different approach. Can you
|
|||||||
## Handling changes
|
## Handling changes
|
||||||
|
|
||||||
```
|
```
|
||||||
We've decided to use MongoDB instead of PostgreSQL. Can you update all future tasks to reflect this change?
|
I've decided to use MongoDB instead of PostgreSQL. Can you update all future tasks to reflect this change?
|
||||||
```
|
```
|
||||||
|
|
||||||
## Completing work
|
## Completing work
|
||||||
@@ -40,6 +54,34 @@ I've finished implementing the authentication system described in task 2. All te
|
|||||||
Please mark it as complete and tell me what I should work on next.
|
Please mark it as complete and tell me what I should work on next.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Reorganizing tasks
|
||||||
|
|
||||||
|
```
|
||||||
|
I think subtask 5.2 would fit better as part of task 7. Can you move it there?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master move --from=5.2 --to=7.3`)
|
||||||
|
|
||||||
|
```
|
||||||
|
Task 8 should actually be a subtask of task 4. Can you reorganize this?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master move --from=8 --to=4.1`)
|
||||||
|
|
||||||
|
```
|
||||||
|
I just merged the main branch and there's a conflict in tasks.json. My teammates created tasks 10-15 on their branch while I created tasks 10-12 on my branch. Can you help me resolve this by moving my tasks?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task-master move --from=10 --to=16
|
||||||
|
task-master move --from=11 --to=17
|
||||||
|
task-master move --from=12 --to=18
|
||||||
|
```
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
## Analyzing complexity
|
## Analyzing complexity
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -51,3 +93,166 @@ Can you analyze the complexity of our tasks to help me understand which ones nee
|
|||||||
```
|
```
|
||||||
Can you show me the complexity report in a more readable format?
|
Can you show me the complexity report in a more readable format?
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Breaking Down Complex Tasks
|
||||||
|
|
||||||
|
```
|
||||||
|
Task 5 seems complex. Can you break it down into subtasks?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master expand --id=5`)
|
||||||
|
|
||||||
|
```
|
||||||
|
Please break down task 5 using research-backed generation.
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master expand --id=5 --research`)
|
||||||
|
|
||||||
|
### Updating Tasks with Research
|
||||||
|
|
||||||
|
```
|
||||||
|
We need to update task 15 based on the latest React Query v5 changes. Can you research this and update the task?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master update-task --id=15 --prompt="Update based on React Query v5 changes" --research`)
|
||||||
|
|
||||||
|
### Adding Tasks with Research
|
||||||
|
|
||||||
|
```
|
||||||
|
Please add a new task to implement user profile image uploads using Cloudinary, research the best approach.
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master add-task --prompt="Implement user profile image uploads using Cloudinary" --research`)
|
||||||
|
|
||||||
|
## Research-Driven Development
|
||||||
|
|
||||||
|
### Getting Fresh Information
|
||||||
|
|
||||||
|
```
|
||||||
|
Research the latest best practices for implementing JWT authentication in Node.js applications.
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master research "Latest best practices for JWT authentication in Node.js"`)
|
||||||
|
|
||||||
|
### Research with Project Context
|
||||||
|
|
||||||
|
```
|
||||||
|
I'm working on task 15 which involves API optimization. Can you research current best practices for our specific implementation?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master research "API optimization best practices" --id=15 --files=src/api.js`)
|
||||||
|
|
||||||
|
### Research Before Implementation
|
||||||
|
|
||||||
|
```
|
||||||
|
Before I implement task 8 (React Query integration), can you research the latest React Query v5 patterns and any breaking changes?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master research "React Query v5 patterns and breaking changes" --id=8`)
|
||||||
|
|
||||||
|
### Research and Update Pattern
|
||||||
|
|
||||||
|
```
|
||||||
|
Research the latest security recommendations for Express.js applications and update our authentication task with the findings.
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs:
|
||||||
|
|
||||||
|
1. `task-master research "Latest Express.js security recommendations" --id=12`
|
||||||
|
2. `task-master update-subtask --id=12.3 --prompt="Updated with latest security findings: [research results]"`)
|
||||||
|
|
||||||
|
### Research for Debugging
|
||||||
|
|
||||||
|
```
|
||||||
|
I'm having issues with our WebSocket implementation in task 20. Can you research common WebSocket problems and solutions?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master research "Common WebSocket implementation problems and solutions" --id=20 --files=src/websocket.js`)
|
||||||
|
|
||||||
|
### Research Technology Comparisons
|
||||||
|
|
||||||
|
```
|
||||||
|
We need to choose between Redis and Memcached for caching. Can you research the current recommendations for our use case?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master research "Redis vs Memcached 2024 comparison for session caching" --tree`)
|
||||||
|
|
||||||
|
## Git Integration and Tag Management
|
||||||
|
|
||||||
|
### Creating Tags for Feature Branches
|
||||||
|
|
||||||
|
```
|
||||||
|
I'm starting work on a new feature branch for user authentication. Can you create a matching task tag?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master add-tag --from-branch`)
|
||||||
|
|
||||||
|
### Creating Named Tags
|
||||||
|
|
||||||
|
```
|
||||||
|
Create a new tag called 'api-v2' for our API redesign work.
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master add-tag api-v2 --description="API v2 redesign tasks"`)
|
||||||
|
|
||||||
|
### Switching Tag Contexts
|
||||||
|
|
||||||
|
```
|
||||||
|
Switch to the 'testing' tag so I can work on QA tasks.
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master use-tag testing`)
|
||||||
|
|
||||||
|
### Copying Tasks Between Tags
|
||||||
|
|
||||||
|
```
|
||||||
|
I need to copy the current tasks to a new 'hotfix' tag for urgent fixes.
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master add-tag hotfix --copy-from-current --description="Urgent hotfix tasks"`)
|
||||||
|
|
||||||
|
### Managing Multiple Contexts
|
||||||
|
|
||||||
|
```
|
||||||
|
Show me all available tags and their current status.
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master tags --show-metadata`)
|
||||||
|
|
||||||
|
### Tag Cleanup
|
||||||
|
|
||||||
|
```
|
||||||
|
I've finished the 'user-auth' feature and merged the branch. Can you clean up the tag?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master delete-tag user-auth`)
|
||||||
|
|
||||||
|
### Working with Tag-Specific Tasks
|
||||||
|
|
||||||
|
```
|
||||||
|
List all tasks in the 'api-v2' tag context.
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs: `task-master use-tag api-v2` then `task-master list`)
|
||||||
|
|
||||||
|
### Branch-Based Development Workflow
|
||||||
|
|
||||||
|
```
|
||||||
|
I'm switching to work on the 'feature/payments' branch. Can you set up the task context for this?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent runs:
|
||||||
|
1. `git checkout feature/payments`
|
||||||
|
2. `task-master add-tag --from-branch --description="Payment system implementation"`
|
||||||
|
3. `task-master list` to show tasks in the new context)
|
||||||
|
|
||||||
|
### Parallel Feature Development
|
||||||
|
|
||||||
|
```
|
||||||
|
I need to work on both authentication and payment features simultaneously. How should I organize the tasks?
|
||||||
|
```
|
||||||
|
|
||||||
|
(Agent suggests and runs:
|
||||||
|
1. `task-master add-tag auth --description="Authentication feature tasks"`
|
||||||
|
2. `task-master add-tag payments --description="Payment system tasks"`
|
||||||
|
3. `task-master use-tag auth` to start with authentication work)
|
||||||
|
|||||||
235
docs/migration-guide.md
Normal file
235
docs/migration-guide.md
Normal file
@@ -0,0 +1,235 @@
|
|||||||
|
# Migration Guide: New .taskmaster Directory Structure
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Task Master v0.16.0 introduces a new `.taskmaster/` directory structure to keep your project directories clean and organized. This guide explains the benefits of the new structure and how to migrate existing projects.
|
||||||
|
|
||||||
|
## What's New
|
||||||
|
|
||||||
|
### Before (Legacy Structure)
|
||||||
|
|
||||||
|
```
|
||||||
|
your-project/
|
||||||
|
├── tasks/ # Task files
|
||||||
|
│ ├── tasks.json
|
||||||
|
│ ├── task-1.txt
|
||||||
|
│ └── task-2.txt
|
||||||
|
├── scripts/ # PRD and reports
|
||||||
|
│ ├── prd.txt
|
||||||
|
│ ├── example_prd.txt
|
||||||
|
│ └── task-complexity-report.json
|
||||||
|
├── .taskmasterconfig # Configuration
|
||||||
|
└── ... (your project files)
|
||||||
|
```
|
||||||
|
|
||||||
|
### After (New Structure)
|
||||||
|
|
||||||
|
```
|
||||||
|
your-project/
|
||||||
|
├── .taskmaster/ # Consolidated Task Master files
|
||||||
|
│ ├── config.json # Configuration (was .taskmasterconfig)
|
||||||
|
│ ├── tasks/ # Task files
|
||||||
|
│ │ ├── tasks.json
|
||||||
|
│ │ ├── task-1.txt
|
||||||
|
│ │ └── task-2.txt
|
||||||
|
│ ├── docs/ # Project documentation
|
||||||
|
│ │ └── prd.txt
|
||||||
|
│ ├── reports/ # Generated reports
|
||||||
|
│ │ └── task-complexity-report.json
|
||||||
|
│ └── templates/ # Example/template files
|
||||||
|
│ └── example_prd.txt
|
||||||
|
└── ... (your project files)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Benefits of the New Structure
|
||||||
|
|
||||||
|
✅ **Cleaner Project Root**: No more scattered Task Master files
|
||||||
|
✅ **Better Organization**: Logical separation of tasks, docs, reports, and templates
|
||||||
|
✅ **Hidden by Default**: `.taskmaster/` directory is hidden from most file browsers
|
||||||
|
✅ **Future-Proof**: Centralized location for Task Master extensions
|
||||||
|
✅ **Backward Compatible**: Existing projects continue to work until migrated
|
||||||
|
|
||||||
|
## Migration Options
|
||||||
|
|
||||||
|
### Option 1: Automatic Migration (Recommended)
|
||||||
|
|
||||||
|
Task Master provides a built-in migration command that handles everything automatically:
|
||||||
|
|
||||||
|
#### CLI Migration
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Dry run to see what would be migrated
|
||||||
|
task-master migrate --dry-run
|
||||||
|
|
||||||
|
# Perform the migration with backup
|
||||||
|
task-master migrate --backup
|
||||||
|
|
||||||
|
# Force migration (overwrites existing files)
|
||||||
|
task-master migrate --force
|
||||||
|
|
||||||
|
# Clean up legacy files after migration
|
||||||
|
task-master migrate --cleanup
|
||||||
|
```
|
||||||
|
|
||||||
|
#### MCP Migration (Cursor/AI Editors)
|
||||||
|
|
||||||
|
Ask your AI assistant:
|
||||||
|
|
||||||
|
```
|
||||||
|
Please migrate my Task Master project to the new .taskmaster directory structure
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 2: Manual Migration
|
||||||
|
|
||||||
|
If you prefer to migrate manually:
|
||||||
|
|
||||||
|
1. **Create the new directory structure:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p .taskmaster/{tasks,docs,reports,templates}
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Move your files:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Move tasks
|
||||||
|
mv tasks/* .taskmaster/tasks/
|
||||||
|
|
||||||
|
# Move configuration
|
||||||
|
mv .taskmasterconfig .taskmaster/config.json
|
||||||
|
|
||||||
|
# Move PRD and documentation
|
||||||
|
mv scripts/prd.txt .taskmaster/docs/
|
||||||
|
mv scripts/example_prd.txt .taskmaster/templates/
|
||||||
|
|
||||||
|
# Move reports (if they exist)
|
||||||
|
mv scripts/task-complexity-report.json .taskmaster/reports/ 2>/dev/null || true
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Clean up empty directories:**
|
||||||
|
```bash
|
||||||
|
rmdir tasks scripts 2>/dev/null || true
|
||||||
|
```
|
||||||
|
|
||||||
|
## What Gets Migrated
|
||||||
|
|
||||||
|
The migration process handles these file types:
|
||||||
|
|
||||||
|
### Tasks Directory → `.taskmaster/tasks/`
|
||||||
|
|
||||||
|
- `tasks.json`
|
||||||
|
- Individual task text files (`.txt`)
|
||||||
|
|
||||||
|
### Scripts Directory → Multiple Destinations
|
||||||
|
|
||||||
|
- **PRD files** → `.taskmaster/docs/`
|
||||||
|
- `prd.txt`, `requirements.txt`, etc.
|
||||||
|
- **Example/Template files** → `.taskmaster/templates/`
|
||||||
|
- `example_prd.txt`, template files
|
||||||
|
- **Reports** → `.taskmaster/reports/`
|
||||||
|
- `task-complexity-report.json`
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
- `.taskmasterconfig` → `.taskmaster/config.json`
|
||||||
|
|
||||||
|
## After Migration
|
||||||
|
|
||||||
|
Once migrated, Task Master will:
|
||||||
|
|
||||||
|
✅ **Automatically use** the new directory structure
|
||||||
|
✅ **Show deprecation warnings** when legacy files are detected
|
||||||
|
✅ **Create new files** in the proper locations
|
||||||
|
✅ **Fall back gracefully** to legacy locations if new ones don't exist
|
||||||
|
|
||||||
|
### Verification
|
||||||
|
|
||||||
|
After migration, verify everything works:
|
||||||
|
|
||||||
|
1. **List your tasks:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task-master list
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Check your configuration:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task-master models
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Generate new task files:**
|
||||||
|
```bash
|
||||||
|
task-master generate
|
||||||
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Migration Issues
|
||||||
|
|
||||||
|
**Q: Migration says "no files to migrate"**
|
||||||
|
A: Your project may already be using the new structure or have no Task Master files to migrate.
|
||||||
|
|
||||||
|
**Q: Migration fails with permission errors**
|
||||||
|
A: Ensure you have write permissions in your project directory.
|
||||||
|
|
||||||
|
**Q: Some files weren't migrated**
|
||||||
|
A: Check the migration output - some files may not match the expected patterns. You can migrate these manually.
|
||||||
|
|
||||||
|
### Working with Legacy Projects
|
||||||
|
|
||||||
|
If you're working with an older project that hasn't been migrated:
|
||||||
|
|
||||||
|
- Task Master will continue to work with the old structure
|
||||||
|
- You'll see deprecation warnings in the output
|
||||||
|
- New files will still be created in legacy locations
|
||||||
|
- Use the migration command when ready to upgrade
|
||||||
|
|
||||||
|
### New Project Initialization
|
||||||
|
|
||||||
|
New projects automatically use the new structure:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task-master init # Creates .taskmaster/ structure
|
||||||
|
```
|
||||||
|
|
||||||
|
## Path Changes for Developers
|
||||||
|
|
||||||
|
If you're developing tools or scripts that interact with Task Master files:
|
||||||
|
|
||||||
|
### Configuration File
|
||||||
|
|
||||||
|
- **Old:** `.taskmasterconfig`
|
||||||
|
- **New:** `.taskmaster/config.json`
|
||||||
|
- **Fallback:** Task Master checks both locations
|
||||||
|
|
||||||
|
### Tasks File
|
||||||
|
|
||||||
|
- **Old:** `tasks/tasks.json`
|
||||||
|
- **New:** `.taskmaster/tasks/tasks.json`
|
||||||
|
- **Fallback:** Task Master checks both locations
|
||||||
|
|
||||||
|
### Reports
|
||||||
|
|
||||||
|
- **Old:** `scripts/task-complexity-report.json`
|
||||||
|
- **New:** `.taskmaster/reports/task-complexity-report.json`
|
||||||
|
- **Fallback:** Task Master checks both locations
|
||||||
|
|
||||||
|
### PRD Files
|
||||||
|
|
||||||
|
- **Old:** `scripts/prd.txt`
|
||||||
|
- **New:** `.taskmaster/docs/prd.txt`
|
||||||
|
- **Fallback:** Task Master checks both locations
|
||||||
|
|
||||||
|
## Need Help?
|
||||||
|
|
||||||
|
If you encounter issues during migration:
|
||||||
|
|
||||||
|
1. **Check the logs:** Add `--debug` flag for detailed output
|
||||||
|
2. **Backup first:** Always use `--backup` option for safety
|
||||||
|
3. **Test with dry-run:** Use `--dry-run` to preview changes
|
||||||
|
4. **Ask for help:** Use our Discord community or GitHub issues
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_This migration guide applies to Task Master v0.15.x and later. For older versions, please upgrade to the latest version first._
|
||||||
128
docs/models.md
Normal file
128
docs/models.md
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
# Available Models as of June 13, 2025
|
||||||
|
|
||||||
|
## Main Models
|
||||||
|
|
||||||
|
| Provider | Model Name | SWE Score | Input Cost | Output Cost |
|
||||||
|
| ---------- | ---------------------------------------------- | --------- | ---------- | ----------- |
|
||||||
|
| anthropic | claude-sonnet-4-20250514 | 0.727 | 3 | 15 |
|
||||||
|
| anthropic | claude-opus-4-20250514 | 0.725 | 15 | 75 |
|
||||||
|
| anthropic | claude-3-7-sonnet-20250219 | 0.623 | 3 | 15 |
|
||||||
|
| anthropic | claude-3-5-sonnet-20241022 | 0.49 | 3 | 15 |
|
||||||
|
| openai | gpt-4o | 0.332 | 2.5 | 10 |
|
||||||
|
| openai | o1 | 0.489 | 15 | 60 |
|
||||||
|
| openai | o3 | 0.5 | 2 | 8 |
|
||||||
|
| openai | o3-mini | 0.493 | 1.1 | 4.4 |
|
||||||
|
| openai | o4-mini | 0.45 | 1.1 | 4.4 |
|
||||||
|
| openai | o1-mini | 0.4 | 1.1 | 4.4 |
|
||||||
|
| openai | o1-pro | — | 150 | 600 |
|
||||||
|
| openai | gpt-4-5-preview | 0.38 | 75 | 150 |
|
||||||
|
| openai | gpt-4-1-mini | — | 0.4 | 1.6 |
|
||||||
|
| openai | gpt-4-1-nano | — | 0.1 | 0.4 |
|
||||||
|
| openai | gpt-4o-mini | 0.3 | 0.15 | 0.6 |
|
||||||
|
| google | gemini-2.5-pro-preview-05-06 | 0.638 | — | — |
|
||||||
|
| google | gemini-2.5-pro-preview-03-25 | 0.638 | — | — |
|
||||||
|
| google | gemini-2.5-flash-preview-04-17 | — | — | — |
|
||||||
|
| google | gemini-2.0-flash | 0.754 | 0.15 | 0.6 |
|
||||||
|
| google | gemini-2.0-flash-lite | — | — | — |
|
||||||
|
| perplexity | sonar-pro | — | 3 | 15 |
|
||||||
|
| perplexity | sonar-reasoning-pro | 0.211 | 2 | 8 |
|
||||||
|
| perplexity | sonar-reasoning | 0.211 | 1 | 5 |
|
||||||
|
| xai | grok-3 | — | 3 | 15 |
|
||||||
|
| xai | grok-3-fast | — | 5 | 25 |
|
||||||
|
| ollama | devstral:latest | — | 0 | 0 |
|
||||||
|
| ollama | qwen3:latest | — | 0 | 0 |
|
||||||
|
| ollama | qwen3:14b | — | 0 | 0 |
|
||||||
|
| ollama | qwen3:32b | — | 0 | 0 |
|
||||||
|
| ollama | mistral-small3.1:latest | — | 0 | 0 |
|
||||||
|
| ollama | llama3.3:latest | — | 0 | 0 |
|
||||||
|
| ollama | phi4:latest | — | 0 | 0 |
|
||||||
|
| openrouter | google/gemini-2.5-flash-preview-05-20 | — | 0.15 | 0.6 |
|
||||||
|
| openrouter | google/gemini-2.5-flash-preview-05-20:thinking | — | 0.15 | 3.5 |
|
||||||
|
| openrouter | google/gemini-2.5-pro-exp-03-25 | — | 0 | 0 |
|
||||||
|
| openrouter | deepseek/deepseek-chat-v3-0324:free | — | 0 | 0 |
|
||||||
|
| openrouter | deepseek/deepseek-chat-v3-0324 | — | 0.27 | 1.1 |
|
||||||
|
| openrouter | openai/gpt-4.1 | — | 2 | 8 |
|
||||||
|
| openrouter | openai/gpt-4.1-mini | — | 0.4 | 1.6 |
|
||||||
|
| openrouter | openai/gpt-4.1-nano | — | 0.1 | 0.4 |
|
||||||
|
| openrouter | openai/o3 | — | 10 | 40 |
|
||||||
|
| openrouter | openai/codex-mini | — | 1.5 | 6 |
|
||||||
|
| openrouter | openai/gpt-4o-mini | — | 0.15 | 0.6 |
|
||||||
|
| openrouter | openai/o4-mini | 0.45 | 1.1 | 4.4 |
|
||||||
|
| openrouter | openai/o4-mini-high | — | 1.1 | 4.4 |
|
||||||
|
| openrouter | openai/o1-pro | — | 150 | 600 |
|
||||||
|
| openrouter | meta-llama/llama-3.3-70b-instruct | — | 120 | 600 |
|
||||||
|
| openrouter | meta-llama/llama-4-maverick | — | 0.18 | 0.6 |
|
||||||
|
| openrouter | meta-llama/llama-4-scout | — | 0.08 | 0.3 |
|
||||||
|
| openrouter | qwen/qwen-max | — | 1.6 | 6.4 |
|
||||||
|
| openrouter | qwen/qwen-turbo | — | 0.05 | 0.2 |
|
||||||
|
| openrouter | qwen/qwen3-235b-a22b | — | 0.14 | 2 |
|
||||||
|
| openrouter | mistralai/mistral-small-3.1-24b-instruct:free | — | 0 | 0 |
|
||||||
|
| openrouter | mistralai/mistral-small-3.1-24b-instruct | — | 0.1 | 0.3 |
|
||||||
|
| openrouter | mistralai/devstral-small | — | 0.1 | 0.3 |
|
||||||
|
| openrouter | mistralai/mistral-nemo | — | 0.03 | 0.07 |
|
||||||
|
| openrouter | thudm/glm-4-32b:free | — | 0 | 0 |
|
||||||
|
|
||||||
|
## Research Models
|
||||||
|
|
||||||
|
| Provider | Model Name | SWE Score | Input Cost | Output Cost |
|
||||||
|
| ---------- | -------------------------- | --------- | ---------- | ----------- |
|
||||||
|
| openai | gpt-4o-search-preview | 0.33 | 2.5 | 10 |
|
||||||
|
| openai | gpt-4o-mini-search-preview | 0.3 | 0.15 | 0.6 |
|
||||||
|
| perplexity | sonar-pro | — | 3 | 15 |
|
||||||
|
| perplexity | sonar | — | 1 | 1 |
|
||||||
|
| perplexity | deep-research | 0.211 | 2 | 8 |
|
||||||
|
| perplexity | sonar-reasoning-pro | 0.211 | 2 | 8 |
|
||||||
|
| perplexity | sonar-reasoning | 0.211 | 1 | 5 |
|
||||||
|
| xai | grok-3 | — | 3 | 15 |
|
||||||
|
| xai | grok-3-fast | — | 5 | 25 |
|
||||||
|
|
||||||
|
## Fallback Models
|
||||||
|
|
||||||
|
| Provider | Model Name | SWE Score | Input Cost | Output Cost |
|
||||||
|
| ---------- | ---------------------------------------------- | --------- | ---------- | ----------- |
|
||||||
|
| anthropic | claude-sonnet-4-20250514 | 0.727 | 3 | 15 |
|
||||||
|
| anthropic | claude-opus-4-20250514 | 0.725 | 15 | 75 |
|
||||||
|
| anthropic | claude-3-7-sonnet-20250219 | 0.623 | 3 | 15 |
|
||||||
|
| anthropic | claude-3-5-sonnet-20241022 | 0.49 | 3 | 15 |
|
||||||
|
| openai | gpt-4o | 0.332 | 2.5 | 10 |
|
||||||
|
| openai | o3 | 0.5 | 2 | 8 |
|
||||||
|
| openai | o4-mini | 0.45 | 1.1 | 4.4 |
|
||||||
|
| google | gemini-2.5-pro-preview-05-06 | 0.638 | — | — |
|
||||||
|
| google | gemini-2.5-pro-preview-03-25 | 0.638 | — | — |
|
||||||
|
| google | gemini-2.5-flash-preview-04-17 | — | — | — |
|
||||||
|
| google | gemini-2.0-flash | 0.754 | 0.15 | 0.6 |
|
||||||
|
| google | gemini-2.0-flash-lite | — | — | — |
|
||||||
|
| perplexity | sonar-reasoning-pro | 0.211 | 2 | 8 |
|
||||||
|
| perplexity | sonar-reasoning | 0.211 | 1 | 5 |
|
||||||
|
| xai | grok-3 | — | 3 | 15 |
|
||||||
|
| xai | grok-3-fast | — | 5 | 25 |
|
||||||
|
| ollama | devstral:latest | — | 0 | 0 |
|
||||||
|
| ollama | qwen3:latest | — | 0 | 0 |
|
||||||
|
| ollama | qwen3:14b | — | 0 | 0 |
|
||||||
|
| ollama | qwen3:32b | — | 0 | 0 |
|
||||||
|
| ollama | mistral-small3.1:latest | — | 0 | 0 |
|
||||||
|
| ollama | llama3.3:latest | — | 0 | 0 |
|
||||||
|
| ollama | phi4:latest | — | 0 | 0 |
|
||||||
|
| openrouter | google/gemini-2.5-flash-preview-05-20 | — | 0.15 | 0.6 |
|
||||||
|
| openrouter | google/gemini-2.5-flash-preview-05-20:thinking | — | 0.15 | 3.5 |
|
||||||
|
| openrouter | google/gemini-2.5-pro-exp-03-25 | — | 0 | 0 |
|
||||||
|
| openrouter | deepseek/deepseek-chat-v3-0324:free | — | 0 | 0 |
|
||||||
|
| openrouter | openai/gpt-4.1 | — | 2 | 8 |
|
||||||
|
| openrouter | openai/gpt-4.1-mini | — | 0.4 | 1.6 |
|
||||||
|
| openrouter | openai/gpt-4.1-nano | — | 0.1 | 0.4 |
|
||||||
|
| openrouter | openai/o3 | — | 10 | 40 |
|
||||||
|
| openrouter | openai/codex-mini | — | 1.5 | 6 |
|
||||||
|
| openrouter | openai/gpt-4o-mini | — | 0.15 | 0.6 |
|
||||||
|
| openrouter | openai/o4-mini | 0.45 | 1.1 | 4.4 |
|
||||||
|
| openrouter | openai/o4-mini-high | — | 1.1 | 4.4 |
|
||||||
|
| openrouter | openai/o1-pro | — | 150 | 600 |
|
||||||
|
| openrouter | meta-llama/llama-3.3-70b-instruct | — | 120 | 600 |
|
||||||
|
| openrouter | meta-llama/llama-4-maverick | — | 0.18 | 0.6 |
|
||||||
|
| openrouter | meta-llama/llama-4-scout | — | 0.08 | 0.3 |
|
||||||
|
| openrouter | qwen/qwen-max | — | 1.6 | 6.4 |
|
||||||
|
| openrouter | qwen/qwen-turbo | — | 0.05 | 0.2 |
|
||||||
|
| openrouter | qwen/qwen3-235b-a22b | — | 0.14 | 2 |
|
||||||
|
| openrouter | mistralai/mistral-small-3.1-24b-instruct:free | — | 0 | 0 |
|
||||||
|
| openrouter | mistralai/mistral-small-3.1-24b-instruct | — | 0.1 | 0.3 |
|
||||||
|
| openrouter | mistralai/mistral-nemo | — | 0.03 | 0.07 |
|
||||||
|
| openrouter | thudm/glm-4-32b:free | — | 0 | 0 |
|
||||||
131
docs/scripts/models-json-to-markdown.js
Normal file
131
docs/scripts/models-json-to-markdown.js
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
|
const supportedModelsPath = path.join(
|
||||||
|
__dirname,
|
||||||
|
'..',
|
||||||
|
'modules',
|
||||||
|
'supported-models.json'
|
||||||
|
);
|
||||||
|
const outputMarkdownPath = path.join(
|
||||||
|
__dirname,
|
||||||
|
'..',
|
||||||
|
'..',
|
||||||
|
'docs',
|
||||||
|
'models.md'
|
||||||
|
);
|
||||||
|
|
||||||
|
function formatCost(cost) {
|
||||||
|
if (cost === null || cost === undefined) {
|
||||||
|
return '—';
|
||||||
|
}
|
||||||
|
return cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatSweScore(score) {
|
||||||
|
if (score === null || score === undefined || score === 0) {
|
||||||
|
return '—';
|
||||||
|
}
|
||||||
|
return score.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateMarkdownTable(title, models) {
|
||||||
|
if (!models || models.length === 0) {
|
||||||
|
return `## ${title}\n\nNo models in this category.\n\n`;
|
||||||
|
}
|
||||||
|
let table = `## ${title}\n\n`;
|
||||||
|
table += '| Provider | Model Name | SWE Score | Input Cost | Output Cost |\n';
|
||||||
|
table += '|---|---|---|---|---|\n';
|
||||||
|
models.forEach((model) => {
|
||||||
|
table += `| ${model.provider} | ${model.modelName} | ${formatSweScore(model.sweScore)} | ${formatCost(model.inputCost)} | ${formatCost(model.outputCost)} |\n`;
|
||||||
|
});
|
||||||
|
table += '\n';
|
||||||
|
return table;
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
try {
|
||||||
|
const correctSupportedModelsPath = path.join(
|
||||||
|
__dirname,
|
||||||
|
'..',
|
||||||
|
'..',
|
||||||
|
'scripts',
|
||||||
|
'modules',
|
||||||
|
'supported-models.json'
|
||||||
|
);
|
||||||
|
const correctOutputMarkdownPath = path.join(__dirname, '..', 'models.md');
|
||||||
|
|
||||||
|
const supportedModelsContent = fs.readFileSync(
|
||||||
|
correctSupportedModelsPath,
|
||||||
|
'utf8'
|
||||||
|
);
|
||||||
|
const supportedModels = JSON.parse(supportedModelsContent);
|
||||||
|
|
||||||
|
const mainModels = [];
|
||||||
|
const researchModels = [];
|
||||||
|
const fallbackModels = [];
|
||||||
|
|
||||||
|
for (const provider in supportedModels) {
|
||||||
|
if (Object.hasOwnProperty.call(supportedModels, provider)) {
|
||||||
|
const models = supportedModels[provider];
|
||||||
|
models.forEach((model) => {
|
||||||
|
const modelEntry = {
|
||||||
|
provider: provider,
|
||||||
|
modelName: model.id,
|
||||||
|
sweScore: model.swe_score,
|
||||||
|
inputCost: model.cost_per_1m_tokens
|
||||||
|
? model.cost_per_1m_tokens.input
|
||||||
|
: null,
|
||||||
|
outputCost: model.cost_per_1m_tokens
|
||||||
|
? model.cost_per_1m_tokens.output
|
||||||
|
: null
|
||||||
|
};
|
||||||
|
|
||||||
|
if (model.allowed_roles.includes('main')) {
|
||||||
|
mainModels.push(modelEntry);
|
||||||
|
}
|
||||||
|
if (model.allowed_roles.includes('research')) {
|
||||||
|
researchModels.push(modelEntry);
|
||||||
|
}
|
||||||
|
if (model.allowed_roles.includes('fallback')) {
|
||||||
|
fallbackModels.push(modelEntry);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const date = new Date();
|
||||||
|
const monthNames = [
|
||||||
|
'January',
|
||||||
|
'February',
|
||||||
|
'March',
|
||||||
|
'April',
|
||||||
|
'May',
|
||||||
|
'June',
|
||||||
|
'July',
|
||||||
|
'August',
|
||||||
|
'September',
|
||||||
|
'October',
|
||||||
|
'November',
|
||||||
|
'December'
|
||||||
|
];
|
||||||
|
const formattedDate = `${monthNames[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()}`;
|
||||||
|
|
||||||
|
let markdownContent = `# Available Models as of ${formattedDate}\n\n`;
|
||||||
|
markdownContent += generateMarkdownTable('Main Models', mainModels);
|
||||||
|
markdownContent += generateMarkdownTable('Research Models', researchModels);
|
||||||
|
markdownContent += generateMarkdownTable('Fallback Models', fallbackModels);
|
||||||
|
|
||||||
|
fs.writeFileSync(correctOutputMarkdownPath, markdownContent, 'utf8');
|
||||||
|
console.log(`Successfully updated ${correctOutputMarkdownPath}`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error transforming models.json to models.md:', error);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
@@ -137,3 +137,290 @@ The `show` command:
|
|||||||
8. **Communicate context to the agent**: When asking the Cursor agent to help with a task, provide context about what you're trying to achieve.
|
8. **Communicate context to the agent**: When asking the Cursor agent to help with a task, provide context about what you're trying to achieve.
|
||||||
|
|
||||||
9. **Validate dependencies**: Periodically run the validate-dependencies command to check for invalid or circular dependencies.
|
9. **Validate dependencies**: Periodically run the validate-dependencies command to check for invalid or circular dependencies.
|
||||||
|
|
||||||
|
# Task Structure Documentation
|
||||||
|
|
||||||
|
Task Master uses a structured JSON format to organize and manage tasks. As of version 0.16.2, Task Master introduces **Tagged Task Lists** for multi-context task management while maintaining full backward compatibility.
|
||||||
|
|
||||||
|
## Tagged Task Lists System
|
||||||
|
|
||||||
|
Task Master now organizes tasks into separate contexts called **tags**. This enables working across multiple contexts such as different branches, environments, or project phases without conflicts.
|
||||||
|
|
||||||
|
### Data Structure Overview
|
||||||
|
|
||||||
|
**Tagged Format (Current)**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"master": {
|
||||||
|
"tasks": [
|
||||||
|
{ "id": 1, "title": "Setup API", "status": "pending", ... }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"feature-branch": {
|
||||||
|
"tasks": [
|
||||||
|
{ "id": 1, "title": "New Feature", "status": "pending", ... }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Legacy Format (Automatically Migrated)**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"tasks": [
|
||||||
|
{ "id": 1, "title": "Setup API", "status": "pending", ... }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Tag-based Task Lists (v0.17+) and Compatibility
|
||||||
|
|
||||||
|
- **Seamless Migration**: Existing `tasks.json` files are automatically migrated to use a "master" tag
|
||||||
|
- **Zero Disruption**: All existing commands continue to work exactly as before
|
||||||
|
- **Backward Compatibility**: Existing workflows remain unchanged
|
||||||
|
- **Silent Process**: Migration happens transparently on first use with a friendly notification
|
||||||
|
|
||||||
|
## Core Task Properties
|
||||||
|
|
||||||
|
Each task within a tag context contains the following properties:
|
||||||
|
|
||||||
|
### Required Properties
|
||||||
|
|
||||||
|
- **`id`** (number): Unique identifier within the tag context
|
||||||
|
|
||||||
|
```json
|
||||||
|
"id": 1
|
||||||
|
```
|
||||||
|
|
||||||
|
- **`title`** (string): Brief, descriptive title
|
||||||
|
|
||||||
|
```json
|
||||||
|
"title": "Implement user authentication"
|
||||||
|
```
|
||||||
|
|
||||||
|
- **`description`** (string): Concise summary of what the task involves
|
||||||
|
|
||||||
|
```json
|
||||||
|
"description": "Create a secure authentication system using JWT tokens"
|
||||||
|
```
|
||||||
|
|
||||||
|
- **`status`** (string): Current state of the task
|
||||||
|
- Valid values: `"pending"`, `"in-progress"`, `"done"`, `"review"`, `"deferred"`, `"cancelled"`
|
||||||
|
```json
|
||||||
|
"status": "pending"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Optional Properties
|
||||||
|
|
||||||
|
- **`dependencies`** (array): IDs of prerequisite tasks that must be completed first
|
||||||
|
|
||||||
|
```json
|
||||||
|
"dependencies": [2, 3]
|
||||||
|
```
|
||||||
|
|
||||||
|
- **`priority`** (string): Importance level
|
||||||
|
|
||||||
|
- Valid values: `"high"`, `"medium"`, `"low"`
|
||||||
|
- Default: `"medium"`
|
||||||
|
|
||||||
|
```json
|
||||||
|
"priority": "high"
|
||||||
|
```
|
||||||
|
|
||||||
|
- **`details`** (string): In-depth implementation instructions
|
||||||
|
|
||||||
|
```json
|
||||||
|
"details": "Use GitHub OAuth client ID/secret, handle callback, set session token"
|
||||||
|
```
|
||||||
|
|
||||||
|
- **`testStrategy`** (string): Verification approach
|
||||||
|
|
||||||
|
```json
|
||||||
|
"testStrategy": "Deploy and call endpoint to confirm authentication flow"
|
||||||
|
```
|
||||||
|
|
||||||
|
- **`subtasks`** (array): List of smaller, more specific tasks
|
||||||
|
```json
|
||||||
|
"subtasks": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "Configure OAuth",
|
||||||
|
"description": "Set up OAuth configuration",
|
||||||
|
"status": "pending",
|
||||||
|
"dependencies": [],
|
||||||
|
"details": "Configure GitHub OAuth app and store credentials"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Subtask Structure
|
||||||
|
|
||||||
|
Subtasks follow a similar structure to main tasks but with some differences:
|
||||||
|
|
||||||
|
### Subtask Properties
|
||||||
|
|
||||||
|
- **`id`** (number): Unique identifier within the parent task
|
||||||
|
- **`title`** (string): Brief, descriptive title
|
||||||
|
- **`description`** (string): Concise summary of the subtask
|
||||||
|
- **`status`** (string): Current state (same values as main tasks)
|
||||||
|
- **`dependencies`** (array): Can reference other subtasks or main task IDs
|
||||||
|
- **`details`** (string): Implementation instructions and notes
|
||||||
|
|
||||||
|
### Subtask Example
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"title": "Handle OAuth callback",
|
||||||
|
"description": "Process the OAuth callback and extract user data",
|
||||||
|
"status": "pending",
|
||||||
|
"dependencies": [1],
|
||||||
|
"details": "Parse callback parameters, exchange code for token, fetch user profile"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Complete Example
|
||||||
|
|
||||||
|
Here's a complete example showing the tagged task structure:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"master": {
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "Setup Express Server",
|
||||||
|
"description": "Initialize and configure Express.js server with middleware",
|
||||||
|
"status": "done",
|
||||||
|
"dependencies": [],
|
||||||
|
"priority": "high",
|
||||||
|
"details": "Create Express app with CORS, body parser, and error handling",
|
||||||
|
"testStrategy": "Start server and verify health check endpoint responds",
|
||||||
|
"subtasks": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "Initialize npm project",
|
||||||
|
"description": "Set up package.json and install dependencies",
|
||||||
|
"status": "done",
|
||||||
|
"dependencies": [],
|
||||||
|
"details": "Run npm init, install express, cors, body-parser"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"title": "Configure middleware",
|
||||||
|
"description": "Set up CORS and body parsing middleware",
|
||||||
|
"status": "done",
|
||||||
|
"dependencies": [1],
|
||||||
|
"details": "Add app.use() calls for cors() and express.json()"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"title": "Implement user authentication",
|
||||||
|
"description": "Create secure authentication system",
|
||||||
|
"status": "pending",
|
||||||
|
"dependencies": [1],
|
||||||
|
"priority": "high",
|
||||||
|
"details": "Use JWT tokens for session management",
|
||||||
|
"testStrategy": "Test login/logout flow with valid and invalid credentials",
|
||||||
|
"subtasks": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"feature-auth": {
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "OAuth Integration",
|
||||||
|
"description": "Add OAuth authentication support",
|
||||||
|
"status": "pending",
|
||||||
|
"dependencies": [],
|
||||||
|
"priority": "medium",
|
||||||
|
"details": "Integrate with GitHub OAuth for user authentication",
|
||||||
|
"testStrategy": "Test OAuth flow with GitHub account",
|
||||||
|
"subtasks": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tag Context Management
|
||||||
|
|
||||||
|
### Current Tag Resolution
|
||||||
|
|
||||||
|
Task Master automatically determines the current tag context based on:
|
||||||
|
|
||||||
|
1. **State Configuration**: Current tag stored in `.taskmaster/state.json`
|
||||||
|
2. **Default Fallback**: "master" tag when no context is specified
|
||||||
|
3. **Future Enhancement**: Git branch-based tag switching (Part 2)
|
||||||
|
|
||||||
|
### Tag Isolation
|
||||||
|
|
||||||
|
- **Context Separation**: Tasks in different tags are completely isolated
|
||||||
|
- **Independent Numbering**: Each tag has its own task ID sequence starting from 1
|
||||||
|
- **Parallel Development**: Multiple team members can work on separate tags without conflicts
|
||||||
|
|
||||||
|
## Data Validation
|
||||||
|
|
||||||
|
Task Master validates the following aspects of task data:
|
||||||
|
|
||||||
|
### Required Validations
|
||||||
|
|
||||||
|
- **Unique IDs**: Task IDs must be unique within each tag context
|
||||||
|
- **Valid Status**: Status values must be from the allowed set
|
||||||
|
- **Dependency References**: Dependencies must reference existing task IDs within the same tag
|
||||||
|
- **Subtask IDs**: Subtask IDs must be unique within their parent task
|
||||||
|
|
||||||
|
### Optional Validations
|
||||||
|
|
||||||
|
- **Circular Dependencies**: System detects and prevents circular dependency chains
|
||||||
|
- **Priority Values**: Priority must be one of the allowed values if specified
|
||||||
|
- **Data Types**: All properties must match their expected data types
|
||||||
|
|
||||||
|
## File Generation
|
||||||
|
|
||||||
|
Task Master can generate individual markdown files for each task based on the JSON structure. These files include:
|
||||||
|
|
||||||
|
- **Task Overview**: ID, title, status, dependencies
|
||||||
|
- **Tag Context**: Which tag the task belongs to
|
||||||
|
- **Implementation Details**: Full task details and test strategy
|
||||||
|
- **Subtask Breakdown**: All subtasks with their current status
|
||||||
|
- **Dependency Status**: Visual indicators showing which dependencies are complete
|
||||||
|
|
||||||
|
## Migration Process
|
||||||
|
|
||||||
|
When Task Master encounters a legacy format `tasks.json` file:
|
||||||
|
|
||||||
|
1. **Detection**: Automatically detects `{"tasks": [...]}` format
|
||||||
|
2. **Transformation**: Converts to `{"master": {"tasks": [...]}}` format
|
||||||
|
3. **Configuration**: Updates `.taskmaster/config.json` with tagged system settings
|
||||||
|
4. **State Creation**: Creates `.taskmaster/state.json` for tag management
|
||||||
|
5. **Notification**: Shows one-time friendly notice about the new system
|
||||||
|
6. **Preservation**: All existing task data is preserved exactly as-is
|
||||||
|
|
||||||
|
## Best Practices
|
||||||
|
|
||||||
|
### Task Organization
|
||||||
|
|
||||||
|
- **Logical Grouping**: Use tags to group related tasks (e.g., by feature, branch, or milestone)
|
||||||
|
- **Clear Titles**: Use descriptive titles that explain the task's purpose
|
||||||
|
- **Proper Dependencies**: Define dependencies to ensure correct execution order
|
||||||
|
- **Detailed Instructions**: Include sufficient detail in the `details` field for implementation
|
||||||
|
|
||||||
|
### Tag Management
|
||||||
|
|
||||||
|
- **Meaningful Names**: Use descriptive tag names that reflect their purpose
|
||||||
|
- **Consistent Naming**: Establish naming conventions for tags (e.g., branch names, feature names)
|
||||||
|
- **Context Switching**: Be aware of which tag context you're working in
|
||||||
|
- **Isolation Benefits**: Leverage tag isolation to prevent merge conflicts
|
||||||
|
|
||||||
|
### Subtask Design
|
||||||
|
|
||||||
|
- **Granular Tasks**: Break down complex tasks into manageable subtasks
|
||||||
|
- **Clear Dependencies**: Define subtask dependencies to show implementation order
|
||||||
|
- **Implementation Notes**: Use subtask details to track progress and decisions
|
||||||
|
- **Status Tracking**: Keep subtask status updated as work progresses
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user