diff --git a/.changeset/orange-pots-add.md b/.changeset/orange-pots-add.md new file mode 100644 index 00000000..7e855805 --- /dev/null +++ b/.changeset/orange-pots-add.md @@ -0,0 +1,24 @@ +--- +"task-master-ai": minor +--- + +Add comprehensive Kiro IDE integration with autonomous task management hooks + +- **Kiro Profile**: Added full support for Kiro IDE with automatic installation of 7 Taskmaster agent hooks +- **Hook-Driven Workflow**: Introduced natural language automation hooks that eliminate manual task status updates +- **Automatic Hook Installation**: Hooks are now automatically copied to `.kiro/hooks/` when running `task-master rules add kiro` +- **Language-Agnostic Support**: All hooks support multiple programming languages (JS, Python, Go, Rust, Java, etc.) +- **Frontmatter Transformation**: Kiro rules use simplified `inclusion: always` format instead of Cursor's complex frontmatter +- **Special Rule**: Added `taskmaster_hooks_workflow.md` that guides AI assistants to prefer hook-driven completion + +Key hooks included: + +- Task Dependency Auto-Progression: Automatically starts tasks when dependencies complete +- Code Change Task Tracker: Updates task progress as you save files +- Test Success Task Completer: Marks tasks done when tests pass +- Daily Standup Assistant: Provides personalized task status summaries +- PR Readiness Checker: Validates task completion before creating pull requests +- Complexity Analyzer: Auto-expands complex tasks into manageable subtasks +- Git Commit Task Linker: Links commits to tasks for better traceability + +This creates a truly autonomous development workflow where task management happens naturally as you code! diff --git a/.kiro/hooks/tm-code-change-task-tracker.kiro.hook b/.kiro/hooks/tm-code-change-task-tracker.kiro.hook new file mode 100644 index 00000000..774657e0 --- /dev/null +++ b/.kiro/hooks/tm-code-change-task-tracker.kiro.hook @@ -0,0 +1,23 @@ +{ + "enabled": true, + "name": "[TM] Code Change Task Tracker", + "description": "Track implementation progress by monitoring code changes", + "version": "1", + "when": { + "type": "fileEdited", + "patterns": [ + "**/*.{js,ts,jsx,tsx,py,go,rs,java,cpp,c,h,hpp,cs,rb,php,swift,kt,scala,clj}", + "!**/node_modules/**", + "!**/vendor/**", + "!**/.git/**", + "!**/build/**", + "!**/dist/**", + "!**/target/**", + "!**/__pycache__/**" + ] + }, + "then": { + "type": "askAgent", + "prompt": "I just saved a source code file. Please:\n\n1. Check what task is currently 'in-progress' using 'tm list --status=in-progress'\n2. Look at the file I saved and summarize what was changed (considering the programming language and context)\n3. Update the task's notes with: 'tm update-subtask --id= --prompt=\"Implemented: in \"'\n4. If the changes seem to complete the task based on its description, ask if I want to mark it as done" + } +} \ No newline at end of file diff --git a/.kiro/hooks/tm-complexity-analyzer.kiro.hook b/.kiro/hooks/tm-complexity-analyzer.kiro.hook new file mode 100644 index 00000000..ef7dcf83 --- /dev/null +++ b/.kiro/hooks/tm-complexity-analyzer.kiro.hook @@ -0,0 +1,16 @@ +{ + "enabled": false, + "name": "[TM] Complexity Analyzer", + "description": "Analyze task complexity when new tasks are added", + "version": "1", + "when": { + "type": "fileEdited", + "patterns": [ + ".taskmaster/tasks/tasks.json" + ] + }, + "then": { + "type": "askAgent", + "prompt": "New tasks were added to tasks.json. For each new task:\n\n1. Run 'tm analyze-complexity --id='\n2. If complexity score is > 7, automatically expand it: 'tm expand --id= --num=5'\n3. Show the complexity analysis results\n4. Suggest task dependencies based on the expanded subtasks" + } +} \ No newline at end of file diff --git a/.kiro/hooks/tm-daily-standup-assistant.kiro.hook b/.kiro/hooks/tm-daily-standup-assistant.kiro.hook new file mode 100644 index 00000000..eb3c783f --- /dev/null +++ b/.kiro/hooks/tm-daily-standup-assistant.kiro.hook @@ -0,0 +1,13 @@ +{ + "enabled": true, + "name": "[TM] Daily Standup Assistant", + "description": "Morning workflow summary and task selection", + "version": "1", + "when": { + "type": "userTriggered" + }, + "then": { + "type": "askAgent", + "prompt": "Good morning! Please provide my daily standup summary:\n\n1. Run 'tm list --status=done' and show tasks completed in the last 24 hours\n2. Run 'tm list --status=in-progress' to show current work\n3. Run 'tm next' to suggest the highest priority task to start\n4. Show the dependency graph for upcoming work\n5. Ask which task I'd like to focus on today" + } +} \ No newline at end of file diff --git a/.kiro/hooks/tm-git-commit-task-linker.kiro.hook b/.kiro/hooks/tm-git-commit-task-linker.kiro.hook new file mode 100644 index 00000000..c8d5d064 --- /dev/null +++ b/.kiro/hooks/tm-git-commit-task-linker.kiro.hook @@ -0,0 +1,13 @@ +{ + "enabled": true, + "name": "[TM] Git Commit Task Linker", + "description": "Link commits to tasks for traceability", + "version": "1", + "when": { + "type": "manual" + }, + "then": { + "type": "askAgent", + "prompt": "I'm about to commit code. Please:\n\n1. Run 'git diff --staged' to see what's being committed\n2. Analyze the changes and suggest which tasks they relate to\n3. Generate a commit message in format: 'feat(task-): '\n4. Update the relevant tasks with a note about this commit\n5. Show the proposed commit message for approval" + } +} \ No newline at end of file diff --git a/.kiro/hooks/tm-pr-readiness-checker.kiro.hook b/.kiro/hooks/tm-pr-readiness-checker.kiro.hook new file mode 100644 index 00000000..3c515206 --- /dev/null +++ b/.kiro/hooks/tm-pr-readiness-checker.kiro.hook @@ -0,0 +1,13 @@ +{ + "enabled": true, + "name": "[TM] PR Readiness Checker", + "description": "Validate tasks before creating a pull request", + "version": "1", + "when": { + "type": "manual" + }, + "then": { + "type": "askAgent", + "prompt": "I'm about to create a PR. Please:\n\n1. List all tasks marked as 'done' in this branch\n2. For each done task, verify:\n - All subtasks are also done\n - Test files exist for new functionality\n - No TODO comments remain related to the task\n3. Generate a PR description listing completed tasks\n4. Suggest a PR title based on the main tasks completed" + } +} \ No newline at end of file diff --git a/.kiro/hooks/tm-task-dependency-auto-progression.kiro.hook b/.kiro/hooks/tm-task-dependency-auto-progression.kiro.hook new file mode 100644 index 00000000..465e11d4 --- /dev/null +++ b/.kiro/hooks/tm-task-dependency-auto-progression.kiro.hook @@ -0,0 +1,17 @@ +{ + "enabled": true, + "name": "[TM] Task Dependency Auto-Progression", + "description": "Automatically progress tasks when dependencies are completed", + "version": "1", + "when": { + "type": "fileEdited", + "patterns": [ + ".taskmaster/tasks/tasks.json", + ".taskmaster/tasks/*.json" + ] + }, + "then": { + "type": "askAgent", + "prompt": "Check the tasks.json file for any tasks that just changed status to 'done'. For each completed task:\n\n1. Find all tasks that depend on it\n2. Check if those dependent tasks now have all their dependencies satisfied\n3. If a task has all dependencies met and is still 'pending', use the command 'tm set-status --id= --status=in-progress' to start it\n4. Show me which tasks were auto-started and why" + } +} \ No newline at end of file diff --git a/.kiro/hooks/tm-test-success-task-completer.kiro.hook b/.kiro/hooks/tm-test-success-task-completer.kiro.hook new file mode 100644 index 00000000..eb4469d8 --- /dev/null +++ b/.kiro/hooks/tm-test-success-task-completer.kiro.hook @@ -0,0 +1,23 @@ +{ + "enabled": true, + "name": "[TM] Test Success Task Completer", + "description": "Mark tasks as done when their tests pass", + "version": "1", + "when": { + "type": "fileEdited", + "patterns": [ + "**/*test*.{js,ts,jsx,tsx,py,go,java,rb,php,rs,cpp,cs}", + "**/*spec*.{js,ts,jsx,tsx,rb}", + "**/test_*.py", + "**/*_test.go", + "**/*Test.java", + "**/*Tests.cs", + "!**/node_modules/**", + "!**/vendor/**" + ] + }, + "then": { + "type": "askAgent", + "prompt": "A test file was just saved. Please:\n\n1. Identify the test framework/language and run the appropriate test command for this file (npm test, pytest, go test, cargo test, dotnet test, mvn test, etc.)\n2. If all tests pass, check which tasks mention this functionality\n3. For any matching tasks that are 'in-progress', ask if the passing tests mean the task is complete\n4. If confirmed, mark the task as done with 'tm set-status --id= --status=done'" + } +} \ No newline at end of file diff --git a/.kiro/settings/mcp.json b/.kiro/settings/mcp.json new file mode 100644 index 00000000..b157908c --- /dev/null +++ b/.kiro/settings/mcp.json @@ -0,0 +1,19 @@ +{ + "mcpServers": { + "task-master-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", + "XAI_API_KEY": "YOUR_XAI_KEY_HERE", + "OPENROUTER_API_KEY": "YOUR_OPENROUTER_KEY_HERE", + "MISTRAL_API_KEY": "YOUR_MISTRAL_KEY_HERE", + "AZURE_OPENAI_API_KEY": "YOUR_AZURE_KEY_HERE", + "OLLAMA_API_KEY": "YOUR_OLLAMA_API_KEY_HERE" + } + } + } +} diff --git a/.kiro/steering/dev_workflow.md b/.kiro/steering/dev_workflow.md new file mode 100644 index 00000000..1cba1a22 --- /dev/null +++ b/.kiro/steering/dev_workflow.md @@ -0,0 +1,422 @@ +--- +inclusion: always +--- + +# Taskmaster Development Workflow + +This guide outlines the standard process for using Taskmaster to manage software development projects. It is written as a set of instructions for you, the AI agent. + +- **Your Default Stance**: For most projects, the user can work directly within the `master` task context. Your initial actions should operate on this default context unless a clear pattern for multi-context work emerges. +- **Your Goal**: Your role is to elevate the user's workflow by intelligently introducing advanced features like **Tagged Task Lists** when you detect the appropriate context. Do not force tags on the user; suggest them as a helpful solution to a specific need. + +## The Basic Loop +The fundamental development cycle you will facilitate is: +1. **`list`**: Show the user what needs to be done. +2. **`next`**: Help the user decide what to work on. +3. **`show `**: Provide details for a specific task. +4. **`expand `**: Break down a complex task into smaller, manageable subtasks. +5. **Implement**: The user writes the code and tests. +6. **`update-subtask`**: Log progress and findings on behalf of the user. +7. **`set-status`**: Mark tasks and subtasks as `done` as work is completed. +8. **Repeat**. + +All your standard command executions should operate on the user's current task context, which defaults to `master`. + +--- + +## Standard Development Workflow Process + +### Simple Workflow (Default Starting Point) + +For new projects or when users are getting started, operate within the `master` tag context: + +- Start new projects by running `initialize_project` tool / `task-master init` or `parse_prd` / `task-master parse-prd --input=''` (see @`taskmaster.md`) to generate initial tasks.json with tagged structure +- Configure rule sets during initialization with `--rules` flag (e.g., `task-master init --rules kiro,windsurf`) or manage them later with `task-master rules add/remove` commands +- Begin coding sessions with `get_tasks` / `task-master list` (see @`taskmaster.md`) to see current tasks, status, and IDs +- Determine the next task to work on using `next_task` / `task-master next` (see @`taskmaster.md`) +- Analyze task complexity with `analyze_project_complexity` / `task-master analyze-complexity --research` (see @`taskmaster.md`) before breaking down tasks +- Review complexity report using `complexity_report` / `task-master complexity-report` (see @`taskmaster.md`) +- Select tasks based on dependencies (all marked 'done'), priority level, and ID order +- View specific task details using `get_task` / `task-master show ` (see @`taskmaster.md`) to understand implementation requirements +- Break down complex tasks using `expand_task` / `task-master expand --id= --force --research` (see @`taskmaster.md`) with appropriate flags like `--force` (to replace existing subtasks) and `--research` +- Implement code following task details, dependencies, and project standards +- Mark completed tasks with `set_task_status` / `task-master set-status --id= --status=done` (see @`taskmaster.md`) +- Update dependent tasks when implementation differs from original plan using `update` / `task-master update --from= --prompt="..."` or `update_task` / `task-master update-task --id= --prompt="..."` (see @`taskmaster.md`) + +--- + +## Leveling Up: Agent-Led Multi-Context Workflows + +While the basic workflow is powerful, your primary opportunity to add value is by identifying when to introduce **Tagged Task Lists**. These patterns are your tools for creating a more organized and efficient development environment for the user, especially if you detect agentic or parallel development happening across the same session. + +**Critical Principle**: Most users should never see a difference in their experience. Only introduce advanced workflows when you detect clear indicators that the project has evolved beyond simple task management. + +### When to Introduce Tags: Your Decision Patterns + +Here are the patterns to look for. When you detect one, you should propose the corresponding workflow to the user. + +#### Pattern 1: Simple Git Feature Branching +This is the most common and direct use case for tags. + +- **Trigger**: The user creates a new git branch (e.g., `git checkout -b feature/user-auth`). +- **Your Action**: Propose creating a new tag that mirrors the branch name to isolate the feature's tasks from `master`. +- **Your Suggested Prompt**: *"I see you've created a new branch named 'feature/user-auth'. To keep all related tasks neatly organized and separate from your main list, I can create a corresponding task tag for you. This helps prevent merge conflicts in your `tasks.json` file later. Shall I create the 'feature-user-auth' tag?"* +- **Tool to Use**: `task-master add-tag --from-branch` + +#### Pattern 2: Team Collaboration +- **Trigger**: The user mentions working with teammates (e.g., "My teammate Alice is handling the database schema," or "I need to review Bob's work on the API."). +- **Your Action**: Suggest creating a separate tag for the user's work to prevent conflicts with shared master context. +- **Your Suggested Prompt**: *"Since you're working with Alice, I can create a separate task context for your work to avoid conflicts. This way, Alice can continue working with the master list while you have your own isolated context. When you're ready to merge your work, we can coordinate the tasks back to master. Shall I create a tag for your current work?"* +- **Tool to Use**: `task-master add-tag my-work --copy-from-current --description="My tasks while collaborating with Alice"` + +#### Pattern 3: Experiments or Risky Refactors +- **Trigger**: The user wants to try something that might not be kept (e.g., "I want to experiment with switching our state management library," or "Let's refactor the old API module, but I want to keep the current tasks as a reference."). +- **Your Action**: Propose creating a sandboxed tag for the experimental work. +- **Your Suggested Prompt**: *"This sounds like a great experiment. To keep these new tasks separate from our main plan, I can create a temporary 'experiment-zustand' tag for this work. If we decide not to proceed, we can simply delete the tag without affecting the main task list. Sound good?"* +- **Tool to Use**: `task-master add-tag experiment-zustand --description="Exploring Zustand migration"` + +#### Pattern 4: Large Feature Initiatives (PRD-Driven) +This is a more structured approach for significant new features or epics. + +- **Trigger**: The user describes a large, multi-step feature that would benefit from a formal plan. +- **Your Action**: Propose a comprehensive, PRD-driven workflow. +- **Your Suggested Prompt**: *"This sounds like a significant new feature. To manage this effectively, I suggest we create a dedicated task context for it. Here's the plan: I'll create a new tag called 'feature-xyz', then we can draft a Product Requirements Document (PRD) together to scope the work. Once the PRD is ready, I'll automatically generate all the necessary tasks within that new tag. How does that sound?"* +- **Your Implementation Flow**: + 1. **Create an empty tag**: `task-master add-tag feature-xyz --description "Tasks for the new XYZ feature"`. You can also start by creating a git branch if applicable, and then create the tag from that branch. + 2. **Collaborate & Create PRD**: Work with the user to create a detailed PRD file (e.g., `.taskmaster/docs/feature-xyz-prd.txt`). + 3. **Parse PRD into the new tag**: `task-master parse-prd .taskmaster/docs/feature-xyz-prd.txt --tag feature-xyz` + 4. **Prepare the new task list**: Follow up by suggesting `analyze-complexity` and `expand-all` for the newly created tasks within the `feature-xyz` tag. + +#### Pattern 5: Version-Based Development +Tailor your approach based on the project maturity indicated by tag names. + +- **Prototype/MVP Tags** (`prototype`, `mvp`, `poc`, `v0.x`): + - **Your Approach**: Focus on speed and functionality over perfection + - **Task Generation**: Create tasks that emphasize "get it working" over "get it perfect" + - **Complexity Level**: Lower complexity, fewer subtasks, more direct implementation paths + - **Research Prompts**: Include context like "This is a prototype - prioritize speed and basic functionality over optimization" + - **Example Prompt Addition**: *"Since this is for the MVP, I'll focus on tasks that get core functionality working quickly rather than over-engineering."* + +- **Production/Mature Tags** (`v1.0+`, `production`, `stable`): + - **Your Approach**: Emphasize robustness, testing, and maintainability + - **Task Generation**: Include comprehensive error handling, testing, documentation, and optimization + - **Complexity Level**: Higher complexity, more detailed subtasks, thorough implementation paths + - **Research Prompts**: Include context like "This is for production - prioritize reliability, performance, and maintainability" + - **Example Prompt Addition**: *"Since this is for production, I'll ensure tasks include proper error handling, testing, and documentation."* + +### Advanced Workflow (Tag-Based & PRD-Driven) + +**When to Transition**: Recognize when the project has evolved (or has initiated a project which existing code) beyond simple task management. Look for these indicators: +- User mentions teammates or collaboration needs +- Project has grown to 15+ tasks with mixed priorities +- User creates feature branches or mentions major initiatives +- User initializes Taskmaster on an existing, complex codebase +- User describes large features that would benefit from dedicated planning + +**Your Role in Transition**: Guide the user to a more sophisticated workflow that leverages tags for organization and PRDs for comprehensive planning. + +#### Master List Strategy (High-Value Focus) +Once you transition to tag-based workflows, the `master` tag should ideally contain only: +- **High-level deliverables** that provide significant business value +- **Major milestones** and epic-level features +- **Critical infrastructure** work that affects the entire project +- **Release-blocking** items + +**What NOT to put in master**: +- Detailed implementation subtasks (these go in feature-specific tags' parent tasks) +- Refactoring work (create dedicated tags like `refactor-auth`) +- Experimental features (use `experiment-*` tags) +- Team member-specific tasks (use person-specific tags) + +#### PRD-Driven Feature Development + +**For New Major Features**: +1. **Identify the Initiative**: When user describes a significant feature +2. **Create Dedicated Tag**: `add_tag feature-[name] --description="[Feature description]"` +3. **Collaborative PRD Creation**: Work with user to create comprehensive PRD in `.taskmaster/docs/feature-[name]-prd.txt` +4. **Parse & Prepare**: + - `parse_prd .taskmaster/docs/feature-[name]-prd.txt --tag=feature-[name]` + - `analyze_project_complexity --tag=feature-[name] --research` + - `expand_all --tag=feature-[name] --research` +5. **Add Master Reference**: Create a high-level task in `master` that references the feature tag + +**For Existing Codebase Analysis**: +When users initialize Taskmaster on existing projects: +1. **Codebase Discovery**: Use your native tools for producing deep context about the code base. You may use `research` tool with `--tree` and `--files` to collect up to date information using the existing architecture as context. +2. **Collaborative Assessment**: Work with user to identify improvement areas, technical debt, or new features +3. **Strategic PRD Creation**: Co-author PRDs that include: + - Current state analysis (based on your codebase research) + - Proposed improvements or new features + - Implementation strategy considering existing code +4. **Tag-Based Organization**: Parse PRDs into appropriate tags (`refactor-api`, `feature-dashboard`, `tech-debt`, etc.) +5. **Master List Curation**: Keep only the most valuable initiatives in master + +The parse-prd's `--append` flag enables the user to parse multiple PRDs within tags or across tags. PRDs should be focused and the number of tasks they are parsed into should be strategically chosen relative to the PRD's complexity and level of detail. + +### Workflow Transition Examples + +**Example 1: Simple → Team-Based** +``` +User: "Alice is going to help with the API work" +Your Response: "Great! To avoid conflicts, I'll create a separate task context for your work. Alice can continue with the master list while you work in your own context. When you're ready to merge, we can coordinate the tasks back together." +Action: add_tag my-api-work --copy-from-current --description="My API tasks while collaborating with Alice" +``` + +**Example 2: Simple → PRD-Driven** +``` +User: "I want to add a complete user dashboard with analytics, user management, and reporting" +Your Response: "This sounds like a major feature that would benefit from detailed planning. Let me create a dedicated context for this work and we can draft a PRD together to ensure we capture all requirements." +Actions: +1. add_tag feature-dashboard --description="User dashboard with analytics and management" +2. Collaborate on PRD creation +3. parse_prd dashboard-prd.txt --tag=feature-dashboard +4. Add high-level "User Dashboard" task to master +``` + +**Example 3: Existing Project → Strategic Planning** +``` +User: "I just initialized Taskmaster on my existing React app. It's getting messy and I want to improve it." +Your Response: "Let me research your codebase to understand the current architecture, then we can create a strategic plan for improvements." +Actions: +1. research "Current React app architecture and improvement opportunities" --tree --files=src/ +2. Collaborate on improvement PRD based on findings +3. Create tags for different improvement areas (refactor-components, improve-state-management, etc.) +4. Keep only major improvement initiatives in master +``` + +--- + +## Primary Interaction: MCP Server vs. CLI + +Taskmaster offers two primary ways to interact: + +1. **MCP Server (Recommended for Integrated Tools)**: + - For AI agents and integrated development environments (like Kiro), interacting via the **MCP server is the preferred method**. + - The MCP server exposes Taskmaster functionality through a set of tools (e.g., `get_tasks`, `add_subtask`). + - This method offers better performance, structured data exchange, and richer error handling compared to CLI parsing. + - Refer to @`mcp.md` 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.md`. + - **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)**: + - The global `task-master` command provides a user-friendly interface for direct terminal interaction. + - It can also serve as a fallback if the MCP server is inaccessible or a specific function isn't exposed via MCP. + - 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`). + - Refer to @`taskmaster.md` for a detailed command reference. + - **Tagged Task Lists**: CLI fully supports the new tagged system with seamless migration. + +## How the Tag System Works (For Your Reference) + +- **Data Structure**: Tasks are organized into separate contexts (tags) like "master", "feature-branch", or "v2.0". +- **Silent Migration**: Existing projects automatically migrate to use a "master" tag with zero disruption. +- **Context Isolation**: Tasks in different tags are completely separate. Changes in one tag do not affect any other tag. +- **Manual Control**: The user is always in control. There is no automatic switching. You facilitate switching by using `use-tag `. +- **Full CLI & MCP Support**: All tag management commands are available through both the CLI and MCP tools for you to use. Refer to @`taskmaster.md` for a full command list. + +--- + +## Task Complexity Analysis + +- Run `analyze_project_complexity` / `task-master analyze-complexity --research` (see @`taskmaster.md`) for comprehensive analysis +- Review complexity report via `complexity_report` / `task-master complexity-report` (see @`taskmaster.md`) for a formatted, readable version. +- Focus on tasks with highest complexity scores (8-10) for detailed breakdown +- Use analysis results to determine appropriate subtask allocation +- Note that reports are automatically used by the `expand_task` tool/command + +## Task Breakdown Process + +- Use `expand_task` / `task-master expand --id=`. It automatically uses the complexity report if found, otherwise generates default number of subtasks. +- Use `--num=` 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 `--force` flag to clear existing subtasks before generating new ones (default is to append). +- Use `--prompt=""` to provide additional context when needed. +- Review and adjust generated subtasks as necessary. +- 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=`. + +## Implementation Drift Handling + +- When implementation differs significantly from planned approach +- When future tasks need modification due to current implementation choices +- When new dependencies or requirements emerge +- Use `update` / `task-master update --from= --prompt='\nUpdate context...' --research` to update multiple future tasks. +- Use `update_task` / `task-master update-task --id= --prompt='\nUpdate context...' --research` to update a single specific task. + +## Task Status Management + +- Use 'pending' for tasks ready to be worked on +- Use 'done' for completed and verified tasks +- Use 'deferred' for postponed tasks +- Add custom status values as needed for project-specific workflows + +## Task Structure Fields + +- **id**: Unique identifier for the task (Example: `1`, `1.1`) +- **title**: Brief, descriptive title (Example: `"Initialize Repo"`) +- **description**: Concise summary of what the task involves (Example: `"Create a new repository, set up initial structure."`) +- **status**: Current state of the task (Example: `"pending"`, `"done"`, `"deferred"`) +- **dependencies**: IDs of prerequisite tasks (Example: `[1, 2.1]`) + - Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending) + - This helps quickly identify which prerequisite tasks are blocking work +- **priority**: Importance level (Example: `"high"`, `"medium"`, `"low"`) +- **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."`) +- **subtasks**: List of smaller, more specific tasks (Example: `[{"id": 1, "title": "Configure OAuth", ...}]`) +- Refer to task structure details (previously linked to `tasks.md`). + +## Configuration Management (Updated) + +Taskmaster configuration is managed through two main mechanisms: + +1. **`.taskmaster/config.json` File (Primary):** + * Located in the project root directory. + * Stores most configuration settings: AI model selections (main, research, fallback), parameters (max tokens, temperature), logging level, default subtasks/priority, project name, etc. + * **Tagged System Settings**: Includes `global.defaultTag` (defaults to "master") and `tags` section for tag management configuration. + * **Managed via `task-master models --setup` command.** Do not edit manually unless you know what you are doing. + * **View/Set specific models via `task-master models` command or `models` MCP tool.** + * Created automatically when you run `task-master models --setup` for the first time or during tagged system migration. + +2. **Environment Variables (`.env` / `mcp.json`):** + * Used **only** for sensitive API keys and specific endpoint URLs. + * Place API keys (one per provider) in a `.env` file in the project root for CLI usage. + * For MCP/Kiro integration, configure these keys in the `env` section of `.kiro/mcp.json`. + * Available keys/variables: See `assets/env.example` or the Configuration section in the command reference (previously linked to `taskmaster.md`). + +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 `.kiro/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. + +## Rules Management + +Taskmaster supports multiple AI coding assistant rule sets that can be configured during project initialization or managed afterward: + +- **Available Profiles**: Claude Code, Cline, Codex, Kiro, Roo Code, Trae, Windsurf (claude, cline, codex, kiro, roo, trae, windsurf) +- **During Initialization**: Use `task-master init --rules kiro,windsurf` to specify which rule sets to include +- **After Initialization**: Use `task-master rules add ` or `task-master rules remove ` to manage rule sets +- **Interactive Setup**: Use `task-master rules setup` to launch an interactive prompt for selecting rule profiles +- **Default Behavior**: If no `--rules` flag is specified during initialization, all available rule profiles are included +- **Rule Structure**: Each profile creates its own directory (e.g., `.kiro/steering`, `.roo/rules`) with appropriate configuration files + +## Determining the Next Task + +- Run `next_task` / `task-master next` to show the next task to work on. +- The command identifies tasks with all dependencies satisfied +- Tasks are prioritized by priority level, dependency count, and ID +- The command shows comprehensive task information including: + - Basic task details and description + - Implementation details + - Subtasks (if they exist) + - Contextual suggested actions +- Recommended before starting any new development work +- Respects your project's dependency structure +- Ensures tasks are completed in the appropriate sequence +- Provides ready-to-use commands for common task actions + +## Viewing Specific Task Details + +- Run `get_task` / `task-master show ` to view a specific task. +- 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 +- For parent tasks, shows all subtasks and their current status +- For subtasks, shows parent task information and relationship +- Provides contextual suggested actions appropriate for the specific task +- Useful for examining task details before implementation or checking status + +## Managing Task Dependencies + +- Use `add_dependency` / `task-master add-dependency --id= --depends-on=` to add a dependency. +- Use `remove_dependency` / `task-master remove-dependency --id= --depends-on=` to remove a dependency. +- The system prevents circular dependencies and duplicate dependency entries +- Dependencies are checked for existence before being added or removed +- Task files are automatically regenerated after dependency changes +- Dependencies are visualized with status indicators in task listings and files + +## Task Reorganization + +- Use `move_task` / `task-master move --from= --to=` 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 + +Once a task has been broken down into subtasks using `expand_task` or similar methods, follow this iterative process for implementation: + +1. **Understand the Goal (Preparation):** + * Use `get_task` / `task-master show ` (see @`taskmaster.md`) to thoroughly understand the specific goals and requirements of the subtask. + +2. **Initial Exploration & Planning (Iteration 1):** + * This is the first attempt at creating a concrete implementation plan. + * Explore the codebase to identify the precise files, functions, and even specific lines of code that will need modification. + * Determine the intended code changes (diffs) and their locations. + * Gather *all* relevant details from this exploration phase. + +3. **Log the Plan:** + * Run `update_subtask` / `task-master update-subtask --id= --prompt=''`. + * 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:** + * Run `get_task` / `task-master show ` again to confirm that the detailed implementation plan has been successfully appended to the subtask's details. + +5. **Begin Implementation:** + * Set the subtask status using `set_task_status` / `task-master set-status --id= --status=in-progress`. + * Start coding based on the logged plan. + +6. **Refine and Log Progress (Iteration 2+):** + * As implementation progresses, you will encounter challenges, discover nuances, or confirm successful approaches. + * **Before appending new information**: Briefly review the *existing* details logged in the subtask (using `get_task` or recalling from context) to ensure the update adds fresh insights and avoids redundancy. + * **Regularly** use `update_subtask` / `task-master update-subtask --id= --prompt='\n- What worked...\n- What didn't work...'` to append new findings. + * **Crucially, log:** + * What worked ("fundamental truths" discovered). + * What didn't work and why (to avoid repeating mistakes). + * Specific code snippets or configurations that were successful. + * Decisions made, especially if confirmed with user input. + * Any deviations from the initial plan and the reasoning. + * The objective is to continuously enrich the subtask's details, creating a log of the implementation journey that helps the AI (and human developers) learn, adapt, and avoid repeating errors. + +7. **Review & Update Rules (Post-Implementation):** + * 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. + * Create new or update existing rules following internal guidelines (previously linked to `cursor_rules.md` and `self_improve.md`). + +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= --status=done`. + +9. **Commit Changes (If using Git):** + * 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. + * Execute the commit command directly in the terminal (e.g., `git commit -m 'feat(module): Implement feature X for subtask \n\n- Details about changes...\n- Updated rule Y for pattern Z'`). + * Consider if a Changeset is needed according to internal versioning guidelines (previously linked to `changeset.md`). If so, run `npm run changeset`, stage the generated file, and amend the commit or create a new one. + +10. **Proceed to Next Subtask:** + * Identify the next subtask (e.g., using `next_task` / `task-master next`). + +## Code Analysis & Refactoring Techniques + +- **Top-Level Function Search**: + - Useful for understanding module structure or planning refactors. + - Use grep/ripgrep to find exported functions/constants: + `rg "export (async function|function|const) \w+"` or similar patterns. + - Can help compare functions between files during migrations or identify potential naming conflicts. + +--- +*This workflow provides a general guideline. Adapt it based on your specific project needs and team practices.* \ No newline at end of file diff --git a/.kiro/steering/kiro_rules.md b/.kiro/steering/kiro_rules.md new file mode 100644 index 00000000..df6e17ac --- /dev/null +++ b/.kiro/steering/kiro_rules.md @@ -0,0 +1,51 @@ +--- +inclusion: always +--- + +- **Required Rule Structure:** + ```markdown + --- + description: Clear, one-line description of what the rule enforces + globs: path/to/files/*.ext, other/path/**/* + alwaysApply: boolean + --- + + - **Main Points in Bold** + - Sub-points with details + - Examples and explanations + ``` + +- **File References:** + - Use `[filename](mdc:path/to/file)` ([filename](mdc:filename)) to reference files + - Example: [prisma.md](.kiro/steering/prisma.md) for rule references + - Example: [schema.prisma](mdc:prisma/schema.prisma) for code references + +- **Code Examples:** + - Use language-specific code blocks + ```typescript + // ✅ DO: Show good examples + const goodExample = true; + + // ❌ DON'T: Show anti-patterns + const badExample = false; + ``` + +- **Rule Content Guidelines:** + - Start with high-level overview + - Include specific, actionable requirements + - Show examples of correct implementation + - Reference existing code when possible + - Keep rules DRY by referencing other rules + +- **Rule Maintenance:** + - Update rules when new patterns emerge + - Add examples from actual codebase + - Remove outdated patterns + - Cross-reference related rules + +- **Best Practices:** + - Use bullet points for clarity + - Keep descriptions concise + - Include both DO and DON'T examples + - Reference actual code over theoretical examples + - Use consistent formatting across rules \ No newline at end of file diff --git a/.kiro/steering/self_improve.md b/.kiro/steering/self_improve.md new file mode 100644 index 00000000..ec816b78 --- /dev/null +++ b/.kiro/steering/self_improve.md @@ -0,0 +1,70 @@ +--- +inclusion: always +--- + +- **Rule Improvement Triggers:** + - New code patterns not covered by existing rules + - Repeated similar implementations across files + - Common error patterns that could be prevented + - New libraries or tools being used consistently + - Emerging best practices in the codebase + +- **Analysis Process:** + - Compare new code with existing rules + - Identify patterns that should be standardized + - Look for references to external documentation + - Check for consistent error handling patterns + - Monitor test patterns and coverage + +- **Rule Updates:** + - **Add New Rules When:** + - A new technology/pattern is used in 3+ files + - Common bugs could be prevented by a rule + - Code reviews repeatedly mention the same feedback + - New security or performance patterns emerge + + - **Modify Existing Rules When:** + - Better examples exist in the codebase + - Additional edge cases are discovered + - Related rules have been updated + - Implementation details have changed + +- **Example Pattern Recognition:** + ```typescript + // If you see repeated patterns like: + const data = await prisma.user.findMany({ + select: { id: true, email: true }, + where: { status: 'ACTIVE' } + }); + + // Consider adding to [prisma.md](.kiro/steering/prisma.md): + // - Standard select fields + // - Common where conditions + // - Performance optimization patterns + ``` + +- **Rule Quality Checks:** + - Rules should be actionable and specific + - Examples should come from actual code + - References should be up to date + - Patterns should be consistently enforced + +- **Continuous Improvement:** + - Monitor code review comments + - Track common development questions + - Update rules after major refactors + - Add links to relevant documentation + - Cross-reference related rules + +- **Rule Deprecation:** + - Mark outdated patterns as deprecated + - Remove rules that no longer apply + - Update references to deprecated rules + - Document migration paths for old patterns + +- **Documentation Updates:** + - Keep examples synchronized with code + - Update references to external docs + - Maintain links between related rules + - Document breaking changes +Follow [kiro_rules.md](.kiro/steering/kiro_rules.md) for proper rule formatting and structure. diff --git a/.kiro/steering/taskmaster.md b/.kiro/steering/taskmaster.md new file mode 100644 index 00000000..90cc9c88 --- /dev/null +++ b/.kiro/steering/taskmaster.md @@ -0,0 +1,556 @@ +--- +inclusion: always +--- + +# Taskmaster Tool & Command Reference + +This document provides a detailed reference for interacting with Taskmaster, covering both the recommended MCP tools, suitable for integrations like Kiro, 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. + +**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 ` flag to specify which context to operate on. If omitted, commands use the currently active tag. + +--- + +## Initialization & Setup + +### 1. Initialize Project (`init`) + +* **MCP Tool:** `initialize_project` +* **CLI Command:** `task-master init [options]` +* **Description:** `Set up the basic Taskmaster file structure and configuration in the current directory for a new project.` +* **Key CLI Options:** + * `--name `: `Set the name for your project in Taskmaster's configuration.` + * `--description `: `Provide a brief description for your project.` + * `--version `: `Set the initial version for your project, e.g., '0.1.0'.` + * `-y, --yes`: `Initialize Taskmaster quickly using default settings without interactive prompts.` +* **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.` +* **Key MCP Parameters/Options:** + * `projectName`: `Set the name for your project.` (CLI: `--name `) + * `projectDescription`: `Provide a brief description for your project.` (CLI: `--description `) + * `projectVersion`: `Set the initial version for your project, e.g., '0.1.0'.` (CLI: `--version `) + * `authorName`: `Author name.` (CLI: `--author `) + * `skipInstall`: `Skip installing dependencies. Default is false.` (CLI: `--skip-install`) + * `addAliases`: `Add shell aliases tm and taskmaster. Default is false.` (CLI: `--aliases`) + * `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 Kiro. 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`) + +* **MCP Tool:** `parse_prd` +* **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.` +* **Key Parameters/Options:** + * `input`: `Path to your PRD or requirements text file that Taskmaster should parse for tasks.` (CLI: `[file]` positional or `-i, --input `) + * `output`: `Specify where Taskmaster should save the generated 'tasks.json' file. Defaults to '.taskmaster/tasks/tasks.json'.` (CLI: `-o, --output `) + * `numTasks`: `Approximate number of top-level tasks Taskmaster should aim to generate from the document.` (CLI: `-n, --num-tasks `) + * `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. +* **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. 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 `: `Set the primary model ID for task generation/updates.` (CLI: `--set-main `) + * `setResearch `: `Set the model ID for research-backed operations.` (CLI: `--set-research `) + * `setFallback `: `Set the model ID to use if the primary fails.` (CLI: `--set-fallback `) + * `ollama `: `Indicates the set model ID is a custom Ollama model.` (CLI: `--ollama`) + * `openrouter `: `Indicates the set model ID is a custom OpenRouter model.` (CLI: `--openrouter`) + * `listAvailableModels `: `If true, lists available models not currently assigned to a role.` (CLI: No direct equivalent; CLI lists available automatically) + * `projectRoot `: `Optional. Absolute path to the project root directory.` (CLI: Determined automatically) +* **Key CLI Options:** + * `--set-main `: `Set the primary model.` + * `--set-research `: `Set the research model.` + * `--set-fallback `: `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.` + * `--bedrock`: `Specify that the provided model ID is for AWS Bedrock (use with --set-*).` + * `--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-=` 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. + +--- + +## Task Listing & Viewing + +### 3. Get Tasks (`get_tasks`) + +* **MCP Tool:** `get_tasks` +* **CLI Command:** `task-master list [options]` +* **Description:** `List your Taskmaster tasks, optionally filtering by status and showing subtasks.` +* **Key Parameters/Options:** + * `status`: `Show only Taskmaster tasks matching this status (or multiple statuses, comma-separated), e.g., 'pending' or 'done,in-progress'.` (CLI: `-s, --status `) + * `withSubtasks`: `Include subtasks indented under their parent tasks in the list.` (CLI: `--with-subtasks`) + * `tag`: `Specify which tag context to list tasks from. Defaults to the current active tag.` (CLI: `--tag `) + * `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file `) +* **Usage:** Get an overview of the project status, often used at the start of a work session. + +### 4. Get Next Task (`next_task`) + +* **MCP Tool:** `next_task` +* **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.` +* **Key Parameters/Options:** + * `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file `) + * `tag`: `Specify which tag context to use. Defaults to the current active tag.` (CLI: `--tag `) +* **Usage:** Identify what to work on next according to the plan. + +### 5. Get Task Details (`get_task`) + +* **MCP Tool:** `get_task` +* **CLI Command:** `task-master show [id] [options]` +* **Description:** `Display detailed information for one or more specific Taskmaster tasks or subtasks by ID.` +* **Key Parameters/Options:** + * `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 `) + * `tag`: `Specify which tag context to get the task(s) from. Defaults to the current active tag.` (CLI: `--tag `) + * `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --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. + +--- + +## Task Creation & Modification + +### 6. Add Task (`add_task`) + +* **MCP Tool:** `add_task` +* **CLI Command:** `task-master add-task [options]` +* **Description:** `Add a new task to Taskmaster by describing it; AI will structure it.` +* **Key Parameters/Options:** + * `prompt`: `Required. Describe the new task you want Taskmaster to create, e.g., "Implement user authentication using JWT".` (CLI: `-p, --prompt `) + * `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 `) + * `priority`: `Set the priority for the new task: 'high', 'medium', or 'low'. Default is 'medium'.` (CLI: `--priority `) + * `research`: `Enable Taskmaster to use the research role for potentially more informed task creation.` (CLI: `-r, --research`) + * `tag`: `Specify which tag context to add the task to. Defaults to the current active tag.` (CLI: `--tag `) + * `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file `) +* **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. + +### 7. Add Subtask (`add_subtask`) + +* **MCP Tool:** `add_subtask` +* **CLI Command:** `task-master add-subtask [options]` +* **Description:** `Add a new subtask to a Taskmaster parent task, or convert an existing task into a subtask.` +* **Key Parameters/Options:** + * `id` / `parent`: `Required. The ID of the Taskmaster task that will be the parent.` (MCP: `id`, CLI: `-p, --parent `) + * `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 `) + * `title`: `Required if not using taskId. The title for the new subtask Taskmaster should create.` (CLI: `-t, --title `) + * `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>`) + * `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 is 'pending'.` (CLI: `-s, --status <status>`) + * `generate`: `Enable Taskmaster to regenerate markdown task files after adding the subtask.` (CLI: `--generate`) + * `tag`: `Specify which tag context to operate on. 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:** Break down tasks manually or reorganize existing tasks. + +### 8. Update Tasks (`update`) + +* **MCP Tool:** `update` +* **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.` +* **Key Parameters/Options:** + * `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>`) + * `research`: `Enable Taskmaster to use the research role for more informed updates. Requires appropriate API key.` (CLI: `-r, --research`) + * `tag`: `Specify which tag context to operate on. 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:** 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. + +### 9. Update Task (`update_task`) + +* **MCP Tool:** `update_task` +* **CLI Command:** `task-master update-task [options]` +* **Description:** `Modify a specific Taskmaster task by ID, incorporating new information or changes. By default, this replaces the existing task details.` +* **Key Parameters/Options:** + * `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>`) + * `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`) + * `research`: `Enable Taskmaster to use the research role for more informed updates. Requires appropriate API key.` (CLI: `-r, --research`) + * `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. + +### 10. Update Subtask (`update_subtask`) + +* **MCP Tool:** `update_subtask` +* **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.` +* **Key Parameters/Options:** + * `id`: `Required. The ID of the Taskmaster subtask, e.g., '5.2', to update with new information.` (CLI: `-i, --id <id>`) + * `prompt`: `Required. The information, findings, or progress notes to append to the subtask's details with a timestamp.` (CLI: `-p, --prompt <text>`) + * `research`: `Enable Taskmaster to use the research role for more informed updates. Requires appropriate API key.` (CLI: `-r, --research`) + * `tag`: `Specify which tag context the subtask 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:** Log implementation progress, findings, and discoveries during subtask development. Each update is timestamped and appended to preserve the implementation journey. +* **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. + +### 11. Set Task Status (`set_task_status`) + +* **MCP Tool:** `set_task_status` +* **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'.` +* **Key Parameters/Options:** + * `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>`) + * `tag`: `Specify which tag context to operate on. 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:** Mark progress as tasks move through the development cycle. + +### 12. Remove Task (`remove_task`) + +* **MCP Tool:** `remove_task` +* **CLI Command:** `task-master remove-task [options]` +* **Description:** `Permanently remove a task or subtask from the Taskmaster tasks list.` +* **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>`) + * `yes`: `Skip the confirmation prompt and immediately delete the task.` (CLI: `-y, --yes`) + * `tag`: `Specify which tag context to operate on. 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:** 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. + +--- + +## Task Structure & Breakdown + +### 13. Expand Task (`expand_task`) + +* **MCP Tool:** `expand_task` +* **CLI Command:** `task-master expand [options]` +* **Description:** `Use Taskmaster's AI to break down a complex task into smaller, manageable subtasks. Appends subtasks by default.` +* **Key Parameters/Options:** + * `id`: `The ID of the specific Taskmaster task you want to break down into subtasks.` (CLI: `-i, --id <id>`) + * `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 the research role for more informed subtask generation. Requires appropriate API key.` (CLI: `-r, --research`) + * `prompt`: `Optional: Provide extra context or specific instructions to Taskmaster for generating the subtasks.` (CLI: `-p, --prompt <text>`) + * `force`: `Optional: If true, clear existing subtasks before generating new ones. Default is false (append).` (CLI: `--force`) + * `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:** 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. + +### 14. Expand All Tasks (`expand_all`) + +* **MCP Tool:** `expand_all` +* **CLI Command:** `task-master expand --all [options]` (Note: CLI uses the `expand` command with the `--all` flag) +* **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:** + * `num`: `Optional: Suggests how many subtasks Taskmaster should aim to create per task.` (CLI: `-n, --num <number>`) + * `research`: `Enable research role for more informed subtask generation. Requires appropriate API key.` (CLI: `-r, --research`) + * `prompt`: `Optional: Provide extra context for Taskmaster to apply generally during expansion.` (CLI: `-p, --prompt <text>`) + * `force`: `Optional: If true, clear existing subtasks before generating new ones for each eligible task. Default is false (append).` (CLI: `--force`) + * `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. +* **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. + +### 15. Clear Subtasks (`clear_subtasks`) + +* **MCP Tool:** `clear_subtasks` +* **CLI Command:** `task-master clear-subtasks [options]` +* **Description:** `Remove all subtasks from one or more specified Taskmaster parent tasks.` +* **Key Parameters/Options:** + * `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`) + * `tag`: `Specify which tag context to operate on. 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 regenerating subtasks with `expand_task` if the previous breakdown needs replacement. + +### 16. Remove Subtask (`remove_subtask`) + +* **MCP Tool:** `remove_subtask` +* **CLI Command:** `task-master remove-subtask [options]` +* **Description:** `Remove a subtask from its Taskmaster parent, optionally converting it into a standalone task.` +* **Key Parameters/Options:** + * `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`) + * `generate`: `Enable Taskmaster to regenerate markdown task files after removing the subtask.` (CLI: `--generate`) + * `tag`: `Specify which tag context to operate on. 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:** 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>`) + * `tag`: `Specify which tag context to operate on. 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:** 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 + +### 18. Add Dependency (`add_dependency`) + +* **MCP Tool:** `add_dependency` +* **CLI Command:** `task-master add-dependency [options]` +* **Description:** `Define a dependency in Taskmaster, making one task a prerequisite for another.` +* **Key Parameters/Options:** + * `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>`) + * `tag`: `Specify which tag context to operate on. 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 <path>`) +* **Usage:** Establish the correct order of execution between tasks. + +### 19. Remove Dependency (`remove_dependency`) + +* **MCP Tool:** `remove_dependency` +* **CLI Command:** `task-master remove-dependency [options]` +* **Description:** `Remove a dependency relationship between two Taskmaster tasks.` +* **Key Parameters/Options:** + * `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>`) + * `tag`: `Specify which tag context to operate on. 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:** Update task relationships when the order of execution changes. + +### 20. Validate Dependencies (`validate_dependencies`) + +* **MCP Tool:** `validate_dependencies` +* **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.` +* **Key Parameters/Options:** + * `tag`: `Specify which tag context to validate. 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:** Audit the integrity of your task dependencies. + +### 21. Fix Dependencies (`fix_dependencies`) + +* **MCP Tool:** `fix_dependencies` +* **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.` +* **Key Parameters/Options:** + * `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. + +--- + +## Analysis & Reporting + +### 22. Analyze Project Complexity (`analyze_project_complexity`) + +* **MCP Tool:** `analyze_project_complexity` +* **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.` +* **Key Parameters/Options:** + * `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>`) + * `research`: `Enable research role for more accurate complexity analysis. Requires appropriate API key.` (CLI: `-r, --research`) + * `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. +* **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. + +### 23. View Complexity Report (`complexity_report`) + +* **MCP Tool:** `complexity_report` +* **CLI Command:** `task-master complexity-report [options]` +* **Description:** `Display the task complexity analysis report in a readable format.` +* **Key Parameters/Options:** + * `tag`: `Specify which tag context to show the report for. Defaults to the current active tag.` (CLI: `--tag <name>`) + * `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. + +--- + +## File Management + +### 24. Generate Task Files (`generate`) + +* **MCP Tool:** `generate` +* **CLI Command:** `task-master generate [options]` +* **Description:** `Create or update individual Markdown files for each task based on your tasks.json.` +* **Key Parameters/Options:** + * `output`: `The directory where Taskmaster should save the task files (default: in a 'tasks' directory).` (CLI: `-o, --output <directory>`) + * `tag`: `Specify which tag context to generate files for. 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:** 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. + +--- + +## AI-Powered Research + +### 25. Research (`research`) + +* **MCP Tool:** `research` +* **CLI Command:** `task-master research [options]` +* **Description:** `Perform AI-powered research queries with project context to get fresh, up-to-date information beyond the AI's knowledge cutoff.` +* **Key Parameters/Options:** + * `query`: `Required. Research query/prompt (e.g., "What are the latest best practices for React Query v5?").` (CLI: `[query]` positional or `-q, --query <text>`) + * `taskIds`: `Comma-separated list of task/subtask IDs from the current tag context (e.g., "15,16.2,17").` (CLI: `-i, --id <ids>`) + * `filePaths`: `Comma-separated list of file paths for context (e.g., "src/api.js,docs/readme.md").` (CLI: `-f, --files <paths>`) + * `customContext`: `Additional custom context text to include in the research.` (CLI: `-c, --context <text>`) + * `includeProjectTree`: `Include project file tree structure in context (default: false).` (CLI: `--tree`) + * `detailLevel`: `Detail level for the research response: 'low', 'medium', 'high' (default: medium).` (CLI: `--detail <level>`) + * `saveTo`: `Task or subtask ID (e.g., "15", "15.2") to automatically save the research conversation to.` (CLI: `--save-to <id>`) + * `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`) + * `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. + +--- + +## Tag Management + +This new suite of commands allows you to manage different task contexts (tags). + +### 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:** + * `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`) + * `--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>`) + * `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`) + +### 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`) + * `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`) + +### 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) + * `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`) + +### 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) + * `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`) + +### 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 **`.kiro/mcp.json`** file (for MCP/Kiro 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 [dev_workflow.md](.kiro/steering/dev_workflow.md). \ No newline at end of file diff --git a/.kiro/steering/taskmaster_hooks_workflow.md b/.kiro/steering/taskmaster_hooks_workflow.md new file mode 100644 index 00000000..c6aa84f9 --- /dev/null +++ b/.kiro/steering/taskmaster_hooks_workflow.md @@ -0,0 +1,59 @@ +--- +inclusion: always +--- + +# Taskmaster Hook-Driven Workflow + +## Core Principle: Hooks Automate Task Management + +When working with Taskmaster in Kiro, **avoid manually marking tasks as done**. The hook system automatically handles task completion based on: + +- **Test Success**: `[TM] Test Success Task Completer` detects passing tests and prompts for task completion +- **Code Changes**: `[TM] Code Change Task Tracker` monitors implementation progress +- **Dependency Chains**: `[TM] Task Dependency Auto-Progression` auto-starts dependent tasks + +## AI Assistant Workflow + +Follow this pattern when implementing features: + +1. **Implement First**: Write code, create tests, make changes +2. **Save Frequently**: Hooks trigger on file saves to track progress automatically +3. **Let Hooks Decide**: Allow hooks to detect completion rather than manually setting status +4. **Respond to Prompts**: Confirm when hooks suggest task completion + +## Key Rules for AI Assistants + +- **Never use `tm set-status --status=done`** unless hooks fail to detect completion +- **Always write tests** - they provide the most reliable completion signal +- **Save files after implementation** - this triggers progress tracking +- **Trust hook suggestions** - if no completion prompt appears, more work may be needed + +## Automatic Behaviors + +The hook system provides: + +- **Progress Logging**: Implementation details automatically added to task notes +- **Evidence-Based Completion**: Tasks marked done only when criteria are met +- **Dependency Management**: Next tasks auto-started when dependencies complete +- **Natural Flow**: Focus on coding, not task management overhead + +## Manual Override Cases + +Only manually set task status for: + +- Documentation-only tasks +- Tasks without testable outcomes +- Emergency fixes without proper test coverage + +Use `tm set-status` sparingly - prefer hook-driven completion. + +## Implementation Pattern + +``` +1. Implement feature → Save file +2. Write tests → Save test file +3. Tests pass → Hook prompts completion +4. Confirm completion → Next task auto-starts +``` + +This workflow ensures proper task tracking while maintaining development flow. \ No newline at end of file diff --git a/.kiro/steering/test.md b/.kiro/steering/test.md new file mode 100644 index 00000000..db7d7c0c --- /dev/null +++ b/.kiro/steering/test.md @@ -0,0 +1,3 @@ +Testing rules that you can help me improve to see how it works<!------------------------------------------------------------------------------------ +Add Rules to this file or a short description and have Kiro refine them for you: +-------------------------------------------------------------------------------------> diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 00000000..26a129bf --- /dev/null +++ b/.mcp.json @@ -0,0 +1,9 @@ +{ + "mcpServers": { + "task-master-ai": { + "type": "stdio", + "command": "npx", + "args": ["-y", "task-master-ai"] + } + } +} diff --git a/.taskmaster/CLAUDE.md b/.taskmaster/CLAUDE.md new file mode 100644 index 00000000..6f664815 --- /dev/null +++ b/.taskmaster/CLAUDE.md @@ -0,0 +1,417 @@ +# Task Master AI - Agent 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._ diff --git a/.taskmaster/reports/task-complexity-report_cc-kiro-hooks.json b/.taskmaster/reports/task-complexity-report_cc-kiro-hooks.json new file mode 100644 index 00000000..9106ccf8 --- /dev/null +++ b/.taskmaster/reports/task-complexity-report_cc-kiro-hooks.json @@ -0,0 +1,93 @@ +{ + "meta": { + "generatedAt": "2025-07-22T09:41:10.517Z", + "tasksAnalyzed": 10, + "totalTasks": 10, + "analysisCount": 10, + "thresholdScore": 5, + "projectName": "Taskmaster", + "usedResearch": false + }, + "complexityAnalysis": [ + { + "taskId": 1, + "taskTitle": "Implement Task Integration Layer (TIL) Core", + "complexityScore": 8, + "recommendedSubtasks": 5, + "expansionPrompt": "Break down the TIL Core implementation into distinct components: hook registration system, task lifecycle management, event coordination, state persistence layer, and configuration validation. Each subtask should focus on a specific architectural component with clear interfaces and testable boundaries.", + "reasoning": "This is a foundational component with multiple complex subsystems including event-driven architecture, API integration, state management, and configuration validation. The existing 5 subtasks are well-structured and appropriately sized." + }, + { + "taskId": 2, + "taskTitle": "Develop Dependency Monitor with Taskmaster MCP Integration", + "complexityScore": 7, + "recommendedSubtasks": 4, + "expansionPrompt": "Divide the dependency monitor into: dependency graph data structure implementation, circular dependency detection algorithm, Taskmaster MCP integration layer, and real-time notification system. Focus on performance optimization for large graphs and efficient caching strategies.", + "reasoning": "Complex graph algorithms and real-time monitoring require careful implementation. The task involves sophisticated data structures, algorithm design, and API integration with performance constraints." + }, + { + "taskId": 3, + "taskTitle": "Build Execution Manager with Priority Queue and Parallel Execution", + "complexityScore": 8, + "recommendedSubtasks": 5, + "expansionPrompt": "Structure the execution manager into: priority queue implementation, resource conflict detection system, parallel execution coordinator, timeout and cancellation handler, and execution history persistence layer. Each component should handle specific aspects of concurrent task management.", + "reasoning": "Managing concurrent execution with resource conflicts, priority scheduling, and persistence is highly complex. Requires careful synchronization, error handling, and performance optimization." + }, + { + "taskId": 4, + "taskTitle": "Implement Safety Manager with Configurable Constraints and Emergency Controls", + "complexityScore": 7, + "recommendedSubtasks": 4, + "expansionPrompt": "Break down into: constraint validation engine, emergency control system (stop/pause), user approval workflow implementation, and safety monitoring/audit logging. Each subtask should address specific safety aspects with fail-safe mechanisms.", + "reasoning": "Safety systems require careful design with multiple fail-safes. The task involves validation logic, real-time controls, workflow management, and comprehensive logging." + }, + { + "taskId": 5, + "taskTitle": "Develop Event-Based Hook Processor", + "complexityScore": 6, + "recommendedSubtasks": 4, + "expansionPrompt": "Organize into: file system event integration, Git/VCS event listeners, build system event connectors, and event filtering/debouncing mechanism. Focus on modular event source integration with configurable processing pipelines.", + "reasoning": "While conceptually straightforward, integrating multiple event sources with proper filtering and performance optimization requires careful implementation. Each event source has unique characteristics." + }, + { + "taskId": 6, + "taskTitle": "Implement Prompt-Based Hook Processor with AI Integration", + "complexityScore": 7, + "recommendedSubtasks": 4, + "expansionPrompt": "Divide into: prompt interception mechanism, NLP-based task suggestion engine, context injection system, and conversation-based status updater. Each component should handle specific aspects of AI conversation integration.", + "reasoning": "AI integration with prompt analysis and dynamic context injection is complex. Requires understanding of conversation flow, relevance scoring, and seamless integration with existing systems." + }, + { + "taskId": 7, + "taskTitle": "Create Update-Based Hook Processor for Automatic Progress Tracking", + "complexityScore": 6, + "recommendedSubtasks": 4, + "expansionPrompt": "Structure as: code change monitor, acceptance criteria validator, dependency update propagator, and conflict detection/resolution system. Focus on accurate progress tracking and automated validation logic.", + "reasoning": "Automatic progress tracking requires integration with version control and intelligent analysis of code changes. Conflict detection and dependency propagation add complexity." + }, + { + "taskId": 8, + "taskTitle": "Develop Real-Time Automation Dashboard and User Controls", + "complexityScore": 7, + "recommendedSubtasks": 5, + "expansionPrompt": "Break down into: WebSocket real-time communication layer, interactive dependency graph visualization, task queue and status displays, user control interfaces, and analytics/charting components. Each UI component should be modular and reusable.", + "reasoning": "Building a responsive real-time dashboard with complex visualizations and interactive controls is challenging. Requires careful state management, performance optimization, and user experience design." + }, + { + "taskId": 9, + "taskTitle": "Integrate Kiro IDE and Taskmaster MCP with Core Services", + "complexityScore": 8, + "recommendedSubtasks": 4, + "expansionPrompt": "Organize into: KiroHookAdapter implementation, TaskmasterMCPAdapter development, error handling and retry logic layer, and IDE UI component integration. Focus on robust adapter patterns and comprehensive error recovery.", + "reasoning": "End-to-end integration of multiple systems with different architectures is highly complex. Requires careful adapter design, extensive error handling, and thorough testing across all integration points." + }, + { + "taskId": 10, + "taskTitle": "Implement Configuration Management and Safety Profiles", + "complexityScore": 6, + "recommendedSubtasks": 4, + "expansionPrompt": "Divide into: visual configuration editor UI, JSON Schema validation engine, import/export functionality, and version control integration. Each component should provide intuitive configuration management with robust validation.", + "reasoning": "While technically less complex than core systems, building an intuitive configuration editor with validation, versioning, and import/export requires careful UI/UX design and robust data handling." + } + ] +} diff --git a/.taskmaster/state.json b/.taskmaster/state.json index 1d0d2694..7674db09 100644 --- a/.taskmaster/state.json +++ b/.taskmaster/state.json @@ -1,6 +1,6 @@ { "currentTag": "master", - "lastSwitched": "2025-06-14T20:37:15.456Z", + "lastSwitched": "2025-07-22T13:32:03.558Z", "branchTagMapping": { "v017-adds": "v017-adds", "next": "next" diff --git a/.taskmaster/tasks/tasks.json b/.taskmaster/tasks/tasks.json index c8e368c6..cde5d76f 100644 --- a/.taskmaster/tasks/tasks.json +++ b/.taskmaster/tasks/tasks.json @@ -27,7 +27,9 @@ "title": "Implement Basic Task Operations", "description": "Create core functionality for managing tasks including listing, creating, updating, and deleting tasks.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "priority": "high", "details": "Implement the following task operations:\n- List tasks with filtering options\n- Create new tasks with required fields\n- Update existing task properties\n- Delete tasks\n- Change task status (pending/done/deferred)\n- Handle dependencies between tasks\n- Manage task priorities", "testStrategy": "Test each operation with valid and invalid inputs. Verify that dependencies are properly tracked and that status changes are reflected correctly in the tasks.json file." @@ -37,7 +39,10 @@ "title": "Create Task File Generation System", "description": "Implement the system for generating individual task files from the tasks.json data structure.", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "priority": "medium", "details": "Build the task file generation system including:\n- Create task file templates\n- Implement generation of task files from tasks.json\n- Add bi-directional synchronization between task files and tasks.json\n- Implement proper file naming and organization\n- Handle updates to task files reflecting back to tasks.json", "testStrategy": "Generate task files from sample tasks.json data and verify the content matches the expected format. Test synchronization by modifying task files and ensuring changes are reflected in tasks.json.", @@ -55,7 +60,9 @@ "title": "Implement Task File Generation Logic", "description": "Develop the core functionality to generate individual task files from the tasks.json data structure. This includes reading the tasks.json file, iterating through each task, applying the template to each task's data, and writing the resulting content to appropriately named files in the tasks directory. Ensure proper error handling for file operations and data validation.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- Successfully reads tasks from tasks.json\n- Correctly applies template to each task's data\n- Generates files with proper naming convention (e.g., task_001.txt)\n- Creates the tasks directory if it doesn't exist\n- Handles errors gracefully (file not found, permission issues, etc.)\n- Validates task data before generation to prevent errors\n- Logs generation process with appropriate verbosity levels" }, { @@ -63,7 +70,9 @@ "title": "Implement File Naming and Organization System", "description": "Create a consistent system for naming and organizing task files. Implement a function that generates standardized filenames based on task IDs (e.g., task_001.txt for task ID 1). Design the directory structure for storing task files according to the PRD specification. Ensure the system handles task ID formatting consistently and prevents filename collisions.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- Generates consistent filenames based on task IDs with proper zero-padding\n- Creates and maintains the correct directory structure as specified in the PRD\n- Handles special characters or edge cases in task IDs appropriately\n- Prevents filename collisions between different tasks\n- Provides utility functions for converting between task IDs and filenames\n- Maintains backward compatibility if the naming scheme needs to evolve" }, { @@ -71,7 +80,11 @@ "title": "Implement Task File to JSON Synchronization", "description": "Develop functionality to read modified task files and update the corresponding entries in tasks.json. This includes parsing the task file format, extracting structured data, validating the changes, and updating the tasks.json file accordingly. Ensure the system can handle concurrent modifications and resolve conflicts appropriately.", "status": "done", - "dependencies": [1, 3, 2], + "dependencies": [ + 1, + 3, + 2 + ], "acceptanceCriteria": "- Successfully parses task files to extract structured data\n- Validates parsed data against the task model schema\n- Updates tasks.json with changes from task files\n- Handles conflicts when the same task is modified in both places\n- Preserves task relationships and dependencies during synchronization\n- Provides clear error messages for parsing or validation failures\n- Updates the \"updatedAt\" timestamp in tasks.json metadata" }, { @@ -79,7 +92,12 @@ "title": "Implement Change Detection and Update Handling", "description": "Create a system to detect changes in task files and tasks.json, and handle updates bidirectionally. This includes implementing file watching or comparison mechanisms, determining which version is newer, and applying changes in the appropriate direction. Ensure the system handles edge cases like deleted files, new tasks, and conflicting changes.", "status": "done", - "dependencies": [1, 3, 4, 2], + "dependencies": [ + 1, + 3, + 4, + 2 + ], "acceptanceCriteria": "- Detects changes in both task files and tasks.json\n- Determines which version is newer based on modification timestamps or content\n- Applies changes in the appropriate direction (file to JSON or JSON to file)\n- Handles edge cases like deleted files, new tasks, and renamed tasks\n- Provides options for manual conflict resolution when necessary\n- Maintains data integrity during the synchronization process\n- Includes a command to force synchronization in either direction\n- Logs all synchronization activities for troubleshooting\n\nEach of these subtasks addresses a specific component of the task file generation system, following a logical progression from template design to bidirectional synchronization. The dependencies ensure that prerequisites are completed before dependent work begins, and the acceptance criteria provide clear guidelines for verifying each subtask's completion.", "details": "\n\n<info added on 2025-05-01T21:59:10.551Z>\n{\n \"id\": 5,\n \"title\": \"Implement Change Detection and Update Handling\",\n \"description\": \"Create a system to detect changes in task files and tasks.json, and handle updates bidirectionally. This includes implementing file watching or comparison mechanisms, determining which version is newer, and applying changes in the appropriate direction. Ensure the system handles edge cases like deleted files, new tasks, and conflicting changes.\",\n \"status\": \"done\",\n \"dependencies\": [\n 1,\n 3,\n 4,\n 2\n ],\n \"acceptanceCriteria\": \"- Detects changes in both task files and tasks.json\\n- Determines which version is newer based on modification timestamps or content\\n- Applies changes in the appropriate direction (file to JSON or JSON to file)\\n- Handles edge cases like deleted files, new tasks, and renamed tasks\\n- Provides options for manual conflict resolution when necessary\\n- Maintains data integrity during the synchronization process\\n- Includes a command to force synchronization in either direction\\n- Logs all synchronization activities for troubleshooting\\n\\nEach of these subtasks addresses a specific component of the task file generation system, following a logical progression from template design to bidirectional synchronization. The dependencies ensure that prerequisites are completed before dependent work begins, and the acceptance criteria provide clear guidelines for verifying each subtask's completion.\",\n \"details\": \"[2025-05-01 21:59:07] Adding another note via MCP test.\"\n}\n</info added on 2025-05-01T21:59:10.551Z>" } @@ -90,7 +108,9 @@ "title": "Integrate Anthropic Claude API", "description": "Set up the integration with Claude API for AI-powered task generation and expansion.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "priority": "high", "details": "Implement Claude API integration including:\n- API authentication using environment variables\n- Create prompt templates for various operations\n- Implement response handling and parsing\n- Add error management with retries and exponential backoff\n- Implement token usage tracking\n- Create configurable model parameters", "testStrategy": "Test API connectivity with sample prompts. Verify authentication works correctly with different API keys. Test error handling by simulating API failures.", @@ -108,7 +128,9 @@ "title": "Develop Prompt Template System", "description": "Create a flexible prompt template system for Claude API interactions. Implement a PromptTemplate class that can handle variable substitution, system and user messages, and proper formatting according to Claude's requirements. Include templates for different operations (task generation, task expansion, etc.) with appropriate instructions and constraints for each use case.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- PromptTemplate class supports variable substitution\n- System and user message separation is properly implemented\n- Templates exist for all required operations (task generation, expansion, etc.)\n- Templates include appropriate constraints and formatting instructions\n- Template system is unit tested with various inputs" }, { @@ -116,7 +138,10 @@ "title": "Implement Response Handling and Parsing", "description": "Create a response handling system that processes Claude API responses. Implement JSON parsing for structured outputs, error detection in responses, and extraction of relevant information. Build utility functions to transform Claude's responses into the application's data structures. Include validation to ensure responses meet expected formats.", "status": "done", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "acceptanceCriteria": "- Response parsing functions handle both JSON and text formats\n- Error detection identifies malformed or unexpected responses\n- Utility functions transform responses into task data structures\n- Validation ensures responses meet expected schemas\n- Edge cases like empty or partial responses are handled gracefully" }, { @@ -124,7 +149,10 @@ "title": "Build Error Management with Retry Logic", "description": "Implement a robust error handling system for Claude API interactions. Create middleware that catches API errors, network issues, and timeout problems. Implement exponential backoff retry logic that increases wait time between retries. Add configurable retry limits and timeout settings. Include detailed logging for troubleshooting API issues.", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "acceptanceCriteria": "- All API errors are caught and handled appropriately\n- Exponential backoff retry logic is implemented\n- Retry limits and timeouts are configurable\n- Detailed error logging provides actionable information\n- System degrades gracefully when API is unavailable\n- Unit tests verify retry behavior with mocked API failures" }, { @@ -132,7 +160,10 @@ "title": "Implement Token Usage Tracking", "description": "Create a token tracking system to monitor Claude API usage. Implement functions to count tokens in prompts and responses. Build a logging system that records token usage per operation. Add reporting capabilities to show token usage trends and costs. Implement configurable limits to prevent unexpected API costs.", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "acceptanceCriteria": "- Token counting functions accurately estimate usage\n- Usage logging records tokens per operation type\n- Reporting functions show usage statistics and estimated costs\n- Configurable limits can prevent excessive API usage\n- Warning system alerts when approaching usage thresholds\n- Token tracking data is persisted between application runs" }, { @@ -140,7 +171,10 @@ "title": "Create Model Parameter Configuration System", "description": "Implement a flexible system for configuring Claude model parameters. Create a configuration module that manages model selection, temperature, top_p, max_tokens, and other parameters. Build functions to customize parameters based on operation type. Add validation to ensure parameters are within acceptable ranges. Include preset configurations for different use cases (creative, precise, etc.).", "status": "done", - "dependencies": [1, 5], + "dependencies": [ + 1, + 5 + ], "acceptanceCriteria": "- Configuration module manages all Claude model parameters\n- Parameter customization functions exist for different operations\n- Validation ensures parameters are within acceptable ranges\n- Preset configurations exist for different use cases\n- Parameters can be overridden at runtime when needed\n- Documentation explains parameter effects and recommended values\n- Unit tests verify parameter validation and configuration loading" } ] @@ -150,7 +184,10 @@ "title": "Build PRD Parsing System", "description": "Create the system for parsing Product Requirements Documents into structured task lists.", "status": "done", - "dependencies": [1, 5], + "dependencies": [ + 1, + 5 + ], "priority": "high", "details": "Implement PRD parsing functionality including:\n- PRD file reading from specified path\n- Prompt engineering for effective PRD parsing\n- Convert PRD content to task structure via Claude API\n- Implement intelligent dependency inference\n- Add priority assignment logic\n- Handle large PRDs by chunking if necessary", "testStrategy": "Test with sample PRDs of varying complexity. Verify that generated tasks accurately reflect the requirements in the PRD. Check that dependencies and priorities are logically assigned.", @@ -176,7 +213,9 @@ "title": "Implement PRD to Task Conversion System", "description": "Develop the core functionality that sends PRD content to Claude API and converts the response into the task data structure. This includes sending the engineered prompts with PRD content to Claude, parsing the structured response, and transforming it into valid task objects that conform to the task model. Implement validation to ensure the generated tasks meet all requirements.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- Successfully sends PRD content to Claude API with appropriate prompts\n- Parses Claude's response into structured task objects\n- Validates generated tasks against the task model schema\n- Handles API errors and response parsing failures gracefully\n- Generates unique and sequential task IDs" }, { @@ -184,7 +223,10 @@ "title": "Build Intelligent Dependency Inference System", "description": "Create an algorithm that analyzes the generated tasks and infers logical dependencies between them. The system should identify which tasks must be completed before others based on the content and context of each task. Implement both explicit dependency detection (from Claude's output) and implicit dependency inference (based on task relationships and logical ordering).", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "acceptanceCriteria": "- Correctly identifies explicit dependencies mentioned in task descriptions\n- Infers implicit dependencies based on task context and relationships\n- Prevents circular dependencies in the task graph\n- Provides confidence scores for inferred dependencies\n- Allows for manual override/adjustment of detected dependencies" }, { @@ -192,7 +234,10 @@ "title": "Implement Priority Assignment Logic", "description": "Develop a system that assigns appropriate priorities (high, medium, low) to tasks based on their content, dependencies, and position in the PRD. Create algorithms that analyze task descriptions, identify critical path tasks, and consider factors like technical risk and business value. Implement both automated priority assignment and manual override capabilities.", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "acceptanceCriteria": "- Assigns priorities based on multiple factors (dependencies, critical path, risk)\n- Identifies foundation/infrastructure tasks as high priority\n- Balances priorities across the project (not everything is high priority)\n- Provides justification for priority assignments\n- Allows for manual adjustment of priorities" }, { @@ -200,7 +245,11 @@ "title": "Implement PRD Chunking for Large Documents", "description": "Create a system that can handle large PRDs by breaking them into manageable chunks for processing. Implement intelligent document segmentation that preserves context across chunks, tracks section relationships, and maintains coherence in the generated tasks. Develop a mechanism to reassemble and deduplicate tasks generated from different chunks into a unified task list.", "status": "done", - "dependencies": [1, 5, 3], + "dependencies": [ + 1, + 5, + 3 + ], "acceptanceCriteria": "- Successfully processes PRDs larger than Claude's context window\n- Intelligently splits documents at logical boundaries (sections, chapters)\n- Preserves context when processing individual chunks\n- Reassembles tasks from multiple chunks into a coherent task list\n- Detects and resolves duplicate or overlapping tasks\n- Maintains correct dependency relationships across chunks" } ] @@ -210,7 +259,10 @@ "title": "Implement Task Expansion with Claude", "description": "Create functionality to expand tasks into subtasks using Claude's AI capabilities.", "status": "done", - "dependencies": [3, 5], + "dependencies": [ + 3, + 5 + ], "priority": "medium", "details": "Build task expansion functionality including:\n- Create subtask generation prompts\n- Implement workflow for expanding a task into subtasks\n- Add context-aware expansion capabilities\n- Implement parent-child relationship management\n- Allow specification of number of subtasks to generate\n- Provide mechanism to regenerate unsatisfactory subtasks", "testStrategy": "Test expanding various types of tasks into subtasks. Verify that subtasks are properly linked to parent tasks. Check that context is properly incorporated into generated subtasks.", @@ -228,7 +280,9 @@ "title": "Develop Task Expansion Workflow and UI", "description": "Implement the command-line interface and workflow for expanding tasks into subtasks. Create a new command that allows users to select a task, specify the number of subtasks, and add optional context. Design the interaction flow to handle the API request, process the response, and update the tasks.json file with the newly generated subtasks.", "status": "done", - "dependencies": [5], + "dependencies": [ + 5 + ], "acceptanceCriteria": "- Command `node scripts/dev.js expand --id=<task_id> --count=<number>` is implemented\n- Optional parameters for additional context (`--context=\"...\"`) are supported\n- User is shown progress indicators during API calls\n- Generated subtasks are displayed for review before saving\n- Command handles errors gracefully with helpful error messages\n- Help documentation for the expand command is comprehensive" }, { @@ -236,7 +290,9 @@ "title": "Implement Context-Aware Expansion Capabilities", "description": "Enhance the task expansion functionality to incorporate project context when generating subtasks. Develop a system to gather relevant information from the project, such as related tasks, dependencies, and previously completed work. Implement logic to include this context in the Claude prompts to improve the relevance and quality of generated subtasks.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- System automatically gathers context from related tasks and dependencies\n- Project metadata is incorporated into expansion prompts\n- Implementation details from dependent tasks are included in context\n- Context gathering is configurable (amount and type of context)\n- Generated subtasks show awareness of existing project structure and patterns\n- Context gathering has reasonable performance even with large task collections" }, { @@ -244,7 +300,9 @@ "title": "Build Parent-Child Relationship Management", "description": "Implement the data structure and operations for managing parent-child relationships between tasks and subtasks. Create functions to establish these relationships in the tasks.json file, update the task model to support subtask arrays, and develop utilities to navigate, filter, and display task hierarchies. Ensure all basic task operations (update, delete, etc.) properly handle subtask relationships.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- Task model is updated to include subtasks array\n- Subtasks have proper ID format (parent.sequence)\n- Parent tasks track their subtasks with proper references\n- Task listing command shows hierarchical structure\n- Completing all subtasks automatically updates parent task status\n- Deleting a parent task properly handles orphaned subtasks\n- Task file generation includes subtask information" }, { @@ -252,7 +310,11 @@ "title": "Implement Subtask Regeneration Mechanism", "description": "Create functionality that allows users to regenerate unsatisfactory subtasks. Implement a command that can target specific subtasks for regeneration, preserve satisfactory subtasks, and incorporate feedback to improve the new generation. Design the system to maintain proper parent-child relationships and task IDs during regeneration.", "status": "done", - "dependencies": [1, 2, 4], + "dependencies": [ + 1, + 2, + 4 + ], "acceptanceCriteria": "- Command `node scripts/dev.js regenerate --id=<subtask_id>` is implemented\n- Option to regenerate all subtasks for a parent (`--all`)\n- Feedback parameter allows user to guide regeneration (`--feedback=\"...\"`)\n- Original subtask details are preserved in prompt context\n- Regenerated subtasks maintain proper ID sequence\n- Task relationships remain intact after regeneration\n- Command provides clear before/after comparison of subtasks" } ] @@ -262,7 +324,11 @@ "title": "Develop Implementation Drift Handling", "description": "Create system to handle changes in implementation that affect future tasks.", "status": "done", - "dependencies": [3, 5, 7], + "dependencies": [ + 3, + 5, + 7 + ], "priority": "medium", "details": "Implement drift handling including:\n- Add capability to update future tasks based on completed work\n- Implement task rewriting based on new context\n- Create dependency chain updates when tasks change\n- Preserve completed work while updating future tasks\n- Add command to analyze and suggest updates to future tasks", "testStrategy": "Simulate implementation changes and test the system's ability to update future tasks appropriately. Verify that completed tasks remain unchanged while pending tasks are updated correctly.", @@ -296,7 +362,9 @@ "title": "Implement Completed Work Preservation", "description": "Develop a mechanism to ensure that updates to future tasks don't affect completed work. This includes creating a versioning system for tasks, tracking task history, and implementing safeguards to prevent modifications to completed tasks. The system should maintain a record of task changes while ensuring that completed work remains stable.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- Implementation of task versioning to track changes\n- Safeguards that prevent modifications to tasks marked as \"done\"\n- System to store and retrieve task history\n- Clear visual indicators in the CLI for tasks that have been modified\n- Ability to view the original version of a modified task\n- Unit tests for completed work preservation" }, { @@ -304,7 +372,9 @@ "title": "Create Update Analysis and Suggestion Command", "description": "Implement a CLI command that analyzes the current state of tasks, identifies potential drift between completed and pending tasks, and suggests updates. This command should provide a comprehensive report of potential inconsistencies and offer recommendations for task updates without automatically applying them. It should include options to apply all suggested changes, select specific changes to apply, or ignore suggestions.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- New CLI command \"analyze-drift\" implemented\n- Comprehensive analysis of potential implementation drift\n- Detailed report of suggested task updates\n- Interactive mode to select which suggestions to apply\n- Batch mode to apply all suggested changes\n- Option to export suggestions to a file for review\n- Documentation of the command usage and options\n- Integration tests that verify the end-to-end workflow" } ] @@ -314,7 +384,9 @@ "title": "Integrate Perplexity API", "description": "Add integration with Perplexity API for research-backed task generation.", "status": "done", - "dependencies": [5], + "dependencies": [ + 5 + ], "priority": "low", "details": "Implement Perplexity integration including:\n- API authentication via OpenAI client\n- Create research-oriented prompt templates\n- Implement response handling for Perplexity\n- Add fallback to Claude when Perplexity is unavailable\n- Implement response quality comparison logic\n- Add configuration for model selection", "testStrategy": "Test connectivity to Perplexity API. Verify research-oriented prompts return useful information. Test fallback mechanism by simulating Perplexity API unavailability.", @@ -366,7 +438,10 @@ "title": "Create Research-Backed Subtask Generation", "description": "Enhance subtask generation with research capabilities from Perplexity API.", "status": "done", - "dependencies": [7, 9], + "dependencies": [ + 7, + 9 + ], "priority": "low", "details": "Implement research-backed generation including:\n- Create specialized research prompts for different domains\n- Implement context enrichment from research results\n- Add domain-specific knowledge incorporation\n- Create more detailed subtask generation with best practices\n- Include references to relevant libraries and tools", "testStrategy": "Compare subtasks generated with and without research backing. Verify that research-backed subtasks include more specific technical details and best practices.", @@ -392,7 +467,9 @@ "title": "Develop Context Enrichment Pipeline", "description": "Create a pipeline that processes research results and enriches the task context with relevant information. This should include filtering irrelevant information, organizing research findings by category (tools, libraries, best practices, etc.), and formatting the enriched context for use in subtask generation. Implement a scoring mechanism to prioritize the most relevant research findings.", "status": "done", - "dependencies": [2], + "dependencies": [ + 2 + ], "acceptanceCriteria": "- Context enrichment function that takes raw research results and task details as input\n- Filtering system to remove irrelevant or low-quality information\n- Categorization of research findings into distinct sections (tools, libraries, patterns, etc.)\n- Relevance scoring algorithm to prioritize the most important findings\n- Formatted output that can be directly used in subtask generation prompts\n- Tests comparing enriched context quality against baseline" }, { @@ -400,7 +477,9 @@ "title": "Implement Domain-Specific Knowledge Incorporation", "description": "Develop a system to incorporate domain-specific knowledge into the subtask generation process. This should include identifying key domain concepts, technical requirements, and industry standards from the research results. Create a knowledge base structure that organizes domain information and can be referenced during subtask generation.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- Domain knowledge extraction function that identifies key technical concepts\n- Knowledge base structure for organizing domain-specific information\n- Integration with the subtask generation prompt to incorporate relevant domain knowledge\n- Support for technical terminology and concept explanation in generated subtasks\n- Mechanism to link domain concepts to specific implementation recommendations\n- Tests verifying improved technical accuracy in generated subtasks" }, { @@ -408,7 +487,10 @@ "title": "Enhance Subtask Generation with Technical Details", "description": "Extend the existing subtask generation functionality to incorporate research findings and produce more technically detailed subtasks. This includes modifying the Claude prompt templates to leverage the enriched context, implementing specific sections for technical approach, implementation notes, and potential challenges. Ensure generated subtasks include concrete technical details rather than generic steps.", "status": "done", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "acceptanceCriteria": "- Enhanced prompt templates for Claude that incorporate research-backed context\n- Generated subtasks include specific technical approaches and implementation details\n- Each subtask contains references to relevant tools, libraries, or frameworks\n- Implementation notes section with code patterns or architectural recommendations\n- Potential challenges and mitigation strategies are included where appropriate\n- Comparative tests showing improvement over baseline subtask generation" }, { @@ -416,7 +498,10 @@ "title": "Implement Reference and Resource Inclusion", "description": "Create a system to include references to relevant libraries, tools, documentation, and other resources in generated subtasks. This should extract specific references from research results, validate their relevance, and format them as actionable links or citations within subtasks. Implement a verification step to ensure referenced resources are current and applicable.", "status": "done", - "dependencies": [3, 5], + "dependencies": [ + 3, + 5 + ], "acceptanceCriteria": "- Reference extraction function that identifies tools, libraries, and resources from research\n- Validation mechanism to verify reference relevance and currency\n- Formatting system for including references in subtask descriptions\n- Support for different reference types (GitHub repos, documentation, articles, etc.)\n- Optional version specification for referenced libraries and tools\n- Tests verifying that included references are relevant and accessible" } ] @@ -426,7 +511,9 @@ "title": "Implement Batch Operations", "description": "Add functionality for performing operations on multiple tasks simultaneously.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "priority": "medium", "details": "Create batch operations including:\n- Implement multi-task status updates\n- Add bulk subtask generation\n- Create task filtering and querying capabilities\n- Implement advanced dependency management\n- Add batch prioritization\n- Create commands for operating on filtered task sets", "testStrategy": "Test batch operations with various filters and operations. Verify that operations are applied correctly to all matching tasks. Test with large task sets to ensure performance.", @@ -436,7 +523,9 @@ "title": "Implement Multi-Task Status Update Functionality", "description": "Create a command-line interface command that allows users to update the status of multiple tasks simultaneously. Implement the backend logic to process batch status changes, validate the requested changes, and update the tasks.json file accordingly. The implementation should include options for filtering tasks by various criteria (ID ranges, status, priority, etc.) and applying status changes to the filtered set.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- Command accepts parameters for filtering tasks (e.g., `--status=pending`, `--priority=high`, `--id=1,2,3-5`)\n- Command accepts a parameter for the new status value (e.g., `--new-status=done`)\n- All matching tasks are updated in the tasks.json file\n- Command provides a summary of changes made (e.g., \"Updated 5 tasks from 'pending' to 'done'\")\n- Command handles errors gracefully (e.g., invalid status values, no matching tasks)\n- Changes are persisted correctly to tasks.json" }, { @@ -444,7 +533,10 @@ "title": "Develop Bulk Subtask Generation System", "description": "Create functionality to generate multiple subtasks across several parent tasks at once. This should include a command-line interface that accepts filtering parameters to select parent tasks and either a template for subtasks or an AI-assisted generation option. The system should validate parent tasks, generate appropriate subtasks with proper ID assignments, and update the tasks.json file.", "status": "done", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "acceptanceCriteria": "- Command accepts parameters for filtering parent tasks\n- Command supports template-based subtask generation with variable substitution\n- Command supports AI-assisted subtask generation using Claude API\n- Generated subtasks have proper IDs following the parent.sequence format (e.g., 1.1, 1.2)\n- Subtasks inherit appropriate properties from parent tasks (e.g., dependencies)\n- Generated subtasks are added to the tasks.json file\n- Task files are regenerated to include the new subtasks\n- Command provides a summary of subtasks created" }, { @@ -460,7 +552,9 @@ "title": "Create Advanced Dependency Management System", "description": "Implement batch operations for managing dependencies between tasks. This includes commands for adding, removing, and updating dependencies across multiple tasks simultaneously. The system should validate dependency changes to prevent circular dependencies, update the tasks.json file, and regenerate task files to reflect the changes.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- Command for adding dependencies to multiple tasks at once\n- Command for removing dependencies from multiple tasks\n- Command for replacing dependencies across multiple tasks\n- Validation to prevent circular dependencies\n- Validation to ensure referenced tasks exist\n- Automatic update of affected task files\n- Summary report of dependency changes made\n- Error handling for invalid dependency operations" }, { @@ -468,7 +562,9 @@ "title": "Implement Batch Task Prioritization and Command System", "description": "Create a system for batch prioritization of tasks and a command framework for operating on filtered task sets. This includes commands for changing priorities of multiple tasks at once and a generic command execution system that can apply custom operations to filtered task sets. The implementation should include a plugin architecture that allows for extending the system with new batch operations.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- Command for changing priorities of multiple tasks at once\n- Support for relative priority changes (e.g., increase/decrease priority)\n- Generic command execution framework that works with the filtering system\n- Plugin architecture for registering new batch operations\n- At least three example plugins (e.g., batch tagging, batch assignment, batch export)\n- Command for executing arbitrary operations on filtered task sets\n- Documentation for creating new batch operation plugins\n- Performance testing with large task sets (100+ tasks)" } ] @@ -478,7 +574,12 @@ "title": "Develop Project Initialization System", "description": "Create functionality for initializing new projects with task structure and configuration.", "status": "done", - "dependencies": [1, 3, 4, 6], + "dependencies": [ + 1, + 3, + 4, + 6 + ], "priority": "medium", "details": "Implement project initialization including:\n- Create project templating system\n- Implement interactive setup wizard\n- Add environment configuration generation\n- Create initial directory structure\n- Generate example tasks.json\n- Set up default configuration", "testStrategy": "Test project initialization in empty directories. Verify that all required files and directories are created correctly. Test the interactive setup with various inputs.", @@ -488,7 +589,9 @@ "title": "Create Project Template Structure", "description": "Design and implement a flexible project template system that will serve as the foundation for new project initialization. This should include creating a base directory structure, template files (e.g., default tasks.json, .env.example), and a configuration file to define customizable aspects of the template.", "status": "done", - "dependencies": [4], + "dependencies": [ + 4 + ], "acceptanceCriteria": "- A `templates` directory is created with at least one default project template" }, { @@ -496,7 +599,9 @@ "title": "Implement Interactive Setup Wizard", "description": "Develop an interactive command-line wizard using a library like Inquirer.js to guide users through the project initialization process. The wizard should prompt for project name, description, initial task structure, and other configurable options defined in the template configuration.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- Interactive wizard prompts for essential project information" }, { @@ -504,7 +609,9 @@ "title": "Generate Environment Configuration", "description": "Create functionality to generate environment-specific configuration files based on user input and template defaults. This includes creating a .env file with necessary API keys and configuration values, and updating the tasks.json file with project-specific metadata.", "status": "done", - "dependencies": [2], + "dependencies": [ + 2 + ], "acceptanceCriteria": "- .env file is generated with placeholders for required API keys" }, { @@ -512,7 +619,9 @@ "title": "Implement Directory Structure Creation", "description": "Develop the logic to create the initial directory structure for new projects based on the selected template and user inputs. This should include creating necessary subdirectories (e.g., tasks/, scripts/, .cursor/rules/) and copying template files to appropriate locations.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- Directory structure is created according to the template specification" }, { @@ -520,7 +629,9 @@ "title": "Generate Example Tasks.json", "description": "Create functionality to generate an initial tasks.json file with example tasks based on the project template and user inputs from the setup wizard. This should include creating a set of starter tasks that demonstrate the task structure and provide a starting point for the project.", "status": "done", - "dependencies": [6], + "dependencies": [ + 6 + ], "acceptanceCriteria": "- An initial tasks.json file is generated with at least 3 example tasks" }, { @@ -538,7 +649,10 @@ "title": "Create Cursor Rules Implementation", "description": "Develop the Cursor AI integration rules and documentation.", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "priority": "medium", "details": "Implement Cursor rules including:\n- Create dev_workflow.mdc documentation\n- Implement cursor_rules.mdc\n- Add self_improve.mdc\n- Design rule integration documentation\n- Set up .cursor directory structure\n- Document how Cursor AI should interact with the system", "testStrategy": "Review rules documentation for clarity and completeness. Test with Cursor AI to verify the rules are properly interpreted and followed.", @@ -556,7 +670,9 @@ "title": "Create dev_workflow.mdc Documentation", "description": "Develop the dev_workflow.mdc file that documents the development workflow for Cursor AI. This file should outline how Cursor AI should assist with task discovery, implementation, and verification within the project. Include specific examples of commands and interactions that demonstrate the optimal workflow.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- dev_workflow.mdc file created in .cursor/rules directory\n- Document clearly explains the development workflow with Cursor AI\n- Workflow documentation includes task discovery process\n- Implementation guidance for Cursor AI is detailed\n- Verification procedures are documented\n- Examples of typical interactions are provided" }, { @@ -564,7 +680,9 @@ "title": "Implement cursor_rules.mdc", "description": "Create the cursor_rules.mdc file that defines specific rules and guidelines for how Cursor AI should interact with the codebase. This should include code style preferences, architectural patterns to follow, documentation requirements, and any project-specific conventions that Cursor AI should adhere to when generating or modifying code.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- cursor_rules.mdc file created in .cursor/rules directory\n- Rules document clearly defines code style guidelines\n- Architectural patterns and principles are specified\n- Documentation requirements for generated code are outlined\n- Project-specific naming conventions are documented\n- Rules for handling dependencies and imports are defined\n- Guidelines for test implementation are included" }, { @@ -572,7 +690,11 @@ "title": "Add self_improve.mdc Documentation", "description": "Develop the self_improve.mdc file that instructs Cursor AI on how to continuously improve its assistance capabilities within the project context. This document should outline how Cursor AI should learn from feedback, adapt to project evolution, and enhance its understanding of the codebase over time.", "status": "done", - "dependencies": [1, 2, 3], + "dependencies": [ + 1, + 2, + 3 + ], "acceptanceCriteria": "- self_improve.mdc file created in .cursor/rules directory\n- Document outlines feedback incorporation mechanisms\n- Guidelines for adapting to project evolution are included\n- Instructions for enhancing codebase understanding over time\n- Strategies for improving code suggestions based on past interactions\n- Methods for refining prompt responses based on user feedback\n- Approach for maintaining consistency with evolving project patterns" }, { @@ -580,7 +702,12 @@ "title": "Create Cursor AI Integration Documentation", "description": "Develop comprehensive documentation on how Cursor AI integrates with the task management system. This should include detailed instructions on how Cursor AI should interpret tasks.json, individual task files, and how it should assist with implementation. Document the specific commands and workflows that Cursor AI should understand and support.", "status": "done", - "dependencies": [1, 2, 3, 4], + "dependencies": [ + 1, + 2, + 3, + 4 + ], "acceptanceCriteria": "- Integration documentation created and stored in an appropriate location\n- Documentation explains how Cursor AI should interpret tasks.json structure\n- Guidelines for Cursor AI to understand task dependencies and priorities\n- Instructions for Cursor AI to assist with task implementation\n- Documentation of specific commands Cursor AI should recognize\n- Examples of effective prompts for working with the task system\n- Troubleshooting section for common Cursor AI integration issues\n- Documentation references all created rule files and explains their purpose" } ] @@ -590,7 +717,9 @@ "title": "Develop Agent Workflow Guidelines", "description": "Create comprehensive guidelines for how AI agents should interact with the task system.", "status": "done", - "dependencies": [13], + "dependencies": [ + 13 + ], "priority": "medium", "details": "Create agent workflow guidelines including:\n- Document task discovery workflow\n- Create task selection guidelines\n- Implement implementation guidance\n- Add verification procedures\n- Define how agents should prioritize work\n- Create guidelines for handling dependencies", "testStrategy": "Review guidelines with actual AI agents to verify they can follow the procedures. Test various scenarios to ensure the guidelines cover all common workflows.", @@ -608,7 +737,9 @@ "title": "Implement Task Selection Algorithm", "description": "Develop an algorithm for AI agents to select the most appropriate task to work on based on priority, dependencies, and current project status. This should include logic for evaluating task urgency, managing blocked tasks, and optimizing workflow efficiency. Implement the algorithm in JavaScript and integrate it with the existing task management system.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- JavaScript module implementing the task selection algorithm" }, { @@ -616,7 +747,9 @@ "title": "Create Implementation Guidance Generator", "description": "Develop a system that generates detailed implementation guidance for AI agents based on task descriptions and project context. This should leverage the Anthropic Claude API to create step-by-step instructions, suggest relevant libraries or tools, and provide code snippets or pseudocode where appropriate. Implement caching to reduce API calls and improve performance.", "status": "done", - "dependencies": [5], + "dependencies": [ + 5 + ], "acceptanceCriteria": "- Node.js module for generating implementation guidance using Claude API" }, { @@ -624,7 +757,10 @@ "title": "Develop Verification Procedure Framework", "description": "Create a flexible framework for defining and executing verification procedures for completed tasks. This should include a DSL (Domain Specific Language) for specifying acceptance criteria, automated test generation where possible, and integration with popular testing frameworks. Implement hooks for both automated and manual verification steps.", "status": "done", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "acceptanceCriteria": "- JavaScript module implementing the verification procedure framework" }, { @@ -632,7 +768,11 @@ "title": "Implement Dynamic Task Prioritization System", "description": "Develop a system that dynamically adjusts task priorities based on project progress, dependencies, and external factors. This should include an algorithm for recalculating priorities, a mechanism for propagating priority changes through dependency chains, and an API for external systems to influence priorities. Implement this as a background process that periodically updates the tasks.json file.", "status": "done", - "dependencies": [1, 2, 3], + "dependencies": [ + 1, + 2, + 3 + ], "acceptanceCriteria": "- Node.js module implementing the dynamic prioritization system" } ] @@ -642,7 +782,9 @@ "title": "Optimize Agent Integration with Cursor and dev.js Commands", "description": "Document and enhance existing agent interaction patterns through Cursor rules and dev.js commands.", "status": "done", - "dependencies": [14], + "dependencies": [ + 14 + ], "priority": "medium", "details": "Optimize agent integration including:\n- Document and improve existing agent interaction patterns in Cursor rules\n- Enhance integration between Cursor agent capabilities and dev.js commands\n- Improve agent workflow documentation in cursor rules (dev_workflow.mdc, cursor_rules.mdc)\n- Add missing agent-specific features to existing commands\n- Leverage existing infrastructure rather than building a separate system", "testStrategy": "Test the enhanced commands with AI agents to verify they can correctly interpret and use them. Verify that agents can effectively interact with the task system using the documented patterns in Cursor rules.", @@ -668,7 +810,9 @@ "title": "Optimize Command Responses for Agent Consumption", "description": "Refine the output format of existing commands to ensure they are easily parseable by AI agents. Focus on consistent, structured outputs that agents can reliably interpret without requiring a separate parsing system.", "status": "done", - "dependencies": [2], + "dependencies": [ + 2 + ], "acceptanceCriteria": "- Command outputs optimized for agent consumption" }, { @@ -676,7 +820,10 @@ "title": "Improve Agent Workflow Documentation in Cursor Rules", "description": "Enhance the agent workflow documentation in dev_workflow.mdc and cursor_rules.mdc to provide clear guidance on how agents should interact with the task system. Include example interactions and best practices for agents.", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "acceptanceCriteria": "- Enhanced agent workflow documentation in Cursor rules" }, { @@ -684,7 +831,9 @@ "title": "Add Agent-Specific Features to Existing Commands", "description": "Identify and implement any missing agent-specific features in the existing command system. This may include additional flags, parameters, or output formats that are particularly useful for agent interactions.", "status": "done", - "dependencies": [2], + "dependencies": [ + 2 + ], "acceptanceCriteria": "- Agent-specific features added to existing commands" }, { @@ -692,7 +841,10 @@ "title": "Create Agent Usage Examples and Patterns", "description": "Develop a set of example interactions and usage patterns that demonstrate how agents should effectively use the task system. Include these examples in the documentation to guide future agent implementations.", "status": "done", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "acceptanceCriteria": "- Comprehensive set of agent usage examples and patterns" } ] @@ -702,7 +854,9 @@ "title": "Create Configuration Management System", "description": "Implement robust configuration handling with environment variables and .env files.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "priority": "high", "details": "Build configuration management including:\n- Environment variable handling\n- .env file support\n- Configuration validation\n- Sensible defaults with overrides\n- Create .env.example template\n- Add configuration documentation\n- Implement secure handling of API keys", "testStrategy": "Test configuration loading from various sources (environment variables, .env files). Verify that validation correctly identifies invalid configurations. Test that defaults are applied when values are missing.", @@ -720,7 +874,9 @@ "title": "Implement .env File Support", "description": "Add support for loading configuration from .env files using dotenv or a similar library. Implement file detection, parsing, and merging with existing environment variables. Handle multiple environments (.env.development, .env.production, etc.) and implement proper error handling for file reading issues.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- Integration with dotenv or equivalent library\n- Support for multiple environment-specific .env files (.env.development, .env.production)\n- Proper error handling for missing or malformed .env files\n- Priority order established (process.env overrides .env values)\n- Unit tests verifying .env file loading and overriding behavior" }, { @@ -728,7 +884,10 @@ "title": "Implement Configuration Validation", "description": "Create a validation system for configuration values using a schema validation library like Joi, Zod, or Ajv. Define schemas for all configuration categories (API keys, file paths, feature flags, etc.). Implement validation that runs at startup and provides clear error messages for invalid configurations.", "status": "done", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "acceptanceCriteria": "- Schema validation implemented for all configuration values\n- Type checking and format validation for different value types\n- Comprehensive error messages that clearly identify validation failures\n- Support for custom validation rules for complex configuration requirements\n- Unit tests covering validation of valid and invalid configurations" }, { @@ -736,7 +895,11 @@ "title": "Create Configuration Defaults and Override System", "description": "Implement a system of sensible defaults for all configuration values with the ability to override them via environment variables or .env files. Create a unified configuration object that combines defaults, .env values, and environment variables with proper precedence. Implement a caching mechanism to avoid repeated environment lookups.", "status": "done", - "dependencies": [1, 2, 3], + "dependencies": [ + 1, + 2, + 3 + ], "acceptanceCriteria": "- Default configuration values defined for all settings\n- Clear override precedence (env vars > .env files > defaults)\n- Configuration object accessible throughout the application\n- Caching mechanism to improve performance\n- Unit tests verifying override behavior works correctly" }, { @@ -744,7 +907,12 @@ "title": "Create .env.example Template", "description": "Generate a comprehensive .env.example file that documents all supported environment variables, their purpose, format, and default values. Include comments explaining the purpose of each variable and provide examples. Ensure sensitive values are not included but have clear placeholders.", "status": "done", - "dependencies": [1, 2, 3, 4], + "dependencies": [ + 1, + 2, + 3, + 4 + ], "acceptanceCriteria": "- Complete .env.example file with all supported variables\n- Detailed comments explaining each variable's purpose and format\n- Clear placeholders for sensitive values (API_KEY=your-api-key-here)\n- Categorization of variables by function (API, logging, features, etc.)\n- Documentation on how to use the .env.example file" }, { @@ -752,7 +920,12 @@ "title": "Implement Secure API Key Handling", "description": "Create a secure mechanism for handling sensitive configuration values like API keys. Implement masking of sensitive values in logs and error messages. Add validation for API key formats and implement a mechanism to detect and warn about insecure storage of API keys (e.g., committed to git). Add support for key rotation and refresh.", "status": "done", - "dependencies": [1, 2, 3, 4], + "dependencies": [ + 1, + 2, + 3, + 4 + ], "acceptanceCriteria": "- Secure storage of API keys and sensitive configuration\n- Masking of sensitive values in logs and error messages\n- Validation of API key formats (length, character set, etc.)\n- Warning system for potentially insecure configuration practices\n- Support for key rotation without application restart\n- Unit tests verifying secure handling of sensitive configuration\n\nThese subtasks provide a comprehensive approach to implementing the configuration management system with a focus on security, validation, and developer experience. The tasks are sequenced to build upon each other logically, starting with basic environment variable support and progressing to more advanced features like secure API key handling." } ] @@ -762,7 +935,9 @@ "title": "Implement Comprehensive Logging System", "description": "Create a flexible logging system with configurable levels and output formats.", "status": "done", - "dependencies": [16], + "dependencies": [ + 16 + ], "priority": "medium", "details": "Implement logging system including:\n- Multiple log levels (debug, info, warn, error)\n- Configurable output destinations\n- Command execution logging\n- API interaction logging\n- Error tracking\n- Performance metrics\n- Log file rotation", "testStrategy": "Test logging at different verbosity levels. Verify that logs contain appropriate information for debugging. Test log file rotation with large volumes of logs.", @@ -780,7 +955,9 @@ "title": "Implement Configurable Output Destinations", "description": "Extend the logging framework to support multiple output destinations simultaneously. Implement adapters for console output, file output, and potentially other destinations (like remote logging services). Create a configuration system that allows specifying which log levels go to which destinations. Ensure thread-safe writing to prevent log corruption.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- Abstract destination interface that can be implemented by different output types\n- Console output adapter with color-coding based on log level\n- File output adapter with proper file handling and path configuration\n- Configuration options to route specific log levels to specific destinations\n- Ability to add custom output destinations through the adapter pattern\n- Tests verifying logs are correctly routed to configured destinations" }, { @@ -788,7 +965,10 @@ "title": "Implement Command and API Interaction Logging", "description": "Create specialized logging functionality for command execution and API interactions. For commands, log the command name, arguments, options, and execution status. For API interactions, log request details (URL, method, headers), response status, and timing information. Implement sanitization to prevent logging sensitive data like API keys or passwords.", "status": "done", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "acceptanceCriteria": "- Command logger that captures command execution details\n- API logger that records request/response details with timing information\n- Data sanitization to mask sensitive information in logs\n- Configuration options to control verbosity of command and API logs\n- Integration with existing command execution flow\n- Tests verifying proper logging of commands and API calls" }, { @@ -796,7 +976,9 @@ "title": "Implement Error Tracking and Performance Metrics", "description": "Enhance the logging system to provide detailed error tracking and performance metrics. For errors, capture stack traces, error codes, and contextual information. For performance metrics, implement timing utilities to measure execution duration of key operations. Create a consistent format for these specialized log types to enable easier analysis.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- Error logging with full stack trace capture and error context\n- Performance timer utility for measuring operation duration\n- Standard format for error and performance log entries\n- Ability to track related errors through correlation IDs\n- Configuration options for performance logging thresholds\n- Unit tests for error tracking and performance measurement" }, { @@ -804,7 +986,9 @@ "title": "Implement Log File Rotation and Management", "description": "Create a log file management system that handles rotation based on file size or time intervals. Implement compression of rotated logs, automatic cleanup of old logs, and configurable retention policies. Ensure that log rotation happens without disrupting the application and that no log messages are lost during rotation.", "status": "done", - "dependencies": [2], + "dependencies": [ + 2 + ], "acceptanceCriteria": "- Log rotation based on configurable file size or time interval\n- Compressed archive creation for rotated logs\n- Configurable retention policy for log archives\n- Zero message loss during rotation operations\n- Proper file locking to prevent corruption during rotation\n- Configuration options for rotation settings\n- Tests verifying rotation functionality with large log volumes\n- Documentation for log file location and naming conventions" } ] @@ -814,7 +998,17 @@ "title": "Create Comprehensive User Documentation", "description": "Develop complete user documentation including README, examples, and troubleshooting guides.", "status": "done", - "dependencies": [1, 3, 4, 5, 6, 7, 11, 12, 16], + "dependencies": [ + 1, + 3, + 4, + 5, + 6, + 7, + 11, + 12, + 16 + ], "priority": "medium", "details": "Create user documentation including:\n- Detailed README with installation and usage instructions\n- Command reference documentation\n- Configuration guide\n- Example workflows\n- Troubleshooting guides\n- API integration documentation\n- Best practices\n- Advanced usage scenarios", "testStrategy": "Review documentation for clarity and completeness. Have users unfamiliar with the system attempt to follow the documentation and note any confusion or issues.", @@ -824,7 +1018,9 @@ "title": "Create Detailed README with Installation and Usage Instructions", "description": "Develop a comprehensive README.md file that serves as the primary documentation entry point. Include project overview, installation steps for different environments, basic usage examples, and links to other documentation sections. Structure the README with clear headings, code blocks for commands, and screenshots where helpful.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- README includes project overview, features list, and system requirements\n- Installation instructions cover all supported platforms with step-by-step commands\n- Basic usage examples demonstrate core functionality with command syntax\n- Configuration section explains environment variables and .env file usage\n- Documentation includes badges for version, license, and build status\n- All sections are properly formatted with Markdown for readability" }, { @@ -832,7 +1028,9 @@ "title": "Develop Command Reference Documentation", "description": "Create detailed documentation for all CLI commands, their options, arguments, and examples. Organize commands by functionality category, include syntax diagrams, and provide real-world examples for each command. Document all global options and environment variables that affect command behavior.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- All commands are documented with syntax, options, and arguments\n- Each command includes at least 2 practical usage examples\n- Commands are organized into logical categories (task management, AI integration, etc.)\n- Global options are documented with their effects on command execution\n- Exit codes and error messages are documented for troubleshooting\n- Documentation includes command output examples" }, { @@ -848,7 +1046,10 @@ "title": "Develop Example Workflows and Use Cases", "description": "Create detailed documentation of common workflows and use cases, showing how to use the tool effectively for different scenarios. Include step-by-step guides with command sequences, expected outputs, and explanations. Cover basic to advanced workflows, including PRD parsing, task expansion, and implementation drift handling.", "status": "done", - "dependencies": [3, 6], + "dependencies": [ + 3, + 6 + ], "acceptanceCriteria": "- At least 5 complete workflow examples from initialization to completion\n- Each workflow includes all commands in sequence with expected outputs\n- Screenshots or terminal recordings illustrate the workflows\n- Explanation of decision points and alternatives within workflows\n- Advanced use cases demonstrate integration with development processes\n- Examples show how to handle common edge cases and errors" }, { @@ -856,7 +1057,11 @@ "title": "Create Troubleshooting Guide and FAQ", "description": "Develop a comprehensive troubleshooting guide that addresses common issues, error messages, and their solutions. Include a FAQ section covering common questions about usage, configuration, and best practices. Document known limitations and workarounds for edge cases.", "status": "done", - "dependencies": [1, 2, 3], + "dependencies": [ + 1, + 2, + 3 + ], "acceptanceCriteria": "- All error messages are documented with causes and solutions\n- Common issues are organized by category (installation, configuration, execution)\n- FAQ covers at least 15 common questions with detailed answers\n- Troubleshooting decision trees help users diagnose complex issues\n- Known limitations and edge cases are clearly documented\n- Recovery procedures for data corruption or API failures are included" }, { @@ -864,7 +1069,9 @@ "title": "Develop API Integration and Extension Documentation", "description": "Create technical documentation for API integrations (Claude, Perplexity) and extension points. Include details on prompt templates, response handling, token optimization, and custom integrations. Document the internal architecture to help developers extend the tool with new features or integrations.", "status": "done", - "dependencies": [5], + "dependencies": [ + 5 + ], "acceptanceCriteria": "- Detailed documentation of all API integrations with authentication requirements\n- Prompt templates are documented with variables and expected responses\n- Token usage optimization strategies are explained\n- Extension points are documented with examples\n- Internal architecture diagrams show component relationships\n- Custom integration guide includes step-by-step instructions and code examples" } ] @@ -874,7 +1081,14 @@ "title": "Implement Error Handling and Recovery", "description": "Create robust error handling throughout the system with helpful error messages and recovery options.", "status": "done", - "dependencies": [1, 3, 5, 9, 16, 17], + "dependencies": [ + 1, + 3, + 5, + 9, + 16, + 17 + ], "priority": "high", "details": "Implement error handling including:\n- Consistent error message format\n- Helpful error messages with recovery suggestions\n- API error handling with retries\n- File system error recovery\n- Data validation errors with specific feedback\n- Command syntax error guidance\n- System state recovery after failures", "testStrategy": "Deliberately trigger various error conditions and verify that the system handles them gracefully. Check that error messages are helpful and provide clear guidance on how to resolve issues.", @@ -900,7 +1114,9 @@ "title": "Develop File System Error Recovery Mechanisms", "description": "Implement error handling and recovery mechanisms for file system operations, focusing on tasks.json and individual task files. This should include handling of file not found errors, permission issues, and data corruption scenarios. Implement automatic backups and recovery procedures to ensure data integrity.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- File system operations are wrapped with comprehensive error handling" }, { @@ -908,7 +1124,10 @@ "title": "Enhance Data Validation with Detailed Error Feedback", "description": "Improve the existing data validation system to provide more specific and actionable error messages. Implement detailed validation checks for all user inputs and task data, with clear error messages that pinpoint the exact issue and how to resolve it. This should cover task creation, updates, and any data imported from external sources.", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "acceptanceCriteria": "- Enhanced validation checks are implemented for all task properties and user inputs" }, { @@ -916,7 +1135,9 @@ "title": "Implement Command Syntax Error Handling and Guidance", "description": "Enhance the CLI to provide more helpful error messages and guidance when users input invalid commands or options. Implement a \"did you mean?\" feature for close matches to valid commands, and provide context-sensitive help for command syntax errors. This should integrate with the existing Commander.js setup.", "status": "done", - "dependencies": [2], + "dependencies": [ + 2 + ], "acceptanceCriteria": "- Invalid commands trigger helpful error messages with suggestions for valid alternatives" }, { @@ -924,7 +1145,10 @@ "title": "Develop System State Recovery After Critical Failures", "description": "Implement a system state recovery mechanism to handle critical failures that could leave the task management system in an inconsistent state. This should include creating periodic snapshots of the system state, implementing a recovery procedure to restore from these snapshots, and providing tools for manual intervention if automatic recovery fails.", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "acceptanceCriteria": "- Periodic snapshots of the tasks.json and related state are automatically created" } ] @@ -934,7 +1158,11 @@ "title": "Create Token Usage Tracking and Cost Management", "description": "Implement system for tracking API token usage and managing costs.", "status": "done", - "dependencies": [5, 9, 17], + "dependencies": [ + 5, + 9, + 17 + ], "priority": "medium", "details": "Implement token tracking including:\n- Track token usage for all API calls\n- Implement configurable usage limits\n- Add reporting on token consumption\n- Create cost estimation features\n- Implement caching to reduce API calls\n- Add token optimization for prompts\n- Create usage alerts when approaching limits", "testStrategy": "Track token usage across various operations and verify accuracy. Test that limits properly prevent excessive usage. Verify that caching reduces token consumption for repeated operations.", @@ -944,7 +1172,9 @@ "title": "Implement Token Usage Tracking for API Calls", "description": "Create a middleware or wrapper function that intercepts all API calls to OpenAI, Anthropic, and Perplexity. This function should count the number of tokens used in both the request and response, storing this information in a persistent data store (e.g., SQLite database). Implement a caching mechanism to reduce redundant API calls and token usage.", "status": "done", - "dependencies": [5], + "dependencies": [ + 5 + ], "acceptanceCriteria": "- Token usage is accurately tracked for all API calls" }, { @@ -960,7 +1190,10 @@ "title": "Implement Token Usage Reporting and Cost Estimation", "description": "Develop a reporting module that generates detailed token usage reports. Include breakdowns by API, user, and time period. Implement cost estimation features by integrating current pricing information for each API. Create both command-line and programmatic interfaces for generating reports and estimates.", "status": "done", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "acceptanceCriteria": "- CLI command for generating usage reports with various filters" }, { @@ -976,7 +1209,10 @@ "title": "Develop Token Usage Alert System", "description": "Create an alert system that monitors token usage in real-time and sends notifications when usage approaches or exceeds defined thresholds. Implement multiple notification channels (e.g., email, Slack, system logs) and allow for customizable alert rules. Integrate this system with the existing logging and reporting modules.", "status": "done", - "dependencies": [2, 3], + "dependencies": [ + 2, + 3 + ], "acceptanceCriteria": "- Real-time monitoring of token usage against configured limits" } ] @@ -986,7 +1222,11 @@ "title": "Refactor dev.js into Modular Components", "description": "Restructure the monolithic dev.js file into separate modular components to improve code maintainability, readability, and testability while preserving all existing functionality.", "status": "done", - "dependencies": [3, 16, 17], + "dependencies": [ + 3, + 16, + 17 + ], "priority": "high", "details": "This task involves breaking down the current dev.js file into logical modules with clear responsibilities:\n\n1. Create the following module files:\n - commands.js: Handle all CLI command definitions and execution logic\n - ai-services.js: Encapsulate all AI service interactions (OpenAI, etc.)\n - task-manager.js: Manage task operations (create, read, update, delete)\n - ui.js: Handle all console output formatting, colors, and user interaction\n - utils.js: Contain helper functions, utilities, and shared code\n\n2. Refactor dev.js to serve as the entry point that:\n - Imports and initializes all modules\n - Handles command-line argument parsing\n - Sets up the execution environment\n - Orchestrates the flow between modules\n\n3. Ensure proper dependency injection between modules to avoid circular dependencies\n\n4. Maintain consistent error handling across modules\n\n5. Update import/export statements throughout the codebase\n\n6. Document each module with clear JSDoc comments explaining purpose and usage\n\n7. Ensure configuration and logging systems are properly integrated into each module\n\nThe refactoring should not change any existing functionality - this is purely a code organization task.", "testStrategy": "Testing should verify that functionality remains identical after refactoring:\n\n1. Automated Testing:\n - Create unit tests for each new module to verify individual functionality\n - Implement integration tests that verify modules work together correctly\n - Test each command to ensure it works exactly as before\n\n2. Manual Testing:\n - Execute all existing CLI commands and verify outputs match pre-refactoring behavior\n - Test edge cases like error handling and invalid inputs\n - Verify that configuration options still work as expected\n\n3. Code Quality Verification:\n - Run linting tools to ensure code quality standards are maintained\n - Check for any circular dependencies between modules\n - Verify that each module has a single, clear responsibility\n\n4. Performance Testing:\n - Compare execution time before and after refactoring to ensure no performance regression\n\n5. Documentation Check:\n - Verify that each module has proper documentation\n - Ensure README is updated if necessary to reflect architectural changes", @@ -1004,7 +1244,9 @@ "title": "Create Core Module Structure and Entry Point Refactoring", "description": "Create the skeleton structure for all module files (commands.js, ai-services.js, task-manager.js, ui.js, utils.js) with proper export statements. Refactor dev.js to serve as the entry point that imports and orchestrates these modules. Implement the basic initialization flow and command-line argument parsing in the new structure.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- All module files created with appropriate JSDoc headers explaining purpose" }, { @@ -1012,7 +1254,9 @@ "title": "Implement Core Module Functionality with Dependency Injection", "description": "Migrate the core functionality from dev.js into the appropriate modules following the mapping document. Implement proper dependency injection to avoid circular dependencies. Ensure each module has a clear API and properly encapsulates its internal state. Focus on the critical path functionality first.", "status": "done", - "dependencies": [2], + "dependencies": [ + 2 + ], "acceptanceCriteria": "- All core functionality migrated to appropriate modules" }, { @@ -1020,7 +1264,9 @@ "title": "Implement Error Handling and Complete Module Migration", "description": "Establish a consistent error handling pattern across all modules. Complete the migration of remaining functionality from dev.js to the appropriate modules. Ensure all edge cases, error scenarios, and helper functions are properly moved and integrated. Update all import/export statements throughout the codebase to reference the new module structure.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "acceptanceCriteria": "- Consistent error handling pattern implemented across all modules" }, { @@ -1028,7 +1274,9 @@ "title": "Test, Document, and Finalize Modular Structure", "description": "Perform comprehensive testing of the refactored codebase to ensure all functionality works as expected. Add detailed JSDoc comments to all modules, functions, and significant code blocks. Create or update developer documentation explaining the new modular structure, module responsibilities, and how they interact. Perform a final code review to ensure code quality, consistency, and adherence to best practices.", "status": "done", - "dependencies": ["21.4"], + "dependencies": [ + "21.4" + ], "acceptanceCriteria": "- All existing functionality works exactly as before" } ] @@ -1038,7 +1286,9 @@ "title": "Create Comprehensive Test Suite for Task Master CLI", "description": "Develop a complete testing infrastructure for the Task Master CLI that includes unit, integration, and end-to-end tests to verify all core functionality and error handling.", "status": "done", - "dependencies": [21], + "dependencies": [ + 21 + ], "priority": "high", "details": "Implement a comprehensive test suite using Jest as the testing framework. The test suite should be organized into three main categories:\n\n1. Unit Tests:\n - Create tests for all utility functions and core logic components\n - Test task creation, parsing, and manipulation functions\n - Test data storage and retrieval functions\n - Test formatting and display functions\n\n2. Integration Tests:\n - Test all CLI commands (create, expand, update, list, etc.)\n - Verify command options and parameters work correctly\n - Test interactions between different components\n - Test configuration loading and application settings\n\n3. End-to-End Tests:\n - Test complete workflows (e.g., creating a task, expanding it, updating status)\n - Test error scenarios and recovery\n - Test edge cases like handling large numbers of tasks\n\nImplement proper mocking for:\n- Claude API interactions (using Jest mock functions)\n- File system operations (using mock-fs or similar)\n- User input/output (using mock stdin/stdout)\n\nEnsure tests cover both successful operations and error handling paths. Set up continuous integration to run tests automatically. Create fixtures for common test data and scenarios. Include test coverage reporting to identify untested code paths.", "testStrategy": "Verification will involve:\n\n1. Code Review:\n - Verify test organization follows the unit/integration/end-to-end structure\n - Check that all major functions have corresponding tests\n - Verify mocks are properly implemented for external dependencies\n\n2. Test Coverage Analysis:\n - Run test coverage tools to ensure at least 80% code coverage\n - Verify critical paths have 100% coverage\n - Identify any untested code paths\n\n3. Test Quality Verification:\n - Manually review test cases to ensure they test meaningful behavior\n - Verify both positive and negative test cases exist\n - Check that tests are deterministic and don't have false positives/negatives\n\n4. CI Integration:\n - Verify tests run successfully in the CI environment\n - Ensure tests run in a reasonable amount of time\n - Check that test failures provide clear, actionable information\n\nThe task will be considered complete when all tests pass consistently, coverage meets targets, and the test suite can detect intentionally introduced bugs.", @@ -1056,7 +1306,9 @@ "title": "Implement Unit Tests for Core Components", "description": "Create a comprehensive set of unit tests for all utility functions, core logic components, and individual modules of the Task Master CLI. This includes tests for task creation, parsing, manipulation, data storage, retrieval, and formatting functions. Ensure all edge cases and error scenarios are covered.", "status": "done", - "dependencies": [1], + "dependencies": [ + 1 + ], "acceptanceCriteria": "- Unit tests are implemented for all utility functions in the project" }, { @@ -1064,7 +1316,10 @@ "title": "Develop Integration and End-to-End Tests", "description": "Create integration tests that verify the correct interaction between different components of the CLI, including command execution, option parsing, and data flow. Implement end-to-end tests that simulate complete user workflows, such as creating a task, expanding it, and updating its status. Include tests for error scenarios, recovery processes, and handling large numbers of tasks.", "status": "deferred", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "acceptanceCriteria": "- Integration tests cover all CLI commands (create, expand, update, list, etc.)" } ] @@ -1074,7 +1329,9 @@ "title": "Complete MCP Server Implementation for Task Master using FastMCP", "description": "Finalize the MCP server functionality for Task Master by leveraging FastMCP's capabilities, transitioning from CLI-based execution to direct function imports, and optimizing performance, authentication, and context management. Ensure the server integrates seamlessly with Cursor via `mcp.json` and supports proper tool registration, efficient context handling, and transport type handling (focusing on stdio). Additionally, ensure the server can be instantiated properly when installed via `npx` or `npm i -g`. Evaluate and address gaps in the current implementation, including function imports, context management, caching, tool registration, and adherence to FastMCP best practices.", "status": "done", - "dependencies": [22], + "dependencies": [ + 22 + ], "priority": "medium", "details": "This task involves completing the Model Context Protocol (MCP) server implementation for Task Master using FastMCP. Key updates include:\n\n1. Transition from CLI-based execution (currently using `child_process.spawnSync`) to direct Task Master function imports for improved performance and reliability.\n2. Implement caching mechanisms for frequently accessed contexts to enhance performance, leveraging FastMCP's efficient transport mechanisms (e.g., stdio).\n3. Refactor context management to align with best practices for handling large context windows, metadata, and tagging.\n4. Refactor tool registration in `tools/index.js` to include clear descriptions and parameter definitions, leveraging FastMCP's decorator-based patterns for better integration.\n5. Enhance transport type handling to ensure proper stdio communication and compatibility with FastMCP.\n6. Ensure the MCP server can be instantiated and run correctly when installed globally via `npx` or `npm i -g`.\n7. Integrate the ModelContextProtocol SDK directly to streamline resource and tool registration, ensuring compatibility with FastMCP's transport mechanisms.\n8. Identify and address missing components or functionalities to meet FastMCP best practices, such as robust error handling, monitoring endpoints, and concurrency support.\n9. Update documentation to include examples of using the MCP server with FastMCP, detailed setup instructions, and client integration guides.\n10. Organize direct function implementations in a modular structure within the mcp-server/src/core/direct-functions/ directory for improved maintainability and organization.\n11. Follow consistent naming conventions: file names use kebab-case (like-this.js), direct functions use camelCase with Direct suffix (functionNameDirect), tool registration functions use camelCase with Tool suffix (registerToolNameTool), and MCP tool names exposed to clients use snake_case (tool_name).\n\nThe implementation must ensure compatibility with existing MCP clients and follow RESTful API design principles, while supporting concurrent requests and maintaining robust error handling.", "testStrategy": "Testing for the MCP server implementation will follow a comprehensive approach based on our established testing guidelines:\n\n## Test Organization\n\n1. **Unit Tests** (`tests/unit/mcp-server/`):\n - Test individual MCP server components in isolation\n - Mock all external dependencies including FastMCP SDK\n - Test each tool implementation separately\n - Test each direct function implementation in the direct-functions directory\n - Verify direct function imports work correctly\n - Test context management and caching mechanisms\n - Example files: `context-manager.test.js`, `tool-registration.test.js`, `direct-functions/list-tasks.test.js`\n\n2. **Integration Tests** (`tests/integration/mcp-server/`):\n - Test interactions between MCP server components\n - Verify proper tool registration with FastMCP\n - Test context flow between components\n - Validate error handling across module boundaries\n - Test the integration between direct functions and their corresponding MCP tools\n - Example files: `server-tool-integration.test.js`, `context-flow.test.js`\n\n3. **End-to-End Tests** (`tests/e2e/mcp-server/`):\n - Test complete MCP server workflows\n - Verify server instantiation via different methods (direct, npx, global install)\n - Test actual stdio communication with mock clients\n - Example files: `server-startup.e2e.test.js`, `client-communication.e2e.test.js`\n\n4. **Test Fixtures** (`tests/fixtures/mcp-server/`):\n - Sample context data\n - Mock tool definitions\n - Sample MCP requests and responses\n\n## Testing Approach\n\n### Module Mocking Strategy\n```javascript\n// Mock the FastMCP SDK\njest.mock('@model-context-protocol/sdk', () => ({\n MCPServer: jest.fn().mockImplementation(() => ({\n registerTool: jest.fn(),\n registerResource: jest.fn(),\n start: jest.fn().mockResolvedValue(undefined),\n stop: jest.fn().mockResolvedValue(undefined)\n })),\n MCPError: jest.fn().mockImplementation(function(message, code) {\n this.message = message;\n this.code = code;\n })\n}));\n\n// Import modules after mocks\nimport { MCPServer, MCPError } from '@model-context-protocol/sdk';\nimport { initMCPServer } from '../../scripts/mcp-server.js';\n```\n\n### Direct Function Testing\n- Test each direct function in isolation\n- Verify proper error handling and return formats\n- Test with various input parameters and edge cases\n- Verify integration with the task-master-core.js export hub\n\n### Context Management Testing\n- Test context creation, retrieval, and manipulation\n- Verify caching mechanisms work correctly\n- Test context windowing and metadata handling\n- Validate context persistence across server restarts\n\n### Direct Function Import Testing\n- Verify Task Master functions are imported correctly\n- Test performance improvements compared to CLI execution\n- Validate error handling with direct imports\n\n### Tool Registration Testing\n- Verify tools are registered with proper descriptions and parameters\n- Test decorator-based registration patterns\n- Validate tool execution with different input types\n\n### Error Handling Testing\n- Test all error paths with appropriate MCPError types\n- Verify error propagation to clients\n- Test recovery from various error conditions\n\n### Performance Testing\n- Benchmark response times with and without caching\n- Test memory usage under load\n- Verify concurrent request handling\n\n## Test Quality Guidelines\n\n- Follow TDD approach when possible\n- Maintain test independence and isolation\n- Use descriptive test names explaining expected behavior\n- Aim for 80%+ code coverage, with critical paths at 100%\n- Follow the mock-first-then-import pattern for all Jest mocks\n- Avoid testing implementation details that might change\n- Ensure tests don't depend on execution order\n\n## Specific Test Cases\n\n1. **Server Initialization**\n - Test server creation with various configuration options\n - Verify proper tool and resource registration\n - Test server startup and shutdown procedures\n\n2. **Context Operations**\n - Test context creation, retrieval, update, and deletion\n - Verify context windowing and truncation\n - Test context metadata and tagging\n\n3. **Tool Execution**\n - Test each tool with various input parameters\n - Verify proper error handling for invalid inputs\n - Test tool execution performance\n\n4. **MCP.json Integration**\n - Test creation and updating of .cursor/mcp.json\n - Verify proper server registration in mcp.json\n - Test handling of existing mcp.json files\n\n5. **Transport Handling**\n - Test stdio communication\n - Verify proper message formatting\n - Test error handling in transport layer\n\n6. **Direct Function Structure**\n - Test the modular organization of direct functions\n - Verify proper import/export through task-master-core.js\n - Test utility functions in the utils directory\n\nAll tests will be automated and integrated into the CI/CD pipeline to ensure consistent quality.", @@ -1092,7 +1349,9 @@ "id": 2, "title": "Implement Context Management System", "description": "Develop a robust context management system that can efficiently store, retrieve, and manipulate context data according to the MCP specification.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Implementation steps:\n1. Design and implement data structures for context storage\n2. Create methods for context creation, retrieval, updating, and deletion\n3. Implement context windowing and truncation algorithms for handling size limits\n4. Add support for context metadata and tagging\n5. Create utilities for context serialization and deserialization\n6. Implement efficient indexing for quick context lookups\n7. Add support for context versioning and history\n8. Develop mechanisms for context persistence (in-memory, disk-based, or database)\n\nTesting approach:\n- Unit tests for all context operations (CRUD)\n- Performance tests for context retrieval with various sizes\n- Test context windowing and truncation with edge cases\n- Verify metadata handling and tagging functionality\n- Test persistence mechanisms with simulated failures", "status": "done", "parentTaskId": 23 @@ -1101,7 +1360,10 @@ "id": 3, "title": "Implement MCP Endpoints and API Handlers", "description": "Develop the complete API handlers for all required MCP endpoints, ensuring they follow the protocol specification and integrate with the context management system.", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Implementation steps:\n1. Implement the `/context` endpoint for:\n - GET: retrieving existing context\n - POST: creating new context\n - PUT: updating existing context\n - DELETE: removing context\n2. Implement the `/models` endpoint to list available models\n3. Develop the `/execute` endpoint for performing operations with context\n4. Create request validators for each endpoint\n5. Implement response formatters according to MCP specifications\n6. Add detailed error handling for each endpoint\n7. Set up proper HTTP status codes for different scenarios\n8. Implement pagination for endpoints that return lists\n\nTesting approach:\n- Unit tests for each endpoint handler\n- Integration tests with mock context data\n- Test various request formats and edge cases\n- Verify response formats match MCP specifications\n- Test error handling with invalid inputs\n- Benchmark endpoint performance", "status": "done", "parentTaskId": 23 @@ -1110,7 +1372,11 @@ "id": 6, "title": "Refactor MCP Server to Leverage ModelContextProtocol SDK", "description": "Integrate the ModelContextProtocol SDK directly into the MCP server implementation to streamline tool registration and resource handling.", - "dependencies": [1, 2, 3], + "dependencies": [ + 1, + 2, + 3 + ], "details": "Implementation steps:\n1. Replace manual tool registration with ModelContextProtocol SDK methods.\n2. Use SDK utilities to simplify resource and template management.\n3. Ensure compatibility with FastMCP's transport mechanisms.\n4. Update server initialization to include SDK-based configurations.\n\nTesting approach:\n- Verify SDK integration with all MCP endpoints.\n- Test resource and template registration using SDK methods.\n- Validate compatibility with existing MCP clients.\n- Benchmark performance improvements from SDK integration.\n\n<info added on 2025-03-31T18:49:14.439Z>\nThe subtask is being cancelled because FastMCP already serves as a higher-level abstraction over the Model Context Protocol SDK. Direct integration with the MCP SDK would be redundant and potentially counterproductive since:\n\n1. FastMCP already encapsulates the necessary SDK functionality for tool registration and resource handling\n2. The existing FastMCP abstractions provide a more streamlined developer experience\n3. Adding another layer of SDK integration would increase complexity without clear benefits\n4. The transport mechanisms in FastMCP are already optimized for the current architecture\n\nInstead, we should focus on extending and enhancing the existing FastMCP abstractions where needed, rather than attempting to bypass them with direct SDK integration.\n</info added on 2025-03-31T18:49:14.439Z>", "status": "done", "parentTaskId": 23 @@ -1119,7 +1385,9 @@ "id": 8, "title": "Implement Direct Function Imports and Replace CLI-based Execution", "description": "Refactor the MCP server implementation to use direct Task Master function imports instead of the current CLI-based execution using child_process.spawnSync. This will improve performance, reliability, and enable better error handling.", - "dependencies": ["23.13"], + "dependencies": [ + "23.13" + ], "details": "\n\n<info added on 2025-03-30T00:14:10.040Z>\n```\n# Refactoring Strategy for Direct Function Imports\n\n## Core Approach\n1. Create a clear separation between data retrieval/processing and presentation logic\n2. Modify function signatures to accept `outputFormat` parameter ('cli'|'json', default: 'cli')\n3. Implement early returns for JSON format to bypass CLI-specific code\n\n## Implementation Details for `listTasks`\n```javascript\nfunction listTasks(tasksPath, statusFilter, withSubtasks = false, outputFormat = 'cli') {\n try {\n // Existing data retrieval logic\n const filteredTasks = /* ... */;\n \n // Early return for JSON format\n if (outputFormat === 'json') return filteredTasks;\n \n // Existing CLI output logic\n } catch (error) {\n if (outputFormat === 'json') {\n throw {\n code: 'TASK_LIST_ERROR',\n message: error.message,\n details: error.stack\n };\n } else {\n console.error(error);\n process.exit(1);\n }\n }\n}\n```\n\n## Testing Strategy\n- Create integration tests in `tests/integration/mcp-server/`\n- Use FastMCP InMemoryTransport for direct client-server testing\n- Test both JSON and CLI output formats\n- Verify structure consistency with schema validation\n\n## Additional Considerations\n- Update JSDoc comments to document new parameters and return types\n- Ensure backward compatibility with default CLI behavior\n- Add JSON schema validation for consistent output structure\n- Apply similar pattern to other core functions (expandTask, updateTaskById, etc.)\n\n## Error Handling Improvements\n- Standardize error format for JSON returns:\n```javascript\n{\n code: 'ERROR_CODE',\n message: 'Human-readable message',\n details: {}, // Additional context when available\n stack: process.env.NODE_ENV === 'development' ? error.stack : undefined\n}\n```\n- Enrich JSON errors with error codes and debug info\n- Ensure validation failures return proper objects in JSON mode\n```\n</info added on 2025-03-30T00:14:10.040Z>", "status": "done", "parentTaskId": 23 @@ -1128,7 +1396,9 @@ "id": 9, "title": "Implement Context Management and Caching Mechanisms", "description": "Enhance the MCP server with proper context management and caching to improve performance and user experience, especially for frequently accessed data and contexts.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "1. Implement a context manager class that leverages FastMCP's Context object\n2. Add caching for frequently accessed task data with configurable TTL settings\n3. Implement context tagging for better organization of context data\n4. Add methods to efficiently handle large context windows\n5. Create helper functions for storing and retrieving context data\n6. Implement cache invalidation strategies for task updates\n7. Add cache statistics for monitoring performance\n8. Create unit tests for context management and caching functionality", "status": "done", "parentTaskId": 23 @@ -1137,7 +1407,10 @@ "id": 10, "title": "Enhance Tool Registration and Resource Management", "description": "Refactor tool registration to follow FastMCP best practices, using decorators and improving the overall structure. Implement proper resource management for task templates and other shared resources.", - "dependencies": [1, "23.8"], + "dependencies": [ + 1, + "23.8" + ], "details": "1. Update registerTaskMasterTools function to use FastMCP's decorator pattern\n2. Implement @mcp.tool() decorators for all existing tools\n3. Add proper type annotations and documentation for all tools\n4. Create resource handlers for task templates using @mcp.resource()\n5. Implement resource templates for common task patterns\n6. Update the server initialization to properly register all tools and resources\n7. Add validation for tool inputs using FastMCP's built-in validation\n8. Create comprehensive tests for tool registration and resource access\n\n<info added on 2025-03-31T18:35:21.513Z>\nHere is additional information to enhance the subtask regarding resources and resource templates in FastMCP:\n\nResources in FastMCP are used to expose static or dynamic data to LLM clients. For the Task Master MCP server, we should implement resources to provide:\n\n1. Task templates: Predefined task structures that can be used as starting points\n2. Workflow definitions: Reusable workflow patterns for common task sequences\n3. User preferences: Stored user settings for task management\n4. Project metadata: Information about active projects and their attributes\n\nResource implementation should follow this structure:\n\n```python\n@mcp.resource(\"tasks://templates/{template_id}\")\ndef get_task_template(template_id: str) -> dict:\n # Fetch and return the specified task template\n ...\n\n@mcp.resource(\"workflows://definitions/{workflow_id}\")\ndef get_workflow_definition(workflow_id: str) -> dict:\n # Fetch and return the specified workflow definition\n ...\n\n@mcp.resource(\"users://{user_id}/preferences\")\ndef get_user_preferences(user_id: str) -> dict:\n # Fetch and return user preferences\n ...\n\n@mcp.resource(\"projects://metadata\")\ndef get_project_metadata() -> List[dict]:\n # Fetch and return metadata for all active projects\n ...\n```\n\nResource templates in FastMCP allow for dynamic generation of resources based on patterns. For Task Master, we can implement:\n\n1. Dynamic task creation templates\n2. Customizable workflow templates\n3. User-specific resource views\n\nExample implementation:\n\n```python\n@mcp.resource(\"tasks://create/{task_type}\")\ndef get_task_creation_template(task_type: str) -> dict:\n # Generate and return a task creation template based on task_type\n ...\n\n@mcp.resource(\"workflows://custom/{user_id}/{workflow_name}\")\ndef get_custom_workflow_template(user_id: str, workflow_name: str) -> dict:\n # Generate and return a custom workflow template for the user\n ...\n\n@mcp.resource(\"users://{user_id}/dashboard\")\ndef get_user_dashboard(user_id: str) -> dict:\n # Generate and return a personalized dashboard view for the user\n ...\n```\n\nBest practices for integrating resources with Task Master functionality:\n\n1. Use resources to provide context and data for tools\n2. Implement caching for frequently accessed resources\n3. Ensure proper error handling and not-found cases for all resources\n4. Use resource templates to generate dynamic, personalized views of data\n5. Implement access control to ensure users only access authorized resources\n\nBy properly implementing these resources and resource templates, we can provide rich, contextual data to LLM clients, enhancing the Task Master's capabilities and user experience.\n</info added on 2025-03-31T18:35:21.513Z>", "status": "done", "parentTaskId": 23 @@ -1148,7 +1421,10 @@ "description": "Implement robust error handling using FastMCP's MCPError, including custom error types for different categories and standardized error responses.", "details": "1. Create custom error types extending MCPError for different categories (validation, auth, etc.)\\n2. Implement standardized error responses following MCP protocol\\n3. Add error handling middleware for all MCP endpoints\\n4. Ensure proper error propagation from tools to client\\n5. Add debug mode with detailed error information\\n6. Document error types and handling patterns", "status": "done", - "dependencies": ["23.1", "23.3"], + "dependencies": [ + "23.1", + "23.3" + ], "parentTaskId": 23 }, { @@ -1157,7 +1433,10 @@ "description": "Implement a comprehensive logging system for the MCP server with different log levels, structured logging format, and request/response tracking.", "details": "1. Design structured log format for consistent parsing\\n2. Implement different log levels (debug, info, warn, error)\\n3. Add request/response logging middleware\\n4. Implement correlation IDs for request tracking\\n5. Add performance metrics logging\\n6. Configure log output destinations (console, file)\\n7. Document logging patterns and usage", "status": "done", - "dependencies": ["23.1", "23.3"], + "dependencies": [ + "23.1", + "23.3" + ], "parentTaskId": 23 }, { @@ -1166,7 +1445,10 @@ "description": "Implement a comprehensive testing framework for the MCP server, including unit tests, integration tests, and end-to-end tests.", "details": "1. Set up Jest testing framework with proper configuration\\n2. Create MCPTestClient for testing FastMCP server interaction\\n3. Implement unit tests for individual tool functions\\n4. Create integration tests for end-to-end request/response cycles\\n5. Set up test fixtures and mock data\\n6. Implement test coverage reporting\\n7. Document testing guidelines and examples", "status": "done", - "dependencies": ["23.1", "23.3"], + "dependencies": [ + "23.1", + "23.3" + ], "parentTaskId": 23 }, { @@ -1175,7 +1457,10 @@ "description": "Implement functionality to create or update .cursor/mcp.json during project initialization, handling cases where: 1) If there's no mcp.json, create it with the appropriate configuration; 2) If there is an mcp.json, intelligently append to it without syntax errors like trailing commas", "details": "1. Create functionality to detect if .cursor/mcp.json exists in the project\\n2. Implement logic to create a new mcp.json file with proper structure if it doesn't exist\\n3. Add functionality to read and parse existing mcp.json if it exists\\n4. Create method to add a new taskmaster-ai server entry to the mcpServers object\\n5. Implement intelligent JSON merging that avoids trailing commas and syntax errors\\n6. Ensure proper formatting and indentation in the generated/updated JSON\\n7. Add validation to verify the updated configuration is valid JSON\\n8. Include this functionality in the init workflow\\n9. Add error handling for file system operations and JSON parsing\\n10. Document the mcp.json structure and integration process", "status": "done", - "dependencies": ["23.1", "23.3"], + "dependencies": [ + "23.1", + "23.3" + ], "parentTaskId": 23 }, { @@ -1184,7 +1469,11 @@ "description": "Add Server-Sent Events (SSE) capabilities to the MCP server to enable real-time updates and streaming of task execution progress, logs, and status changes to clients", "details": "1. Research and implement SSE protocol for the MCP server\\n2. Create dedicated SSE endpoints for event streaming\\n3. Implement event emitter pattern for internal event management\\n4. Add support for different event types (task status, logs, errors)\\n5. Implement client connection management with proper keep-alive handling\\n6. Add filtering capabilities to allow subscribing to specific event types\\n7. Create in-memory event buffer for clients reconnecting\\n8. Document SSE endpoint usage and client implementation examples\\n9. Add robust error handling for dropped connections\\n10. Implement rate limiting and backpressure mechanisms\\n11. Add authentication for SSE connections", "status": "done", - "dependencies": ["23.1", "23.3", "23.11"], + "dependencies": [ + "23.1", + "23.3", + "23.11" + ], "parentTaskId": 23 }, { @@ -1337,7 +1626,9 @@ "description": "Move existing direct function implementations from task-master-core.js to individual files in the new directory structure.", "details": "1. Identify all existing direct functions in task-master-core.js\n2. Create individual files for each function in mcp-server/src/core/direct-functions/\n3. Move the implementation to the new files, ensuring consistent error handling\n4. Update imports/exports in task-master-core.js\n5. Create unit tests for each individual function file\n6. Update documentation to reflect the new structure\n7. Ensure all MCP tools reference the functions through task-master-core.js\n8. Verify backward compatibility with existing code", "status": "done", - "dependencies": ["23.31"], + "dependencies": [ + "23.31" + ], "parentTaskId": 23 }, { @@ -1400,7 +1691,9 @@ "description": "Create MCP tool implementation for the add-dependency command", "details": "", "status": "done", - "dependencies": ["23.31"], + "dependencies": [ + "23.31" + ], "parentTaskId": 23 }, { @@ -1409,7 +1702,9 @@ "description": "Create MCP tool implementation for the remove-dependency command", "details": "", "status": "done", - "dependencies": ["23.31"], + "dependencies": [ + "23.31" + ], "parentTaskId": 23 }, { @@ -1418,7 +1713,11 @@ "description": "Create MCP tool implementation for the validate-dependencies command", "details": "", "status": "done", - "dependencies": ["23.31", "23.39", "23.40"], + "dependencies": [ + "23.31", + "23.39", + "23.40" + ], "parentTaskId": 23 }, { @@ -1427,7 +1726,10 @@ "description": "Create MCP tool implementation for the fix-dependencies command", "details": "", "status": "done", - "dependencies": ["23.31", "23.41"], + "dependencies": [ + "23.31", + "23.41" + ], "parentTaskId": 23 }, { @@ -1436,7 +1738,9 @@ "description": "Create MCP tool implementation for the complexity-report command", "details": "", "status": "done", - "dependencies": ["23.31"], + "dependencies": [ + "23.31" + ], "parentTaskId": 23 }, { @@ -1473,7 +1777,9 @@ "title": "Implement AI-Powered Test Generation Command", "description": "Create a new 'generate-test' command in Task Master that leverages AI to automatically produce Jest test files for tasks based on their descriptions and subtasks, utilizing Claude API for AI integration.", "status": "pending", - "dependencies": [22], + "dependencies": [ + 22 + ], "priority": "high", "details": "Implement a new command in the Task Master CLI that generates comprehensive Jest test files for tasks. The command should be callable as 'task-master generate-test --id=1' and should:\n\n1. Accept a task ID parameter to identify which task to generate tests for\n2. Retrieve the task and its subtasks from the task store\n3. Analyze the task description, details, and subtasks to understand implementation requirements\n4. Construct an appropriate prompt for the AI service using Claude API\n5. Process the AI response to create a well-formatted test file named 'task_XXX.test.ts' where XXX is the zero-padded task ID\n6. Include appropriate test cases that cover the main functionality described in the task\n7. Generate mocks for external dependencies identified in the task description\n8. Create assertions that validate the expected behavior\n9. Handle both parent tasks and subtasks appropriately (for subtasks, name the file 'task_XXX_YYY.test.ts' where YYY is the subtask ID)\n10. Include error handling for API failures, invalid task IDs, etc.\n11. Add appropriate documentation for the command in the help system\n\nThe implementation should utilize the Claude API for AI service integration and maintain consistency with the current command structure and error handling patterns. Consider using TypeScript for better type safety and integration with the Claude API.", "testStrategy": "Testing for this feature should include:\n\n1. Unit tests for the command handler function to verify it correctly processes arguments and options\n2. Mock tests for the Claude API integration to ensure proper prompt construction and response handling\n3. Integration tests that verify the end-to-end flow using a mock Claude API response\n4. Tests for error conditions including:\n - Invalid task IDs\n - Network failures when contacting the AI service\n - Malformed AI responses\n - File system permission issues\n5. Verification that generated test files follow Jest conventions and can be executed\n6. Tests for both parent task and subtask handling\n7. Manual verification of the quality of generated tests by running them against actual task implementations\n\nCreate a test fixture with sample tasks of varying complexity to evaluate the test generation capabilities across different scenarios. The tests should verify that the command outputs appropriate success/error messages to the console and creates files in the expected location with proper content structure.", @@ -1491,7 +1797,9 @@ "id": 2, "title": "Implement AI prompt construction and FastMCP integration", "description": "Develop the logic to analyze tasks, construct appropriate AI prompts, and interact with the AI service using FastMCP to generate test content.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Implementation steps:\n1. Create a utility function to analyze task descriptions and subtasks for test requirements\n2. Implement a prompt builder that formats task information into an effective AI prompt\n3. Use FastMCP to send the prompt and receive the response\n4. Process the FastMCP response to extract the generated test code\n5. Implement error handling for FastMCP failures, rate limits, and malformed responses\n6. Add appropriate logging for the FastMCP interaction process\n\nTesting approach:\n- Test prompt construction with various task types\n- Test FastMCP integration with mocked responses\n- Test error handling for FastMCP failures\n- Test response processing with sample FastMCP outputs\n<info added on 2025-05-23T21:04:33.890Z>\n## AI Integration Implementation\n\n### AI Service Integration\n- Use the unified AI service layer, not FastMCP directly\n- Implement with `generateObjectService` from '../ai-services-unified.js'\n- Define Zod schema for structured test generation output:\n - testContent: Complete Jest test file content\n - fileName: Suggested filename for the test file\n - mockRequirements: External dependencies that need mocking\n\n### Prompt Construction\n- Create system prompt defining AI's role as test generator\n- Build user prompt with task context (ID, title, description, details)\n- Include test strategy and subtasks context in the prompt\n- Follow patterns from add-task.js for prompt structure\n\n### Task Analysis\n- Retrieve task data using `findTaskById()` from utils.js\n- Build context by analyzing task description, details, and testStrategy\n- Examine project structure for import patterns\n- Parse specific testing requirements from task.testStrategy field\n\n### File System Operations\n- Determine output path in same directory as tasks.json\n- Generate standardized filename based on task ID\n- Use fs.writeFileSync for writing test content to file\n\n### Error Handling & UI\n- Implement try/catch blocks for AI service calls\n- Display user-friendly error messages with chalk\n- Use loading indicators during AI processing\n- Support both research and main AI models\n\n### Telemetry\n- Pass through telemetryData from AI service response\n- Display AI usage summary for CLI output\n\n### Required Dependencies\n- generateObjectService from ai-services-unified.js\n- UI components (loading indicators, display functions)\n- Zod for schema validation\n- Chalk for formatted console output\n</info added on 2025-05-23T21:04:33.890Z>", "status": "pending", "parentTaskId": 24 @@ -1500,7 +1808,9 @@ "id": 3, "title": "Implement test file generation and output", "description": "Create functionality to format AI-generated tests into proper Jest test files and save them to the appropriate location.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Implementation steps:\n1. Create a utility to format the FastMCP response into a well-structured Jest test file\n2. Implement naming logic for test files (task_XXX.test.ts for parent tasks, task_XXX_YYY.test.ts for subtasks)\n3. Add logic to determine the appropriate file path for saving the test\n4. Implement file system operations to write the test file\n5. Add validation to ensure the generated test follows Jest conventions\n6. Implement formatting of the test file for consistency with project coding standards\n7. Add user feedback about successful test generation and file location\n8. Implement handling for both parent tasks and subtasks\n\nTesting approach:\n- Test file naming logic for various task/subtask combinations\n- Test file content formatting with sample FastMCP outputs\n- Test file system operations with mocked fs module\n- Test the complete flow from command input to file output\n- Verify generated tests can be executed by Jest\n<info added on 2025-05-23T21:06:32.457Z>\n## Detailed Implementation Guidelines\n\n### File Naming Convention Implementation\n```javascript\nfunction generateTestFileName(taskId, isSubtask = false) {\n if (isSubtask) {\n // For subtasks like \"24.1\", generate \"task_024_001.test.js\"\n const [parentId, subtaskId] = taskId.split('.');\n return `task_${parentId.padStart(3, '0')}_${subtaskId.padStart(3, '0')}.test.js`;\n } else {\n // For parent tasks like \"24\", generate \"task_024.test.js\"\n return `task_${taskId.toString().padStart(3, '0')}.test.js`;\n }\n}\n```\n\n### File Location Strategy\n- Place generated test files in the `tasks/` directory alongside task files\n- This ensures co-location with task documentation and simplifies implementation\n\n### File Content Structure Template\n```javascript\n/**\n * Test file for Task ${taskId}: ${taskTitle}\n * Generated automatically by Task Master\n */\n\nimport { jest } from '@jest/globals';\n// Additional imports based on task requirements\n\ndescribe('Task ${taskId}: ${taskTitle}', () => {\n beforeEach(() => {\n // Setup code\n });\n\n afterEach(() => {\n // Cleanup code\n });\n\n test('should ${testDescription}', () => {\n // Test implementation\n });\n});\n```\n\n### Code Formatting Standards\n- Follow project's .prettierrc configuration:\n - Tab width: 2 spaces (useTabs: true)\n - Print width: 80 characters\n - Semicolons: Required (semi: true)\n - Quotes: Single quotes (singleQuote: true)\n - Trailing commas: None (trailingComma: \"none\")\n - Bracket spacing: True\n - Arrow parens: Always\n\n### File System Operations Implementation\n```javascript\nimport fs from 'fs';\nimport path from 'path';\n\n// Determine output path\nconst tasksDir = path.dirname(tasksPath); // Same directory as tasks.json\nconst fileName = generateTestFileName(task.id, isSubtask);\nconst filePath = path.join(tasksDir, fileName);\n\n// Ensure directory exists\nif (!fs.existsSync(tasksDir)) {\n fs.mkdirSync(tasksDir, { recursive: true });\n}\n\n// Write test file with proper error handling\ntry {\n fs.writeFileSync(filePath, formattedTestContent, 'utf8');\n} catch (error) {\n throw new Error(`Failed to write test file: ${error.message}`);\n}\n```\n\n### Error Handling for File Operations\n```javascript\ntry {\n // File writing operation\n fs.writeFileSync(filePath, testContent, 'utf8');\n} catch (error) {\n if (error.code === 'ENOENT') {\n throw new Error(`Directory does not exist: ${path.dirname(filePath)}`);\n } else if (error.code === 'EACCES') {\n throw new Error(`Permission denied writing to: ${filePath}`);\n } else if (error.code === 'ENOSPC') {\n throw new Error('Insufficient disk space to write test file');\n } else {\n throw new Error(`Failed to write test file: ${error.message}`);\n }\n}\n```\n\n### User Feedback Implementation\n```javascript\n// Success feedback\nconsole.log(chalk.green('✅ Test file generated successfully:'));\nconsole.log(chalk.cyan(` File: ${fileName}`));\nconsole.log(chalk.cyan(` Location: ${filePath}`));\nconsole.log(chalk.gray(` Size: ${testContent.length} characters`));\n\n// Additional info\nif (mockRequirements && mockRequirements.length > 0) {\n console.log(chalk.yellow(` Mocks needed: ${mockRequirements.join(', ')}`));\n}\n```\n\n### Content Validation Requirements\n1. Jest Syntax Validation:\n - Ensure proper describe/test structure\n - Validate import statements\n - Check for balanced brackets and parentheses\n\n2. Code Quality Checks:\n - Verify no syntax errors\n - Ensure proper indentation\n - Check for required imports\n\n3. Test Completeness:\n - At least one test case\n - Proper test descriptions\n - Appropriate assertions\n\n### Required Dependencies\n```javascript\nimport fs from 'fs';\nimport path from 'path';\nimport chalk from 'chalk';\nimport { log } from '../utils.js';\n```\n\n### Integration with Existing Patterns\nFollow the pattern from `generate-task-files.js`:\n1. Read task data using existing utilities\n2. Process content with proper formatting\n3. Write files with error handling\n4. Provide feedback to user\n5. Return success data for MCP integration\n</info added on 2025-05-23T21:06:32.457Z>\n<info added on 2025-05-23T21:18:25.369Z>\n## Corrected Implementation Approach\n\n### Updated File Location Strategy\n\n**CORRECTION**: Tests should go in `/tests/` directory, not `/tasks/` directory.\n\nBased on Jest configuration analysis:\n- Jest is configured with `roots: ['<rootDir>/tests']`\n- Test pattern: `**/?(*.)+(spec|test).js`\n- Current test structure has `/tests/unit/`, `/tests/integration/`, etc.\n\n### Recommended Directory Structure:\n```\ntests/\n├── unit/ # Manual unit tests\n├── integration/ # Manual integration tests \n├── generated/ # AI-generated tests\n│ ├── tasks/ # Generated task tests\n│ │ ├── task_024.test.js\n│ │ └── task_024_001.test.js\n│ └── README.md # Explains generated tests\n└── fixtures/ # Test fixtures\n```\n\n### Updated File Path Logic:\n```javascript\n// Determine output path - place in tests/generated/tasks/\nconst projectRoot = findProjectRoot() || '.';\nconst testsDir = path.join(projectRoot, 'tests', 'generated', 'tasks');\nconst fileName = generateTestFileName(task.id, isSubtask);\nconst filePath = path.join(testsDir, fileName);\n\n// Ensure directory structure exists\nif (!fs.existsSync(testsDir)) {\n fs.mkdirSync(testsDir, { recursive: true });\n}\n```\n\n### Testing Framework Configuration\n\nThe generate-test command should read the configured testing framework from `.taskmasterconfig`:\n\n```javascript\n// Read testing framework from config\nconst config = getConfig(projectRoot);\nconst testingFramework = config.testingFramework || 'jest'; // Default to Jest\n\n// Generate different templates based on framework\nswitch (testingFramework) {\n case 'jest':\n return generateJestTest(task, context);\n case 'mocha':\n return generateMochaTest(task, context);\n case 'vitest':\n return generateVitestTest(task, context);\n default:\n throw new Error(`Unsupported testing framework: ${testingFramework}`);\n}\n```\n\n### Framework-Specific Templates\n\n**Jest Template** (current):\n```javascript\n/**\n * Test file for Task ${taskId}: ${taskTitle}\n * Generated automatically by Task Master\n */\n\nimport { jest } from '@jest/globals';\n// Task-specific imports\n\ndescribe('Task ${taskId}: ${taskTitle}', () => {\n beforeEach(() => {\n jest.clearAllMocks();\n });\n\n test('should ${testDescription}', () => {\n // Test implementation\n });\n});\n```\n\n**Mocha Template**:\n```javascript\n/**\n * Test file for Task ${taskId}: ${taskTitle}\n * Generated automatically by Task Master\n */\n\nimport { expect } from 'chai';\nimport sinon from 'sinon';\n// Task-specific imports\n\ndescribe('Task ${taskId}: ${taskTitle}', () => {\n beforeEach(() => {\n sinon.restore();\n });\n\n it('should ${testDescription}', () => {\n // Test implementation\n });\n});\n```\n\n**Vitest Template**:\n```javascript\n/**\n * Test file for Task ${taskId}: ${taskTitle}\n * Generated automatically by Task Master\n */\n\nimport { describe, test, expect, vi, beforeEach } from 'vitest';\n// Task-specific imports\n\ndescribe('Task ${taskId}: ${taskTitle}', () => {\n beforeEach(() => {\n vi.clearAllMocks();\n });\n\n test('should ${testDescription}', () => {\n // Test implementation\n });\n});\n```\n\n### AI Prompt Enhancement for Mocking\n\nTo address the mocking challenge, enhance the AI prompt with project context:\n\n```javascript\nconst systemPrompt = `You are an expert at generating comprehensive test files. When generating tests, pay special attention to mocking external dependencies correctly.\n\nCRITICAL MOCKING GUIDELINES:\n1. Analyze the task requirements to identify external dependencies (APIs, databases, file system, etc.)\n2. Mock external dependencies at the module level, not inline\n3. Use the testing framework's mocking utilities (jest.mock(), sinon.stub(), vi.mock())\n4. Create realistic mock data that matches the expected API responses\n5. Test both success and error scenarios for mocked dependencies\n6. Ensure mocks are cleared between tests to prevent test pollution\n\nTesting Framework: ${testingFramework}\nProject Structure: ${projectStructureContext}\n`;\n```\n\n### Integration with Future Features\n\nThis primitive command design enables:\n1. **Automatic test generation**: `task-master add-task --with-test`\n2. **Batch test generation**: `task-master generate-tests --all`\n3. **Framework-agnostic**: Support multiple testing frameworks\n4. **Smart mocking**: LLM analyzes dependencies and generates appropriate mocks\n\n### Updated Implementation Requirements:\n\n1. **Read testing framework** from `.taskmasterconfig`\n2. **Create tests directory structure** if it doesn't exist\n3. **Generate framework-specific templates** based on configuration\n4. **Enhanced AI prompts** with mocking best practices\n5. **Project structure analysis** for better import resolution\n6. **Mock dependency detection** from task requirements\n</info added on 2025-05-23T21:18:25.369Z>", "status": "pending", "parentTaskId": 24 @@ -1511,7 +1821,9 @@ "description": "Create MCP server tool support for the generate-test command to enable integration with Claude Code and other MCP clients.", "details": "Implementation steps:\n1. Create direct function wrapper in mcp-server/src/core/direct-functions/\n2. Create MCP tool registration in mcp-server/src/tools/\n3. Add tool to the main tools index\n4. Implement proper parameter validation and error handling\n5. Ensure telemetry data is properly passed through\n6. Add tool to MCP server registration\n\nThe MCP tool should support the same parameters as the CLI command:\n- id: Task ID to generate tests for\n- file: Path to tasks.json file\n- research: Whether to use research model\n- prompt: Additional context for test generation\n\nFollow the existing pattern from other MCP tools like add-task.js and expand-task.js.", "status": "pending", - "dependencies": [3], + "dependencies": [ + 3 + ], "parentTaskId": 24 }, { @@ -1520,7 +1832,9 @@ "description": "Enhance the init.js process to let users choose their preferred testing framework (Jest, Mocha, Vitest, etc.) and store this choice in .taskmasterconfig for use by the generate-test command.", "details": "Implementation requirements:\n\n1. **Add Testing Framework Prompt to init.js**:\n - Add interactive prompt asking users to choose testing framework\n - Support Jest (default), Mocha + Chai, Vitest, Ava, Jasmine\n - Include brief descriptions of each framework\n - Allow --testing-framework flag for non-interactive mode\n\n2. **Update .taskmasterconfig Template**:\n - Add testingFramework field to configuration file\n - Include default dependencies for each framework\n - Store framework-specific configuration options\n\n3. **Framework-Specific Setup**:\n - Generate appropriate config files (jest.config.js, vitest.config.ts, etc.)\n - Add framework dependencies to package.json suggestions\n - Create sample test file for the chosen framework\n\n4. **Integration Points**:\n - Ensure generate-test command reads testingFramework from config\n - Add validation to prevent conflicts between framework choices\n - Support switching frameworks later via models command or separate config command\n\nThis makes the generate-test command truly framework-agnostic and sets up the foundation for --with-test flags in other commands.\n<info added on 2025-05-23T21:22:02.048Z>\n# Implementation Plan for Testing Framework Integration\n\n## Code Structure\n\n### 1. Update init.js\n- Add testing framework prompt after addAliases prompt\n- Implement framework selection with descriptions\n- Support non-interactive mode with --testing-framework flag\n- Create setupTestingFramework() function to handle framework-specific setup\n\n### 2. Create New Module Files\n- Create `scripts/modules/testing-frameworks.js` for framework templates and setup\n- Add sample test generators for each supported framework\n- Implement config file generation for each framework\n\n### 3. Update Configuration Templates\n- Modify `assets/.taskmasterconfig` to include testing fields:\n ```json\n \"testingFramework\": \"{{testingFramework}}\",\n \"testingConfig\": {\n \"framework\": \"{{testingFramework}}\",\n \"setupFiles\": [],\n \"testDirectory\": \"tests\",\n \"testPattern\": \"**/*.test.js\",\n \"coverage\": {\n \"enabled\": false,\n \"threshold\": 80\n }\n }\n ```\n\n### 4. Create Framework-Specific Templates\n- `assets/jest.config.template.js`\n- `assets/vitest.config.template.ts`\n- `assets/.mocharc.template.json`\n- `assets/ava.config.template.js`\n- `assets/jasmine.json.template`\n\n### 5. Update commands.js\n- Add `--testing-framework <framework>` option to init command\n- Add validation for supported frameworks\n\n## Error Handling\n- Validate selected framework against supported list\n- Handle existing config files gracefully with warning/overwrite prompt\n- Provide recovery options if framework setup fails\n- Add conflict detection for multiple testing frameworks\n\n## Integration Points\n- Ensure generate-test command reads testingFramework from config\n- Prepare for future --with-test flag in other commands\n- Support framework switching via config command\n\n## Testing Requirements\n- Unit tests for framework selection logic\n- Integration tests for config file generation\n- Validation tests for each supported framework\n</info added on 2025-05-23T21:22:02.048Z>", "status": "pending", - "dependencies": [3], + "dependencies": [ + 3 + ], "parentTaskId": 24 } ] @@ -1530,7 +1844,9 @@ "title": "Implement 'add-subtask' Command for Task Hierarchy Management", "description": "Create a command-line interface command that allows users to manually add subtasks to existing tasks, establishing a parent-child relationship between tasks.", "status": "done", - "dependencies": [3], + "dependencies": [ + 3 + ], "priority": "medium", "details": "Implement the 'add-subtask' command that enables users to create hierarchical relationships between tasks. The command should:\n\n1. Accept parameters for the parent task ID and either the details for a new subtask or the ID of an existing task to convert to a subtask\n2. Validate that the parent task exists before proceeding\n3. If creating a new subtask, collect all necessary task information (title, description, due date, etc.)\n4. If converting an existing task, ensure it's not already a subtask of another task\n5. Update the data model to support parent-child relationships between tasks\n6. Modify the task storage mechanism to persist these relationships\n7. Ensure that when a parent task is marked complete, there's appropriate handling of subtasks (prompt user or provide options)\n8. Update the task listing functionality to display subtasks with appropriate indentation or visual hierarchy\n9. Implement proper error handling for cases like circular dependencies (a task cannot be a subtask of its own subtask)\n10. Document the command syntax and options in the help system", "testStrategy": "Testing should verify both the functionality and edge cases of the subtask implementation:\n\n1. Unit tests:\n - Test adding a new subtask to an existing task\n - Test converting an existing task to a subtask\n - Test validation logic for parent task existence\n - Test prevention of circular dependencies\n - Test error handling for invalid inputs\n\n2. Integration tests:\n - Verify subtask relationships are correctly persisted to storage\n - Verify subtasks appear correctly in task listings\n - Test the complete workflow from adding a subtask to viewing it in listings\n\n3. Edge cases:\n - Attempt to add a subtask to a non-existent parent\n - Attempt to make a task a subtask of itself\n - Attempt to create circular dependencies (A → B → A)\n - Test with a deep hierarchy of subtasks (A → B → C → D)\n - Test handling of subtasks when parent tasks are deleted\n - Verify behavior when marking parent tasks as complete\n\n4. Manual testing:\n - Verify command usability and clarity of error messages\n - Test the command with various parameter combinations", @@ -1548,7 +1864,9 @@ "id": 2, "title": "Implement Core addSubtask Function in task-manager.js", "description": "Create the core function that handles adding subtasks to parent tasks", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "1. Create a new addSubtask function in scripts/modules/task-manager.js\n2. Implement logic to validate that the parent task exists\n3. Add functionality to handle both creating new subtasks and converting existing tasks\n4. For new subtasks: collect task information and create a new task with parentId set\n5. For existing tasks: validate it's not already a subtask and update its parentId\n6. Add validation to prevent circular dependencies (a task cannot be a subtask of its own subtask)\n7. Update the parent task's subtasks array\n8. Ensure proper error handling with descriptive error messages\n9. Export the function for use by the command handler\n10. Write unit tests to verify all scenarios (new subtask, converting task, error cases)", "status": "done", "parentTaskId": 25 @@ -1557,7 +1875,9 @@ "id": 3, "title": "Implement add-subtask Command in commands.js", "description": "Create the command-line interface for the add-subtask functionality", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "1. Add a new command registration in scripts/modules/commands.js following existing patterns\n2. Define command syntax: 'add-subtask <parentId> [--task-id=<taskId> | --title=<title>]'\n3. Implement command handler that calls the addSubtask function from task-manager.js\n4. Add interactive prompts to collect required information when not provided as arguments\n5. Implement validation for command arguments\n6. Add appropriate success and error messages\n7. Document the command syntax and options in the help system\n8. Test the command with various input combinations\n9. Ensure the command follows the same patterns as other commands like add-dependency", "status": "done", "parentTaskId": 25 @@ -1566,7 +1886,10 @@ "id": 4, "title": "Create Unit Test for add-subtask", "description": "Develop comprehensive unit tests for the add-subtask functionality", - "dependencies": [2, 3], + "dependencies": [ + 2, + 3 + ], "details": "1. Create a test file in tests/unit/ directory for the add-subtask functionality\n2. Write tests for the addSubtask function in task-manager.js\n3. Test all key scenarios: adding new subtasks, converting existing tasks to subtasks\n4. Test error cases: non-existent parent task, circular dependencies, invalid input\n5. Use Jest mocks to isolate the function from file system operations\n6. Test the command handler in isolation using mock functions\n7. Ensure test coverage for all branches and edge cases\n8. Document the testing approach for future reference", "status": "done", "parentTaskId": 25 @@ -1575,7 +1898,10 @@ "id": 5, "title": "Implement remove-subtask Command", "description": "Create functionality to remove a subtask from its parent, following the same approach as add-subtask", - "dependencies": [2, 3], + "dependencies": [ + 2, + 3 + ], "details": "1. Create a removeSubtask function in scripts/modules/task-manager.js\n2. Implement logic to validate the subtask exists and is actually a subtask\n3. Add options to either delete the subtask completely or convert it to a standalone task\n4. Update the parent task's subtasks array to remove the reference\n5. If converting to standalone task, clear the parentId reference\n6. Implement the remove-subtask command in scripts/modules/commands.js following patterns from add-subtask\n7. Add appropriate validation and error messages\n8. Document the command in the help system\n9. Export the function in task-manager.js\n10. Ensure proper error handling for all scenarios", "status": "done", "parentTaskId": 25 @@ -1587,7 +1913,11 @@ "title": "Implement Context Foundation for AI Operations", "description": "Implement the foundation for context integration in Task Master, enabling AI operations to leverage file-based context, cursor rules, and basic code context to improve generated outputs.", "status": "pending", - "dependencies": [5, 6, 7], + "dependencies": [ + 5, + 6, + 7 + ], "priority": "high", "details": "Create a Phase 1 foundation for context integration in Task Master that provides immediate practical value:\n\n1. Add `--context-file` Flag to AI Commands:\n - Add a consistent `--context-file <file>` option to all AI-related commands (expand, update, add-task, etc.)\n - Implement file reading functionality that loads content from the specified file\n - Add content integration into Claude API prompts with appropriate formatting\n - Handle error conditions such as file not found gracefully\n - Update help documentation to explain the new option\n\n2. Implement Cursor Rules Integration for Context:\n - Create a `--context-rules <rules>` option for all AI commands\n - Implement functionality to extract content from specified .cursor/rules/*.mdc files\n - Support comma-separated lists of rule names and \"all\" option\n - Add validation and error handling for non-existent rules\n - Include helpful examples in command help output\n\n3. Implement Basic Context File Extraction Utility:\n - Create utility functions in utils.js for reading context from files\n - Add proper error handling and logging\n - Implement content validation to ensure reasonable size limits\n - Add content truncation if files exceed token limits\n - Create helper functions for formatting context additions properly\n\n4. Update Command Handler Logic:\n - Modify command handlers to support the new context options\n - Update prompt construction to incorporate context content\n - Ensure backwards compatibility with existing commands\n - Add logging for context inclusion to aid troubleshooting\n\nThe focus of this phase is to provide immediate value with straightforward implementations that enable users to include relevant context in their AI operations.", "testStrategy": "Testing should verify that the context foundation works as expected and adds value:\n\n1. Functional Tests:\n - Verify `--context-file` flag correctly reads and includes content from specified files\n - Test that `--context-rules` correctly extracts and formats content from cursor rules\n - Test with both existing and non-existent files/rules to verify error handling\n - Verify content truncation works appropriately for large files\n\n2. Integration Tests:\n - Test each AI-related command with context options\n - Verify context is properly included in API calls to Claude\n - Test combinations of multiple context options\n - Verify help documentation includes the new options\n\n3. Usability Testing:\n - Create test scenarios that show clear improvement in AI output quality with context\n - Compare outputs with and without context to measure impact\n - Document examples of effective context usage for the user documentation\n\n4. Error Handling:\n - Test invalid file paths and rule names\n - Test oversized context files\n - Verify appropriate error messages guide users to correct usage\n\nThe testing focus should be on proving immediate value to users while ensuring robust error handling.", @@ -1635,7 +1965,9 @@ "title": "Implement Context Enhancements for AI Operations", "description": "Enhance the basic context integration with more sophisticated code context extraction, task history awareness, and PRD integration to provide richer context for AI operations.", "status": "pending", - "dependencies": [26], + "dependencies": [ + 26 + ], "priority": "high", "details": "Building upon the foundational context implementation in Task #26, implement Phase 2 context enhancements:\n\n1. Add Code Context Extraction Feature:\n - Create a `--context-code <pattern>` option for all AI commands\n - Implement glob-based file matching to extract code from specified patterns\n - Create intelligent code parsing to extract most relevant sections (function signatures, classes, exports)\n - Implement token usage optimization by selecting key structural elements\n - Add formatting for code context with proper file paths and syntax indicators\n\n2. Implement Task History Context:\n - Add a `--context-tasks <ids>` option for AI commands\n - Support comma-separated task IDs and a \"similar\" option to find related tasks\n - Create functions to extract context from specified tasks or find similar tasks\n - Implement formatting for task context with clear section markers\n - Add validation and error handling for non-existent task IDs\n\n3. Add PRD Context Integration:\n - Create a `--context-prd <file>` option for AI commands\n - Implement PRD text extraction and intelligent summarization\n - Add formatting for PRD context with appropriate section markers\n - Integrate with the existing PRD parsing functionality from Task #6\n\n4. Improve Context Formatting and Integration:\n - Create a standardized context formatting system\n - Implement type-based sectioning for different context sources\n - Add token estimation for different context types to manage total prompt size\n - Enhance prompt templates to better integrate various context types\n\nThese enhancements will provide significantly richer context for AI operations, resulting in more accurate and relevant outputs while remaining practical to implement.", "testStrategy": "Testing should verify the enhanced context functionality:\n\n1. Code Context Testing:\n - Verify pattern matching works for different glob patterns\n - Test code extraction with various file types and sizes\n - Verify intelligent parsing correctly identifies important code elements\n - Test token optimization by comparing full file extraction vs. optimized extraction\n - Check code formatting in prompts sent to Claude API\n\n2. Task History Testing:\n - Test with different combinations of task IDs\n - Verify \"similar\" option correctly identifies relevant tasks\n - Test with non-existent task IDs to ensure proper error handling\n - Verify formatting and integration in prompts\n\n3. PRD Context Testing:\n - Test with various PRD files of different sizes\n - Verify summarization functions correctly when PRDs are too large\n - Test integration with prompts and formatting\n\n4. Performance Testing:\n - Measure the impact of context enrichment on command execution time\n - Test with large code bases to ensure reasonable performance\n - Verify token counting and optimization functions work as expected\n\n5. Quality Assessment:\n - Compare AI outputs with Phase 1 vs. Phase 2 context to measure improvements\n - Create test cases that specifically benefit from code context\n - Create test cases that benefit from task history context\n\nFocus testing on practical use cases that demonstrate clear improvements in AI-generated outputs.", @@ -1683,7 +2015,10 @@ "title": "Implement Advanced ContextManager System", "description": "Create a comprehensive ContextManager class to unify context handling with advanced features like context optimization, prioritization, and intelligent context selection.", "status": "pending", - "dependencies": [26, 27], + "dependencies": [ + 26, + 27 + ], "priority": "high", "details": "Building on Phase 1 and Phase 2 context implementations, develop Phase 3 advanced context management:\n\n1. Implement the ContextManager Class:\n - Create a unified `ContextManager` class that encapsulates all context functionality\n - Implement methods for gathering context from all supported sources\n - Create a configurable context priority system to favor more relevant context types\n - Add token management to ensure context fits within API limits\n - Implement caching for frequently used context to improve performance\n\n2. Create Context Optimization Pipeline:\n - Develop intelligent context optimization algorithms\n - Implement type-based truncation strategies (code vs. text)\n - Create relevance scoring to prioritize most useful context portions\n - Add token budget allocation that divides available tokens among context types\n - Implement dynamic optimization based on operation type\n\n3. Add Command Interface Enhancements:\n - Create the `--context-all` flag to include all available context\n - Add the `--context-max-tokens <tokens>` option to control token allocation\n - Implement unified context options across all AI commands\n - Add intelligent default values for different command types\n\n4. Integrate with AI Services:\n - Update the AI service integration to use the ContextManager\n - Create specialized context assembly for different AI operations\n - Add post-processing to capture new context from AI responses\n - Implement adaptive context selection based on operation success\n\n5. Add Performance Monitoring:\n - Create context usage statistics tracking\n - Implement logging for context selection decisions\n - Add warnings for context token limits\n - Create troubleshooting utilities for context-related issues\n\nThe ContextManager system should provide a powerful but easy-to-use interface for both users and developers, maintaining backward compatibility with earlier phases while adding substantial new capabilities.", "testStrategy": "Testing should verify both the functionality and performance of the advanced context management:\n\n1. Unit Testing:\n - Test all ContextManager class methods with various inputs\n - Verify optimization algorithms maintain critical information\n - Test caching mechanisms for correctness and efficiency\n - Verify token allocation and budgeting functions\n - Test each context source integration separately\n\n2. Integration Testing:\n - Verify ContextManager integration with AI services\n - Test with all AI-related commands\n - Verify backward compatibility with existing context options\n - Test context prioritization across multiple context types\n - Verify logging and error handling\n\n3. Performance Testing:\n - Benchmark context gathering and optimization times\n - Test with large and complex context sources\n - Measure impact of caching on repeated operations\n - Verify memory usage remains acceptable\n - Test with token limits of different sizes\n\n4. Quality Assessment:\n - Compare AI outputs using Phase 3 vs. earlier context handling\n - Measure improvements in context relevance and quality\n - Test complex scenarios requiring multiple context types\n - Quantify the impact on token efficiency\n\n5. User Experience Testing:\n - Verify CLI options are intuitive and well-documented\n - Test error messages are helpful for troubleshooting\n - Ensure log output provides useful insights\n - Test all convenience options like `--context-all`\n\nCreate automated test suites for regression testing of the complete context system.", @@ -1915,7 +2250,9 @@ "id": 2, "title": "Implement updateTask command in commands.js", "description": "Create a new command called 'updateTask' in commands.js that leverages the updateTaskById function to update a specific task by ID.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Implementation steps:\n1. Create a new command object for 'updateTask' in commands.js following the Command pattern\n2. Define command parameters including a required taskId parameter\n3. Support all options from the existing update command:\n - Research flag for Perplexity integration\n - Formatting and refinement options\n - Task context options\n4. Implement the command handler function that calls the updateTaskById function from task-manager.js\n5. Add appropriate error handling to catch and display user-friendly error messages\n6. Ensure the command follows the same pattern as other commands in the codebase\n7. Implement proper validation of input parameters\n8. Format and return appropriate success/failure messages to the user\n\nTesting approach:\n- Unit test the command handler with various input combinations\n- Test error handling scenarios\n- Verify command options are correctly passed to the updateTaskById function", "status": "done", "parentTaskId": 34 @@ -1924,7 +2261,10 @@ "id": 3, "title": "Add comprehensive error handling and validation", "description": "Implement robust error handling and validation for the updateTask command to ensure proper user feedback and system stability.", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Implementation steps:\n1. Create custom error types for different failure scenarios (TaskNotFoundError, ValidationError, etc.)\n2. Implement input validation for the taskId parameter and all options\n3. Add proper error handling for AI service failures with appropriate fallback mechanisms\n4. Implement concurrency handling to prevent conflicts when multiple updates occur simultaneously\n5. Add comprehensive logging for debugging and auditing purposes\n6. Ensure all error messages are user-friendly and actionable\n7. Implement proper HTTP status codes for API responses if applicable\n8. Add validation to ensure the task exists before attempting updates\n\nTesting approach:\n- Test various error scenarios including invalid inputs, non-existent tasks, and API failures\n- Verify error messages are clear and helpful\n- Test concurrency scenarios with multiple simultaneous updates\n- Verify logging captures appropriate information for troubleshooting", "status": "done", "parentTaskId": 34 @@ -1933,7 +2273,11 @@ "id": 4, "title": "Write comprehensive tests for updateTask command", "description": "Create a comprehensive test suite for the updateTask command to ensure it works correctly in all scenarios and maintains backward compatibility.", - "dependencies": [1, 2, 3], + "dependencies": [ + 1, + 2, + 3 + ], "details": "Implementation steps:\n1. Create unit tests for the updateTaskById function in task-manager.js\n - Test finding and updating tasks with various IDs\n - Test preservation of completed subtasks\n - Test different update options combinations\n - Test error handling for non-existent tasks\n2. Create unit tests for the updateTask command in commands.js\n - Test command parameter parsing\n - Test option handling\n - Test error scenarios and messages\n3. Create integration tests that verify the end-to-end flow\n - Test the command with actual AI service integration\n - Test with mock AI responses for predictable testing\n4. Implement test fixtures and mocks for consistent testing\n5. Add performance tests to ensure the command is efficient\n6. Test edge cases such as empty tasks, tasks with many subtasks, etc.\n\nTesting approach:\n- Use Jest or similar testing framework\n- Implement mocks for external dependencies like AI services\n- Create test fixtures for consistent test data\n- Use snapshot testing for command output verification", "status": "done", "parentTaskId": 34 @@ -1942,7 +2286,9 @@ "id": 5, "title": "Update CLI documentation and help text", "description": "Update the CLI help documentation to include the new updateTask command and ensure users understand its purpose and options.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Implementation steps:\n1. Add comprehensive help text for the updateTask command including:\n - Command description\n - Required and optional parameters\n - Examples of usage\n - Description of all supported options\n2. Update the main CLI help documentation to include the new command\n3. Add the command to any relevant command groups or categories\n4. Create usage examples that demonstrate common scenarios\n5. Update README.md and other documentation files to include information about the new command\n6. Add inline code comments explaining the implementation details\n7. Update any API documentation if applicable\n8. Create or update user guides with the new functionality\n\nTesting approach:\n- Verify help text is displayed correctly when running `--help`\n- Review documentation for clarity and completeness\n- Have team members review the documentation for usability\n- Test examples to ensure they work as documented", "status": "done", "parentTaskId": 34 @@ -2012,7 +2358,9 @@ "id": 2, "title": "Update Source Code License Headers and Package Metadata", "description": "Add appropriate dual license headers to all source code files and update package metadata to reflect the new licensing structure.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Implementation steps:\n1. Create a template for the new license header that references the dual license structure (BSL 1.1 / Apache 2.0).\n2. Systematically update all source code files to include the new license header, replacing any existing MIT headers.\n3. Update the license field in package.json to \"BSL 1.1 / Apache 2.0\".\n4. Update any other metadata files (composer.json, setup.py, etc.) that contain license information.\n5. Verify that any build scripts or tools that reference licensing information are updated.\n\nTesting approach:\n- Write a script to verify that all source files contain the new license header\n- Validate package.json and other metadata files have the correct license field\n- Ensure any build processes that depend on license information still function correctly\n- Run a sample build to confirm license information is properly included in any generated artifacts", "status": "done", "parentTaskId": 39 @@ -2021,7 +2369,10 @@ "id": 3, "title": "Update Documentation and Create License Explanation", "description": "Update project documentation to clearly explain the dual license structure and create comprehensive licensing guidance.", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Implementation steps:\n1. Update the README.md with a clear, concise explanation of the licensing terms:\n - Summary of what users can and cannot do with the code\n - Who holds commercial rights (Ralph & Eyal)\n - How to obtain commercial use permission\n - Links to the full license texts\n2. Create a dedicated LICENSING.md or similar document with detailed explanations of:\n - The rationale behind the dual licensing approach\n - Detailed examples of what constitutes commercial vs. non-commercial use\n - FAQs addressing common licensing questions\n3. Update any other documentation references to licensing throughout the project.\n4. Create visual aids (if appropriate) to help users understand the licensing structure.\n5. Ensure all documentation links to licensing information are updated.\n\nTesting approach:\n- Have non-technical stakeholders review the documentation for clarity and understanding\n- Verify all links to license files work correctly\n- Ensure the explanation is comprehensive but concise enough for users to understand quickly\n- Check that the documentation correctly addresses the most common use cases and questions", "status": "done", "parentTaskId": 39 @@ -2050,7 +2401,9 @@ "id": 2, "title": "Generate Implementation Plan with AI", "description": "Use an AI model (Claude or Perplexity) to generate an implementation plan based on the retrieved task content. The plan should outline the steps required to complete the task.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Implement logic to switch between Claude and Perplexity APIs. Handle API authentication and rate limiting. Prompt the AI model with the task content and request a detailed implementation plan.", "status": "pending" }, @@ -2058,7 +2411,9 @@ "id": 3, "title": "Format Plan in XML", "description": "Format the generated implementation plan within XML tags. Each step in the plan should be represented as an XML element with appropriate attributes.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Define the XML schema for the implementation plan. Implement a function to convert the AI-generated plan into the defined XML format. Ensure proper XML syntax and validation.", "status": "pending" }, @@ -2066,7 +2421,9 @@ "id": 4, "title": "Error Handling and Output", "description": "Implement error handling for all steps, including API failures and XML formatting errors. Output the formatted XML plan to the console or a file.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Add try-except blocks to handle potential exceptions. Log errors for debugging. Provide informative error messages to the user. Output the XML plan in a user-friendly format.", "status": "pending" } @@ -2094,7 +2451,9 @@ "id": 2, "title": "Graph Layout Algorithms", "description": "Develop or integrate algorithms to compute optimal node and edge placement for clear and readable graph layouts in a terminal environment.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Consider topological sorting, hierarchical, and force-directed layouts suitable for ASCII/Unicode rendering.\n<info added on 2025-05-23T21:02:49.434Z>\nCreate a new diagram-generator.js module in the scripts/modules/ directory following Task Master's module architecture pattern. The module should include:\n\n1. Core functions for generating Mermaid diagrams:\n - generateDependencyGraph(tasks, options) - creates flowchart showing task dependencies\n - generateSubtaskDiagram(task, options) - creates hierarchy diagram for subtasks\n - generateProjectFlow(tasks, options) - creates overall project workflow\n - generateGanttChart(tasks, options) - creates timeline visualization\n\n2. Integration with existing Task Master data structures:\n - Use the same task object format from task-manager.js\n - Leverage dependency analysis from dependency-manager.js\n - Support complexity scores from analyze-complexity functionality\n - Handle both main tasks and subtasks with proper ID notation (parentId.subtaskId)\n\n3. Layout algorithm considerations for Mermaid:\n - Topological sorting for dependency flows\n - Hierarchical layouts for subtask trees\n - Circular dependency detection and highlighting\n - Terminal width-aware formatting for ASCII fallback\n\n4. Export functions following the existing module pattern at the bottom of the file\n</info added on 2025-05-23T21:02:49.434Z>", "status": "pending" }, @@ -2102,7 +2461,9 @@ "id": 3, "title": "ASCII/Unicode Rendering Engine", "description": "Implement rendering logic to display the dependency graph using ASCII and Unicode characters in the terminal.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Support for various node and edge styles, and ensure compatibility with different terminal types.\n<info added on 2025-05-23T21:03:10.001Z>\nExtend ui.js with diagram display functions that integrate with Task Master's existing UI patterns:\n\n1. Implement core diagram display functions:\n - displayTaskDiagram(tasksPath, diagramType, options) as the main entry point\n - displayMermaidCode(mermaidCode, title) for formatted code output with boxen\n - displayDiagramLegend() to explain symbols and colors\n\n2. Ensure UI consistency by:\n - Using established chalk color schemes (blue/green/yellow/red)\n - Applying boxen for consistent component formatting\n - Following existing display function patterns (displayTaskById, displayComplexityReport)\n - Utilizing cli-table3 for any diagram metadata tables\n\n3. Address terminal rendering challenges:\n - Implement ASCII/Unicode fallback when Mermaid rendering isn't available\n - Respect terminal width constraints using process.stdout.columns\n - Integrate with loading indicators via startLoadingIndicator/stopLoadingIndicator\n\n4. Update task file generation to include Mermaid diagram sections in individual task files\n\n5. Support both CLI and MCP output formats through the outputFormat parameter\n</info added on 2025-05-23T21:03:10.001Z>", "status": "pending" }, @@ -2110,7 +2471,9 @@ "id": 4, "title": "Color Coding Support", "description": "Add color coding to nodes and edges to visually distinguish types, statuses, or other attributes in the graph.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Use ANSI escape codes for color; provide options for colorblind-friendly palettes.\n<info added on 2025-05-23T21:03:35.762Z>\nIntegrate color coding with Task Master's existing status system:\n\n1. Extend getStatusWithColor() in ui.js to support diagram contexts:\n - Add 'diagram' parameter to determine rendering context\n - Modify color intensity for better visibility in graph elements\n\n2. Implement Task Master's established color scheme using ANSI codes:\n - Green (\\x1b[32m) for 'done'/'completed' tasks\n - Yellow (\\x1b[33m) for 'pending' tasks\n - Orange (\\x1b[38;5;208m) for 'in-progress' tasks\n - Red (\\x1b[31m) for 'blocked' tasks\n - Gray (\\x1b[90m) for 'deferred'/'cancelled' tasks\n - Magenta (\\x1b[35m) for 'review' tasks\n\n3. Create diagram-specific color functions:\n - getDependencyLineColor(fromTaskStatus, toTaskStatus) - color dependency arrows based on relationship status\n - getNodeBorderColor(task) - style node borders using priority/complexity indicators\n - getSubtaskGroupColor(parentTask) - visually group related subtasks\n\n4. Integrate complexity visualization:\n - Use getComplexityWithColor() for node background or border thickness\n - Map complexity scores to visual weight in the graph\n\n5. Ensure accessibility:\n - Add text-based indicators (symbols like ✓, ⚠, ⏳) alongside colors\n - Implement colorblind-friendly palettes as user-selectable option\n - Include shape variations for different statuses\n\n6. Follow existing ANSI patterns:\n - Maintain consistency with terminal UI color usage\n - Reuse color constants from the codebase\n\n7. Support graceful degradation:\n - Check terminal capabilities using existing detection\n - Provide monochrome fallbacks with distinctive patterns\n - Use bold/underline as alternatives when colors unavailable\n</info added on 2025-05-23T21:03:35.762Z>", "status": "pending" }, @@ -2118,7 +2481,9 @@ "id": 5, "title": "Circular Dependency Detection", "description": "Implement algorithms to detect and highlight circular dependencies within the graph.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Clearly mark cycles in the rendered output and provide warnings or errors as appropriate.\n<info added on 2025-05-23T21:04:20.125Z>\nIntegrate with Task Master's existing circular dependency detection:\n\n1. Import the dependency detection logic from dependency-manager.js module\n2. Utilize the findCycles function from utils.js or dependency-manager.js\n3. Extend validateDependenciesCommand functionality to highlight cycles in diagrams\n\nVisual representation in Mermaid diagrams:\n- Apply red/bold styling to nodes involved in dependency cycles\n- Add warning annotations to cyclic edges\n- Implement cycle path highlighting with distinctive line styles\n\nIntegration with validation workflow:\n- Execute dependency validation before diagram generation\n- Display cycle warnings consistent with existing CLI error messaging\n- Utilize chalk.red and boxen for error highlighting following established patterns\n\nAdd diagram legend entries that explain cycle notation and warnings\n\nEnsure detection of cycles in both:\n- Main task dependencies\n- Subtask dependencies within parent tasks\n\nFollow Task Master's error handling patterns for graceful cycle reporting and user notification\n</info added on 2025-05-23T21:04:20.125Z>", "status": "pending" }, @@ -2126,7 +2491,10 @@ "id": 6, "title": "Filtering and Search Functionality", "description": "Enable users to filter nodes and edges by criteria such as name, type, or dependency depth.", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Support command-line flags for filtering and interactive search if feasible.\n<info added on 2025-05-23T21:04:57.811Z>\nImplement MCP tool integration for task dependency visualization:\n\n1. Create task_diagram.js in mcp-server/src/tools/ following existing tool patterns\n2. Implement taskDiagramDirect.js in mcp-server/src/core/direct-functions/\n3. Use Zod schema for parameter validation:\n - diagramType (dependencies, subtasks, flow, gantt)\n - taskId (optional string)\n - format (mermaid, text, json)\n - includeComplexity (boolean)\n\n4. Structure response data with:\n - mermaidCode for client-side rendering\n - metadata (nodeCount, edgeCount, cycleWarnings)\n - support for both task-specific and project-wide diagrams\n\n5. Integrate with session management and project root handling\n6. Implement error handling using handleApiResult pattern\n7. Register the tool in tools/index.js\n\nMaintain compatibility with existing command-line flags for filtering and interactive search.\n</info added on 2025-05-23T21:04:57.811Z>", "status": "pending" }, @@ -2134,7 +2502,10 @@ "id": 7, "title": "Accessibility Features", "description": "Ensure the tool is accessible, including support for screen readers, high-contrast modes, and keyboard navigation.", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "details": "Provide alternative text output and ensure color is not the sole means of conveying information.\n<info added on 2025-05-23T21:05:54.584Z>\n# Accessibility and Export Integration\n\n## Accessibility Features\n- Provide alternative text output for visual elements\n- Ensure color is not the sole means of conveying information\n- Support keyboard navigation through the dependency graph\n- Add screen reader compatible node descriptions\n\n## Export Integration\n- Extend generateTaskFiles function in task-manager.js to include Mermaid diagram sections\n- Add Mermaid code blocks to task markdown files under ## Diagrams header\n- Follow existing task file generation patterns and markdown structure\n- Support multiple diagram types per task file:\n * Task dependencies (prerequisite relationships)\n * Subtask hierarchy visualization\n * Task flow context in project workflow\n- Integrate with existing fs module file writing operations\n- Add diagram export options to the generate command in commands.js\n- Support SVG and PNG export using Mermaid CLI when available\n- Implement error handling for diagram generation failures\n- Reference exported diagrams in task markdown with proper paths\n- Update CLI generate command with options like --include-diagrams\n</info added on 2025-05-23T21:05:54.584Z>", "status": "pending" }, @@ -2142,7 +2513,13 @@ "id": 8, "title": "Performance Optimization", "description": "Profile and optimize the tool for large graphs to ensure responsive rendering and low memory usage.", - "dependencies": [2, 3, 4, 5, 6], + "dependencies": [ + 2, + 3, + 4, + 5, + 6 + ], "details": "Implement lazy loading, efficient data structures, and parallel processing where appropriate.\n<info added on 2025-05-23T21:06:14.533Z>\n# Mermaid Library Integration and Terminal-Specific Handling\n\n## Package Dependencies\n- Add mermaid package as an optional dependency in package.json for generating raw Mermaid diagram code\n- Consider mermaid-cli for SVG/PNG conversion capabilities\n- Evaluate terminal-image or similar libraries for terminals with image support\n- Explore ascii-art-ansi or box-drawing character libraries for text-only terminals\n\n## Terminal Capability Detection\n- Leverage existing terminal detection from ui.js to assess rendering capabilities\n- Implement detection for:\n - iTerm2 and other terminals with image protocol support\n - Terminals with Unicode/extended character support\n - Basic terminals requiring pure ASCII output\n\n## Rendering Strategy with Fallbacks\n1. Primary: Generate raw Mermaid code for user copy/paste\n2. Secondary: Render simplified ASCII tree/flow representation using box characters\n3. Tertiary: Present dependencies in tabular format for minimal terminals\n\n## Implementation Approach\n- Use dynamic imports for optional rendering libraries to maintain lightweight core\n- Implement graceful degradation when optional packages aren't available\n- Follow Task Master's philosophy of minimal dependencies\n- Ensure performance optimization through lazy loading where appropriate\n- Design modular rendering components that can be swapped based on terminal capabilities\n</info added on 2025-05-23T21:06:14.533Z>", "status": "pending" }, @@ -2150,7 +2527,16 @@ "id": 9, "title": "Documentation", "description": "Write comprehensive user and developer documentation covering installation, usage, configuration, and extension.", - "dependencies": [1, 2, 3, 4, 5, 6, 7, 8], + "dependencies": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], "details": "Include examples, troubleshooting, and contribution guidelines.", "status": "pending" }, @@ -2158,7 +2544,17 @@ "id": 10, "title": "Testing and Validation", "description": "Develop automated tests for all major features, including CLI parsing, layout correctness, rendering, color coding, filtering, and cycle detection.", - "dependencies": [1, 2, 3, 4, 5, 6, 7, 8, 9], + "dependencies": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], "details": "Include unit, integration, and regression tests; validate accessibility and performance claims.\n<info added on 2025-05-23T21:08:36.329Z>\n# Documentation Tasks for Visual Task Dependency Graph\n\n## User Documentation\n1. Update README.md with diagram command documentation following existing command reference format\n2. Add examples to CLI command help text in commands.js matching patterns from other commands\n3. Create docs/diagrams.md with detailed usage guide including:\n - Command examples for each diagram type\n - Mermaid code samples and output\n - Terminal compatibility notes\n - Integration with task workflow examples\n - Troubleshooting section for common diagram rendering issues\n - Accessibility features and terminal fallback options\n\n## Developer Documentation\n1. Update MCP tool documentation to include the new task_diagram tool\n2. Add JSDoc comments to all new functions following existing code standards\n3. Create contributor documentation for extending diagram types\n4. Update API documentation for any new MCP interface endpoints\n\n## Integration Documentation\n1. Document integration with existing commands (analyze-complexity, generate, etc.)\n2. Provide examples showing how diagrams complement other Task Master features\n</info added on 2025-05-23T21:08:36.329Z>", "status": "pending" } @@ -2248,7 +2644,9 @@ "id": 2, "title": "Implement webhook authentication and security measures", "description": "Develop security mechanisms for webhook verification and payload signing", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Implement signature verification using HMAC, rate limiting to prevent abuse, IP whitelisting options, and webhook secret management. Create a secure token system for webhook verification and implement TLS for all webhook communications.", "status": "pending" }, @@ -2264,7 +2662,10 @@ "id": 4, "title": "Build event processing and queuing system", "description": "Implement a robust system for processing and queuing events before webhook delivery", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "details": "Create an event queue using a message broker (like RabbitMQ or Kafka) to handle high volumes of events. Implement event deduplication, prioritization, and persistence to ensure reliable delivery even during system failures.", "status": "pending" }, @@ -2272,7 +2673,10 @@ "id": 5, "title": "Develop webhook delivery and retry mechanism", "description": "Create a reliable system for webhook delivery with retry logic and failure handling", - "dependencies": [2, 4], + "dependencies": [ + 2, + 4 + ], "details": "Implement exponential backoff retry logic, configurable retry attempts, and dead letter queues for failed deliveries. Add monitoring for webhook delivery success rates and performance metrics. Include timeout handling for unresponsive webhook endpoints.", "status": "pending" }, @@ -2280,7 +2684,9 @@ "id": 6, "title": "Implement comprehensive error handling and logging", "description": "Create robust error handling, logging, and monitoring for the webhook system", - "dependencies": [5], + "dependencies": [ + 5 + ], "details": "Develop detailed error logging for webhook failures, including response codes, error messages, and timing information. Implement alerting for critical failures and create a dashboard for monitoring system health. Add debugging tools for webhook delivery issues.", "status": "pending" }, @@ -2288,7 +2694,11 @@ "id": 7, "title": "Create webhook testing and simulation tools", "description": "Develop tools for testing webhook integrations and simulating event triggers", - "dependencies": [3, 5, 6], + "dependencies": [ + 3, + 5, + 6 + ], "details": "Build a webhook testing console that allows manual triggering of events, viewing delivery history, and replaying failed webhooks. Create a webhook simulator for developers to test their endpoint implementations without generating real system events.", "status": "pending" } @@ -2299,7 +2709,9 @@ "title": "Implement GitHub Issue Import Feature", "description": "Implement a comprehensive LLM-powered 'import_task' command that can intelligently import tasks from GitHub Issues and Discussions. The system uses our existing ContextGatherer.js infrastructure to analyze the full context of GitHub content and automatically generate well-structured tasks with appropriate subtasks, priorities, and implementation details. This feature works in conjunction with the GitHub export feature (Task #97) to provide bidirectional linking between Task Master tasks and GitHub issues.", "status": "pending", - "dependencies": [97], + "dependencies": [ + 97 + ], "priority": "medium", "details": "Implement a new 'import_task' command that leverages LLM-powered analysis to create comprehensive tasks from GitHub Issues and Discussions. The system should be designed as an extensible import framework that can support multiple platforms in the future.\n\nCore functionality:\n1. **New Command Structure**: Create 'import_task' command with source-specific subcommands:\n - 'taskmaster import_task github <URL>' for GitHub imports\n - Future: 'taskmaster import_task gitlab <URL>', 'taskmaster import_task linear <URL>', etc.\n\n2. **Multi-Source GitHub Support**: Automatically detect and handle:\n - GitHub Issues: https://github.com/owner/repo/issues/123\n - GitHub Discussions: https://github.com/owner/repo/discussions/456\n - Auto-detect URL type and use appropriate API endpoints\n\n3. **LLM-Powered Context Analysis**: Integrate with ContextGatherer.js to:\n - Fetch complete GitHub content (main post + all comments/replies)\n - Analyze discussion threads and extract key insights\n - Identify references to our project components and codebase\n - Generate comprehensive task descriptions based on full context\n - Automatically create relevant subtasks from complex discussions\n - Determine appropriate priority levels based on content analysis\n - Suggest dependencies based on mentioned components/features\n\n4. **Smart Content Processing**: The LLM should:\n - Parse markdown content and preserve important formatting\n - Extract actionable items from discussion threads\n - Identify implementation requirements and technical details\n - Convert complex discussions into structured task breakdowns\n - Generate appropriate test strategies based on the scope\n - Preserve important context while creating focused task descriptions\n\n5. **Enhanced GitHub API Integration**:\n - Support GITHUB_API_KEY environment variable for authentication\n - Handle both public and private repository access\n - Fetch issue/discussion metadata (labels, assignees, status)\n - Retrieve complete comment threads with proper threading\n - Implement rate limiting and error handling\n\n6. **Rich Metadata Storage**:\n - Source platform and original URL\n - Import timestamp and LLM model version used\n - Content hash for change detection and sync capabilities\n - Participant information and discussion context\n - GitHub-specific metadata (labels, assignees, status)\n - **Use consistent metadata schema with export feature (Task #97)**\n\n7. **Future-Proof Architecture**:\n - Modular design supporting multiple import sources\n - Plugin-style architecture for new platforms\n - Extensible content type handling (issues, PRs, discussions, etc.)\n - Configurable LLM prompts for different content types\n\n8. **Bidirectional Integration**:\n - Maintain compatibility with GitHub export feature\n - Enable round-trip workflows (import → modify → export)\n - Preserve source linking for synchronization capabilities\n - Support identification of imported vs. native tasks\n\n9. **Error Handling and Validation**:\n - Validate GitHub URLs and accessibility\n - Handle API rate limiting gracefully\n - Provide meaningful error messages for various failure scenarios\n - Implement retry logic for transient failures\n - Validate LLM responses and handle generation errors\n\n10. **Configuration and Customization**:\n - Allow users to customize LLM prompts for task generation\n - Support different import strategies (full vs. summary)\n - Enable filtering of comments by date, author, or relevance\n - Provide options for manual review before task creation", "testStrategy": "Testing should cover the comprehensive LLM-powered import system:\n\n1. **Unit Tests**:\n - Test URL parsing for GitHub Issues and Discussions\n - Test GitHub API client with mocked responses\n - Test LLM integration with ContextGatherer.js\n - Test metadata schema consistency with export feature\n - Test content processing and task generation logic\n - Test error handling for various failure scenarios\n\n2. **Integration Tests**:\n - Test with real GitHub Issues and Discussions (public repos)\n - Test LLM-powered analysis with various content types\n - Test ContextGatherer integration with GitHub content\n - Test bidirectional compatibility with export feature\n - Test metadata structure and storage\n - Test with different GitHub content complexities\n\n3. **LLM and Context Analysis Tests**:\n - Test task generation quality with various GitHub content types\n - Test subtask creation from complex discussions\n - Test priority and dependency inference\n - Test handling of code references and technical discussions\n - Test content summarization and structure preservation\n - Validate LLM prompt effectiveness and response quality\n\n4. **Error Case Tests**:\n - Invalid or malformed GitHub URLs\n - Non-existent repositories or issues/discussions\n - API rate limit handling\n - Authentication failures for private repos\n - LLM service unavailability or errors\n - Network connectivity issues\n - Malformed or incomplete GitHub content\n\n5. **End-to-End Tests**:\n - Complete import workflow from GitHub URL to created task\n - Verify task quality and completeness\n - Test metadata preservation and linking\n - Test compatibility with existing task management features\n - Verify bidirectional workflow with export feature\n\n6. **Performance and Scalability Tests**:\n - Test with large GitHub discussions (many comments)\n - Test LLM processing time and resource usage\n - Test API rate limiting behavior\n - Test concurrent import operations\n\n7. **Future Platform Preparation Tests**:\n - Test modular architecture extensibility\n - Verify plugin-style platform addition capability\n - Test configuration system flexibility\n\nCreate comprehensive mock data for GitHub API responses including various issue/discussion types, comment structures, and edge cases. Use environment variables for test credentials and LLM service configuration.", @@ -2316,7 +2728,9 @@ "id": 2, "title": "Implement GitHub URL parsing and validation", "description": "Create a module to parse and validate GitHub issue URLs, extracting repository owner, repository name, and issue number.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Handle various GitHub URL formats (e.g., github.com/owner/repo/issues/123, github.com/owner/repo/pull/123). Implement validation to ensure the URL points to a valid issue or pull request. Return structured data with owner, repo, and issue number for valid URLs.", "status": "pending" }, @@ -2324,7 +2738,10 @@ "id": 3, "title": "Develop GitHub API client for issue fetching", "description": "Create a service to authenticate with GitHub and fetch issue details using the GitHub REST API.", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Implement authentication using GitHub Personal Access Tokens or OAuth. Handle API responses, including error cases (rate limiting, authentication failures, not found). Extract relevant issue data: title, description, labels, assignees, and comments.", "status": "pending" }, @@ -2332,7 +2749,9 @@ "id": 4, "title": "Create task formatter for GitHub issues", "description": "Develop a formatter to convert GitHub issue data into the application's task format.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Map GitHub issue fields to task fields (title, description, etc.). Convert GitHub markdown to the application's supported format. Handle special GitHub features like issue references and user mentions. Generate appropriate tags based on GitHub labels.", "status": "pending" }, @@ -2340,7 +2759,9 @@ "id": 5, "title": "Implement end-to-end import flow with UI", "description": "Create the user interface and workflow for importing GitHub issues, including progress indicators and error handling.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Design and implement UI for URL input and import confirmation. Show loading states during API calls. Display meaningful error messages for various failure scenarios. Allow users to review and modify imported task details before saving. Add automated tests for the entire import flow.", "status": "pending" }, @@ -2356,7 +2777,9 @@ "id": 7, "title": "Add bidirectional integration with export feature", "description": "Ensure imported tasks work seamlessly with the GitHub export feature and maintain consistent link management.", - "dependencies": [6], + "dependencies": [ + 6 + ], "details": "Verify that tasks imported from GitHub can be properly exported back to GitHub. Implement checks to prevent duplicate exports of imported issues. Add metadata flags to identify imported tasks and their source repositories. Test round-trip workflows (import → modify → export) to ensure data integrity.", "status": "pending" }, @@ -2372,7 +2795,10 @@ "id": 9, "title": "Extend GitHub URL parsing for Issues and Discussions", "description": "Enhance URL parsing to support both GitHub Issues and Discussions with automatic type detection.", - "dependencies": [2, 8], + "dependencies": [ + 2, + 8 + ], "details": "Extend existing URL parser to handle GitHub Discussions URLs. Implement automatic detection of content type (issue vs discussion). Update validation logic for both content types. Ensure consistent data extraction for owner, repo, and content ID regardless of type.", "status": "pending" }, @@ -2380,7 +2806,10 @@ "id": 10, "title": "Implement comprehensive GitHub API client", "description": "Create enhanced GitHub API client supporting both Issues and Discussions APIs with complete content fetching.", - "dependencies": [3, 9], + "dependencies": [ + 3, + 9 + ], "details": "Extend existing API client to support GitHub Discussions API. Implement complete content fetching including all comments and replies. Add support for GITHUB_API_KEY environment variable. Handle threaded discussions and comment hierarchies. Implement robust error handling and rate limiting for both API types.", "status": "pending" }, @@ -2388,7 +2817,9 @@ "id": 11, "title": "Integrate ContextGatherer for LLM-powered analysis", "description": "Integrate with existing ContextGatherer.js to enable LLM-powered analysis of GitHub content.", - "dependencies": [10], + "dependencies": [ + 10 + ], "details": "Adapt ContextGatherer.js to work with GitHub content as input source. Create GitHub-specific context gathering strategies. Implement content preprocessing for optimal LLM analysis. Add project component identification for GitHub discussions. Create prompts for task generation from GitHub content.", "status": "pending" }, @@ -2396,7 +2827,9 @@ "id": 12, "title": "Implement LLM-powered task generation", "description": "Create the core LLM integration that analyzes GitHub content and generates comprehensive tasks with subtasks.", - "dependencies": [11], + "dependencies": [ + 11 + ], "details": "Design LLM prompts for task generation from GitHub content. Implement automatic subtask creation from complex discussions. Add priority and dependency inference based on content analysis. Create test strategy generation from technical discussions. Implement quality validation for LLM-generated content. Add fallback mechanisms for LLM failures.", "status": "pending" }, @@ -2404,7 +2837,10 @@ "id": 13, "title": "Enhance metadata system for rich import context", "description": "Extend the metadata schema to store comprehensive import context and enable advanced features.", - "dependencies": [6, 12], + "dependencies": [ + 6, + 12 + ], "details": "Extend existing metadata schema with import-specific fields. Add source platform, import timestamp, and LLM model tracking. Implement content hash storage for change detection. Store participant information and discussion context. Add support for custom metadata per platform type. Ensure backward compatibility with existing export feature metadata.", "status": "pending" }, @@ -2412,7 +2848,11 @@ "id": 14, "title": "Implement import_task command interface", "description": "Create the user-facing command interface for the new import_task system with GitHub support.", - "dependencies": [8, 12, 13], + "dependencies": [ + 8, + 12, + 13 + ], "details": "Implement the main import_task command with GitHub subcommand. Add command-line argument parsing and validation. Create progress indicators for LLM processing. Implement user review and confirmation workflow. Add verbose output options for debugging. Create help documentation and usage examples.", "status": "pending" }, @@ -2420,7 +2860,9 @@ "id": 15, "title": "Add comprehensive testing and validation", "description": "Implement comprehensive testing suite covering all aspects of the LLM-powered import system.", - "dependencies": [14], + "dependencies": [ + 14 + ], "details": "Create unit tests for all new components. Implement integration tests with real GitHub content. Add LLM response validation and quality tests. Create performance tests for large discussions. Implement end-to-end workflow testing. Add mock data for consistent testing. Test bidirectional compatibility with export feature.", "status": "pending" } @@ -2448,7 +2890,9 @@ "id": 2, "title": "Implement AI integration for ICE scoring", "description": "Develop the AI component that will analyze tasks and generate ICE scores", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Create prompts for the AI to evaluate Impact, Confidence, and Ease. Implement error handling for AI responses. Add caching to prevent redundant AI calls. Ensure the AI provides justification for each score component. Test with various task types to ensure consistent scoring.", "status": "pending" }, @@ -2456,7 +2900,9 @@ "id": 3, "title": "Create report file generator", "description": "Build functionality to generate a structured report file with ICE analysis results", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Design the report file format (JSON, CSV, or Markdown). Implement sorting of tasks by ICE score. Include task details, individual I/C/E scores, and final ICE score in the report. Add timestamp and project metadata. Create a function to save the report to the specified location.", "status": "pending" }, @@ -2464,7 +2910,9 @@ "id": 4, "title": "Implement CLI rendering for ICE analysis", "description": "Develop the command-line interface for displaying ICE analysis results", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Design a tabular format for displaying ICE scores in the terminal. Use color coding to highlight high/medium/low priority tasks. Implement filtering options (by score range, task type, etc.). Add sorting capabilities. Create a summary view that shows top N tasks by ICE score.", "status": "pending" }, @@ -2472,7 +2920,10 @@ "id": 5, "title": "Integrate with existing complexity reports", "description": "Connect the ICE analysis functionality with the existing complexity reporting system", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "details": "Modify the existing complexity report to include ICE scores. Ensure consistent formatting between complexity and ICE reports. Add cross-referencing between reports. Update the command-line help documentation. Test the integrated system with various project sizes and configurations.", "status": "pending" } @@ -2500,7 +2951,9 @@ "id": 2, "title": "Implement State Management for Task Expansion", "description": "Develop the state management logic to handle expanded task states, subtask creation, and context additions.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Create state handlers for expanded/collapsed states, subtask array management, and context data. Implement proper validation for user inputs and error handling. Ensure state persistence across user sessions and synchronization with backend services.", "status": "pending" }, @@ -2508,7 +2961,9 @@ "id": 3, "title": "Build Context Addition Functionality", "description": "Create the functionality that allows users to add additional context to tasks and subtasks.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Implement context input fields with support for rich text, attachments, links, and references to other tasks. Add auto-save functionality for context changes and version history if applicable. Include context suggestion features based on task content.", "status": "pending" }, @@ -2516,7 +2971,9 @@ "id": 4, "title": "Develop Task Management Controls", "description": "Implement controls for managing tasks within the expanded card view, including prioritization, scheduling, and assignment.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Create UI controls for task prioritization (drag-and-drop ranking), deadline setting with calendar integration, assignee selection with user search, and status updates. Implement notification triggers for task changes and deadline reminders.", "status": "pending" }, @@ -2524,7 +2981,10 @@ "id": 5, "title": "Integrate with Existing Task Systems", "description": "Ensure the enhanced actions card workflow integrates seamlessly with existing task management functionality.", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "details": "Connect the new UI components to existing backend APIs. Update data models if necessary to support new features. Ensure compatibility with existing task filters, search, and reporting features. Implement data migration plan for existing tasks if needed.", "status": "pending" }, @@ -2532,7 +2992,9 @@ "id": 6, "title": "Test and Optimize User Experience", "description": "Conduct thorough testing of the enhanced workflow and optimize based on user feedback and performance metrics.", - "dependencies": [5], + "dependencies": [ + 5 + ], "details": "Perform usability testing with representative users. Collect metrics on task completion time, error rates, and user satisfaction. Optimize performance for large task lists and complex subtask hierarchies. Implement A/B testing for alternative UI approaches if needed.", "status": "pending" } @@ -2560,7 +3022,9 @@ "id": 2, "title": "Extract prompts into individual files", "description": "Identify all hardcoded prompts in the codebase and extract them into individual files in the prompts directory", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Search through the codebase for all hardcoded prompt strings. For each prompt, create a new file in the appropriate subdirectory with a descriptive name (e.g., 'taskBreakdownPrompt.js'). Format each file to export the prompt string as a constant. Add JSDoc comments to document the purpose and expected usage of each prompt.", "status": "pending" }, @@ -2568,7 +3032,10 @@ "id": 3, "title": "Update functions to import prompts", "description": "Modify all functions that use hardcoded prompts to import them from the centralized structure", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "For each function that previously used a hardcoded prompt, add an import statement to pull in the prompt from the centralized structure. Test each function after modification to ensure it still works correctly. Update any tests that might be affected by the refactoring. Create a pull request with the changes and document the new prompt structure in the project documentation.", "status": "pending" } @@ -2596,7 +3063,9 @@ "id": 2, "title": "Implement best practice verification", "description": "Build verification checks against established coding standards and best practices", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Create a framework to compare code against established best practices for the specific language/framework. Include checks for naming conventions, function length, complexity metrics, comment coverage, and other industry-standard quality indicators.", "status": "pending" }, @@ -2604,7 +3073,10 @@ "id": 3, "title": "Develop AI integration for code analysis", "description": "Integrate AI capabilities to enhance code analysis and provide intelligent recommendations", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Connect to AI services (like OpenAI) to analyze code beyond rule-based checks. Configure the AI to understand context, project-specific patterns, and provide nuanced analysis that rule-based systems might miss.", "status": "pending" }, @@ -2612,7 +3084,10 @@ "id": 4, "title": "Create recommendation generation system", "description": "Build a system to generate actionable improvement recommendations based on analysis results", - "dependencies": [2, 3], + "dependencies": [ + 2, + 3 + ], "details": "Develop algorithms to transform analysis results into specific, actionable recommendations. Include priority levels, effort estimates, and potential impact assessments for each recommendation.", "status": "pending" }, @@ -2620,7 +3095,9 @@ "id": 5, "title": "Implement task creation functionality", "description": "Add capability to automatically create tasks from code quality recommendations", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Build functionality to convert recommendations into tasks in the project management system. Include appropriate metadata, assignee suggestions based on code ownership, and integration with existing workflow systems.", "status": "pending" }, @@ -2628,7 +3105,10 @@ "id": 6, "title": "Create comprehensive reporting interface", "description": "Develop a user interface to display analysis results and recommendations", - "dependencies": [4, 5], + "dependencies": [ + 4, + 5 + ], "details": "Build a dashboard showing code quality metrics, identified patterns, recommendations, and created tasks. Include filtering options, trend analysis over time, and the ability to drill down into specific issues with code snippets and explanations.", "status": "pending" } @@ -2657,7 +3137,9 @@ "id": 2, "title": "Develop coverage report parser and adapter system", "description": "Create a framework-agnostic system that can parse coverage reports from various testing tools and convert them to the standardized task-based format in tests.json.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "1. Research and document output formats for major coverage tools (Istanbul/nyc, Jest, Pytest, JaCoCo).\n2. Design a normalized intermediate coverage format that any test tool can map to.\n3. Implement adapter classes for each major testing framework that convert their reports to the intermediate format.\n4. Create a parser registry that can automatically detect and use the appropriate parser based on input format.\n5. Develop a mapping algorithm that associates coverage data with specific tasks based on file paths and code blocks.\n6. Implement file path normalization to handle different operating systems and environments.\n7. Add error handling for malformed or incomplete coverage reports.\n8. Create unit tests for each adapter using sample coverage reports.\n9. Implement a command-line interface for manual parsing and testing.\n10. Document the extension points for adding custom coverage tool adapters.", "status": "pending", "parentTaskId": 50 @@ -2666,7 +3148,10 @@ "id": 3, "title": "Build coverage tracking and update generator", "description": "Create a system that processes code coverage reports, maps them to tasks, and updates the tests.json file to maintain accurate coverage tracking over time.", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "1. Implement a coverage processor that takes parsed coverage data and maps it to task IDs.\n2. Create algorithms to calculate aggregate coverage metrics at the task and subtask levels.\n3. Develop a change detection system that identifies when tests or code have changed and require updates.\n4. Implement incremental update logic to avoid reprocessing unchanged tests.\n5. Create a task-code association system that maps specific code blocks to tasks for granular tracking.\n6. Add historical tracking to monitor coverage trends over time.\n7. Implement hooks for CI/CD integration to automatically update coverage after test runs.\n8. Create a conflict resolution strategy for when multiple tests cover the same code areas.\n9. Add performance optimizations for large codebases and test suites.\n10. Develop unit tests that verify correct aggregation and mapping of coverage data.\n11. Document the update workflow with sequence diagrams and examples.", "status": "pending", "parentTaskId": 50 @@ -2675,7 +3160,11 @@ "id": 4, "title": "Implement CLI commands for coverage operations", "description": "Create a set of command-line interface tools that allow developers to view, analyze, and manage test coverage at the task level.", - "dependencies": [1, 2, 3], + "dependencies": [ + 1, + 2, + 3 + ], "details": "1. Design a cohesive CLI command structure with subcommands for different coverage operations.\n2. Implement 'coverage show' command to display test coverage for a specific task/subtask.\n3. Create 'coverage gaps' command to identify untested code related to a particular task.\n4. Develop 'coverage history' command to show how coverage has changed over time.\n5. Implement 'coverage generate' command that uses LLMs to suggest tests for uncovered code.\n6. Add filtering options to focus on specific test types or coverage thresholds.\n7. Create formatted output options (JSON, CSV, markdown tables) for integration with other tools.\n8. Implement colorized terminal output for better readability of coverage reports.\n9. Add batch processing capabilities for running operations across multiple tasks.\n10. Create comprehensive help documentation and examples for each command.\n11. Develop unit and integration tests for CLI commands.\n12. Document command usage patterns and example workflows.", "status": "pending", "parentTaskId": 50 @@ -2684,7 +3173,12 @@ "id": 5, "title": "Develop AI-powered test generation system", "description": "Create an intelligent system that uses LLMs to generate targeted tests for uncovered code sections within tasks, integrating with the existing task management workflow.", - "dependencies": [1, 2, 3, 4], + "dependencies": [ + 1, + 2, + 3, + 4 + ], "details": "1. Design prompt templates for different test types (unit, integration, E2E) that incorporate task descriptions and code context.\n2. Implement code analysis to extract relevant context from uncovered code sections.\n3. Create a test generation pipeline that combines task metadata, code context, and coverage gaps.\n4. Develop strategies for maintaining test context across task changes and updates.\n5. Implement test quality evaluation to ensure generated tests are meaningful and effective.\n6. Create a feedback mechanism to improve prompts based on acceptance or rejection of generated tests.\n7. Add support for different testing frameworks and languages through templating.\n8. Implement caching to avoid regenerating similar tests.\n9. Create a workflow that integrates with the task management system to suggest tests alongside implementation requirements.\n10. Develop specialized generation modes for edge cases, regression tests, and performance tests.\n11. Add configuration options for controlling test generation style and coverage goals.\n12. Create comprehensive documentation on how to use and extend the test generation system.\n13. Implement evaluation metrics to track the effectiveness of AI-generated tests.", "status": "pending", "parentTaskId": 50 @@ -2723,7 +3217,10 @@ "id": 3, "title": "Build Research Command CLI Interface", "description": "Implement the Commander.js command structure for the 'research' command with all required options and parameters.", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Implementation details:\n1. Create a new command file `commands/research.js`\n2. Set up the Commander.js command structure with the following options:\n - Required search query parameter\n - `--task` or `-t` option for task/subtask ID\n - `--prompt` or `-p` option for custom research prompt\n - `--save` or `-s` option to save results to a file\n - `--copy` or `-c` option to copy results to clipboard\n - `--summary` or `-m` option to generate a summary\n - `--detail` or `-d` option to set research depth (default: medium)\n3. Implement command validation logic\n4. Connect the command to the Perplexity service created in subtask 1\n5. Integrate the context extraction logic from subtask 2\n6. Register the command in the main CLI application\n7. Add help text and examples\n\nTesting approach:\n- Test command registration and option parsing\n- Verify command validation logic works correctly\n- Test with various combinations of options\n- Ensure proper error messages for invalid inputs\n<info added on 2025-05-23T21:09:08.478Z>\nImplementation details:\n1. Create a new module `repl/research-chat.js` for the interactive research experience\n2. Implement REPL-style chat interface using inquirer with:\n - Persistent conversation history management\n - Context-aware prompting system\n - Command parsing for special instructions\n3. Implement REPL commands:\n - `/save` - Save conversation to file\n - `/task` - Associate with or load context from a task\n - `/help` - Show available commands and usage\n - `/exit` - End the research session\n - `/copy` - Copy last response to clipboard\n - `/summary` - Generate summary of conversation\n - `/detail` - Adjust research depth level\n4. Create context initialization system:\n - Task/subtask context loading\n - File content integration\n - System prompt configuration\n5. Integrate with ai-services-unified.js research mode\n6. Implement conversation state management:\n - Track message history\n - Maintain context window\n - Handle context pruning for long conversations\n7. Design consistent UI patterns using ui.js library\n8. Add entry point in main CLI application\n\nTesting approach:\n- Test REPL command parsing and execution\n- Verify context initialization with various inputs\n- Test conversation state management\n- Ensure proper error handling and recovery\n- Validate UI consistency across different terminal environments\n</info added on 2025-05-23T21:09:08.478Z>", "status": "pending", "parentTaskId": 51 @@ -2732,7 +3229,10 @@ "id": 4, "title": "Implement Results Processing and Output Formatting", "description": "Create functionality to process, format, and display research results in the terminal with options for saving, copying, and summarizing.", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "details": "Implementation details:\n1. Create a new module `utils/researchFormatter.js`\n2. Implement terminal output formatting with:\n - Color-coded sections for better readability\n - Proper text wrapping for terminal width\n - Highlighting of key points\n3. Add functionality to save results to a file:\n - Create a `research-results` directory if it doesn't exist\n - Save results with timestamp and query in filename\n - Support multiple formats (text, markdown, JSON)\n4. Implement clipboard copying using a library like `clipboardy`\n5. Create a summarization function that extracts key points from research results\n6. Add progress indicators during API calls\n7. Implement pagination for long results\n\nTesting approach:\n- Test output formatting with various result lengths and content types\n- Verify file saving functionality creates proper files with correct content\n- Test clipboard functionality\n- Verify summarization produces useful results\n<info added on 2025-05-23T21:10:00.181Z>\nImplementation details:\n1. Create a new module `utils/chatFormatter.js` for REPL interface formatting\n2. Implement terminal output formatting for conversational display:\n - Color-coded messages distinguishing user inputs and AI responses\n - Proper text wrapping and indentation for readability\n - Support for markdown rendering in terminal\n - Visual indicators for system messages and status updates\n3. Implement streaming/progressive display of AI responses:\n - Character-by-character or chunk-by-chunk display\n - Cursor animations during response generation\n - Ability to interrupt long responses\n4. Design chat history visualization:\n - Scrollable history with clear message boundaries\n - Timestamp display options\n - Session identification\n5. Create specialized formatters for different content types:\n - Code blocks with syntax highlighting\n - Bulleted and numbered lists\n - Tables and structured data\n - Citations and references\n6. Implement export functionality:\n - Save conversations to markdown or text files\n - Export individual responses\n - Copy responses to clipboard\n7. Adapt existing ui.js patterns for conversational context:\n - Maintain consistent styling while supporting chat flow\n - Handle multi-turn context appropriately\n\nTesting approach:\n- Test streaming display with various response lengths and speeds\n- Verify markdown rendering accuracy for complex formatting\n- Test history navigation and scrolling functionality\n- Verify export features create properly formatted files\n- Test display on various terminal sizes and configurations\n- Verify handling of special characters and unicode\n</info added on 2025-05-23T21:10:00.181Z>", "status": "pending", "parentTaskId": 51 @@ -2741,7 +3241,10 @@ "id": 5, "title": "Implement Caching and Results Management System", "description": "Create a persistent caching system for research results and implement functionality to manage, retrieve, and reference previous research.", - "dependencies": [1, 4], + "dependencies": [ + 1, + 4 + ], "details": "Implementation details:\n1. Create a research results database using a simple JSON file or SQLite:\n - Store queries, timestamps, and results\n - Index by query and related task IDs\n2. Implement cache retrieval and validation:\n - Check for cached results before making API calls\n - Validate cache freshness with configurable TTL\n3. Add commands to manage research history:\n - List recent research queries\n - Retrieve past research by ID or search term\n - Clear cache or delete specific entries\n4. Create functionality to associate research results with tasks:\n - Add metadata linking research to specific tasks\n - Implement command to show all research related to a task\n5. Add configuration options for cache behavior in user settings\n6. Implement export/import functionality for research data\n\nTesting approach:\n- Test cache storage and retrieval with various queries\n- Verify cache invalidation works correctly\n- Test history management commands\n- Verify task association functionality\n- Test with large cache sizes to ensure performance\n<info added on 2025-05-23T21:10:28.544Z>\nImplementation details:\n1. Create a session management system for the REPL experience:\n - Generate and track unique session IDs\n - Store conversation history with timestamps\n - Maintain context and state between interactions\n2. Implement session persistence:\n - Save sessions to disk automatically\n - Load previous sessions on startup\n - Handle graceful recovery from crashes\n3. Build session browser and selector:\n - List available sessions with preview\n - Filter sessions by date, topic, or content\n - Enable quick switching between sessions\n4. Implement conversation state serialization:\n - Capture full conversation context\n - Preserve user preferences per session\n - Handle state migration during updates\n5. Add session sharing capabilities:\n - Export sessions to portable formats\n - Import sessions from files\n - Generate shareable links (if applicable)\n6. Create session management commands:\n - Create new sessions\n - Clone existing sessions\n - Archive or delete old sessions\n\nTesting approach:\n- Verify session persistence across application restarts\n- Test session recovery from simulated crashes\n- Validate state serialization with complex conversations\n- Ensure session switching maintains proper context\n- Test session import/export functionality\n- Verify performance with large conversation histories\n</info added on 2025-05-23T21:10:28.544Z>", "status": "cancelled", "parentTaskId": 51 @@ -2750,7 +3253,9 @@ "id": 6, "title": "Implement Project Context Generation", "description": "Create functionality to generate and include project-level context such as file trees, repository structure, and codebase insights for more informed research.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Implementation details:\n1. Create a new module `utils/projectContextGenerator.js` for project-level context extraction\n2. Implement file tree generation functionality:\n - Scan project directory structure recursively\n - Filter out irrelevant files (node_modules, .git, etc.)\n - Format file tree for AI consumption\n - Include file counts and structure statistics\n3. Add code analysis capabilities:\n - Extract key imports and dependencies\n - Identify main modules and their relationships\n - Generate high-level architecture overview\n4. Implement context summarization:\n - Create concise project overview\n - Identify key technologies and patterns\n - Summarize project purpose and structure\n5. Add caching for expensive operations:\n - Cache file tree with invalidation on changes\n - Store analysis results with TTL\n6. Create integration with research REPL:\n - Add project context to system prompts\n - Support `/project` command to refresh context\n - Allow selective inclusion of project components\n\nTesting approach:\n- Test file tree generation with various project structures\n- Verify filtering logic works correctly\n- Test context summarization quality\n- Measure performance impact of context generation\n- Verify caching mechanism effectiveness", "status": "pending", "parentTaskId": 51 @@ -2759,7 +3264,9 @@ "id": 7, "title": "Create REPL Command System", "description": "Implement a flexible command system for the research REPL that allows users to control the conversation flow, manage sessions, and access additional functionality.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Implementation details:\n1. Create a new module `repl/commands.js` for REPL command handling\n2. Implement a command parser that:\n - Detects commands starting with `/`\n - Parses arguments and options\n - Handles quoted strings and special characters\n3. Create a command registry system:\n - Register command handlers with descriptions\n - Support command aliases\n - Enable command discovery and help\n4. Implement core commands:\n - `/save [filename]` - Save conversation\n - `/task <taskId>` - Load task context\n - `/file <path>` - Include file content\n - `/help [command]` - Show help\n - `/exit` - End session\n - `/copy [n]` - Copy nth response\n - `/summary` - Generate conversation summary\n - `/detail <level>` - Set detail level\n - `/clear` - Clear conversation\n - `/project` - Refresh project context\n - `/session <id|new>` - Switch/create session\n5. Add command completion and suggestions\n6. Implement error handling for invalid commands\n7. Create a help system with examples\n\nTesting approach:\n- Test command parsing with various inputs\n- Verify command execution and error handling\n- Test command completion functionality\n- Verify help system provides useful information\n- Test with complex command sequences", "status": "pending", "parentTaskId": 51 @@ -2768,7 +3275,10 @@ "id": 8, "title": "Integrate with AI Services Unified", "description": "Integrate the research REPL with the existing ai-services-unified.js to leverage the unified AI service architecture with research mode.", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "details": "Implementation details:\n1. Update `repl/research-chat.js` to integrate with ai-services-unified.js\n2. Configure research mode in AI service:\n - Set appropriate system prompts\n - Configure temperature and other parameters\n - Enable streaming responses\n3. Implement context management:\n - Format conversation history for AI context\n - Include task and project context\n - Handle context window limitations\n4. Add support for different research styles:\n - Exploratory research with broader context\n - Focused research with specific questions\n - Comparative analysis between concepts\n5. Implement response handling:\n - Process streaming chunks\n - Format and display responses\n - Handle errors and retries\n6. Add configuration options for AI service selection\n7. Implement fallback mechanisms for service unavailability\n\nTesting approach:\n- Test integration with mocked AI services\n- Verify context formatting and management\n- Test streaming response handling\n- Verify error handling and recovery\n- Test with various research styles and queries", "status": "pending", "parentTaskId": 51 @@ -2797,7 +3307,9 @@ "id": 2, "title": "Implement AI integration for task suggestions", "description": "Develop the core functionality to generate task suggestions using AI based on existing tasks", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Create an AI prompt template that effectively communicates the existing task context and request for suggestions. Implement error handling for API failures, rate limiting, and malformed responses. Include parameters for controlling suggestion quantity and specificity.", "status": "pending" }, @@ -2805,7 +3317,9 @@ "id": 3, "title": "Build interactive CLI interface for suggestions", "description": "Create the command-line interface for requesting and displaying task suggestions", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Design a user-friendly CLI command structure with appropriate flags for customization. Implement progress indicators during AI processing and format the output of suggestions in a clear, readable format. Include help text and examples in the command documentation.", "status": "pending" }, @@ -2813,7 +3327,9 @@ "id": 4, "title": "Implement suggestion selection and task creation", "description": "Allow users to interactively select suggestions to convert into actual tasks", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Create an interactive selection interface where users can review suggestions, select which ones to create as tasks, and optionally modify them before creation. Implement batch creation capabilities and validation to ensure new tasks meet system requirements.", "status": "pending" }, @@ -2821,7 +3337,10 @@ "id": 5, "title": "Add configuration options and flag handling", "description": "Implement various configuration options and command flags for customizing suggestion behavior", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "details": "Create a comprehensive set of command flags for controlling suggestion quantity, specificity, format, and other parameters. Implement persistent configuration options that users can set as defaults. Document all available options and provide examples of common usage patterns.", "status": "pending" } @@ -2849,7 +3368,9 @@ "id": 2, "title": "Build context gathering mechanism", "description": "Develop a system to collect relevant context from parent task and existing subtasks", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Create functions to extract information from the parent task including title, description, and metadata. Also gather information about any existing subtasks to provide context for AI suggestions. Format this data appropriately for the AI prompt.", "status": "pending" }, @@ -2857,7 +3378,9 @@ "id": 3, "title": "Develop AI suggestion logic for subtasks", "description": "Create the core AI integration to generate relevant subtask suggestions", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Implement the AI prompt engineering and response handling for subtask generation. Ensure the AI provides structured output with appropriate fields for subtasks. Include error handling for API failures and malformed responses.", "status": "pending" }, @@ -2865,7 +3388,9 @@ "id": 4, "title": "Create interactive CLI interface", "description": "Build a user-friendly command-line interface for the subtask suggestion feature", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Develop CLI commands and options for requesting subtask suggestions. Include interactive elements for selecting, modifying, or rejecting suggested subtasks. Ensure clear user feedback throughout the process.", "status": "pending" }, @@ -2873,7 +3398,9 @@ "id": 5, "title": "Implement subtask linking functionality", "description": "Create system to properly link suggested subtasks to their parent task", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Develop the database operations to save accepted subtasks and link them to the parent task. Include functionality for setting dependencies between subtasks. Ensure proper transaction handling to maintain data integrity.", "status": "pending" }, @@ -2881,7 +3408,9 @@ "id": 6, "title": "Perform comprehensive testing", "description": "Test the subtask suggestion feature across various scenarios", - "dependencies": [5], + "dependencies": [ + 5 + ], "details": "Create unit tests for each component. Develop integration tests for the full feature workflow. Test edge cases including invalid inputs, API failures, and unusual task structures. Document test results and fix any identified issues.", "status": "pending" } @@ -2919,7 +3448,9 @@ "id": 2, "title": "Design positional argument specification format", "description": "Create a specification for how positional arguments will be defined in command definitions, including their order, required/optional status, and type validation.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Define a clear syntax for specifying positional arguments in command definitions. Consider how to handle mixed positional and named arguments, default values, and type constraints. Document the specification with examples for different command types.", "status": "pending" }, @@ -2927,7 +3458,10 @@ "id": 3, "title": "Implement core positional argument parsing logic", "description": "Modify the argument parser to recognize and process positional arguments according to the specification, while maintaining compatibility with existing named arguments.", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Update the parser to identify arguments without flags as positional, map them to the correct parameter based on order, and apply appropriate validation. Ensure the implementation handles missing required positional arguments and provides helpful error messages.", "status": "pending" }, @@ -2935,7 +3469,9 @@ "id": 4, "title": "Handle edge cases and error conditions", "description": "Implement robust handling for edge cases such as too many/few arguments, type mismatches, and ambiguous situations between positional and named arguments.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Create comprehensive error handling for scenarios like: providing both positional and named version of the same argument, incorrect argument types, missing required positional arguments, and excess positional arguments. Ensure error messages are clear and actionable for users.", "status": "pending" }, @@ -2943,7 +3479,11 @@ "id": 5, "title": "Update documentation and create usage examples", "description": "Update CLI documentation to explain positional argument support and provide clear examples showing how to use positional arguments with different commands.", - "dependencies": [2, 3, 4], + "dependencies": [ + 2, + 3, + 4 + ], "details": "Revise user documentation to include positional argument syntax, update command reference with positional argument information, and create example command snippets showing both positional and named argument usage. Include a migration guide for users transitioning from named-only to positional arguments.", "status": "pending" } @@ -2989,7 +3529,9 @@ "id": 3, "title": "Implement Progress Indicators and Loading Animations", "description": "Add visual feedback for long-running operations", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Create spinner animations for operations that take time to complete. Implement progress bars for operations with known completion percentages. Ensure animations degrade gracefully in terminals with limited capabilities. Add estimated time remaining calculations where possible.", "status": "pending" }, @@ -2997,7 +3539,9 @@ "id": 4, "title": "Develop Interactive Selection Menus", "description": "Create interactive menus for task selection and configuration", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Implement arrow-key navigation for selecting tasks from a list. Add checkbox and radio button interfaces for multi-select and single-select options. Include search/filter functionality for large task lists. Ensure keyboard shortcuts are consistent and documented.", "status": "pending" }, @@ -3005,7 +3549,9 @@ "id": 5, "title": "Design Tabular and Structured Output Formats", "description": "Improve the formatting of task lists and detailed information", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Create table layouts with proper column alignment for task lists. Implement tree views for displaying task hierarchies and dependencies. Add support for different output formats (plain text, JSON, CSV). Ensure outputs are properly paginated for large datasets.", "status": "pending" }, @@ -3013,7 +3559,11 @@ "id": 6, "title": "Create Help System and Interactive Documentation", "description": "Develop an in-CLI help system with examples and contextual assistance", - "dependencies": [2, 4, 5], + "dependencies": [ + 2, + 4, + 5 + ], "details": "Implement a comprehensive help command with examples for each feature. Add contextual help that suggests relevant commands based on user actions. Create interactive tutorials for new users. Include command auto-completion suggestions and syntax highlighting for command examples.", "status": "pending" } @@ -3051,7 +3601,9 @@ "id": 2, "title": "Remove Manual Dependency Modifications", "description": "Eliminate any custom scripts or manual steps that alter dependencies outside of npm's standard workflow.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Refactor or delete code that manually installs, updates, or modifies dependencies, ensuring all dependency management is handled via npm.", "status": "done" }, @@ -3059,7 +3611,9 @@ "id": 3, "title": "Update npm Dependencies", "description": "Update all project dependencies using npm, ensuring versions are current and compatible, and resolve any conflicts.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Run npm update, audit for vulnerabilities, and adjust package.json and package-lock.json as needed.", "status": "done" }, @@ -3067,7 +3621,9 @@ "id": 4, "title": "Update Initialization and Installation Commands", "description": "Revise project setup scripts and documentation to reflect the new npm-based dependency management approach.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Ensure that all initialization commands (e.g., npm install) are up-to-date and remove references to deprecated manual steps.", "status": "done" }, @@ -3075,7 +3631,9 @@ "id": 5, "title": "Update Documentation", "description": "Revise project documentation to describe the new dependency management process and provide clear setup instructions.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Update README, onboarding guides, and any developer documentation to align with npm best practices.", "status": "done" }, @@ -3083,7 +3641,9 @@ "id": 6, "title": "Perform Regression Testing", "description": "Run comprehensive tests to ensure that the refactor has not introduced any regressions or broken existing functionality.", - "dependencies": [5], + "dependencies": [ + 5 + ], "details": "Execute automated and manual tests, focusing on areas affected by dependency management changes.", "status": "done" } @@ -3111,7 +3671,9 @@ "id": 2, "title": "Implement Mentor Profile Management", "description": "Develop the functionality for creating, editing, and managing mentor profiles in the system.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Build UI components for mentor profile creation and editing. Implement backend APIs for profile CRUD operations. Create expertise tagging system and availability calendar. Add profile verification and approval workflows for quality control.", "status": "pending" }, @@ -3119,7 +3681,9 @@ "id": 3, "title": "Develop Round-Table Discussion Framework", "description": "Create the core framework for hosting and managing round-table discussions between mentors and users.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Design the discussion room data model and state management. Implement discussion scheduling and participant management. Create discussion topic and agenda setting functionality. Develop discussion moderation tools and rules enforcement mechanisms.", "status": "pending" }, @@ -3127,7 +3691,9 @@ "id": 4, "title": "Implement LLM Integration for AI Mentors", "description": "Integrate LLM capabilities to simulate AI mentors that can participate in round-table discussions.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Select appropriate LLM models for mentor simulation. Develop prompt engineering templates for different mentor personas and expertise areas. Implement context management to maintain conversation coherence. Create fallback mechanisms for handling edge cases in discussions.", "status": "pending" }, @@ -3135,7 +3701,10 @@ "id": 5, "title": "Build Discussion Output Formatter", "description": "Create a system to format and present round-table discussion outputs in a structured, readable format.", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "details": "Design templates for discussion summaries and transcripts. Implement real-time formatting of ongoing discussions. Create exportable formats for discussion outcomes (PDF, markdown, etc.). Develop highlighting and annotation features for key insights.", "status": "pending" }, @@ -3143,7 +3712,10 @@ "id": 6, "title": "Integrate Mentor System with Task Management", "description": "Connect the mentor system with the existing task management functionality to enable task-specific mentoring.", - "dependencies": [2, 3], + "dependencies": [ + 2, + 3 + ], "details": "Create APIs to link tasks with relevant mentors based on expertise. Implement functionality to initiate discussions around specific tasks. Develop mechanisms for mentors to provide feedback and guidance on tasks. Build notification system for task-related mentor interactions.", "status": "pending" }, @@ -3151,7 +3723,11 @@ "id": 7, "title": "Test and Optimize Round-Table Discussions", "description": "Conduct comprehensive testing of the round-table discussion feature and optimize for performance and user experience.", - "dependencies": [4, 5, 6], + "dependencies": [ + 4, + 5, + 6 + ], "details": "Perform load testing with multiple concurrent discussions. Test AI mentor responses for quality and relevance. Optimize LLM usage for cost efficiency. Conduct user testing sessions and gather feedback. Implement performance monitoring and analytics for ongoing optimization.", "status": "pending" } @@ -3180,7 +3756,9 @@ "id": 2, "title": "Implement CLI Command Parser for Model Management", "description": "Extend the CLI command parser to handle the new 'models' command and associated flags for model management.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "1. Update the CLI command parser to recognize the 'models' command\n2. Add support for '--set-main' and '--set-research' flags\n3. Implement validation for command arguments\n4. Create help text and usage examples for the models command\n5. Add error handling for invalid command usage\n6. Connect CLI parser to the configuration manager\n7. Implement command output formatting for model listings\n8. Testing approach: Create integration tests that verify CLI commands correctly interact with the configuration manager", "status": "done", "parentTaskId": 61 @@ -3189,7 +3767,9 @@ "id": 3, "title": "Integrate Vercel AI SDK and Create Client Factory", "description": "Set up Vercel AI SDK integration and implement a client factory pattern to create and manage AI model clients.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "1. Install Vercel AI SDK: `npm install @vercel/ai`\n2. Create an `ai-client-factory.js` module that implements the Factory pattern\n3. Define client creation functions for each supported model (Claude, OpenAI, Ollama, Gemini, OpenRouter, Perplexity, Grok)\n4. Implement error handling for missing API keys or configuration issues\n5. Add caching mechanism to reuse existing clients\n6. Create a unified interface for all clients regardless of the underlying model\n7. Implement client validation to ensure proper initialization\n8. Testing approach: Mock API responses to test client creation and error handling\n\n<info added on 2025-04-14T23:02:30.519Z>\nHere's additional information for the client factory implementation:\n\nFor the client factory implementation:\n\n1. Structure the factory with a modular approach:\n```javascript\n// ai-client-factory.js\nimport { createOpenAI } from '@ai-sdk/openai';\nimport { createAnthropic } from '@ai-sdk/anthropic';\nimport { createGoogle } from '@ai-sdk/google';\nimport { createPerplexity } from '@ai-sdk/perplexity';\n\nconst clientCache = new Map();\n\nexport function createClientInstance(providerName, options = {}) {\n // Implementation details below\n}\n```\n\n2. For OpenAI-compatible providers (Ollama), implement specific configuration:\n```javascript\ncase 'ollama':\n const ollamaBaseUrl = process.env.OLLAMA_BASE_URL || 'http://localhost:11434';\n return createOpenAI({\n baseURL: ollamaBaseUrl,\n apiKey: 'ollama', // Ollama doesn't require a real API key\n ...options\n });\n```\n\n3. Add provider-specific model mapping:\n```javascript\n// Model mapping helper\nconst getModelForProvider = (provider, requestedModel) => {\n const modelMappings = {\n openai: {\n default: 'gpt-3.5-turbo',\n // Add other mappings\n },\n anthropic: {\n default: 'claude-3-opus-20240229',\n // Add other mappings\n },\n // Add mappings for other providers\n };\n \n return (modelMappings[provider] && modelMappings[provider][requestedModel]) \n || modelMappings[provider]?.default \n || requestedModel;\n};\n```\n\n4. Implement caching with provider+model as key:\n```javascript\nexport function getClient(providerName, model) {\n const cacheKey = `${providerName}:${model || 'default'}`;\n \n if (clientCache.has(cacheKey)) {\n return clientCache.get(cacheKey);\n }\n \n const modelName = getModelForProvider(providerName, model);\n const client = createClientInstance(providerName, { model: modelName });\n clientCache.set(cacheKey, client);\n \n return client;\n}\n```\n\n5. Add detailed environment variable validation:\n```javascript\nfunction validateEnvironment(provider) {\n const requirements = {\n openai: ['OPENAI_API_KEY'],\n anthropic: ['ANTHROPIC_API_KEY'],\n google: ['GOOGLE_API_KEY'],\n perplexity: ['PERPLEXITY_API_KEY'],\n openrouter: ['OPENROUTER_API_KEY'],\n ollama: ['OLLAMA_BASE_URL'],\n xai: ['XAI_API_KEY']\n };\n \n const missing = requirements[provider]?.filter(env => !process.env[env]) || [];\n \n if (missing.length > 0) {\n throw new Error(`Missing environment variables for ${provider}: ${missing.join(', ')}`);\n }\n}\n```\n\n6. Add Jest test examples:\n```javascript\n// ai-client-factory.test.js\ndescribe('AI Client Factory', () => {\n beforeEach(() => {\n // Mock environment variables\n process.env.OPENAI_API_KEY = 'test-openai-key';\n process.env.ANTHROPIC_API_KEY = 'test-anthropic-key';\n // Add other mocks\n });\n \n test('creates OpenAI client with correct configuration', () => {\n const client = getClient('openai');\n expect(client).toBeDefined();\n // Add assertions for client configuration\n });\n \n test('throws error when environment variables are missing', () => {\n delete process.env.OPENAI_API_KEY;\n expect(() => getClient('openai')).toThrow(/Missing environment variables/);\n });\n \n // Add tests for other providers\n});\n```\n</info added on 2025-04-14T23:02:30.519Z>", "status": "done", "parentTaskId": 61 @@ -3198,7 +3778,9 @@ "id": 4, "title": "Develop Centralized AI Services Module", "description": "Create a centralized AI services module that abstracts all AI interactions through a unified interface, using the Decorator pattern for adding functionality like logging and retries.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "1. Create `ai-services.js` module to consolidate all AI model interactions\n2. Implement wrapper functions for text generation and streaming\n3. Add retry mechanisms for handling API rate limits and transient errors\n4. Implement logging for all AI interactions for observability\n5. Create model-specific adapters to normalize responses across different providers\n6. Add caching layer for frequently used responses to optimize performance\n7. Implement graceful fallback mechanisms when primary models fail\n8. Testing approach: Create unit tests with mocked responses to verify service behavior\n\n<info added on 2025-04-19T23:51:22.219Z>\nBased on the exploration findings, here's additional information for the AI services module refactoring:\n\nThe existing `ai-services.js` should be refactored to:\n\n1. Leverage the `ai-client-factory.js` for model instantiation while providing a higher-level service abstraction\n2. Implement a layered architecture:\n - Base service layer handling common functionality (retries, logging, caching)\n - Model-specific service implementations extending the base\n - Facade pattern to provide a unified API for all consumers\n\n3. Integration points:\n - Replace direct OpenAI client usage with factory-provided clients\n - Maintain backward compatibility with existing service consumers\n - Add service registration mechanism for new AI providers\n\n4. Performance considerations:\n - Implement request batching for high-volume operations\n - Add request priority queuing for critical vs non-critical operations\n - Implement circuit breaker pattern to prevent cascading failures\n\n5. Monitoring enhancements:\n - Add detailed telemetry for response times, token usage, and costs\n - Implement standardized error classification for better diagnostics\n\n6. Implementation sequence:\n - Start with abstract base service class\n - Refactor existing OpenAI implementations\n - Add adapter layer for new providers\n - Implement the unified facade\n</info added on 2025-04-19T23:51:22.219Z>", "status": "done", "parentTaskId": 61 @@ -3207,7 +3789,10 @@ "id": 5, "title": "Implement Environment Variable Management", "description": "Update environment variable handling to support multiple AI models and create documentation for configuration options.", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "details": "1. Update `.env.example` with all required API keys for supported models\n2. Implement environment variable validation on startup\n3. Create clear error messages for missing or invalid environment variables\n4. Add support for model-specific configuration options\n5. Document all environment variables and their purposes\n6. Implement a check to ensure required API keys are present for selected models\n7. Add support for optional configuration parameters for each model\n8. Testing approach: Create tests that verify environment variable validation logic", "status": "done", "parentTaskId": 61 @@ -3216,7 +3801,11 @@ "id": 6, "title": "Implement Model Listing Command", "description": "Implement the 'task-master models' command to display currently configured models and available options.", - "dependencies": [1, 2, 4], + "dependencies": [ + 1, + 2, + 4 + ], "details": "1. Create handler for the models command without flags\n2. Implement formatted output showing current model configuration\n3. Add color-coding for better readability using a library like chalk\n4. Include version information for each configured model\n5. Show API status indicators (connected/disconnected)\n6. Display usage examples for changing models\n7. Add support for verbose output with additional details\n8. Testing approach: Create integration tests that verify correct output formatting and content", "status": "done", "parentTaskId": 61 @@ -3225,7 +3814,12 @@ "id": 7, "title": "Implement Model Setting Commands", "description": "Implement the commands to set main and research models with proper validation and feedback.", - "dependencies": [1, 2, 4, 6], + "dependencies": [ + 1, + 2, + 4, + 6 + ], "details": "1. Create handlers for '--set-main' and '--set-research' flags\n2. Implement validation logic for model names\n3. Add clear error messages for invalid model selections\n4. Implement confirmation messages for successful model changes\n5. Add support for setting both models in a single command\n6. Implement dry-run option to validate without making changes\n7. Add verbose output option for debugging\n8. Testing approach: Create integration tests that verify model setting functionality with various inputs", "status": "done", "parentTaskId": 61 @@ -3234,7 +3828,11 @@ "id": 8, "title": "Update Main Task Processing Logic", "description": "Refactor the main task processing logic to use the new AI services module and support dynamic model selection.", - "dependencies": [4, 5, "61.18"], + "dependencies": [ + 4, + 5, + "61.18" + ], "details": "1. Update task processing functions to use the centralized AI services\n2. Implement dynamic model selection based on configuration\n3. Add error handling for model-specific failures\n4. Implement graceful degradation when preferred models are unavailable\n5. Update prompts to be model-agnostic where possible\n6. Add telemetry for model performance monitoring\n7. Implement response validation to ensure quality across different models\n8. Testing approach: Create integration tests that verify task processing with different model configurations\n\n<info added on 2025-04-20T03:55:56.310Z>\nWhen updating the main task processing logic, implement the following changes to align with the new configuration system:\n\n1. Replace direct environment variable access with calls to the configuration manager:\n ```javascript\n // Before\n const apiKey = process.env.OPENAI_API_KEY;\n const modelId = process.env.MAIN_MODEL || \"gpt-4\";\n \n // After\n import { getMainProvider, getMainModelId, getMainMaxTokens, getMainTemperature } from './config-manager.js';\n \n const provider = getMainProvider();\n const modelId = getMainModelId();\n const maxTokens = getMainMaxTokens();\n const temperature = getMainTemperature();\n ```\n\n2. Implement model fallback logic using the configuration hierarchy:\n ```javascript\n async function processTaskWithFallback(task) {\n try {\n return await processWithModel(task, getMainModelId());\n } catch (error) {\n logger.warn(`Primary model failed: ${error.message}`);\n const fallbackModel = getMainFallbackModelId();\n if (fallbackModel) {\n return await processWithModel(task, fallbackModel);\n }\n throw error;\n }\n }\n ```\n\n3. Add configuration-aware telemetry points to track model usage and performance:\n ```javascript\n function trackModelPerformance(modelId, startTime, success) {\n const duration = Date.now() - startTime;\n telemetry.trackEvent('model_usage', {\n modelId,\n provider: getMainProvider(),\n duration,\n success,\n configVersion: getConfigVersion()\n });\n }\n ```\n\n4. Ensure all prompt templates are loaded through the configuration system rather than hardcoded:\n ```javascript\n const promptTemplate = getPromptTemplate('task_processing');\n const prompt = formatPrompt(promptTemplate, { task: taskData });\n ```\n</info added on 2025-04-20T03:55:56.310Z>", "status": "done", "parentTaskId": 61 @@ -3243,7 +3841,12 @@ "id": 9, "title": "Update Research Processing Logic", "description": "Refactor the research processing logic to use the new AI services module and support dynamic model selection for research operations.", - "dependencies": [4, 5, 8, "61.18"], + "dependencies": [ + 4, + 5, + 8, + "61.18" + ], "details": "1. Update research functions to use the centralized AI services\n2. Implement dynamic model selection for research operations\n3. Add specialized error handling for research-specific issues\n4. Optimize prompts for research-focused models\n5. Implement result caching for research operations\n6. Add support for model-specific research parameters\n7. Create fallback mechanisms for research operations\n8. Testing approach: Create integration tests that verify research functionality with different model configurations\n\n<info added on 2025-04-20T03:55:39.633Z>\nWhen implementing the refactored research processing logic, ensure the following:\n\n1. Replace direct environment variable access with the new configuration system:\n ```javascript\n // Old approach\n const apiKey = process.env.OPENAI_API_KEY;\n const model = \"gpt-4\";\n \n // New approach\n import { getResearchProvider, getResearchModelId, getResearchMaxTokens, \n getResearchTemperature } from './config-manager.js';\n \n const provider = getResearchProvider();\n const modelId = getResearchModelId();\n const maxTokens = getResearchMaxTokens();\n const temperature = getResearchTemperature();\n ```\n\n2. Implement model fallback chains using the configuration system:\n ```javascript\n async function performResearch(query) {\n try {\n return await callAIService({\n provider: getResearchProvider(),\n modelId: getResearchModelId(),\n maxTokens: getResearchMaxTokens(),\n temperature: getResearchTemperature()\n });\n } catch (error) {\n logger.warn(`Primary research model failed: ${error.message}`);\n return await callAIService({\n provider: getResearchProvider('fallback'),\n modelId: getResearchModelId('fallback'),\n maxTokens: getResearchMaxTokens('fallback'),\n temperature: getResearchTemperature('fallback')\n });\n }\n }\n ```\n\n3. Add support for dynamic parameter adjustment based on research type:\n ```javascript\n function getResearchParameters(researchType) {\n // Get base parameters\n const baseParams = {\n provider: getResearchProvider(),\n modelId: getResearchModelId(),\n maxTokens: getResearchMaxTokens(),\n temperature: getResearchTemperature()\n };\n \n // Adjust based on research type\n switch(researchType) {\n case 'deep':\n return {...baseParams, maxTokens: baseParams.maxTokens * 1.5};\n case 'creative':\n return {...baseParams, temperature: Math.min(baseParams.temperature + 0.2, 1.0)};\n case 'factual':\n return {...baseParams, temperature: Math.max(baseParams.temperature - 0.2, 0)};\n default:\n return baseParams;\n }\n }\n ```\n\n4. Ensure the caching mechanism uses configuration-based TTL settings:\n ```javascript\n const researchCache = new Cache({\n ttl: getResearchCacheTTL(),\n maxSize: getResearchCacheMaxSize()\n });\n ```\n</info added on 2025-04-20T03:55:39.633Z>", "status": "done", "parentTaskId": 61 @@ -3252,7 +3855,12 @@ "id": 10, "title": "Create Comprehensive Documentation and Examples", "description": "Develop comprehensive documentation for the new model management features, including examples, troubleshooting guides, and best practices.", - "dependencies": [6, 7, 8, 9], + "dependencies": [ + 6, + 7, + 8, + 9 + ], "details": "1. Update README.md with new model management commands\n2. Create usage examples for all supported models\n3. Document environment variable requirements for each model\n4. Create troubleshooting guide for common issues\n5. Add performance considerations and best practices\n6. Document API key acquisition process for each supported service\n7. Create comparison chart of model capabilities and limitations\n8. Testing approach: Conduct user testing with the documentation to ensure clarity and completeness\n\n<info added on 2025-04-20T03:55:20.433Z>\n## Documentation Update for Configuration System Refactoring\n\n### Configuration System Architecture\n- Document the separation between environment variables and configuration file:\n - API keys: Sourced exclusively from environment variables (process.env or session.env)\n - All other settings: Centralized in `.taskmasterconfig` JSON file\n\n### `.taskmasterconfig` Structure\n```json\n{\n \"models\": {\n \"completion\": \"gpt-3.5-turbo\",\n \"chat\": \"gpt-4\",\n \"embedding\": \"text-embedding-ada-002\"\n },\n \"parameters\": {\n \"temperature\": 0.7,\n \"maxTokens\": 2000,\n \"topP\": 1\n },\n \"logging\": {\n \"enabled\": true,\n \"level\": \"info\"\n },\n \"defaults\": {\n \"outputFormat\": \"markdown\"\n }\n}\n```\n\n### Configuration Access Patterns\n- Document the getter functions in `config-manager.js`:\n - `getModelForRole(role)`: Returns configured model for a specific role\n - `getParameter(name)`: Retrieves model parameters\n - `getLoggingConfig()`: Access logging settings\n - Example usage: `const completionModel = getModelForRole('completion')`\n\n### Environment Variable Resolution\n- Explain the `resolveEnvVariable(key)` function:\n - Checks both process.env and session.env\n - Prioritizes session variables over process variables\n - Returns null if variable not found\n\n### Configuration Precedence\n- Document the order of precedence:\n 1. Command-line arguments (highest priority)\n 2. Session environment variables\n 3. Process environment variables\n 4. `.taskmasterconfig` settings\n 5. Hardcoded defaults (lowest priority)\n\n### Migration Guide\n- Steps for users to migrate from previous configuration approach\n- How to verify configuration is correctly loaded\n</info added on 2025-04-20T03:55:20.433Z>", "status": "done", "parentTaskId": 61 @@ -3263,7 +3871,9 @@ "description": "Update PRD processing logic (callClaude, processClaudeResponse, handleStreamingRequest in ai-services.js) to use the new `generateObjectService` from `ai-services-unified.js` with an appropriate Zod schema.", "details": "\n\n<info added on 2025-04-20T03:55:01.707Z>\nThe PRD parsing refactoring should align with the new configuration system architecture. When implementing this change:\n\n1. Replace direct environment variable access with `resolveEnvVariable` calls for API keys.\n\n2. Remove any hardcoded model names or parameters in the PRD processing functions. Instead, use the config-manager.js getters:\n - `getModelForRole('prd')` to determine the appropriate model\n - `getModelParameters('prd')` to retrieve temperature, maxTokens, etc.\n\n3. When constructing the generateObjectService call, ensure parameters are sourced from config:\n```javascript\nconst modelConfig = getModelParameters('prd');\nconst model = getModelForRole('prd');\n\nconst result = await generateObjectService({\n model,\n temperature: modelConfig.temperature,\n maxTokens: modelConfig.maxTokens,\n // other parameters as needed\n schema: prdSchema,\n // existing prompt/context parameters\n});\n```\n\n4. Update any logging to respect the logging configuration from config-manager (e.g., `isLoggingEnabled('ai')`)\n\n5. Ensure any default values previously hardcoded are now retrieved from the configuration system.\n</info added on 2025-04-20T03:55:01.707Z>", "status": "done", - "dependencies": ["61.23"], + "dependencies": [ + "61.23" + ], "parentTaskId": 61 }, { @@ -3272,7 +3882,9 @@ "description": "Update the `generateSubtasks` function in `ai-services.js` to use the new `generateObjectService` from `ai-services-unified.js` with a Zod schema for the subtask array.", "details": "\n\n<info added on 2025-04-20T03:54:45.542Z>\nThe refactoring should leverage the new configuration system:\n\n1. Replace direct model references with calls to config-manager.js getters:\n ```javascript\n const { getModelForRole, getModelParams } = require('./config-manager');\n \n // Instead of hardcoded models/parameters:\n const model = getModelForRole('subtask-generator');\n const modelParams = getModelParams('subtask-generator');\n ```\n\n2. Update API key handling to use the resolveEnvVariable pattern:\n ```javascript\n const { resolveEnvVariable } = require('./utils');\n const apiKey = resolveEnvVariable('OPENAI_API_KEY');\n ```\n\n3. When calling generateObjectService, pass the configuration parameters:\n ```javascript\n const result = await generateObjectService({\n schema: subtasksArraySchema,\n prompt: subtaskPrompt,\n model: model,\n temperature: modelParams.temperature,\n maxTokens: modelParams.maxTokens,\n // Other parameters from config\n });\n ```\n\n4. Add error handling that respects logging configuration:\n ```javascript\n const { isLoggingEnabled } = require('./config-manager');\n \n try {\n // Generation code\n } catch (error) {\n if (isLoggingEnabled('errors')) {\n console.error('Subtask generation error:', error);\n }\n throw error;\n }\n ```\n</info added on 2025-04-20T03:54:45.542Z>", "status": "done", - "dependencies": ["61.23"], + "dependencies": [ + "61.23" + ], "parentTaskId": 61 }, { @@ -3281,7 +3893,9 @@ "description": "Update the `generateSubtasksWithPerplexity` function in `ai-services.js` to first perform research (potentially keeping the Perplexity call separate or adapting it) and then use `generateObjectService` from `ai-services-unified.js` with research results included in the prompt.", "details": "\n\n<info added on 2025-04-20T03:54:26.882Z>\nThe refactoring should align with the new configuration system by:\n\n1. Replace direct environment variable access with `resolveEnvVariable` for API keys\n2. Use the config-manager.js getters to retrieve model parameters:\n - Replace hardcoded model names with `getModelForRole('research')`\n - Use `getParametersForRole('research')` to get temperature, maxTokens, etc.\n3. Implement proper error handling that respects the `getLoggingConfig()` settings\n4. Example implementation pattern:\n```javascript\nconst { getModelForRole, getParametersForRole, getLoggingConfig } = require('./config-manager');\nconst { resolveEnvVariable } = require('./environment-utils');\n\n// In the refactored function:\nconst researchModel = getModelForRole('research');\nconst { temperature, maxTokens } = getParametersForRole('research');\nconst apiKey = resolveEnvVariable('PERPLEXITY_API_KEY');\nconst { verbose } = getLoggingConfig();\n\n// Then use these variables in the API call configuration\n```\n5. Ensure the transition to generateObjectService maintains all existing functionality while leveraging the new configuration system\n</info added on 2025-04-20T03:54:26.882Z>", "status": "done", - "dependencies": ["61.23"], + "dependencies": [ + "61.23" + ], "parentTaskId": 61 }, { @@ -3290,7 +3904,9 @@ "description": "Update the `generateTaskDescriptionWithPerplexity` function in `ai-services.js` to first perform research and then use `generateObjectService` from `ai-services-unified.js` to generate the structured task description.", "details": "\n\n<info added on 2025-04-20T03:54:04.420Z>\nThe refactoring should incorporate the new configuration management system:\n\n1. Update imports to include the config-manager:\n```javascript\nconst { getModelForRole, getParametersForRole } = require('./config-manager');\n```\n\n2. Replace any hardcoded model selections or parameters with config-manager calls:\n```javascript\n// Replace direct model references like:\n// const model = \"perplexity-model-7b-online\" \n// With:\nconst model = getModelForRole('research');\nconst parameters = getParametersForRole('research');\n```\n\n3. For API key handling, use the resolveEnvVariable pattern:\n```javascript\nconst apiKey = resolveEnvVariable('PERPLEXITY_API_KEY');\n```\n\n4. When calling generateObjectService, pass the configuration-derived parameters:\n```javascript\nreturn generateObjectService({\n prompt: researchResults,\n schema: taskDescriptionSchema,\n role: 'taskDescription',\n // Config-driven parameters will be applied within generateObjectService\n});\n```\n\n5. Remove any hardcoded configuration values, ensuring all settings are retrieved from the centralized configuration system.\n</info added on 2025-04-20T03:54:04.420Z>", "status": "done", - "dependencies": ["61.23"], + "dependencies": [ + "61.23" + ], "parentTaskId": 61 }, { @@ -3299,7 +3915,9 @@ "description": "Update the logic that calls the AI after using `generateComplexityAnalysisPrompt` in `ai-services.js` to use the new `generateObjectService` from `ai-services-unified.js` with a Zod schema for the complexity report.", "details": "\n\n<info added on 2025-04-20T03:53:46.120Z>\nThe complexity analysis AI call should be updated to align with the new configuration system architecture. When refactoring to use `generateObjectService`, implement the following changes:\n\n1. Replace direct model references with calls to the appropriate config getter:\n ```javascript\n const modelName = getComplexityAnalysisModel(); // Use the specific getter from config-manager.js\n ```\n\n2. Retrieve AI parameters from the config system:\n ```javascript\n const temperature = getAITemperature('complexityAnalysis');\n const maxTokens = getAIMaxTokens('complexityAnalysis');\n ```\n\n3. When constructing the call to `generateObjectService`, pass these configuration values:\n ```javascript\n const result = await generateObjectService({\n prompt,\n schema: complexityReportSchema,\n modelName,\n temperature,\n maxTokens,\n sessionEnv: session?.env\n });\n ```\n\n4. Ensure API key resolution uses the `resolveEnvVariable` helper:\n ```javascript\n // Don't hardcode API keys or directly access process.env\n // The generateObjectService should handle this internally with resolveEnvVariable\n ```\n\n5. Add logging configuration based on settings:\n ```javascript\n const enableLogging = getAILoggingEnabled('complexityAnalysis');\n if (enableLogging) {\n // Use the logging mechanism defined in the configuration\n }\n ```\n</info added on 2025-04-20T03:53:46.120Z>", "status": "done", - "dependencies": ["61.23"], + "dependencies": [ + "61.23" + ], "parentTaskId": 61 }, { @@ -3308,7 +3926,9 @@ "description": "Update the logic that calls the AI after using `_buildAddTaskPrompt` in `ai-services.js` to use the new `generateObjectService` from `ai-services-unified.js` with a Zod schema for the single task object.", "details": "\n\n<info added on 2025-04-20T03:53:27.455Z>\nTo implement this refactoring, you'll need to:\n\n1. Replace direct AI calls with the new `generateObjectService` approach:\n ```javascript\n // OLD approach\n const aiResponse = await callLLM(prompt, modelName, temperature, maxTokens);\n const task = parseAIResponseToTask(aiResponse);\n \n // NEW approach using generateObjectService with config-manager\n import { generateObjectService } from '../services/ai-services-unified.js';\n import { getAIModelForRole, getAITemperature, getAIMaxTokens } from '../config/config-manager.js';\n import { taskSchema } from '../schemas/task-schema.js'; // Create this Zod schema for a single task\n \n const modelName = getAIModelForRole('taskCreation');\n const temperature = getAITemperature('taskCreation');\n const maxTokens = getAIMaxTokens('taskCreation');\n \n const task = await generateObjectService({\n prompt: _buildAddTaskPrompt(...),\n schema: taskSchema,\n modelName,\n temperature,\n maxTokens\n });\n ```\n\n2. Create a Zod schema for the task object in a new file `schemas/task-schema.js` that defines the expected structure.\n\n3. Ensure API key resolution uses the new pattern:\n ```javascript\n // This happens inside generateObjectService, but verify it uses:\n import { resolveEnvVariable } from '../config/config-manager.js';\n // Instead of direct process.env access\n ```\n\n4. Update any error handling to match the new service's error patterns.\n</info added on 2025-04-20T03:53:27.455Z>", "status": "done", - "dependencies": ["61.23"], + "dependencies": [ + "61.23" + ], "parentTaskId": 61 }, { @@ -3317,7 +3937,9 @@ "description": "Refactor functions like `sendChatWithContext` (and potentially related task update functions in `task-manager.js` if they make direct AI calls) to use `streamTextService` or `generateTextService` from `ai-services-unified.js`.", "details": "\n\n<info added on 2025-04-20T03:53:03.709Z>\nWhen refactoring `sendChatWithContext` and related functions, ensure they align with the new configuration system:\n\n1. Replace direct model references with config getter calls:\n ```javascript\n // Before\n const model = \"gpt-4\";\n \n // After\n import { getModelForRole } from './config-manager.js';\n const model = getModelForRole('chat'); // or appropriate role\n ```\n\n2. Extract AI parameters from config rather than hardcoding:\n ```javascript\n import { getAIParameters } from './config-manager.js';\n const { temperature, maxTokens } = getAIParameters('chat');\n ```\n\n3. When calling `streamTextService` or `generateTextService`, pass parameters from config:\n ```javascript\n await streamTextService({\n messages,\n model: getModelForRole('chat'),\n temperature: getAIParameters('chat').temperature,\n // other parameters as needed\n });\n ```\n\n4. For logging control, check config settings:\n ```javascript\n import { isLoggingEnabled } from './config-manager.js';\n \n if (isLoggingEnabled('aiCalls')) {\n console.log('AI request:', messages);\n }\n ```\n\n5. Ensure any default behaviors respect configuration defaults rather than hardcoded values.\n</info added on 2025-04-20T03:53:03.709Z>", "status": "done", - "dependencies": ["61.23"], + "dependencies": [ + "61.23" + ], "parentTaskId": 61 }, { @@ -3335,7 +3957,9 @@ "description": "Refactor the AI call within `updateSubtaskById` in `task-manager.js` (which generates additional information based on a prompt) to use the appropriate unified service function (e.g., `generateTextService`) from `ai-services-unified.js`.", "details": "\n\n<info added on 2025-04-20T03:52:28.196Z>\nThe `updateSubtaskById` function currently makes direct AI calls with hardcoded parameters. When refactoring to use the unified service:\n\n1. Replace direct OpenAI calls with `generateTextService` from `ai-services-unified.js`\n2. Use configuration parameters from `config-manager.js`:\n - Replace hardcoded model with `getMainModel()`\n - Use `getMainMaxTokens()` for token limits\n - Apply `getMainTemperature()` for response randomness\n3. Ensure prompt construction remains consistent but passes these dynamic parameters\n4. Handle API key resolution through the unified service (which uses `resolveEnvVariable`)\n5. Update error handling to work with the unified service response format\n6. If the function uses any logging, ensure it respects `getLoggingEnabled()` setting\n\nExample refactoring pattern:\n```javascript\n// Before\nconst completion = await openai.chat.completions.create({\n model: \"gpt-4\",\n temperature: 0.7,\n max_tokens: 1000,\n messages: [/* prompt messages */]\n});\n\n// After\nconst completion = await generateTextService({\n model: getMainModel(),\n temperature: getMainTemperature(),\n max_tokens: getMainMaxTokens(),\n messages: [/* prompt messages */]\n});\n```\n</info added on 2025-04-20T03:52:28.196Z>\n\n<info added on 2025-04-22T06:05:42.437Z>\n- When testing the non-streaming `generateTextService` call within `updateSubtaskById`, ensure that the function awaits the full response before proceeding with subtask updates. This allows you to validate that the unified service returns the expected structure (e.g., `completion.choices.message.content`) and that error handling logic correctly interprets any error objects or status codes returned by the service.\n\n- Mock or stub the `generateTextService` in unit tests to simulate both successful and failed completions. For example, verify that when the service returns a valid completion, the subtask is updated with the generated content, and when an error is returned, the error handling path is triggered and logged appropriately.\n\n- Confirm that the non-streaming mode does not emit partial results or require event-based handling; the function should only process the final, complete response.\n\n- Example test assertion:\n ```javascript\n // Mocked response from generateTextService\n const mockCompletion = {\n choices: [{ message: { content: \"Generated subtask details.\" } }]\n };\n generateTextService.mockResolvedValue(mockCompletion);\n\n // Call updateSubtaskById and assert the subtask is updated\n await updateSubtaskById(...);\n expect(subtask.details).toBe(\"Generated subtask details.\");\n ```\n\n- If the unified service supports both streaming and non-streaming modes, explicitly set or verify the `stream` parameter is `false` (or omitted) to ensure non-streaming behavior during these tests.\n</info added on 2025-04-22T06:05:42.437Z>\n\n<info added on 2025-04-22T06:20:19.747Z>\nWhen testing the non-streaming `generateTextService` call in `updateSubtaskById`, implement these verification steps:\n\n1. Add unit tests that verify proper parameter transformation between the old and new implementation:\n ```javascript\n test('should correctly transform parameters when calling generateTextService', async () => {\n // Setup mocks for config values\n jest.spyOn(configManager, 'getMainModel').mockReturnValue('gpt-4');\n jest.spyOn(configManager, 'getMainTemperature').mockReturnValue(0.7);\n jest.spyOn(configManager, 'getMainMaxTokens').mockReturnValue(1000);\n \n const generateTextServiceSpy = jest.spyOn(aiServices, 'generateTextService')\n .mockResolvedValue({ choices: [{ message: { content: 'test content' } }] });\n \n await updateSubtaskById(/* params */);\n \n // Verify the service was called with correct transformed parameters\n expect(generateTextServiceSpy).toHaveBeenCalledWith({\n model: 'gpt-4',\n temperature: 0.7,\n max_tokens: 1000,\n messages: expect.any(Array)\n });\n });\n ```\n\n2. Implement response validation to ensure the subtask content is properly extracted:\n ```javascript\n // In updateSubtaskById function\n try {\n const completion = await generateTextService({\n // parameters\n });\n \n // Validate response structure before using\n if (!completion?.choices?.[0]?.message?.content) {\n throw new Error('Invalid response structure from AI service');\n }\n \n // Continue with updating subtask\n } catch (error) {\n // Enhanced error handling\n }\n ```\n\n3. Add integration tests that verify the end-to-end flow with actual configuration values.\n</info added on 2025-04-22T06:20:19.747Z>\n\n<info added on 2025-04-22T06:23:23.247Z>\n<info added on 2025-04-22T06:35:14.892Z>\nWhen testing the non-streaming `generateTextService` call in `updateSubtaskById`, implement these specific verification steps:\n\n1. Create a dedicated test fixture that isolates the AI service interaction:\n ```javascript\n describe('updateSubtaskById AI integration', () => {\n beforeEach(() => {\n // Reset all mocks and spies\n jest.clearAllMocks();\n // Setup environment with controlled config values\n process.env.OPENAI_API_KEY = 'test-key';\n });\n \n // Test cases follow...\n });\n ```\n\n2. Test error propagation from the unified service:\n ```javascript\n test('should properly handle AI service errors', async () => {\n const mockError = new Error('Service unavailable');\n mockError.status = 503;\n jest.spyOn(aiServices, 'generateTextService').mockRejectedValue(mockError);\n \n // Capture console errors if needed\n const consoleSpy = jest.spyOn(console, 'error').mockImplementation();\n \n // Execute with error expectation\n await expect(updateSubtaskById(1, { prompt: 'test' })).rejects.toThrow();\n \n // Verify error was logged with appropriate context\n expect(consoleSpy).toHaveBeenCalledWith(\n expect.stringContaining('AI service error'),\n expect.objectContaining({ status: 503 })\n );\n });\n ```\n\n3. Verify that the function correctly preserves existing subtask content when appending new AI-generated information:\n ```javascript\n test('should preserve existing content when appending AI-generated details', async () => {\n // Setup mock subtask with existing content\n const mockSubtask = {\n id: 1,\n details: 'Existing details.\\n\\n'\n };\n \n // Mock database retrieval\n getSubtaskById.mockResolvedValue(mockSubtask);\n \n // Mock AI response\n generateTextService.mockResolvedValue({\n choices: [{ message: { content: 'New AI content.' } }]\n });\n \n await updateSubtaskById(1, { prompt: 'Enhance this subtask' });\n \n // Verify the update preserves existing content\n expect(updateSubtaskInDb).toHaveBeenCalledWith(\n 1,\n expect.objectContaining({\n details: expect.stringContaining('Existing details.\\n\\n<info added on')\n })\n );\n \n // Verify the new content was added\n expect(updateSubtaskInDb).toHaveBeenCalledWith(\n 1,\n expect.objectContaining({\n details: expect.stringContaining('New AI content.')\n })\n );\n });\n ```\n\n4. Test that the function correctly formats the timestamp and wraps the AI-generated content:\n ```javascript\n test('should format timestamp and wrap content correctly', async () => {\n // Mock date for consistent testing\n const mockDate = new Date('2025-04-22T10:00:00Z');\n jest.spyOn(global, 'Date').mockImplementation(() => mockDate);\n \n // Setup and execute test\n // ...\n \n // Verify correct formatting\n expect(updateSubtaskInDb).toHaveBeenCalledWith(\n expect.any(Number),\n expect.objectContaining({\n details: expect.stringMatching(\n /<info added on 2025-04-22T10:00:00\\.000Z>\\n.*\\n<\\/info added on 2025-04-22T10:00:00\\.000Z>/s\n )\n })\n );\n });\n ```\n\n5. Verify that the function correctly handles the case when no existing details are present:\n ```javascript\n test('should handle subtasks with no existing details', async () => {\n // Setup mock subtask with no details\n const mockSubtask = { id: 1 };\n getSubtaskById.mockResolvedValue(mockSubtask);\n \n // Execute test\n // ...\n \n // Verify details were initialized properly\n expect(updateSubtaskInDb).toHaveBeenCalledWith(\n 1,\n expect.objectContaining({\n details: expect.stringMatching(/^<info added on/)\n })\n );\n });\n ```\n</info added on 2025-04-22T06:35:14.892Z>\n</info added on 2025-04-22T06:23:23.247Z>", "status": "done", - "dependencies": ["61.23"], + "dependencies": [ + "61.23" + ], "parentTaskId": 61 }, { @@ -3442,7 +4066,9 @@ "title": "Implement Integration Tests for Unified AI Service", "description": "Implement integration tests for `ai-services-unified.js`. These tests should verify the correct routing to different provider modules based on configuration and ensure the unified service functions (`generateTextService`, `generateObjectService`, etc.) work correctly when called from modules like `task-manager.js`. [Updated: 5/2/2025] [Updated: 5/2/2025] [Updated: 5/2/2025] [Updated: 5/2/2025]", "status": "done", - "dependencies": ["61.18"], + "dependencies": [ + "61.18" + ], "details": "\n\n<info added on 2025-04-20T03:51:23.368Z>\nFor the integration tests of the Unified AI Service, consider the following implementation details:\n\n1. Setup test fixtures:\n - Create a mock `.taskmasterconfig` file with different provider configurations\n - Define test cases with various model selections and parameter settings\n - Use environment variable mocks only for API keys (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`)\n\n2. Test configuration resolution:\n - Verify that `ai-services-unified.js` correctly retrieves settings from `config-manager.js`\n - Test that model selection follows the hierarchy defined in `.taskmasterconfig`\n - Ensure fallback mechanisms work when primary providers are unavailable\n\n3. Mock the provider modules:\n ```javascript\n jest.mock('../services/openai-service.js');\n jest.mock('../services/anthropic-service.js');\n ```\n\n4. Test specific scenarios:\n - Provider selection based on configured preferences\n - Parameter inheritance from config (temperature, maxTokens)\n - Error handling when API keys are missing\n - Proper routing when specific models are requested\n\n5. Verify integration with task-manager:\n ```javascript\n test('task-manager correctly uses unified AI service with config-based settings', async () => {\n // Setup mock config with specific settings\n mockConfigManager.getAIProviderPreference.mockReturnValue(['openai', 'anthropic']);\n mockConfigManager.getModelForRole.mockReturnValue('gpt-4');\n mockConfigManager.getParametersForModel.mockReturnValue({ temperature: 0.7, maxTokens: 2000 });\n \n // Verify task-manager uses these settings when calling the unified service\n // ...\n });\n ```\n\n6. Include tests for configuration changes at runtime and their effect on service behavior.\n</info added on 2025-04-20T03:51:23.368Z>\n\n<info added on 2025-05-02T18:41:13.374Z>\n]\n{\n \"id\": 31,\n \"title\": \"Implement Integration Test for Unified AI Service\",\n \"description\": \"Implement integration tests for `ai-services-unified.js`. These tests should verify the correct routing to different provider module based on configuration and ensure the unified service function (`generateTextService`, `generateObjectService`, etc.) work correctly when called from module like `task-manager.js`.\",\n \"details\": \"\\n\\n<info added on 2025-04-20T03:51:23.368Z>\\nFor the integration test of the Unified AI Service, consider the following implementation details:\\n\\n1. Setup test fixture:\\n - Create a mock `.taskmasterconfig` file with different provider configuration\\n - Define test case with various model selection and parameter setting\\n - Use environment variable mock only for API key (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`)\\n\\n2. Test configuration resolution:\\n - Verify that `ai-services-unified.js` correctly retrieve setting from `config-manager.js`\\n - Test that model selection follow the hierarchy defined in `.taskmasterconfig`\\n - Ensure fallback mechanism work when primary provider are unavailable\\n\\n3. Mock the provider module:\\n ```javascript\\n jest.mock('../service/openai-service.js');\\n jest.mock('../service/anthropic-service.js');\\n ```\\n\\n4. Test specific scenario:\\n - Provider selection based on configured preference\\n - Parameter inheritance from config (temperature, maxToken)\\n - Error handling when API key are missing\\n - Proper routing when specific model are requested\\n\\n5. Verify integration with task-manager:\\n ```javascript\\n test('task-manager correctly use unified AI service with config-based setting', async () => {\\n // Setup mock config with specific setting\\n mockConfigManager.getAIProviderPreference.mockReturnValue(['openai', 'anthropic']);\\n mockConfigManager.getModelForRole.mockReturnValue('gpt-4');\\n mockConfigManager.getParameterForModel.mockReturnValue({ temperature: 0.7, maxToken: 2000 });\\n \\n // Verify task-manager use these setting when calling the unified service\\n // ...\\n });\\n ```\\n\\n6. Include test for configuration change at runtime and their effect on service behavior.\\n</info added on 2025-04-20T03:51:23.368Z>\\n[2024-01-15 10:30:45] A custom e2e script was created to test all the CLI command but that we'll need one to test the MCP too and that task 76 are dedicated to that\",\n \"status\": \"pending\",\n \"dependency\": [\n \"61.18\"\n ],\n \"parentTaskId\": 61\n}\n</info added on 2025-05-02T18:41:13.374Z>\n[2023-11-24 20:05:45] It's my birthday today\n[2023-11-24 20:05:46] add more low level details\n[2023-11-24 20:06:45] Additional low-level details for integration tests:\n\n- Ensure that each test case logs detailed output for each step, including configuration retrieval, provider selection, and API call results.\n- Implement a utility function to reset mocks and configurations between tests to avoid state leakage.\n- Use a combination of spies and mocks to verify that internal methods are called with expected arguments, especially for critical functions like `generateTextService`.\n- Consider edge cases such as empty configurations, invalid API keys, and network failures to ensure robustness.\n- Document each test case with expected outcomes and any assumptions made during the test design.\n- Leverage parallel test execution where possible to reduce test suite runtime, ensuring that tests are independent and do not interfere with each other.\n<info added on 2025-05-02T20:42:14.388Z>\n<info added on 2025-04-20T03:51:23.368Z>\nFor the integration tests of the Unified AI Service, consider the following implementation details:\n\n1. Setup test fixtures:\n - Create a mock `.taskmasterconfig` file with different provider configurations\n - Define test cases with various model selections and parameter settings\n - Use environment variable mocks only for API keys (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`)\n\n2. Test configuration resolution:\n - Verify that `ai-services-unified.js` correctly retrieves settings from `config-manager.js`\n - Test that model selection follows the hierarchy defined in `.taskmasterconfig`\n - Ensure fallback mechanisms work when primary providers are unavailable\n\n3. Mock the provider modules:\n ```javascript\n jest.mock('../services/openai-service.js');\n jest.mock('../services/anthropic-service.js');\n ```\n\n4. Test specific scenarios:\n - Provider selection based on configured preferences\n - Parameter inheritance from config (temperature, maxTokens)\n - Error handling when API keys are missing\n - Proper routing when specific models are requested\n\n5. Verify integration with task-manager:\n ```javascript\n test('task-manager correctly uses unified AI service with config-based settings', async () => {\n // Setup mock config with specific settings\n mockConfigManager.getAIProviderPreference.mockReturnValue(['openai', 'anthropic']);\n mockConfigManager.getModelForRole.mockReturnValue('gpt-4');\n mockConfigManager.getParametersForModel.mockReturnValue({ temperature: 0.7, maxTokens: 2000 });\n \n // Verify task-manager uses these settings when calling the unified service\n // ...\n });\n ```\n\n6. Include tests for configuration changes at runtime and their effect on service behavior.\n</info added on 2025-04-20T03:51:23.368Z>\n\n<info added on 2025-05-02T18:41:13.374Z>\n]\n{\n \"id\": 31,\n \"title\": \"Implement Integration Test for Unified AI Service\",\n \"description\": \"Implement integration tests for `ai-services-unified.js`. These tests should verify the correct routing to different provider module based on configuration and ensure the unified service function (`generateTextService`, `generateObjectService`, etc.) work correctly when called from module like `task-manager.js`.\",\n \"details\": \"\\n\\n<info added on 2025-04-20T03:51:23.368Z>\\nFor the integration test of the Unified AI Service, consider the following implementation details:\\n\\n1. Setup test fixture:\\n - Create a mock `.taskmasterconfig` file with different provider configuration\\n - Define test case with various model selection and parameter setting\\n - Use environment variable mock only for API key (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`)\\n\\n2. Test configuration resolution:\\n - Verify that `ai-services-unified.js` correctly retrieve setting from `config-manager.js`\\n - Test that model selection follow the hierarchy defined in `.taskmasterconfig`\\n - Ensure fallback mechanism work when primary provider are unavailable\\n\\n3. Mock the provider module:\\n ```javascript\\n jest.mock('../service/openai-service.js');\\n jest.mock('../service/anthropic-service.js');\\n ```\\n\\n4. Test specific scenario:\\n - Provider selection based on configured preference\\n - Parameter inheritance from config (temperature, maxToken)\\n - Error handling when API key are missing\\n - Proper routing when specific model are requested\\n\\n5. Verify integration with task-manager:\\n ```javascript\\n test('task-manager correctly use unified AI service with config-based setting', async () => {\\n // Setup mock config with specific setting\\n mockConfigManager.getAIProviderPreference.mockReturnValue(['openai', 'anthropic']);\\n mockConfigManager.getModelForRole.mockReturnValue('gpt-4');\\n mockConfigManager.getParameterForModel.mockReturnValue({ temperature: 0.7, maxToken: 2000 });\\n \\n // Verify task-manager use these setting when calling the unified service\\n // ...\\n });\\n ```\\n\\n6. Include test for configuration change at runtime and their effect on service behavior.\\n</info added on 2025-04-20T03:51:23.368Z>\\n[2024-01-15 10:30:45] A custom e2e script was created to test all the CLI command but that we'll need one to test the MCP too and that task 76 are dedicated to that\",\n \"status\": \"pending\",\n \"dependency\": [\n \"61.18\"\n ],\n \"parentTaskId\": 61\n}\n</info added on 2025-05-02T18:41:13.374Z>\n[2023-11-24 20:05:45] It's my birthday today\n[2023-11-24 20:05:46] add more low level details\n[2023-11-24 20:06:45] Additional low-level details for integration tests:\n\n- Ensure that each test case logs detailed output for each step, including configuration retrieval, provider selection, and API call results.\n- Implement a utility function to reset mocks and configurations between tests to avoid state leakage.\n- Use a combination of spies and mocks to verify that internal methods are called with expected arguments, especially for critical functions like `generateTextService`.\n- Consider edge cases such as empty configurations, invalid API keys, and network failures to ensure robustness.\n- Document each test case with expected outcomes and any assumptions made during the test design.\n- Leverage parallel test execution where possible to reduce test suite runtime, ensuring that tests are independent and do not interfere with each other.\n\n<info added on 2023-11-24T20:10:00.000Z>\n- Implement detailed logging for each API call, capturing request and response data to facilitate debugging.\n- Create a comprehensive test matrix to cover all possible combinations of provider configurations and model selections.\n- Use snapshot testing to verify that the output of `generateTextService` and `generateObjectService` remains consistent across code changes.\n- Develop a set of utility functions to simulate network latency and failures, ensuring the service handles such scenarios gracefully.\n- Regularly review and update test cases to reflect changes in the configuration management or provider APIs.\n- Ensure that all test data is anonymized and does not contain sensitive information.\n</info added on 2023-11-24T20:10:00.000Z>\n</info added on 2025-05-02T20:42:14.388Z>" }, { @@ -3451,7 +4077,9 @@ "description": "Update relevant documentation files (e.g., `architecture.mdc`, `taskmaster.mdc`, environment variable guides, README) to accurately reflect the new AI service architecture using `ai-services-unified.js`, provider modules, the Vercel AI SDK, and the updated configuration approach.", "details": "\n\n<info added on 2025-04-20T03:51:04.461Z>\nThe new AI architecture introduces a clear separation between sensitive credentials and configuration settings:\n\n## Environment Variables vs Configuration File\n\n- **Environment Variables (.env)**: \n - Store only sensitive API keys and credentials\n - Accessed via `resolveEnvVariable()` which checks both process.env and session.env\n - Example: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`\n - No model names, parameters, or non-sensitive settings should be here\n\n- **.taskmasterconfig File**:\n - Central location for all non-sensitive configuration\n - Structured JSON with clear sections for different aspects of the system\n - Contains:\n - Model mappings by role (e.g., `systemModels`, `userModels`)\n - Default parameters (temperature, maxTokens, etc.)\n - Logging preferences\n - Provider-specific settings\n - Accessed via getter functions from `config-manager.js` like:\n ```javascript\n import { getModelForRole, getDefaultTemperature } from './config-manager.js';\n \n // Usage examples\n const model = getModelForRole('system');\n const temp = getDefaultTemperature();\n ```\n\n## Implementation Notes\n- Document the structure of `.taskmasterconfig` with examples\n- Explain the migration path for users with existing setups\n- Include a troubleshooting section for common configuration issues\n- Add a configuration validation section explaining how the system verifies settings\n</info added on 2025-04-20T03:51:04.461Z>", "status": "done", - "dependencies": ["61.31"], + "dependencies": [ + "61.31" + ], "parentTaskId": 61 }, { @@ -3460,7 +4088,10 @@ "description": "After all other migration subtasks (refactoring, provider implementation, testing, documentation) are complete and verified, remove the old `ai-services.js` and `ai-client-factory.js` files from the `scripts/modules/` directory. Ensure no code still references them.", "details": "\n\n<info added on 2025-04-22T06:51:02.444Z>\nI'll provide additional technical information to enhance the \"Cleanup Old AI Service Files\" subtask:\n\n## Implementation Details\n\n**Pre-Cleanup Verification Steps:**\n- Run a comprehensive codebase search for any remaining imports or references to `ai-services.js` and `ai-client-factory.js` using grep or your IDE's search functionality[1][4]\n- Check for any dynamic imports that might not be caught by static analysis tools\n- Verify that all dependent modules have been properly migrated to the new AI service architecture\n\n**Cleanup Process:**\n- Create a backup of the files before deletion in case rollback is needed\n- Document the file removal in the migration changelog with timestamps and specific file paths[5]\n- Update any build configuration files that might reference these files (webpack configs, etc.)\n- Run a full test suite after removal to ensure no runtime errors occur[2]\n\n**Post-Cleanup Validation:**\n- Implement automated tests to verify the application functions correctly without the removed files\n- Monitor application logs and error reporting systems for 48-72 hours after deployment to catch any missed dependencies[3]\n- Perform a final code review to ensure clean architecture principles are maintained in the new implementation\n\n**Technical Considerations:**\n- Check for any circular dependencies that might have been created during the migration process\n- Ensure proper garbage collection by removing any cached instances of the old services\n- Verify that performance metrics remain stable after the removal of legacy code\n</info added on 2025-04-22T06:51:02.444Z>", "status": "done", - "dependencies": ["61.31", "61.32"], + "dependencies": [ + "61.31", + "61.32" + ], "parentTaskId": 61 }, { @@ -3596,7 +4227,9 @@ "id": 2, "title": "Implement conditional logic to bypass AI processing", "description": "Modify the update logic to check for the --simple flag and conditionally skip the AI processing pipeline when the flag is present.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "In the update handlers for both commands, add a condition to check if the --simple flag is set. If it is, create a path that bypasses the normal AI processing flow. This will require modifying the update functions to accept the flag parameter and branch the execution flow accordingly.", "status": "pending", "testStrategy": "Test that when the --simple flag is provided, the AI processing functions are not called, and when the flag is not provided, the normal AI processing flow is maintained." @@ -3605,7 +4238,9 @@ "id": 3, "title": "Format user input with timestamp for simple updates", "description": "Implement functionality to format the user's direct text input with a timestamp in the same format as AI-processed updates when the --simple flag is used.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Create a utility function that takes the user's raw input text and prepends a timestamp in the same format used for AI-generated updates. This function should be called when the --simple flag is active. Ensure the timestamp format is consistent with the existing format used throughout the application.", "status": "pending", "testStrategy": "Verify that the timestamp format matches the AI-generated updates and that the user's text is preserved exactly as entered." @@ -3614,7 +4249,9 @@ "id": 4, "title": "Add visual indicator for manual updates", "description": "Make simple updates visually distinguishable from AI-processed updates by adding a 'manual update' indicator or other visual differentiation.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Modify the update formatting to include a visual indicator (such as '[Manual Update]' prefix or different styling) when displaying updates that were created using the --simple flag. This will help users distinguish between AI-processed and manually entered updates.", "status": "pending", "testStrategy": "Check that updates made with the --simple flag are visually distinct from AI-processed updates when displayed in the task or subtask history." @@ -3623,7 +4260,10 @@ "id": 5, "title": "Implement storage of simple updates in history", "description": "Ensure that updates made with the --simple flag are properly saved to the task or subtask's history in the same way as AI-processed updates.", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "details": "Modify the storage logic to save the formatted simple updates to the task or subtask history. The storage format should be consistent with AI-processed updates, but include the manual indicator. Ensure that the update is properly associated with the correct task or subtask.", "status": "pending", "testStrategy": "Test that updates made with the --simple flag are correctly saved to the history and persist between application restarts." @@ -3632,7 +4272,9 @@ "id": 6, "title": "Update help documentation for the new flag", "description": "Update the help documentation for both update-task and update-subtask commands to include information about the new --simple flag.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Add clear descriptions of the --simple flag to the help text for both commands. The documentation should explain that the flag allows users to add timestamped notes without AI processing, directly using the text from the prompt. Include examples of how to use the flag.", "status": "pending", "testStrategy": "Verify that the help command correctly displays information about the --simple flag for both update commands." @@ -3641,7 +4283,13 @@ "id": 7, "title": "Implement integration tests for the simple update feature", "description": "Create comprehensive integration tests to verify that the --simple flag works correctly in both commands and integrates properly with the rest of the system.", - "dependencies": [1, 2, 3, 4, 5], + "dependencies": [ + 1, + 2, + 3, + 4, + 5 + ], "details": "Develop integration tests that verify the entire flow of using the --simple flag with both update commands. Tests should confirm that updates are correctly formatted, stored, and displayed. Include edge cases such as empty input, very long input, and special characters.", "status": "pending", "testStrategy": "Run integration tests that simulate user input with and without the --simple flag and verify the correct behavior in each case." @@ -3650,7 +4298,15 @@ "id": 8, "title": "Perform final validation and documentation", "description": "Conduct final validation of the feature across all use cases and update the user documentation to include the new functionality.", - "dependencies": [1, 2, 3, 4, 5, 6, 7], + "dependencies": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], "details": "Perform end-to-end testing of the feature to ensure it works correctly in all scenarios. Update the user documentation with detailed information about the new --simple flag, including its purpose, how to use it, and examples. Ensure that the documentation clearly explains the difference between AI-processed updates and simple updates.", "status": "pending", "testStrategy": "Manually test all use cases and review documentation for completeness and clarity." @@ -3680,7 +4336,9 @@ "id": 2, "title": "Ensure Package Scripts Compatibility with pnpm", "description": "Review and update package.json scripts to ensure they work seamlessly with pnpm's execution model. Confirm that any scripts responsible for showing a website or prompt during install behave identically with pnpm and npm. Ensure compatibility with 'module' package type and correct binary definitions.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Test all scripts using `pnpm run <script>`, address any pnpm-specific path or execution differences, and modify scripts as needed for compatibility. Pay special attention to any scripts that trigger a website or prompt during installation, ensuring they serve the same content as npm. Validate that scripts/init.js and binaries are referenced correctly for ESM ('module') projects.", "status": "done", "testStrategy": "Run all package scripts using pnpm and confirm expected behavior matches npm, especially for any website or UI shown during install. Validate correct execution of scripts/init.js and binary linking." @@ -3689,7 +4347,9 @@ "id": 3, "title": "Generate and Validate pnpm Lockfile", "description": "Install dependencies using pnpm to create a pnpm-lock.yaml file and ensure it accurately reflects the project's dependency tree, considering the 'module' package type.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Run `pnpm install` to generate the lockfile, check it into version control, and verify that dependency resolution is correct and consistent. Ensure that all dependencies listed in package.json are resolved as expected for an ESM project.", "status": "done", "testStrategy": "Compare dependency trees between npm and pnpm; ensure no missing or extraneous dependencies. Validate that the lockfile works for both CLI and init.js flows." @@ -3698,7 +4358,9 @@ "id": 4, "title": "Test Taskmaster Installation and Operation with pnpm", "description": "Thoroughly test Taskmaster's installation and CLI operation when installed via pnpm, both globally and locally. Confirm that any website or UI shown during installation is identical to npm. Validate that binaries and the init process (scripts/init.js) work as expected.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Perform global (`pnpm add -g taskmaster`) and local installations, verify CLI commands, and check for any pnpm-specific issues or incompatibilities. Ensure any installation UIs or websites appear identical to npm installations, including any website or prompt shown during install. Test that binaries 'task-master' and 'task-master-mcp' are linked and that scripts/init.js creates the correct structure and templates.", "status": "done", "testStrategy": "Document and resolve any errors encountered during installation or usage with pnpm. Compare the installation experience side-by-side with npm, including any website or UI shown during install. Validate directory and template setup as per scripts/init.js." @@ -3707,7 +4369,9 @@ "id": 5, "title": "Integrate pnpm into CI/CD Pipeline", "description": "Update CI/CD workflows to include pnpm in the test matrix, ensuring all tests pass when dependencies are installed with pnpm. Confirm that tests cover the 'module' package type, binaries, and init process.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Modify GitHub Actions or other CI configurations to use pnpm/action-setup, run tests with pnpm, and cache pnpm dependencies for efficiency. Ensure that CI covers CLI commands, binary linking, and the directory/template setup performed by scripts/init.js.", "status": "done", "testStrategy": "Confirm that CI passes for all supported package managers, including pnpm, and that pnpm-specific jobs are green. Validate that tests cover ESM usage, binaries, and init.js flows." @@ -3716,7 +4380,9 @@ "id": 6, "title": "Verify Installation UI/Website Consistency", "description": "Ensure any installation UIs, websites, or interactive prompts—including any website or prompt shown during install—appear and function identically when installing with pnpm compared to npm. Confirm that the experience is consistent for the 'module' package type and the init process.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Identify all user-facing elements during the installation process, including any website or prompt shown during install, and verify they are consistent across package managers. If a website is shown during installation, ensure it appears the same regardless of package manager used. Validate that any prompts or UIs triggered by scripts/init.js are identical.", "status": "done", "testStrategy": "Perform side-by-side installations with npm and pnpm, capturing screenshots of any UIs or websites for comparison. Test all interactive elements to ensure identical behavior, including any website or prompt shown during install and those from scripts/init.js." @@ -3725,7 +4391,9 @@ "id": 7, "title": "Test init.js Script with pnpm", "description": "Verify that the scripts/init.js file works correctly when Taskmaster is installed via pnpm, creating the proper directory structure and copying all required templates as defined in the project structure.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Test the init command to ensure it properly creates .cursor/rules, scripts, and tasks directories, copies templates (.env.example, .gitignore, rule files, dev.js), handles package.json merging, and sets up MCP config (.cursor/mcp.json) as per scripts/init.js.", "status": "done", "testStrategy": "Run the init command after installing with pnpm and verify all directories and files are created correctly. Compare the results with an npm installation to ensure identical behavior and structure." @@ -3734,7 +4402,9 @@ "id": 8, "title": "Verify Binary Links with pnpm", "description": "Ensure that the task-master and task-master-mcp binaries are properly defined in package.json, linked, and executable when installed via pnpm, in both global and local installations.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Check that the binaries defined in package.json are correctly linked in node_modules/.bin when installed with pnpm, and that they can be executed without errors. Validate that binaries work for ESM ('module') projects and are accessible after both global and local installs.", "status": "done", "testStrategy": "Install Taskmaster with pnpm and verify that the binaries are accessible and executable. Test both global and local installations, ensuring correct behavior for ESM projects." @@ -3764,7 +4434,9 @@ "id": 2, "title": "Add Yarn-Specific Configuration Files", "description": "Introduce Yarn-specific configuration files such as .yarnrc.yml if needed to optimize Yarn behavior and ensure consistent installs for 'module' package type and binary definitions.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Determine if Yarn v2+ (Berry) or classic requires additional configuration for the project, and add or update .yarnrc.yml or .yarnrc files accordingly. Ensure configuration supports ESM and binary linking.", "status": "done", "testStrategy": "Verify that Yarn respects the configuration by running installs and checking for expected behaviors (e.g., plug'n'play, nodeLinker settings, ESM support, binary linking)." @@ -3773,7 +4445,9 @@ "id": 3, "title": "Test and Fix Yarn Compatibility for Scripts and CLI", "description": "Ensure all scripts, post-install hooks, and CLI commands function correctly when Taskmaster is installed and managed via Yarn. Confirm that any website or UI shown during installation is identical to npm. Validate that binaries and the init process (scripts/init.js) work as expected.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Test all lifecycle scripts, post-install actions, and CLI commands using Yarn. Address any issues related to environment variables, script execution, or dependency hoisting. Ensure any website or prompt shown during install is the same as with npm. Validate that binaries 'task-master' and 'task-master-mcp' are linked and that scripts/init.js creates the correct structure and templates.", "status": "done", "testStrategy": "Install Taskmaster using Yarn and run all documented scripts and CLI commands, comparing results to npm installations, especially for any website or UI shown during install. Validate directory and template setup as per scripts/init.js." @@ -3782,7 +4456,9 @@ "id": 4, "title": "Update Documentation for Yarn Installation and Usage", "description": "Revise installation and usage documentation to include clear instructions for installing and managing Taskmaster with Yarn. Clearly state that the installation process, including any website or UI shown, is identical to npm. Ensure documentation reflects the use of 'module' package type, binaries, and the init process as defined in scripts/init.js. If the installation process includes a website component or requires account setup, document the steps users must follow. If not, explicitly state that no website or account setup is required.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Add Yarn-specific installation commands, troubleshooting tips, and notes on version compatibility to the README and any relevant docs. Document that any installation website or prompt is the same as with npm. Include notes on the 'module' package type, binaries, and the directory/template setup performed by scripts/init.js. If website or account setup is required during installation, provide clear instructions; otherwise, confirm and document that no such steps are needed.", "status": "done", "testStrategy": "Review documentation for accuracy and clarity; have a user follow the Yarn instructions to verify successful installation and usage. Confirm that documentation explicitly states the identical experience for npm and Yarn, including any website or UI shown during install, and describes the init process and binaries. If website/account setup is required, verify that instructions are complete and accurate; if not, confirm this is documented." @@ -3791,7 +4467,9 @@ "id": 5, "title": "Implement and Test Package Manager Detection Logic", "description": "Update or add logic in the codebase to detect Yarn installations and handle Yarn-specific behaviors, ensuring feature parity across package managers. Ensure detection logic works for 'module' package type and binary definitions.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Modify detection logic to recognize Yarn (classic and berry), handle lockfile generation, and resolve any Yarn-specific package resolution or hoisting issues. Ensure detection logic supports ESM and binary linking.", "status": "done", "testStrategy": "Install Taskmaster using npm, pnpm, and Yarn (classic and berry), verifying that the application detects the package manager correctly and behaves consistently for ESM projects and binaries." @@ -3800,7 +4478,9 @@ "id": 6, "title": "Verify Installation UI/Website Consistency", "description": "Ensure any installation UIs, websites, or interactive prompts—including any website or prompt shown during install—appear and function identically when installing with Yarn compared to npm. Confirm that the experience is consistent for the 'module' package type and the init process. If the installation process includes a website or account setup, verify that all required website actions (e.g., account creation, login) are consistent and documented. If not, confirm and document that no website or account setup is needed.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Identify all user-facing elements during the installation process, including any website or prompt shown during install, and verify they are consistent across package managers. If a website is shown during installation or account setup is required, ensure it appears and functions the same regardless of package manager used, and document the steps. If not, confirm and document that no website or account setup is needed. Validate that any prompts or UIs triggered by scripts/init.js are identical.", "status": "done", "testStrategy": "Perform side-by-side installations with npm and Yarn, capturing screenshots of any UIs or websites for comparison. Test all interactive elements to ensure identical behavior, including any website or prompt shown during install and those from scripts/init.js. If website/account setup is required, verify and document the steps; if not, confirm this is documented." @@ -3809,7 +4489,9 @@ "id": 7, "title": "Test init.js Script with Yarn", "description": "Verify that the scripts/init.js file works correctly when Taskmaster is installed via Yarn, creating the proper directory structure and copying all required templates as defined in the project structure.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Test the init command to ensure it properly creates .cursor/rules, scripts, and tasks directories, copies templates (.env.example, .gitignore, rule files, dev.js), handles package.json merging, and sets up MCP config (.cursor/mcp.json) as per scripts/init.js.", "status": "done", "testStrategy": "Run the init command after installing with Yarn and verify all directories and files are created correctly. Compare the results with an npm installation to ensure identical behavior and structure." @@ -3818,7 +4500,9 @@ "id": 8, "title": "Verify Binary Links with Yarn", "description": "Ensure that the task-master and task-master-mcp binaries are properly defined in package.json, linked, and executable when installed via Yarn, in both global and local installations.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Check that the binaries defined in package.json are correctly linked in node_modules/.bin when installed with Yarn, and that they can be executed without errors. Validate that binaries work for ESM ('module') projects and are accessible after both global and local installs.", "status": "done", "testStrategy": "Install Taskmaster with Yarn and verify that the binaries are accessible and executable. Test both global and local installations, ensuring correct behavior for ESM projects." @@ -3827,7 +4511,9 @@ "id": 9, "title": "Test Website Account Setup with Yarn", "description": "If the installation process includes a website component, verify that account setup, registration, or any other user-specific configurations work correctly when Taskmaster is installed via Yarn. If no website or account setup is required, confirm and document this explicitly.", - "dependencies": [6], + "dependencies": [ + 6 + ], "details": "Test the complete user flow for any website component that appears during installation, including account creation, login, and configuration steps. Ensure that all website interactions work identically with Yarn as they do with npm or pnpm. Document any website-specific steps that users need to complete during the installation process. If no website or account setup is required, confirm and document this.\n\n<info added on 2025-04-25T08:45:48.709Z>\nSince the request is vague, I'll provide helpful implementation details for testing website account setup with Yarn:\n\nFor thorough testing, create a test matrix covering different browsers (Chrome, Firefox, Safari) and operating systems (Windows, macOS, Linux). Document specific Yarn-related environment variables that might affect website connectivity. Use tools like Playwright or Cypress to automate the account setup flow testing, capturing screenshots at each step for documentation. Implement network throttling tests to verify behavior under poor connectivity. Create a checklist of all UI elements that should be verified during the account setup process, including form validation, error messages, and success states. If no website component exists, explicitly document this in the project README and installation guides to prevent user confusion.\n</info added on 2025-04-25T08:45:48.709Z>\n\n<info added on 2025-04-25T08:46:08.651Z>\n- For environments where the website component requires integration with external authentication providers (such as OAuth, SSO, or LDAP), ensure that these flows are tested specifically when Taskmaster is installed via Yarn. Validate that redirect URIs, token exchanges, and session persistence behave as expected across all supported browsers.\n\n- If the website setup involves configuring application pools or web server settings (e.g., with IIS), document any Yarn-specific considerations, such as environment variable propagation or file permission differences, that could affect the web service's availability or configuration[2].\n\n- When automating tests, include validation for accessibility compliance (e.g., using axe-core or Lighthouse) during the account setup process to ensure the UI is usable for all users.\n\n- Capture and log all HTTP requests and responses during the account setup flow to help diagnose any discrepancies between Yarn and other package managers. This can be achieved by enabling network logging in Playwright or Cypress test runs.\n\n- If the website component supports batch operations or automated uploads (such as uploading user data or configuration files), verify that these automation features function identically after installation with Yarn[3].\n\n- For documentation, provide annotated screenshots or screen recordings of the account setup process, highlighting any Yarn-specific prompts, warnings, or differences encountered.\n\n- If the website component is not required, add a badge or prominent note in the README and installation guides stating \"No website or account setup required,\" and reference the test results confirming this.\n</info added on 2025-04-25T08:46:08.651Z>\n\n<info added on 2025-04-25T17:04:12.550Z>\nFor clarity, this task does not involve setting up a Yarn account. Yarn itself is just a package manager that doesn't require any account creation. The task is about testing whether any website component that is part of Taskmaster (if one exists) works correctly when Taskmaster is installed using Yarn as the package manager.\n\nTo be specific:\n- You don't need to create a Yarn account\n- Yarn is simply the tool used to install Taskmaster (`yarn add taskmaster` instead of `npm install taskmaster`)\n- The testing focuses on whether any web interfaces or account setup processes that are part of Taskmaster itself function correctly when the installation was done via Yarn\n- If Taskmaster includes a web dashboard or requires users to create accounts within the Taskmaster system, those features should be tested\n\nIf you're uncertain whether Taskmaster includes a website component at all, the first step would be to check the project documentation or perform an initial installation to determine if any web interface exists.\n</info added on 2025-04-25T17:04:12.550Z>\n\n<info added on 2025-04-25T17:19:03.256Z>\nWhen testing website account setup with Yarn after the codebase refactor, pay special attention to:\n\n- Verify that any environment-specific configuration files (like `.env` or config JSON files) are properly loaded when the application is installed via Yarn\n- Test the session management implementation to ensure user sessions persist correctly across page refreshes and browser restarts\n- Check that any database migrations or schema updates required for account setup execute properly when installed via Yarn\n- Validate that client-side form validation logic works consistently with server-side validation\n- Ensure that any WebSocket connections for real-time features initialize correctly after the refactor\n- Test account deletion and data export functionality to verify GDPR compliance remains intact\n- Document any changes to the authentication flow that resulted from the refactor and confirm they work identically with Yarn installation\n</info added on 2025-04-25T17:19:03.256Z>\n\n<info added on 2025-04-25T17:22:05.951Z>\nWhen testing website account setup with Yarn after the logging fix, implement these additional verification steps:\n\n1. Verify that all account-related actions are properly logged with the correct log levels (debug, info, warn, error) according to the updated logging framework\n2. Test the error handling paths specifically - force authentication failures and verify the logs contain sufficient diagnostic information\n3. Check that sensitive user information is properly redacted in logs according to privacy requirements\n4. Confirm that log rotation and persistence work correctly when high volumes of authentication attempts occur\n5. Validate that any custom logging middleware correctly captures HTTP request/response data for account operations\n6. Test that log aggregation tools (if used) can properly parse and display the account setup logs in their expected format\n7. Verify that performance metrics for account setup flows are correctly captured in logs for monitoring purposes\n8. Document any Yarn-specific environment variables that affect the logging configuration for the website component\n</info added on 2025-04-25T17:22:05.951Z>\n\n<info added on 2025-04-25T17:22:46.293Z>\nWhen testing website account setup with Yarn, consider implementing a positive user experience validation:\n\n1. Measure and document time-to-completion for the account setup process to ensure it meets usability standards\n2. Create a satisfaction survey for test users to rate the account setup experience on a 1-5 scale\n3. Implement A/B testing for different account setup flows to identify the most user-friendly approach\n4. Add delightful micro-interactions or success animations that make the setup process feel rewarding\n5. Test the \"welcome\" or \"onboarding\" experience that follows successful account creation\n6. Ensure helpful tooltips and contextual help are displayed at appropriate moments during setup\n7. Verify that error messages are friendly, clear, and provide actionable guidance rather than technical jargon\n8. Test the account recovery flow to ensure users have a smooth experience if they forget credentials\n</info added on 2025-04-25T17:22:46.293Z>", "status": "done", "testStrategy": "Perform a complete installation with Yarn and follow through any website account setup process. Compare the experience with npm installation to ensure identical behavior. Test edge cases such as account creation failures, login issues, and configuration changes. If no website or account setup is required, confirm and document this in the test results." @@ -3856,7 +4542,9 @@ "id": 2, "title": "Update installation scripts for Bun compatibility", "description": "Modify the existing installation scripts to detect and support Bun as a runtime environment.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Add Bun detection logic to installation scripts. Update package management commands to use Bun equivalents where needed. Ensure all dependencies are compatible with Bun. Modify any Node.js-specific code to work with Bun's runtime.", "status": "done" }, @@ -3864,7 +4552,9 @@ "id": 3, "title": "Create Bun-specific installation path", "description": "Implement a dedicated installation flow for Bun users that optimizes for Bun's capabilities.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Create a Bun-specific installation script that leverages Bun's performance advantages. Update any environment detection logic to properly identify Bun environments. Ensure proper path resolution and environment variable handling for Bun.", "status": "done" }, @@ -3872,7 +4562,9 @@ "id": 4, "title": "Test Taskmaster installation with Bun", "description": "Perform comprehensive testing of the installation process using Bun across different operating systems.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Test installation on Windows, macOS, and Linux using Bun. Verify that all Taskmaster features work correctly when installed via Bun. Document any issues encountered and implement fixes as needed.", "status": "done" }, @@ -3880,7 +4572,9 @@ "id": 5, "title": "Test Taskmaster operation with Bun", "description": "Ensure all Taskmaster functionality works correctly when running under Bun.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Test all Taskmaster commands and features when running with Bun. Compare performance metrics between Node.js and Bun. Identify and fix any runtime issues specific to Bun. Ensure all plugins and extensions are compatible.", "status": "done" }, @@ -3888,7 +4582,10 @@ "id": 6, "title": "Update documentation for Bun support", "description": "Update all relevant documentation to include information about installing and running Taskmaster with Bun.", - "dependencies": [4, 5], + "dependencies": [ + 4, + 5 + ], "details": "Add Bun installation instructions to README and documentation. Document any Bun-specific considerations or limitations. Update troubleshooting guides to include Bun-specific issues. Create examples showing Bun usage with Taskmaster.", "status": "done" } @@ -3928,7 +4625,9 @@ "id": 2, "title": "Extend JSON Output to All Relevant Commands and Ensure Schema Consistency", "description": "Apply the JSON output pattern established in subtask 1 to all other relevant Taskmaster CLI commands that display data (e.g., `list`, `status`, etc.). Ensure the JSON structure is consistent where applicable (e.g., task objects should have the same fields). Add help text mentioning the `--json` flag for each modified command.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "1. Create a JSON schema definition file at `src/schemas/task.json` to define the standard structure for task objects\n2. Modify the following command files to support the `--json` flag:\n - `src/commands/list.js`\n - `src/commands/status.js`\n - `src/commands/search.js`\n - `src/commands/summary.js`\n3. Refactor the `formatAsJson` utility to handle different data types (single task, task array, status object, etc.)\n4. Add a `validateJsonSchema` function in `src/utils/validation.js` to ensure output conforms to defined schemas\n5. Update each command's help text documentation to include the `--json` flag description\n6. Implement consistent error handling for JSON output (using a standard error object format)\n7. For list-type commands, ensure array outputs are properly formatted as JSON arrays", "status": "pending", "testStrategy": "1. Create unit tests for each modified command in their respective test files\n2. Test each command with the `--json` flag and validate output against the defined schemas\n3. Create specific test cases for edge conditions (empty lists, error states, etc.)\n4. Verify help text includes `--json` documentation for each command\n5. Test piping JSON output to tools like `jq` to confirm proper formatting\n6. Create integration tests that verify schema consistency across different commands" @@ -3946,7 +4645,9 @@ "id": 4, "title": "Implement Keybinding File Handling and Backup Logic", "description": "Implement the core logic within the `install-keybindings` command to read the target `keybindings.json` file. If it exists, create a backup. If it doesn't exist, create a new file with an empty JSON array `[]`. Prepare the structure to add new keybindings.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "1. Create a `KeybindingsManager` class in `src/utils/keybindings.js` with the following methods:\n - `checkFileExists(path)`: Verify if the keybindings file exists\n - `createBackup(path)`: Copy existing file to `keybindings.json.bak`\n - `readKeybindings(path)`: Read and parse the JSON file\n - `writeKeybindings(path, data)`: Serialize and write data to the file\n - `createEmptyFile(path)`: Create a new file with `[]` content\n2. In the command handler, use these methods to:\n - Check if the target file exists\n - Create a backup if it does (with timestamp in filename)\n - Read existing keybindings or create an empty file\n - Parse the JSON content with proper error handling\n3. Add a `--no-backup` flag to skip backup creation\n4. Implement verbose logging with a `--verbose` flag\n5. Handle all potential file system errors (permissions, disk space, etc.)\n6. Add a `--dry-run` option that shows what would be done without making changes", "status": "pending", "testStrategy": "1. Create unit tests for the `KeybindingsManager` class\n2. Test all file handling scenarios with mocked file system:\n - File exists with valid JSON\n - File exists with invalid JSON\n - File doesn't exist\n - File exists but is not writable\n - Backup creation succeeds/fails\n3. Test the `--no-backup` and `--dry-run` flags\n4. Verify error messages are clear and actionable\n5. Test with various mock file contents to ensure proper parsing" @@ -3955,7 +4656,9 @@ "id": 5, "title": "Add Taskmaster Keybindings, Prevent Duplicates, and Support Customization", "description": "Define the specific Taskmaster keybindings (e.g., next task to clipboard, status update, open agent chat) and implement the logic to merge them into the user's `keybindings.json` data. Prevent adding duplicate keybindings (based on command ID or key combination). Add support for custom key combinations via command flags.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "1. Define default Taskmaster keybindings in `src/config/default-keybindings.js` as an array of objects with:\n - `key`: Default key combination (e.g., `\"ctrl+alt+n\"`)\n - `command`: Cursor command ID (e.g., `\"taskmaster.nextTask\"`)\n - `when`: Context when keybinding is active (e.g., `\"editorTextFocus\"`)\n - `args`: Any command arguments as an object\n - `description`: Human-readable description of what the keybinding does\n2. Implement the following keybindings:\n - Next task to clipboard: `ctrl+alt+n`\n - Update task status: `ctrl+alt+u`\n - Open agent chat with task context: `ctrl+alt+a`\n - Show task details: `ctrl+alt+d`\n3. Add command-line options to customize each keybinding:\n - `--next-key=\"ctrl+alt+n\"`\n - `--update-key=\"ctrl+alt+u\"`\n - `--agent-key=\"ctrl+alt+a\"`\n - `--details-key=\"ctrl+alt+d\"`\n4. Implement a `mergeKeybindings(existing, new)` function that:\n - Checks for duplicates based on command ID\n - Checks for key combination conflicts\n - Warns about conflicts but allows override with `--force` flag\n - Preserves existing non-Taskmaster keybindings\n5. Add a `--reset` flag to remove all existing Taskmaster keybindings before adding new ones\n6. Add a `--list` option to display currently installed Taskmaster keybindings\n7. Implement an `--uninstall` option to remove all Taskmaster keybindings", "status": "pending", "testStrategy": "1. Create unit tests for the keybinding merging logic\n2. Test duplicate detection and conflict resolution\n3. Test each customization flag to verify it properly overrides defaults\n4. Test the `--reset`, `--list`, and `--uninstall` options\n5. Create integration tests with various starting keybindings.json states\n6. Manually verify the installed keybindings work in Cursor\n7. Test edge cases like:\n - All keybindings customized\n - Conflicting key combinations with `--force` and without\n - Empty initial keybindings file\n - File with existing Taskmaster keybindings" @@ -3984,7 +4687,9 @@ "id": 2, "title": "Implement task saving functionality", "description": "Develop the backend functionality to save manually created tasks to the database", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Create API endpoints to handle task creation requests from the frontend. Implement data validation, error handling, and confirmation messages. Ensure the saved tasks appear in the task list view and can be edited or deleted like PRD-parsed tasks.", "status": "done" } @@ -4012,7 +4717,9 @@ "id": 2, "title": "Update CLI interface for task-specific complexity analysis", "description": "Extend the CLI to accept task IDs or ranges as parameters for the complexity analysis command", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Add new flags `--id/-i`, `--from/-f`, and `--to/-t` to the CLI that allow users to specify task IDs or ranges for targeted complexity analysis. Update the command parser, help documentation, and ensure proper validation of the provided values.", "status": "done" }, @@ -4020,7 +4727,9 @@ "id": 3, "title": "Integrate task-specific analysis with MCP tool", "description": "Update the MCP tool interface to support analyzing complexity for specific tasks or ranges", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Modify the MCP tool's API endpoints and UI components to allow users to select specific tasks or ranges for complexity analysis. Ensure the UI provides clear feedback about which tasks are being analyzed and update the visualization components to properly display partial analysis results.", "status": "done" }, @@ -4028,7 +4737,11 @@ "id": 4, "title": "Create comprehensive tests for task-specific complexity analysis", "description": "Develop test cases to verify the correct functioning of task-specific complexity analysis", - "dependencies": [1, 2, 3], + "dependencies": [ + 1, + 2, + 3 + ], "details": "Create unit and integration tests that verify the task-specific complexity analysis works correctly across both CLI and MCP interfaces. Include tests for edge cases such as invalid task IDs, tasks with dependencies outside the selected set, and performance tests for large task sets.", "status": "done" } @@ -4056,7 +4769,9 @@ "id": 2, "title": "Implement Mermaid diagram generation core functionality", "description": "Create the core logic to parse Mermaid syntax and generate diagram output", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Integrate with the Mermaid library to parse diagram syntax. Implement error handling for invalid syntax. Create the rendering pipeline to generate the diagram in memory before output. Support all standard Mermaid diagram types (flowchart, sequence, class, etc.). Include proper logging for the generation process.", "status": "pending" }, @@ -4064,7 +4779,9 @@ "id": 3, "title": "Develop output handling mechanisms", "description": "Implement different output options for the generated diagrams", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Create handlers for different output formats (SVG, PNG, PDF). Implement file output with appropriate naming conventions and directory handling. Add clipboard support for direct pasting. Implement stdout output for piping to other commands. Include progress indicators for longer rendering operations.", "status": "pending" }, @@ -4072,7 +4789,9 @@ "id": 4, "title": "Create documentation and examples", "description": "Provide comprehensive documentation and examples for the 'diagram' command", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Write detailed command documentation with all options explained. Create example diagrams covering different diagram types. Include troubleshooting section for common errors. Add documentation on extending the command with custom themes or templates. Create integration examples showing how to use the command in workflows with other tools.", "status": "pending" } @@ -4111,7 +4830,9 @@ "id": 2, "title": "Design PDF template and layout", "description": "Create a template design for the project progress PDF including sections for summary, metrics, and dependency visualization", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Design should include header/footer, progress summary section, key metrics visualization, dependency diagram placement, and styling guidelines. Create a mockup of the final PDF output for approval.", "status": "pending" }, @@ -4119,7 +4840,9 @@ "id": 3, "title": "Implement project progress data collection module", "description": "Develop functionality to gather and process project data for the PDF report", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Create functions to extract task completion percentages, milestone status, timeline adherence, and other relevant metrics from the project database. Include data transformation logic to prepare for PDF rendering.", "status": "pending" }, @@ -4127,7 +4850,10 @@ "id": 4, "title": "Integrate with dependency visualization system", "description": "Connect to the existing diagram command to generate visual representation of task dependencies", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "details": "Implement adapter for the diagram command output to be compatible with the PDF generation library. Handle different scales of dependency chains and ensure proper rendering of complex relationships.", "status": "pending" }, @@ -4135,7 +4861,11 @@ "id": 5, "title": "Build PDF generation core functionality", "description": "Develop the main module that combines data and visualizations into a formatted PDF document", - "dependencies": [2, 3, 4], + "dependencies": [ + 2, + 3, + 4 + ], "details": "Implement the core PDF generation logic using the selected library. Include functions for adding text sections, embedding visualizations, formatting tables, and applying the template design. Add pagination and document metadata.", "status": "pending" }, @@ -4143,7 +4873,9 @@ "id": 6, "title": "Create export options and command interface", "description": "Implement user-facing commands and options for generating and saving PDF reports", - "dependencies": [5], + "dependencies": [ + 5 + ], "details": "Develop CLI commands for PDF generation with parameters for customization (time period, detail level, etc.). Include options for automatic saving to specified locations, email distribution, and integration with existing project workflows.", "status": "pending" } @@ -4203,7 +4935,9 @@ "id": 2, "title": "Implement conditional logic for research role detection", "description": "Create logic to detect when a conversation is in 'research mode' and should trigger the Google Search Grounding functionality.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Develop heuristics or machine learning-based detection to identify when a user's query requires research capabilities. Implement a decision tree that determines when to activate Google Search Grounding based on conversation context, explicit user requests for research, or specific keywords. Include configuration options to adjust sensitivity of the detection mechanism.", "status": "pending" }, @@ -4211,7 +4945,9 @@ "id": 3, "title": "Update supported models configuration", "description": "Modify the model configuration to specify which AI models can utilize the Google Search Grounding capability.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Update the model configuration files to include flags for Google Search Grounding compatibility. Create a registry of supported models with their specific parameters for optimal integration with the search API. Implement version checking to ensure compatibility between model versions and the Google Search Grounding API version.", "status": "pending" }, @@ -4219,7 +4955,11 @@ "id": 4, "title": "Create end-to-end testing suite for research functionality", "description": "Develop comprehensive tests to verify the correct operation of the Google Search Grounding integration in research contexts.", - "dependencies": [1, 2, 3], + "dependencies": [ + 1, + 2, + 3 + ], "details": "Build automated test cases that cover various research scenarios, including edge cases. Create mock responses for the Google Search API to enable testing without actual API calls. Implement integration tests that verify the entire flow from user query to research-enhanced response. Include performance benchmarks to ensure the integration doesn't significantly impact response times.", "status": "pending" } @@ -4247,7 +4987,9 @@ "id": 2, "title": "Implement FastMCP Server Launcher", "description": "Create a component that can programmatically launch and manage the FastMCP server process over stdio", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Develop a module that can spawn the FastMCP server as a child process, establish stdio communication channels, handle process lifecycle events, and implement proper cleanup procedures. Include error handling for process failures and timeout mechanisms.", "status": "pending" }, @@ -4255,7 +4997,9 @@ "id": 3, "title": "Develop Message Protocol Handler", "description": "Implement a handler that can serialize/deserialize messages according to the FastMCP protocol specification", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Create a protocol handler that formats outgoing messages and parses incoming messages according to the FastMCP protocol. Implement validation for message format compliance and error handling for malformed messages. Support all required message types defined in the protocol.", "status": "pending" }, @@ -4263,7 +5007,9 @@ "id": 4, "title": "Create Request/Response Correlation Mechanism", "description": "Implement a system to track and correlate requests with their corresponding responses", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Develop a correlation mechanism using unique identifiers to match requests with their responses. Implement timeout handling for unresponded requests and proper error propagation. Design the API to support both synchronous and asynchronous request patterns.", "status": "pending" }, @@ -4271,7 +5017,10 @@ "id": 5, "title": "Build Test Assertion Framework", "description": "Create a set of assertion utilities specific to FastMCP server testing", - "dependencies": [3, 4], + "dependencies": [ + 3, + 4 + ], "details": "Develop assertion utilities that can validate server responses against expected values, verify timing constraints, and check for proper error handling. Include support for complex response validation patterns and detailed failure reporting.", "status": "pending" }, @@ -4279,7 +5028,11 @@ "id": 6, "title": "Implement Test Cases", "description": "Develop a comprehensive set of test cases covering all FastMCP server functionality", - "dependencies": [2, 4, 5], + "dependencies": [ + 2, + 4, + 5 + ], "details": "Create test cases for basic server operations, error conditions, edge cases, and performance scenarios. Organize tests into logical groups and ensure proper isolation between test cases. Include documentation for each test explaining its purpose and expected outcomes.", "status": "pending" }, @@ -4287,7 +5040,9 @@ "id": 7, "title": "Create CI Integration and Documentation", "description": "Set up continuous integration for the test framework and create comprehensive documentation", - "dependencies": [6], + "dependencies": [ + 6 + ], "details": "Configure the test framework to run in CI environments, generate reports, and fail builds appropriately. Create documentation covering framework architecture, usage instructions, test case development guidelines, and troubleshooting procedures. Include examples of extending the framework for new test scenarios.", "status": "pending" } @@ -4316,7 +5071,9 @@ "id": 2, "title": "Implement secure telemetry transmission", "description": "Create a secure mechanism to transmit telemetry data to the external analytics endpoint", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Implement HTTPS POST request functionality to securely send the telemetry payload to the closed-source analytics API. Include proper encryption in transit using TLS. Implement retry logic and graceful fallback mechanisms for handling transmission failures due to connectivity issues.\n<info added on 2025-05-14T17:52:40.647Z>\nTo securely send structured JSON telemetry payloads from a Node.js CLI tool to an external analytics backend, follow these steps:\n\n1. Use the Axios library for HTTPS POST requests. Install it with: npm install axios.\n2. Store sensitive configuration such as the analytics endpoint URL and any secret keys in environment variables (e.g., process.env.ANALYTICS_URL, process.env.ANALYTICS_KEY). Use dotenv or a similar library to load these securely.\n3. Construct the telemetry payload as a JSON object with the required fields: userId, commandName, modelUsed, inputTokens, outputTokens, totalTokens, totalCost, and timestamp (ISO 8601).\n4. Implement robust retry logic using the axios-retry package (npm install axios-retry). Configure exponential backoff with a recommended maximum of 3 retries and a base delay (e.g., 500ms).\n5. Ensure all requests use HTTPS to guarantee TLS encryption in transit. Axios automatically uses HTTPS when the endpoint URL starts with https://.\n6. Handle errors gracefully: catch all transmission errors, log them for diagnostics, and ensure failures do not interrupt or degrade the CLI user experience. Optionally, queue failed payloads for later retry if persistent connectivity issues occur.\n7. Example code snippet:\n\nrequire('dotenv').config();\nconst axios = require('axios');\nconst axiosRetry = require('axios-retry');\n\naxiosRetry(axios, {\n retries: 3,\n retryDelay: axiosRetry.exponentialDelay,\n retryCondition: (error) => axiosRetry.isNetworkOrIdempotentRequestError(error),\n});\n\nasync function sendTelemetry(payload) {\n try {\n await axios.post(process.env.ANALYTICS_URL, payload, {\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${process.env.ANALYTICS_KEY}`,\n },\n timeout: 5000,\n });\n } catch (error) {\n // Log error, do not throw to avoid impacting CLI UX\n console.error('Telemetry transmission failed:', error.message);\n // Optionally, queue payload for later retry\n }\n}\n\nconst telemetryPayload = {\n userId: 'user-123',\n commandName: 'expand',\n modelUsed: 'gpt-4',\n inputTokens: 100,\n outputTokens: 200,\n totalTokens: 300,\n totalCost: 0.0123,\n timestamp: new Date().toISOString(),\n};\n\nsendTelemetry(telemetryPayload);\n\n8. Best practices:\n- Never hardcode secrets or endpoint URLs in source code.\n- Use environment variables and restrict access permissions.\n- Validate all payload fields before transmission.\n- Ensure the CLI continues to function even if telemetry transmission fails.\n\nReferences: [1][2][3][5]\n</info added on 2025-05-14T17:52:40.647Z>\n<info added on 2025-05-14T17:57:18.218Z>\nUser ID Retrieval and Generation:\n\nThe telemetry system must securely retrieve the user ID from the .taskmasterconfig globals, where it should have been generated during the initialization phase. Implementation should:\n\n1. Check for an existing user ID in the .taskmasterconfig file before sending any telemetry data.\n2. If no user ID exists (for users who run AI commands without prior initialization or during upgrades), automatically generate a new UUID v4 and persist it to the .taskmasterconfig file.\n3. Implement a getOrCreateUserId() function that:\n - Reads from the global configuration file\n - Returns the existing ID if present\n - Generates a cryptographically secure UUID v4 if not present\n - Saves the newly generated ID to the configuration file\n - Handles file access errors gracefully\n\n4. Example implementation:\n```javascript\nconst fs = require('fs');\nconst path = require('path');\nconst { v4: uuidv4 } = require('uuid');\n\nfunction getOrCreateUserId() {\n const configPath = path.join(os.homedir(), '.taskmasterconfig');\n \n try {\n // Try to read existing config\n const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));\n \n if (config.userId) {\n return config.userId;\n }\n \n // No user ID found, generate and save\n config.userId = uuidv4();\n fs.writeFileSync(configPath, JSON.stringify(config, null, 2));\n return config.userId;\n } catch (error) {\n // Handle case where config doesn't exist or is invalid\n const userId = uuidv4();\n const newConfig = { userId };\n \n try {\n fs.writeFileSync(configPath, JSON.stringify(newConfig, null, 2));\n } catch (writeError) {\n console.error('Failed to save user ID to config:', writeError.message);\n }\n \n return userId;\n }\n}\n```\n\n5. Ensure this function is called before constructing any telemetry payload to guarantee a consistent user ID across all telemetry events.\n</info added on 2025-05-14T17:57:18.218Z>\n<info added on 2025-05-15T18:45:32.123Z>\n**Invocation Point for Sending Telemetry:**\n* The primary invocation for sending the telemetry payload should occur in `scripts/modules/ai-services-unified.js`.\n* This should happen *after* the `telemetryData` object is fully constructed and *after* user consent (from subtask 77.3) has been confirmed.\n\n**Dedicated Module for Transmission Logic:**\n* The actual HTTPS POST request mechanism, including TLS encryption, retry logic, and graceful fallbacks, should be implemented in a new, separate module (e.g., `scripts/modules/telemetry-sender.js` or `scripts/utils/telemetry-client.js`).\n* This module will be imported and utilized by `scripts/modules/ai-services-unified.js`.\n\n**Key Considerations:**\n* Robust error handling must be in place for the telemetry transmission process; failures should be logged locally and must not disrupt core application functionality.\n* The entire telemetry sending process is contingent upon explicit user consent as outlined in subtask 77.3.\n\n**Implementation Plan:**\n1. Create a new module `scripts/utils/telemetry-client.js` with the following functions:\n - `sendTelemetryData(telemetryPayload)`: Main function that handles the HTTPS POST request\n - `isUserConsentGiven()`: Helper function to check if user has consented to telemetry\n - `logTelemetryError(error)`: Helper function for consistent error logging\n\n2. In `ai-services-unified.js`, after constructing the telemetryData object:\n ```javascript\n const telemetryClient = require('../utils/telemetry-client');\n \n // After telemetryData is constructed\n if (telemetryClient.isUserConsentGiven()) {\n // Non-blocking telemetry submission\n telemetryClient.sendTelemetryData(telemetryData)\n .catch(error => telemetryClient.logTelemetryError(error));\n }\n ```\n\n3. Ensure the telemetry-client module implements:\n - Axios with retry logic for robust HTTP requests\n - Proper TLS encryption via HTTPS\n - Comprehensive error handling\n - Configuration loading from environment variables\n - Validation of payload data before transmission\n</info added on 2025-05-15T18:45:32.123Z>", "status": "deferred", "testStrategy": "Test with mock endpoints to verify secure transmission and proper handling of various response scenarios" @@ -4334,7 +5091,10 @@ "id": 4, "title": "Integrate telemetry into Taskmaster commands", "description": "Integrate the telemetry utility across all relevant Taskmaster commands", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "details": "Modify each Taskmaster command (expand, parse-prd, research, etc.) to call the logAiUsage utility after AI interactions. Ensure telemetry is only sent if user has provided consent. Implement the integration in a way that doesn't impact command performance or user experience.\n<info added on 2025-05-06T17:57:13.980Z>\nModify each Taskmaster command (expand, parse-prd, research, etc.) to call the logAiUsage utility after AI interactions. Ensure telemetry is only sent if user has provided consent. Implement the integration in a way that doesn't impact command performance or user experience.\n\nSuccessfully integrated telemetry calls into `addTask` (core) and `addTaskDirect` (MCP) functions by passing `commandName` and `outputType` parameters to the telemetry system. The `ai-services-unified.js` module now logs basic telemetry data, including calculated cost information, whenever the `add-task` command or tool is invoked. This integration respects user consent settings and maintains performance standards.\n</info added on 2025-05-06T17:57:13.980Z>", "status": "done", "testStrategy": "Integration tests to verify telemetry is correctly triggered across different commands with proper data" @@ -4343,7 +5103,10 @@ "id": 5, "title": "Implement usage summary display", "description": "Create an optional feature to display AI usage summary in the CLI output", - "dependencies": [1, 4], + "dependencies": [ + 1, + 4 + ], "details": "Develop functionality to display a concise summary of AI usage (tokens used, estimated cost) directly in the CLI output after command execution. Make this feature configurable through Taskmaster settings. Ensure the display is formatted clearly and doesn't clutter the main command output.", "status": "done", "testStrategy": "User acceptance testing to verify the summary display is clear, accurate, and properly configurable" @@ -4468,7 +5231,10 @@ "description": "Implement a separate module for handling telemetry transmission logic", "details": "Create a new module (e.g., `scripts/utils/telemetry-client.js`) that encapsulates all telemetry transmission functionality:\n\n1. Implement core functions:\n - `sendTelemetryData(telemetryPayload)`: Main function to handle HTTPS POST requests\n - `isUserConsentGiven()`: Helper to check if user has consented to telemetry\n - `logTelemetryError(error)`: Helper for consistent error logging\n\n2. Use Axios with retry logic:\n - Configure with exponential backoff (max 3 retries, 500ms base delay)\n - Implement proper TLS encryption via HTTPS\n - Set appropriate timeouts (5000ms recommended)\n\n3. Implement robust error handling:\n - Catch all transmission errors\n - Log failures locally without disrupting application flow\n - Ensure failures are transparent to users\n\n4. Configure securely:\n - Load endpoint URL and authentication from environment variables\n - Never hardcode secrets in source code\n - Validate payload data before transmission\n\n5. Integration with ai-services-unified.js:\n - Import the telemetry-client module\n - Call after telemetryData object is constructed\n - Only send if user consent is confirmed\n - Use non-blocking approach to avoid performance impact", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "parentTaskId": 77, "testStrategy": "Unit test with mock endpoints to verify proper transmission, error handling, and respect for user consent settings" } @@ -4497,7 +5263,9 @@ "id": 2, "title": "Modify Add-Task to Recursively Analyze Dependencies", "description": "Update the add-task functionality to recursively analyze and incorporate all task dependencies.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Implement a recursive algorithm that identifies and incorporates all dependencies for a given task. Ensure it handles nested dependencies correctly.", "status": "done", "testStrategy": "Test with various dependency scenarios, including nested dependencies." @@ -4506,7 +5274,9 @@ "id": 3, "title": "Ensure Correct Order of Dependency Resolution", "description": "Modify the add-task functionality to ensure that dependencies are resolved in the correct order during task execution.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Implement logic to sort and execute tasks based on their dependency order. Handle cases where multiple tasks depend on each other.", "status": "done", "testStrategy": "Test with complex dependency chains to verify correct ordering." @@ -4515,7 +5285,9 @@ "id": 4, "title": "Integrate with Existing Validation and Error Handling", "description": "Update the add-task functionality to integrate with existing validation and error handling mechanisms (from Task 87).", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Modify the code to provide clear feedback if dependencies cannot be resolved. Ensure that circular dependencies are detected and handled appropriately.", "status": "done", "testStrategy": "Test with invalid dependency scenarios to verify proper error handling." @@ -4524,7 +5296,9 @@ "id": 5, "title": "Optimize Performance for Large Projects", "description": "Optimize the add-task functionality to ensure efficient dependency resolution, especially for projects with a large number of tasks.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Profile and optimize the recursive dependency analysis algorithm. Implement caching or other performance improvements as needed.", "status": "done", "testStrategy": "Test with large sets of tasks to verify performance improvements." @@ -4547,7 +5321,10 @@ "title": "Implement Move Command for Tasks and Subtasks", "description": "Introduce a 'move' command to enable moving tasks or subtasks to a different id, facilitating conflict resolution by allowing teams to assign new ids as needed.", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "priority": "medium", "details": "The move command will consist of three core components: 1) Core Logic Function in scripts/modules/task-manager/move-task.js, 2) Direct Function Wrapper in mcp-server/src/core/direct-functions/move-task.js, and 3) MCP Tool in mcp-server/src/tools/move-task.js. The command will accept source and destination IDs, handling various scenarios including moving tasks to become subtasks, subtasks to become tasks, and subtasks between different parents. The implementation will handle edge cases such as invalid ids, non-existent parents, circular dependencies, and will properly update all dependencies.", "testStrategy": "Testing will follow a three-tier approach: 1) Unit tests for core functionality including moving tasks to subtasks, subtasks to tasks, subtasks between parents, dependency handling, and validation error cases; 2) Integration tests for the direct function with mock MCP environment and task file regeneration; 3) End-to-end tests for the full MCP tool call path. This will verify all scenarios including moving a task to a new id, moving a subtask under a different parent while preserving its hierarchy, and handling errors for invalid operations.", @@ -4565,7 +5342,9 @@ "id": 2, "title": "Implement edge case handling", "description": "Develop robust error handling for all potential edge cases in the move operation", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Create validation functions to detect invalid task IDs, non-existent parent tasks, and circular dependencies. Handle special cases such as moving a task to become the first/last subtask, reordering within the same parent, preventing moving a task to itself, and preventing moving a parent to its own subtask. Implement proper error messages and status codes for each edge case, and ensure system stability if a move operation fails.", "status": "done", "parentTaskId": 91 @@ -4574,7 +5353,9 @@ "id": 3, "title": "Update CLI interface for move commands", "description": "Extend the command-line interface to support the new move functionality with appropriate flags and options", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Create the Direct Function Wrapper in mcp-server/src/core/direct-functions/move-task.js to adapt the core logic for MCP, handling path resolution and parameter validation. Implement silent mode to prevent console output interfering with JSON responses. Create the MCP Tool in mcp-server/src/tools/move-task.js that exposes the functionality to Cursor, handles project root resolution, and includes proper Zod parameter definitions. Update MCP tool definition in .cursor/mcp.json and register the tool in mcp-server/src/tools/index.js.", "status": "done", "parentTaskId": 91 @@ -4583,7 +5364,10 @@ "id": 4, "title": "Ensure data integrity during moves", "description": "Implement safeguards to maintain data consistency and update all relationships during move operations", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Implement dependency handling logic to update dependencies when converting between task/subtask, add appropriate parent dependencies when needed, and validate no circular dependencies are created. Create transaction-like operations to ensure atomic moves that either complete fully or roll back. Implement functions to update all affected task relationships after a move, and add verification steps to confirm data integrity post-move.", "status": "done", "parentTaskId": 91 @@ -4592,7 +5376,12 @@ "id": 5, "title": "Create comprehensive test suite", "description": "Develop and execute tests covering all move scenarios and edge cases", - "dependencies": [1, 2, 3, 4], + "dependencies": [ + 1, + 2, + 3, + 4 + ], "details": "Create unit tests for core functionality including moving tasks to subtasks, subtasks to tasks, subtasks between parents, dependency handling, and validation error cases. Implement integration tests for the direct function with mock MCP environment and task file regeneration. Develop end-to-end tests for the full MCP tool call path. Ensure tests cover all identified edge cases and potential failure points, and verify data integrity after moves.", "status": "done", "parentTaskId": 91 @@ -4601,7 +5390,9 @@ "id": 6, "title": "Export and integrate the move function", "description": "Ensure the move function is properly exported and integrated with existing code", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Export the move function in scripts/modules/task-manager.js. Update task-master-core.js to include the direct function. Reuse validation logic from add-subtask.js and remove-subtask.js where appropriate. Follow silent mode implementation pattern from other direct functions and match parameter naming conventions in MCP tools.", "status": "done", "parentTaskId": 91 @@ -4613,7 +5404,11 @@ "title": "Implement Project Root Environment Variable Support in MCP Configuration", "description": "Add support for a 'TASK_MASTER_PROJECT_ROOT' environment variable in MCP configuration, allowing it to be set in both mcp.json and .env, with precedence over other methods. This will define the root directory for the MCP server and take precedence over all other project root resolution methods. The implementation should be backward compatible with existing workflows that don't use this variable.", "status": "review", - "dependencies": [1, 3, 17], + "dependencies": [ + 1, + 3, + 17 + ], "priority": "medium", "details": "Update the MCP server configuration system to support the TASK_MASTER_PROJECT_ROOT environment variable as the standard way to specify the project root directory. This provides better namespacing and avoids conflicts with other tools that might use a generic PROJECT_ROOT variable. Implement a clear precedence order for project root resolution:\n\n1. TASK_MASTER_PROJECT_ROOT environment variable (from shell or .env file)\n2. 'projectRoot' key in mcp_config.toml or mcp.json configuration files\n3. Existing resolution logic (CLI args, current working directory, etc.)\n\nModify the configuration loading logic to check for these sources in the specified order, ensuring backward compatibility. All MCP tools and components should use this standardized project root resolution logic. The TASK_MASTER_PROJECT_ROOT environment variable will be required because path resolution is delegated to the MCP client implementation, ensuring consistent behavior across different environments.\n\nImplementation steps:\n1. Identify all code locations where project root is determined (initialization, utility functions)\n2. Update configuration loaders to check for TASK_MASTER_PROJECT_ROOT in environment variables\n3. Add support for 'projectRoot' in configuration files as a fallback\n4. Refactor project root resolution logic to follow the new precedence rules\n5. Ensure all MCP tools and functions use the updated resolution logic\n6. Add comprehensive error handling for cases where TASK_MASTER_PROJECT_ROOT is not set or invalid\n7. Implement validation to ensure the specified directory exists and is accessible", "testStrategy": "1. Write unit tests to verify that the config loader correctly reads project root from environment variables and configuration files with the expected precedence:\n - Test TASK_MASTER_PROJECT_ROOT environment variable takes precedence when set\n - Test 'projectRoot' in configuration files is used when environment variable is absent\n - Test fallback to existing resolution logic when neither is specified\n\n2. Add integration tests to ensure that the MCP server and all tools use the correct project root:\n - Test server startup with TASK_MASTER_PROJECT_ROOT set to various valid and invalid paths\n - Test configuration file loading from the specified project root\n - Test path resolution for resources relative to the project root\n\n3. Test backward compatibility:\n - Verify existing workflows function correctly without the new variables\n - Ensure no regression in projects not using the new configuration options\n\n4. Manual testing:\n - Set TASK_MASTER_PROJECT_ROOT in shell environment and verify correct behavior\n - Set TASK_MASTER_PROJECT_ROOT in .env file and verify it's properly loaded\n - Configure 'projectRoot' in configuration files and test precedence\n - Test with invalid or non-existent directories to verify error handling", @@ -4675,7 +5470,10 @@ "details": "1. Create a new provider class in `src/ai-providers/google-vertex.js` that extends the existing BaseAIProvider, following the established structure used by other providers (e.g., google.js, openai.js).\n2. Integrate the Vercel AI SDK's `@ai-sdk/google-vertex` package. Use the default `vertex` provider for standard usage, and allow for custom configuration via `createVertex` for advanced scenarios (e.g., specifying project ID, location, and credentials).\n3. Implement all required interface methods (such as `getClient`, `generateText`, etc.) to ensure compatibility with the provider system. Reference the implementation patterns from other providers for consistency.\n4. Handle Vertex AI-specific configuration, including project ID, location, and Google Cloud authentication. Support both environment-based authentication and explicit service account credentials via `googleAuthOptions`.\n5. Implement robust error handling for Vertex-specific issues, including authentication failures and API errors, leveraging the system-wide error handling patterns.\n6. Update `src/ai-providers/index.js` to export the new provider, and add the 'vertex' entry to the PROVIDERS object in `scripts/modules/ai-services-unified.js`.\n7. Update documentation to provide clear setup instructions for Google Vertex AI, including required environment variables, service account setup, and configuration examples.\n8. Ensure the implementation is modular and maintainable, supporting future expansion for additional Vertex AI features or models.", "testStrategy": "- Write unit tests for the new provider class, covering all interface methods and configuration scenarios (default, custom, error cases).\n- Verify that the provider can successfully authenticate using both environment-based and explicit service account credentials.\n- Test integration with the provider system by selecting 'vertex' as the provider and generating text using supported Vertex AI models (e.g., Gemini).\n- Simulate authentication and API errors to confirm robust error handling and user feedback.\n- Confirm that the provider is correctly exported and available in the PROVIDERS object.\n- Review and validate the updated documentation for accuracy and completeness.", "status": "done", - "dependencies": [19, 94], + "dependencies": [ + 19, + 94 + ], "priority": "medium", "subtasks": [ { @@ -4691,7 +5489,9 @@ "id": 2, "title": "Integrate Vercel AI SDK Google Vertex Package", "description": "Integrate the `@ai-sdk/google-vertex` package, supporting both the default provider and custom configuration via `createVertex`.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Allow for standard usage with the default `vertex` provider and advanced scenarios using `createVertex` for custom project ID, location, and credentials as per SDK documentation.", "status": "done", "testStrategy": "Write unit tests to ensure both default and custom provider instances can be created and configured." @@ -4700,7 +5500,9 @@ "id": 3, "title": "Implement Provider Interface Methods", "description": "Implement all required interface methods (e.g., `getClient`, `generateText`) to ensure compatibility with the provider system.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Reference implementation patterns from other providers to maintain consistency and ensure all required methods are present and functional.", "status": "done", "testStrategy": "Run integration tests to confirm the provider responds correctly to all interface method calls." @@ -4709,7 +5511,9 @@ "id": 4, "title": "Handle Vertex AI Configuration and Authentication", "description": "Implement support for Vertex AI-specific configuration, including project ID, location, and authentication via environment variables or explicit service account credentials.", - "dependencies": [3], + "dependencies": [ + 3 + ], "details": "Support both environment-based authentication and explicit credentials using `googleAuthOptions`, following Google Cloud and Vertex AI setup best practices.", "status": "done", "testStrategy": "Test with both environment variable-based and explicit service account authentication to ensure both methods work as expected." @@ -4718,7 +5522,9 @@ "id": 5, "title": "Update Exports, Documentation, and Error Handling", "description": "Export the new provider, update the PROVIDERS object, and document setup instructions, including robust error handling for Vertex-specific issues.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Update `src/ai-providers/index.js` and `scripts/modules/ai-services-unified.js`, and provide clear documentation for setup, configuration, and error handling patterns.", "status": "done", "testStrategy": "Verify the provider is available for import, documentation is accurate, and error handling works by simulating common failure scenarios." @@ -4732,7 +5538,10 @@ "details": "Implement the Azure OpenAI provider following the established provider pattern:\n\n1. **Create Azure Provider Class** (`src/ai-providers/azure.js`):\n - Extend BaseAIProvider class following the same pattern as openai.js and google.js\n - Import and use `createAzureOpenAI` from `@ai-sdk/azure` package\n - Implement required interface methods: `getClient()`, `validateConfig()`, and any other abstract methods\n - Handle Azure-specific configuration: endpoint URL, API key, and deployment name\n - Add proper error handling for missing or invalid Azure configuration\n\n2. **Configuration Management**:\n - Support environment variables: AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY, AZURE_OPENAI_DEPLOYMENT\n - Validate that both endpoint and API key are provided\n - Provide clear error messages for configuration issues\n - Follow the same configuration pattern as other providers\n\n3. **Integration Updates**:\n - Update `src/ai-providers/index.js` to export the new AzureProvider\n - Add 'azure' entry to the PROVIDERS object in `scripts/modules/ai-services-unified.js`\n - Ensure the provider is properly registered and accessible through the unified AI services\n\n4. **Error Handling**:\n - Implement Azure-specific error handling for authentication failures\n - Handle endpoint connectivity issues with helpful error messages\n - Validate deployment name and provide guidance for common configuration mistakes\n - Follow the established error handling patterns from Task 19\n\n5. **Documentation Updates**:\n - Update any provider documentation to include Azure OpenAI setup instructions\n - Add configuration examples for Azure OpenAI environment variables\n - Include troubleshooting guidance for common Azure-specific issues\n\nThe implementation should maintain consistency with existing provider implementations while handling Azure's unique authentication and endpoint requirements.", "testStrategy": "Verify the Azure OpenAI provider implementation through comprehensive testing:\n\n1. **Unit Testing**:\n - Test provider class instantiation and configuration validation\n - Verify getClient() method returns properly configured Azure OpenAI client\n - Test error handling for missing/invalid configuration parameters\n - Validate that the provider correctly extends BaseAIProvider\n\n2. **Integration Testing**:\n - Test provider registration in the unified AI services system\n - Verify the provider appears in the PROVIDERS object and is accessible\n - Test end-to-end functionality with valid Azure OpenAI credentials\n - Validate that the provider works with existing AI operation workflows\n\n3. **Configuration Testing**:\n - Test with various environment variable combinations\n - Verify proper error messages for missing endpoint or API key\n - Test with invalid endpoint URLs and ensure graceful error handling\n - Validate deployment name handling and error reporting\n\n4. **Manual Verification**:\n - Set up test Azure OpenAI credentials and verify successful connection\n - Test actual AI operations (like task expansion) using the Azure provider\n - Verify that the provider selection works correctly in the CLI\n - Confirm that error messages are helpful and actionable for users\n\n5. **Documentation Verification**:\n - Ensure all configuration examples work as documented\n - Verify that setup instructions are complete and accurate\n - Test troubleshooting guidance with common error scenarios", "status": "done", - "dependencies": [19, 26], + "dependencies": [ + 19, + 26 + ], "priority": "medium", "subtasks": [ { @@ -4749,7 +5558,9 @@ "id": 2, "title": "Implement Configuration Management", "description": "Add support for Azure OpenAI environment variables and configuration validation", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Implement configuration management for Azure OpenAI provider that supports environment variables: AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY, and AZURE_OPENAI_DEPLOYMENT. Add validation logic to ensure both endpoint and API key are provided. Create clear error messages for configuration issues. Follow the same configuration pattern as implemented in other providers. Ensure the validateConfig() method properly checks all required Azure configuration parameters.", "status": "done", "testStrategy": "Test configuration validation with various combinations of missing or invalid parameters. Verify environment variables are correctly loaded and applied to the provider configuration.", @@ -4759,7 +5570,10 @@ "id": 3, "title": "Update Provider Integration", "description": "Integrate the Azure provider into the existing AI provider system", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Update src/ai-providers/index.js to export the new AzureProvider class. Add 'azure' entry to the PROVIDERS object in scripts/modules/ai-services-unified.js. Ensure the provider is properly registered and accessible through the unified AI services. Test that the provider can be instantiated and used through the provider selection mechanism. Follow the same integration pattern used for existing providers.", "status": "done", "testStrategy": "Create integration tests that verify the Azure provider is correctly registered and can be selected through the provider system. Test that the provider is properly initialized when selected.", @@ -4769,7 +5583,10 @@ "id": 4, "title": "Implement Azure-Specific Error Handling", "description": "Add specialized error handling for Azure OpenAI-specific issues", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "details": "Implement Azure-specific error handling for authentication failures, endpoint connectivity issues, and deployment name validation. Provide helpful error messages that guide users to resolve common configuration mistakes. Follow the established error handling patterns from Task 19. Create custom error classes if needed for Azure-specific errors. Ensure errors are properly propagated and formatted for user display.", "status": "done", "testStrategy": "Test error handling by simulating various failure scenarios including authentication failures, invalid endpoints, and missing deployment names. Verify appropriate error messages are generated.", @@ -4779,7 +5596,12 @@ "id": 5, "title": "Update Documentation", "description": "Create comprehensive documentation for the Azure OpenAI provider integration", - "dependencies": [1, 2, 3, 4], + "dependencies": [ + 1, + 2, + 3, + 4 + ], "details": "Update provider documentation to include Azure OpenAI setup instructions. Add configuration examples for Azure OpenAI environment variables. Include troubleshooting guidance for common Azure-specific issues. Document the required Azure resource creation process with references to Microsoft's documentation. Provide examples of valid configuration settings and explain each required parameter. Include information about Azure OpenAI model deployment requirements.", "status": "done", "testStrategy": "Review documentation for completeness, accuracy, and clarity. Ensure all configuration options are documented and examples are provided. Verify troubleshooting guidance addresses common issues identified during implementation.", @@ -4792,7 +5614,12 @@ "title": "Implement .taskmaster Directory Structure", "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.", "status": "done", - "dependencies": [1, 3, 4, 17], + "dependencies": [ + 1, + 3, + 4, + 17 + ], "priority": "high", "details": "This task involves restructuring how Task Master organizes files within user projects to improve maintainability and keep project directories clean:\n\n1. Create a new `.taskmaster/` directory structure in user projects:\n - Move task files from `tasks/` to `.taskmaster/tasks/`\n - Move PRD files from `scripts/` to `.taskmaster/docs/`\n - Move analysis reports to `.taskmaster/reports/`\n - Move configuration from `.taskmasterconfig` to `.taskmaster/config.json`\n - Create `.taskmaster/templates/` for user templates\n\n2. Update all Task Master code that creates/reads user files:\n - Modify task file generation to use `.taskmaster/tasks/`\n - Update PRD file handling to use `.taskmaster/docs/`\n - Adjust report generation to save to `.taskmaster/reports/`\n - Update configuration loading to look for `.taskmaster/config.json`\n - Modify any path resolution logic in Task Master's codebase\n\n3. Ensure backward compatibility during migration:\n - Implement path fallback logic that checks both old and new locations\n - Add deprecation warnings when old paths are detected\n - Create a migration command to help users transition to the new structure\n - Preserve existing user data during migration\n\n4. Update the project initialization process:\n - Modify the init command to create the new `.taskmaster/` directory structure\n - Update default file creation to use new paths\n\n5. Benefits of the new structure:\n - Keeps user project directories clean and organized\n - Clearly separates Task Master files from user project files\n - Makes it easier to add Task Master to .gitignore if desired\n - Provides logical grouping of different file types\n\n6. Test thoroughly to ensure all functionality works with the new structure:\n - Verify all Task Master commands work with the new paths\n - Ensure backward compatibility functions correctly\n - Test migration process preserves all user data\n\n7. Update documentation:\n - Update README.md to reflect the new user file structure\n - Add migration guide for existing users\n - Document the benefits of the cleaner organization", "testStrategy": "1. Unit Testing:\n - Create unit tests for path resolution that verify both new and old paths work\n - Test configuration loading with both `.taskmasterconfig` and `.taskmaster/config.json`\n - Verify the migration command correctly moves files and preserves content\n - Test file creation in all new subdirectories\n\n2. Integration Testing:\n - Run all existing integration tests with the new directory structure\n - Verify that all Task Master commands function correctly with new paths\n - Test backward compatibility by running commands with old file structure\n\n3. Migration Testing:\n - Test the migration process on sample projects with existing tasks and files\n - Verify all tasks, PRDs, reports, and configurations are correctly moved\n - Ensure no data loss occurs during migration\n - Test migration with partial existing structures (e.g., only tasks/ exists)\n\n4. User Workflow Testing:\n - Test complete workflows: init → create tasks → generate reports → update PRDs\n - Verify all generated files go to correct locations in `.taskmaster/`\n - Test that user project directories remain clean\n\n5. Manual Testing:\n - Perform end-to-end testing with the new structure\n - Create, update, and delete tasks using the new structure\n - Generate reports and verify they're saved to `.taskmaster/reports/`\n\n6. Documentation Verification:\n - Review all documentation to ensure it accurately reflects the new user file structure\n - Verify the migration guide provides clear instructions\n\n7. Regression Testing:\n - Run the full test suite to ensure no regressions were introduced\n - Verify existing user projects continue to work during transition period", @@ -4810,7 +5637,9 @@ "id": 2, "title": "Update Task Master code for new user file paths", "description": "Modify all Task Master code that creates or reads user project files to use the new .taskmaster structure", - "dependencies": [1], + "dependencies": [ + 1 + ], "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.", "status": "done", "testStrategy": "Run unit tests to ensure all Task Master modules can properly create and access user files in new locations. Test configuration loading with the new path structure." @@ -4819,7 +5648,9 @@ "id": 3, "title": "Update task file generation system", "description": "Modify the task file generation system to use the new directory structure", - "dependencies": [1], + "dependencies": [ + 1 + ], "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.", "status": "done", "testStrategy": "Test creating new tasks and verify they're saved to the correct location. Verify existing tasks can be read from the new location." @@ -4828,7 +5659,10 @@ "id": 4, "title": "Implement backward compatibility logic", "description": "Add fallback mechanisms to support both old and new file locations during transition", - "dependencies": [2, 3], + "dependencies": [ + 2, + 3 + ], "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.", "status": "done", "testStrategy": "Test with both old and new directory structures to verify fallback works correctly. Verify deprecation warnings appear when using old paths." @@ -4837,7 +5671,10 @@ "id": 5, "title": "Create migration command for users", "description": "Develop a Task Master command to help users transition their existing projects to the new structure", - "dependencies": [1, 4], + "dependencies": [ + 1, + 4 + ], "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.", "status": "done", "testStrategy": "Test the migration command on various user project configurations. Verify it handles edge cases like missing directories or partial existing structures." @@ -4846,7 +5683,9 @@ "id": 6, "title": "Update project initialization process", "description": "Modify the init command to create the new directory structure for new projects", - "dependencies": [1], + "dependencies": [ + 1 + ], "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.", "status": "done", "testStrategy": "Test initializing new projects and verify the correct .taskmaster directory structure is created. Check that default configurations are properly set up in the new location." @@ -4855,7 +5694,10 @@ "id": 7, "title": "Update PRD and report file handling", "description": "Modify PRD file creation and report generation to use the new directory structure", - "dependencies": [2, 6], + "dependencies": [ + 2, + 6 + ], "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.", "status": "done", "testStrategy": "Test PRD file creation and updates in the new location. Verify reports are generated and saved to .taskmaster/reports/. Test reading existing PRD files from new location." @@ -4864,7 +5706,11 @@ "id": 8, "title": "Update documentation and create migration guide", "description": "Update all documentation to reflect the new directory structure and provide migration guidance", - "dependencies": [5, 6, 7], + "dependencies": [ + 5, + 6, + 7 + ], "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.", "status": "done", "testStrategy": "Review documentation for accuracy and completeness. Have users follow the migration guide to verify it's clear and effective." @@ -4873,7 +5719,10 @@ "id": 9, "title": "Add templates directory support", "description": "Implement support for user templates in the .taskmaster/templates/ directory", - "dependencies": [2, 6], + "dependencies": [ + 2, + 6 + ], "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.", "status": "done", "testStrategy": "Test creating and using custom templates from .taskmaster/templates/. Verify template discovery and usage works correctly. Test that missing templates directory doesn't break functionality." @@ -4882,7 +5731,10 @@ "id": 10, "title": "Verify clean user project directories", "description": "Ensure the new structure keeps user project root directories clean and organized", - "dependencies": [8, 9], + "dependencies": [ + 8, + 9 + ], "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.", "status": "done", "testStrategy": "Test complete workflows and verify only .taskmaster/ directory is created in project root. Check that all Task Master operations respect the new file organization. Verify .gitignore compatibility." @@ -4896,7 +5748,11 @@ "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.", "testStrategy": "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.", "status": "pending", - "dependencies": [2, 4, 95], + "dependencies": [ + 2, + 4, + 95 + ], "priority": "medium", "subtasks": [ { @@ -4913,7 +5769,9 @@ "id": 2, "title": "Implement Export Command Infrastructure with On-Demand Task File Generation", "description": "Develop the CLI 'export' command infrastructure, enabling users to generate task files on-demand by invoking the preserved generateTaskFiles function only when requested.", - "dependencies": [1], + "dependencies": [ + 1 + ], "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.", "status": "pending", "testStrategy": "Test the export command to confirm task files are generated only when explicitly requested and that output paths and options function as intended.", @@ -4923,7 +5781,9 @@ "id": 3, "title": "Implement Comprehensive PDF Export Functionality", "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.", - "dependencies": [2], + "dependencies": [ + 2 + ], "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.", "status": "pending", "testStrategy": "Generate PDFs for projects of varying sizes and verify layout, content accuracy, and performance. Test error handling and concurrency under load.", @@ -4933,7 +5793,10 @@ "id": 4, "title": "Update Documentation, Tests, and CLI Help for Export Workflow", "description": "Revise all relevant documentation, automated tests, and CLI help output to reflect the new export-based workflow and available options.", - "dependencies": [2, 3], + "dependencies": [ + 2, + 3 + ], "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.", "status": "pending", "testStrategy": "Review documentation for completeness and accuracy. Run all tests to ensure coverage of the new export command and verify CLI help output.", @@ -5038,7 +5901,11 @@ "title": "Implement Standalone 'research' CLI Command for AI-Powered Queries", "description": "Develop a new 'task-master research' (alias 'tm research') CLI command for fast, context-aware AI research queries using the ai-services-unified.js infrastructure.", "status": "done", - "dependencies": [2, 4, 16], + "dependencies": [ + 2, + 4, + 16 + ], "priority": "medium", "details": "- Add a new CLI command 'research' to commands.js, following established CLI patterns and conventions.\n- Command should accept a research query as the main parameter, with optional flags for task IDs (--tasks), file paths (--files), custom context (--context), output detail level (--detail), and result saving (--save).\n- Integrate with ai-services-unified.js, invoking its research mode to process the query and context, leveraging project file tree and task context as needed.\n- Implement logic to gather and inject relevant context from specified tasks, files, or custom input, and generate a project file tree snapshot if required.\n- Ensure output is formatted for terminal readability, including citations and references where available.\n- Support saving research results to a specified file if --save is provided.\n- Provide both brief and comprehensive output modes, controlled by a flag.\n- Ensure the command is non-interactive (one-shot execution) and complements the existing 'explore' command.\n- Update help documentation and usage examples for the new command.\n<info added on 2025-06-13T16:09:57.347Z>\nAdd research findings on interactive CLI best practices to inform implementation decisions for the research command and potential future interactive features:\n\n**Interactive CLI Best Practices Research Results:**\n\nKey findings for Node.js CLI development include empathic user-friendly design (prompting for missing arguments rather than failing), stateful context-aware interactions using XDG Base Directory Specification for config storage, and conversation threading with libraries like Inquirer.js for chaining prompts based on previous answers.\n\nImplementation recommendations: Use Inquirer.js for interactive flows, implement state management for user preferences across sessions, structure commands to support multi-step context-aware conversations, enhance output with color formatting using chalk, and design keyboard-friendly navigation without mouse requirements.\n\nSpecific patterns include branching conversations where follow-up prompts are triggered based on user selections, persistent context storage between CLI runs through file-based serialization, and rich UI elements like lists and checkboxes for improved accessibility.\n\nConsider applying these patterns to enhance the research command with optional interactive modes for query refinement and result exploration, while maintaining the primary non-interactive one-shot execution design.\n</info added on 2025-06-13T16:09:57.347Z>\n<info added on 2025-06-13T16:46:28.375Z>\nTesting append functionality: The research command implementation is progressing well. Successfully integrated enhanced follow-up functionality with conversation threading and save-to-task capabilities.\n</info added on 2025-06-13T16:46:28.375Z>\n<info added on 2025-06-14T10:15:00.000Z>\nRegular update test: Add information about the successful implementation of the append mode functionality which allows timestamped updates to tasks. This functionality enables research results to be appended to existing task details with proper timestamps, maintaining a chronological record of research activities and findings. The append mode integrates seamlessly with the existing task update mechanisms and follows the established patterns for task modification and file regeneration.\n</info added on 2025-06-14T10:15:00.000Z>", "testStrategy": "- Write unit and integration tests to verify correct parsing of command-line arguments and flags.\n- Test that the command invokes ai-services-unified.js in research mode with the correct parameters and context.\n- Validate that context from tasks, files, and custom input is correctly gathered and passed to the research engine.\n- Confirm that output is properly formatted, includes citations, and is displayed in the terminal as expected.\n- Test saving results to files and handling of file system errors.\n- Ensure the command works in both brief and comprehensive modes.\n- Verify that the command does not enter interactive mode and exits cleanly after execution.\n- Check help output and usage documentation for accuracy and completeness.\n- Test the append mode functionality for timestamped updates to task details.\n- Validate that research-to-task linking works correctly with proper task file updates.", @@ -5055,7 +5922,9 @@ "id": 2, "title": "Parameter and Flag Handling", "description": "Define and implement parsing for all arguments, flags, and options accepted by the 'research' command, including validation and default values.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Use a command-line parsing framework to handle parameters. Ensure support for optional and required arguments, order-independence, and clear error messages for invalid input.\n<info added on 2025-05-25T06:00:42.350Z>\n✅ **Parameter and Flag Handling Implementation Complete**\n\nSuccessfully implemented comprehensive parameter validation and processing for the research command:\n\n**✅ Implemented Features:**\n1. **Comprehensive Parameter Validation:**\n - Prompt validation (required, non-empty string)\n - Detail level validation (low, medium, high)\n - Task ID format validation (supports \"15\" and \"15.2\" formats)\n - File path validation (comma-separated, existence checks)\n - Save target validation (security checks for path traversal)\n\n2. **Advanced Parameter Processing:**\n - Comma-separated value parsing for task IDs and file paths\n - Whitespace trimming and normalization\n - Project root detection using `findProjectRoot()`\n - Relative/absolute path handling for files\n - Default value application\n\n3. **Informative Error Messages:**\n - Specific error messages for each validation failure\n - Clear examples of correct usage\n - Helpful suggestions for fixing errors\n - Much more informative than basic Commander.js errors\n\n4. **Structured Output:**\n - Creates validated parameters object with all processed values\n - Proper type conversion and normalization\n - Ready for consumption by core research function\n\n**✅ Validation Examples Tested:**\n- Missing prompt: Shows Commander.js error (expected behavior)\n- Invalid detail level: \"Error: Detail level must be one of: low, medium, high\"\n- Invalid task ID format: \"Error parsing task IDs: Invalid task ID format: \"invalid_format\". Expected format: \"15\" or \"15.2\"\"\n- Valid parameters: Successfully processes and creates structured parameter object\n\n**✅ Security Features:**\n- Path traversal protection for save targets\n- File existence validation\n- Input sanitization and trimming\n\nThe parameter validation is now production-ready and follows the same patterns used throughout the Task Master codebase. Ready to proceed to subtask 94.3 (Context Gathering Utility).\n</info added on 2025-05-25T06:00:42.350Z>", "status": "done" }, @@ -5063,7 +5932,9 @@ "id": 3, "title": "Context Gathering", "description": "Implement logic to gather necessary context for the research operation, such as reading from files, stdin, or other sources as specified by the user.", - "dependencies": [2], + "dependencies": [ + 2 + ], "details": "Support reading input from files or stdin using '-' as a convention. Validate and preprocess the gathered context to ensure it is suitable for AI processing.\n<info added on 2025-05-25T05:24:58.107Z>\nCreate a comprehensive, reusable context gathering utility `utils/contextGatherer.js` that can be shared between the research command and explore REPL functionality.\n\n**Core Features:**\n\n**Task/Subtask Context Extraction:**\n- Parse task IDs and subtask IDs (formats: \"15\", \"15.2\", \"16,17.1\")\n- Extract task titles, descriptions, details, and dependencies from the task system\n- Include parent task context automatically for subtasks\n- Format task data optimally for AI consumption\n\n**File Path Context Processing:**\n- Handle single or comma-separated file paths\n- Implement safe file reading with comprehensive error handling\n- Support multiple file types (JavaScript, markdown, text, JSON, etc.)\n- Include file metadata (path, size, type, last modified)\n\n**Project File Tree Generation:**\n- Create structured project overview with configurable depth\n- Filter out irrelevant directories (.git, node_modules, .env files)\n- Include file counts and directory statistics\n- Support custom filtering patterns\n\n**Custom Context Integration:**\n- Accept and merge custom context strings\n- Maintain clear context hierarchy and organization\n- Preserve context source attribution\n\n**Unified API Design:**\n```javascript\nconst contextGatherer = new ContextGatherer(projectRoot);\nconst context = await contextGatherer.gather({\n tasks: [\"15\", \"16.2\"],\n files: [\"src/main.js\", \"README.md\"],\n customContext: \"Additional context...\",\n includeProjectTree: true,\n format: \"research\" // or \"chat\", \"system-prompt\"\n});\n```\n\n**Output Formatting:**\n- Support multiple output formats (research, chat, system-prompt)\n- Ensure consistent context structure across different use cases\n- Optimize for AI model consumption and token efficiency\n\nThis utility will eliminate code duplication between task 51 (explore REPL) and task 94 (research command) while providing a robust, extensible foundation for context gathering operations.\n</info added on 2025-05-25T05:24:58.107Z>\n<info added on 2025-05-25T06:13:19.991Z>\n✅ **Context Gathering Implementation Complete**\n\nSuccessfully implemented the comprehensive ContextGatherer utility in `scripts/modules/utils/contextGatherer.js`:\n\n**✅ Core Features Implemented:**\n\n1. **Task/Subtask Context Extraction:**\n - ✅ Parse task IDs and subtask IDs (formats: \"15\", \"15.2\", \"16,17.1\")\n - ✅ Extract task titles, descriptions, details, and dependencies from the task system\n - ✅ Include parent task context automatically for subtasks\n - ✅ Format task data optimally for AI consumption\n - ✅ Proper integration with existing `findTaskById` utility function\n\n2. **File Path Context Processing:**\n - ✅ Handle single or comma-separated file paths\n - ✅ Implement safe file reading with comprehensive error handling\n - ✅ Support multiple file types (JavaScript, markdown, text, JSON, etc.)\n - ✅ Include file metadata (path, size, type, last modified)\n - ✅ File size limits (50KB max) to prevent context explosion\n\n3. **Project File Tree Generation:**\n - ✅ Create structured project overview with configurable depth (max 3 levels)\n - ✅ Filter out irrelevant directories (.git, node_modules, .env files)\n - ✅ Include file counts and directory statistics\n - ✅ Support custom filtering patterns\n\n4. **Custom Context Integration:**\n - ✅ Accept and merge custom context strings\n - ✅ Maintain clear context hierarchy and organization\n - ✅ Preserve context source attribution\n\n5. **Unified API Design:**\n - ✅ Clean class-based API with factory function\n - ✅ Flexible options object for configuration\n - ✅ Multiple output formats (research, chat, system-prompt)\n - ✅ Proper error handling and graceful degradation\n\n**✅ Output Formatting:**\n- ✅ Support for 'research', 'chat', and 'system-prompt' formats\n- ✅ Consistent context structure across different use cases\n- ✅ Optimized for AI model consumption and token efficiency\n\n**✅ Testing:**\n- ✅ Successfully tested with real task data (Task 94 and subtask 94.1)\n- ✅ Verified task context extraction works correctly\n- ✅ Confirmed proper formatting and structure\n\n**✅ Integration Ready:**\n- ✅ Designed to be shared between task 51 (explore REPL) and task 94 (research command)\n- ✅ Follows existing codebase patterns and utilities\n- ✅ Proper ES6 module exports for easy importing\n\nThe ContextGatherer utility is now ready for integration into the core research function (subtask 94.4).\n</info added on 2025-05-25T06:13:19.991Z>", "status": "done" }, @@ -5073,7 +5944,10 @@ "description": "Implement the core research function in scripts/modules/task-manager/ following the add-task.js pattern", "details": "Create a new core function (e.g., research.js) in scripts/modules/task-manager/ that:\n- Accepts parameters: query, context options (task IDs, file paths, custom context), project tree flag, detail level\n- Implements context gathering using the contextGatherer utility from subtask 94.3\n- Integrates with ai-services-unified.js using research role\n- Handles both CLI and MCP output formats\n- Returns structured results with telemetry data\n- Follows the same parameter validation and error handling patterns as add-task.js\n<info added on 2025-05-25T06:29:01.194Z>\n✅ COMPLETED: Added loading spinner to research command\n\n**Implementation Details:**\n- Imported `startLoadingIndicator` and `stopLoadingIndicator` from ui.js\n- Added loading indicator that shows \"Researching with AI...\" during AI service calls\n- Properly wrapped AI service call in try/catch/finally blocks to ensure spinner stops on both success and error\n- Loading indicator only shows in CLI mode (outputFormat === 'text'), not in MCP mode\n- Follows the same pattern as add-task.js for consistent user experience\n\n**Testing:**\n- Tested with `node bin/task-master.js research \"What is TypeScript?\" --detail=low`\n- Confirmed spinner appears during AI processing and disappears when complete\n- Telemetry display works correctly after spinner stops\n\nThe research command now provides the same polished user experience as other AI-powered commands in the system.\n</info added on 2025-05-25T06:29:01.194Z>", "status": "done", - "dependencies": ["98.2", "98.3"], + "dependencies": [ + "98.2", + "98.3" + ], "parentTaskId": 98 }, { @@ -5082,7 +5956,9 @@ "description": "Create the MCP direct function wrapper in mcp-server/src/core/direct-functions/ following the add-task pattern", "details": "Create a new direct function (e.g., research.js) in mcp-server/src/core/direct-functions/ that:\n- Follows the addTaskDirect pattern for parameter handling and error management\n- Uses enableSilentMode/disableSilentMode to prevent console output interference\n- Creates logger wrapper using createLogWrapper utility\n- Validates required parameters (query, projectRoot)\n- Calls the core research function with proper context (session, mcpLog, projectRoot)\n- Returns standardized result object with success/error structure\n- Handles telemetry data propagation\n- Export and register in task-master-core.js", "status": "done", - "dependencies": ["98.4"], + "dependencies": [ + "98.4" + ], "parentTaskId": 98 }, { @@ -5091,7 +5967,9 @@ "description": "Create the MCP tool in mcp-server/src/tools/ following the add-task tool pattern", "details": "Create a new MCP tool (e.g., research.js) in mcp-server/src/tools/ that:\n- Defines zod schema for all research command parameters (query, id, files, context, project-tree, save, detail)\n- Uses withNormalizedProjectRoot HOF to handle project path normalization\n- Calls findTasksJsonPath to locate tasks.json file\n- Invokes the direct function with proper parameter mapping\n- Uses handleApiResult for standardized response formatting\n- Registers the tool as 'research' (snake_case) in the MCP server\n- Handles errors with createErrorResponse\n- Register in mcp-server/src/tools/index.js\n- Update .cursor/mcp.json with tool definition", "status": "done", - "dependencies": ["98.5"], + "dependencies": [ + "98.5" + ], "parentTaskId": 98 }, { @@ -5118,7 +5996,9 @@ "description": "Leverage the successfully implemented append mode functionality to enable seamless integration of research results into task details", "details": "Build upon the existing append mode functionality to enhance research-to-task integration:\n\n- Utilize the timestamped update mechanism for appending research findings to task details\n- Ensure research results maintain chronological order when appended to tasks\n- Integrate with the existing task modification and file regeneration patterns\n- Support both direct research appending and research reference linking\n- Maintain consistency with the established append mode formatting and timestamp patterns\n- Test integration with the existing task update workflows\n\nThis subtask leverages the already-implemented append mode infrastructure to provide a robust foundation for research result integration into the task management system.", "status": "done", - "dependencies": ["98.8"], + "dependencies": [ + "98.8" + ], "parentTaskId": 98 } ] @@ -5148,7 +6028,9 @@ "description": "Modify generateTasksFromPRD to embed PRD context and maintain source mappings", "details": "## Implementation Requirements\n\n### Core Modifications to generateTasksFromPRD:\n1. **Add PRD Context Embedding**\n - Modify task generation prompt to include relevant PRD excerpts\n - Ensure each generated task includes source section references\n - Preserve original PRD language and specifications in task metadata\n\n2. **Implement Context Windowing**\n - For large PRDs, implement intelligent context windowing\n - Include relevant sections for each task being generated\n - Maintain context relationships between related tasks\n\n3. **Enhanced Task Structure**\n - Add prdContext field to task objects\n - Include sourceSection, originalText, and relatedSections\n - Store contextWindow for later use in expansions\n\n### Technical Implementation:\n```javascript\n// Enhanced task generation with context\nconst generateTaskWithContext = async (prdSection, relatedSections, fullPRD) => {\n const contextWindow = buildContextWindow(prdSection, relatedSections, fullPRD);\n const prompt = `\n Generate a task based on this PRD section:\n \n PRIMARY SECTION:\n ${prdSection.content}\n \n RELATED CONTEXT:\n ${contextWindow}\n \n Ensure the task preserves all specific requirements and technical details.\n `;\n \n // Generate task with embedded context\n const task = await generateTask(prompt);\n task.prdContext = {\n sourceSection: prdSection.title,\n originalText: prdSection.content,\n relatedSections: relatedSections.map(s => s.title),\n contextWindow: contextWindow\n };\n \n return task;\n};\n```\n\n### Context Preservation Strategy:\n- Map each task to its source PRD sections\n- Preserve technical specifications and requirements language\n- Maintain relationships between interdependent features\n- Store context for later use in expansion phase\n\n### Integration with Existing Flow:\n- Modify existing generateTasksFromPRD function\n- Maintain backward compatibility with simple PRDs\n- Add new metadata fields without breaking existing structure\n- Ensure context is available for subsequent operations", "status": "pending", - "dependencies": ["99.1"], + "dependencies": [ + "99.1" + ], "parentTaskId": 99 }, { @@ -5157,7 +6039,9 @@ "description": "Add optional --expand-tasks flag and intelligent expansion using preserved PRD context", "details": "## Implementation Requirements\n\n### Core Features:\n1. **Add --expand-tasks CLI Flag**\n - Optional flag for parse-prd command\n - Triggers automatic expansion after initial task generation\n - Configurable expansion depth and strategy\n\n2. **Two-Pass Processing System**\n - First pass: Generate tasks with PRD context preservation\n - Second pass: Expand tasks using their embedded PRD context\n - Maintain context fidelity throughout the process\n\n3. **Context-Aware Expansion Logic**\n - Use preserved PRD context for each task's expansion\n - Include relevant PRD excerpts in expansion prompts\n - Ensure subtasks maintain fidelity to original specifications\n\n### Technical Implementation:\n```javascript\n// Enhanced parse-prd with expansion pipeline\nconst parsePRDWithExpansion = async (prdContent, options) => {\n // Phase 1: Analyze and generate tasks with context\n const prdAnalysis = await analyzePRDStructure(prdContent);\n const tasksWithContext = await generateTasksWithContext(prdAnalysis);\n \n // Phase 2: Expand tasks if requested\n if (options.expandTasks) {\n for (const task of tasksWithContext) {\n if (shouldExpandTask(task, prdAnalysis)) {\n const expandedSubtasks = await expandTaskWithPRDContext(task);\n task.subtasks = expandedSubtasks;\n }\n }\n }\n \n return tasksWithContext;\n};\n\n// Context-aware task expansion\nconst expandTaskWithPRDContext = async (task) => {\n const { prdContext } = task;\n const expansionPrompt = `\n Expand this task into detailed subtasks using the original PRD context:\n \n TASK: ${task.title}\n DESCRIPTION: ${task.description}\n \n ORIGINAL PRD CONTEXT:\n ${prdContext.originalText}\n \n RELATED SECTIONS:\n ${prdContext.contextWindow}\n \n Generate subtasks that preserve all technical details and requirements from the PRD.\n `;\n \n return await generateSubtasks(expansionPrompt);\n};\n```\n\n### CLI Integration:\n- Add --expand-tasks flag to parse-prd command\n- Add --expansion-depth option for controlling subtask levels\n- Add --preserve-detail flag for maximum context preservation\n- Maintain backward compatibility with existing parse-prd usage\n\n### Expansion Strategy:\n- Determine which tasks should be expanded based on complexity\n- Use PRD context to generate accurate, detailed subtasks\n- Preserve technical specifications and implementation details\n- Validate subtask accuracy against original PRD content\n\n### Performance Considerations:\n- Implement batching for large numbers of tasks\n- Add progress indicators for long-running expansions\n- Optimize context window sizes for efficiency\n- Cache PRD analysis results for reuse", "status": "pending", - "dependencies": ["99.2"], + "dependencies": [ + "99.2" + ], "parentTaskId": 99 }, { @@ -5166,7 +6050,9 @@ "description": "Modify existing expand-task functionality to leverage preserved PRD context for more accurate expansions", "details": "## Implementation Requirements\n\n### Core Enhancements to expand-task.js:\n1. **PRD Context Detection**\n - Check if task has embedded prdContext metadata\n - Extract relevant PRD sections for expansion\n - Fall back to existing expansion logic if no PRD context\n\n2. **Context-Enhanced Expansion Prompts**\n - Include original PRD excerpts in expansion prompts\n - Add related section context for comprehensive understanding\n - Preserve technical specifications and requirements language\n\n3. **Validation and Quality Assurance**\n - Validate generated subtasks against original PRD content\n - Ensure technical accuracy and requirement compliance\n - Flag potential discrepancies for review\n\n### Technical Implementation:\n```javascript\n// Enhanced expand-task with PRD context\nconst expandTaskWithContext = async (taskId, options, context) => {\n const task = await getTask(taskId);\n \n // Check for PRD context\n if (task.prdContext) {\n return await expandWithPRDContext(task, options);\n } else {\n // Fall back to existing expansion logic\n return await expandTaskStandard(task, options);\n }\n};\n\nconst expandWithPRDContext = async (task, options) => {\n const { prdContext } = task;\n \n const enhancedPrompt = `\n Expand this task into detailed subtasks using the original PRD context:\n \n TASK DETAILS:\n Title: ${task.title}\n Description: ${task.description}\n Current Details: ${task.details}\n \n ORIGINAL PRD CONTEXT:\n Source Section: ${prdContext.sourceSection}\n Original Requirements:\n ${prdContext.originalText}\n \n RELATED CONTEXT:\n ${prdContext.contextWindow}\n \n EXPANSION REQUIREMENTS:\n - Preserve all technical specifications from the PRD\n - Maintain requirement accuracy and completeness\n - Generate ${options.num || 'appropriate number of'} subtasks\n - Include implementation details that reflect PRD specifics\n \n Generate subtasks that are grounded in the original PRD content.\n `;\n \n const subtasks = await generateSubtasks(enhancedPrompt, options);\n \n // Add PRD context inheritance to subtasks\n subtasks.forEach(subtask => {\n subtask.prdContext = {\n inheritedFrom: task.id,\n sourceSection: prdContext.sourceSection,\n relevantExcerpt: extractRelevantExcerpt(prdContext, subtask)\n };\n });\n \n return subtasks;\n};\n```\n\n### Integration Points:\n1. **Modify existing expand-task.js**\n - Add PRD context detection logic\n - Enhance prompt generation with context\n - Maintain backward compatibility\n\n2. **Update expansion validation**\n - Add PRD compliance checking\n - Implement quality scoring for context fidelity\n - Flag potential accuracy issues\n\n3. **CLI and MCP Integration**\n - Update expand-task command to leverage PRD context\n - Add options for context-aware expansion\n - Maintain existing command interface\n\n### Context Inheritance Strategy:\n- Pass relevant PRD context to generated subtasks\n- Create context inheritance chain for nested expansions\n- Preserve source traceability throughout expansion tree\n- Enable future re-expansion with maintained context\n\n### Quality Assurance Features:\n- Semantic similarity checking between subtasks and PRD\n- Technical requirement compliance validation\n- Automated flagging of potential context drift\n- User feedback integration for continuous improvement", "status": "pending", - "dependencies": ["99.2"], + "dependencies": [ + "99.2" + ], "parentTaskId": 99 }, { @@ -5175,7 +6061,9 @@ "description": "Implement new command-line flags and MCP tool parameters for enhanced PRD parsing", "details": "## Implementation Requirements\n\n### New CLI Options for parse-prd:\n1. **--expand-tasks**\n - Automatically expand generated tasks using PRD context\n - Boolean flag, default false\n - Triggers in-flight expansion pipeline\n\n2. **--preserve-detail**\n - Maximum detail preservation mode\n - Boolean flag, default false\n - Ensures highest fidelity to PRD content\n\n3. **--adaptive-count**\n - Let AI determine optimal task count based on PRD complexity\n - Boolean flag, default false\n - Overrides --num-tasks when enabled\n\n4. **--context-window-size**\n - Control how much PRD context to include in expansions\n - Integer value, default 2000 characters\n - Balances context richness with performance\n\n5. **--expansion-depth**\n - Control how many levels deep to expand tasks\n - Integer value, default 1\n - Prevents excessive nesting\n\n### MCP Tool Parameter Updates:\n```javascript\n// Enhanced parse_prd MCP tool parameters\n{\n input: \"Path to PRD file\",\n output: \"Output path for tasks.json\",\n numTasks: \"Number of top-level tasks (overridden by adaptiveCount)\",\n expandTasks: \"Boolean - automatically expand tasks with PRD context\",\n preserveDetail: \"Boolean - maximum detail preservation mode\",\n adaptiveCount: \"Boolean - AI determines optimal task count\",\n contextWindowSize: \"Integer - context size for expansions\",\n expansionDepth: \"Integer - levels of expansion to perform\",\n research: \"Boolean - use research model for enhanced analysis\",\n force: \"Boolean - overwrite existing files\"\n}\n```\n\n### CLI Command Updates:\n```bash\n# Enhanced parse-prd command examples\ntask-master parse-prd prd.txt --expand-tasks --preserve-detail\ntask-master parse-prd prd.txt --adaptive-count --expansion-depth=2\ntask-master parse-prd prd.txt --context-window-size=3000 --research\n```\n\n### Implementation Details:\n1. **Update commands.js**\n - Add new option definitions\n - Update parse-prd command handler\n - Maintain backward compatibility\n\n2. **Update MCP tool definition**\n - Add new parameter schemas\n - Update tool description and examples\n - Ensure parameter validation\n\n3. **Parameter Processing Logic**\n - Validate parameter combinations\n - Set appropriate defaults\n - Handle conflicting options gracefully\n\n### Validation Rules:\n- expansion-depth must be positive integer ≤ 3\n- context-window-size must be between 500-5000 characters\n- adaptive-count overrides num-tasks when both specified\n- expand-tasks requires either adaptive-count or num-tasks > 5\n\n### Help Documentation Updates:\n- Update command help text with new options\n- Add usage examples for different scenarios\n- Document parameter interactions and constraints\n- Include performance considerations for large PRDs", "status": "pending", - "dependencies": ["99.3"], + "dependencies": [ + "99.3" + ], "parentTaskId": 99 }, { @@ -5184,7 +6072,10 @@ "description": "Create test suite for PRD analysis, context preservation, and expansion accuracy", "details": "## Implementation Requirements\n\n### Test Categories:\n1. **PRD Analysis Testing**\n - Test section identification with various PRD formats\n - Validate complexity scoring accuracy\n - Test boundary detection for different document structures\n - Verify context mapping correctness\n\n2. **Context Preservation Testing**\n - Validate PRD context embedding in generated tasks\n - Test context window generation and sizing\n - Verify source section mapping accuracy\n - Test context inheritance in subtasks\n\n3. **Expansion Accuracy Testing**\n - Compare PRD-grounded vs standard expansions\n - Measure semantic similarity between PRD and subtasks\n - Test technical requirement preservation\n - Validate expansion depth and quality\n\n4. **Integration Testing**\n - Test full parse-prd pipeline with expansion\n - Validate CLI option combinations\n - Test MCP tool parameter handling\n - Verify backward compatibility\n\n### Test Data Requirements:\n```javascript\n// Test PRD samples\nconst testPRDs = {\n simple: \"Basic PRD with minimal technical details\",\n complex: \"Detailed PRD with extensive technical specifications\",\n structured: \"Well-organized PRD with clear sections\",\n unstructured: \"Free-form PRD with mixed content\",\n technical: \"Highly technical PRD with specific requirements\",\n large: \"Very large PRD testing context window limits\"\n};\n```\n\n### Validation Metrics:\n1. **Detail Preservation Score**\n - Semantic similarity between PRD and generated tasks\n - Technical requirement coverage percentage\n - Specification accuracy rating\n\n2. **Context Fidelity Score**\n - Accuracy of source section mapping\n - Relevance of included context windows\n - Quality of context inheritance\n\n3. **Expansion Quality Score**\n - Subtask relevance to parent task and PRD\n - Technical accuracy of implementation details\n - Completeness of requirement coverage\n\n### Test Implementation:\n```javascript\n// Example test structure\ndescribe('Enhanced Parse-PRD', () => {\n describe('PRD Analysis', () => {\n test('should identify sections correctly', async () => {\n const analysis = await analyzePRDStructure(testPRDs.structured);\n expect(analysis.sections).toHaveLength(expectedSectionCount);\n expect(analysis.overallComplexity).toBeGreaterThan(0);\n });\n \n test('should calculate appropriate task count', async () => {\n const analysis = await analyzePRDStructure(testPRDs.complex);\n expect(analysis.recommendedTaskCount).toBeGreaterThan(10);\n });\n });\n \n describe('Context Preservation', () => {\n test('should embed PRD context in tasks', async () => {\n const tasks = await generateTasksWithContext(testPRDs.technical);\n tasks.forEach(task => {\n expect(task.prdContext).toBeDefined();\n expect(task.prdContext.sourceSection).toBeTruthy();\n expect(task.prdContext.originalText).toBeTruthy();\n });\n });\n });\n \n describe('Expansion Accuracy', () => {\n test('should generate relevant subtasks from PRD context', async () => {\n const task = createTestTaskWithPRDContext();\n const subtasks = await expandTaskWithPRDContext(task);\n \n const relevanceScore = calculateRelevanceScore(subtasks, task.prdContext);\n expect(relevanceScore).toBeGreaterThan(0.8);\n });\n });\n});\n```\n\n### Performance Testing:\n- Test with large PRDs (>10,000 words)\n- Measure processing time for different complexity levels\n- Test memory usage with extensive context preservation\n- Validate timeout handling for long-running operations\n\n### Quality Assurance Tools:\n- Automated semantic similarity checking\n- Technical requirement compliance validation\n- Context drift detection algorithms\n- User acceptance testing framework\n\n### Continuous Integration:\n- Add tests to existing CI pipeline\n- Set up performance benchmarking\n- Implement quality gates for PRD processing\n- Create regression testing for context preservation", "status": "pending", - "dependencies": ["99.4", "99.5"], + "dependencies": [ + "99.4", + "99.5" + ], "parentTaskId": 99 } ] @@ -5196,7 +6087,10 @@ "details": "## Core Problem Statement\n\nThe current help menu in `displayHelp()` function (ui.js:434-734) is hardcoded with static command information that can become outdated when:\n\n1. **Command Changes**: New options/flags are added to existing commands\n2. **New Commands**: New commands are added to commands.js but not reflected in help\n3. **Command Removal**: Commands are removed but help text remains\n4. **Inconsistent Documentation**: Help text doesn't match actual command behavior\n5. **Maintenance Burden**: Developers must remember to update help when modifying commands\n\n## Technical Implementation Requirements\n\n### 1. Command Introspection System\n- **Extract Command Metadata**: Parse Commander.js program instance to extract:\n - Command names and aliases\n - Command descriptions\n - All options/flags with their descriptions and default values\n - Required vs optional parameters\n - Argument specifications\n- **Command Categorization**: Implement intelligent categorization based on:\n - Command name patterns (e.g., 'add-*', 'remove-*', 'set-*')\n - Command descriptions containing keywords\n - Manual category overrides for edge cases\n- **Validation**: Ensure all registered commands are captured and categorized\n\n### 2. Dynamic Help Generation Engine\n- **Template System**: Create flexible templates for:\n - Category headers with consistent styling\n - Command entries with proper formatting\n - Option/flag documentation with type information\n - Example usage generation\n- **Formatting Logic**: Implement dynamic column width calculation based on:\n - Terminal width detection\n - Content length analysis\n - Responsive layout adjustments\n- **Content Optimization**: Handle text wrapping, truncation, and spacing automatically\n\n### 3. Enhanced Command Documentation\n- **Auto-Generated Examples**: Create realistic usage examples by:\n - Combining command names with common option patterns\n - Using project-specific values (task IDs, file paths)\n - Showing both simple and complex usage scenarios\n- **Option Details**: Display comprehensive option information:\n - Short and long flag variants (-f, --file)\n - Data types and format requirements\n - Default values and behavior\n - Required vs optional indicators\n- **Cross-References**: Add intelligent linking between related commands\n\n### 4. Integration Points\n- **Commands.js Integration**: \n - Access the programInstance after all commands are registered\n - Extract metadata without affecting command functionality\n - Handle edge cases like hidden commands or aliases\n- **UI.js Refactoring**:\n - Replace static commandCategories array with dynamic generation\n - Maintain existing visual styling and layout\n - Preserve terminal width responsiveness\n - Keep configuration and quick start sections\n\n### 5. Category Classification Logic\nImplement smart categorization rules:\n```javascript\nconst categoryRules = {\n 'Project Setup & Configuration': ['init', 'models'],\n 'Task Generation': ['parse-prd', 'generate'],\n 'Task Management': ['list', 'set-status', 'update', 'add-task', 'remove-task'],\n 'Subtask Management': ['add-subtask', 'remove-subtask', 'clear-subtasks'],\n 'Task Analysis & Breakdown': ['analyze-complexity', 'complexity-report', 'expand', 'research'],\n 'Task Navigation & Viewing': ['next', 'show'],\n 'Dependency Management': ['add-dependency', 'remove-dependency', 'validate-dependencies', 'fix-dependencies']\n};\n```\n\n### 6. Error Handling and Fallbacks\n- **Graceful Degradation**: Fall back to static help if introspection fails\n- **Missing Information**: Handle commands with incomplete metadata\n- **Performance Considerations**: Cache generated help content when possible\n- **Debug Mode**: Provide verbose output for troubleshooting categorization\n\n## Implementation Architecture\n\n### Core Functions to Implement:\n1. **`extractCommandMetadata(programInstance)`**\n - Parse Commander.js instance\n - Extract all command and option information\n - Return structured metadata object\n\n2. **`categorizeCommands(commandMetadata)`**\n - Apply categorization rules\n - Handle special cases and overrides\n - Return categorized command structure\n\n3. **`generateDynamicHelp(categorizedCommands)`**\n - Create formatted help content\n - Apply consistent styling\n - Handle responsive layout\n\n4. **`displayDynamicHelp(programInstance)`**\n - Replace current displayHelp() function\n - Integrate with existing banner and footer content\n - Maintain backward compatibility\n\n### File Structure Changes:\n- **ui.js**: Replace static help with dynamic generation\n- **commands.js**: Ensure all commands have proper descriptions and option documentation\n- **New utility functions**: Add command introspection helpers\n\n## Testing Requirements\n\n### Unit Tests:\n- Command metadata extraction accuracy\n- Categorization logic correctness\n- Help content generation formatting\n- Terminal width responsiveness\n\n### Integration Tests:\n- Full help menu generation from actual commands\n- Consistency between help and actual command behavior\n- Performance with large numbers of commands\n\n### Manual Testing:\n- Visual verification of help output\n- Terminal width adaptation testing\n- Comparison with current static help for completeness\n\n## Benefits\n\n1. **Automatic Synchronization**: Help always reflects actual command state\n2. **Reduced Maintenance**: No manual help updates needed for command changes\n3. **Consistency**: Guaranteed alignment between help and implementation\n4. **Extensibility**: Easy to add new categorization rules or formatting\n5. **Accuracy**: Eliminates human error in help documentation\n6. **Developer Experience**: Faster development with automatic documentation\n\n## Migration Strategy\n\n1. **Phase 1**: Implement introspection system alongside existing static help\n2. **Phase 2**: Add categorization and dynamic generation\n3. **Phase 3**: Replace static help with dynamic system\n4. **Phase 4**: Remove static command definitions and add validation tests\n\nThis implementation will create a self-documenting CLI that maintains accuracy and reduces the burden on developers to manually maintain help documentation.", "testStrategy": "", "status": "pending", - "dependencies": [2, 4], + "dependencies": [ + 2, + 4 + ], "priority": "medium", "subtasks": [ { @@ -5214,7 +6108,9 @@ "description": "Implement smart categorization logic to group commands into logical categories for the help menu", "details": "## Implementation Requirements\n\n### Core Function: `categorizeCommands(commandMetadata)`\n\n**Location**: Add to `ui.js` or `help-utils.js` module\n\n**Functionality**:\n1. **Category Definition System**:\n - Define category rules with command name patterns\n - Support keyword-based categorization from descriptions\n - Allow manual overrides for edge cases\n - Maintain existing category structure for consistency\n\n2. **Categorization Rules**:\n```javascript\nconst categoryRules = {\n 'Project Setup & Configuration': {\n commands: ['init', 'models'],\n patterns: [/^models/, /^init/],\n keywords: ['setup', 'configure', 'initialization'],\n color: 'blue'\n },\n 'Task Generation': {\n commands: ['parse-prd', 'generate'],\n patterns: [/^parse/, /^generate/],\n keywords: ['create', 'generate', 'parse'],\n color: 'cyan'\n },\n 'Task Management': {\n commands: ['list', 'set-status', 'update', 'add-task', 'remove-task'],\n patterns: [/^(list|set-|update|add-|remove-)/, /status$/],\n keywords: ['manage', 'update', 'modify', 'status'],\n color: 'green'\n },\n 'Subtask Management': {\n commands: ['add-subtask', 'remove-subtask', 'clear-subtasks'],\n patterns: [/subtask/],\n keywords: ['subtask', 'sub-task'],\n color: 'yellow'\n },\n 'Task Analysis & Breakdown': {\n commands: ['analyze-complexity', 'complexity-report', 'expand', 'research'],\n patterns: [/^(analyze|complexity|expand|research)/],\n keywords: ['analyze', 'complexity', 'expand', 'research', 'breakdown'],\n color: 'magenta'\n },\n 'Task Navigation & Viewing': {\n commands: ['next', 'show'],\n patterns: [/^(next|show|view|display)/],\n keywords: ['view', 'show', 'display', 'navigate'],\n color: 'cyan'\n },\n 'Dependency Management': {\n commands: ['add-dependency', 'remove-dependency', 'validate-dependencies', 'fix-dependencies'],\n patterns: [/dependency|dependencies/],\n keywords: ['dependency', 'dependencies', 'depend'],\n color: 'blue'\n }\n};\n```\n\n3. **Categorization Algorithm**:\n - **Exact Match**: Check if command name is in category's command list\n - **Pattern Matching**: Test command name against regex patterns\n - **Keyword Analysis**: Search command description for category keywords\n - **Fallback Category**: Create \"Other Commands\" for uncategorized commands\n - **Priority System**: Handle commands that match multiple categories\n\n4. **Category Validation**:\n - Ensure all commands are categorized\n - Detect and warn about duplicate categorizations\n - Validate category color assignments\n - Check for empty categories\n\n### Technical Implementation:\n1. **Categorization Logic**:\n```javascript\nfunction categorizeCommands(commandMetadata) {\n const categorizedCommands = {};\n const uncategorized = [];\n \n // Initialize categories\n Object.keys(categoryRules).forEach(categoryName => {\n categorizedCommands[categoryName] = {\n ...categoryRules[categoryName],\n commands: []\n };\n });\n \n // Categorize each command\n Object.values(commandMetadata).forEach(command => {\n const category = findBestCategory(command);\n if (category) {\n categorizedCommands[category].commands.push(command);\n } else {\n uncategorized.push(command);\n }\n });\n \n // Handle uncategorized commands\n if (uncategorized.length > 0) {\n categorizedCommands['Other Commands'] = {\n color: 'gray',\n commands: uncategorized\n };\n }\n \n return categorizedCommands;\n}\n```\n\n2. **Best Category Detection**:\n - Score each category based on match strength\n - Prefer exact command name matches over patterns\n - Weight keyword matches by frequency and relevance\n - Return highest-scoring category\n\n3. **Dynamic Category Creation**:\n - Support adding new categories without code changes\n - Allow category rules to be loaded from configuration\n - Handle category inheritance and hierarchies\n\n### Testing Requirements:\n- Test categorization accuracy for all existing commands\n- Verify handling of new commands not in predefined lists\n- Test pattern matching and keyword detection\n- Validate category completeness and no duplicates", "status": "pending", - "dependencies": [1], + "dependencies": [ + 1 + ], "parentTaskId": 100 }, { @@ -5223,7 +6119,9 @@ "description": "Create the core help content generation system that formats command metadata into user-friendly help text", "details": "## Implementation Requirements\n\n### Core Function: `generateHelpContent(categorizedCommands)`\n\n**Location**: Replace existing `displayHelp()` logic in `ui.js`\n\n**Functionality**:\n1. **Help Section Generation**:\n - Generate header with tool name and version\n - Create usage section with basic syntax\n - Build categorized command sections\n - Add footer with additional resources\n\n2. **Command Formatting Logic**:\n```javascript\nfunction formatCommand(command) {\n const { name, description, options, arguments: args, aliases } = command;\n \n // Build usage line\n let usage = `task-master ${name}`;\n \n // Add arguments\n if (args && args.length > 0) {\n args.forEach(arg => {\n if (arg.required) {\n usage += ` <${arg.name}>`;\n } else {\n usage += ` [${arg.name}]`;\n }\n });\n }\n \n // Add options indicator\n if (options && options.length > 0) {\n usage += ' [options]';\n }\n \n // Format aliases\n const aliasText = aliases && aliases.length > 0 \n ? ` (aliases: ${aliases.join(', ')})` \n : '';\n \n return {\n usage,\n description: description || 'No description available',\n aliasText,\n options: formatOptions(options)\n };\n}\n```\n\n3. **Option Formatting**:\n - Format flags with proper spacing and alignment\n - Include descriptions and default values\n - Highlight required vs optional parameters\n - Group related options together\n\n4. **Category Section Generation**:\n```javascript\nfunction generateCategorySection(categoryName, categoryData) {\n const { color, commands } = categoryData;\n \n let section = `\\n${chalk[color].bold(categoryName)}:\\n`;\n \n commands.forEach(command => {\n const formatted = formatCommand(command);\n section += ` ${chalk.cyan(formatted.usage)}${formatted.aliasText}\\n`;\n section += ` ${formatted.description}\\n`;\n \n if (formatted.options.length > 0) {\n section += ` Options:\\n`;\n formatted.options.forEach(option => {\n section += ` ${option.flags.padEnd(20)} ${option.description}\\n`;\n });\n }\n section += '\\n';\n });\n \n return section;\n}\n```\n\n5. **Responsive Formatting**:\n - Detect terminal width for optimal formatting\n - Adjust column widths based on content length\n - Handle long descriptions with proper wrapping\n - Maintain consistent indentation and spacing\n\n### Technical Implementation:\n1. **Content Assembly**:\n - Build help content in logical sections\n - Apply consistent styling and colors\n - Handle empty categories gracefully\n - Support different output formats (terminal, plain text)\n\n2. **Performance Optimization**:\n - Cache generated help content\n - Lazy-load command metadata only when needed\n - Minimize string concatenation overhead\n - Support incremental updates\n\n3. **Accessibility Features**:\n - Support no-color output for accessibility\n - Provide plain text fallbacks\n - Ensure proper screen reader compatibility\n - Support different terminal capabilities\n\n4. **Customization Options**:\n - Allow filtering by category\n - Support command-specific help\n - Enable verbose vs compact modes\n - Provide search functionality\n\n### Integration Points:\n1. **Replace Existing displayHelp()**:\n - Maintain same function signature\n - Preserve existing color scheme\n - Keep backward compatibility\n - Update all call sites\n\n2. **Add New Help Variants**:\n - `displayHelp(category)` - Show specific category\n - `displayCommandHelp(commandName)` - Detailed command help\n - `displayHelpSearch(query)` - Search-based help\n\n### Testing Requirements:\n- Test help generation for all command categories\n- Verify formatting consistency across different terminals\n- Test with various terminal widths and capabilities\n- Validate color output and no-color fallbacks\n- Performance testing with large command sets", "status": "pending", - "dependencies": [2], + "dependencies": [ + 2 + ], "parentTaskId": 100 }, { @@ -5232,7 +6130,9 @@ "description": "Replace the static help system with the new dynamic help generation and ensure seamless integration", "details": "## Implementation Requirements\n\n### Core Integration Tasks:\n\n1. **Replace displayHelp() Function**:\n - **Location**: `ui.js` lines 434-734\n - **Action**: Replace static help content with dynamic generation\n - **Preserve**: Existing function signature and color scheme\n - **Enhance**: Add new parameters for filtering and customization\n\n2. **Update Function Signature**:\n```javascript\n// Current: displayHelp()\n// New: displayHelp(options = {})\nfunction displayHelp(options = {}) {\n const {\n category = null, // Filter by specific category\n command = null, // Show help for specific command\n search = null, // Search query for commands\n verbose = false, // Show detailed help\n noColor = false // Disable colors for accessibility\n } = options;\n \n // Dynamic help generation logic\n}\n```\n\n3. **Integration with commands.js**:\n - **Access Program Instance**: Get reference to Commander.js program\n - **Timing**: Ensure commands are fully registered before help generation\n - **Caching**: Cache command metadata to avoid repeated parsing\n\n4. **Update Help Command Registration**:\n```javascript\n// In commands.js, update help command\nprogram\n .command('help [command]')\n .description('Display help information')\n .option('-c, --category <category>', 'Show help for specific category')\n .option('-s, --search <query>', 'Search commands by keyword')\n .option('-v, --verbose', 'Show detailed help information')\n .option('--no-color', 'Disable colored output')\n .action(async (command, options) => {\n displayHelp({\n command,\n category: options.category,\n search: options.search,\n verbose: options.verbose,\n noColor: !options.color\n });\n });\n```\n\n5. **Fallback and Error Handling**:\n - **Graceful Degradation**: Fall back to static help if dynamic generation fails\n - **Error Recovery**: Handle malformed command definitions\n - **Performance**: Ensure help generation doesn't slow down CLI startup\n\n### Technical Implementation:\n\n1. **Program Instance Access**:\n```javascript\n// Method 1: Pass program instance to displayHelp\nfunction displayHelp(options = {}, programInstance = null) {\n if (!programInstance) {\n // Fallback to static help or error\n console.warn('Dynamic help unavailable, using static fallback');\n return displayStaticHelp();\n }\n \n const commandMetadata = extractCommandMetadata(programInstance);\n const categorizedCommands = categorizeCommands(commandMetadata);\n return generateHelpContent(categorizedCommands, options);\n}\n\n// Method 2: Global program reference\nlet globalProgramInstance = null;\nexport function setProgramInstance(program) {\n globalProgramInstance = program;\n}\n```\n\n2. **Initialization Sequence**:\n - Commands are registered in `commands.js`\n - Program instance is made available to help system\n - Help system caches command metadata on first use\n - Subsequent help calls use cached data\n\n3. **Backward Compatibility**:\n - Maintain existing `displayHelp()` calls without parameters\n - Preserve existing color scheme and formatting style\n - Keep same output structure for scripts that parse help output\n\n4. **Performance Optimization**:\n - Cache command metadata after first extraction\n - Lazy-load help content generation\n - Minimize impact on CLI startup time\n - Support incremental cache updates\n\n### Integration Points:\n\n1. **Update All Help Call Sites**:\n - Search codebase for `displayHelp()` calls\n - Update calls to pass program instance or use global reference\n - Test all help invocation paths\n\n2. **Enhanced Help Commands**:\n - `task-master help` - General help (existing behavior)\n - `task-master help <command>` - Command-specific help\n - `task-master help --category <cat>` - Category-specific help\n - `task-master help --search <query>` - Search-based help\n\n3. **Error Handling Integration**:\n - Update error messages to suggest relevant help commands\n - Provide contextual help suggestions based on failed commands\n - Integrate with existing error reporting system\n\n### Testing Requirements:\n\n1. **Integration Testing**:\n - Test help system with all existing commands\n - Verify backward compatibility with existing help calls\n - Test new help command options and parameters\n\n2. **Performance Testing**:\n - Measure help generation time with full command set\n - Test CLI startup time impact\n - Verify caching effectiveness\n\n3. **Compatibility Testing**:\n - Test with different terminal types and capabilities\n - Verify color output and no-color modes\n - Test with various screen sizes and widths\n\n4. **Error Scenario Testing**:\n - Test behavior with malformed command definitions\n - Verify fallback to static help when needed\n - Test graceful handling of missing metadata\n\n### Migration Strategy:\n\n1. **Phase 1**: Implement dynamic help system alongside existing static help\n2. **Phase 2**: Update help command to use dynamic system with fallback\n3. **Phase 3**: Replace all displayHelp() calls with dynamic version\n4. **Phase 4**: Remove static help content and cleanup old code\n5. **Phase 5**: Add enhanced help features (search, filtering, etc.)", "status": "pending", - "dependencies": [3], + "dependencies": [ + 3 + ], "parentTaskId": 100 }, { @@ -5241,7 +6141,9 @@ "description": "Implement advanced help features including command search, category filtering, and contextual help suggestions", "details": "## Implementation Requirements\n\n### Enhanced Help Features:\n\n1. **Command Search Functionality**:\n```javascript\nfunction searchCommands(query, commandMetadata) {\n const results = [];\n const searchTerms = query.toLowerCase().split(' ');\n \n Object.values(commandMetadata).forEach(command => {\n let score = 0;\n \n // Search in command name (highest weight)\n if (command.name.toLowerCase().includes(query.toLowerCase())) {\n score += 10;\n }\n \n // Search in description (medium weight)\n if (command.description && command.description.toLowerCase().includes(query.toLowerCase())) {\n score += 5;\n }\n \n // Search in option descriptions (lower weight)\n command.options?.forEach(option => {\n if (option.description.toLowerCase().includes(query.toLowerCase())) {\n score += 2;\n }\n });\n \n // Fuzzy matching for command names\n if (fuzzyMatch(command.name, query)) {\n score += 3;\n }\n \n if (score > 0) {\n results.push({ command, score });\n }\n });\n \n return results.sort((a, b) => b.score - a.score);\n}\n```\n\n2. **Category Filtering**:\n - Allow users to view help for specific categories only\n - Support partial category name matching\n - Provide category list when invalid category specified\n - Enable multiple category selection\n\n3. **Contextual Help Suggestions**:\n```javascript\nfunction suggestRelatedCommands(commandName, commandMetadata) {\n const suggestions = [];\n const command = commandMetadata[commandName];\n \n if (!command) return suggestions;\n \n // Find commands in same category\n const category = findCommandCategory(commandName);\n if (category) {\n suggestions.push(...getCategoryCommands(category));\n }\n \n // Find commands with similar names\n Object.keys(commandMetadata).forEach(name => {\n if (name !== commandName && similarity(name, commandName) > 0.6) {\n suggestions.push(commandMetadata[name]);\n }\n });\n \n // Find commands with related functionality\n const keywords = extractKeywords(command.description);\n keywords.forEach(keyword => {\n const related = findCommandsByKeyword(keyword, commandMetadata);\n suggestions.push(...related);\n });\n \n return deduplicateAndScore(suggestions);\n}\n```\n\n4. **Interactive Help Mode**:\n - Implement step-by-step help wizard\n - Guide users through command selection\n - Provide examples and use cases\n - Support help history and bookmarks\n\n### Advanced Features:\n\n1. **Help Caching and Performance**:\n```javascript\nclass HelpCache {\n constructor() {\n this.cache = new Map();\n this.lastUpdate = null;\n this.commandMetadata = null;\n }\n \n getHelp(key, generator) {\n if (this.cache.has(key) && !this.isStale()) {\n return this.cache.get(key);\n }\n \n const content = generator();\n this.cache.set(key, content);\n return content;\n }\n \n invalidate() {\n this.cache.clear();\n this.lastUpdate = Date.now();\n }\n \n isStale() {\n return Date.now() - this.lastUpdate > 300000; // 5 minutes\n }\n}\n```\n\n2. **Help Export and Documentation**:\n - Export help content to markdown format\n - Generate man pages from command metadata\n - Create HTML documentation\n - Support JSON export for API documentation\n\n3. **Accessibility Enhancements**:\n - Screen reader friendly output\n - High contrast mode support\n - Keyboard navigation for interactive help\n - Alternative text descriptions for visual elements\n\n4. **Internationalization Support**:\n - Support for multiple languages\n - Localized command descriptions\n - Cultural formatting preferences\n - RTL language support\n\n### Command-Specific Help Features:\n\n1. **Detailed Command Help**:\n```javascript\nfunction displayCommandHelp(commandName, commandMetadata) {\n const command = commandMetadata[commandName];\n if (!command) {\n console.error(`Command '${commandName}' not found.`);\n suggestSimilarCommands(commandName, commandMetadata);\n return;\n }\n \n console.log(chalk.cyan.bold(`\\\\n${command.name.toUpperCase()} COMMAND HELP\\\\n`));\n console.log(`Description: ${command.description}\\\\n`);\n \n // Usage examples\n if (command.examples) {\n console.log(chalk.yellow.bold('Examples:'));\n command.examples.forEach(example => {\n console.log(` ${chalk.green(example.command)}`);\n console.log(` ${example.description}\\\\n`);\n });\n }\n \n // Detailed options\n if (command.options && command.options.length > 0) {\n console.log(chalk.yellow.bold('Options:'));\n command.options.forEach(option => {\n console.log(` ${chalk.cyan(option.flags.padEnd(20))} ${option.description}`);\n if (option.defaultValue) {\n console.log(`${' '.repeat(22)}Default: ${option.defaultValue}`);\n }\n if (option.examples) {\n console.log(`${' '.repeat(22)}Example: ${option.examples[0]}`);\n }\n });\n }\n \n // Related commands\n const related = suggestRelatedCommands(commandName, commandMetadata);\n if (related.length > 0) {\n console.log(chalk.yellow.bold('\\\\nRelated Commands:'));\n related.slice(0, 5).forEach(cmd => {\n console.log(` ${chalk.cyan(cmd.name)} - ${cmd.description}`);\n });\n }\n}\n```\n\n2. **Usage Examples Generation**:\n - Auto-generate common usage patterns\n - Include real-world scenarios\n - Show before/after examples\n - Provide troubleshooting tips\n\n### Error Integration:\n\n1. **Smart Error Messages**:\n```javascript\nfunction enhanceErrorWithHelp(error, commandName, commandMetadata) {\n console.error(chalk.red(error.message));\n \n // Suggest correct usage\n if (commandMetadata[commandName]) {\n console.log(chalk.yellow('\\\\nCorrect usage:'));\n console.log(` ${formatCommandUsage(commandMetadata[commandName])}`);\n }\n \n // Suggest similar commands\n const suggestions = findSimilarCommands(commandName, commandMetadata);\n if (suggestions.length > 0) {\n console.log(chalk.yellow('\\\\nDid you mean:'));\n suggestions.slice(0, 3).forEach(cmd => {\n console.log(` ${chalk.cyan(cmd.name)} - ${cmd.description}`);\n });\n }\n \n // Provide help command\n console.log(chalk.gray(`\\\\nFor more help: task-master help ${commandName}`));\n}\n```\n\n### Testing Requirements:\n\n1. **Search Functionality Testing**:\n - Test search accuracy with various queries\n - Verify fuzzy matching and scoring\n - Test performance with large command sets\n - Validate search result ranking\n\n2. **Feature Integration Testing**:\n - Test all new help command options\n - Verify category filtering accuracy\n - Test contextual suggestions relevance\n - Validate caching behavior\n\n3. **Accessibility Testing**:\n - Test with screen readers\n - Verify keyboard navigation\n - Test color contrast and no-color modes\n - Validate output formatting\n\n4. **Performance Testing**:\n - Measure search response times\n - Test caching effectiveness\n - Verify memory usage with large datasets\n - Test concurrent help requests\n\n### Documentation Updates:\n\n1. **Update README**:\n - Document new help features\n - Provide usage examples\n - Update command reference\n - Add troubleshooting section\n\n2. **Create Help Documentation**:\n - Comprehensive help system guide\n - Advanced usage patterns\n - Customization options\n - Integration examples", "status": "pending", - "dependencies": [4], + "dependencies": [ + 4 + ], "parentTaskId": 100 }, { @@ -5250,7 +6152,9 @@ "description": "Implement thorough testing for the dynamic help system and update all relevant documentation", "details": "## Implementation Requirements\n\n### Testing Strategy:\n\n1. **Unit Tests for Core Functions**:\n```javascript\n// tests/unit/help-system.test.js\ndescribe('Dynamic Help System', () => {\n describe('extractCommandMetadata', () => {\n test('should extract basic command information', () => {\n const mockProgram = createMockProgram();\n const metadata = extractCommandMetadata(mockProgram);\n \n expect(metadata).toHaveProperty('init');\n expect(metadata.init.name).toBe('init');\n expect(metadata.init.description).toBeDefined();\n expect(metadata.init.options).toBeArray();\n });\n \n test('should handle commands with complex options', () => {\n const mockProgram = createComplexMockProgram();\n const metadata = extractCommandMetadata(mockProgram);\n \n expect(metadata.parseRrd.options).toHaveLength(5);\n expect(metadata.parseRrd.options[0]).toHaveProperty('flags');\n expect(metadata.parseRrd.options[0]).toHaveProperty('description');\n });\n \n test('should handle missing descriptions gracefully', () => {\n const mockProgram = createIncompleteProgram();\n const metadata = extractCommandMetadata(mockProgram);\n \n expect(metadata.undocumented.description).toBe('No description available');\n });\n });\n \n describe('categorizeCommands', () => {\n test('should categorize commands correctly', () => {\n const mockMetadata = createMockMetadata();\n const categorized = categorizeCommands(mockMetadata);\n \n expect(categorized).toHaveProperty('Project Setup & Configuration');\n expect(categorized['Project Setup & Configuration'].commands).toContainEqual(\n expect.objectContaining({ name: 'init' })\n );\n });\n \n test('should handle uncategorized commands', () => {\n const mockMetadata = { unknownCommand: { name: 'unknown', description: 'test' } };\n const categorized = categorizeCommands(mockMetadata);\n \n expect(categorized).toHaveProperty('Other Commands');\n expect(categorized['Other Commands'].commands).toHaveLength(1);\n });\n });\n \n describe('generateHelpContent', () => {\n test('should generate properly formatted help content', () => {\n const mockCategorized = createMockCategorizedCommands();\n const content = generateHelpContent(mockCategorized);\n \n expect(content).toContain('Task Master CLI');\n expect(content).toContain('Project Setup & Configuration');\n expect(content).toContain('task-master init');\n });\n \n test('should handle empty categories', () => {\n const emptyCategorized = { 'Empty Category': { commands: [] } };\n const content = generateHelpContent(emptyCategorized);\n \n expect(content).not.toContain('Empty Category');\n });\n });\n});\n```\n\n2. **Integration Tests**:\n```javascript\n// tests/integration/help-integration.test.js\ndescribe('Help System Integration', () => {\n test('should integrate with actual CLI commands', async () => {\n const { program } = await import('../../scripts/modules/commands.js');\n const metadata = extractCommandMetadata(program);\n \n // Verify all expected commands are present\n const expectedCommands = ['init', 'parse-prd', 'list', 'add-task', 'expand'];\n expectedCommands.forEach(cmd => {\n expect(metadata).toHaveProperty(cmd);\n });\n });\n \n test('should maintain backward compatibility', () => {\n const originalHelp = captureConsoleOutput(() => {\n displayHelp(); // Original function call\n });\n \n expect(originalHelp).toContain('Task Master CLI');\n expect(originalHelp).toContain('Available Commands');\n });\n \n test('should handle help command with options', () => {\n const categoryHelp = captureConsoleOutput(() => {\n displayHelp({ category: 'Task Management' });\n });\n \n expect(categoryHelp).toContain('Task Management');\n expect(categoryHelp).toContain('list');\n expect(categoryHelp).not.toContain('init'); // Should not contain other categories\n });\n});\n```\n\n3. **Performance Tests**:\n```javascript\n// tests/performance/help-performance.test.js\ndescribe('Help System Performance', () => {\n test('should extract metadata within acceptable time', () => {\n const start = performance.now();\n const metadata = extractCommandMetadata(largeMockProgram);\n const end = performance.now();\n \n expect(end - start).toBeLessThan(100); // Should complete in under 100ms\n });\n \n test('should cache help content effectively', () => {\n const cache = new HelpCache();\n \n const start1 = performance.now();\n const content1 = cache.getHelp('main', () => generateHelpContent(mockData));\n const end1 = performance.now();\n \n const start2 = performance.now();\n const content2 = cache.getHelp('main', () => generateHelpContent(mockData));\n const end2 = performance.now();\n \n expect(content1).toBe(content2);\n expect(end2 - start2).toBeLessThan((end1 - start1) / 10); // Cached should be 10x faster\n });\n});\n```\n\n4. **Accessibility Tests**:\n```javascript\n// tests/accessibility/help-accessibility.test.js\ndescribe('Help System Accessibility', () => {\n test('should provide no-color output', () => {\n const noColorHelp = captureConsoleOutput(() => {\n displayHelp({ noColor: true });\n });\n \n // Should not contain ANSI color codes\n expect(noColorHelp).not.toMatch(/\\u001b\\[[0-9;]*m/);\n });\n \n test('should format content for screen readers', () => {\n const accessibleHelp = generateAccessibleHelp(mockMetadata);\n \n expect(accessibleHelp).toContain('Heading level 1: Task Master CLI');\n expect(accessibleHelp).toContain('List item: init command');\n });\n});\n```\n\n### Mock Data and Utilities:\n\n1. **Mock Program Creation**:\n```javascript\n// tests/utils/mock-program.js\nexport function createMockProgram() {\n return {\n commands: [\n {\n _name: 'init',\n _description: 'Initialize a new Task Master project',\n _aliases: [],\n options: [\n {\n flags: '-y, --yes',\n description: 'Skip prompts and use defaults',\n required: false,\n defaultValue: false\n }\n ],\n _args: []\n },\n {\n _name: 'list',\n _description: 'List all tasks',\n _aliases: ['ls'],\n options: [\n {\n flags: '-s, --status <status>',\n description: 'Filter by status',\n required: false\n }\n ],\n _args: []\n }\n ]\n };\n}\n```\n\n2. **Test Utilities**:\n```javascript\n// tests/utils/test-helpers.js\nexport function captureConsoleOutput(fn) {\n const originalLog = console.log;\n let output = '';\n \n console.log = (...args) => {\n output += args.join(' ') + '\\n';\n };\n \n try {\n fn();\n return output;\n } finally {\n console.log = originalLog;\n }\n}\n\nexport function stripAnsiColors(text) {\n return text.replace(/\\u001b\\[[0-9;]*m/g, '');\n}\n```\n\n### Documentation Updates:\n\n1. **README.md Updates**:\n```markdown\n## Enhanced Help System\n\nTask Master now features a dynamic help system that automatically generates help content from your CLI commands.\n\n### Basic Help\n```bash\ntask-master help\n```\n\n### Category-Specific Help\n```bash\ntask-master help --category \"Task Management\"\n```\n\n### Command Search\n```bash\ntask-master help --search \"dependency\"\n```\n\n### Command-Specific Help\n```bash\ntask-master help add-task\n```\n\n### Advanced Options\n- `--verbose`: Show detailed help with examples\n- `--no-color`: Disable colored output for accessibility\n- `--search <query>`: Search commands by keyword\n- `--category <name>`: Filter by command category\n```\n\n2. **API Documentation**:\n```markdown\n## Help System API\n\n### Core Functions\n\n#### `extractCommandMetadata(programInstance)`\nExtracts command metadata from a Commander.js program instance.\n\n**Parameters:**\n- `programInstance` (Object): Commander.js program instance\n\n**Returns:**\n- Object containing command metadata\n\n#### `categorizeCommands(commandMetadata)`\nCategorizes commands into logical groups.\n\n**Parameters:**\n- `commandMetadata` (Object): Command metadata from extractCommandMetadata\n\n**Returns:**\n- Object with categorized commands\n\n#### `generateHelpContent(categorizedCommands, options)`\nGenerates formatted help content.\n\n**Parameters:**\n- `categorizedCommands` (Object): Categorized command data\n- `options` (Object): Formatting options\n\n**Returns:**\n- String containing formatted help content\n```\n\n3. **Developer Guide**:\n```markdown\n## Extending the Help System\n\n### Adding New Categories\nTo add a new command category, update the `categoryRules` object:\n\n```javascript\nconst categoryRules = {\n 'Your New Category': {\n commands: ['command1', 'command2'],\n patterns: [/^pattern/],\n keywords: ['keyword1', 'keyword2'],\n color: 'blue'\n }\n};\n```\n\n### Custom Help Formatters\nCreate custom help formatters for specific use cases:\n\n```javascript\nfunction customHelpFormatter(command) {\n // Your custom formatting logic\n return formattedContent;\n}\n```\n```\n\n### Continuous Integration:\n\n1. **GitHub Actions Workflow**:\n```yaml\n# .github/workflows/help-system-tests.yml\nname: Help System Tests\n\non: [push, pull_request]\n\njobs:\n test-help-system:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-node@v3\n with:\n node-version: '18'\n - run: npm ci\n - run: npm run test:help-system\n - run: npm run test:help-accessibility\n - run: npm run test:help-performance\n```\n\n2. **Test Scripts in package.json**:\n```json\n{\n \"scripts\": {\n \"test:help-system\": \"jest tests/unit/help-system.test.js tests/integration/help-integration.test.js\",\n \"test:help-accessibility\": \"jest tests/accessibility/help-accessibility.test.js\",\n \"test:help-performance\": \"jest tests/performance/help-performance.test.js\",\n \"test:help-all\": \"npm run test:help-system && npm run test:help-accessibility && npm run test:help-performance\"\n }\n}\n```\n\n### Quality Assurance:\n\n1. **Code Coverage Requirements**:\n - Minimum 90% coverage for help system functions\n - 100% coverage for critical path functions\n - Integration test coverage for all CLI commands\n\n2. **Performance Benchmarks**:\n - Help generation: < 100ms for full help\n - Command search: < 50ms for typical queries\n - Cache hit ratio: > 95% for repeated requests\n\n3. **Accessibility Standards**:\n - WCAG 2.1 AA compliance for terminal output\n - Screen reader compatibility testing\n - High contrast mode support\n - Keyboard navigation support", "status": "pending", - "dependencies": [5], + "dependencies": [ + 5 + ], "parentTaskId": 100 } ] @@ -5280,7 +6184,9 @@ "description": "Implement intelligent content formatting to convert Task Master tasks into properly formatted GitHub issues", "details": "## Implementation Requirements\n\n### Core Formatting Service\n```javascript\n// scripts/modules/github/task-formatter.js\nclass TaskToGitHubFormatter {\n constructor(options = {}) {\n this.options = {\n includeTaskId: true,\n includeMetadata: true,\n convertSubtasksToChecklist: true,\n addTaskMasterReference: true,\n ...options\n };\n }\n \n formatTaskAsIssue(task, exportOptions = {}) {\n return {\n title: this.formatTitle(task, exportOptions),\n body: this.formatBody(task, exportOptions),\n labels: this.formatLabels(task, exportOptions),\n assignees: this.formatAssignees(task, exportOptions)\n };\n }\n}\n```\n\n### Title Formatting\n```javascript\nformatTitle(task, options) {\n let title = task.title;\n \n // Add task ID prefix if enabled\n if (this.options.includeTaskId && !options.hideTaskId) {\n title = `[Task ${task.id}] ${title}`;\n }\n \n // Add priority indicator for high priority tasks\n if (task.priority === 'high') {\n title = `🔥 ${title}`;\n }\n \n // Truncate if too long (GitHub limit is 256 characters)\n if (title.length > 250) {\n title = title.substring(0, 247) + '...';\n }\n \n return title;\n}\n```\n\n### Body Formatting\n```javascript\nformatBody(task, options) {\n let body = '';\n \n // Header with task metadata\n if (this.options.includeMetadata) {\n body += this.formatMetadataSection(task);\n }\n \n // Main description\n if (task.description) {\n body += `## Description\\n\\n${task.description}\\n\\n`;\n }\n \n // Implementation details\n if (task.details) {\n body += `## Implementation Details\\n\\n${this.formatDetails(task.details)}\\n\\n`;\n }\n \n // Test strategy\n if (task.testStrategy) {\n body += `## Test Strategy\\n\\n${task.testStrategy}\\n\\n`;\n }\n \n // Subtasks as checklist\n if (task.subtasks && task.subtasks.length > 0 && this.options.convertSubtasksToChecklist) {\n body += this.formatSubtasksSection(task.subtasks);\n }\n \n // Dependencies\n if (task.dependencies && task.dependencies.length > 0) {\n body += this.formatDependenciesSection(task.dependencies);\n }\n \n // Task Master reference\n if (this.options.addTaskMasterReference) {\n body += this.formatTaskMasterReference(task);\n }\n \n return body;\n}\n```\n\n### Metadata Section\n```javascript\nformatMetadataSection(task) {\n let metadata = '## Task Information\\n\\n';\n metadata += `| Field | Value |\\n`;\n metadata += `|-------|-------|\\n`;\n metadata += `| **Task ID** | ${task.id} |\\n`;\n metadata += `| **Priority** | ${this.formatPriority(task.priority)} |\\n`;\n metadata += `| **Status** | ${this.formatStatus(task.status)} |\\n`;\n \n if (task.dependencies && task.dependencies.length > 0) {\n metadata += `| **Dependencies** | ${task.dependencies.join(', ')} |\\n`;\n }\n \n if (task.complexityScore) {\n metadata += `| **Complexity** | ${task.complexityScore}/10 |\\n`;\n }\n \n metadata += '\\n';\n return metadata;\n}\n```\n\n### Subtasks Formatting\n```javascript\nformatSubtasksSection(subtasks) {\n let section = '## Subtasks\\n\\n';\n \n subtasks.forEach(subtask => {\n const checked = subtask.status === 'done' ? 'x' : ' ';\n section += `- [${checked}] **${subtask.title}**`;\n \n if (subtask.description) {\n section += ` - ${subtask.description}`;\n }\n \n section += '\\n';\n \n // Add subtask details as indented content\n if (subtask.details) {\n const indentedDetails = subtask.details\n .split('\\n')\n .map(line => ` ${line}`)\n .join('\\n');\n section += `${indentedDetails}\\n`;\n }\n });\n \n section += '\\n';\n return section;\n}\n```\n\n### Label Generation\n```javascript\nformatLabels(task, options) {\n const labels = [];\n \n // Always add task-master label\n labels.push('task-master');\n \n // Priority-based labels\n if (task.priority === 'high') {\n labels.push('priority:high');\n } else if (task.priority === 'low') {\n labels.push('priority:low');\n }\n \n // Status-based labels\n if (task.status === 'in-progress') {\n labels.push('in-progress');\n }\n \n // Complexity-based labels\n if (task.complexityScore >= 8) {\n labels.push('complexity:high');\n } else if (task.complexityScore <= 3) {\n labels.push('complexity:low');\n }\n \n // Custom labels from options\n if (options.labels) {\n labels.push(...options.labels);\n }\n \n return labels;\n}\n```\n\n### Markdown Conversion\n```javascript\nformatDetails(details) {\n // Convert Task Master specific formatting to GitHub markdown\n let formatted = details;\n \n // Convert code blocks\n formatted = formatted.replace(/```(\\w+)?\\n([\\s\\S]*?)```/g, (match, lang, code) => {\n return `\\`\\`\\`${lang || ''}\\n${code}\\`\\`\\``;\n });\n \n // Convert inline code\n formatted = formatted.replace(/`([^`]+)`/g, '`$1`');\n \n // Convert headers\n formatted = formatted.replace(/^(#{1,6})\\s+(.+)$/gm, '$1 $2');\n \n // Convert lists\n formatted = formatted.replace(/^\\s*[-*+]\\s+(.+)$/gm, '- $1');\n \n // Convert numbered lists\n formatted = formatted.replace(/^\\s*\\d+\\.\\s+(.+)$/gm, (match, content, offset, string) => {\n const lineNumber = string.substring(0, offset).split('\\n').length;\n return `${lineNumber}. ${content}`;\n });\n \n return formatted;\n}\n```\n\n### Task Master Reference\n```javascript\nformatTaskMasterReference(task) {\n return `\\n---\\n\\n*This issue was exported from Task Master*\\n\\n` +\n `**Original Task**: #${task.id}\\n` +\n `**Exported**: ${new Date().toISOString()}\\n` +\n `**Task Master Project**: ${this.getProjectName()}\\n`;\n}\n```\n\n### Template System\n```javascript\nclass IssueTemplateManager {\n constructor() {\n this.templates = {\n default: new DefaultTemplate(),\n bug: new BugTemplate(),\n feature: new FeatureTemplate(),\n epic: new EpicTemplate()\n };\n }\n \n applyTemplate(task, templateName, options) {\n const template = this.templates[templateName] || this.templates.default;\n return template.format(task, options);\n }\n}\n\nclass BugTemplate extends TaskToGitHubFormatter {\n formatTitle(task, options) {\n return `🐛 [BUG] ${task.title}`;\n }\n \n formatBody(task, options) {\n let body = '## Bug Report\\n\\n';\n body += `**Task ID**: ${task.id}\\n\\n`;\n \n if (task.description) {\n body += `### Description\\n${task.description}\\n\\n`;\n }\n \n if (task.details) {\n body += `### Steps to Reproduce\\n${task.details}\\n\\n`;\n }\n \n body += `### Expected Behavior\\n<!-- Describe what should happen -->\\n\\n`;\n body += `### Actual Behavior\\n<!-- Describe what actually happens -->\\n\\n`;\n \n return body + this.formatTaskMasterReference(task);\n }\n}\n```\n\n### Testing Requirements\n- Unit tests for all formatting methods\n- Test with various task structures (with/without subtasks, different priorities)\n- Markdown conversion accuracy testing\n- Template system testing\n- Character limit and truncation testing\n- Special character handling (emojis, unicode)\n- Large content handling and performance testing", "status": "pending", - "dependencies": [1], + "dependencies": [ + 1 + ], "parentTaskId": 101 }, { @@ -5289,7 +6195,9 @@ "description": "Create a robust system for managing links between Task Master tasks and GitHub issues, including validation and synchronization", "details": "## Implementation Requirements\n\n### Core Link Management Service\n```javascript\n// scripts/modules/github/link-manager.js\nclass GitHubLinkManager {\n constructor(githubService) {\n this.githubService = githubService;\n this.linkCache = new Map();\n }\n \n async addGitHubLinkToTask(taskId, issueUrl, issueNumber, repository) {\n const task = await this.getTask(taskId);\n \n // Initialize metadata if it doesn't exist\n if (!task.metadata) {\n task.metadata = {};\n }\n \n // Add GitHub link information\n task.metadata.githubIssue = {\n url: issueUrl,\n number: issueNumber,\n repository: repository,\n exportedAt: new Date().toISOString(),\n lastValidated: new Date().toISOString(),\n status: 'active'\n };\n \n // Update task in storage\n await this.updateTask(taskId, task);\n \n // Regenerate task files to include the link\n await this.regenerateTaskFiles();\n \n // Cache the link for quick access\n this.linkCache.set(taskId, task.metadata.githubIssue);\n \n return task.metadata.githubIssue;\n }\n}\n```\n\n### Task Metadata Schema\n```javascript\n// Enhanced task structure with GitHub integration\nconst taskWithGitHubLink = {\n id: 42,\n title: \"Example Task\",\n description: \"Task description\",\n // ... other task fields ...\n metadata: {\n githubIssue: {\n url: \"https://github.com/owner/repo/issues/123\",\n number: 123,\n repository: \"owner/repo\",\n exportedAt: \"2024-01-15T10:30:00.000Z\",\n lastValidated: \"2024-01-15T10:30:00.000Z\",\n status: \"active\", // active, closed, deleted, invalid\n syncEnabled: true,\n lastSyncAt: \"2024-01-15T10:30:00.000Z\"\n },\n // Other metadata fields...\n }\n};\n```\n\n### Link Validation System\n```javascript\nclass LinkValidator {\n constructor(githubService) {\n this.githubService = githubService;\n }\n \n async validateGitHubLink(taskId, linkInfo) {\n try {\n const { repository, number } = linkInfo;\n const [owner, repo] = repository.split('/');\n \n // Check if issue still exists\n const issue = await this.githubService.getIssue(owner, repo, number);\n \n if (!issue) {\n return {\n valid: false,\n status: 'deleted',\n message: 'GitHub issue no longer exists'\n };\n }\n \n // Check if issue is closed\n const status = issue.state === 'open' ? 'active' : 'closed';\n \n // Update link status if changed\n if (linkInfo.status !== status) {\n await this.updateLinkStatus(taskId, status);\n }\n \n return {\n valid: true,\n status: status,\n issue: issue,\n lastValidated: new Date().toISOString()\n };\n \n } catch (error) {\n if (error.status === 404) {\n return {\n valid: false,\n status: 'deleted',\n message: 'GitHub issue not found'\n };\n } else if (error.status === 403) {\n return {\n valid: false,\n status: 'access_denied',\n message: 'Access denied to GitHub issue'\n };\n }\n \n throw error;\n }\n }\n \n async validateAllLinks() {\n const tasks = await this.getAllTasksWithGitHubLinks();\n const results = [];\n \n for (const task of tasks) {\n if (task.metadata?.githubIssue) {\n const result = await this.validateGitHubLink(task.id, task.metadata.githubIssue);\n results.push({\n taskId: task.id,\n ...result\n });\n }\n }\n \n return results;\n }\n}\n```\n\n### Task File Enhancement\n```javascript\n// Enhanced task file generation with GitHub links\nclass TaskFileGenerator {\n generateTaskFile(task) {\n let content = this.generateBasicTaskContent(task);\n \n // Add GitHub integration section if link exists\n if (task.metadata?.githubIssue) {\n content += this.generateGitHubSection(task.metadata.githubIssue);\n }\n \n return content;\n }\n \n generateGitHubSection(githubInfo) {\n let section = '\\n## GitHub Integration\\n\\n';\n \n section += `**GitHub Issue**: [#${githubInfo.number}](${githubInfo.url})\\n`;\n section += `**Repository**: ${githubInfo.repository}\\n`;\n section += `**Status**: ${this.formatGitHubStatus(githubInfo.status)}\\n`;\n section += `**Exported**: ${new Date(githubInfo.exportedAt).toLocaleDateString()}\\n`;\n \n if (githubInfo.lastValidated) {\n section += `**Last Validated**: ${new Date(githubInfo.lastValidated).toLocaleDateString()}\\n`;\n }\n \n if (githubInfo.status === 'closed') {\n section += '\\n> ⚠️ **Note**: The linked GitHub issue has been closed.\\n';\n } else if (githubInfo.status === 'deleted') {\n section += '\\n> ❌ **Warning**: The linked GitHub issue no longer exists.\\n';\n }\n \n return section;\n }\n \n formatGitHubStatus(status) {\n const statusMap = {\n 'active': '🟢 Active',\n 'closed': '🔴 Closed',\n 'deleted': '❌ Deleted',\n 'invalid': '⚠️ Invalid',\n 'access_denied': '🔒 Access Denied'\n };\n \n return statusMap[status] || status;\n }\n}\n```\n\n### GitHub Issue Reference System\n```javascript\nclass GitHubReferenceManager {\n generateTaskMasterReference(taskId, projectName, taskUrl = null) {\n let reference = '\\n\\n---\\n\\n';\n reference += '**🔗 Task Master Integration**\\n\\n';\n reference += `- **Task ID**: #${taskId}\\n`;\n reference += `- **Project**: ${projectName}\\n`;\n reference += `- **Exported**: ${new Date().toISOString()}\\n`;\n \n if (taskUrl) {\n reference += `- **Task URL**: [View in Task Master](${taskUrl})\\n`;\n }\n \n reference += '\\n*This issue is managed by Task Master. Changes made here may be overwritten during synchronization.*\\n';\n \n return reference;\n }\n \n async updateGitHubIssueWithTaskReference(issueUrl, taskId, projectName) {\n const { owner, repo, number } = this.parseGitHubUrl(issueUrl);\n const issue = await this.githubService.getIssue(owner, repo, number);\n \n if (!issue) {\n throw new Error('GitHub issue not found');\n }\n \n // Check if Task Master reference already exists\n const hasReference = issue.body.includes('Task Master Integration');\n \n if (!hasReference) {\n const reference = this.generateTaskMasterReference(taskId, projectName);\n const updatedBody = issue.body + reference;\n \n await this.githubService.updateIssue(owner, repo, number, {\n body: updatedBody\n });\n }\n }\n}\n```\n\n### Link Synchronization\n```javascript\nclass LinkSynchronizer {\n constructor(githubService, linkManager) {\n this.githubService = githubService;\n this.linkManager = linkManager;\n }\n \n async syncTaskWithGitHubIssue(taskId) {\n const task = await this.getTask(taskId);\n const githubInfo = task.metadata?.githubIssue;\n \n if (!githubInfo || !githubInfo.syncEnabled) {\n return { synced: false, reason: 'Sync not enabled' };\n }\n \n const { repository, number } = githubInfo;\n const [owner, repo] = repository.split('/');\n \n try {\n const issue = await this.githubService.getIssue(owner, repo, number);\n \n if (!issue) {\n await this.linkManager.updateLinkStatus(taskId, 'deleted');\n return { synced: false, reason: 'Issue deleted' };\n }\n \n // Sync status changes\n const changes = await this.detectChanges(task, issue);\n \n if (changes.length > 0) {\n await this.applyChanges(taskId, changes);\n await this.linkManager.updateLastSync(taskId);\n \n return { \n synced: true, \n changes: changes,\n lastSync: new Date().toISOString()\n };\n }\n \n return { synced: true, changes: [] };\n \n } catch (error) {\n console.error(`Failed to sync task ${taskId}:`, error);\n return { synced: false, error: error.message };\n }\n }\n \n async detectChanges(task, issue) {\n const changes = [];\n \n // Check if GitHub issue was closed and task is still pending\n if (issue.state === 'closed' && task.status !== 'done') {\n changes.push({\n type: 'status',\n from: task.status,\n to: 'done',\n reason: 'GitHub issue closed'\n });\n }\n \n // Check if GitHub issue was reopened and task is done\n if (issue.state === 'open' && task.status === 'done') {\n changes.push({\n type: 'status',\n from: task.status,\n to: 'in-progress',\n reason: 'GitHub issue reopened'\n });\n }\n \n return changes;\n }\n}\n```\n\n### CLI Integration\n```javascript\n// Add link management commands\nprogram\n .command('github-link')\n .description('Manage GitHub links for tasks')\n .option('--validate', 'Validate all GitHub links')\n .option('--sync <taskId>', 'Sync specific task with GitHub')\n .option('--sync-all', 'Sync all linked tasks')\n .option('--remove <taskId>', 'Remove GitHub link from task')\n .action(async (options) => {\n if (options.validate) {\n await validateAllGitHubLinks();\n } else if (options.sync) {\n await syncTaskWithGitHub(options.sync);\n } else if (options.syncAll) {\n await syncAllTasksWithGitHub();\n } else if (options.remove) {\n await removeGitHubLink(options.remove);\n }\n });\n```\n\n### Testing Requirements\n- Unit tests for link management operations\n- Integration tests with GitHub API\n- Link validation testing (valid, invalid, deleted issues)\n- Synchronization testing with various scenarios\n- Error handling testing (network failures, auth issues)\n- Performance testing with large numbers of linked tasks\n- Cache behavior testing\n- Concurrent operation testing", "status": "pending", - "dependencies": [2], + "dependencies": [ + 2 + ], "parentTaskId": 101 }, { @@ -5298,7 +6206,9 @@ "description": "Implement the command-line interface and MCP tools for GitHub export functionality", "details": "## Implementation Requirements\n\n### CLI Command Implementation\n```javascript\n// In scripts/modules/commands.js\nprogram\n .command('github-export')\n .description('Export Task Master task to GitHub issue with bidirectional linking')\n .requiredOption('-i, --id <taskId>', 'Task ID to export')\n .requiredOption('-r, --repo <owner/repo>', 'Target GitHub repository (owner/repo format)')\n .option('-t, --token <token>', 'GitHub Personal Access Token (or use GITHUB_TOKEN env var)')\n .option('--title <title>', 'Override the GitHub issue title')\n .option('--labels <labels>', 'Comma-separated list of GitHub labels to add')\n .option('--assignees <assignees>', 'Comma-separated list of GitHub usernames to assign')\n .option('--milestone <milestone>', 'GitHub milestone number or title')\n .option('--template <template>', 'Issue template to use (bug, feature, epic, default)')\n .option('--include-subtasks', 'Include subtasks as checklist items in the issue')\n .option('--separate-subtasks', 'Create separate GitHub issues for each subtask')\n .option('--dry-run', 'Preview the issue content without actually creating it')\n .option('--force', 'Overwrite existing GitHub link if task is already linked')\n .option('--no-link-back', 'Do not add Task Master reference to the GitHub issue')\n .option('--sync', 'Enable automatic synchronization between task and issue')\n .action(async (options) => {\n try {\n await handleGitHubExport(options);\n } catch (error) {\n console.error(chalk.red('GitHub export failed:'), error.message);\n process.exit(1);\n }\n });\n```\n\n### Core Export Handler\n```javascript\n// scripts/modules/github/github-export-handler.js\nasync function handleGitHubExport(options) {\n const {\n id: taskId,\n repo: repository,\n token,\n title: titleOverride,\n labels,\n assignees,\n milestone,\n template = 'default',\n includeSubtasks,\n separateSubtasks,\n dryRun,\n force,\n linkBack = true,\n sync = false\n } = options;\n\n // Validate inputs\n await validateExportOptions(options);\n \n // Get task details\n const task = await getTask(taskId);\n if (!task) {\n throw new Error(`Task ${taskId} not found`);\n }\n \n // Check for existing GitHub link\n if (task.metadata?.githubIssue && !force) {\n const existingUrl = task.metadata.githubIssue.url;\n console.log(chalk.yellow(`Task ${taskId} is already linked to GitHub issue: ${existingUrl}`));\n console.log(chalk.gray('Use --force to overwrite the existing link'));\n return;\n }\n \n // Initialize GitHub service\n const githubToken = token || process.env.GITHUB_TOKEN;\n if (!githubToken) {\n throw new Error('GitHub token required. Use --token flag or set GITHUB_TOKEN environment variable');\n }\n \n const githubService = new GitHubExportService(githubToken);\n const formatter = new TaskToGitHubFormatter();\n const linkManager = new GitHubLinkManager(githubService);\n \n // Format task content\n const exportOptions = {\n titleOverride,\n labels: labels ? labels.split(',').map(l => l.trim()) : [],\n assignees: assignees ? assignees.split(',').map(a => a.trim()) : [],\n milestone,\n template,\n includeSubtasks,\n linkBack\n };\n \n const issueData = formatter.formatTaskAsIssue(task, exportOptions);\n \n // Dry run - just show what would be created\n if (dryRun) {\n console.log(chalk.cyan('\\\\n=== DRY RUN - GitHub Issue Preview ===\\\\n'));\n console.log(chalk.bold('Title:'), issueData.title);\n console.log(chalk.bold('\\\\nLabels:'), issueData.labels.join(', ') || 'None');\n console.log(chalk.bold('\\\\nAssignees:'), issueData.assignees.join(', ') || 'None');\n console.log(chalk.bold('\\\\nBody:'));\n console.log(issueData.body);\n console.log(chalk.cyan('\\\\n=== End Preview ===\\\\n'));\n return;\n }\n \n // Show progress\n console.log(chalk.blue(`Exporting task ${taskId} to GitHub repository ${repository}...`));\n \n // Export to GitHub\n const result = await githubService.exportTask(task, repository, exportOptions);\n \n if (result.success) {\n console.log(chalk.green(`✅ Successfully exported task ${taskId} to GitHub!`));\n console.log(chalk.cyan(`GitHub Issue: ${result.issueUrl}`));\n \n // Add bidirectional link\n await linkManager.addGitHubLinkToTask(taskId, result.issueUrl, result.issue.number, repository);\n \n if (linkBack) {\n await linkManager.updateGitHubIssueWithTaskReference(result.issueUrl, taskId, getProjectName());\n }\n \n if (sync) {\n await linkManager.enableSync(taskId);\n console.log(chalk.blue('🔄 Synchronization enabled for this task'));\n }\n \n // Handle subtasks if requested\n if (separateSubtasks && task.subtasks && task.subtasks.length > 0) {\n console.log(chalk.blue('\\\\nExporting subtasks as separate issues...'));\n await exportSubtasksAsSeparateIssues(task.subtasks, repository, githubService, linkManager);\n }\n \n } else {\n throw new Error(result.error || 'Export failed');\n }\n}\n```\n\n### MCP Tool Implementation\n```javascript\n// mcp-server/src/tools/github-export.js\nimport { githubExportDirect } from '../core/direct-functions/github-export-direct.js';\nimport { handleApiResult, withNormalizedProjectRoot } from './utils.js';\n\nexport function registerGitHubExportTool(server) {\n server.addTool({\n name: \"github_export_task\",\n description: \"Export a Task Master task to GitHub issue with bidirectional linking\",\n parameters: {\n type: \"object\",\n properties: {\n taskId: {\n type: \"string\",\n description: \"Task ID to export (required)\"\n },\n repository: {\n type: \"string\", \n description: \"GitHub repository in owner/repo format (required)\"\n },\n token: {\n type: \"string\",\n description: \"GitHub Personal Access Token (optional if GITHUB_TOKEN env var is set)\"\n },\n options: {\n type: \"object\",\n properties: {\n title: {\n type: \"string\",\n description: \"Override the GitHub issue title\"\n },\n labels: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"GitHub labels to add to the issue\"\n },\n assignees: {\n type: \"array\", \n items: { type: \"string\" },\n description: \"GitHub usernames to assign to the issue\"\n },\n milestone: {\n type: \"string\",\n description: \"GitHub milestone number or title\"\n },\n template: {\n type: \"string\",\n enum: [\"default\", \"bug\", \"feature\", \"epic\"],\n description: \"Issue template to use\"\n },\n includeSubtasks: {\n type: \"boolean\",\n description: \"Include subtasks as checklist items\"\n },\n separateSubtasks: {\n type: \"boolean\", \n description: \"Create separate issues for subtasks\"\n },\n dryRun: {\n type: \"boolean\",\n description: \"Preview without creating the issue\"\n },\n force: {\n type: \"boolean\",\n description: \"Overwrite existing GitHub link\"\n },\n linkBack: {\n type: \"boolean\",\n description: \"Add Task Master reference to GitHub issue\"\n },\n enableSync: {\n type: \"boolean\",\n description: \"Enable automatic synchronization\"\n }\n }\n },\n projectRoot: {\n type: \"string\",\n description: \"Project root directory path\"\n }\n },\n required: [\"taskId\", \"repository\"]\n },\n execute: withNormalizedProjectRoot(async (args, { log, session }) => {\n try {\n const result = await githubExportDirect(args, log, { session });\n return handleApiResult(result, log);\n } catch (error) {\n log(`GitHub export error: ${error.message}`);\n return {\n success: false,\n error: error.message\n };\n }\n })\n });\n}\n```\n\n### Direct Function Implementation\n```javascript\n// mcp-server/src/core/direct-functions/github-export-direct.js\nimport { handleGitHubExport } from '../../../../scripts/modules/github/github-export-handler.js';\nimport { createLogWrapper } from '../../tools/utils.js';\n\nexport async function githubExportDirect(args, log, context = {}) {\n const { session } = context;\n const mcpLog = createLogWrapper(log);\n \n try {\n // Prepare options for the core handler\n const options = {\n id: args.taskId,\n repo: args.repository,\n token: args.token,\n ...args.options,\n projectRoot: args.projectRoot\n };\n \n // Call the core export handler\n const result = await handleGitHubExport(options, {\n session,\n mcpLog,\n outputFormat: 'json' // Request JSON output for MCP\n });\n \n return {\n success: true,\n data: {\n taskId: args.taskId,\n repository: args.repository,\n issueUrl: result.issueUrl,\n issueNumber: result.issue.number,\n exportedAt: new Date().toISOString(),\n message: `Successfully exported task ${args.taskId} to GitHub issue #${result.issue.number}`\n }\n };\n \n } catch (error) {\n mcpLog(`GitHub export failed: ${error.message}`);\n return {\n success: false,\n error: error.message\n };\n }\n}\n```\n\n### Validation Functions\n```javascript\n// scripts/modules/github/validation.js\nasync function validateExportOptions(options) {\n const { id: taskId, repo: repository, token } = options;\n \n // Validate task ID\n if (!taskId || !/^\\\\d+(\\\\.\\\\d+)*$/.test(taskId)) {\n throw new Error('Invalid task ID format');\n }\n \n // Validate repository format\n if (!repository || !/^[a-zA-Z0-9._-]+\\\\/[a-zA-Z0-9._-]+$/.test(repository)) {\n throw new Error('Repository must be in owner/repo format');\n }\n \n // Validate GitHub token\n const githubToken = token || process.env.GITHUB_TOKEN;\n if (!githubToken) {\n throw new Error('GitHub token is required');\n }\n \n if (!/^gh[ps]_[a-zA-Z0-9]{36,}$/.test(githubToken)) {\n console.warn(chalk.yellow('Warning: GitHub token format appears invalid'));\n }\n \n // Validate labels format\n if (options.labels) {\n const labels = options.labels.split(',').map(l => l.trim());\n for (const label of labels) {\n if (label.length > 50) {\n throw new Error(`Label \"${label}\" is too long (max 50 characters)`);\n }\n }\n }\n \n // Validate assignees format\n if (options.assignees) {\n const assignees = options.assignees.split(',').map(a => a.trim());\n for (const assignee of assignees) {\n if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(assignee)) {\n throw new Error(`Invalid GitHub username: ${assignee}`);\n }\n }\n }\n}\n```\n\n### Help Integration\n```javascript\n// Add to help system\nconst githubExportHelp = {\n command: 'github-export',\n description: 'Export Task Master task to GitHub issue',\n usage: 'task-master github-export --id=<taskId> --repo=<owner/repo> [options]',\n examples: [\n {\n command: 'task-master github-export --id=42 --repo=myorg/myproject',\n description: 'Export task 42 to GitHub repository'\n },\n {\n command: 'task-master github-export --id=42 --repo=myorg/myproject --labels=\"bug,urgent\" --assignees=\"john,jane\"',\n description: 'Export with custom labels and assignees'\n },\n {\n command: 'task-master github-export --id=42 --repo=myorg/myproject --dry-run',\n description: 'Preview the GitHub issue without creating it'\n },\n {\n command: 'task-master github-export --id=42 --repo=myorg/myproject --template=bug --sync',\n description: 'Export using bug template with sync enabled'\n }\n ],\n options: [\n { flag: '--id <taskId>', description: 'Task ID to export (required)' },\n { flag: '--repo <owner/repo>', description: 'GitHub repository (required)' },\n { flag: '--token <token>', description: 'GitHub Personal Access Token' },\n { flag: '--title <title>', description: 'Override issue title' },\n { flag: '--labels <labels>', description: 'Comma-separated labels' },\n { flag: '--assignees <users>', description: 'Comma-separated assignees' },\n { flag: '--milestone <milestone>', description: 'GitHub milestone' },\n { flag: '--template <template>', description: 'Issue template (bug, feature, epic)' },\n { flag: '--include-subtasks', description: 'Include subtasks as checklist' },\n { flag: '--separate-subtasks', description: 'Create separate issues for subtasks' },\n { flag: '--dry-run', description: 'Preview without creating' },\n { flag: '--force', description: 'Overwrite existing GitHub link' },\n { flag: '--no-link-back', description: 'Skip Task Master reference in issue' },\n { flag: '--sync', description: 'Enable automatic synchronization' }\n ]\n};\n```\n\n### Testing Requirements\n- Unit tests for CLI option parsing and validation\n- Integration tests for MCP tool functionality\n- End-to-end tests with real GitHub repositories\n- Error handling tests for various failure scenarios\n- Dry-run functionality testing\n- Template system testing\n- Subtask export testing (both checklist and separate issues)\n- Authentication and authorization testing\n- Rate limiting and retry logic testing", "status": "pending", - "dependencies": [3], + "dependencies": [ + 3 + ], "parentTaskId": 101 }, { @@ -5307,7 +6217,9 @@ "description": "Implement thorough testing for the GitHub export system and create comprehensive documentation", "details": "## Implementation Requirements\n\n### Testing Strategy\n\n#### 1. Unit Tests\n```javascript\n// tests/unit/github-export.test.js\ndescribe('GitHub Export System', () => {\n describe('GitHubExportService', () => {\n test('should validate repository access', async () => {\n const service = new GitHubExportService('mock-token');\n const mockGitHub = jest.spyOn(service, 'validateRepositoryAccess');\n \n await service.exportTask(mockTask, 'owner', 'repo');\n expect(mockGitHub).toHaveBeenCalledWith('owner', 'repo');\n });\n \n test('should handle authentication errors', async () => {\n const service = new GitHubExportService('invalid-token');\n \n await expect(service.exportTask(mockTask, 'owner', 'repo'))\n .rejects.toThrow('Authentication failed');\n });\n \n test('should respect rate limits', async () => {\n const service = new GitHubExportService('valid-token');\n const rateLimiter = jest.spyOn(service.rateLimiter, 'removeTokens');\n \n await service.exportTask(mockTask, 'owner', 'repo');\n expect(rateLimiter).toHaveBeenCalled();\n });\n });\n \n describe('TaskToGitHubFormatter', () => {\n test('should format task title correctly', () => {\n const formatter = new TaskToGitHubFormatter();\n const task = { id: 42, title: 'Test Task', priority: 'high' };\n \n const result = formatter.formatTitle(task);\n expect(result).toBe('🔥 [Task 42] Test Task');\n });\n \n test('should truncate long titles', () => {\n const formatter = new TaskToGitHubFormatter();\n const longTitle = 'A'.repeat(300);\n const task = { id: 1, title: longTitle };\n \n const result = formatter.formatTitle(task);\n expect(result.length).toBeLessThanOrEqual(250);\n expect(result).toEndWith('...');\n });\n \n test('should format subtasks as checklist', () => {\n const formatter = new TaskToGitHubFormatter();\n const task = {\n id: 1,\n title: 'Parent Task',\n subtasks: [\n { title: 'Subtask 1', status: 'done' },\n { title: 'Subtask 2', status: 'pending' }\n ]\n };\n \n const result = formatter.formatBody(task);\n expect(result).toContain('- [x] **Subtask 1**');\n expect(result).toContain('- [ ] **Subtask 2**');\n });\n \n test('should generate appropriate labels', () => {\n const formatter = new TaskToGitHubFormatter();\n const task = { priority: 'high', complexityScore: 9 };\n \n const labels = formatter.formatLabels(task);\n expect(labels).toContain('task-master');\n expect(labels).toContain('priority:high');\n expect(labels).toContain('complexity:high');\n });\n });\n \n describe('GitHubLinkManager', () => {\n test('should add GitHub link to task metadata', async () => {\n const linkManager = new GitHubLinkManager(mockGitHubService);\n const taskId = '42';\n const issueUrl = 'https://github.com/owner/repo/issues/123';\n \n await linkManager.addGitHubLinkToTask(taskId, issueUrl, 123, 'owner/repo');\n \n const task = await getTask(taskId);\n expect(task.metadata.githubIssue).toBeDefined();\n expect(task.metadata.githubIssue.url).toBe(issueUrl);\n expect(task.metadata.githubIssue.number).toBe(123);\n });\n \n test('should validate GitHub links', async () => {\n const linkManager = new GitHubLinkManager(mockGitHubService);\n const linkInfo = {\n repository: 'owner/repo',\n number: 123,\n status: 'active'\n };\n \n mockGitHubService.getIssue.mockResolvedValue({ state: 'open' });\n \n const result = await linkManager.validateGitHubLink('42', linkInfo);\n expect(result.valid).toBe(true);\n expect(result.status).toBe('active');\n });\n });\n});\n```\n\n#### 2. Integration Tests\n```javascript\n// tests/integration/github-export-integration.test.js\ndescribe('GitHub Export Integration', () => {\n let testRepository;\n let githubToken;\n \n beforeAll(() => {\n githubToken = process.env.GITHUB_TEST_TOKEN;\n testRepository = process.env.GITHUB_TEST_REPO || 'taskmaster-test/test-repo';\n \n if (!githubToken) {\n throw new Error('GITHUB_TEST_TOKEN environment variable required for integration tests');\n }\n });\n \n test('should export task to real GitHub repository', async () => {\n const task = createTestTask();\n const service = new GitHubExportService(githubToken);\n \n const result = await service.exportTask(task, testRepository, {\n labels: ['test', 'automated'],\n template: 'default'\n });\n \n expect(result.success).toBe(true);\n expect(result.issueUrl).toMatch(/https:\\\\/\\\\/github\\\\.com\\\\/.+\\\\/issues\\\\/\\\\d+/);\n \n // Cleanup: Close the test issue\n await service.updateIssue(testRepository, result.issue.number, { state: 'closed' });\n });\n \n test('should handle repository permission errors', async () => {\n const task = createTestTask();\n const service = new GitHubExportService(githubToken);\n \n await expect(service.exportTask(task, 'private/inaccessible-repo'))\n .rejects.toThrow(/permission|access/i);\n });\n \n test('should respect GitHub API rate limits', async () => {\n const service = new GitHubExportService(githubToken);\n const tasks = Array.from({ length: 10 }, () => createTestTask());\n \n const startTime = Date.now();\n \n for (const task of tasks) {\n await service.exportTask(task, testRepository);\n }\n \n const endTime = Date.now();\n const duration = endTime - startTime;\n \n // Should take some time due to rate limiting\n expect(duration).toBeGreaterThan(1000);\n });\n});\n```\n\n#### 3. CLI Tests\n```javascript\n// tests/cli/github-export-cli.test.js\ndescribe('GitHub Export CLI', () => {\n test('should validate required options', async () => {\n const result = await runCLI(['github-export']);\n \n expect(result.exitCode).toBe(1);\n expect(result.stderr).toContain('required option');\n });\n \n test('should perform dry run correctly', async () => {\n const result = await runCLI([\n 'github-export',\n '--id=42',\n '--repo=owner/repo',\n '--dry-run'\n ]);\n \n expect(result.exitCode).toBe(0);\n expect(result.stdout).toContain('DRY RUN');\n expect(result.stdout).toContain('GitHub Issue Preview');\n });\n \n test('should handle invalid task ID', async () => {\n const result = await runCLI([\n 'github-export',\n '--id=invalid',\n '--repo=owner/repo'\n ]);\n \n expect(result.exitCode).toBe(1);\n expect(result.stderr).toContain('Invalid task ID');\n });\n \n test('should validate repository format', async () => {\n const result = await runCLI([\n 'github-export',\n '--id=42',\n '--repo=invalid-format'\n ]);\n \n expect(result.exitCode).toBe(1);\n expect(result.stderr).toContain('owner/repo format');\n });\n});\n```\n\n#### 4. MCP Tool Tests\n```javascript\n// tests/mcp/github-export-mcp.test.js\ndescribe('GitHub Export MCP Tool', () => {\n test('should export task via MCP', async () => {\n const args = {\n taskId: '42',\n repository: 'owner/repo',\n token: 'test-token',\n options: {\n labels: ['test'],\n dryRun: true\n }\n };\n \n const result = await githubExportDirect(args, mockLog, { session: mockSession });\n \n expect(result.success).toBe(true);\n expect(result.data.taskId).toBe('42');\n });\n \n test('should handle MCP tool errors', async () => {\n const args = {\n taskId: 'invalid',\n repository: 'owner/repo'\n };\n \n const result = await githubExportDirect(args, mockLog, { session: mockSession });\n \n expect(result.success).toBe(false);\n expect(result.error).toBeDefined();\n });\n});\n```\n\n### Mock Data and Utilities\n```javascript\n// tests/utils/github-mocks.js\nexport function createTestTask() {\n return {\n id: Math.floor(Math.random() * 1000),\n title: 'Test Task',\n description: 'This is a test task for GitHub export',\n details: 'Implementation details for the test task',\n priority: 'medium',\n status: 'pending',\n subtasks: [\n { title: 'Test Subtask 1', status: 'done' },\n { title: 'Test Subtask 2', status: 'pending' }\n ]\n };\n}\n\nexport function mockGitHubAPI() {\n return {\n getIssue: jest.fn(),\n createIssue: jest.fn(),\n updateIssue: jest.fn(),\n getRepository: jest.fn()\n };\n}\n\nexport function createMockGitHubResponse(issueNumber = 123) {\n return {\n id: issueNumber,\n number: issueNumber,\n title: 'Test Issue',\n body: 'Test issue body',\n state: 'open',\n html_url: `https://github.com/owner/repo/issues/${issueNumber}`,\n created_at: new Date().toISOString(),\n updated_at: new Date().toISOString()\n };\n}\n```\n\n### Documentation\n\n#### 1. User Guide\n```markdown\n# GitHub Export Feature\n\n## Overview\nThe GitHub Export feature allows you to create GitHub issues directly from your Task Master tasks, maintaining bidirectional links between tasks and issues.\n\n## Setup\n\n### 1. GitHub Token\nCreate a GitHub Personal Access Token with the following permissions:\n- `repo` (for private repositories)\n- `public_repo` (for public repositories)\n\nSet the token as an environment variable:\n```bash\nexport GITHUB_TOKEN=your_token_here\n```\n\n### 2. Basic Usage\n```bash\n# Export a task to GitHub\ntask-master github-export --id=42 --repo=myorg/myproject\n\n# Export with custom labels and assignees\ntask-master github-export --id=42 --repo=myorg/myproject \\\\\n --labels=\"bug,urgent\" --assignees=\"john,jane\"\n\n# Preview before creating\ntask-master github-export --id=42 --repo=myorg/myproject --dry-run\n```\n\n## Advanced Features\n\n### Templates\nUse predefined templates for different issue types:\n```bash\n# Bug report template\ntask-master github-export --id=42 --repo=myorg/myproject --template=bug\n\n# Feature request template\ntask-master github-export --id=42 --repo=myorg/myproject --template=feature\n```\n\n### Subtask Handling\n```bash\n# Include subtasks as checklist items\ntask-master github-export --id=42 --repo=myorg/myproject --include-subtasks\n\n# Create separate issues for each subtask\ntask-master github-export --id=42 --repo=myorg/myproject --separate-subtasks\n```\n\n### Synchronization\n```bash\n# Enable automatic synchronization\ntask-master github-export --id=42 --repo=myorg/myproject --sync\n```\n\n## Troubleshooting\n\n### Common Issues\n1. **Authentication Error**: Verify your GitHub token has the correct permissions\n2. **Repository Not Found**: Ensure the repository exists and you have access\n3. **Rate Limit Exceeded**: Wait for the rate limit to reset or use a different token\n\n### Link Management\n```bash\n# Validate all GitHub links\ntask-master github-link --validate\n\n# Sync specific task with GitHub\ntask-master github-link --sync 42\n\n# Remove GitHub link from task\ntask-master github-link --remove 42\n```\n```\n\n#### 2. API Documentation\n```markdown\n# GitHub Export API Reference\n\n## MCP Tool: github_export_task\n\n### Parameters\n- `taskId` (string, required): Task ID to export\n- `repository` (string, required): GitHub repository in owner/repo format\n- `token` (string, optional): GitHub Personal Access Token\n- `options` (object, optional): Export configuration\n\n### Options Object\n- `title` (string): Override issue title\n- `labels` (array): GitHub labels to add\n- `assignees` (array): GitHub usernames to assign\n- `milestone` (string): GitHub milestone\n- `template` (string): Issue template (bug, feature, epic, default)\n- `includeSubtasks` (boolean): Include subtasks as checklist\n- `separateSubtasks` (boolean): Create separate issues for subtasks\n- `dryRun` (boolean): Preview without creating\n- `force` (boolean): Overwrite existing GitHub link\n- `linkBack` (boolean): Add Task Master reference to issue\n- `enableSync` (boolean): Enable automatic synchronization\n\n### Response\n```json\n{\n \"success\": true,\n \"data\": {\n \"taskId\": \"42\",\n \"repository\": \"owner/repo\",\n \"issueUrl\": \"https://github.com/owner/repo/issues/123\",\n \"issueNumber\": 123,\n \"exportedAt\": \"2024-01-15T10:30:00.000Z\",\n \"message\": \"Successfully exported task 42 to GitHub issue #123\"\n }\n}\n```\n```\n\n### Performance Testing\n```javascript\n// tests/performance/github-export-performance.test.js\ndescribe('GitHub Export Performance', () => {\n test('should export large task within time limit', async () => {\n const largeTask = createLargeTask(); // Task with many subtasks and long content\n const service = new GitHubExportService('test-token');\n \n const startTime = performance.now();\n await service.exportTask(largeTask, 'owner/repo');\n const endTime = performance.now();\n \n expect(endTime - startTime).toBeLessThan(5000); // Should complete in under 5 seconds\n });\n \n test('should handle concurrent exports', async () => {\n const service = new GitHubExportService('test-token');\n const tasks = Array.from({ length: 5 }, () => createTestTask());\n \n const promises = tasks.map(task => service.exportTask(task, 'owner/repo'));\n const results = await Promise.all(promises);\n \n results.forEach(result => {\n expect(result.success).toBe(true);\n });\n });\n});\n```\n\n### Test Configuration\n```javascript\n// jest.config.js additions\nmodule.exports = {\n // ... existing config\n testEnvironment: 'node',\n setupFilesAfterEnv: ['<rootDir>/tests/setup/github-setup.js'],\n testMatch: [\n '**/tests/**/*.test.js',\n '**/tests/**/*.spec.js'\n ],\n collectCoverageFrom: [\n 'scripts/modules/github/**/*.js',\n 'mcp-server/src/tools/github-*.js',\n 'mcp-server/src/core/direct-functions/github-*.js'\n ],\n coverageThreshold: {\n global: {\n branches: 80,\n functions: 80,\n lines: 80,\n statements: 80\n }\n }\n};\n```\n\n### Continuous Integration\n```yaml\n# .github/workflows/github-export-tests.yml\nname: GitHub Export Tests\n\non: [push, pull_request]\n\njobs:\n test:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-node@v3\n with:\n node-version: '18'\n - run: npm ci\n - run: npm run test:github-export\n env:\n GITHUB_TEST_TOKEN: ${{ secrets.GITHUB_TEST_TOKEN }}\n GITHUB_TEST_REPO: ${{ secrets.GITHUB_TEST_REPO }}\n```", "status": "pending", - "dependencies": [4], + "dependencies": [ + 4 + ], "parentTaskId": 101 } ] @@ -5419,7 +6331,11 @@ "title": "Implement Tagged Task Lists System for Multi-Context Task Management", "description": "Develop a comprehensive tagged task lists system enabling users to organize, filter, and manage tasks across multiple contexts (e.g., personal, branch, version) with full backward compatibility.", "status": "in-progress", - "dependencies": [3, 11, 19], + "dependencies": [ + 3, + 11, + 19 + ], "priority": "medium", "details": "1. Extend the tasks.json schema to support a 'tags' structure, with 'master' as the default tag containing all existing tasks. Ensure seamless migration for users without tags.\n2. Add a 'defaultTag' configuration option to config.json in the global section, defaulting to 'master'.\n3. Implement tag management CLI commands: add-tag, delete, list, use (switch), rename, and copy. Each command should update the relevant data structures and persist changes.\n4. Update all existing task commands (list, add-task, set-status, etc.) to accept a --tag flag, filtering or applying actions within the specified tag context.\n5. Implement automatic tag creation from git branch names using a --from-branch flag, integrating with git APIs to detect current branch.\n6. Maintain the current tag state in .taskmaster/state.json with currentTag set to 'master' by default, ensuring session persistence and correct context switching.\n7. Guarantee backward compatibility: users without tags continue to operate in the 'master' context transparently.\n8. Provide comprehensive documentation and migration notes for users, and update help menus to reflect new tag-related features.", "testStrategy": "- Migrate an existing tasks.json and verify all tasks appear under the 'master' tag.\n- Create, delete, rename, and copy tags using add-tag and other commands; confirm correct data structure updates and persistence.\n- Switch between tags and verify task isolation and context switching.\n- Use --tag flag with all supported commands and confirm correct filtering and operation.\n- Test --from-branch flag by switching git branches and verifying tag creation and selection.\n- Simulate usage without tags to ensure backward compatibility.\n- Review documentation and help menus for accuracy and completeness.\n- Run automated and manual tests for all new and modified commands, including edge cases (e.g., duplicate tag names, tag deletion with tasks).", @@ -5437,7 +6353,9 @@ "id": 2, "title": "Implement Seamless Migration for Existing Users", "description": "Develop a migration script or logic to move existing tasks into the 'master' tag for users upgrading from previous versions.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Ensure no data loss and that users without tags continue to operate transparently.", "status": "done", "testStrategy": "Test migration on various legacy datasets and verify task integrity post-migration." @@ -5446,7 +6364,9 @@ "id": 3, "title": "Add 'defaultTag' Configuration Option to config.json Global Section", "description": "Introduce a 'defaultTag' field in the global section of config.json, defaulting to 'master', and update configuration handling logic.", - "dependencies": [1], + "dependencies": [ + 1 + ], "details": "Allow users to set and persist their preferred default tag in the global configuration section.\n<info added on 2025-06-11T20:46:57.669Z>\nAdded global.defaultTag configuration option to .taskmaster/config.json structure in assets/config.json. Implemented complete tags section including autoSwitchOnBranch and gitIntegration options. Created migrateConfigJson() function in utils.js to handle updating existing configuration files during the migration process. Configuration is automatically created and updated during the silent migration process to ensure seamless transition for existing users.\n</info added on 2025-06-11T20:46:57.669Z>", "status": "done", "testStrategy": "Check that the default tag is respected on startup and when creating new tasks." @@ -5455,7 +6375,10 @@ "id": 4, "title": "Develop Tag Management CLI Commands", "description": "Implement CLI commands for tag management: add-tag, delete, list, use (switch), rename, and copy, ensuring all changes are persisted.", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "details": "Each command should update the tasks.json and config files as needed. The primary command for creating tags should be 'add-tag' to maintain consistency with other task-master commands.\n<info added on 2025-06-12T07:14:51.761Z>\n✅ **COMPLETED: CLI Command Integration for Tag Management**\n\nSuccessfully implemented complete CLI command integration for all tag management functions with enhanced UX features:\n\n**Commands Implemented:**\n\n1. **`task-master tags [--show-metadata]`** - List all available tags\n - Shows tag names, task counts, completion status\n - Optional metadata display (creation date, description)\n - Dynamic table width that adapts to terminal size\n - Current tag indicator with visual highlighting\n\n2. **`task-master add-tag <name> [options]`** - Create new tags\n - `--copy-from-current` - Copy tasks from current tag\n - `--copy-from=<tag>` - Copy tasks from specified tag\n - `-d, --description <text>` - Set tag description\n - **Default behavior: Creates empty tags** (fixed from previous copying behavior)\n\n3. **`task-master delete-tag <name> [--yes]`** - Delete tags with enhanced safety\n - **Changed from `--force` to `--yes`** for consistency\n - **Double confirmation system** using inquirer:\n - First: Yes/No confirmation prompt\n - Second: Type tag name to confirm deletion\n - Visual warning box showing impact\n - Automatic current tag switching if deleting active tag\n\n4. **`task-master use-tag <name>`** - Switch tag contexts\n - Updates current tag in state.json\n - Validates tag existence before switching\n - Clear success messaging\n\n5. **`task-master rename-tag <old> <new>`** - Rename existing tags\n - Validates both source and target names\n - Updates current tag reference if renaming active tag\n\n6. **`task-master copy-tag <source> <target> [options]`** - Copy tags\n - `-d, --description <text>` - Set description for new tag\n - Deep copy of all tasks and metadata\n\n**Key Improvements Made:**\n\nEnhanced User Experience:\n- **Double confirmation for destructive operations** using inquirer prompts\n- **Consistent option naming** (`--yes` instead of `--force`)\n- **Dynamic table layouts** that use full terminal width\n- **Visual warning boxes** for dangerous operations\n- **Contextual help displays** on command errors\n\nTechnical Fixes:\n- **Fixed critical `_rawTaggedData` corruption bug** in readJSON/writeJSON cycle\n- **Dynamic task counting** instead of stored counters (eliminates sync issues)\n- **Master tag metadata enhancement** with creation dates and descriptions\n- **Proper error handling** with command-specific help displays\n\nCLI Integration:\n- **Added all commands to help menu** in ui.js under \"Tag Management\" section\n- **Comprehensive help functions** for each command with examples\n- **Error handlers with contextual help** for better user guidance\n- **Consistent command patterns** following established CLI conventions\n\n**Testing Completed:**\n- ✅ Created empty tags (default behavior)\n- ✅ Created tags with task copying (explicit flags)\n- ✅ Listed tags with and without metadata\n- ✅ Double confirmation for tag deletion\n- ✅ Tag switching and current tag persistence\n- ✅ Table width responsiveness\n- ✅ Master tag metadata enhancement\n- ✅ Error handling and help displays\n\n**Files Modified:**\n- `scripts/modules/commands.js` - Added all tag management commands\n- `scripts/modules/task-manager/tag-management.js` - Enhanced functions with inquirer\n- `scripts/modules/ui.js` - Added tag commands to help menu\n- Fixed critical data corruption bug in utils.js\n\nThe CLI integration is now complete and production-ready with enhanced safety features and improved user experience!\n</info added on 2025-06-12T07:14:51.761Z>", "status": "done", "testStrategy": "Unit test each CLI command for correct behavior and data persistence, specifically testing add-tag command." @@ -5464,7 +6387,9 @@ "id": 5, "title": "Update Task Commands to Support --tag Flag", "description": "Modify all existing task-related CLI commands (list, add-task, set-status, etc.) to accept a --tag flag, applying actions within the specified tag context.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Ensure commands filter or apply actions only to tasks within the selected tag.\n<info added on 2025-06-11T18:23:45.185Z>\nDependencies: [4, 13, 14] - Requires CLI commands foundation, MCP tools integration, and state management utilities to properly implement --tag flag support across both CLI and MCP interfaces.\n</info added on 2025-06-11T18:23:45.185Z>\n<info added on 2025-06-12T22:44:17.705Z>\n**CURRENT STATUS ANALYSIS - Commands Needing --tag Flag + projectRoot Fix**\n\nAfter fixing the migration bug in readJSON and updating `list` and `move` commands, here's the current status:\n\n**✅ COMPLETED:**\n- `list` command - Has projectRoot fix + tag support working\n- `move` command - Has projectRoot fix + tag support working \n\n**❌ STILL NEED BOTH --tag FLAG + projectRoot FIX:**\n\n**High Priority (Core Task Operations):**\n1. `show` - View specific tasks (needs tag context)\n2. `add-task` - Create tasks (needs tag context) \n3. `set-status` - Update task status (needs tag context)\n4. `next` - Find next task (needs tag context)\n\n**Medium Priority (Task Modification):**\n5. `update-task` - Update specific task (needs tag context)\n6. `update-subtask` - Update subtask (needs tag context)\n7. `add-subtask` - Add subtasks (needs tag context)\n8. `remove-task` - Remove tasks (needs tag context)\n9. `remove-subtask` - Remove subtasks (needs tag context)\n10. `clear-subtasks` - Clear subtasks (needs tag context)\n11. `expand` - Expand tasks (needs tag context)\n\n**Lower Priority (Dependencies & Analysis):**\n12. `add-dependency` - Add dependencies (needs tag context)\n13. `remove-dependency` - Remove dependencies (needs tag context)\n14. `validate-dependencies` - Validate deps (needs tag context)\n15. `fix-dependencies` - Fix deps (needs tag context)\n16. `generate` - Generate task files (needs tag context)\n17. `analyze-complexity` - Analyze complexity (needs tag context)\n18. `complexity-report` - View complexity report (needs tag context)\n\n**✅ DON'T NEED TAG SUPPORT:**\n- `init`, `models`, `parse-prd`, `research`, `migrate`, `sync-readme`\n- Tag management commands (they manage tags themselves)\n\n**NEXT STEPS:**\n1. Start with high-priority commands (`show`, `add-task`, `set-status`, `next`)\n2. Add `--tag` flag to each command\n3. Ensure `findProjectRoot()` is called and passed to underlying functions\n4. Update underlying functions to accept and use projectRoot parameter\n5. Test migration and tag resolution for each command\n\n**PATTERN TO FOLLOW:**\nSame pattern as `list` and `move` commands:\n- Add `--tag` option to CLI command\n- Call `findProjectRoot()` in action function\n- Pass `{ projectRoot }` context to underlying function\n- Update underlying function signature to accept context parameter\n- Pass projectRoot to readJSON/writeJSON calls\n</info added on 2025-06-12T22:44:17.705Z>\n<info added on 2025-06-12T22:47:22.415Z>\n**PROGRESS UPDATE - show Command Completed Successfully**\n\n✅ **COMPLETED: `show` command**\n- Added `--tag` flag support to CLI command\n- Fixed `findProjectRoot()` call and projectRoot passing\n- Updated `displayTaskById` function to accept context parameter with projectRoot\n- Updated `displayMultipleTasksSummary` function to accept context parameter\n- Fixed readJSON calls to include projectRoot for proper tag resolution and migration\n- **TESTED SUCCESSFULLY**: `task-master show 103` works perfectly with no errors\n\n**TECHNICAL DETAILS:**\n- CLI command now calls `findProjectRoot()` and passes `{ projectRoot, tag }` context\n- UI functions extract projectRoot from context and pass to `readJSON(tasksPath, projectRoot, tag)`\n- Migration logic now works correctly when viewing tasks\n- Both single task and multiple task views work properly\n\n**UPDATED STATUS - 1 of 4 High-Priority Commands Complete:**\n1. ✅ `show` - **COMPLETED** \n2. ❌ `add-task` - Create tasks (needs tag context)\n3. ❌ `set-status` - Update task status (needs tag context) \n4. ❌ `next` - Find next task (needs tag context)\n\n**NEXT ACTION:** Continue with `add-task` command following the same proven pattern:\n- Add `--tag` flag to CLI command\n- Call `findProjectRoot()` in action function \n- Pass `{ projectRoot, tag }` context to underlying function\n- Update underlying function to accept context and pass projectRoot to readJSON/writeJSON\n</info added on 2025-06-12T22:47:22.415Z>\n<info added on 2025-06-12T22:49:16.724Z>\n**PROGRESS UPDATE - add-task Command Completed Successfully**\n\n✅ **COMPLETED: `add-task` command**\n- Already had `--tag` flag support in CLI command\n- Already had `findProjectRoot()` call and projectRoot passing\n- Already had proper context object with `{ projectRoot, tag }`\n- Underlying `addTask` function already properly handles tag parameter and projectRoot\n- **TESTED SUCCESSFULLY**: `task-master add-task --prompt=\"Test task for tag support\" --priority=low` works perfectly with no errors\n\n**TECHNICAL DETAILS:**\n- CLI command already calls `findProjectRoot()` and passes `{ projectRoot, tag }` context\n- `addTask` function extracts projectRoot from context and passes to `readJSON(tasksPath, projectRoot)`\n- Migration logic works correctly when adding tasks\n- Tag resolution and context handling work properly\n\n**COMPLETED HIGH-PRIORITY COMMANDS:**\n1. ✅ `show` - **COMPLETED** \n2. ✅ `add-task` - **COMPLETED**\n3. ❌ `set-status` - Update task status (needs tag context)\n4. ❌ `next` - Find next task (needs tag context)\n\n**REMAINING WORK:**\nNext commands to fix: `set-status` and `next` commands following the same pattern.\n</info added on 2025-06-12T22:49:16.724Z>\n<info added on 2025-06-13T02:48:17.985Z>\n**FINAL PROGRESS UPDATE - Tag Management Issues Resolved**\n\n✅ **COMPLETED: All Tag Management Issues Fixed**\n\n**Major Issues Resolved:**\n1. **Rogue `\"created\"` property cleanup** - Fixed root-level `\"created\"` property in master tag that was outside metadata\n2. **Tags command error fixed** - Resolved undefined `taskCount` error by making calculation dynamic\n3. **Data corruption prevention** - Enhanced `writeJSON` to automatically filter rogue properties during write operations\n\n**Technical Fixes Applied:**\n- **Enhanced `writeJSON` function** to automatically clean up rogue `created` and `description` properties from tag objects\n- **Fixed `taskCount` calculation** to be dynamic (`tasks.length`) instead of hardcoded field\n- **Cleaned up existing corruption** in master tag through forced write operation\n- **All `created` properties** now properly located in `metadata` objects only\n\n**Commands Status Update:**\n✅ **COMPLETED HIGH-PRIORITY COMMANDS:**\n1. ✅ `show` - Added --tag flag + fixed projectRoot passing\n2. ✅ `add-task` - Already had proper tag support \n3. ✅ `list` - Already had proper tag support\n4. ✅ `move` - Already had proper tag support\n5. ✅ `tags` - Fixed errors and working perfectly\n\n**REMAINING COMMANDS TO FIX:**\n❌ `set-status` - Update task status (needs tag context)\n❌ `next` - Find next task (needs tag context)\n❌ `update-task` - Update specific task (needs tag context)\n❌ `update-subtask` - Update subtask (needs tag context)\n❌ `add-subtask` - Add subtasks (needs tag context)\n❌ `remove-task` - Remove tasks (needs tag context)\n❌ `remove-subtask` - Remove subtasks (needs tag context)\n\n**Data Integrity Status:**\n- ✅ Migration logic working correctly\n- ✅ Tag creation/deletion working with proper metadata\n- ✅ File corruption prevention active\n- ✅ Automatic cleanup during write operations\n- ✅ Tagged task lists system fully functional\n\n**Next Steps:** Continue with remaining commands (set-status, next, etc.) to complete task 103.5\n</info added on 2025-06-13T02:48:17.985Z>\n<info added on 2025-06-13T03:57:35.440Z>\n**CRITICAL BUG FIX & PROGRESS UPDATE**\n\n✅ **COMPLETED: Fixed critical tag-deletion bug** affecting `add-subtask` and likely other commands.\n- **Root Cause:** The core `writeJSON` function was not accepting `projectRoot` and `tag` parameters, causing it to overwrite the entire `tasks.json` file with only the data for the current tag, deleting all other tags.\n- **The Fix:** The `writeJSON` signature and logic have been corrected to properly accept `projectRoot` and `tag` context. It now correctly merges resolved tag data back into the full tagged data structure before writing, preserving data integrity.\n- **Impact:** This single, critical fix likely resolves the tag-deletion bug for all commands that modify the tasks file.\n\n**UPDATED COMMAND STATUS:**\nMany commands previously listed as \"remaining\" are now likely fixed due to the `writeJSON` correction.\n\n- ✅ `list`, `show`, `add-task`, `move`\n- ✅ `add-subtask` (tested and confirmed fixed)\n- ❓ **Likely Fixed (Pending Confirmation):** `set-status`, `remove-task`, `remove-subtask`, `clear-subtasks`, `update-task`, `update-subtask`, `expand`, `generate`, and all dependency commands.\n\n**NEXT STEPS:**\nSystematically test the \"Likely Fixed\" commands to confirm they no longer corrupt the `tasks.json` file. Then, implement the `--tag` flag for those that still need it.\n</info added on 2025-06-13T03:57:35.440Z>\n<info added on 2025-06-13T03:58:43.036Z>\n**PROGRESS UPDATE - `set-status` command verified**\n\n✅ **COMPLETED: `set-status` command is confirmed fixed.**\n- **Test:** Created a new tag, ran `set-status` on an existing task, and verified that the new tag was NOT deleted.\n- **Confirmation:** The underlying fix to the `writeJSON` function correctly preserves the full tagged data structure.\n\n**UPDATED COMMAND STATUS:**\n- ✅ `list`, `show`, `add-task`, `move`, `add-subtask`\n- ✅ `set-status` **(Newly Verified)**\n- ❓ **Likely Fixed (Pending Confirmation):** `remove-task`, `remove-subtask`, `clear-subtasks`, `update-task`, `update-subtask`, `expand`, `generate`, and all dependency commands.\n\n**NEXT STEPS:**\nContinue systematically testing the remaining commands. Next up is `remove-task`.\n</info added on 2025-06-13T03:58:43.036Z>\n<info added on 2025-06-13T04:01:04.367Z>\n**PROGRESS UPDATE - `remove-task` command fixed**\n\n✅ **COMPLETED: `remove-task` command has been fixed and is now fully tag-aware.**\n- **CLI Command:** Updated `remove-task` in `commands.js` to include the `--tag` option and pass `projectRoot` and `tag` context to the core function.\n- **Core Function:** Refactored the `removeTask` function in `scripts/modules/task-manager/remove-task.js`.\n - It now accepts a `context` object.\n - It reads the raw tagged data structure using `readJSON` with the correct context.\n - It operates only on the tasks within the specified (or current) tag.\n - It correctly updates the full `rawData` object before writing.\n - It calls `writeJSON` and `generateTaskFiles` with the correct context to prevent data corruption.\n- **Impact:** The `remove-task` command should no longer cause tag deletion or data corruption.\n\n**UPDATED COMMAND STATUS:**\n- ✅ `list`, `show`, `add-task`, `move`, `add-subtask`, `set-status`\n- ✅ `remove-task` **(Newly Fixed)**\n- ❓ **Likely Fixed (Pending Confirmation):** `remove-subtask`, `clear-subtasks`, `update-task`, `update-subtask`, `expand`, `generate`, and all dependency commands.\n\n**NEXT STEPS:**\nTest the `remove-task` command to verify the fix. Then continue with the remaining commands.\n</info added on 2025-06-13T04:01:04.367Z>\n<info added on 2025-06-13T04:13:22.909Z>\n**FINAL COMPLETION STATUS - All Critical Data Corruption Bugs Resolved**\n\nThe root cause of the tag deletion bug has been identified and fixed in the `generateTaskFiles` function. This function was incorrectly reading a single tag's data and then causing `validateAndFixDependencies` to overwrite the entire `tasks.json` file.\n\n**The Core Fix:**\n- `generateTaskFiles` has been refactored to be fully tag-aware\n- It now reads the complete raw data structure, preserving all tags\n- It performs its operations (validation, file generation) only on the tasks of the specified tag, without affecting other tags\n- This prevents the data corruption that was affecting `add-task`, `add-subtask`, and likely other commands\n\n**System Stability Achieved:**\nThe critical `writeJSON` and `generateTaskFiles` fixes have stabilized the entire system. All commands that modify `tasks.json` are now safe from data corruption.\n\n**Final Command Status - All Core Commands Working:**\n✅ `list`, `show`, `add-task`, `move`, `add-subtask`, `set-status`, `remove-task` - All confirmed working correctly without causing data loss\n✅ All other commands are presumed stable due to the core infrastructure fixes\n\n**Tagged Task List System Status: STABLE**\nThe tagged task list system is now considered stable and production-ready for all primary task modification commands. The --tag flag implementation is complete and functional across the command suite.\n</info added on 2025-06-13T04:13:22.909Z>\n<info added on 2025-06-13T07:01:11.925Z>\n**MAJOR MILESTONE ACHIEVED - Tagged Command Implementation Complete!**\n\n✅ **CRITICAL BUG FIXES COMPLETED:**\n- Fixed parse-prd data corruption bug that was deleting other tags\n- Enhanced tag preservation logic in both parse-prd.js and commands.js\n- Fixed confirmation logic to check tag-specific task existence (not just file existence)\n\n✅ **PARSE-PRD TAG SUPPORT - FULLY WORKING:**\n- parse-prd --tag=feature-name: Creates tasks in specific tag contexts\n- Non-existent tags are created automatically and silently\n- Existing tags are preserved during new tag creation\n- Append mode works correctly within tag contexts\n- Smart confirmation only prompts when target tag has existing tasks\n\n✅ **ANALYZE-COMPLEXITY TAG SUPPORT - FULLY WORKING:**\n- analyze-complexity --tag=branch: Generates tag-specific reports\n- File naming: master → task-complexity-report.json, others → task-complexity-report_tagname.json\n- complexity-report --tag=branch: Reads from correct tag-specific report file\n- Complete isolation between different tag contexts\n\n✅ **COMPREHENSIVE TESTING COMPLETED:**\n- Tested parse-prd with new tag creation (test-prd-tag)\n- Tested parse-prd with append mode (added 2 more tasks to existing 3)\n- Tested analyze-complexity with tag-specific report generation\n- Tested complexity-report with tag-specific report reading\n- Verified tag preservation and no data corruption across all operations\n\n✅ **CHANGESET & COMMIT COMPLETED:**\n- Updated changeset to describe new tag features (minor version bump)\n- Committed comprehensive changes with detailed commit message\n- All changes properly documented and versioned\n\n🚀 **SYSTEM IMPACT:**\nThe core tagged task lists system is now complete and production-ready! Users can:\n- Parse PRDs into separate contexts on the fly: parse-prd --tag=feature-branch\n- Generate isolated complexity reports: analyze-complexity --tag=experiment\n- Work across multiple project contexts without conflicts\n- Enable rapid prototyping and parallel development workflows\n\n**TAGGED COMMAND SUITE STATUS: COMPLETE**\nAll critical commands now support --tag flag with full data integrity preservation. The tagged task management system is stable and ready for advanced workflow integration.\n</info added on 2025-06-13T07:01:11.925Z>", "status": "done", "testStrategy": "Test each command with and without the --tag flag for correct scoping." @@ -5473,7 +6398,9 @@ "id": 6, "title": "Integrate Automatic Tag Creation from Git Branches", "description": "Implement logic to create tags based on git branch names using a --from-branch flag, integrating with git APIs to detect the current branch.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Enable seamless context switching between code branches and task tags. Use add-tag internally when creating tags from branch names.\n<info added on 2025-06-13T17:27:34.449Z>\n**Code Context Analysis Complete**\n\n**Current State:**\n- `state.json` has `branchTagMapping: {}` ready for storing git branch to tag mappings\n- `config.json` has `tags.enabledGitworkflow: false` and `tags.autoSwitchTagWithBranch: false` controls\n- Existing tag management functions in `scripts/modules/task-manager/tag-management.js` provide `createTag`, `useTag`, `switchCurrentTag` utilities\n- No existing git integration - need to add git CLI dependencies\n\n**Implementation Plan:**\n\n1. **Add Git Dependencies**: Add `simple-git` package for git operations (better than calling CLI directly)\n2. **Create Git Utilities Module**: `scripts/modules/utils/git-utils.js` with functions:\n - `getCurrentBranch()` - Get current git branch name\n - `isGitRepository()` - Check if we're in a git repo\n - `getBranchList()` - Get list of all branches\n - `onBranchChange()` - Hook for branch change detection\n\n3. **Enhance Tag Management**: Add git integration functions:\n - `createTagFromBranch(branchName)` - Create tag from git branch name\n - `autoSwitchTagForBranch()` - Auto-switch tag when branch changes\n - `updateBranchTagMapping()` - Update state.json mapping\n\n4. **Add CLI Commands**:\n - `--from-branch` flag for `add-tag` command\n - `task-master sync-git` command for manual git-tag synchronization\n\n5. **Configuration Integration**: \n - Check `config.tags.enabledGitworkflow` before git operations\n - Use `config.tags.autoSwitchTagWithBranch` for automatic switching\n\n**Next Steps**: Start with adding simple-git dependency and creating git utilities module.\n</info added on 2025-06-13T17:27:34.449Z>\n<info added on 2025-06-13T17:45:03.727Z>\n**Updated Implementation Strategy - Automatic Git Integration**\n\n**Revised Approach:**\n- Eliminate manual `sync-git` command for seamless user experience\n- Implement automatic git-tag synchronization following the established migration pattern\n- Integration occurs transparently during normal task operations without user intervention\n- Behavior controlled entirely through existing configuration flags\n\n**Updated Implementation Plan:**\n\n1. **Simplified Git Dependencies**: Keep `simple-git` package for git operations\n\n2. **Enhanced Git Utilities Module**: `scripts/modules/utils/git-utils.js` with streamlined functions:\n - `getCurrentBranch()` - Get current git branch name\n - `isGitRepository()` - Check if we're in a git repo\n - `shouldAutoSync()` - Check if git workflow is enabled and conditions are met\n\n3. **Automatic Integration Hook**: \n - Add `checkAndSyncGitTags()` function to utils.js\n - Integrate into `readJSON()` similar to migration system\n - Automatically create tags from branch names when conditions are met\n - Update branch-tag mappings in state.json transparently\n\n4. **Streamlined Tag Management**: Remove complex CLI additions:\n - No `--from-branch` flag needed for `add-tag`\n - No manual `sync-git` command\n - Automatic tag creation and switching based on git context\n\n5. **Configuration-Driven Behavior**:\n - `config.tags.enabledGitworkflow` enables/disables entire system\n - `config.tags.autoSwitchTagWithBranch` controls automatic tag switching\n - Silent operation when disabled, seamless when enabled\n\n**Benefits**: Zero-friction git integration that \"just works\" when enabled, following established project patterns for automatic system enhancements.\n</info added on 2025-06-13T17:45:03.727Z>\n<info added on 2025-06-13T17:50:24.997Z>\n**✅ IMPLEMENTATION COMPLETED**\n\n**Final Implementation Summary:**\n\n1. **Proper Module Organization**: \n - Moved `checkAndAutoSwitchGitTag` function to correct location in `scripts/modules/utils/git-utils.js`\n - Updated imports in `utils.js` to use the git-utils version\n - Maintains clean separation of concerns with git operations in dedicated module\n\n2. **Seamless Integration Architecture**:\n - Function automatically executes during `readJSON()` operations\n - Integrates with both migration system and normal tagged format processing\n - Zero user intervention required - works transparently in background\n\n3. **Smart Git-Tag Synchronization**:\n - Automatically switches to existing tags matching current branch names\n - Creates new tags for branches without corresponding tags\n - Updates `state.json` branch-tag mappings for persistent tracking\n - Validates branch names (excludes main/master/develop/dev/HEAD)\n\n4. **Configuration-Driven Operation**:\n - Controlled by `config.tags.enabledGitworkflow` and `config.tags.autoSwitchTagWithBranch` flags\n - Silent operation when disabled, seamless when enabled\n - Uses `console.debug` for error handling to avoid disrupting normal operations\n\n5. **MCP-Compatible Design**:\n - All functions require `projectRoot` parameter for MCP compatibility\n - Leverages existing git utility functions (`isGitRepository`, `getCurrentBranch`, `isValidBranchForTag`, `sanitizeBranchNameForTag`)\n - Follows established project patterns for automatic system enhancements\n\n**Status**: Implementation complete and ready for production use. Users can enable automatic git integration by configuring the appropriate flags in `.taskmaster/config.json`.\n</info added on 2025-06-13T17:50:24.997Z>\n<info added on 2025-06-14T01:01:52.559Z>\n**SCOPE SIMPLIFIED: Basic CLI Git Integration Only**\n\n**Implementation Status Changed:**\n- **CANCELLED**: All automatic git-tag synchronization features\n- **CANCELLED**: Configuration-driven git workflow automation \n- **CANCELLED**: Silent background git integration\n- **CANCELLED**: Branch-tag mapping persistence and auto-switching\n\n**COMPLETED: Core Git Utilities**\n- Git utilities module with MCP-compatible functions ready\n- Branch name sanitization and validation implemented\n- Git repository detection working\n\n**REMAINING WORK: CLI Integration**\n- Add `--from-branch` flag to `add-tag` command in `scripts/modules/commands.js`\n- Integrate existing git utilities with tag creation workflow\n- Enable `task-master add-tag --from-branch` command functionality\n\n**Final Simplified Scope:**\nSingle explicit command: `task-master add-tag --from-branch`\n- Detects current git branch name\n- Sanitizes branch name to valid tag format\n- Creates new tag with sanitized name\n- No automation, no background processes, no persistent mappings\n\n**Benefits**: Explicit user control, predictable behavior, simple implementation, easy debugging, clear separation of concerns between git and task management.\n\n**Next Step**: Implement CLI flag integration to complete the simplified git integration feature.\n</info added on 2025-06-14T01:01:52.559Z>", "status": "deferred", "testStrategy": "Test tag creation and switching in repositories with multiple branches." @@ -5482,7 +6409,9 @@ "id": 7, "title": "Update State Management for Current Tag Tracking", "description": "Ensure .taskmaster/state.json properly tracks the current tag with currentTag field set to 'master' by default during initialization.", - "dependencies": [4], + "dependencies": [ + 4 + ], "details": "Update initialization logic to create state.json with currentTag set to 'master', ensuring the state file accurately reflects the active tag across sessions.\n<info added on 2025-06-11T20:49:28.104Z>\nSTATE MANAGEMENT: Updated scripts/init.js to create state.json during initialization with proper initial state: currentTag: 'master', lastSwitched timestamp, branchTagMapping, migrationNoticeShown flag. createStateJson() function in utils.js handles state file creation during migration. State management integrated into complete migration system.\n</info added on 2025-06-11T20:49:28.104Z>", "status": "done", "testStrategy": "Verify state persistence after restarts and tag switches, confirm initialization creates proper currentTag field." @@ -5491,7 +6420,11 @@ "id": 8, "title": "Ensure Full Backward Compatibility", "description": "Guarantee that users without tags continue to operate in the 'master' context without disruption or required changes.", - "dependencies": [2, 5, 7], + "dependencies": [ + 2, + 5, + 7 + ], "details": "Test all workflows for legacy users and ensure no regressions.", "status": "done", "testStrategy": "Regression test with legacy data and workflows." @@ -5500,7 +6433,12 @@ "id": 9, "title": "Update Documentation and Help Menus", "description": "Revise user documentation, migration notes, and CLI help menus to reflect new tag-related features and usage patterns, specifically documenting the add-tag command.", - "dependencies": [4, 5, 6, 8], + "dependencies": [ + 4, + 5, + 6, + 8 + ], "details": "Provide clear instructions and examples for all tag management features, ensuring add-tag command is properly documented with consistent naming.", "status": "done", "testStrategy": "Review documentation for completeness and clarity; user acceptance testing." @@ -5509,7 +6447,10 @@ "id": 10, "title": "Conduct Comprehensive System Testing and QA", "description": "Perform end-to-end testing of the tagged task lists system, including migration, tag management, task operations, and context switching.", - "dependencies": [8, 9], + "dependencies": [ + 8, + 9 + ], "details": "Ensure all features work as intended and meet quality standards, with specific focus on add-tag command functionality.\n<info added on 2025-06-13T23:48:22.721Z>\nStarting MCP integration implementation for tag management:\n\nPhase 1: Creating direct functions for tag management\n- Examining existing tag management functions in scripts/modules/task-manager/tag-management.js\n- Need to create 6 direct functions: add-tag, delete-tag, list-tags, use-tag, rename-tag, copy-tag\n- Following existing patterns from other direct functions for consistency\n</info added on 2025-06-13T23:48:22.721Z>", "status": "done", "testStrategy": "Execute test cases covering all user scenarios, including edge cases and error handling." @@ -5520,7 +6461,10 @@ "description": "Implement core tag management functions in scripts/modules/task-manager/ following the established pattern. Include functions for createTag, deleteTag, listTags, useTag, renameTag, copyTag, and tag resolution logic.", "details": "", "status": "done", - "dependencies": [1, 3], + "dependencies": [ + 1, + 3 + ], "parentTaskId": 103 }, { @@ -5529,7 +6473,9 @@ "description": "Create MCP direct function wrappers in mcp-server/src/core/direct-functions/ for all tag management operations, following the established pattern like add-task.js", "details": "<info added on 2025-06-13T14:32:43.186Z>\nSuccessfully implemented all 6 MCP direct function wrappers in `mcp-server/src/core/direct-functions/`:\n\n**Created Files:**\n1. **`add-tag.js`** - Direct function for creating new tags with options for copying tasks and descriptions\n2. **`delete-tag.js`** - Direct function for deleting tags with automatic confirmation bypass for MCP\n3. **`list-tags.js`** - Direct function for listing all tags with optional metadata display\n4. **`use-tag.js`** - Direct function for switching current tag context\n5. **`rename-tag.js`** - Direct function for renaming existing tags\n6. **`copy-tag.js`** - Direct function for copying tags with all tasks and metadata\n\n**Integration Completed:**\n- Updated `mcp-server/src/core/task-master-core.js` to import and export all new direct functions\n- Added all functions to the directFunctions Map for dynamic dispatch\n- Followed established patterns from existing direct functions (add-task.js, etc.)\n\n**Key Features Implemented:**\n- **Silent Mode Management**: All functions properly enable/disable silent mode for MCP responses\n- **Error Handling**: Comprehensive error handling with structured error codes and messages\n- **Parameter Validation**: Full validation of required parameters with helpful error messages\n- **Logger Integration**: Proper MCP logger wrapper integration using createLogWrapper utility\n- **JSON Output**: All functions return structured JSON responses suitable for MCP clients\n- **Context Support**: Full session and projectRoot context support for all operations\n\n**Technical Details:**\n- All functions accept `tasksJsonPath`, `projectRoot`, and operation-specific parameters\n- Proper async/await error handling with silent mode restoration in finally blocks\n- Consistent return format: `{ success: boolean, data?: any, error?: { code: string, message: string } }`\n- Integration with existing tag management functions from `scripts/modules/task-manager/tag-management.js`\n\nThe MCP direct function layer is now complete and ready for MCP tool integration in the next phase.\n</info added on 2025-06-13T14:32:43.186Z>", "status": "done", - "dependencies": [11], + "dependencies": [ + 11 + ], "parentTaskId": 103 }, { @@ -5538,7 +6484,9 @@ "description": "Implement MCP tools in mcp-server/src/tools/ for all tag management operations (add-tag, delete-tag, list-tags, use-tag, rename-tag, copy-tag), following the established pattern like add-task.js", "details": "", "status": "done", - "dependencies": [12], + "dependencies": [ + 12 + ], "parentTaskId": 103 }, { @@ -5547,7 +6495,10 @@ "description": "Implement utilities for reading/writing current tag state, tag resolution logic (currentTag from state -> --tag flag -> defaultTag fallback), and state file validation", "details": "", "status": "done", - "dependencies": [3, 7], + "dependencies": [ + 3, + 7 + ], "parentTaskId": 103 }, { @@ -5556,7 +6507,10 @@ "description": "Create specific migration logic to transform existing tasks.json format (array of tasks) to the new tagged format ({tags: {master: {tasks: [...]}}}). Include validation and rollback capabilities.", "details": "<info added on 2025-06-11T20:50:25.721Z>\nMIGRATION LOGIC: Implemented in scripts/modules/utils.js with performCompleteTagMigration(), migrateConfigJson(), createStateJson(), and markMigrationForNotice() functions. Silent migration triggers on readJSON() for tasks.json files. Migration notice system implemented in commands.js with displayTaggedTasksFYI() from ui.js. Complete 3-part migration: tasks.json + config.json + state.json all handled automatically.\n</info added on 2025-06-11T20:50:25.721Z>", "status": "done", - "dependencies": [1, 2], + "dependencies": [ + 1, + 2 + ], "parentTaskId": 103 }, { @@ -5565,7 +6519,10 @@ "description": "Update all documentation in /docs to reflect the new tagged task lists architecture and migration system", "details": "Update docs to be aware of the new tagged structure: - Update command-reference.md with new tag-related commands - Update task-structure.md to explain tagged format - Update configuration.md with tagged system config - Update tutorial.md with tagged workflow - Update migration-guide.md for tagged migration - Ensure all examples reflect new structure\n<info added on 2025-06-11T21:12:52.662Z>\nCOMPLETED: All documentation files have been successfully updated to reflect the tagged task lists system. Key updates include:\n\n- docs/task-structure.md: Added complete tagged format explanation, data structure overview, migration details, and best practices\n- docs/configuration.md: Updated with tagged system configuration, state management, and new settings\n- docs/migration-guide.md: Added comprehensive tagged system migration process, verification steps, and team coordination guidelines\n- .cursor/rules/*.mdc files: Updated architecture.mdc, dev_workflow.mdc, taskmaster.mdc, tasks.mdc, utilities.mdc, new_features.mdc, git_workflow.mdc, and glossary.mdc to be aware of tagged system\n\nAll documentation now properly reflects Part 1 implementation and prepares for Part 2 features. Documentation is fully aligned with the new tagged task structure.\n</info added on 2025-06-11T21:12:52.662Z>", "status": "done", - "dependencies": ["103.8", "103.9"], + "dependencies": [ + "103.8", + "103.9" + ], "parentTaskId": 103 }, { @@ -5604,7 +6561,12 @@ "details": "1. Extend the CLI (commands.js) to introduce 'scope-up' and 'scope-down' commands, following established subcommand patterns for consistency and discoverability. \n2. Accept comma-separated task/subtask IDs and an optional '--strength' flag (light|regular|heavy, defaulting to regular). Validate all inputs, ensuring referenced tasks/subtasks exist and strength is valid.\n3. Fetch current task details and associated milestone context to inform the adjustment logic.\n4. Implement core logic functions that:\n - Construct context-aware AI prompts for scaling complexity up or down, leveraging the current state, project phase, and strength parameter.\n - Call the unified AI service (ai-services-unified.js) to generate new task/subtask content at the desired complexity level.\n - Replace existing task details and subtasks with the AI-generated output, preserving historical versions for rollback/comparison.\n - Ensure task dependency integrity and update tasks.json and related files accordingly.\n5. Integrate robust error handling for invalid IDs, parameters, or AI failures, and provide clear CLI output showing before/after differences.\n6. Add corresponding MCP tool equivalents for integrated environments and update documentation/help text to reflect new commands and usage patterns.\n7. Ensure compatibility with batch operations, milestone-based guidelines, and existing task management workflows.", "testStrategy": "- Write unit and integration tests for both 'scope-up' and 'scope-down' commands, covering single and multiple ID scenarios, all strength levels, and edge cases (e.g., non-existent IDs, invalid strength values).\n- Simulate CLI usage to verify correct parsing, validation, and error handling.\n- Test AI prompt construction and output integration, ensuring that task complexity is adjusted as expected for each strength level and milestone context.\n- Verify that historical data is preserved and that before/after summaries are accurate and clear.\n- Confirm that task dependencies remain intact and that batch operations work as intended.\n- Validate MCP tool integration and documentation updates.", "status": "pending", - "dependencies": [3, 11, 19, 94], + "dependencies": [ + 3, + 11, + 19, + 94 + ], "priority": "high", "subtasks": [ { @@ -5634,7 +6596,9 @@ "details": "Implement TTS functionality including:\n- Add --tts flag to all relevant taskmaster commands (list, show, generate, etc.)\n- Integrate with system TTS engines (Windows SAPI, macOS say command, Linux espeak/festival)\n- Create TTS configuration options in the configuration management system\n- Add voice selection options (male/female, different languages if available)\n- Implement audio output settings (volume, speed, pitch)\n- Add TTS-specific error handling for cases where TTS is unavailable\n- Create fallback behavior when TTS fails (silent failure or text output)\n- Support for reading task titles, descriptions, and status updates aloud\n- Add option to read entire task lists or individual task details\n- Implement TTS for command confirmations and error messages\n- Create TTS output formatting to make spoken text more natural (removing markdown, formatting numbers/dates appropriately)\n- Add configuration option to enable/disable TTS globally\n<info added on 2025-06-14T21:55:53.499Z>\nAdd comprehensive testing strategy for TTS functionality:\n\n**TTS Testing Requirements:**\n- Test TTS flag functionality across all commands (list, show, generate) with various voice configurations\n- Validate TTS engine integration on different platforms (Windows SAPI, macOS say, Linux espeak/festival)\n- Test voice selection options and audio output settings (volume, speed, pitch) with edge cases\n- Verify TTS error handling when engines are unavailable or fail\n- Test fallback behavior scenarios (silent failure vs text output)\n- Validate TTS output formatting for natural speech (markdown removal, number/date pronunciation)\n- Test global TTS enable/disable configuration settings\n- Verify TTS works correctly with task titles, descriptions, and status updates of varying lengths and complexity\n- Test TTS performance with large task lists and individual task details\n- Validate TTS for command confirmations and error messages across different error scenarios\n\n**Automated TTS Test Cases:**\n- Enable TTS flag and verify audio output generation without errors\n- Test each supported TTS engine with fallback when primary engine fails\n- Validate configuration persistence for TTS settings across application restarts\n- Test TTS with special characters, long text, and multilingual content\n- Verify TTS integration doesn't interfere with normal command execution or file operations\n- Test concurrent TTS operations and resource management\n- Validate TTS accessibility compliance and user experience consistency\n</info added on 2025-06-14T21:55:53.499Z>\n<info added on 2025-06-14T22:07:04.840Z>\n**Duplicate Save Prevention Testing for TTS Implementation:**\n\nSince TTS functionality involves configuration persistence and potential concurrent operations, implement specific tests to prevent duplicate saves in the TTS context:\n\n- Test TTS configuration saves to prevent duplicate entries in configuration files when users rapidly change voice settings, volume, or other audio parameters\n- Validate that TTS engine initialization doesn't create duplicate configuration entries when switching between different TTS engines (Windows SAPI, macOS say, Linux espeak)\n- Test concurrent TTS operations to ensure audio output settings aren't duplicated when multiple commands with --tts flag run simultaneously\n- Verify that TTS preference saves are atomic and don't result in corrupted or duplicate configuration data during rapid user interactions\n- Implement unique constraint checks for TTS configuration entries to prevent duplicate voice profiles or audio settings\n- Test TTS configuration persistence across application restarts to ensure settings aren't duplicated on reload\n- Validate that TTS error logging doesn't create duplicate log entries when TTS engines fail or fallback mechanisms activate\n- Test edge cases where users rapidly toggle global TTS enable/disable settings to prevent duplicate configuration states\n- Ensure TTS-related task metadata (like audio output preferences per task) doesn't create duplicate entries in tasks.json\n- Implement locking mechanisms for TTS configuration file operations to prevent race conditions during concurrent access\n\nThis testing should be integrated with the existing TTS test strategy to ensure robust duplicate prevention across all TTS-related save operations.\n</info added on 2025-06-14T22:07:04.840Z>\n<info added on 2025-06-14T22:08:10.995Z>\n**Claude API Integration Testing for TTS Commands:**\n\nAdd specific testing requirements for Claude API integration within the TTS implementation context:\n\n- Test Claude API connectivity when generating TTS-enabled task content to ensure API calls don't interfere with audio output generation\n- Validate Claude API authentication and error handling when TTS commands request AI-generated content with --tts flag enabled\n- Test Claude API response parsing and integration with TTS output formatting to ensure AI-generated text is properly converted for speech synthesis\n- Verify Claude API token usage tracking doesn't conflict with TTS configuration persistence mechanisms\n- Test concurrent operations where Claude API calls and TTS audio generation occur simultaneously\n- Validate Claude API retry and backoff logic works correctly when TTS commands fail and need to regenerate content\n- Test Claude API integration with task generation workflows that include TTS output requirements\n- Ensure Claude API error messages are properly formatted for TTS output when --tts flag is enabled\n- Test Claude API model parameter configuration persistence alongside TTS configuration settings\n- Validate that Claude API failures gracefully fallback without breaking TTS functionality for existing task content\n- Test environment variable handling for ANTHROPIC_API_KEY in conjunction with TTS engine configuration\n- Verify Claude API integration logging doesn't create conflicts with TTS error logging mechanisms\n\nThis testing should ensure seamless integration between Claude API functionality and TTS features without interference or duplicate save issues.\n</info added on 2025-06-14T22:08:10.995Z>\n<info added on 2025-06-14T22:10:22.106Z>\n**Final Duplicate Save Testing Protocol - Research Session 6/14/2025:**\n\n**Comprehensive Test Environment Setup:**\n- Create clean test environment with known state of tasks.json and TTS configuration files\n- Back up current tasks.json, TTS settings, and Claude API configuration before testing\n- Ensure all TTS engines and Claude API connectivity are functional for comprehensive testing\n\n**Duplicate Save Test Scenarios for TTS Implementation:**\n- Test saving TTS configuration with identical voice settings to verify no duplicate entries\n- Attempt simultaneous TTS configuration saves while audio output is active\n- Test Claude API task generation with --tts flag to ensure no duplicate task entries in tasks.json\n- Validate TTS preference persistence doesn't create duplicate configuration entries during rapid setting changes\n- Test concurrent TTS operations with multiple commands to verify no duplicate audio output settings\n- Simulate race conditions between TTS configuration saves and Claude API calls\n\n**Manual and Automated Test Execution:**\n- Execute TTS commands with --tts flag while monitoring tasks.json for duplicate entries\n- Test Claude API integration with TTS-enabled commands to verify single task creation\n- Validate TTS configuration file integrity after multiple rapid setting changes\n- Test TTS error logging to ensure no duplicate log entries during engine failures\n- Verify TTS-related task metadata saves don't create duplicate entries\n\n**Edge Case Testing for TTS Context:**\n- Test TTS configuration saves with minor variations (case sensitivity, whitespace) in voice names\n- Validate duplicate detection with similar TTS settings across different engines\n- Test large-scale TTS operations to ensure performance and correctness\n- Verify TTS global enable/disable toggle doesn't create duplicate configuration states\n\n**Validation and Documentation:**\n- Monitor TTS configuration files, tasks.json, and logs for any duplicate entries\n- Document test results in provided table format with TTS-specific scenarios\n- Verify error handling provides clear feedback for TTS-related duplicate save attempts\n- Confirm regression testing covers all TTS functionality without introducing new duplicate save issues\n- Complete stakeholder confirmation before closing duplicate save testing for TTS implementation\n</info added on 2025-06-14T22:10:22.106Z>", "testStrategy": "Test TTS functionality across different operating systems (Windows, macOS, Linux). Verify that the --tts flag works with all major commands. Test voice configuration options and ensure audio output settings are properly applied. Test error handling when TTS services are unavailable. Verify that text formatting for speech is natural and understandable. Test with various task content types including special characters, code snippets, and long descriptions. Ensure TTS can be disabled and enabled through configuration.", "status": "pending", - "dependencies": [16], + "dependencies": [ + 16 + ], "priority": "medium", "subtasks": [] } @@ -5644,5 +6608,700 @@ "updated": "2025-06-14T21:31:06.388Z", "description": "Tag created on 6/14/2025" } + }, + "cc-kiro-hooks": { + "tasks": [ + { + "id": 1, + "title": "Implement Task Integration Layer (TIL) Core", + "description": "Develop the central coordination component that manages the lifecycle of Kiro hooks and Taskmaster tasks, monitors task readiness, and coordinates execution.", + "details": "Use TypeScript/Node.js to build the TIL as an event-driven service. Implement hook registration, lifecycle management, task readiness checking, execution coordination, and status tracking. Use EventEmitter for internal event handling. Validate configurations with JSON Schema. Persist state with SQLite. Integrate with Taskmaster MCP API for task operations. Ensure robust error handling and logging.", + "testStrategy": "Unit test hook registration, lifecycle, and task readiness logic with Jest. Mock Taskmaster MCP API for integration tests. Validate error handling and event propagation. Verify configuration validation with JSON Schema tests.", + "priority": "high", + "dependencies": [], + "status": "pending", + "subtasks": [ + { + "id": 1, + "title": "Implement Hook Registration and Lifecycle Management", + "description": "Develop the mechanism to register Kiro hooks, manage their lifecycle events, and handle their state transitions within the Task Integration Layer.", + "dependencies": [], + "details": "Use TypeScript/Node.js to build hook registration APIs and lifecycle management logic. Employ EventEmitter for internal event handling to track hook states and transitions. Validate hook configurations using JSON Schema to ensure correctness before registration.", + "status": "pending", + "testStrategy": "Unit test hook registration and lifecycle management logic with Jest. Validate configuration schema enforcement and event propagation." + }, + { + "id": 2, + "title": "Implement Task Readiness Checking and Status Tracking", + "description": "Create functionality to monitor and determine the readiness of Taskmaster tasks and track their execution status within the TIL.", + "dependencies": [], + "details": "Develop logic to check task readiness based on predefined criteria and hook states. Persist task status and readiness information in SQLite for durability. Use EventEmitter to emit status change events for downstream processing.", + "status": "pending", + "testStrategy": "Unit test readiness checking logic and status tracking. Verify persistence in SQLite and event emission correctness." + }, + { + "id": 3, + "title": "Develop Execution Coordination and Taskmaster MCP API Integration", + "description": "Coordinate execution of tasks by interfacing with the Taskmaster MCP API, managing task lifecycle commands such as start, cancel, and update.", + "dependencies": [], + "details": "Implement integration with Taskmaster MCP API to issue task commands and receive updates. Coordinate task execution flow based on readiness and hook events. Handle concurrency and ensure robust error handling and logging throughout the process.", + "status": "pending", + "testStrategy": "Mock Taskmaster MCP API for integration tests. Validate execution coordination, error handling, and logging behavior." + }, + { + "id": 4, + "title": "Implement Configuration Validation and Persistence Layer", + "description": "Build the configuration validation system using JSON Schema and implement persistent state storage using SQLite for hooks and tasks.", + "dependencies": [], + "details": "Use JSON Schema to validate all configuration inputs related to hooks and tasks. Design SQLite schema to persist hook states, task statuses, and lifecycle events. Ensure data integrity and support efficient queries for status and readiness checks.", + "status": "pending", + "testStrategy": "Unit test JSON Schema validation logic. Integration test SQLite persistence and retrieval operations." + }, + { + "id": 5, + "title": "Implement Robust Error Handling, Logging, and Event-Driven Service Architecture", + "description": "Ensure the TIL operates as a resilient event-driven service with comprehensive error handling and logging for all components.", + "dependencies": [], + "details": "Leverage Node.js EventEmitter to build an event-driven architecture for internal communication. Implement centralized error handling strategies and detailed logging for debugging and audit trails. Ensure the service gracefully handles failures and recovers state from SQLite.", + "status": "pending", + "testStrategy": "Test error scenarios and recovery mechanisms. Verify event propagation and logging outputs under various conditions." + } + ] + }, + { + "id": 2, + "title": "Develop Dependency Monitor with Taskmaster MCP Integration", + "description": "Create a real-time dependency tracking system that monitors task dependencies, detects circular dependencies, and notifies on dependency status changes.", + "details": "Implement dependency graph management using efficient data structures to support large graphs (500+ tasks). Integrate with Taskmaster MCP commands to fetch and monitor task dependencies and tags. Implement circular dependency detection algorithms. Use event-driven notifications for dependency status changes. Optimize for sub-second response times. Cache dependency data for performance.", + "testStrategy": "Unit test dependency graph operations and circular dependency detection. Integration test with Taskmaster MCP mock server. Performance test with large dependency graphs. Validate event notifications on dependency changes.", + "priority": "high", + "dependencies": [ + 1 + ], + "status": "pending", + "subtasks": [ + { + "id": 1, + "title": "Design and Implement Dependency Graph Management", + "description": "Develop an efficient data structure to represent and manage large dependency graphs with 500+ tasks, ensuring scalability and performance.", + "dependencies": [], + "details": "Choose and implement graph data structures optimized for large-scale task dependency management. Support operations such as adding, removing, and querying dependencies with sub-second response times. Include caching mechanisms to improve performance.", + "status": "pending", + "testStrategy": "Unit test graph operations for correctness and performance with large datasets." + }, + { + "id": 2, + "title": "Integrate Taskmaster MCP Commands for Dependency Fetching and Monitoring", + "description": "Connect the dependency monitor to Taskmaster MCP to fetch task dependencies and tags, and monitor their status in real-time.", + "dependencies": [ + "2.1" + ], + "details": "Implement API integration with Taskmaster MCP commands to retrieve task dependency data and tags. Set up listeners or polling mechanisms to detect changes in dependencies and update the graph accordingly.", + "status": "pending", + "testStrategy": "Integration test with Taskmaster MCP mock server to validate data fetching and real-time monitoring." + }, + { + "id": 3, + "title": "Implement Circular Dependency Detection Algorithms", + "description": "Develop algorithms to detect circular dependencies within the task dependency graph to prevent execution deadlocks.", + "dependencies": [ + "2.1" + ], + "details": "Use graph traversal techniques such as depth-first search (DFS) or Tarjan's algorithm to identify cycles in the dependency graph. Ensure detection is efficient to maintain sub-second response times.", + "status": "pending", + "testStrategy": "Unit test with various graph scenarios including cyclic and acyclic graphs to verify detection accuracy." + }, + { + "id": 4, + "title": "Develop Event-Driven Notification System for Dependency Status Changes", + "description": "Create an event-driven mechanism to notify relevant components or users when dependency statuses change.", + "dependencies": [ + "2.2", + "2.3" + ], + "details": "Implement event listeners that trigger notifications on dependency status updates, such as completion, failure, or changes in dependency relationships. Ensure notifications are timely and scalable.", + "status": "pending", + "testStrategy": "Integration test event notifications with simulated dependency status changes to verify correct triggering and delivery." + }, + { + "id": 5, + "title": "Optimize Performance and Cache Dependency Data", + "description": "Enhance the system to achieve sub-second response times by optimizing algorithms and caching dependency data effectively.", + "dependencies": [ + "2.1", + "2.2", + "2.3", + "2.4" + ], + "details": "Profile and optimize graph operations and data fetching. Implement caching strategies to reduce redundant computations and network calls. Validate that the system maintains performance under load with large dependency graphs.", + "status": "pending", + "testStrategy": "Performance test with large-scale graphs and high-frequency updates to ensure response time targets are met." + } + ] + }, + { + "id": 3, + "title": "Build Execution Manager with Priority Queue and Parallel Execution", + "description": "Implement task execution queue supporting priority-based scheduling, parallel execution with resource conflict detection, timeout handling, and execution history tracking.", + "details": "Use a priority queue data structure to manage task execution order. Support up to 10 concurrent tasks with resource reservation and conflict detection. Integrate with Taskmaster MCP commands for task execution, cancellation, and status updates. Implement timeout and cancellation logic. Persist execution history in SQLite for analytics. Provide APIs for querying execution status and history.", + "testStrategy": "Unit test queue management, priority scheduling, and concurrency control. Integration test with Taskmaster MCP commands. Simulate resource conflicts and timeouts. Verify execution history persistence and retrieval.", + "priority": "high", + "dependencies": [ + 1, + 2 + ], + "status": "pending", + "subtasks": [ + { + "id": 1, + "title": "Design and Implement Priority Queue for Task Scheduling", + "description": "Develop a priority queue data structure to manage task execution order based on task priority, ensuring higher priority tasks are executed before lower priority ones.", + "dependencies": [], + "details": "Implement a priority queue that supports enqueueing tasks with priority values and dequeues tasks in priority order. Use efficient data structures such as heaps to maintain ordering. Ensure the queue supports dynamic priority updates and integrates with the task execution system.", + "status": "pending", + "testStrategy": "Unit test priority queue operations including enqueue, dequeue, and priority sorting. Validate correct ordering of tasks by priority under various scenarios." + }, + { + "id": 2, + "title": "Implement Parallel Task Execution with Resource Conflict Detection", + "description": "Enable concurrent execution of up to 10 tasks while managing resource reservations and detecting conflicts to prevent resource contention.", + "dependencies": [ + "3.1" + ], + "details": "Develop concurrency control to allow up to 10 parallel tasks. Implement resource reservation mechanisms and conflict detection algorithms to avoid simultaneous access to conflicting resources. Integrate with the priority queue to select tasks eligible for execution.", + "status": "pending", + "testStrategy": "Unit test concurrency limits and resource conflict detection logic. Simulate resource conflicts and verify that conflicting tasks are not executed concurrently." + }, + { + "id": 3, + "title": "Integrate Taskmaster MCP Commands for Task Lifecycle Management", + "description": "Integrate the execution manager with Taskmaster MCP commands to support task execution, cancellation, and status updates.", + "dependencies": [ + "3.1" + ], + "details": "Implement interfaces to send commands to Taskmaster MCP for starting, cancelling, and querying task statuses. Ensure synchronization between the execution manager state and Taskmaster MCP responses.", + "status": "pending", + "testStrategy": "Integration test with Taskmaster MCP mock or real API. Verify correct command dispatch, response handling, and state synchronization." + }, + { + "id": 4, + "title": "Implement Timeout and Cancellation Logic for Task Execution", + "description": "Add timeout handling and cancellation support to manage long-running or stalled tasks effectively.", + "dependencies": [ + "3.2", + "3.3" + ], + "details": "Implement mechanisms to track task execution time and cancel tasks exceeding their timeout thresholds. Support manual cancellation requests and ensure proper cleanup and state updates upon cancellation.", + "status": "pending", + "testStrategy": "Unit test timeout triggers and cancellation flows. Simulate long-running tasks and verify timely cancellation and resource release." + }, + { + "id": 5, + "title": "Persist Execution History and Provide Query APIs", + "description": "Store task execution history in SQLite for analytics and provide APIs to query execution status and history.", + "dependencies": [ + "3.4" + ], + "details": "Design a schema in SQLite to record task execution details including start time, end time, status, priority, and resource usage. Implement APIs to query current execution status and historical data for analytics and reporting.", + "status": "pending", + "testStrategy": "Unit test database persistence and retrieval operations. Integration test API endpoints for querying execution status and history." + } + ] + }, + { + "id": 4, + "title": "Implement Safety Manager with Configurable Constraints and Emergency Controls", + "description": "Develop safety mechanisms including execution limits, emergency stop/pause, user approval workflows, file protection, and automatic violation detection.", + "details": "Design safety constraint schemas and validation logic using JSON Schema. Implement emergency stop and pause functionality with immediate effect. Integrate user approval workflows for critical tasks. Monitor resource usage and detect runaway automation. Implement file permission validation and backup mechanisms. Log all safety-related events for audit purposes.", + "testStrategy": "Unit test safety constraint validation and emergency controls. Simulate safety violations and verify automatic responses. Test user approval workflows. Perform security testing for file protection and access control.", + "priority": "high", + "dependencies": [ + 1, + 3 + ], + "status": "pending", + "subtasks": [ + { + "id": 1, + "title": "Design Safety Constraint Schemas and Validation Logic", + "description": "Create JSON Schema definitions for safety constraints including execution limits, file permissions, and resource usage thresholds to enable automated validation.", + "dependencies": [], + "details": "Develop comprehensive JSON Schema models that define the structure and rules for safety constraints. Implement validation logic to enforce these constraints during runtime, ensuring all safety parameters are met before task execution.", + "status": "pending", + "testStrategy": "Unit test schema validation logic with various valid and invalid constraint configurations to ensure correct enforcement." + }, + { + "id": 2, + "title": "Implement Emergency Stop and Pause Functionality", + "description": "Develop mechanisms to immediately halt or pause ongoing automation tasks upon emergency triggers.", + "dependencies": [ + "4.1" + ], + "details": "Build emergency stop and pause controls that can be triggered manually or automatically. Ensure these controls take immediate effect to prevent unsafe operations and allow safe recovery or intervention.", + "status": "pending", + "testStrategy": "Simulate emergency conditions and verify that tasks stop or pause instantly and safely." + }, + { + "id": 3, + "title": "Integrate User Approval Workflows for Critical Tasks", + "description": "Create workflows requiring explicit user approval before executing high-risk or critical automation tasks.", + "dependencies": [ + "4.1" + ], + "details": "Design and implement user interaction flows that prompt for approval on critical operations. Ensure integration with task execution logic to block unauthorized or unapproved actions.", + "status": "pending", + "testStrategy": "Test approval prompts, user responses, and enforcement of approval requirements before task execution." + }, + { + "id": 4, + "title": "Implement File Protection and Backup Mechanisms", + "description": "Develop validation for file permissions and automatic backup processes to protect critical files from unauthorized changes or loss.", + "dependencies": [ + "4.1" + ], + "details": "Validate file access permissions before operations to prevent unauthorized modifications. Implement backup routines to save file states prior to changes, enabling recovery in case of violations or failures.", + "status": "pending", + "testStrategy": "Perform security testing on file access controls and verify backup creation and restoration processes." + }, + { + "id": 5, + "title": "Monitor Resource Usage and Log Safety Events", + "description": "Continuously monitor resource consumption to detect runaway automation and log all safety-related events for auditing.", + "dependencies": [ + "4.1", + "4.2" + ], + "details": "Implement monitoring tools to track CPU, memory, and other resource usage in real-time. Detect violations such as runaway tasks and trigger safety responses. Log all safety events including constraint violations, emergency stops, approvals, and file protections for audit trails.", + "status": "pending", + "testStrategy": "Simulate resource overuse and safety violations to verify detection and logging accuracy." + } + ] + }, + { + "id": 5, + "title": "Develop Event-Based Hook Processor", + "description": "Create event-based hooks handling file system events, task status changes, Git events, and build system notifications with filtering and debouncing.", + "details": "Integrate with Kiro's file watcher for file system monitoring. Use Taskmaster MCP API to detect task status changes. Integrate Git event listeners for commits, branch changes, and merges. Connect to build system events for test and compilation results. Implement configurable event filters and pattern matching. Use debouncing and batching to optimize performance under high-frequency events.", + "testStrategy": "Unit test event filtering, debouncing, and batching logic. Integration test with simulated file system, Git, and build events. Verify correct triggering of hooks and task execution.", + "priority": "medium", + "dependencies": [ + 1, + 2 + ], + "status": "pending", + "subtasks": [ + { + "id": 1, + "title": "Integrate File System Event Monitoring with Kiro's File Watcher", + "description": "Set up integration with Kiro's file watcher to monitor file system events such as file creation, modification, and deletion.", + "dependencies": [], + "details": "Implement event listeners using Kiro's file watcher API to capture file system changes. Ensure events are captured in real-time and passed to the hook processor for further handling.", + "status": "pending", + "testStrategy": "Unit test file event detection and integration with Kiro's watcher. Simulate file system changes and verify correct event capture and propagation." + }, + { + "id": 2, + "title": "Implement Task Status Change Detection via Taskmaster MCP API", + "description": "Integrate with Taskmaster MCP API to detect and handle task status changes such as start, completion, failure, and cancellation.", + "dependencies": [], + "details": "Use Taskmaster MCP API to subscribe to task lifecycle events. Process these events to trigger corresponding hooks in the event processor.", + "status": "pending", + "testStrategy": "Unit test task status event handling logic. Integration test with Taskmaster MCP mock or live API to verify event reception and processing." + }, + { + "id": 3, + "title": "Develop Git Event Listeners for Commits, Branch Changes, and Merges", + "description": "Create listeners for Git repository events including commits, branch switches, and merges to trigger hooks accordingly.", + "dependencies": [], + "details": "Integrate Git event listeners that detect relevant repository changes. Normalize event data and forward to the hook processor for filtering and action.", + "status": "pending", + "testStrategy": "Unit test Git event detection and parsing. Integration test with simulated Git events to ensure correct hook triggering." + }, + { + "id": 4, + "title": "Connect Build System Event Notifications for Test and Compilation Results", + "description": "Integrate with the build system to receive notifications about test outcomes and compilation results, enabling event-driven responses.", + "dependencies": [], + "details": "Set up event listeners or webhooks from the build system to capture build status updates. Process these events to trigger appropriate hooks.", + "status": "pending", + "testStrategy": "Unit test build event handling logic. Integration test with build system event simulation to verify correct event capture and hook execution." + }, + { + "id": 5, + "title": "Implement Configurable Event Filtering, Pattern Matching, Debouncing, and Batching", + "description": "Develop filtering mechanisms and pattern matching for events, and implement debouncing and batching to optimize performance under high-frequency event loads.", + "dependencies": [ + "5.1", + "5.2", + "5.3", + "5.4" + ], + "details": "Create configurable filters to selectively process events based on criteria. Implement pattern matching for event attributes. Use debouncing to delay processing of rapid event bursts and batching to group events for efficient handling.", + "status": "pending", + "testStrategy": "Unit test filtering, pattern matching, debouncing, and batching logic. Integration test with high-frequency simulated events to validate performance optimization and correct hook triggering." + } + ] + }, + { + "id": 6, + "title": "Implement Prompt-Based Hook Processor with AI Integration", + "description": "Build prompt-based hooks that intercept agent prompts, inject task context, suggest tasks automatically, and update task statuses based on AI conversations.", + "details": "Integrate with Kiro's agent communication system to intercept prompts. Analyze conversation content using natural language processing to suggest relevant tasks. Inject task context dynamically into AI conversations. Update task statuses based on agent responses. Implement relevance scoring and context-aware filtering for task suggestions.", + "testStrategy": "Unit test prompt interception and context injection. Use mock AI conversations to validate task suggestion accuracy. Integration test with Kiro agent communication system. Verify task status updates triggered by prompts.", + "priority": "medium", + "dependencies": [ + 1 + ], + "status": "pending", + "subtasks": [ + { + "id": 1, + "title": "Integrate Hook Processor with Kiro Agent Communication System", + "description": "Develop the integration layer to intercept agent prompts within Kiro's communication system, enabling prompt-based hook processing.", + "dependencies": [], + "details": "Implement the mechanism to capture and intercept prompts sent to agents in Kiro. Ensure seamless integration without impacting existing communication workflows. Use event-driven architecture to listen for prompt events and forward them to the hook processor.", + "status": "pending", + "testStrategy": "Unit test prompt interception logic with mock Kiro agent communication events. Integration test to verify prompt capture without disrupting agent communication." + }, + { + "id": 2, + "title": "Implement Natural Language Processing for Task Suggestion", + "description": "Analyze intercepted conversation content using NLP techniques to automatically suggest relevant tasks based on the context.", + "dependencies": [ + "6.1" + ], + "details": "Use NLP models to parse and understand agent prompts and conversation transcripts. Extract intent and key entities to match against existing tasks. Implement relevance scoring and context-aware filtering to prioritize task suggestions.", + "status": "pending", + "testStrategy": "Unit test NLP parsing and intent extraction with diverse conversation samples. Validate task suggestion accuracy using mock AI conversations." + }, + { + "id": 3, + "title": "Develop Dynamic Task Context Injection into AI Conversations", + "description": "Create functionality to inject relevant task context dynamically into AI conversations to enhance agent understanding and response quality.", + "dependencies": [ + "6.1" + ], + "details": "Design the context injection mechanism to append or embed task-related information into AI prompts or responses. Ensure context is relevant, concise, and updated in real-time based on conversation flow.", + "status": "pending", + "testStrategy": "Unit test context injection with simulated AI conversations. Verify that injected context improves task relevance without causing prompt overload." + }, + { + "id": 4, + "title": "Implement Task Status Update Mechanism Based on Agent Responses", + "description": "Build the logic to update task statuses automatically by interpreting agent responses and AI conversation outcomes.", + "dependencies": [ + "6.2", + "6.3" + ], + "details": "Monitor agent replies and AI outputs to detect task progress or completion signals. Map conversation cues to task status changes such as 'in progress', 'completed', or 'needs review'. Ensure updates are synchronized with the task management system.", + "status": "pending", + "testStrategy": "Unit test status update triggers with varied agent response scenarios. Integration test with task management API to confirm status synchronization." + }, + { + "id": 5, + "title": "Implement Relevance Scoring and Context-Aware Filtering for Task Suggestions", + "description": "Enhance task suggestion accuracy by applying relevance scoring algorithms and context-aware filters to prioritize and refine suggested tasks.", + "dependencies": [ + "6.2" + ], + "details": "Develop scoring models that evaluate task relevance based on conversation context, task metadata, and historical data. Apply filters to exclude irrelevant or low-priority tasks. Continuously refine scoring criteria based on feedback and usage patterns.", + "status": "pending", + "testStrategy": "Unit test scoring and filtering logic with controlled datasets. Perform A/B testing to measure improvement in suggestion relevance." + } + ] + }, + { + "id": 7, + "title": "Create Update-Based Hook Processor for Automatic Progress Tracking", + "description": "Develop update-based hooks that track code changes, validate acceptance criteria, propagate dependency updates, and detect conflicts.", + "details": "Monitor code changes via file system and version control integration. Track implementation progress and milestones automatically. Validate task acceptance criteria and mark completion. Propagate status updates through dependency chains. Detect and resolve conflicts in task updates. Integrate with version control systems for change tracking.", + "testStrategy": "Unit test progress tracking and acceptance validation logic. Integration test with version control events and Taskmaster MCP updates. Simulate conflict scenarios and verify resolution mechanisms.", + "priority": "medium", + "dependencies": [ + 1, + 2 + ], + "status": "pending", + "subtasks": [ + { + "id": 1, + "title": "Implement Code Change Monitoring via File System and Version Control Integration", + "description": "Develop mechanisms to monitor code changes by integrating with the file system watcher and version control system events.", + "dependencies": [], + "details": "Integrate with Kiro's file watcher for real-time file system monitoring and implement Git event listeners to track commits, branch changes, and merges. Ensure hooks trigger on relevant update events before ref updates as per Git update hook behavior.", + "status": "pending", + "testStrategy": "Unit test file system and Git event detection logic. Integration test with simulated file changes and Git operations to verify correct event capture." + }, + { + "id": 2, + "title": "Develop Acceptance Criteria Validation and Task Completion Marking", + "description": "Create logic to validate task acceptance criteria automatically upon code updates and mark tasks as completed when criteria are met.", + "dependencies": [ + "7.1" + ], + "details": "Implement validation rules to check if code changes satisfy predefined acceptance criteria. Automate task status updates to 'completed' when criteria validation passes.", + "status": "pending", + "testStrategy": "Unit test acceptance criteria validation logic with various scenarios. Integration test with task status updates triggered by code changes." + }, + { + "id": 3, + "title": "Implement Dependency Update Propagation Through Task Chains", + "description": "Design and implement propagation of status updates through dependent tasks to maintain consistency across the dependency graph.", + "dependencies": [ + "7.2" + ], + "details": "Use efficient data structures to manage dependency chains and propagate status changes downstream. Integrate with Taskmaster MCP to fetch and update dependency statuses.", + "status": "pending", + "testStrategy": "Unit test dependency propagation logic. Integration test with Taskmaster MCP mock server to verify correct update flows." + }, + { + "id": 4, + "title": "Detect and Resolve Conflicts in Task Updates", + "description": "Develop mechanisms to detect conflicts arising from concurrent or incompatible task updates and implement resolution strategies.", + "dependencies": [ + "7.1" + ], + "details": "Implement conflict detection algorithms triggered by update hooks. Provide automated or manual conflict resolution workflows to maintain task integrity.", + "status": "pending", + "testStrategy": "Simulate conflict scenarios and verify detection accuracy. Test resolution mechanisms for correctness and robustness." + }, + { + "id": 5, + "title": "Integrate Update-Based Hook Processor with Version Control Systems", + "description": "Ensure seamless integration of the update-based hook processor with version control systems for effective change tracking and hook execution.", + "dependencies": [ + "7.1", + "7.4" + ], + "details": "Implement Git update hook scripts that invoke the processor before ref updates. Ensure hooks are executable and handle parameters such as refname and old/new commit hashes.", + "status": "pending", + "testStrategy": "Integration test with Git repositories to verify hook triggering on push events. Validate correct parameter handling and processor invocation." + } + ] + }, + { + "id": 8, + "title": "Develop Real-Time Automation Dashboard and User Controls", + "description": "Build a React-based dashboard displaying live automation status, task queues, dependency graphs, execution history, and system health with user control interfaces.", + "details": "Use React with TypeScript for UI components. Implement WebSocket client for real-time updates. Use D3.js for interactive dependency chain visualization and Chart.js for analytics. Provide controls for pause/resume/stop automation, hook toggles, manual task triggers, safety configuration, and tag management. Style with CSS Modules. Ensure responsive and performant UI.", + "testStrategy": "Unit test UI components with Jest and React Testing Library. Perform integration tests with backend WebSocket server. Conduct usability testing with sample users. Validate real-time updates and control responsiveness.", + "priority": "medium", + "dependencies": [ + 3, + 4, + 5 + ], + "status": "pending", + "subtasks": [ + { + "id": 1, + "title": "Design and Implement Dashboard Layout and Navigation", + "description": "Create the main dashboard layout with navigation, header, and responsive grid for displaying real-time automation status, task queues, dependency graphs, execution history, and system health.", + "dependencies": [], + "details": "Use React with TypeScript for all UI components. Style with CSS Modules for maintainable and scoped styles. Ensure the layout is responsive and performant across devices. Implement a navigation system for switching between dashboard views (e.g., status, queues, graphs, history, health).", + "status": "pending", + "testStrategy": "Unit test layout and navigation components with Jest and React Testing Library. Conduct usability testing for navigation flow and responsiveness." + }, + { + "id": 2, + "title": "Integrate Real-Time Data Streaming with WebSocket Client", + "description": "Implement a WebSocket client to receive live updates for automation status, task queues, execution history, and system health metrics.", + "dependencies": [], + "details": "Develop a robust WebSocket client module in TypeScript, handling connection states, reconnection, and message parsing. Ensure real-time data is efficiently propagated to relevant dashboard components. Optimize for minimal latency and graceful degradation during connection issues.", + "status": "pending", + "testStrategy": "Integration test WebSocket client with a mock backend server. Validate real-time update propagation and error handling. Test under simulated network instability." + }, + { + "id": 3, + "title": "Build Interactive Visualization Components", + "description": "Develop interactive visualizations for dependency graphs (D3.js) and analytics charts (Chart.js) to display task dependencies, execution trends, and system health.", + "dependencies": [ + "8.2" + ], + "details": "Implement a dependency graph visualization using D3.js for interactive exploration of task dependencies and status. Use Chart.js for rendering analytics (e.g., execution history, queue lengths, health metrics). Ensure visualizations are performant with large datasets and support user interactions like zoom, filter, and tooltips.", + "status": "pending", + "testStrategy": "Unit test visualization components for rendering accuracy and interaction handling. Integration test with live and simulated data streams. Validate performance with large datasets." + }, + { + "id": 4, + "title": "Implement User Control Interfaces", + "description": "Provide user interfaces for controlling automation: pause/resume/stop, hook toggles, manual task triggers, safety configuration, and tag management.", + "dependencies": [], + "details": "Design and implement control panels for automation management, including buttons for pause/resume/stop, switches for hook toggles, forms for manual task triggers, and settings for safety configuration and tag management. Ensure controls are intuitive, accessible, and provide immediate feedback. Integrate with backend APIs for command execution.", + "status": "pending", + "testStrategy": "Unit test control components for correct state management and API integration. Conduct usability testing for control flow and feedback. Integration test with backend command endpoints." + }, + { + "id": 5, + "title": "Ensure Dashboard Performance, Responsiveness, and Maintainability", + "description": "Optimize the dashboard for fast rendering, smooth interactions, and maintainable code structure.", + "dependencies": [ + "8.1", + "8.2", + "8.3", + "8.4" + ], + "details": "Profile and optimize dashboard performance, focusing on rendering speed, memory usage, and real-time update handling. Enforce TypeScript best practices: strict typing, consistent naming, and avoidance of 'any' type[1]. Use React hooks and functional components for state management. Apply CSS Modules for scoped, maintainable styles. Implement code splitting and lazy loading where beneficial.", + "status": "pending", + "testStrategy": "Performance test dashboard under heavy data load and frequent updates. Audit code for TypeScript and React best practices[1]. Conduct cross-browser and cross-device responsiveness testing." + } + ] + }, + { + "id": 9, + "title": "Integrate Kiro IDE and Taskmaster MCP with Core Services", + "description": "Complete integration of Kiro hook system and Taskmaster MCP commands with the core backend services and UI components.", + "details": "Implement KiroHookAdapter for hook registration, lifecycle, and event handling within Kiro IDE plugin architecture. Implement TaskmasterMCPAdapter for full MCP command support including task operations, tags, complexity analysis, and research features. Integrate file system monitoring and agent communication. Ensure error handling and retry logic for MCP communication. Integrate UI components into Kiro IDE interface.", + "testStrategy": "Perform end-to-end integration testing with Kiro IDE and Taskmaster MCP servers. Validate all hook types and task operations. Test error handling and recovery. Conduct performance and compatibility testing within Kiro IDE.", + "priority": "high", + "dependencies": [ + 1, + 2, + 3, + 5, + 6, + 7, + 8 + ], + "status": "pending", + "subtasks": [ + { + "id": 1, + "title": "Implement KiroHookAdapter for Hook Management", + "description": "Develop the KiroHookAdapter to handle hook registration, lifecycle management, and event handling within the Kiro IDE plugin architecture.", + "dependencies": [], + "details": "Design and implement the adapter to support all hook types, ensuring seamless integration with Kiro's event-driven plugin system. Manage hook lifecycle events and ensure proper event propagation and handling.", + "status": "pending", + "testStrategy": "Unit test hook registration, lifecycle transitions, and event handling. Perform integration tests within the Kiro IDE environment to validate hook responsiveness and correctness." + }, + { + "id": 2, + "title": "Implement TaskmasterMCPAdapter for MCP Command Support", + "description": "Create the TaskmasterMCPAdapter to provide full support for MCP commands including task operations, tags, complexity analysis, and research features.", + "dependencies": [ + "9.1" + ], + "details": "Develop the adapter to interface with Taskmaster MCP servers, supporting commands for task creation, updates, tagging, complexity metrics, and research functionalities. Ensure robust communication and command execution.", + "status": "pending", + "testStrategy": "Unit test MCP command implementations and command parsing. Integration test with Taskmaster MCP servers to validate command execution and response handling." + }, + { + "id": 3, + "title": "Integrate File System Monitoring and Agent Communication", + "description": "Integrate file system event monitoring and agent communication mechanisms to support real-time updates and interactions within Kiro IDE.", + "dependencies": [ + "9.1", + "9.2" + ], + "details": "Implement file watcher integration to detect file changes and trigger appropriate hooks or MCP commands. Establish reliable communication channels between Kiro IDE agents and backend services.", + "status": "pending", + "testStrategy": "Test file system event detection and propagation. Validate agent communication reliability and message handling under various scenarios." + }, + { + "id": 4, + "title": "Implement Error Handling and Retry Logic for MCP Communication", + "description": "Develop comprehensive error handling and retry mechanisms for all MCP communication to ensure robustness and fault tolerance.", + "dependencies": [ + "9.2", + "9.3" + ], + "details": "Design error detection, logging, and recovery strategies for MCP command failures. Implement retry policies with backoff and failure escalation to maintain stable integration.", + "status": "pending", + "testStrategy": "Simulate MCP communication failures and verify error handling paths. Test retry logic effectiveness and system recovery under intermittent failures." + }, + { + "id": 5, + "title": "Integrate UI Components into Kiro IDE Interface", + "description": "Integrate and embed UI components related to Kiro hooks and Taskmaster MCP commands into the Kiro IDE interface for user interaction.", + "dependencies": [ + "9.1", + "9.2", + "9.3", + "9.4" + ], + "details": "Develop UI elements to display hook statuses, task operations, tags, and complexity analysis results. Ensure seamless user experience and interaction within the Kiro IDE environment.", + "status": "pending", + "testStrategy": "Perform UI integration testing to validate component rendering and interaction. Conduct end-to-end tests to verify UI updates reflect backend state changes accurately." + } + ] + }, + { + "id": 10, + "title": "Implement Configuration Management and Safety Profiles", + "description": "Develop a visual configuration editor for hooks, safety constraints, resource limits, and tag contexts with validation, import/export, and version control integration.", + "details": "Build a React-based configuration editor UI with templates and validation using JSON Schema. Support editing of automation rules, safety profiles, resource limits, and tag inheritance. Implement import/export functionality for configuration sharing. Integrate version control for configuration history and rollback. Provide real-time validation feedback and error highlighting.", + "testStrategy": "Unit test configuration editor components and validation logic. Integration test import/export and version control features. Perform user acceptance testing for usability and correctness.", + "priority": "medium", + "dependencies": [ + 1, + 4, + 8 + ], + "status": "pending", + "subtasks": [ + { + "id": 1, + "title": "Design and Implement React-Based Configuration Editor UI", + "description": "Create the main React UI component for the configuration editor using libraries such as Monaco Editor for code editing and Chakra UI for layout and styling.", + "dependencies": [], + "details": "Develop a React component structure to support editing of hooks, safety constraints, resource limits, and tag contexts. Use JSON Schema for validation integration. Implement templates for common configuration patterns. Ensure the UI supports real-time validation feedback and error highlighting.", + "status": "pending", + "testStrategy": "Unit test React components for rendering and validation feedback. Use snapshot testing and interaction tests to verify UI behavior." + }, + { + "id": 2, + "title": "Implement JSON Schema-Based Validation and Real-Time Feedback", + "description": "Integrate JSON Schema validation into the editor to validate configuration inputs dynamically and provide immediate error highlighting and feedback to users.", + "dependencies": [ + "10.1" + ], + "details": "Use JSON Schema to define validation rules for automation rules, safety profiles, resource limits, and tag inheritance. Implement real-time validation that triggers on user input and displays errors inline within the editor UI.", + "status": "pending", + "testStrategy": "Unit test validation logic with various valid and invalid configuration samples. Verify error messages and UI error highlighting." + }, + { + "id": 3, + "title": "Develop Import and Export Functionality for Configuration Sharing", + "description": "Enable users to import existing configuration files and export current configurations for sharing and backup purposes.", + "dependencies": [ + "10.1", + "10.2" + ], + "details": "Implement file handling features to load configuration JSON files into the editor and export the current configuration state to JSON files. Ensure validation is performed on import and errors are reported to users.", + "status": "pending", + "testStrategy": "Integration test import/export workflows with valid and invalid files. Verify that imported configurations populate the editor correctly and exported files match the current state." + }, + { + "id": 4, + "title": "Integrate Version Control for Configuration History and Rollback", + "description": "Add version control capabilities to track configuration changes, view history, and rollback to previous versions within the editor.", + "dependencies": [ + "10.1", + "10.3" + ], + "details": "Implement integration with a version control system (e.g., Git or a custom solution) to save configuration snapshots. Provide UI components to browse history, compare versions, and revert changes. Ensure seamless user experience within the React editor.", + "status": "pending", + "testStrategy": "Integration test version control operations including commit, history browsing, diff viewing, and rollback. Verify data integrity and UI responsiveness." + }, + { + "id": 5, + "title": "Support Editing of Automation Rules, Safety Profiles, Resource Limits, and Tag Inheritance", + "description": "Extend the editor to support detailed editing capabilities for all configuration aspects including automation rules, safety constraints, resource limits, and tag contexts with inheritance.", + "dependencies": [ + "10.1", + "10.2" + ], + "details": "Design and implement UI forms and editors for each configuration domain. Ensure that editing respects validation rules and supports inheritance logic for tags. Provide user-friendly interfaces for complex configuration structures.", + "status": "pending", + "testStrategy": "Unit and integration test editing workflows for each configuration type. Validate inheritance behavior and constraint enforcement." + } + ] + } + ], + "metadata": { + "created": "2025-07-22T09:35:48.856Z", + "updated": "2025-07-22T09:38:19.341Z", + "description": "Tasks for cc-kiro-hooks context" + } } -} +} \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..ec26a18a --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +# Claude Code Instructions + +## Task Master AI Instructions +**Import Task Master's development workflow commands and guidelines, treat as if import is in the main CLAUDE.md file.** +@./.taskmaster/CLAUDE.md diff --git a/assets/kiro-hooks/tm-code-change-task-tracker.kiro.hook b/assets/kiro-hooks/tm-code-change-task-tracker.kiro.hook new file mode 100644 index 00000000..774657e0 --- /dev/null +++ b/assets/kiro-hooks/tm-code-change-task-tracker.kiro.hook @@ -0,0 +1,23 @@ +{ + "enabled": true, + "name": "[TM] Code Change Task Tracker", + "description": "Track implementation progress by monitoring code changes", + "version": "1", + "when": { + "type": "fileEdited", + "patterns": [ + "**/*.{js,ts,jsx,tsx,py,go,rs,java,cpp,c,h,hpp,cs,rb,php,swift,kt,scala,clj}", + "!**/node_modules/**", + "!**/vendor/**", + "!**/.git/**", + "!**/build/**", + "!**/dist/**", + "!**/target/**", + "!**/__pycache__/**" + ] + }, + "then": { + "type": "askAgent", + "prompt": "I just saved a source code file. Please:\n\n1. Check what task is currently 'in-progress' using 'tm list --status=in-progress'\n2. Look at the file I saved and summarize what was changed (considering the programming language and context)\n3. Update the task's notes with: 'tm update-subtask --id=<task_id> --prompt=\"Implemented: <summary_of_changes> in <file_path>\"'\n4. If the changes seem to complete the task based on its description, ask if I want to mark it as done" + } +} \ No newline at end of file diff --git a/assets/kiro-hooks/tm-complexity-analyzer.kiro.hook b/assets/kiro-hooks/tm-complexity-analyzer.kiro.hook new file mode 100644 index 00000000..ef7dcf83 --- /dev/null +++ b/assets/kiro-hooks/tm-complexity-analyzer.kiro.hook @@ -0,0 +1,16 @@ +{ + "enabled": false, + "name": "[TM] Complexity Analyzer", + "description": "Analyze task complexity when new tasks are added", + "version": "1", + "when": { + "type": "fileEdited", + "patterns": [ + ".taskmaster/tasks/tasks.json" + ] + }, + "then": { + "type": "askAgent", + "prompt": "New tasks were added to tasks.json. For each new task:\n\n1. Run 'tm analyze-complexity --id=<task_id>'\n2. If complexity score is > 7, automatically expand it: 'tm expand --id=<task_id> --num=5'\n3. Show the complexity analysis results\n4. Suggest task dependencies based on the expanded subtasks" + } +} \ No newline at end of file diff --git a/assets/kiro-hooks/tm-daily-standup-assistant.kiro.hook b/assets/kiro-hooks/tm-daily-standup-assistant.kiro.hook new file mode 100644 index 00000000..eb3c783f --- /dev/null +++ b/assets/kiro-hooks/tm-daily-standup-assistant.kiro.hook @@ -0,0 +1,13 @@ +{ + "enabled": true, + "name": "[TM] Daily Standup Assistant", + "description": "Morning workflow summary and task selection", + "version": "1", + "when": { + "type": "userTriggered" + }, + "then": { + "type": "askAgent", + "prompt": "Good morning! Please provide my daily standup summary:\n\n1. Run 'tm list --status=done' and show tasks completed in the last 24 hours\n2. Run 'tm list --status=in-progress' to show current work\n3. Run 'tm next' to suggest the highest priority task to start\n4. Show the dependency graph for upcoming work\n5. Ask which task I'd like to focus on today" + } +} \ No newline at end of file diff --git a/assets/kiro-hooks/tm-git-commit-task-linker.kiro.hook b/assets/kiro-hooks/tm-git-commit-task-linker.kiro.hook new file mode 100644 index 00000000..c8d5d064 --- /dev/null +++ b/assets/kiro-hooks/tm-git-commit-task-linker.kiro.hook @@ -0,0 +1,13 @@ +{ + "enabled": true, + "name": "[TM] Git Commit Task Linker", + "description": "Link commits to tasks for traceability", + "version": "1", + "when": { + "type": "manual" + }, + "then": { + "type": "askAgent", + "prompt": "I'm about to commit code. Please:\n\n1. Run 'git diff --staged' to see what's being committed\n2. Analyze the changes and suggest which tasks they relate to\n3. Generate a commit message in format: 'feat(task-<id>): <description>'\n4. Update the relevant tasks with a note about this commit\n5. Show the proposed commit message for approval" + } +} \ No newline at end of file diff --git a/assets/kiro-hooks/tm-pr-readiness-checker.kiro.hook b/assets/kiro-hooks/tm-pr-readiness-checker.kiro.hook new file mode 100644 index 00000000..3c515206 --- /dev/null +++ b/assets/kiro-hooks/tm-pr-readiness-checker.kiro.hook @@ -0,0 +1,13 @@ +{ + "enabled": true, + "name": "[TM] PR Readiness Checker", + "description": "Validate tasks before creating a pull request", + "version": "1", + "when": { + "type": "manual" + }, + "then": { + "type": "askAgent", + "prompt": "I'm about to create a PR. Please:\n\n1. List all tasks marked as 'done' in this branch\n2. For each done task, verify:\n - All subtasks are also done\n - Test files exist for new functionality\n - No TODO comments remain related to the task\n3. Generate a PR description listing completed tasks\n4. Suggest a PR title based on the main tasks completed" + } +} \ No newline at end of file diff --git a/assets/kiro-hooks/tm-task-dependency-auto-progression.kiro.hook b/assets/kiro-hooks/tm-task-dependency-auto-progression.kiro.hook new file mode 100644 index 00000000..465e11d4 --- /dev/null +++ b/assets/kiro-hooks/tm-task-dependency-auto-progression.kiro.hook @@ -0,0 +1,17 @@ +{ + "enabled": true, + "name": "[TM] Task Dependency Auto-Progression", + "description": "Automatically progress tasks when dependencies are completed", + "version": "1", + "when": { + "type": "fileEdited", + "patterns": [ + ".taskmaster/tasks/tasks.json", + ".taskmaster/tasks/*.json" + ] + }, + "then": { + "type": "askAgent", + "prompt": "Check the tasks.json file for any tasks that just changed status to 'done'. For each completed task:\n\n1. Find all tasks that depend on it\n2. Check if those dependent tasks now have all their dependencies satisfied\n3. If a task has all dependencies met and is still 'pending', use the command 'tm set-status --id=<task_id> --status=in-progress' to start it\n4. Show me which tasks were auto-started and why" + } +} \ No newline at end of file diff --git a/assets/kiro-hooks/tm-test-success-task-completer.kiro.hook b/assets/kiro-hooks/tm-test-success-task-completer.kiro.hook new file mode 100644 index 00000000..eb4469d8 --- /dev/null +++ b/assets/kiro-hooks/tm-test-success-task-completer.kiro.hook @@ -0,0 +1,23 @@ +{ + "enabled": true, + "name": "[TM] Test Success Task Completer", + "description": "Mark tasks as done when their tests pass", + "version": "1", + "when": { + "type": "fileEdited", + "patterns": [ + "**/*test*.{js,ts,jsx,tsx,py,go,java,rb,php,rs,cpp,cs}", + "**/*spec*.{js,ts,jsx,tsx,rb}", + "**/test_*.py", + "**/*_test.go", + "**/*Test.java", + "**/*Tests.cs", + "!**/node_modules/**", + "!**/vendor/**" + ] + }, + "then": { + "type": "askAgent", + "prompt": "A test file was just saved. Please:\n\n1. Identify the test framework/language and run the appropriate test command for this file (npm test, pytest, go test, cargo test, dotnet test, mvn test, etc.)\n2. If all tests pass, check which tasks mention this functionality\n3. For any matching tasks that are 'in-progress', ask if the passing tests mean the task is complete\n4. If confirmed, mark the task as done with 'tm set-status --id=<task_id> --status=done'" + } +} \ No newline at end of file diff --git a/assets/rules/taskmaster_hooks_workflow.mdc b/assets/rules/taskmaster_hooks_workflow.mdc new file mode 100644 index 00000000..c6aa84f9 --- /dev/null +++ b/assets/rules/taskmaster_hooks_workflow.mdc @@ -0,0 +1,59 @@ +--- +inclusion: always +--- + +# Taskmaster Hook-Driven Workflow + +## Core Principle: Hooks Automate Task Management + +When working with Taskmaster in Kiro, **avoid manually marking tasks as done**. The hook system automatically handles task completion based on: + +- **Test Success**: `[TM] Test Success Task Completer` detects passing tests and prompts for task completion +- **Code Changes**: `[TM] Code Change Task Tracker` monitors implementation progress +- **Dependency Chains**: `[TM] Task Dependency Auto-Progression` auto-starts dependent tasks + +## AI Assistant Workflow + +Follow this pattern when implementing features: + +1. **Implement First**: Write code, create tests, make changes +2. **Save Frequently**: Hooks trigger on file saves to track progress automatically +3. **Let Hooks Decide**: Allow hooks to detect completion rather than manually setting status +4. **Respond to Prompts**: Confirm when hooks suggest task completion + +## Key Rules for AI Assistants + +- **Never use `tm set-status --status=done`** unless hooks fail to detect completion +- **Always write tests** - they provide the most reliable completion signal +- **Save files after implementation** - this triggers progress tracking +- **Trust hook suggestions** - if no completion prompt appears, more work may be needed + +## Automatic Behaviors + +The hook system provides: + +- **Progress Logging**: Implementation details automatically added to task notes +- **Evidence-Based Completion**: Tasks marked done only when criteria are met +- **Dependency Management**: Next tasks auto-started when dependencies complete +- **Natural Flow**: Focus on coding, not task management overhead + +## Manual Override Cases + +Only manually set task status for: + +- Documentation-only tasks +- Tasks without testable outcomes +- Emergency fixes without proper test coverage + +Use `tm set-status` sparingly - prefer hook-driven completion. + +## Implementation Pattern + +``` +1. Implement feature → Save file +2. Write tests → Save test file +3. Tests pass → Hook prompts completion +4. Confirm completion → Next task auto-starts +``` + +This workflow ensures proper task tracking while maintaining development flow. \ No newline at end of file diff --git a/src/profiles/kiro.js b/src/profiles/kiro.js index 5dff0604..5eb32fb6 100644 --- a/src/profiles/kiro.js +++ b/src/profiles/kiro.js @@ -1,5 +1,8 @@ // Kiro profile for rule-transformer import { createProfile } from './base-profile.js'; +import fs from 'fs'; +import path from 'path'; +import { log } from '../../scripts/modules/utils.js'; // Create and export kiro profile using the base factory export const kiroProfile = createProfile({ @@ -20,6 +23,7 @@ export const kiroProfile = createProfile({ // 'rules/self_improve.mdc': 'self_improve.md' // 'rules/taskmaster.mdc': 'taskmaster.md' // We can add additional custom mappings here if needed + 'rules/taskmaster_hooks_workflow.mdc': 'taskmaster_hooks_workflow.md' }, customReplacements: [ // Core Kiro directory structure changes @@ -37,6 +41,45 @@ export const kiroProfile = createProfile({ // Kiro specific terminology { from: /rules directory/g, to: 'steering directory' }, - { from: /cursor rules/gi, to: 'Kiro steering files' } - ] + { from: /cursor rules/gi, to: 'Kiro steering files' }, + + // Transform frontmatter to Kiro format + // This regex matches the entire frontmatter block and replaces it + { + from: /^---\n(?:description:\s*[^\n]*\n)?(?:globs:\s*[^\n]*\n)?(?:alwaysApply:\s*true\n)?---/m, + to: '---\ninclusion: always\n---' + } + ], + + // Add lifecycle hook to copy Kiro hooks + onPostConvert: (projectRoot, assetsDir) => { + const hooksSourceDir = path.join(assetsDir, 'kiro-hooks'); + const hooksTargetDir = path.join(projectRoot, '.kiro', 'hooks'); + + // Create hooks directory if it doesn't exist + if (!fs.existsSync(hooksTargetDir)) { + fs.mkdirSync(hooksTargetDir, { recursive: true }); + } + + // Copy all .kiro.hook files + if (fs.existsSync(hooksSourceDir)) { + const hookFiles = fs + .readdirSync(hooksSourceDir) + .filter((f) => f.endsWith('.kiro.hook')); + + hookFiles.forEach((file) => { + const sourcePath = path.join(hooksSourceDir, file); + const targetPath = path.join(hooksTargetDir, file); + + fs.copyFileSync(sourcePath, targetPath); + }); + + if (hookFiles.length > 0) { + log( + 'info', + `[Kiro] Installed ${hookFiles.length} Taskmaster hooks in .kiro/hooks/` + ); + } + } + } }); diff --git a/tests/unit/profiles/rule-transformer-kiro.test.js b/tests/unit/profiles/rule-transformer-kiro.test.js index b1a2ce81..8cb5abc2 100644 --- a/tests/unit/profiles/rule-transformer-kiro.test.js +++ b/tests/unit/profiles/rule-transformer-kiro.test.js @@ -5,7 +5,15 @@ jest.mock('fs', () => ({ readFileSync: jest.fn(), writeFileSync: jest.fn(), existsSync: jest.fn(), - mkdirSync: jest.fn() + mkdirSync: jest.fn(), + readdirSync: jest.fn(), + copyFileSync: jest.fn() +})); + +// Mock the log function +jest.mock('../../../scripts/modules/utils.js', () => ({ + log: jest.fn(), + isSilentMode: jest.fn().mockReturnValue(false) })); // Import modules after mocking @@ -22,6 +30,7 @@ describe('Kiro Rule Transformer', () => { const mockConsoleError = jest .spyOn(console, 'error') .mockImplementation(() => {}); + jest.spyOn(console, 'log').mockImplementation(() => {}); beforeEach(() => { jest.clearAllMocks(); @@ -209,7 +218,113 @@ Use the .mdc extension for all rule files.`; 'rules/cursor_rules.mdc': 'kiro_rules.md', 'rules/dev_workflow.mdc': 'dev_workflow.md', 'rules/self_improve.mdc': 'self_improve.md', - 'rules/taskmaster.mdc': 'taskmaster.md' + 'rules/taskmaster.mdc': 'taskmaster.md', + 'rules/taskmaster_hooks_workflow.mdc': 'taskmaster_hooks_workflow.md' + }); + }); + + describe('onPostConvert lifecycle hook', () => { + const mockReaddirSync = jest.spyOn(fs, 'readdirSync'); + const mockCopyFileSync = jest.spyOn(fs, 'copyFileSync'); + + beforeEach(() => { + jest.clearAllMocks(); + // Setup default mock implementation that doesn't throw + mockCopyFileSync.mockImplementation(() => {}); + }); + + it('should copy hook files when kiro-hooks directory exists', () => { + const projectRoot = '/test/project'; + const assetsDir = '/test/assets'; + const hookFiles = [ + 'tm-test-hook1.kiro.hook', + 'tm-test-hook2.kiro.hook', + 'not-a-hook.txt' + ]; + + // Mock directory existence + mockExistsSync.mockImplementation((path) => { + if (path === '/test/assets/kiro-hooks') return true; + if (path === '/test/project/.kiro/hooks') return false; + return true; + }); + + // Mock reading hook files + mockReaddirSync.mockReturnValue(hookFiles); + + // Call the lifecycle hook + kiroProfile.onPostConvertRulesProfile(projectRoot, assetsDir); + + // Verify hooks directory was created + expect(mockMkdirSync).toHaveBeenCalledWith('/test/project/.kiro/hooks', { + recursive: true + }); + + // Verify only .kiro.hook files were copied + expect(mockCopyFileSync).toHaveBeenCalledTimes(2); + expect(mockCopyFileSync).toHaveBeenCalledWith( + '/test/assets/kiro-hooks/tm-test-hook1.kiro.hook', + '/test/project/.kiro/hooks/tm-test-hook1.kiro.hook' + ); + expect(mockCopyFileSync).toHaveBeenCalledWith( + '/test/assets/kiro-hooks/tm-test-hook2.kiro.hook', + '/test/project/.kiro/hooks/tm-test-hook2.kiro.hook' + ); + }); + + it('should handle case when hooks directory already exists', () => { + const projectRoot = '/test/project'; + const assetsDir = '/test/assets'; + const hookFiles = ['tm-test-hook.kiro.hook']; + + // Mock all directories exist + mockExistsSync.mockReturnValue(true); + mockReaddirSync.mockReturnValue(hookFiles); + + // Call the lifecycle hook + kiroProfile.onPostConvertRulesProfile(projectRoot, assetsDir); + + // Verify hooks directory was NOT created (already exists) + expect(mockMkdirSync).not.toHaveBeenCalled(); + + // Verify hook was copied + expect(mockCopyFileSync).toHaveBeenCalledWith( + '/test/assets/kiro-hooks/tm-test-hook.kiro.hook', + '/test/project/.kiro/hooks/tm-test-hook.kiro.hook' + ); + }); + + it('should handle case when kiro-hooks source directory does not exist', () => { + const projectRoot = '/test/project'; + const assetsDir = '/test/assets'; + + // Mock source directory doesn't exist + mockExistsSync.mockImplementation((path) => { + if (path === '/test/assets/kiro-hooks') return false; + return true; + }); + + // Call the lifecycle hook + kiroProfile.onPostConvertRulesProfile(projectRoot, assetsDir); + + // Verify no files were copied + expect(mockReaddirSync).not.toHaveBeenCalled(); + expect(mockCopyFileSync).not.toHaveBeenCalled(); + }); + + it('should handle case when no hook files exist in source directory', () => { + const projectRoot = '/test/project'; + const assetsDir = '/test/assets'; + + // Mock directory exists but has no hook files + mockExistsSync.mockReturnValue(true); + mockReaddirSync.mockReturnValue(['readme.txt', 'config.json']); + + // Call the lifecycle hook + kiroProfile.onPostConvertRulesProfile(projectRoot, assetsDir); + + // Verify no files were copied + expect(mockCopyFileSync).not.toHaveBeenCalled(); }); }); });