#
tokens: 40666/50000 2/975 files (page 58/69)
lines: on (toggle) GitHub
raw markdown copy reset
This is page 58 of 69. Use http://codebase.md/eyaltoledano/claude-task-master?lines=true&page={x} to view the full context.

# Directory Structure

```
├── .changeset
│   ├── config.json
│   └── README.md
├── .claude
│   ├── commands
│   │   └── dedupe.md
│   └── TM_COMMANDS_GUIDE.md
├── .claude-plugin
│   └── marketplace.json
├── .coderabbit.yaml
├── .cursor
│   ├── mcp.json
│   └── rules
│       ├── ai_providers.mdc
│       ├── ai_services.mdc
│       ├── architecture.mdc
│       ├── changeset.mdc
│       ├── commands.mdc
│       ├── context_gathering.mdc
│       ├── cursor_rules.mdc
│       ├── dependencies.mdc
│       ├── dev_workflow.mdc
│       ├── git_workflow.mdc
│       ├── glossary.mdc
│       ├── mcp.mdc
│       ├── new_features.mdc
│       ├── self_improve.mdc
│       ├── tags.mdc
│       ├── taskmaster.mdc
│       ├── tasks.mdc
│       ├── telemetry.mdc
│       ├── test_workflow.mdc
│       ├── tests.mdc
│       ├── ui.mdc
│       └── utilities.mdc
├── .cursorignore
├── .env.example
├── .github
│   ├── ISSUE_TEMPLATE
│   │   ├── bug_report.md
│   │   ├── enhancements---feature-requests.md
│   │   └── feedback.md
│   ├── PULL_REQUEST_TEMPLATE
│   │   ├── bugfix.md
│   │   ├── config.yml
│   │   ├── feature.md
│   │   └── integration.md
│   ├── PULL_REQUEST_TEMPLATE.md
│   ├── scripts
│   │   ├── auto-close-duplicates.mjs
│   │   ├── backfill-duplicate-comments.mjs
│   │   ├── check-pre-release-mode.mjs
│   │   ├── parse-metrics.mjs
│   │   ├── release.mjs
│   │   ├── tag-extension.mjs
│   │   ├── utils.mjs
│   │   └── validate-changesets.mjs
│   └── workflows
│       ├── auto-close-duplicates.yml
│       ├── backfill-duplicate-comments.yml
│       ├── ci.yml
│       ├── claude-dedupe-issues.yml
│       ├── claude-docs-trigger.yml
│       ├── claude-docs-updater.yml
│       ├── claude-issue-triage.yml
│       ├── claude.yml
│       ├── extension-ci.yml
│       ├── extension-release.yml
│       ├── log-issue-events.yml
│       ├── pre-release.yml
│       ├── release-check.yml
│       ├── release.yml
│       ├── update-models-md.yml
│       └── weekly-metrics-discord.yml
├── .gitignore
├── .kiro
│   ├── hooks
│   │   ├── tm-code-change-task-tracker.kiro.hook
│   │   ├── tm-complexity-analyzer.kiro.hook
│   │   ├── tm-daily-standup-assistant.kiro.hook
│   │   ├── tm-git-commit-task-linker.kiro.hook
│   │   ├── tm-pr-readiness-checker.kiro.hook
│   │   ├── tm-task-dependency-auto-progression.kiro.hook
│   │   └── tm-test-success-task-completer.kiro.hook
│   ├── settings
│   │   └── mcp.json
│   └── steering
│       ├── dev_workflow.md
│       ├── kiro_rules.md
│       ├── self_improve.md
│       ├── taskmaster_hooks_workflow.md
│       └── taskmaster.md
├── .manypkg.json
├── .mcp.json
├── .npmignore
├── .nvmrc
├── .taskmaster
│   ├── CLAUDE.md
│   ├── config.json
│   ├── docs
│   │   ├── autonomous-tdd-git-workflow.md
│   │   ├── MIGRATION-ROADMAP.md
│   │   ├── prd-tm-start.txt
│   │   ├── prd.txt
│   │   ├── README.md
│   │   ├── research
│   │   │   ├── 2025-06-14_how-can-i-improve-the-scope-up-and-scope-down-comm.md
│   │   │   ├── 2025-06-14_should-i-be-using-any-specific-libraries-for-this.md
│   │   │   ├── 2025-06-14_test-save-functionality.md
│   │   │   ├── 2025-06-14_test-the-fix-for-duplicate-saves-final-test.md
│   │   │   └── 2025-08-01_do-we-need-to-add-new-commands-or-can-we-just-weap.md
│   │   ├── task-template-importing-prd.txt
│   │   ├── tdd-workflow-phase-0-spike.md
│   │   ├── tdd-workflow-phase-1-core-rails.md
│   │   ├── tdd-workflow-phase-1-orchestrator.md
│   │   ├── tdd-workflow-phase-2-pr-resumability.md
│   │   ├── tdd-workflow-phase-3-extensibility-guardrails.md
│   │   ├── test-prd.txt
│   │   └── tm-core-phase-1.txt
│   ├── reports
│   │   ├── task-complexity-report_autonomous-tdd-git-workflow.json
│   │   ├── task-complexity-report_cc-kiro-hooks.json
│   │   ├── task-complexity-report_tdd-phase-1-core-rails.json
│   │   ├── task-complexity-report_tdd-workflow-phase-0.json
│   │   ├── task-complexity-report_test-prd-tag.json
│   │   ├── task-complexity-report_tm-core-phase-1.json
│   │   ├── task-complexity-report.json
│   │   └── tm-core-complexity.json
│   ├── state.json
│   ├── tasks
│   │   ├── task_001_tm-start.txt
│   │   ├── task_002_tm-start.txt
│   │   ├── task_003_tm-start.txt
│   │   ├── task_004_tm-start.txt
│   │   ├── task_007_tm-start.txt
│   │   └── tasks.json
│   └── templates
│       ├── example_prd_rpg.md
│       └── example_prd.md
├── .vscode
│   ├── extensions.json
│   └── settings.json
├── apps
│   ├── cli
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── command-registry.ts
│   │   │   ├── commands
│   │   │   │   ├── auth.command.ts
│   │   │   │   ├── autopilot
│   │   │   │   │   ├── abort.command.ts
│   │   │   │   │   ├── commit.command.ts
│   │   │   │   │   ├── complete.command.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── next.command.ts
│   │   │   │   │   ├── resume.command.ts
│   │   │   │   │   ├── shared.ts
│   │   │   │   │   ├── start.command.ts
│   │   │   │   │   └── status.command.ts
│   │   │   │   ├── briefs.command.ts
│   │   │   │   ├── context.command.ts
│   │   │   │   ├── export.command.ts
│   │   │   │   ├── list.command.ts
│   │   │   │   ├── models
│   │   │   │   │   ├── custom-providers.ts
│   │   │   │   │   ├── fetchers.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── prompts.ts
│   │   │   │   │   ├── setup.ts
│   │   │   │   │   └── types.ts
│   │   │   │   ├── next.command.ts
│   │   │   │   ├── set-status.command.ts
│   │   │   │   ├── show.command.ts
│   │   │   │   ├── start.command.ts
│   │   │   │   └── tags.command.ts
│   │   │   ├── index.ts
│   │   │   ├── lib
│   │   │   │   └── model-management.ts
│   │   │   ├── types
│   │   │   │   └── tag-management.d.ts
│   │   │   ├── ui
│   │   │   │   ├── components
│   │   │   │   │   ├── cardBox.component.ts
│   │   │   │   │   ├── dashboard.component.ts
│   │   │   │   │   ├── header.component.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── next-task.component.ts
│   │   │   │   │   ├── suggested-steps.component.ts
│   │   │   │   │   └── task-detail.component.ts
│   │   │   │   ├── display
│   │   │   │   │   ├── messages.ts
│   │   │   │   │   └── tables.ts
│   │   │   │   ├── formatters
│   │   │   │   │   ├── complexity-formatters.ts
│   │   │   │   │   ├── dependency-formatters.ts
│   │   │   │   │   ├── priority-formatters.ts
│   │   │   │   │   ├── status-formatters.spec.ts
│   │   │   │   │   └── status-formatters.ts
│   │   │   │   ├── index.ts
│   │   │   │   └── layout
│   │   │   │       ├── helpers.spec.ts
│   │   │   │       └── helpers.ts
│   │   │   └── utils
│   │   │       ├── auth-helpers.ts
│   │   │       ├── auto-update.ts
│   │   │       ├── brief-selection.ts
│   │   │       ├── display-helpers.ts
│   │   │       ├── error-handler.ts
│   │   │       ├── index.ts
│   │   │       ├── project-root.ts
│   │   │       ├── task-status.ts
│   │   │       ├── ui.spec.ts
│   │   │       └── ui.ts
│   │   ├── tests
│   │   │   ├── integration
│   │   │   │   └── commands
│   │   │   │       └── autopilot
│   │   │   │           └── workflow.test.ts
│   │   │   └── unit
│   │   │       ├── commands
│   │   │       │   ├── autopilot
│   │   │       │   │   └── shared.test.ts
│   │   │       │   ├── list.command.spec.ts
│   │   │       │   └── show.command.spec.ts
│   │   │       └── ui
│   │   │           └── dashboard.component.spec.ts
│   │   ├── tsconfig.json
│   │   └── vitest.config.ts
│   ├── docs
│   │   ├── archive
│   │   │   ├── ai-client-utils-example.mdx
│   │   │   ├── ai-development-workflow.mdx
│   │   │   ├── command-reference.mdx
│   │   │   ├── configuration.mdx
│   │   │   ├── cursor-setup.mdx
│   │   │   ├── examples.mdx
│   │   │   └── Installation.mdx
│   │   ├── best-practices
│   │   │   ├── advanced-tasks.mdx
│   │   │   ├── configuration-advanced.mdx
│   │   │   └── index.mdx
│   │   ├── capabilities
│   │   │   ├── cli-root-commands.mdx
│   │   │   ├── index.mdx
│   │   │   ├── mcp.mdx
│   │   │   ├── rpg-method.mdx
│   │   │   └── task-structure.mdx
│   │   ├── CHANGELOG.md
│   │   ├── command-reference.mdx
│   │   ├── configuration.mdx
│   │   ├── docs.json
│   │   ├── favicon.svg
│   │   ├── getting-started
│   │   │   ├── api-keys.mdx
│   │   │   ├── contribute.mdx
│   │   │   ├── faq.mdx
│   │   │   └── quick-start
│   │   │       ├── configuration-quick.mdx
│   │   │       ├── execute-quick.mdx
│   │   │       ├── installation.mdx
│   │   │       ├── moving-forward.mdx
│   │   │       ├── prd-quick.mdx
│   │   │       ├── quick-start.mdx
│   │   │       ├── requirements.mdx
│   │   │       ├── rules-quick.mdx
│   │   │       └── tasks-quick.mdx
│   │   ├── introduction.mdx
│   │   ├── licensing.md
│   │   ├── logo
│   │   │   ├── dark.svg
│   │   │   ├── light.svg
│   │   │   └── task-master-logo.png
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── style.css
│   │   ├── tdd-workflow
│   │   │   ├── ai-agent-integration.mdx
│   │   │   └── quickstart.mdx
│   │   ├── vercel.json
│   │   └── whats-new.mdx
│   ├── extension
│   │   ├── .vscodeignore
│   │   ├── assets
│   │   │   ├── banner.png
│   │   │   ├── icon-dark.svg
│   │   │   ├── icon-light.svg
│   │   │   ├── icon.png
│   │   │   ├── screenshots
│   │   │   │   ├── kanban-board.png
│   │   │   │   └── task-details.png
│   │   │   └── sidebar-icon.svg
│   │   ├── CHANGELOG.md
│   │   ├── components.json
│   │   ├── docs
│   │   │   ├── extension-CI-setup.md
│   │   │   └── extension-development-guide.md
│   │   ├── esbuild.js
│   │   ├── LICENSE
│   │   ├── package.json
│   │   ├── package.mjs
│   │   ├── package.publish.json
│   │   ├── README.md
│   │   ├── src
│   │   │   ├── components
│   │   │   │   ├── ConfigView.tsx
│   │   │   │   ├── constants.ts
│   │   │   │   ├── TaskDetails
│   │   │   │   │   ├── AIActionsSection.tsx
│   │   │   │   │   ├── DetailsSection.tsx
│   │   │   │   │   ├── PriorityBadge.tsx
│   │   │   │   │   ├── SubtasksSection.tsx
│   │   │   │   │   ├── TaskMetadataSidebar.tsx
│   │   │   │   │   └── useTaskDetails.ts
│   │   │   │   ├── TaskDetailsView.tsx
│   │   │   │   ├── TaskMasterLogo.tsx
│   │   │   │   └── ui
│   │   │   │       ├── badge.tsx
│   │   │   │       ├── breadcrumb.tsx
│   │   │   │       ├── button.tsx
│   │   │   │       ├── card.tsx
│   │   │   │       ├── collapsible.tsx
│   │   │   │       ├── CollapsibleSection.tsx
│   │   │   │       ├── dropdown-menu.tsx
│   │   │   │       ├── label.tsx
│   │   │   │       ├── scroll-area.tsx
│   │   │   │       ├── separator.tsx
│   │   │   │       ├── shadcn-io
│   │   │   │       │   └── kanban
│   │   │   │       │       └── index.tsx
│   │   │   │       └── textarea.tsx
│   │   │   ├── extension.ts
│   │   │   ├── index.ts
│   │   │   ├── lib
│   │   │   │   └── utils.ts
│   │   │   ├── services
│   │   │   │   ├── config-service.ts
│   │   │   │   ├── error-handler.ts
│   │   │   │   ├── notification-preferences.ts
│   │   │   │   ├── polling-service.ts
│   │   │   │   ├── polling-strategies.ts
│   │   │   │   ├── sidebar-webview-manager.ts
│   │   │   │   ├── task-repository.ts
│   │   │   │   ├── terminal-manager.ts
│   │   │   │   └── webview-manager.ts
│   │   │   ├── test
│   │   │   │   └── extension.test.ts
│   │   │   ├── utils
│   │   │   │   ├── configManager.ts
│   │   │   │   ├── connectionManager.ts
│   │   │   │   ├── errorHandler.ts
│   │   │   │   ├── event-emitter.ts
│   │   │   │   ├── logger.ts
│   │   │   │   ├── mcpClient.ts
│   │   │   │   ├── notificationPreferences.ts
│   │   │   │   └── task-master-api
│   │   │   │       ├── cache
│   │   │   │       │   └── cache-manager.ts
│   │   │   │       ├── index.ts
│   │   │   │       ├── mcp-client.ts
│   │   │   │       ├── transformers
│   │   │   │       │   └── task-transformer.ts
│   │   │   │       └── types
│   │   │   │           └── index.ts
│   │   │   └── webview
│   │   │       ├── App.tsx
│   │   │       ├── components
│   │   │       │   ├── AppContent.tsx
│   │   │       │   ├── EmptyState.tsx
│   │   │       │   ├── ErrorBoundary.tsx
│   │   │       │   ├── PollingStatus.tsx
│   │   │       │   ├── PriorityBadge.tsx
│   │   │       │   ├── SidebarView.tsx
│   │   │       │   ├── TagDropdown.tsx
│   │   │       │   ├── TaskCard.tsx
│   │   │       │   ├── TaskEditModal.tsx
│   │   │       │   ├── TaskMasterKanban.tsx
│   │   │       │   ├── ToastContainer.tsx
│   │   │       │   └── ToastNotification.tsx
│   │   │       ├── constants
│   │   │       │   └── index.ts
│   │   │       ├── contexts
│   │   │       │   └── VSCodeContext.tsx
│   │   │       ├── hooks
│   │   │       │   ├── useTaskQueries.ts
│   │   │       │   ├── useVSCodeMessages.ts
│   │   │       │   └── useWebviewHeight.ts
│   │   │       ├── index.css
│   │   │       ├── index.tsx
│   │   │       ├── providers
│   │   │       │   └── QueryProvider.tsx
│   │   │       ├── reducers
│   │   │       │   └── appReducer.ts
│   │   │       ├── sidebar.tsx
│   │   │       ├── types
│   │   │       │   └── index.ts
│   │   │       └── utils
│   │   │           ├── logger.ts
│   │   │           └── toast.ts
│   │   └── tsconfig.json
│   └── mcp
│       ├── CHANGELOG.md
│       ├── package.json
│       ├── src
│       │   ├── index.ts
│       │   ├── shared
│       │   │   ├── types.ts
│       │   │   └── utils.ts
│       │   └── tools
│       │       ├── autopilot
│       │       │   ├── abort.tool.ts
│       │       │   ├── commit.tool.ts
│       │       │   ├── complete.tool.ts
│       │       │   ├── finalize.tool.ts
│       │       │   ├── index.ts
│       │       │   ├── next.tool.ts
│       │       │   ├── resume.tool.ts
│       │       │   ├── start.tool.ts
│       │       │   └── status.tool.ts
│       │       ├── README-ZOD-V3.md
│       │       └── tasks
│       │           ├── get-task.tool.ts
│       │           ├── get-tasks.tool.ts
│       │           └── index.ts
│       ├── tsconfig.json
│       └── vitest.config.ts
├── assets
│   ├── .windsurfrules
│   ├── AGENTS.md
│   ├── claude
│   │   └── TM_COMMANDS_GUIDE.md
│   ├── config.json
│   ├── env.example
│   ├── example_prd_rpg.txt
│   ├── example_prd.txt
│   ├── GEMINI.md
│   ├── gitignore
│   ├── kiro-hooks
│   │   ├── tm-code-change-task-tracker.kiro.hook
│   │   ├── tm-complexity-analyzer.kiro.hook
│   │   ├── tm-daily-standup-assistant.kiro.hook
│   │   ├── tm-git-commit-task-linker.kiro.hook
│   │   ├── tm-pr-readiness-checker.kiro.hook
│   │   ├── tm-task-dependency-auto-progression.kiro.hook
│   │   └── tm-test-success-task-completer.kiro.hook
│   ├── roocode
│   │   ├── .roo
│   │   │   ├── rules-architect
│   │   │   │   └── architect-rules
│   │   │   ├── rules-ask
│   │   │   │   └── ask-rules
│   │   │   ├── rules-code
│   │   │   │   └── code-rules
│   │   │   ├── rules-debug
│   │   │   │   └── debug-rules
│   │   │   ├── rules-orchestrator
│   │   │   │   └── orchestrator-rules
│   │   │   └── rules-test
│   │   │       └── test-rules
│   │   └── .roomodes
│   ├── rules
│   │   ├── cursor_rules.mdc
│   │   ├── dev_workflow.mdc
│   │   ├── self_improve.mdc
│   │   ├── taskmaster_hooks_workflow.mdc
│   │   └── taskmaster.mdc
│   └── scripts_README.md
├── bin
│   └── task-master.js
├── biome.json
├── CHANGELOG.md
├── CLAUDE_CODE_PLUGIN.md
├── CLAUDE.md
├── context
│   ├── chats
│   │   ├── add-task-dependencies-1.md
│   │   └── max-min-tokens.txt.md
│   ├── fastmcp-core.txt
│   ├── fastmcp-docs.txt
│   ├── MCP_INTEGRATION.md
│   ├── mcp-js-sdk-docs.txt
│   ├── mcp-protocol-repo.txt
│   ├── mcp-protocol-schema-03262025.json
│   └── mcp-protocol-spec.txt
├── CONTRIBUTING.md
├── docs
│   ├── claude-code-integration.md
│   ├── CLI-COMMANDER-PATTERN.md
│   ├── command-reference.md
│   ├── configuration.md
│   ├── contributor-docs
│   │   ├── testing-roo-integration.md
│   │   └── worktree-setup.md
│   ├── cross-tag-task-movement.md
│   ├── examples
│   │   ├── claude-code-usage.md
│   │   └── codex-cli-usage.md
│   ├── examples.md
│   ├── licensing.md
│   ├── mcp-provider-guide.md
│   ├── mcp-provider.md
│   ├── migration-guide.md
│   ├── models.md
│   ├── providers
│   │   ├── codex-cli.md
│   │   └── gemini-cli.md
│   ├── README.md
│   ├── scripts
│   │   └── models-json-to-markdown.js
│   ├── task-structure.md
│   └── tutorial.md
├── images
│   ├── hamster-hiring.png
│   └── logo.png
├── index.js
├── jest.config.js
├── jest.resolver.cjs
├── LICENSE
├── llms-install.md
├── mcp-server
│   ├── server.js
│   └── src
│       ├── core
│       │   ├── __tests__
│       │   │   └── context-manager.test.js
│       │   ├── context-manager.js
│       │   ├── direct-functions
│       │   │   ├── add-dependency.js
│       │   │   ├── add-subtask.js
│       │   │   ├── add-tag.js
│       │   │   ├── add-task.js
│       │   │   ├── analyze-task-complexity.js
│       │   │   ├── cache-stats.js
│       │   │   ├── clear-subtasks.js
│       │   │   ├── complexity-report.js
│       │   │   ├── copy-tag.js
│       │   │   ├── create-tag-from-branch.js
│       │   │   ├── delete-tag.js
│       │   │   ├── expand-all-tasks.js
│       │   │   ├── expand-task.js
│       │   │   ├── fix-dependencies.js
│       │   │   ├── generate-task-files.js
│       │   │   ├── initialize-project.js
│       │   │   ├── list-tags.js
│       │   │   ├── models.js
│       │   │   ├── move-task-cross-tag.js
│       │   │   ├── move-task.js
│       │   │   ├── next-task.js
│       │   │   ├── parse-prd.js
│       │   │   ├── remove-dependency.js
│       │   │   ├── remove-subtask.js
│       │   │   ├── remove-task.js
│       │   │   ├── rename-tag.js
│       │   │   ├── research.js
│       │   │   ├── response-language.js
│       │   │   ├── rules.js
│       │   │   ├── scope-down.js
│       │   │   ├── scope-up.js
│       │   │   ├── set-task-status.js
│       │   │   ├── update-subtask-by-id.js
│       │   │   ├── update-task-by-id.js
│       │   │   ├── update-tasks.js
│       │   │   ├── use-tag.js
│       │   │   └── validate-dependencies.js
│       │   ├── task-master-core.js
│       │   └── utils
│       │       ├── env-utils.js
│       │       └── path-utils.js
│       ├── custom-sdk
│       │   ├── errors.js
│       │   ├── index.js
│       │   ├── json-extractor.js
│       │   ├── language-model.js
│       │   ├── message-converter.js
│       │   └── schema-converter.js
│       ├── index.js
│       ├── logger.js
│       ├── providers
│       │   └── mcp-provider.js
│       └── tools
│           ├── add-dependency.js
│           ├── add-subtask.js
│           ├── add-tag.js
│           ├── add-task.js
│           ├── analyze.js
│           ├── clear-subtasks.js
│           ├── complexity-report.js
│           ├── copy-tag.js
│           ├── delete-tag.js
│           ├── expand-all.js
│           ├── expand-task.js
│           ├── fix-dependencies.js
│           ├── generate.js
│           ├── get-operation-status.js
│           ├── index.js
│           ├── initialize-project.js
│           ├── list-tags.js
│           ├── models.js
│           ├── move-task.js
│           ├── next-task.js
│           ├── parse-prd.js
│           ├── README-ZOD-V3.md
│           ├── remove-dependency.js
│           ├── remove-subtask.js
│           ├── remove-task.js
│           ├── rename-tag.js
│           ├── research.js
│           ├── response-language.js
│           ├── rules.js
│           ├── scope-down.js
│           ├── scope-up.js
│           ├── set-task-status.js
│           ├── tool-registry.js
│           ├── update-subtask.js
│           ├── update-task.js
│           ├── update.js
│           ├── use-tag.js
│           ├── utils.js
│           └── validate-dependencies.js
├── mcp-test.js
├── output.json
├── package-lock.json
├── package.json
├── packages
│   ├── ai-sdk-provider-grok-cli
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── src
│   │   │   ├── errors.test.ts
│   │   │   ├── errors.ts
│   │   │   ├── grok-cli-language-model.ts
│   │   │   ├── grok-cli-provider.test.ts
│   │   │   ├── grok-cli-provider.ts
│   │   │   ├── index.ts
│   │   │   ├── json-extractor.test.ts
│   │   │   ├── json-extractor.ts
│   │   │   ├── message-converter.test.ts
│   │   │   ├── message-converter.ts
│   │   │   └── types.ts
│   │   └── tsconfig.json
│   ├── build-config
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   ├── src
│   │   │   └── tsdown.base.ts
│   │   └── tsconfig.json
│   ├── claude-code-plugin
│   │   ├── .claude-plugin
│   │   │   └── plugin.json
│   │   ├── .gitignore
│   │   ├── agents
│   │   │   ├── task-checker.md
│   │   │   ├── task-executor.md
│   │   │   └── task-orchestrator.md
│   │   ├── CHANGELOG.md
│   │   ├── commands
│   │   │   ├── add-dependency.md
│   │   │   ├── add-subtask.md
│   │   │   ├── add-task.md
│   │   │   ├── analyze-complexity.md
│   │   │   ├── analyze-project.md
│   │   │   ├── auto-implement-tasks.md
│   │   │   ├── command-pipeline.md
│   │   │   ├── complexity-report.md
│   │   │   ├── convert-task-to-subtask.md
│   │   │   ├── expand-all-tasks.md
│   │   │   ├── expand-task.md
│   │   │   ├── fix-dependencies.md
│   │   │   ├── generate-tasks.md
│   │   │   ├── help.md
│   │   │   ├── init-project-quick.md
│   │   │   ├── init-project.md
│   │   │   ├── install-taskmaster.md
│   │   │   ├── learn.md
│   │   │   ├── list-tasks-by-status.md
│   │   │   ├── list-tasks-with-subtasks.md
│   │   │   ├── list-tasks.md
│   │   │   ├── next-task.md
│   │   │   ├── parse-prd-with-research.md
│   │   │   ├── parse-prd.md
│   │   │   ├── project-status.md
│   │   │   ├── quick-install-taskmaster.md
│   │   │   ├── remove-all-subtasks.md
│   │   │   ├── remove-dependency.md
│   │   │   ├── remove-subtask.md
│   │   │   ├── remove-subtasks.md
│   │   │   ├── remove-task.md
│   │   │   ├── setup-models.md
│   │   │   ├── show-task.md
│   │   │   ├── smart-workflow.md
│   │   │   ├── sync-readme.md
│   │   │   ├── tm-main.md
│   │   │   ├── to-cancelled.md
│   │   │   ├── to-deferred.md
│   │   │   ├── to-done.md
│   │   │   ├── to-in-progress.md
│   │   │   ├── to-pending.md
│   │   │   ├── to-review.md
│   │   │   ├── update-single-task.md
│   │   │   ├── update-task.md
│   │   │   ├── update-tasks-from-id.md
│   │   │   ├── validate-dependencies.md
│   │   │   └── view-models.md
│   │   ├── mcp.json
│   │   └── package.json
│   ├── tm-bridge
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── src
│   │   │   ├── add-tag-bridge.ts
│   │   │   ├── bridge-types.ts
│   │   │   ├── bridge-utils.ts
│   │   │   ├── expand-bridge.ts
│   │   │   ├── index.ts
│   │   │   ├── tags-bridge.ts
│   │   │   ├── update-bridge.ts
│   │   │   └── use-tag-bridge.ts
│   │   └── tsconfig.json
│   └── tm-core
│       ├── .gitignore
│       ├── CHANGELOG.md
│       ├── docs
│       │   └── listTasks-architecture.md
│       ├── package.json
│       ├── POC-STATUS.md
│       ├── README.md
│       ├── src
│       │   ├── common
│       │   │   ├── constants
│       │   │   │   ├── index.ts
│       │   │   │   ├── paths.ts
│       │   │   │   └── providers.ts
│       │   │   ├── errors
│       │   │   │   ├── index.ts
│       │   │   │   └── task-master-error.ts
│       │   │   ├── interfaces
│       │   │   │   ├── configuration.interface.ts
│       │   │   │   ├── index.ts
│       │   │   │   └── storage.interface.ts
│       │   │   ├── logger
│       │   │   │   ├── factory.ts
│       │   │   │   ├── index.ts
│       │   │   │   ├── logger.spec.ts
│       │   │   │   └── logger.ts
│       │   │   ├── mappers
│       │   │   │   ├── TaskMapper.test.ts
│       │   │   │   └── TaskMapper.ts
│       │   │   ├── types
│       │   │   │   ├── database.types.ts
│       │   │   │   ├── index.ts
│       │   │   │   ├── legacy.ts
│       │   │   │   └── repository-types.ts
│       │   │   └── utils
│       │   │       ├── git-utils.ts
│       │   │       ├── id-generator.ts
│       │   │       ├── index.ts
│       │   │       ├── path-helpers.ts
│       │   │       ├── path-normalizer.spec.ts
│       │   │       ├── path-normalizer.ts
│       │   │       ├── project-root-finder.spec.ts
│       │   │       ├── project-root-finder.ts
│       │   │       ├── run-id-generator.spec.ts
│       │   │       └── run-id-generator.ts
│       │   ├── index.ts
│       │   ├── modules
│       │   │   ├── ai
│       │   │   │   ├── index.ts
│       │   │   │   ├── interfaces
│       │   │   │   │   └── ai-provider.interface.ts
│       │   │   │   └── providers
│       │   │   │       ├── base-provider.ts
│       │   │   │       └── index.ts
│       │   │   ├── auth
│       │   │   │   ├── auth-domain.spec.ts
│       │   │   │   ├── auth-domain.ts
│       │   │   │   ├── config.ts
│       │   │   │   ├── index.ts
│       │   │   │   ├── managers
│       │   │   │   │   ├── auth-manager.spec.ts
│       │   │   │   │   └── auth-manager.ts
│       │   │   │   ├── services
│       │   │   │   │   ├── context-store.ts
│       │   │   │   │   ├── oauth-service.ts
│       │   │   │   │   ├── organization.service.ts
│       │   │   │   │   ├── supabase-session-storage.spec.ts
│       │   │   │   │   └── supabase-session-storage.ts
│       │   │   │   └── types.ts
│       │   │   ├── briefs
│       │   │   │   ├── briefs-domain.ts
│       │   │   │   ├── index.ts
│       │   │   │   ├── services
│       │   │   │   │   └── brief-service.ts
│       │   │   │   ├── types.ts
│       │   │   │   └── utils
│       │   │   │       └── url-parser.ts
│       │   │   ├── commands
│       │   │   │   └── index.ts
│       │   │   ├── config
│       │   │   │   ├── config-domain.ts
│       │   │   │   ├── index.ts
│       │   │   │   ├── managers
│       │   │   │   │   ├── config-manager.spec.ts
│       │   │   │   │   └── config-manager.ts
│       │   │   │   └── services
│       │   │   │       ├── config-loader.service.spec.ts
│       │   │   │       ├── config-loader.service.ts
│       │   │   │       ├── config-merger.service.spec.ts
│       │   │   │       ├── config-merger.service.ts
│       │   │   │       ├── config-persistence.service.spec.ts
│       │   │   │       ├── config-persistence.service.ts
│       │   │   │       ├── environment-config-provider.service.spec.ts
│       │   │   │       ├── environment-config-provider.service.ts
│       │   │   │       ├── index.ts
│       │   │   │       ├── runtime-state-manager.service.spec.ts
│       │   │   │       └── runtime-state-manager.service.ts
│       │   │   ├── dependencies
│       │   │   │   └── index.ts
│       │   │   ├── execution
│       │   │   │   ├── executors
│       │   │   │   │   ├── base-executor.ts
│       │   │   │   │   ├── claude-executor.ts
│       │   │   │   │   └── executor-factory.ts
│       │   │   │   ├── index.ts
│       │   │   │   ├── services
│       │   │   │   │   └── executor-service.ts
│       │   │   │   └── types.ts
│       │   │   ├── git
│       │   │   │   ├── adapters
│       │   │   │   │   ├── git-adapter.test.ts
│       │   │   │   │   └── git-adapter.ts
│       │   │   │   ├── git-domain.ts
│       │   │   │   ├── index.ts
│       │   │   │   └── services
│       │   │   │       ├── branch-name-generator.spec.ts
│       │   │   │       ├── branch-name-generator.ts
│       │   │   │       ├── commit-message-generator.test.ts
│       │   │   │       ├── commit-message-generator.ts
│       │   │   │       ├── scope-detector.test.ts
│       │   │   │       ├── scope-detector.ts
│       │   │   │       ├── template-engine.test.ts
│       │   │   │       └── template-engine.ts
│       │   │   ├── integration
│       │   │   │   ├── clients
│       │   │   │   │   ├── index.ts
│       │   │   │   │   └── supabase-client.ts
│       │   │   │   ├── integration-domain.ts
│       │   │   │   └── services
│       │   │   │       ├── export.service.ts
│       │   │   │       ├── task-expansion.service.ts
│       │   │   │       └── task-retrieval.service.ts
│       │   │   ├── reports
│       │   │   │   ├── index.ts
│       │   │   │   ├── managers
│       │   │   │   │   └── complexity-report-manager.ts
│       │   │   │   └── types.ts
│       │   │   ├── storage
│       │   │   │   ├── adapters
│       │   │   │   │   ├── activity-logger.ts
│       │   │   │   │   ├── api-storage.ts
│       │   │   │   │   └── file-storage
│       │   │   │   │       ├── file-operations.ts
│       │   │   │   │       ├── file-storage.ts
│       │   │   │   │       ├── format-handler.ts
│       │   │   │   │       ├── index.ts
│       │   │   │   │       └── path-resolver.ts
│       │   │   │   ├── index.ts
│       │   │   │   ├── services
│       │   │   │   │   └── storage-factory.ts
│       │   │   │   └── utils
│       │   │   │       └── api-client.ts
│       │   │   ├── tasks
│       │   │   │   ├── entities
│       │   │   │   │   └── task.entity.ts
│       │   │   │   ├── parser
│       │   │   │   │   └── index.ts
│       │   │   │   ├── repositories
│       │   │   │   │   ├── supabase
│       │   │   │   │   │   ├── dependency-fetcher.ts
│       │   │   │   │   │   ├── index.ts
│       │   │   │   │   │   └── supabase-repository.ts
│       │   │   │   │   └── task-repository.interface.ts
│       │   │   │   ├── services
│       │   │   │   │   ├── preflight-checker.service.ts
│       │   │   │   │   ├── tag.service.ts
│       │   │   │   │   ├── task-execution-service.ts
│       │   │   │   │   ├── task-loader.service.ts
│       │   │   │   │   └── task-service.ts
│       │   │   │   └── tasks-domain.ts
│       │   │   ├── ui
│       │   │   │   └── index.ts
│       │   │   └── workflow
│       │   │       ├── managers
│       │   │       │   ├── workflow-state-manager.spec.ts
│       │   │       │   └── workflow-state-manager.ts
│       │   │       ├── orchestrators
│       │   │       │   ├── workflow-orchestrator.test.ts
│       │   │       │   └── workflow-orchestrator.ts
│       │   │       ├── services
│       │   │       │   ├── test-result-validator.test.ts
│       │   │       │   ├── test-result-validator.ts
│       │   │       │   ├── test-result-validator.types.ts
│       │   │       │   ├── workflow-activity-logger.ts
│       │   │       │   └── workflow.service.ts
│       │   │       ├── types.ts
│       │   │       └── workflow-domain.ts
│       │   ├── subpath-exports.test.ts
│       │   ├── tm-core.ts
│       │   └── utils
│       │       └── time.utils.ts
│       ├── tests
│       │   ├── auth
│       │   │   └── auth-refresh.test.ts
│       │   ├── integration
│       │   │   ├── auth-token-refresh.test.ts
│       │   │   ├── list-tasks.test.ts
│       │   │   └── storage
│       │   │       └── activity-logger.test.ts
│       │   ├── mocks
│       │   │   └── mock-provider.ts
│       │   ├── setup.ts
│       │   └── unit
│       │       ├── base-provider.test.ts
│       │       ├── executor.test.ts
│       │       └── smoke.test.ts
│       ├── tsconfig.json
│       └── vitest.config.ts
├── README-task-master.md
├── README.md
├── scripts
│   ├── create-worktree.sh
│   ├── dev.js
│   ├── init.js
│   ├── list-worktrees.sh
│   ├── modules
│   │   ├── ai-services-unified.js
│   │   ├── bridge-utils.js
│   │   ├── commands.js
│   │   ├── config-manager.js
│   │   ├── dependency-manager.js
│   │   ├── index.js
│   │   ├── prompt-manager.js
│   │   ├── supported-models.json
│   │   ├── sync-readme.js
│   │   ├── task-manager
│   │   │   ├── add-subtask.js
│   │   │   ├── add-task.js
│   │   │   ├── analyze-task-complexity.js
│   │   │   ├── clear-subtasks.js
│   │   │   ├── expand-all-tasks.js
│   │   │   ├── expand-task.js
│   │   │   ├── find-next-task.js
│   │   │   ├── generate-task-files.js
│   │   │   ├── is-task-dependent.js
│   │   │   ├── list-tasks.js
│   │   │   ├── migrate.js
│   │   │   ├── models.js
│   │   │   ├── move-task.js
│   │   │   ├── parse-prd
│   │   │   │   ├── index.js
│   │   │   │   ├── parse-prd-config.js
│   │   │   │   ├── parse-prd-helpers.js
│   │   │   │   ├── parse-prd-non-streaming.js
│   │   │   │   ├── parse-prd-streaming.js
│   │   │   │   └── parse-prd.js
│   │   │   ├── remove-subtask.js
│   │   │   ├── remove-task.js
│   │   │   ├── research.js
│   │   │   ├── response-language.js
│   │   │   ├── scope-adjustment.js
│   │   │   ├── set-task-status.js
│   │   │   ├── tag-management.js
│   │   │   ├── task-exists.js
│   │   │   ├── update-single-task-status.js
│   │   │   ├── update-subtask-by-id.js
│   │   │   ├── update-task-by-id.js
│   │   │   └── update-tasks.js
│   │   ├── task-manager.js
│   │   ├── ui.js
│   │   ├── update-config-tokens.js
│   │   ├── utils
│   │   │   ├── contextGatherer.js
│   │   │   ├── fuzzyTaskSearch.js
│   │   │   └── git-utils.js
│   │   └── utils.js
│   ├── task-complexity-report.json
│   ├── test-claude-errors.js
│   └── test-claude.js
├── sonar-project.properties
├── src
│   ├── ai-providers
│   │   ├── anthropic.js
│   │   ├── azure.js
│   │   ├── base-provider.js
│   │   ├── bedrock.js
│   │   ├── claude-code.js
│   │   ├── codex-cli.js
│   │   ├── gemini-cli.js
│   │   ├── google-vertex.js
│   │   ├── google.js
│   │   ├── grok-cli.js
│   │   ├── groq.js
│   │   ├── index.js
│   │   ├── lmstudio.js
│   │   ├── ollama.js
│   │   ├── openai-compatible.js
│   │   ├── openai.js
│   │   ├── openrouter.js
│   │   ├── perplexity.js
│   │   ├── xai.js
│   │   ├── zai-coding.js
│   │   └── zai.js
│   ├── constants
│   │   ├── commands.js
│   │   ├── paths.js
│   │   ├── profiles.js
│   │   ├── rules-actions.js
│   │   ├── task-priority.js
│   │   └── task-status.js
│   ├── profiles
│   │   ├── amp.js
│   │   ├── base-profile.js
│   │   ├── claude.js
│   │   ├── cline.js
│   │   ├── codex.js
│   │   ├── cursor.js
│   │   ├── gemini.js
│   │   ├── index.js
│   │   ├── kilo.js
│   │   ├── kiro.js
│   │   ├── opencode.js
│   │   ├── roo.js
│   │   ├── trae.js
│   │   ├── vscode.js
│   │   ├── windsurf.js
│   │   └── zed.js
│   ├── progress
│   │   ├── base-progress-tracker.js
│   │   ├── cli-progress-factory.js
│   │   ├── parse-prd-tracker.js
│   │   ├── progress-tracker-builder.js
│   │   └── tracker-ui.js
│   ├── prompts
│   │   ├── add-task.json
│   │   ├── analyze-complexity.json
│   │   ├── expand-task.json
│   │   ├── parse-prd.json
│   │   ├── README.md
│   │   ├── research.json
│   │   ├── schemas
│   │   │   ├── parameter.schema.json
│   │   │   ├── prompt-template.schema.json
│   │   │   ├── README.md
│   │   │   └── variant.schema.json
│   │   ├── update-subtask.json
│   │   ├── update-task.json
│   │   └── update-tasks.json
│   ├── provider-registry
│   │   └── index.js
│   ├── schemas
│   │   ├── add-task.js
│   │   ├── analyze-complexity.js
│   │   ├── base-schemas.js
│   │   ├── expand-task.js
│   │   ├── parse-prd.js
│   │   ├── registry.js
│   │   ├── update-subtask.js
│   │   ├── update-task.js
│   │   └── update-tasks.js
│   ├── task-master.js
│   ├── ui
│   │   ├── confirm.js
│   │   ├── indicators.js
│   │   └── parse-prd.js
│   └── utils
│       ├── asset-resolver.js
│       ├── create-mcp-config.js
│       ├── format.js
│       ├── getVersion.js
│       ├── logger-utils.js
│       ├── manage-gitignore.js
│       ├── path-utils.js
│       ├── profiles.js
│       ├── rule-transformer.js
│       ├── stream-parser.js
│       └── timeout-manager.js
├── test-clean-tags.js
├── test-config-manager.js
├── test-prd.txt
├── test-tag-functions.js
├── test-version-check-full.js
├── test-version-check.js
├── tests
│   ├── e2e
│   │   ├── e2e_helpers.sh
│   │   ├── parse_llm_output.cjs
│   │   ├── run_e2e.sh
│   │   ├── run_fallback_verification.sh
│   │   └── test_llm_analysis.sh
│   ├── fixtures
│   │   ├── .taskmasterconfig
│   │   ├── sample-claude-response.js
│   │   ├── sample-prd.txt
│   │   └── sample-tasks.js
│   ├── helpers
│   │   └── tool-counts.js
│   ├── integration
│   │   ├── claude-code-error-handling.test.js
│   │   ├── claude-code-optional.test.js
│   │   ├── cli
│   │   │   ├── commands.test.js
│   │   │   ├── complex-cross-tag-scenarios.test.js
│   │   │   └── move-cross-tag.test.js
│   │   ├── manage-gitignore.test.js
│   │   ├── mcp-server
│   │   │   └── direct-functions.test.js
│   │   ├── move-task-cross-tag.integration.test.js
│   │   ├── move-task-simple.integration.test.js
│   │   ├── profiles
│   │   │   ├── amp-init-functionality.test.js
│   │   │   ├── claude-init-functionality.test.js
│   │   │   ├── cline-init-functionality.test.js
│   │   │   ├── codex-init-functionality.test.js
│   │   │   ├── cursor-init-functionality.test.js
│   │   │   ├── gemini-init-functionality.test.js
│   │   │   ├── opencode-init-functionality.test.js
│   │   │   ├── roo-files-inclusion.test.js
│   │   │   ├── roo-init-functionality.test.js
│   │   │   ├── rules-files-inclusion.test.js
│   │   │   ├── trae-init-functionality.test.js
│   │   │   ├── vscode-init-functionality.test.js
│   │   │   └── windsurf-init-functionality.test.js
│   │   └── providers
│   │       └── temperature-support.test.js
│   ├── manual
│   │   ├── progress
│   │   │   ├── parse-prd-analysis.js
│   │   │   ├── test-parse-prd.js
│   │   │   └── TESTING_GUIDE.md
│   │   └── prompts
│   │       ├── prompt-test.js
│   │       └── README.md
│   ├── README.md
│   ├── setup.js
│   └── unit
│       ├── ai-providers
│       │   ├── base-provider.test.js
│       │   ├── claude-code.test.js
│       │   ├── codex-cli.test.js
│       │   ├── gemini-cli.test.js
│       │   ├── lmstudio.test.js
│       │   ├── mcp-components.test.js
│       │   ├── openai-compatible.test.js
│       │   ├── openai.test.js
│       │   ├── provider-registry.test.js
│       │   ├── zai-coding.test.js
│       │   ├── zai-provider.test.js
│       │   ├── zai-schema-introspection.test.js
│       │   └── zai.test.js
│       ├── ai-services-unified.test.js
│       ├── commands.test.js
│       ├── config-manager.test.js
│       ├── config-manager.test.mjs
│       ├── dependency-manager.test.js
│       ├── init.test.js
│       ├── initialize-project.test.js
│       ├── kebab-case-validation.test.js
│       ├── manage-gitignore.test.js
│       ├── mcp
│       │   └── tools
│       │       ├── __mocks__
│       │       │   └── move-task.js
│       │       ├── add-task.test.js
│       │       ├── analyze-complexity.test.js
│       │       ├── expand-all.test.js
│       │       ├── get-tasks.test.js
│       │       ├── initialize-project.test.js
│       │       ├── move-task-cross-tag-options.test.js
│       │       ├── move-task-cross-tag.test.js
│       │       ├── remove-task.test.js
│       │       └── tool-registration.test.js
│       ├── mcp-providers
│       │   ├── mcp-components.test.js
│       │   └── mcp-provider.test.js
│       ├── parse-prd.test.js
│       ├── profiles
│       │   ├── amp-integration.test.js
│       │   ├── claude-integration.test.js
│       │   ├── cline-integration.test.js
│       │   ├── codex-integration.test.js
│       │   ├── cursor-integration.test.js
│       │   ├── gemini-integration.test.js
│       │   ├── kilo-integration.test.js
│       │   ├── kiro-integration.test.js
│       │   ├── mcp-config-validation.test.js
│       │   ├── opencode-integration.test.js
│       │   ├── profile-safety-check.test.js
│       │   ├── roo-integration.test.js
│       │   ├── rule-transformer-cline.test.js
│       │   ├── rule-transformer-cursor.test.js
│       │   ├── rule-transformer-gemini.test.js
│       │   ├── rule-transformer-kilo.test.js
│       │   ├── rule-transformer-kiro.test.js
│       │   ├── rule-transformer-opencode.test.js
│       │   ├── rule-transformer-roo.test.js
│       │   ├── rule-transformer-trae.test.js
│       │   ├── rule-transformer-vscode.test.js
│       │   ├── rule-transformer-windsurf.test.js
│       │   ├── rule-transformer-zed.test.js
│       │   ├── rule-transformer.test.js
│       │   ├── selective-profile-removal.test.js
│       │   ├── subdirectory-support.test.js
│       │   ├── trae-integration.test.js
│       │   ├── vscode-integration.test.js
│       │   ├── windsurf-integration.test.js
│       │   └── zed-integration.test.js
│       ├── progress
│       │   └── base-progress-tracker.test.js
│       ├── prompt-manager.test.js
│       ├── prompts
│       │   ├── expand-task-prompt.test.js
│       │   └── prompt-migration.test.js
│       ├── scripts
│       │   └── modules
│       │       ├── commands
│       │       │   ├── move-cross-tag.test.js
│       │       │   └── README.md
│       │       ├── dependency-manager
│       │       │   ├── circular-dependencies.test.js
│       │       │   ├── cross-tag-dependencies.test.js
│       │       │   └── fix-dependencies-command.test.js
│       │       ├── task-manager
│       │       │   ├── add-subtask.test.js
│       │       │   ├── add-task.test.js
│       │       │   ├── analyze-task-complexity.test.js
│       │       │   ├── clear-subtasks.test.js
│       │       │   ├── complexity-report-tag-isolation.test.js
│       │       │   ├── expand-all-tasks.test.js
│       │       │   ├── expand-task.test.js
│       │       │   ├── find-next-task.test.js
│       │       │   ├── generate-task-files.test.js
│       │       │   ├── list-tasks.test.js
│       │       │   ├── models-baseurl.test.js
│       │       │   ├── move-task-cross-tag.test.js
│       │       │   ├── move-task.test.js
│       │       │   ├── parse-prd-schema.test.js
│       │       │   ├── parse-prd.test.js
│       │       │   ├── remove-subtask.test.js
│       │       │   ├── remove-task.test.js
│       │       │   ├── research.test.js
│       │       │   ├── scope-adjustment.test.js
│       │       │   ├── set-task-status.test.js
│       │       │   ├── setup.js
│       │       │   ├── update-single-task-status.test.js
│       │       │   ├── update-subtask-by-id.test.js
│       │       │   ├── update-task-by-id.test.js
│       │       │   └── update-tasks.test.js
│       │       ├── ui
│       │       │   └── cross-tag-error-display.test.js
│       │       └── utils-tag-aware-paths.test.js
│       ├── task-finder.test.js
│       ├── task-manager
│       │   ├── clear-subtasks.test.js
│       │   ├── move-task.test.js
│       │   ├── tag-boundary.test.js
│       │   └── tag-management.test.js
│       ├── task-master.test.js
│       ├── ui
│       │   └── indicators.test.js
│       ├── ui.test.js
│       ├── utils-strip-ansi.test.js
│       └── utils.test.js
├── tsconfig.json
├── tsdown.config.ts
├── turbo.json
└── update-task-migration-plan.md
```

# Files

--------------------------------------------------------------------------------
/update-task-migration-plan.md:
--------------------------------------------------------------------------------

```markdown
   1 | # Update Task Migration Plan
   2 | 
   3 | ## Overview
   4 | 
   5 | Migrate and unify `update-tasks.js` and `update-subtask-by-id.js` into a single `update-task` command that handles both task and subtask updates. This migration will move from the legacy `scripts/modules/task-manager/` structure to the new `apps/cli` and `packages/tm-core` architecture.
   6 | 
   7 | ## Current State Analysis
   8 | 
   9 | ### `update-tasks.js` - Bulk Task Updates
  10 | 
  11 | **Purpose**: Update multiple tasks from a specified ID onwards
  12 | **Input Format**: `--from=<id> --prompt="context"`
  13 | **AI Service**: `generateObjectService` with structured schema
  14 | 
  15 | ### `update-subtask-by-id.js` - Single Subtask Updates
  16 | 
  17 | **Purpose**: Append timestamped information to a specific subtask
  18 | **Input Format**: `--id=<parentId.subtaskId> --prompt="notes"`
  19 | **AI Service**: `generateTextService` for freeform content
  20 | 
  21 | ## Unified Command Design
  22 | 
  23 | ### New Command: `update-task`
  24 | 
  25 | ```bash
  26 | # Update single task (replaces update-task)
  27 | task-master update-task --id=3 --prompt="changes"
  28 | 
  29 | # Update single subtask (replaces update-subtask)
  30 | task-master update-task --id=3.2 --prompt="implementation notes"
  31 | 
  32 | # Update multiple tasks from ID onwards (replaces update --from)
  33 | task-master update-task --from=3 --prompt="changes"
  34 | ```
  35 | 
  36 | ### Intelligent Behavior Detection
  37 | 
  38 | The command should automatically determine behavior based on:
  39 | 
  40 | 1. **ID format**: Contains `.` → subtask mode
  41 | 2. **--from flag**: Present → bulk update mode
  42 | 3. **Default**: Single task update mode
  43 | 
  44 | ---
  45 | 
  46 | ## Functionality Checklist
  47 | 
  48 | ### Core Functionality
  49 | 
  50 | #### Input Validation & Parsing
  51 | 
  52 | - [ ] Validate `tasksPath` exists
  53 | - [ ] Validate `id` parameter (task: integer, subtask: "parent.child" format)
  54 | - [ ] Validate `fromId` parameter (integer, positive)
  55 | - [ ] Validate `prompt` parameter (non-empty string)
  56 | - [ ] Parse subtask ID format: split "parentId.subtaskId" and validate both parts
  57 | - [ ] Determine project root (from context or `findProjectRoot()`)
  58 | - [ ] Support both MCP and CLI modes (detect via `mcpLog` presence)
  59 | - [ ] Handle `outputFormat` ('text' or 'json', auto-detect for MCP)
  60 | 
  61 | #### Task Loading & Filtering
  62 | 
  63 | - [ ] Load tasks from `tasks.json` using `readJSON(tasksPath, projectRoot, tag)`
  64 | - [ ] Validate tasks data structure exists
  65 | - [ ] **Bulk mode**: Filter tasks where `id >= fromId AND status !== 'done'`
  66 | - [ ] **Single task mode**: Find specific task by ID
  67 | - [ ] **Subtask mode**: Find parent task, validate subtasks array, find specific subtask
  68 | - [ ] Handle "no tasks to update" scenario gracefully
  69 | 
  70 | #### Context Gathering
  71 | 
  72 | - [ ] Initialize `ContextGatherer` with projectRoot and tag
  73 | - [ ] Flatten all tasks with subtasks using `flattenTasksWithSubtasks()`
  74 | - [ ] Initialize `FuzzyTaskSearch` with appropriate command type:
  75 |   - `'update'` for bulk/single task mode
  76 |   - `'update-subtask'` for subtask mode
  77 | - [ ] **Bulk/Single task**: Search with prompt, max 5 results, include self
  78 | - [ ] **Subtask mode**: Search with combined query: `${parentTask.title} ${subtask.title} ${prompt}`
  79 | - [ ] Merge task IDs to update with relevant context task IDs
  80 | - [ ] Gather context in 'research' format
  81 | - [ ] Handle context gathering errors gracefully (log warning, continue)
  82 | 
  83 | #### Prompt Building
  84 | 
  85 | - [ ] Initialize `PromptManager` via `getPromptManager()`
  86 | - [ ] **Bulk/Single task mode**: Load 'update-tasks' prompt template with params:
  87 |   - `tasks` (array of tasks to update)
  88 |   - `updatePrompt`
  89 |   - `useResearch`
  90 |   - `projectContext` (gathered context)
  91 |   - `hasCodebaseAnalysis` (from config)
  92 |   - `projectRoot`
  93 | - [ ] **Subtask mode**: Load 'update-subtask' prompt template with params:
  94 |   - `parentTask` (id, title)
  95 |   - `prevSubtask` (id, title, status) - if exists
  96 |   - `nextSubtask` (id, title, status) - if exists
  97 |   - `currentDetails` (existing subtask details or fallback)
  98 |   - `updatePrompt`
  99 |   - `useResearch`
 100 |   - `gatheredContext`
 101 |   - `hasCodebaseAnalysis`
 102 |   - `projectRoot`
 103 | - [ ] **Subtask mode**: Support variant key ('research' or 'default')
 104 | - [ ] Extract `systemPrompt` and `userPrompt` from prompt manager
 105 | 
 106 | #### AI Service Integration
 107 | 
 108 | - [ ] Determine service role: `useResearch ? 'research' : 'main'`
 109 | - [ ] **Bulk/Single task mode**: Call `generateObjectService` with:
 110 |   - `role`, `session`, `projectRoot`
 111 |   - `systemPrompt`, `prompt` (userPrompt)
 112 |   - `schema: COMMAND_SCHEMAS['update-tasks']`
 113 |   - `objectName: 'tasks'`
 114 |   - `commandName: 'update-tasks'`
 115 |   - `outputType: isMCP ? 'mcp' : 'cli'`
 116 | - [ ] **Subtask mode**: Call `generateTextService` with:
 117 |   - `prompt` (userPrompt), `systemPrompt`
 118 |   - `role`, `session`, `projectRoot`
 119 |   - `maxRetries: 2`
 120 |   - `commandName: 'update-subtask'`
 121 |   - `outputType: isMCP ? 'mcp' : 'cli'`
 122 | - [ ] Handle empty/invalid AI responses
 123 | - [ ] Capture `telemetryData` and `tagInfo` from response
 124 | 
 125 | #### Data Updates & Persistence
 126 | 
 127 | - [ ] **Bulk/Single task mode**:
 128 |   - Parse `aiServiceResponse.mainResult.tasks` array
 129 |   - Validate array structure
 130 |   - Create Map for efficient lookup
 131 |   - Merge updated tasks with existing, preserving subtasks field
 132 |   - Track actual update count
 133 | - [ ] **Subtask mode**:
 134 |   - Extract text string from `aiServiceResponse.mainResult`
 135 |   - Generate ISO timestamp
 136 |   - Format as: `<info added on ${timestamp}>\n${content}\n</info added on ${timestamp}>`
 137 |   - Append to `subtask.details` (create if doesn't exist)
 138 |   - Store newly added snippet separately for display
 139 |   - If prompt < 100 chars: append `[Updated: ${date}]` to subtask.description
 140 | - [ ] Write updated data using `writeJSON(tasksPath, data, projectRoot, tag)`
 141 | - [ ] Optionally call `generateTaskFiles()` (currently commented out in both)
 142 | 
 143 | #### CLI Display & UX
 144 | 
 145 | - [ ] **Pre-update display** (CLI only, text mode):
 146 |   - Create table with columns: ID, Title, Status
 147 |   - Truncate titles appropriately (57 chars for tasks, 52 for subtasks)
 148 |   - Apply status colors via `getStatusWithColor()`
 149 |   - Show boxed header with update count/target
 150 |   - **Bulk mode**: Show info box about completed subtasks handling
 151 |   - Display table
 152 | - [ ] **Loading indicators** (CLI only, text mode):
 153 |   - Start loading indicator before AI call
 154 |   - Message: "Updating tasks with AI..." (bulk/single) or "Updating subtask..." (subtask)
 155 |   - Support research variant message
 156 |   - Stop indicator when complete or on error
 157 | - [ ] **Post-update display** (CLI only, text mode):
 158 |   - **Bulk/Single task**: Success message with update count
 159 |   - **Subtask mode**: Boxed success message with:
 160 |     - Subtask ID
 161 |     - Title
 162 |     - "Newly Added Snippet" section showing timestamped content
 163 |   - Display AI usage summary via `displayAiUsageSummary(telemetryData, 'cli')`
 164 | 
 165 | #### Logging & Debugging
 166 | 
 167 | - [ ] Use appropriate logger: `mcpLog` (MCP) or `consoleLog` (CLI)
 168 | - [ ] Log info messages with proper format (MCP vs CLI differences)
 169 | - [ ] Log start of operation with key parameters
 170 | - [ ] Log task counts and AI response details
 171 | - [ ] Log successful completion
 172 | - [ ] **Debug mode** (when `getDebugFlag(session)` true):
 173 |   - Log subtask details before/after update
 174 |   - Log writeJSON calls
 175 |   - Log full error stack traces
 176 | 
 177 | #### Error Handling
 178 | 
 179 | - [ ] Catch and handle errors at multiple levels:
 180 |   - Context gathering errors (warn and continue)
 181 |   - AI service errors (stop and report)
 182 |   - General operation errors (report and exit/throw)
 183 | - [ ] **CLI mode**:
 184 |   - Print colored error messages
 185 |   - Show helpful troubleshooting for common errors:
 186 |     - API key missing/invalid
 187 |     - Model overloaded
 188 |     - Task/subtask not found
 189 |     - Invalid ID format
 190 |     - Empty prompt
 191 |     - Empty AI response
 192 |   - Exit with code 1
 193 | - [ ] **MCP mode**: Re-throw errors for caller handling
 194 | - [ ] Always stop loading indicators on error
 195 | 
 196 | #### Return Values
 197 | 
 198 | - [ ] **Success returns** (both modes):
 199 | 
 200 |   ```javascript
 201 |   {
 202 |     success: true,  // bulk/single task only
 203 |     updatedTasks: [...],  // bulk/single task only
 204 |     updatedSubtask: {...},  // subtask only
 205 |     telemetryData: {...},
 206 |     tagInfo: {...}
 207 |   }
 208 |   ```
 209 | 
 210 | - [ ] **Failure returns**:
 211 |   - CLI: exits with code 1
 212 |   - MCP: throws error
 213 |   - Subtask mode: returns `null` on error
 214 | 
 215 | ### Special Features
 216 | 
 217 | #### Completed Subtasks Handling (Bulk Mode)
 218 | 
 219 | - [ ] Display informational box explaining:
 220 |   - Done/completed subtasks are preserved
 221 |   - New subtasks build upon completed work
 222 |   - Revisions create new subtasks instead of modifying done items
 223 |   - Maintains clear record of progress
 224 | 
 225 | #### Subtask Context Awareness
 226 | 
 227 | - [ ] Provide parent task context (id, title) to AI
 228 | - [ ] Provide previous subtask context (if exists) to AI
 229 | - [ ] Provide next subtask context (if exists) to AI
 230 | - [ ] Include current subtask details in prompt
 231 | 
 232 | #### Timestamp Tracking
 233 | 
 234 | - [ ] Use ISO format timestamps for subtask updates
 235 | - [ ] Wrap appended content in timestamped tags
 236 | - [ ] Update description field with simple date stamp (short prompts only)
 237 | 
 238 | ---
 239 | 
 240 | ## Migration Architecture
 241 | 
 242 | ### Object-Oriented Design Philosophy
 243 | 
 244 | This migration will follow the established patterns in `tm-core` and `apps/cli`:
 245 | - **Domain separation** with clear bounded contexts
 246 | - **Dependency injection** for testability and flexibility
 247 | - **Abstract base classes** for shared behavior
 248 | - **Interfaces** for contracts and loose coupling
 249 | - **Service layer** for business logic orchestration
 250 | - **Factory pattern** for object creation
 251 | - **Single Responsibility Principle** throughout
 252 | 
 253 | ### Package Structure
 254 | 
 255 | ```
 256 | packages/tm-core/
 257 |   src/
 258 |     commands/
 259 |       update-task/
 260 |         # Core Interfaces & Types
 261 |         types.ts                              # Shared types, enums, interfaces
 262 |         interfaces/
 263 |           update-strategy.interface.ts        # IUpdateStrategy contract
 264 |           update-context.interface.ts         # IUpdateContext contract
 265 |           display.interface.ts                # IDisplayManager contract
 266 | 
 267 |         # Services (Business Logic)
 268 |         update-task.service.ts                # Main orchestrator service
 269 |         context-builder.service.ts            # Builds AI context (uses ContextGatherer, FuzzySearch)
 270 |         prompt-builder.service.ts             # Builds prompts (uses PromptManager)
 271 |         data-merger.service.ts                # Merges AI results with existing data
 272 | 
 273 |         # Strategies (Update Mode Logic)
 274 |         strategies/
 275 |           base-update.strategy.ts             # Abstract base class for all strategies
 276 |           bulk-update.strategy.ts             # Bulk task update implementation
 277 |           single-task-update.strategy.ts      # Single task update implementation
 278 |           subtask-update.strategy.ts          # Subtask update implementation
 279 | 
 280 |         # Utilities & Helpers
 281 |         validators/
 282 |           update-input.validator.ts           # Validates all input parameters
 283 |           task-id.validator.ts                # Parses and validates task/subtask IDs
 284 | 
 285 |         display/
 286 |           cli-display.manager.ts              # CLI output formatting
 287 |           json-display.manager.ts             # JSON output formatting
 288 |           update-display.factory.ts           # Creates appropriate display manager
 289 | 
 290 |         factories/
 291 |           update-strategy.factory.ts          # Creates appropriate strategy based on mode
 292 | 
 293 |         # Main Entry Point
 294 |         index.ts                              # Public API export
 295 | 
 296 | apps/cli/
 297 |   src/
 298 |     commands/
 299 |       update-task.command.ts                  # CLI command definition (uses UpdateTaskService)
 300 | ```
 301 | 
 302 | ### Core Classes & Their Responsibilities
 303 | 
 304 | #### 1. **UpdateTaskService** (Main Orchestrator)
 305 | ```typescript
 306 | /**
 307 |  * Main service that coordinates the entire update process
 308 |  * Handles initialization, strategy selection, and result aggregation
 309 |  */
 310 | export class UpdateTaskService {
 311 |   constructor(
 312 |     private readonly configManager: ConfigManager,
 313 |     private readonly storage: IStorage,
 314 |     private readonly logger: Logger,
 315 |     private readonly strategyFactory: UpdateStrategyFactory,
 316 |     private readonly contextBuilder: ContextBuilderService,
 317 |     private readonly displayFactory: UpdateDisplayFactory
 318 |   ) {}
 319 | 
 320 |   async updateTask(options: UpdateTaskOptions): Promise<UpdateTaskResult> {
 321 |     // 1. Validate inputs
 322 |     // 2. Detect mode and create strategy
 323 |     // 3. Build context
 324 |     // 4. Execute strategy
 325 |     // 5. Display results
 326 |     // 6. Return result
 327 |   }
 328 | }
 329 | ```
 330 | 
 331 | **Uses (existing classes):**
 332 | - `ConfigManager` - Project configuration
 333 | - `IStorage` - Task persistence
 334 | - `Logger` - Logging
 335 | - `ContextGatherer` - Gather related context
 336 | - `FuzzyTaskSearch` - Find relevant tasks
 337 | - `PromptManager` - Load prompt templates
 338 | 
 339 | **Uses (new classes):**
 340 | - `UpdateStrategyFactory` - Create update strategy
 341 | - `ContextBuilderService` - Build AI context
 342 | - `UpdateDisplayFactory` - Create display manager
 343 | 
 344 | ---
 345 | 
 346 | #### 2. **IUpdateStrategy** (Strategy Interface)
 347 | ```typescript
 348 | /**
 349 |  * Contract for all update strategies
 350 |  * Defines the common interface for bulk, single, and subtask updates
 351 |  */
 352 | export interface IUpdateStrategy {
 353 |   /**
 354 |    * Validate that the strategy can handle the given context
 355 |    */
 356 |   validate(context: IUpdateContext): Promise<void>;
 357 | 
 358 |   /**
 359 |    * Load and filter tasks that need updating
 360 |    */
 361 |   loadTasks(context: IUpdateContext): Promise<TaskLoadResult>;
 362 | 
 363 |   /**
 364 |    * Build prompts for AI service
 365 |    */
 366 |   buildPrompts(
 367 |     context: IUpdateContext,
 368 |     tasks: TaskLoadResult
 369 |   ): Promise<PromptResult>;
 370 | 
 371 |   /**
 372 |    * Call appropriate AI service
 373 |    */
 374 |   callAIService(
 375 |     context: IUpdateContext,
 376 |     prompts: PromptResult
 377 |   ): Promise<AIServiceResult>;
 378 | 
 379 |   /**
 380 |    * Merge AI results with existing data
 381 |    */
 382 |   mergeResults(
 383 |     context: IUpdateContext,
 384 |     aiResult: AIServiceResult,
 385 |     originalTasks: TaskLoadResult
 386 |   ): Promise<MergeResult>;
 387 | 
 388 |   /**
 389 |    * Get the mode this strategy handles
 390 |    */
 391 |   getMode(): UpdateMode;
 392 | }
 393 | ```
 394 | 
 395 | ---
 396 | 
 397 | #### 3. **BaseUpdateStrategy** (Abstract Base Class)
 398 | ```typescript
 399 | /**
 400 |  * Provides common functionality for all update strategies
 401 |  * Implements template method pattern for the update workflow
 402 |  */
 403 | export abstract class BaseUpdateStrategy implements IUpdateStrategy {
 404 |   protected readonly logger: Logger;
 405 | 
 406 |   constructor(
 407 |     protected readonly contextBuilder: ContextBuilderService,
 408 |     protected readonly promptBuilder: PromptBuilderService,
 409 |     protected readonly dataMerger: DataMergerService,
 410 |     protected readonly aiService: AIService // wrapper around generate[Object|Text]Service
 411 |   ) {
 412 |     this.logger = getLogger(`UpdateStrategy:${this.getMode()}`);
 413 |   }
 414 | 
 415 |   // Template method - defines the workflow
 416 |   async execute(context: IUpdateContext): Promise<UpdateStrategyResult> {
 417 |     await this.validate(context);
 418 |     const tasks = await this.loadTasks(context);
 419 |     const prompts = await this.buildPrompts(context, tasks);
 420 |     const aiResult = await this.callAIService(context, prompts);
 421 |     const merged = await this.mergeResults(context, aiResult, tasks);
 422 |     return merged;
 423 |   }
 424 | 
 425 |   // Subclasses must implement these
 426 |   abstract validate(context: IUpdateContext): Promise<void>;
 427 |   abstract loadTasks(context: IUpdateContext): Promise<TaskLoadResult>;
 428 |   abstract getMode(): UpdateMode;
 429 | 
 430 |   // Shared implementations with extensibility
 431 |   async buildPrompts(
 432 |     context: IUpdateContext,
 433 |     tasks: TaskLoadResult
 434 |   ): Promise<PromptResult> {
 435 |     // Delegates to PromptBuilderService with mode-specific params
 436 |   }
 437 | 
 438 |   protected abstract getPromptParams(
 439 |     context: IUpdateContext,
 440 |     tasks: TaskLoadResult
 441 |   ): PromptParams;
 442 | }
 443 | ```
 444 | 
 445 | ---
 446 | 
 447 | #### 4. **BulkUpdateStrategy** (Concrete Strategy)
 448 | ```typescript
 449 | /**
 450 |  * Handles bulk task updates (--from flag)
 451 |  * Uses generateObjectService for structured updates
 452 |  */
 453 | export class BulkUpdateStrategy extends BaseUpdateStrategy {
 454 |   getMode(): UpdateMode {
 455 |     return UpdateMode.BULK;
 456 |   }
 457 | 
 458 |   async validate(context: IUpdateContext): Promise<void> {
 459 |     if (!context.options.from) {
 460 |       throw new TaskMasterError('Bulk mode requires --from parameter');
 461 |     }
 462 |     // Additional validations...
 463 |   }
 464 | 
 465 |   async loadTasks(context: IUpdateContext): Promise<TaskLoadResult> {
 466 |     // Filter tasks where id >= fromId AND status !== 'done'
 467 |   }
 468 | 
 469 |   async callAIService(
 470 |     context: IUpdateContext,
 471 |     prompts: PromptResult
 472 |   ): Promise<AIServiceResult> {
 473 |     // Call generateObjectService with update-tasks schema
 474 |   }
 475 | 
 476 |   protected getPromptParams(
 477 |     context: IUpdateContext,
 478 |     tasks: TaskLoadResult
 479 |   ): PromptParams {
 480 |     return {
 481 |       tasks: tasks.tasks,
 482 |       updatePrompt: context.options.prompt,
 483 |       useResearch: context.options.useResearch,
 484 |       projectContext: tasks.gatheredContext,
 485 |       // ...
 486 |     };
 487 |   }
 488 | }
 489 | ```
 490 | 
 491 | ---
 492 | 
 493 | #### 5. **SubtaskUpdateStrategy** (Concrete Strategy)
 494 | ```typescript
 495 | /**
 496 |  * Handles single subtask updates (--id with dot notation)
 497 |  * Uses generateTextService for timestamped appends
 498 |  */
 499 | export class SubtaskUpdateStrategy extends BaseUpdateStrategy {
 500 |   getMode(): UpdateMode {
 501 |     return UpdateMode.SUBTASK;
 502 |   }
 503 | 
 504 |   async validate(context: IUpdateContext): Promise<void> {
 505 |     const parsed = TaskIdValidator.parseSubtaskId(context.options.id);
 506 |     if (!parsed) {
 507 |       throw new TaskMasterError('Invalid subtask ID format');
 508 |     }
 509 |   }
 510 | 
 511 |   async loadTasks(context: IUpdateContext): Promise<TaskLoadResult> {
 512 |     // Find parent task, locate specific subtask
 513 |     // Build context with prev/next subtask info
 514 |   }
 515 | 
 516 |   async callAIService(
 517 |     context: IUpdateContext,
 518 |     prompts: PromptResult
 519 |   ): Promise<AIServiceResult> {
 520 |     // Call generateTextService for freeform content
 521 |   }
 522 | 
 523 |   async mergeResults(
 524 |     context: IUpdateContext,
 525 |     aiResult: AIServiceResult,
 526 |     originalTasks: TaskLoadResult
 527 |   ): Promise<MergeResult> {
 528 |     // Append timestamped content to subtask.details
 529 |     const timestamp = new Date().toISOString();
 530 |     const formatted = `<info added on ${timestamp}>\n${aiResult.text}\n</info>`;
 531 |     // ...
 532 |   }
 533 | }
 534 | ```
 535 | 
 536 | ---
 537 | 
 538 | #### 6. **SingleTaskUpdateStrategy** (Concrete Strategy)
 539 | ```typescript
 540 | /**
 541 |  * Handles single task updates (--id without dot)
 542 |  * Uses generateObjectService for structured updates
 543 |  */
 544 | export class SingleTaskUpdateStrategy extends BaseUpdateStrategy {
 545 |   getMode(): UpdateMode {
 546 |     return UpdateMode.SINGLE;
 547 |   }
 548 | 
 549 |   async validate(context: IUpdateContext): Promise<void> {
 550 |     TaskIdValidator.validateTaskId(context.options.id);
 551 |   }
 552 | 
 553 |   async loadTasks(context: IUpdateContext): Promise<TaskLoadResult> {
 554 |     // Find single task by ID
 555 |   }
 556 | 
 557 |   // Similar to BulkUpdateStrategy but operates on single task
 558 | }
 559 | ```
 560 | 
 561 | ---
 562 | 
 563 | #### 7. **ContextBuilderService** (Helper Service)
 564 | ```typescript
 565 | /**
 566 |  * Builds context for AI prompts
 567 |  * Coordinates ContextGatherer and FuzzyTaskSearch
 568 |  */
 569 | export class ContextBuilderService {
 570 |   constructor(
 571 |     private readonly logger: Logger
 572 |   ) {}
 573 | 
 574 |   async buildContext(
 575 |     options: ContextBuildOptions
 576 |   ): Promise<BuiltContext> {
 577 |     try {
 578 |       const gatherer = new ContextGatherer(
 579 |         options.projectRoot,
 580 |         options.tag
 581 |       );
 582 | 
 583 |       const allTasksFlat = flattenTasksWithSubtasks(options.allTasks);
 584 |       const fuzzySearch = new FuzzyTaskSearch(
 585 |         allTasksFlat,
 586 |         options.searchMode // 'update' or 'update-subtask'
 587 |       );
 588 | 
 589 |       const searchResults = fuzzySearch.findRelevantTasks(
 590 |         options.searchQuery,
 591 |         { maxResults: 5, includeSelf: true }
 592 |       );
 593 | 
 594 |       const relevantTaskIds = fuzzySearch.getTaskIds(searchResults);
 595 |       const finalTaskIds = [
 596 |         ...new Set([...options.targetTaskIds, ...relevantTaskIds])
 597 |       ];
 598 | 
 599 |       const contextResult = await gatherer.gather({
 600 |         tasks: finalTaskIds,
 601 |         format: 'research'
 602 |       });
 603 | 
 604 |       return {
 605 |         context: contextResult.context || '',
 606 |         taskIds: finalTaskIds
 607 |       };
 608 |     } catch (error) {
 609 |       this.logger.warn(`Context gathering failed: ${error.message}`);
 610 |       return { context: '', taskIds: options.targetTaskIds };
 611 |     }
 612 |   }
 613 | }
 614 | ```
 615 | 
 616 | **Uses (existing):**
 617 | - `ContextGatherer`
 618 | - `FuzzyTaskSearch`
 619 | 
 620 | ---
 621 | 
 622 | #### 8. **PromptBuilderService** (Helper Service)
 623 | ```typescript
 624 | /**
 625 |  * Builds system and user prompts for AI services
 626 |  * Wraps PromptManager with strategy-specific logic
 627 |  */
 628 | export class PromptBuilderService {
 629 |   constructor(
 630 |     private readonly promptManager: PromptManager,
 631 |     private readonly logger: Logger
 632 |   ) {}
 633 | 
 634 |   async buildPrompt(
 635 |     templateName: string,
 636 |     params: PromptParams,
 637 |     variant?: string
 638 |   ): Promise<PromptResult> {
 639 |     const { systemPrompt, userPrompt } = await this.promptManager.loadPrompt(
 640 |       templateName,
 641 |       params,
 642 |       variant
 643 |     );
 644 | 
 645 |     return {
 646 |       systemPrompt,
 647 |       userPrompt,
 648 |       templateName,
 649 |       params
 650 |     };
 651 |   }
 652 | }
 653 | ```
 654 | 
 655 | **Uses (existing):**
 656 | - `PromptManager`
 657 | 
 658 | ---
 659 | 
 660 | #### 9. **DataMergerService** (Helper Service)
 661 | ```typescript
 662 | /**
 663 |  * Merges AI service results with existing task data
 664 |  * Handles different merge strategies for different modes
 665 |  */
 666 | export class DataMergerService {
 667 |   constructor(private readonly logger: Logger) {}
 668 | 
 669 |   /**
 670 |    * Merge for bulk/single task mode (structured updates)
 671 |    */
 672 |   mergeTasks(
 673 |     existingTasks: Task[],
 674 |     updatedTasks: Task[],
 675 |     options: MergeOptions
 676 |   ): MergeResult {
 677 |     const updatedTasksMap = new Map(
 678 |       updatedTasks.map(t => [t.id, t])
 679 |     );
 680 | 
 681 |     let updateCount = 0;
 682 |     const merged = existingTasks.map(task => {
 683 |       if (updatedTasksMap.has(task.id)) {
 684 |         const updated = updatedTasksMap.get(task.id)!;
 685 |         updateCount++;
 686 |         return {
 687 |           ...task,
 688 |           ...updated,
 689 |           // Preserve subtasks if not provided by AI
 690 |           subtasks: updated.subtasks !== undefined
 691 |             ? updated.subtasks
 692 |             : task.subtasks
 693 |         };
 694 |       }
 695 |       return task;
 696 |     });
 697 | 
 698 |     return {
 699 |       tasks: merged,
 700 |       updateCount,
 701 |       mode: 'structured'
 702 |     };
 703 |   }
 704 | 
 705 |   /**
 706 |    * Merge for subtask mode (timestamped append)
 707 |    */
 708 |   mergeSubtask(
 709 |     parentTask: Task,
 710 |     subtaskIndex: number,
 711 |     newContent: string,
 712 |     options: SubtaskMergeOptions
 713 |   ): SubtaskMergeResult {
 714 |     const subtask = parentTask.subtasks![subtaskIndex];
 715 |     const timestamp = new Date().toISOString();
 716 |     const formatted = `<info added on ${timestamp}>\n${newContent.trim()}\n</info added on ${timestamp}>`;
 717 | 
 718 |     subtask.details = (subtask.details ? subtask.details + '\n' : '') + formatted;
 719 | 
 720 |     // Short prompts get description timestamp
 721 |     if (options.prompt.length < 100 && subtask.description) {
 722 |       subtask.description += ` [Updated: ${new Date().toLocaleDateString()}]`;
 723 |     }
 724 | 
 725 |     return {
 726 |       updatedSubtask: subtask,
 727 |       newlyAddedSnippet: formatted,
 728 |       parentTask
 729 |     };
 730 |   }
 731 | }
 732 | ```
 733 | 
 734 | ---
 735 | 
 736 | #### 10. **IDisplayManager** (Display Interface)
 737 | ```typescript
 738 | /**
 739 |  * Contract for display managers
 740 |  * Allows different output formats (CLI, JSON, etc.)
 741 |  */
 742 | export interface IDisplayManager {
 743 |   /**
 744 |    * Show tasks before update
 745 |    */
 746 |   showPreUpdate(tasks: Task[], mode: UpdateMode): void;
 747 | 
 748 |   /**
 749 |    * Show loading indicator
 750 |    */
 751 |   startLoading(message: string): void;
 752 |   stopLoading(success?: boolean): void;
 753 | 
 754 |   /**
 755 |    * Show post-update results
 756 |    */
 757 |   showPostUpdate(result: UpdateStrategyResult, mode: UpdateMode): void;
 758 | 
 759 |   /**
 760 |    * Show telemetry/usage data
 761 |    */
 762 |   showTelemetry(telemetry: TelemetryData): void;
 763 | 
 764 |   /**
 765 |    * Show errors
 766 |    */
 767 |   showError(error: Error): void;
 768 | }
 769 | ```
 770 | 
 771 | ---
 772 | 
 773 | #### 11. **CLIDisplayManager** (Concrete Display)
 774 | ```typescript
 775 | /**
 776 |  * Formats output for CLI with colors, tables, and boxes
 777 |  */
 778 | export class CLIDisplayManager implements IDisplayManager {
 779 |   constructor(
 780 |     private readonly logger: Logger,
 781 |     private readonly isSilent: boolean
 782 |   ) {}
 783 | 
 784 |   showPreUpdate(tasks: Task[], mode: UpdateMode): void {
 785 |     // Create table with ID, Title, Status columns
 786 |     // Show boxed header
 787 |     // For bulk mode: show completed subtasks info box
 788 |   }
 789 | 
 790 |   startLoading(message: string): void {
 791 |     // startLoadingIndicator(message)
 792 |   }
 793 | 
 794 |   // ... implement other methods with chalk, boxen, cli-table3
 795 | }
 796 | ```
 797 | 
 798 | ---
 799 | 
 800 | #### 12. **UpdateStrategyFactory** (Factory)
 801 | ```typescript
 802 | /**
 803 |  * Creates the appropriate update strategy based on mode
 804 |  */
 805 | export class UpdateStrategyFactory {
 806 |   constructor(
 807 |     private readonly contextBuilder: ContextBuilderService,
 808 |     private readonly promptBuilder: PromptBuilderService,
 809 |     private readonly dataMerger: DataMergerService,
 810 |     private readonly aiService: AIService
 811 |   ) {}
 812 | 
 813 |   createStrategy(mode: UpdateMode): IUpdateStrategy {
 814 |     switch (mode) {
 815 |       case UpdateMode.BULK:
 816 |         return new BulkUpdateStrategy(
 817 |           this.contextBuilder,
 818 |           this.promptBuilder,
 819 |           this.dataMerger,
 820 |           this.aiService
 821 |         );
 822 |       case UpdateMode.SINGLE:
 823 |         return new SingleTaskUpdateStrategy(
 824 |           this.contextBuilder,
 825 |           this.promptBuilder,
 826 |           this.dataMerger,
 827 |           this.aiService
 828 |         );
 829 |       case UpdateMode.SUBTASK:
 830 |         return new SubtaskUpdateStrategy(
 831 |           this.contextBuilder,
 832 |           this.promptBuilder,
 833 |           this.dataMerger,
 834 |           this.aiService
 835 |         );
 836 |       default:
 837 |         throw new TaskMasterError(`Unknown update mode: ${mode}`);
 838 |     }
 839 |   }
 840 | 
 841 |   detectMode(options: UpdateTaskOptions): UpdateMode {
 842 |     if (options.from !== undefined) {
 843 |       return UpdateMode.BULK;
 844 |     }
 845 |     if (options.id && typeof options.id === 'string' && options.id.includes('.')) {
 846 |       return UpdateMode.SUBTASK;
 847 |     }
 848 |     if (options.id !== undefined) {
 849 |       return UpdateMode.SINGLE;
 850 |     }
 851 |     throw new TaskMasterError('Must provide either --id or --from parameter');
 852 |   }
 853 | }
 854 | ```
 855 | 
 856 | ---
 857 | 
 858 | #### 13. **Validators** (Utility Classes)
 859 | ```typescript
 860 | /**
 861 |  * Validates all update task inputs
 862 |  */
 863 | export class UpdateInputValidator {
 864 |   static validate(options: UpdateTaskOptions): void {
 865 |     // Validate tasksPath, prompt, etc.
 866 |   }
 867 | }
 868 | 
 869 | /**
 870 |  * Parses and validates task/subtask IDs
 871 |  */
 872 | export class TaskIdValidator {
 873 |   static validateTaskId(id: any): number {
 874 |     // Parse and validate task ID
 875 |   }
 876 | 
 877 |   static parseSubtaskId(id: string): SubtaskIdParts | null {
 878 |     // Parse "parentId.subtaskId" format
 879 |   }
 880 | }
 881 | ```
 882 | 
 883 | ---
 884 | 
 885 | ### Class Diagram (Relationships)
 886 | 
 887 | ```
 888 | ┌─────────────────────────┐
 889 | │  UpdateTaskService      │ ◄─── Main Orchestrator
 890 | │  (Coordinates)          │
 891 | └───────┬─────────────────┘
 892 |         │ uses
 893 |         ├──► UpdateStrategyFactory ──creates──► IUpdateStrategy
 894 |         │                                           │
 895 |         ├──► ContextBuilderService                 │ implements
 896 |         │                                           ▼
 897 |         ├──► IDisplayManager ◄──creates── UpdateDisplayFactory
 898 |         │         │
 899 |         │         ├── CLIDisplayManager
 900 |         │         └── JSONDisplayManager
 901 |         │
 902 |         └──► ConfigManager (existing)
 903 |              IStorage (existing)
 904 |              Logger (existing)
 905 | 
 906 | ┌────────────────────────────────────────────────────┐
 907 | │                 IUpdateStrategy                    │
 908 | └────────────────────────────────────────────────────┘
 909 |                         △
 910 |                         │ extends
 911 |             ┌───────────┴────────────┐
 912 |             │                        │
 913 | ┌───────────────────────┐    ┌──────────────────────┐
 914 | │  BaseUpdateStrategy   │    │  Abstract base with  │
 915 | │  (Template Method)    │    │  common workflow     │
 916 | └───────────┬───────────┘    └──────────────────────┘
 917 |             │ extends
 918 |     ┌───────┼──────────┬─────────────┐
 919 |     │       │          │             │
 920 | ┌───▼───┐ ┌─▼────┐  ┌─▼──────────┐  │
 921 | │ Bulk  │ │Single│  │  Subtask   │  │
 922 | │Update │ │Task  │  │  Update    │  │
 923 | │       │ │Update│  │            │  │
 924 | └───────┘ └──────┘  └────────────┘  │
 925 |                                      │
 926 |                                      ├──► ContextBuilderService
 927 |                                      │      ├─uses─► ContextGatherer (existing)
 928 |                                      │      └─uses─► FuzzyTaskSearch (existing)
 929 |                                      │
 930 |                                      ├──► PromptBuilderService
 931 |                                      │      └─uses─► PromptManager (existing)
 932 |                                      │
 933 |                                      └──► DataMergerService
 934 | ```
 935 | 
 936 | ---
 937 | 
 938 | ### Dependency Injection & Initialization
 939 | 
 940 | ```typescript
 941 | // In packages/tm-core/src/commands/update-task/index.ts
 942 | 
 943 | /**
 944 |  * Factory function to create a fully initialized UpdateTaskService
 945 |  */
 946 | export async function createUpdateTaskService(
 947 |   configManager: ConfigManager,
 948 |   storage: IStorage
 949 | ): Promise<UpdateTaskService> {
 950 |   const logger = getLogger('UpdateTaskService');
 951 | 
 952 |   // Create helper services
 953 |   const contextBuilder = new ContextBuilderService(logger);
 954 |   const promptManager = getPromptManager(); // existing
 955 |   const promptBuilder = new PromptBuilderService(promptManager, logger);
 956 |   const dataMerger = new DataMergerService(logger);
 957 |   const aiService = new AIService(); // wrapper around generateObjectService/generateTextService
 958 | 
 959 |   // Create factory
 960 |   const strategyFactory = new UpdateStrategyFactory(
 961 |     contextBuilder,
 962 |     promptBuilder,
 963 |     dataMerger,
 964 |     aiService
 965 |   );
 966 | 
 967 |   // Create display factory
 968 |   const displayFactory = new UpdateDisplayFactory();
 969 | 
 970 |   // Create service
 971 |   return new UpdateTaskService(
 972 |     configManager,
 973 |     storage,
 974 |     logger,
 975 |     strategyFactory,
 976 |     contextBuilder,
 977 |     displayFactory
 978 |   );
 979 | }
 980 | ```
 981 | 
 982 | ---
 983 | 
 984 | ### Types & Interfaces
 985 | 
 986 | ```typescript
 987 | // packages/tm-core/src/commands/update-task/types.ts
 988 | 
 989 | export enum UpdateMode {
 990 |   BULK = 'bulk',
 991 |   SINGLE = 'single',
 992 |   SUBTASK = 'subtask'
 993 | }
 994 | 
 995 | export interface UpdateTaskOptions {
 996 |   tasksPath: string;
 997 |   id?: number | string;
 998 |   from?: number;
 999 |   prompt: string;
1000 |   useResearch?: boolean;
1001 |   context?: UpdateContext;
1002 |   outputFormat?: 'text' | 'json';
1003 | }
1004 | 
1005 | export interface UpdateContext {
1006 |   session?: any;
1007 |   mcpLog?: any;
1008 |   projectRoot?: string;
1009 |   tag?: string;
1010 | }
1011 | 
1012 | export interface UpdateTaskResult {
1013 |   success: boolean;
1014 |   mode: UpdateMode;
1015 |   updatedTasks?: Task[];
1016 |   updatedSubtask?: Subtask;
1017 |   updateCount?: number;
1018 |   telemetryData?: TelemetryData;
1019 |   tagInfo?: TagInfo;
1020 | }
1021 | 
1022 | export interface IUpdateContext {
1023 |   options: UpdateTaskOptions;
1024 |   projectRoot: string;
1025 |   tag?: string;
1026 |   mode: UpdateMode;
1027 |   isMCP: boolean;
1028 |   logger: Logger;
1029 | }
1030 | 
1031 | export interface TaskLoadResult {
1032 |   tasks: Task[];
1033 |   gatheredContext: string;
1034 |   originalData: TasksData;
1035 | }
1036 | 
1037 | export interface PromptResult {
1038 |   systemPrompt: string;
1039 |   userPrompt: string;
1040 |   templateName: string;
1041 |   params: PromptParams;
1042 | }
1043 | 
1044 | export interface AIServiceResult {
1045 |   mainResult: any; // structured object or text string
1046 |   telemetryData?: TelemetryData;
1047 |   tagInfo?: TagInfo;
1048 | }
1049 | 
1050 | export interface MergeResult {
1051 |   tasks?: Task[];
1052 |   updatedSubtask?: Subtask;
1053 |   newlyAddedSnippet?: string;
1054 |   updateCount: number;
1055 |   mode: 'structured' | 'timestamped';
1056 | }
1057 | ```
1058 | 
1059 | ---
1060 | 
1061 | ## Implementation Phases
1062 | 
1063 | ### Phase 1: Foundation & Core Types
1064 | 
1065 | **Goal**: Establish the type system and interfaces
1066 | 
1067 | **New Files to Create**:
1068 | 1. `packages/tm-core/src/commands/update-task/types.ts`
1069 |    - Define `UpdateMode` enum
1070 |    - Define all shared interfaces (`UpdateTaskOptions`, `UpdateTaskResult`, etc.)
1071 | 2. `packages/tm-core/src/commands/update-task/interfaces/update-strategy.interface.ts`
1072 |    - Define `IUpdateStrategy` interface
1073 | 3. `packages/tm-core/src/commands/update-task/interfaces/update-context.interface.ts`
1074 |    - Define `IUpdateContext` interface
1075 | 4. `packages/tm-core/src/commands/update-task/interfaces/display.interface.ts`
1076 |    - Define `IDisplayManager` interface
1077 | 
1078 | **Existing Classes to Study**:
1079 | - `BaseExecutor` - For abstract class patterns
1080 | - `TaskService` - For service patterns
1081 | - `IStorage` - For interface patterns
1082 | 
1083 | ---
1084 | 
1085 | ### Phase 2: Validator & Helper Utilities
1086 | 
1087 | **Goal**: Build validation and utility classes
1088 | 
1089 | **New Files to Create**:
1090 | 1. `packages/tm-core/src/commands/update-task/validators/update-input.validator.ts`
1091 |    - Create `UpdateInputValidator` class
1092 |    - Port validation logic from both old files
1093 | 2. `packages/tm-core/src/commands/update-task/validators/task-id.validator.ts`
1094 |    - Create `TaskIdValidator` class
1095 |    - Implement `validateTaskId()` and `parseSubtaskId()` methods
1096 | 
1097 | **Tests to Create**:
1098 | - `update-input.validator.spec.ts`
1099 | - `task-id.validator.spec.ts`
1100 | 
1101 | ---
1102 | 
1103 | ### Phase 3: Service Layer
1104 | 
1105 | **Goal**: Build the helper services that strategies will use
1106 | 
1107 | **New Files to Create**:
1108 | 1. `packages/tm-core/src/commands/update-task/context-builder.service.ts`
1109 |    - Create `ContextBuilderService` class
1110 |    - **Uses existing**: `ContextGatherer`, `FuzzyTaskSearch`
1111 |    - Port context gathering logic from both old files
1112 | 
1113 | 2. `packages/tm-core/src/commands/update-task/prompt-builder.service.ts`
1114 |    - Create `PromptBuilderService` class
1115 |    - **Uses existing**: `PromptManager` (via `getPromptManager()`)
1116 |    - Port prompt building logic
1117 | 
1118 | 3. `packages/tm-core/src/commands/update-task/data-merger.service.ts`
1119 |    - Create `DataMergerService` class
1120 |    - Implement `mergeTasks()` method (from `update-tasks.js` lines 250-273)
1121 |    - Implement `mergeSubtask()` method (from `update-subtask-by-id.js` lines 291-332)
1122 | 
1123 | **Tests to Create**:
1124 | - `context-builder.service.spec.ts`
1125 | - `prompt-builder.service.spec.ts`
1126 | - `data-merger.service.spec.ts`
1127 | 
1128 | **Existing Classes Used**:
1129 | - `ContextGatherer` (from `scripts/modules/utils/contextGatherer.js`)
1130 | - `FuzzyTaskSearch` (from `scripts/modules/utils/fuzzyTaskSearch.js`)
1131 | - `PromptManager` (from `scripts/modules/prompt-manager.js`)
1132 | 
1133 | ---
1134 | 
1135 | ### Phase 4: Strategy Pattern Implementation
1136 | 
1137 | **Goal**: Implement the update strategies
1138 | 
1139 | **New Files to Create**:
1140 | 1. `packages/tm-core/src/commands/update-task/strategies/base-update.strategy.ts`
1141 |    - Create `BaseUpdateStrategy` abstract class implementing `IUpdateStrategy`
1142 |    - Implement template method pattern
1143 |    - Define abstract methods for subclasses
1144 | 
1145 | 2. `packages/tm-core/src/commands/update-task/strategies/bulk-update.strategy.ts`
1146 |    - Create `BulkUpdateStrategy` class extending `BaseUpdateStrategy`
1147 |    - Port logic from `update-tasks.js` lines 79-293
1148 |    - **Uses**: `generateObjectService` with `COMMAND_SCHEMAS['update-tasks']`
1149 | 
1150 | 3. `packages/tm-core/src/commands/update-task/strategies/single-task-update.strategy.ts`
1151 |    - Create `SingleTaskUpdateStrategy` class extending `BaseUpdateStrategy`
1152 |    - Similar to bulk but for single task
1153 |    - **Uses**: `generateObjectService` with `COMMAND_SCHEMAS['update-tasks']`
1154 | 
1155 | 4. `packages/tm-core/src/commands/update-task/strategies/subtask-update.strategy.ts`
1156 |    - Create `SubtaskUpdateStrategy` class extending `BaseUpdateStrategy`
1157 |    - Port logic from `update-subtask-by-id.js` lines 67-378
1158 |    - **Uses**: `generateTextService` for freeform content
1159 | 
1160 | **Tests to Create**:
1161 | - `bulk-update.strategy.spec.ts`
1162 | - `single-task-update.strategy.spec.ts`
1163 | - `subtask-update.strategy.spec.ts`
1164 | 
1165 | **Existing Classes/Functions Used**:
1166 | - `generateObjectService` (from `scripts/modules/ai-services-unified.js`)
1167 | - `generateTextService` (from `scripts/modules/ai-services-unified.js`)
1168 | - `COMMAND_SCHEMAS` (from `src/schemas/registry.js`)
1169 | - `readJSON`, `writeJSON`, `flattenTasksWithSubtasks` (from `scripts/modules/utils.js`)
1170 | 
1171 | ---
1172 | 
1173 | ### Phase 5: Display Layer
1174 | 
1175 | **Goal**: Implement display managers for different output formats
1176 | 
1177 | **New Files to Create**:
1178 | 1. `packages/tm-core/src/commands/update-task/display/cli-display.manager.ts`
1179 |    - Create `CLIDisplayManager` class implementing `IDisplayManager`
1180 |    - Port CLI display logic from both old files
1181 |    - **Uses existing**: `chalk`, `boxen`, `cli-table3`, `getStatusWithColor`, `truncate`
1182 | 
1183 | 2. `packages/tm-core/src/commands/update-task/display/json-display.manager.ts`
1184 |    - Create `JSONDisplayManager` class implementing `IDisplayManager`
1185 |    - Implement JSON output format (for MCP)
1186 | 
1187 | 3. `packages/tm-core/src/commands/update-task/display/update-display.factory.ts`
1188 |    - Create `UpdateDisplayFactory` class
1189 |    - Factory method to create appropriate display manager
1190 | 
1191 | **Tests to Create**:
1192 | - `cli-display.manager.spec.ts`
1193 | - `json-display.manager.spec.ts`
1194 | 
1195 | **Existing Functions Used**:
1196 | - `getStatusWithColor`, `startLoadingIndicator`, `stopLoadingIndicator`, `displayAiUsageSummary` (from `scripts/modules/ui.js`)
1197 | - `truncate`, `isSilentMode` (from `scripts/modules/utils.js`)
1198 | 
1199 | ---
1200 | 
1201 | ### Phase 6: Factory Pattern
1202 | 
1203 | **Goal**: Implement factory for creating strategies
1204 | 
1205 | **New Files to Create**:
1206 | 1. `packages/tm-core/src/commands/update-task/factories/update-strategy.factory.ts`
1207 |    - Create `UpdateStrategyFactory` class
1208 |    - Implement `createStrategy(mode)` method
1209 |    - Implement `detectMode(options)` method
1210 |    - Handles dependency injection for all strategies
1211 | 
1212 | **Tests to Create**:
1213 | - `update-strategy.factory.spec.ts` (test mode detection and strategy creation)
1214 | 
1215 | ---
1216 | 
1217 | ### Phase 7: Main Service Orchestrator
1218 | 
1219 | **Goal**: Create the main service that ties everything together
1220 | 
1221 | **New Files to Create**:
1222 | 1. `packages/tm-core/src/commands/update-task/update-task.service.ts`
1223 |    - Create `UpdateTaskService` class
1224 |    - Main orchestrator that coordinates all components
1225 |    - Implements high-level workflow
1226 | 
1227 | 2. `packages/tm-core/src/commands/update-task/index.ts`
1228 |    - Export all public types and interfaces
1229 |    - Export `createUpdateTaskService()` factory function
1230 |    - Export `UpdateTaskService` class
1231 | 
1232 | **Tests to Create**:
1233 | - `update-task.service.spec.ts` (integration tests)
1234 | 
1235 | **Existing Classes Used**:
1236 | - `ConfigManager` (from `packages/tm-core/src/config/config-manager.ts`)
1237 | - `IStorage` (from `packages/tm-core/src/interfaces/storage.interface.ts`)
1238 | - `Logger`, `getLogger` (from `packages/tm-core/src/logger/`)
1239 | 
1240 | ---
1241 | 
1242 | ### Phase 8: CLI Integration
1243 | 
1244 | **Goal**: Wire up the new service to the CLI
1245 | 
1246 | **New Files to Create**:
1247 | 1. `apps/cli/src/commands/update-task.command.ts`
1248 |    - CLI command definition using `commander`
1249 |    - Calls `createUpdateTaskService()` and executes
1250 |    - Handles CLI-specific argument parsing
1251 | 
1252 | **Files to Modify**:
1253 | 1. `apps/cli/src/index.ts` (or main CLI entry point)
1254 |    - Register new `update-task` command
1255 |    - Optionally add aliases for backward compatibility
1256 | 
1257 | **Existing Patterns to Follow**:
1258 | - Study existing CLI commands in `apps/cli/src/commands/`
1259 | - Follow same pattern for option parsing and service invocation
1260 | 
1261 | ---
1262 | 
1263 | ### Phase 9: Integration & Testing
1264 | 
1265 | **Goal**: Ensure everything works together
1266 | 
1267 | **Tasks**:
1268 | 1. Run full integration tests
1269 |    - Test bulk update workflow end-to-end
1270 |    - Test single task update workflow
1271 |    - Test subtask update workflow
1272 |    - Test MCP mode vs CLI mode
1273 |    - Test all edge cases from checklist
1274 | 
1275 | 2. Verify against original functionality
1276 |    - Use the functionality checklist
1277 |    - Ensure no regressions
1278 |    - Test with real task data
1279 | 
1280 | 3. Performance testing
1281 |    - Compare execution time with old implementation
1282 |    - Ensure context gathering performs well
1283 | 
1284 | **Tests to Create**:
1285 | - `update-task.integration.spec.ts` - Full workflow tests
1286 | - End-to-end tests with real task files
1287 | 
1288 | ---
1289 | 
1290 | ### Phase 10: Documentation & Migration
1291 | 
1292 | **Goal**: Document the new system and deprecate old code
1293 | 
1294 | **Tasks**:
1295 | 1. Update documentation
1296 |    - Update `apps/docs/command-reference.mdx`
1297 |    - Add JSDoc comments to all public APIs
1298 |    - Create migration guide for users
1299 | 
1300 | 2. Add deprecation warnings
1301 |    - Mark old `update` and `update-subtask` commands as deprecated
1302 |    - Add console warnings directing users to new command
1303 | 
1304 | 3. Create changeset
1305 |    - Document breaking changes (if any)
1306 |    - Document new features (unified command)
1307 |    - Note backward compatibility
1308 | 
1309 | **Files to Modify**:
1310 | 1. `apps/docs/command-reference.mdx` - Update command documentation
1311 | 2. Legacy files (add deprecation warnings):
1312 |    - `scripts/modules/task-manager/update-tasks.js`
1313 |    - `scripts/modules/task-manager/update-subtask-by-id.js`
1314 | 
1315 | ---
1316 | 
1317 | ### Phase 11: Cleanup
1318 | 
1319 | **Goal**: Remove deprecated code (future version)
1320 | 
1321 | **Tasks**:
1322 | 1. Remove old files:
1323 |    - `scripts/modules/task-manager/update-tasks.js`
1324 |    - `scripts/modules/task-manager/update-subtask-by-id.js`
1325 |    - Any related old command handlers
1326 | 
1327 | 2. Clean up any temporary compatibility shims
1328 | 
1329 | 3. Update all references in codebase to use new command
1330 | 
1331 | ---
1332 | 
1333 | ## Testing Strategy
1334 | 
1335 | ### Unit Tests
1336 | 
1337 | - [ ] Mode detection logic
1338 | - [ ] ID parsing and validation
1339 | - [ ] Context gathering integration
1340 | - [ ] Prompt building for each mode
1341 | - [ ] Data merging logic
1342 | 
1343 | ### Integration Tests
1344 | 
1345 | - [ ] Bulk update workflow
1346 | - [ ] Single task update workflow
1347 | - [ ] Single subtask update workflow
1348 | - [ ] MCP mode operation
1349 | - [ ] CLI mode operation
1350 | 
1351 | ### Edge Cases
1352 | 
1353 | - [ ] Empty tasks.json
1354 | - [ ] Invalid ID formats
1355 | - [ ] Non-existent IDs
1356 | - [ ] Tasks with no subtasks
1357 | - [ ] Empty AI responses
1358 | - [ ] Context gathering failures
1359 | 
1360 | ---
1361 | 
1362 | ## Backward Compatibility
1363 | 
1364 | ### Deprecation Strategy
1365 | 
1366 | 1. Keep old commands working initially
1367 | 2. Add deprecation warnings
1368 | 3. Update all documentation
1369 | 4. Remove old commands in next major version
1370 | 
1371 | ### Alias Support (Optional)
1372 | 
1373 | ```bash
1374 | # Could maintain old command names as aliases
1375 | task-master update --from=3 --prompt="..."    # Still works, calls update-task
1376 | task-master update-subtask --id=3.2 --prompt="..."  # Still works, calls update-task
1377 | ```
1378 | 
1379 | ---
1380 | 
1381 | ## Risk Mitigation
1382 | 
1383 | ### High-Risk Areas
1384 | 
1385 | 1. **Data integrity**: Ensure writeJSON doesn't corrupt existing data
1386 | 2. **AI service compatibility**: Both generateObjectService and generateTextService must work
1387 | 3. **Subtask detail format**: Maintain timestamp format consistency
1388 | 4. **Context gathering**: Same behavior across all modes
1389 | 
1390 | ### Rollback Plan
1391 | 
1392 | - Keep old files until new version is fully tested
1393 | - Version bump allows reverting if issues found
1394 | - Comprehensive test coverage before release
1395 | 
1396 | ---
1397 | 
1398 | ## Success Criteria
1399 | 
1400 | - [ ] All checklist items verified working
1401 | - [ ] Tests passing for all modes
1402 | - [ ] MCP integration functional
1403 | - [ ] CLI display matches existing behavior
1404 | - [ ] Documentation updated
1405 | - [ ] No regression in existing functionality
1406 | - [ ] Performance comparable or better than current implementation
1407 | 
```

--------------------------------------------------------------------------------
/.kiro/steering/taskmaster.md:
--------------------------------------------------------------------------------

```markdown
  1 | ---
  2 | inclusion: always
  3 | ---
  4 | 
  5 | # Taskmaster Tool & Command Reference
  6 | 
  7 | 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.
  8 | 
  9 | **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. 
 10 | 
 11 | **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`.
 12 | 
 13 | **🏷️ Tagged Task Lists System:** Task Master now supports **tagged task lists** for multi-context task management. This allows you to maintain separate, isolated lists of tasks for different features, branches, or experiments. Existing projects are seamlessly migrated to use a default "master" tag. Most commands now support a `--tag <name>` flag to specify which context to operate on. If omitted, commands use the currently active tag.
 14 | 
 15 | ---
 16 | 
 17 | ## Initialization & Setup
 18 | 
 19 | ### 1. Initialize Project (`init`)
 20 | 
 21 | *   **MCP Tool:** `initialize_project`
 22 | *   **CLI Command:** `task-master init [options]`
 23 | *   **Description:** `Set up the basic Taskmaster file structure and configuration in the current directory for a new project.`
 24 | *   **Key CLI Options:**
 25 |     *   `--name <name>`: `Set the name for your project in Taskmaster's configuration.`
 26 |     *   `--description <text>`: `Provide a brief description for your project.`
 27 |     *   `--version <version>`: `Set the initial version for your project, e.g., '0.1.0'.`
 28 |     *   `-y, --yes`: `Initialize Taskmaster quickly using default settings without interactive prompts.`
 29 | *   **Usage:** Run this once at the beginning of a new project.
 30 | *   **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.`
 31 | *   **Key MCP Parameters/Options:**
 32 |     *   `projectName`: `Set the name for your project.` (CLI: `--name <name>`)
 33 |     *   `projectDescription`: `Provide a brief description for your project.` (CLI: `--description <text>`)
 34 |     *   `projectVersion`: `Set the initial version for your project, e.g., '0.1.0'.` (CLI: `--version <version>`)
 35 |     *   `authorName`: `Author name.` (CLI: `--author <author>`)
 36 |     *   `skipInstall`: `Skip installing dependencies. Default is false.` (CLI: `--skip-install`)
 37 |     *   `addAliases`: `Add shell aliases tm and taskmaster. Default is false.` (CLI: `--aliases`)
 38 |     *   `yes`: `Skip prompts and use defaults/provided arguments. Default is false.` (CLI: `-y, --yes`)
 39 | *   **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. 
 40 | *   **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. 
 41 | *   **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`.
 42 | 
 43 | ### 2. Parse PRD (`parse_prd`)
 44 | 
 45 | *   **MCP Tool:** `parse_prd`
 46 | *   **CLI Command:** `task-master parse-prd [file] [options]`
 47 | *   **Description:** `Parse a Product Requirements Document, PRD, or text file with Taskmaster to automatically generate an initial set of tasks in tasks.json.`
 48 | *   **Key Parameters/Options:**
 49 |     *   `input`: `Path to your PRD or requirements text file that Taskmaster should parse for tasks.` (CLI: `[file]` positional or `-i, --input <file>`)
 50 |     *   `output`: `Specify where Taskmaster should save the generated 'tasks.json' file. Defaults to '.taskmaster/tasks/tasks.json'.` (CLI: `-o, --output <file>`)
 51 |     *   `numTasks`: `Approximate number of top-level tasks Taskmaster should aim to generate from the document.` (CLI: `-n, --num-tasks <number>`)
 52 |     *   `force`: `Use this to allow Taskmaster to overwrite an existing 'tasks.json' without asking for confirmation.` (CLI: `-f, --force`)
 53 | *   **Usage:** Useful for bootstrapping a project from an existing requirements document.
 54 | *   **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.
 55 | *   **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`.
 56 | 
 57 | ---
 58 | 
 59 | ## AI Model Configuration
 60 | 
 61 | ### 2. Manage Models (`models`)
 62 | *   **MCP Tool:** `models`
 63 | *   **CLI Command:** `task-master models [options]`
 64 | *   **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.`
 65 | *   **Key MCP Parameters/Options:**
 66 |     *   `setMain <model_id>`: `Set the primary model ID for task generation/updates.` (CLI: `--set-main <model_id>`)
 67 |     *   `setResearch <model_id>`: `Set the model ID for research-backed operations.` (CLI: `--set-research <model_id>`)
 68 |     *   `setFallback <model_id>`: `Set the model ID to use if the primary fails.` (CLI: `--set-fallback <model_id>`)
 69 |     *   `ollama <boolean>`: `Indicates the set model ID is a custom Ollama model.` (CLI: `--ollama`)
 70 |     *   `openrouter <boolean>`: `Indicates the set model ID is a custom OpenRouter model.` (CLI: `--openrouter`)
 71 |     *   `listAvailableModels <boolean>`: `If true, lists available models not currently assigned to a role.` (CLI: No direct equivalent; CLI lists available automatically)
 72 |     *   `projectRoot <string>`: `Optional. Absolute path to the project root directory.` (CLI: Determined automatically)
 73 | *   **Key CLI Options:**
 74 |     *   `--set-main <model_id>`: `Set the primary model.`
 75 |     *   `--set-research <model_id>`: `Set the research model.`
 76 |     *   `--set-fallback <model_id>`: `Set the fallback model.`
 77 |     *   `--ollama`: `Specify that the provided model ID is for Ollama (use with --set-*).`
 78 |     *   `--openrouter`: `Specify that the provided model ID is for OpenRouter (use with --set-*). Validates against OpenRouter API.`
 79 |     *   `--bedrock`: `Specify that the provided model ID is for AWS Bedrock (use with --set-*).`
 80 |     *   `--setup`: `Run interactive setup to configure models, including custom Ollama/OpenRouter IDs.`
 81 | *   **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`.
 82 | *   **Usage (CLI):** Run without flags to view current configuration and available models. Use set flags to update specific roles. Use `--setup` for guided configuration, including custom models. To set a custom model via flags, use `--set-<role>=<model_id>` along with either `--ollama` or `--openrouter`.
 83 | *   **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.
 84 | *   **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.
 85 | *   **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. 
 86 | *   **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.
 87 | 
 88 | ---
 89 | 
 90 | ## Task Listing & Viewing
 91 | 
 92 | ### 3. Get Tasks (`get_tasks`)
 93 | 
 94 | *   **MCP Tool:** `get_tasks`
 95 | *   **CLI Command:** `task-master list [options]`
 96 | *   **Description:** `List your Taskmaster tasks, optionally filtering by status and showing subtasks.`
 97 | *   **Key Parameters/Options:**
 98 |     *   `status`: `Show only Taskmaster tasks matching this status (or multiple statuses, comma-separated), e.g., 'pending' or 'done,in-progress'.` (CLI: `-s, --status <status>`)
 99 |     *   `withSubtasks`: `Include subtasks indented under their parent tasks in the list.` (CLI: `--with-subtasks`)
100 |     *   `tag`: `Specify which tag context to list tasks from. Defaults to the current active tag.` (CLI: `--tag <name>`)
101 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
102 | *   **Usage:** Get an overview of the project status, often used at the start of a work session.
103 | 
104 | ### 4. Get Next Task (`next_task`)
105 | 
106 | *   **MCP Tool:** `next_task`
107 | *   **CLI Command:** `task-master next [options]`
108 | *   **Description:** `Ask Taskmaster to show the next available task you can work on, based on status and completed dependencies.`
109 | *   **Key Parameters/Options:**
110 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
111 |     *   `tag`: `Specify which tag context to use. Defaults to the current active tag.` (CLI: `--tag <name>`)
112 | *   **Usage:** Identify what to work on next according to the plan.
113 | 
114 | ### 5. Get Task Details (`get_task`)
115 | 
116 | *   **MCP Tool:** `get_task`
117 | *   **CLI Command:** `task-master show [id] [options]`
118 | *   **Description:** `Display detailed information for one or more specific Taskmaster tasks or subtasks by ID.`
119 | *   **Key Parameters/Options:**
120 |     *   `id`: `Required. The ID of the Taskmaster task (e.g., '15'), subtask (e.g., '15.2'), or a comma-separated list of IDs ('1,5,10.2') you want to view.` (CLI: `[id]` positional or `-i, --id <id>`)
121 |     *   `tag`: `Specify which tag context to get the task(s) from. Defaults to the current active tag.` (CLI: `--tag <name>`)
122 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
123 | *   **Usage:** Understand the full details for a specific task. When multiple IDs are provided, a summary table is shown.
124 | *   **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.
125 | 
126 | ---
127 | 
128 | ## Task Creation & Modification
129 | 
130 | ### 6. Add Task (`add_task`)
131 | 
132 | *   **MCP Tool:** `add_task`
133 | *   **CLI Command:** `task-master add-task [options]`
134 | *   **Description:** `Add a new task to Taskmaster by describing it; AI will structure it.`
135 | *   **Key Parameters/Options:**
136 |     *   `prompt`: `Required. Describe the new task you want Taskmaster to create, e.g., "Implement user authentication using JWT".` (CLI: `-p, --prompt <text>`)
137 |     *   `dependencies`: `Specify the IDs of any Taskmaster tasks that must be completed before this new one can start, e.g., '12,14'.` (CLI: `-d, --dependencies <ids>`)
138 |     *   `priority`: `Set the priority for the new task: 'high', 'medium', or 'low'. Default is 'medium'.` (CLI: `--priority <priority>`)
139 |     *   `research`: `Enable Taskmaster to use the research role for potentially more informed task creation.` (CLI: `-r, --research`)
140 |     *   `tag`: `Specify which tag context to add the task to. Defaults to the current active tag.` (CLI: `--tag <name>`)
141 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
142 | *   **Usage:** Quickly add newly identified tasks during development.
143 | *   **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.
144 | 
145 | ### 7. Add Subtask (`add_subtask`)
146 | 
147 | *   **MCP Tool:** `add_subtask`
148 | *   **CLI Command:** `task-master add-subtask [options]`
149 | *   **Description:** `Add a new subtask to a Taskmaster parent task, or convert an existing task into a subtask.`
150 | *   **Key Parameters/Options:**
151 |     *   `id` / `parent`: `Required. The ID of the Taskmaster task that will be the parent.` (MCP: `id`, CLI: `-p, --parent <id>`)
152 |     *   `taskId`: `Use this if you want to convert an existing top-level Taskmaster task into a subtask of the specified parent.` (CLI: `-i, --task-id <id>`)
153 |     *   `title`: `Required if not using taskId. The title for the new subtask Taskmaster should create.` (CLI: `-t, --title <title>`)
154 |     *   `description`: `A brief description for the new subtask.` (CLI: `-d, --description <text>`)
155 |     *   `details`: `Provide implementation notes or details for the new subtask.` (CLI: `--details <text>`)
156 |     *   `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>`)
157 |     *   `status`: `Set the initial status for the new subtask. Default is 'pending'.` (CLI: `-s, --status <status>`)
158 |     *   `generate`: `Enable Taskmaster to regenerate markdown task files after adding the subtask.` (CLI: `--generate`)
159 |     *   `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
160 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
161 | *   **Usage:** Break down tasks manually or reorganize existing tasks.
162 | 
163 | ### 8. Update Tasks (`update`)
164 | 
165 | *   **MCP Tool:** `update`
166 | *   **CLI Command:** `task-master update [options]`
167 | *   **Description:** `Update multiple upcoming tasks in Taskmaster based on new context or changes, starting from a specific task ID.`
168 | *   **Key Parameters/Options:**
169 |     *   `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>`)
170 |     *   `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>`)
171 |     *   `research`: `Enable Taskmaster to use the research role for more informed updates. Requires appropriate API key.` (CLI: `-r, --research`)
172 |     *   `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
173 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
174 | *   **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...'`
175 | *   **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.
176 | 
177 | ### 9. Update Task (`update_task`)
178 | 
179 | *   **MCP Tool:** `update_task`
180 | *   **CLI Command:** `task-master update-task [options]`
181 | *   **Description:** `Modify a specific Taskmaster task by ID, incorporating new information or changes. By default, this replaces the existing task details.`
182 | *   **Key Parameters/Options:**
183 |     *   `id`: `Required. The specific ID of the Taskmaster task, e.g., '15', you want to update.` (CLI: `-i, --id <id>`)
184 |     *   `prompt`: `Required. Explain the specific changes or provide the new information Taskmaster should incorporate into this task.` (CLI: `-p, --prompt <text>`)
185 |     *   `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`)
186 |     *   `research`: `Enable Taskmaster to use the research role for more informed updates. Requires appropriate API key.` (CLI: `-r, --research`)
187 |     *   `tag`: `Specify which tag context the task belongs to. Defaults to the current active tag.` (CLI: `--tag <name>`)
188 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
189 | *   **Usage:** Refine a specific task based on new understanding. Use `--append` to log progress without creating subtasks.
190 | *   **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.
191 | 
192 | ### 10. Update Subtask (`update_subtask`)
193 | 
194 | *   **MCP Tool:** `update_subtask`
195 | *   **CLI Command:** `task-master update-subtask [options]`
196 | *   **Description:** `Append timestamped notes or details to a specific Taskmaster subtask without overwriting existing content. Intended for iterative implementation logging.`
197 | *   **Key Parameters/Options:**
198 |     *   `id`: `Required. The ID of the Taskmaster subtask, e.g., '5.2', to update with new information.` (CLI: `-i, --id <id>`)
199 |     *   `prompt`: `Required. The information, findings, or progress notes to append to the subtask's details with a timestamp.` (CLI: `-p, --prompt <text>`)
200 |     *   `research`: `Enable Taskmaster to use the research role for more informed updates. Requires appropriate API key.` (CLI: `-r, --research`)
201 |     *   `tag`: `Specify which tag context the subtask belongs to. Defaults to the current active tag.` (CLI: `--tag <name>`)
202 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
203 | *   **Usage:** Log implementation progress, findings, and discoveries during subtask development. Each update is timestamped and appended to preserve the implementation journey.
204 | *   **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.
205 | 
206 | ### 11. Set Task Status (`set_task_status`)
207 | 
208 | *   **MCP Tool:** `set_task_status`
209 | *   **CLI Command:** `task-master set-status [options]`
210 | *   **Description:** `Update the status of one or more Taskmaster tasks or subtasks, e.g., 'pending', 'in-progress', 'done'.`
211 | *   **Key Parameters/Options:**
212 |     *   `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>`)
213 |     *   `status`: `Required. The new status to set, e.g., 'done', 'pending', 'in-progress', 'review', 'cancelled'.` (CLI: `-s, --status <status>`)
214 |     *   `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
215 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
216 | *   **Usage:** Mark progress as tasks move through the development cycle.
217 | 
218 | ### 12. Remove Task (`remove_task`)
219 | 
220 | *   **MCP Tool:** `remove_task`
221 | *   **CLI Command:** `task-master remove-task [options]`
222 | *   **Description:** `Permanently remove a task or subtask from the Taskmaster tasks list.`
223 | *   **Key Parameters/Options:**
224 |     *   `id`: `Required. The ID of the Taskmaster task, e.g., '5', or subtask, e.g., '5.2', to permanently remove.` (CLI: `-i, --id <id>`)
225 |     *   `yes`: `Skip the confirmation prompt and immediately delete the task.` (CLI: `-y, --yes`)
226 |     *   `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
227 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
228 | *   **Usage:** Permanently delete tasks or subtasks that are no longer needed in the project.
229 | *   **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.
230 | 
231 | ---
232 | 
233 | ## Task Structure & Breakdown
234 | 
235 | ### 13. Expand Task (`expand_task`)
236 | 
237 | *   **MCP Tool:** `expand_task`
238 | *   **CLI Command:** `task-master expand [options]`
239 | *   **Description:** `Use Taskmaster's AI to break down a complex task into smaller, manageable subtasks. Appends subtasks by default.`
240 | *   **Key Parameters/Options:**
241 |     *   `id`: `The ID of the specific Taskmaster task you want to break down into subtasks.` (CLI: `-i, --id <id>`)
242 |     *   `num`: `Optional: Suggests how many subtasks Taskmaster should aim to create. Uses complexity analysis/defaults otherwise.` (CLI: `-n, --num <number>`)
243 |     *   `research`: `Enable Taskmaster to use the research role for more informed subtask generation. Requires appropriate API key.` (CLI: `-r, --research`)
244 |     *   `prompt`: `Optional: Provide extra context or specific instructions to Taskmaster for generating the subtasks.` (CLI: `-p, --prompt <text>`)
245 |     *   `force`: `Optional: If true, clear existing subtasks before generating new ones. Default is false (append).` (CLI: `--force`)
246 |     *   `tag`: `Specify which tag context the task belongs to. Defaults to the current active tag.` (CLI: `--tag <name>`)
247 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
248 | *   **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.
249 | *   **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.
250 | 
251 | ### 14. Expand All Tasks (`expand_all`)
252 | 
253 | *   **MCP Tool:** `expand_all`
254 | *   **CLI Command:** `task-master expand --all [options]` (Note: CLI uses the `expand` command with the `--all` flag)
255 | *   **Description:** `Tell Taskmaster to automatically expand all eligible pending/in-progress tasks based on complexity analysis or defaults. Appends subtasks by default.`
256 | *   **Key Parameters/Options:**
257 |     *   `num`: `Optional: Suggests how many subtasks Taskmaster should aim to create per task.` (CLI: `-n, --num <number>`)
258 |     *   `research`: `Enable research role for more informed subtask generation. Requires appropriate API key.` (CLI: `-r, --research`)
259 |     *   `prompt`: `Optional: Provide extra context for Taskmaster to apply generally during expansion.` (CLI: `-p, --prompt <text>`)
260 |     *   `force`: `Optional: If true, clear existing subtasks before generating new ones for each eligible task. Default is false (append).` (CLI: `--force`)
261 |     *   `tag`: `Specify which tag context to expand. Defaults to the current active tag.` (CLI: `--tag <name>`)
262 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
263 | *   **Usage:** Useful after initial task generation or complexity analysis to break down multiple tasks at once.
264 | *   **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.
265 | 
266 | ### 15. Clear Subtasks (`clear_subtasks`)
267 | 
268 | *   **MCP Tool:** `clear_subtasks`
269 | *   **CLI Command:** `task-master clear-subtasks [options]`
270 | *   **Description:** `Remove all subtasks from one or more specified Taskmaster parent tasks.`
271 | *   **Key Parameters/Options:**
272 |     *   `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>`)
273 |     *   `all`: `Tell Taskmaster to remove subtasks from all parent tasks.` (CLI: `--all`)
274 |     *   `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
275 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
276 | *   **Usage:** Used before regenerating subtasks with `expand_task` if the previous breakdown needs replacement.
277 | 
278 | ### 16. Remove Subtask (`remove_subtask`)
279 | 
280 | *   **MCP Tool:** `remove_subtask`
281 | *   **CLI Command:** `task-master remove-subtask [options]`
282 | *   **Description:** `Remove a subtask from its Taskmaster parent, optionally converting it into a standalone task.`
283 | *   **Key Parameters/Options:**
284 |     *   `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>`)
285 |     *   `convert`: `If used, Taskmaster will turn the subtask into a regular top-level task instead of deleting it.` (CLI: `-c, --convert`)
286 |     *   `generate`: `Enable Taskmaster to regenerate markdown task files after removing the subtask.` (CLI: `--generate`)
287 |     *   `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
288 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
289 | *   **Usage:** Delete unnecessary subtasks or promote a subtask to a top-level task.
290 | 
291 | ### 17. Move Task (`move_task`)
292 | 
293 | *   **MCP Tool:** `move_task`
294 | *   **CLI Command:** `task-master move [options]`
295 | *   **Description:** `Move a task or subtask to a new position within the task hierarchy.`
296 | *   **Key Parameters/Options:**
297 |     *   `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>`)
298 |     *   `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>`)
299 |     *   `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
300 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
301 | *   **Usage:** Reorganize tasks by moving them within the hierarchy. Supports various scenarios like:
302 |     *   Moving a task to become a subtask
303 |     *   Moving a subtask to become a standalone task
304 |     *   Moving a subtask to a different parent
305 |     *   Reordering subtasks within the same parent
306 |     *   Moving a task to a new, non-existent ID (automatically creates placeholders)
307 |     *   Moving multiple tasks at once with comma-separated IDs
308 | *   **Validation Features:**
309 |     *   Allows moving tasks to non-existent destination IDs (creates placeholder tasks)
310 |     *   Prevents moving to existing task IDs that already have content (to avoid overwriting)
311 |     *   Validates that source tasks exist before attempting to move them
312 |     *   Maintains proper parent-child relationships
313 | *   **Example CLI:** `task-master move --from=5.2 --to=7.3` to move subtask 5.2 to become subtask 7.3.
314 | *   **Example Multi-Move:** `task-master move --from=10,11,12 --to=16,17,18` to move multiple tasks to new positions.
315 | *   **Common Use:** Resolving merge conflicts in tasks.json when multiple team members create tasks on different branches.
316 | 
317 | ---
318 | 
319 | ## Dependency Management
320 | 
321 | ### 18. Add Dependency (`add_dependency`)
322 | 
323 | *   **MCP Tool:** `add_dependency`
324 | *   **CLI Command:** `task-master add-dependency [options]`
325 | *   **Description:** `Define a dependency in Taskmaster, making one task a prerequisite for another.`
326 | *   **Key Parameters/Options:**
327 |     *   `id`: `Required. The ID of the Taskmaster task that will depend on another.` (CLI: `-i, --id <id>`)
328 |     *   `dependsOn`: `Required. The ID of the Taskmaster task that must be completed first, the prerequisite.` (CLI: `-d, --depends-on <id>`)
329 |     *   `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
330 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <path>`)
331 | *   **Usage:** Establish the correct order of execution between tasks.
332 | 
333 | ### 19. Remove Dependency (`remove_dependency`)
334 | 
335 | *   **MCP Tool:** `remove_dependency`
336 | *   **CLI Command:** `task-master remove-dependency [options]`
337 | *   **Description:** `Remove a dependency relationship between two Taskmaster tasks.`
338 | *   **Key Parameters/Options:**
339 |     *   `id`: `Required. The ID of the Taskmaster task you want to remove a prerequisite from.` (CLI: `-i, --id <id>`)
340 |     *   `dependsOn`: `Required. The ID of the Taskmaster task that should no longer be a prerequisite.` (CLI: `-d, --depends-on <id>`)
341 |     *   `tag`: `Specify which tag context to operate on. Defaults to the current active tag.` (CLI: `--tag <name>`)
342 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
343 | *   **Usage:** Update task relationships when the order of execution changes.
344 | 
345 | ### 20. Validate Dependencies (`validate_dependencies`)
346 | 
347 | *   **MCP Tool:** `validate_dependencies`
348 | *   **CLI Command:** `task-master validate-dependencies [options]`
349 | *   **Description:** `Check your Taskmaster tasks for dependency issues (like circular references or links to non-existent tasks) without making changes.`
350 | *   **Key Parameters/Options:**
351 |     *   `tag`: `Specify which tag context to validate. Defaults to the current active tag.` (CLI: `--tag <name>`)
352 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
353 | *   **Usage:** Audit the integrity of your task dependencies.
354 | 
355 | ### 21. Fix Dependencies (`fix_dependencies`)
356 | 
357 | *   **MCP Tool:** `fix_dependencies`
358 | *   **CLI Command:** `task-master fix-dependencies [options]`
359 | *   **Description:** `Automatically fix dependency issues (like circular references or links to non-existent tasks) in your Taskmaster tasks.`
360 | *   **Key Parameters/Options:**
361 |     *   `tag`: `Specify which tag context to fix dependencies in. Defaults to the current active tag.` (CLI: `--tag <name>`)
362 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
363 | *   **Usage:** Clean up dependency errors automatically.
364 | 
365 | ---
366 | 
367 | ## Analysis & Reporting
368 | 
369 | ### 22. Analyze Project Complexity (`analyze_project_complexity`)
370 | 
371 | *   **MCP Tool:** `analyze_project_complexity`
372 | *   **CLI Command:** `task-master analyze-complexity [options]`
373 | *   **Description:** `Have Taskmaster analyze your tasks to determine their complexity and suggest which ones need to be broken down further.`
374 | *   **Key Parameters/Options:**
375 |     *   `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>`)
376 |     *   `threshold`: `The minimum complexity score (1-10) that should trigger a recommendation to expand a task.` (CLI: `-t, --threshold <number>`)
377 |     *   `research`: `Enable research role for more accurate complexity analysis. Requires appropriate API key.` (CLI: `-r, --research`)
378 |     *   `tag`: `Specify which tag context to analyze. Defaults to the current active tag.` (CLI: `--tag <name>`)
379 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
380 | *   **Usage:** Used before breaking down tasks to identify which ones need the most attention.
381 | *   **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.
382 | 
383 | ### 23. View Complexity Report (`complexity_report`)
384 | 
385 | *   **MCP Tool:** `complexity_report`
386 | *   **CLI Command:** `task-master complexity-report [options]`
387 | *   **Description:** `Display the task complexity analysis report in a readable format.`
388 | *   **Key Parameters/Options:**
389 |     *   `tag`: `Specify which tag context to show the report for. Defaults to the current active tag.` (CLI: `--tag <name>`)
390 |     *   `file`: `Path to the complexity report (default: '.taskmaster/reports/task-complexity-report.json').` (CLI: `-f, --file <file>`)
391 | *   **Usage:** Review and understand the complexity analysis results after running analyze-complexity.
392 | 
393 | ---
394 | 
395 | ## File Management
396 | 
397 | ### 24. Generate Task Files (`generate`)
398 | 
399 | *   **MCP Tool:** `generate`
400 | *   **CLI Command:** `task-master generate [options]`
401 | *   **Description:** `Create or update individual Markdown files for each task based on your tasks.json.`
402 | *   **Key Parameters/Options:**
403 |     *   `output`: `The directory where Taskmaster should save the task files (default: in a 'tasks' directory).` (CLI: `-o, --output <directory>`)
404 |     *   `tag`: `Specify which tag context to generate files for. Defaults to the current active tag.` (CLI: `--tag <name>`)
405 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
406 | *   **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.
407 | 
408 | ---
409 | 
410 | ## AI-Powered Research
411 | 
412 | ### 25. Research (`research`)
413 | 
414 | *   **MCP Tool:** `research`
415 | *   **CLI Command:** `task-master research [options]`
416 | *   **Description:** `Perform AI-powered research queries with project context to get fresh, up-to-date information beyond the AI's knowledge cutoff.`
417 | *   **Key Parameters/Options:**
418 |     *   `query`: `Required. Research query/prompt (e.g., "What are the latest best practices for React Query v5?").` (CLI: `[query]` positional or `-q, --query <text>`)
419 |     *   `taskIds`: `Comma-separated list of task/subtask IDs from the current tag context (e.g., "15,16.2,17").` (CLI: `-i, --id <ids>`)
420 |     *   `filePaths`: `Comma-separated list of file paths for context (e.g., "src/api.js,docs/readme.md").` (CLI: `-f, --files <paths>`)
421 |     *   `customContext`: `Additional custom context text to include in the research.` (CLI: `-c, --context <text>`)
422 |     *   `includeProjectTree`: `Include project file tree structure in context (default: false).` (CLI: `--tree`)
423 |     *   `detailLevel`: `Detail level for the research response: 'low', 'medium', 'high' (default: medium).` (CLI: `--detail <level>`)
424 |     *   `saveTo`: `Task or subtask ID (e.g., "15", "15.2") to automatically save the research conversation to.` (CLI: `--save-to <id>`)
425 |     *   `saveFile`: `If true, saves the research conversation to a markdown file in '.taskmaster/docs/research/'.` (CLI: `--save-file`)
426 |     *   `noFollowup`: `Disables the interactive follow-up question menu in the CLI.` (CLI: `--no-followup`)
427 |     *   `tag`: `Specify which tag context to use for task-based context gathering. Defaults to the current active tag.` (CLI: `--tag <name>`)
428 |     *   `projectRoot`: `The directory of the project. Must be an absolute path.` (CLI: Determined automatically)
429 | *   **Usage:** **This is a POWERFUL tool that agents should use FREQUENTLY** to:
430 |     *   Get fresh information beyond knowledge cutoff dates
431 |     *   Research latest best practices, library updates, security patches
432 |     *   Find implementation examples for specific technologies
433 |     *   Validate approaches against current industry standards
434 |     *   Get contextual advice based on project files and tasks
435 | *   **When to Consider Using Research:**
436 |     *   **Before implementing any task** - Research current best practices
437 |     *   **When encountering new technologies** - Get up-to-date implementation guidance (libraries, apis, etc)
438 |     *   **For security-related tasks** - Find latest security recommendations
439 |     *   **When updating dependencies** - Research breaking changes and migration guides
440 |     *   **For performance optimization** - Get current performance best practices
441 |     *   **When debugging complex issues** - Research known solutions and workarounds
442 | *   **Research + Action Pattern:**
443 |     *   Use `research` to gather fresh information
444 |     *   Use `update_subtask` to commit findings with timestamps
445 |     *   Use `update_task` to incorporate research into task details
446 |     *   Use `add_task` with research flag for informed task creation
447 | *   **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.
448 | 
449 | ---
450 | 
451 | ## Tag Management
452 | 
453 | This new suite of commands allows you to manage different task contexts (tags).
454 | 
455 | ### 26. List Tags (`tags`)
456 | 
457 | *   **MCP Tool:** `list_tags`
458 | *   **CLI Command:** `task-master tags [options]`
459 | *   **Description:** `List all available tags with task counts, completion status, and other metadata.`
460 | *   **Key Parameters/Options:**
461 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
462 |     *   `--show-metadata`: `Include detailed metadata in the output (e.g., creation date, description).` (CLI: `--show-metadata`)
463 | 
464 | ### 27. Add Tag (`add_tag`)
465 | 
466 | *   **MCP Tool:** `add_tag`
467 | *   **CLI Command:** `task-master add-tag <tagName> [options]`
468 | *   **Description:** `Create a new, empty tag context, or copy tasks from another tag.`
469 | *   **Key Parameters/Options:**
470 |     *   `tagName`: `Name of the new tag to create (alphanumeric, hyphens, underscores).` (CLI: `<tagName>` positional)
471 |     *   `--from-branch`: `Creates a tag with a name derived from the current git branch, ignoring the <tagName> argument.` (CLI: `--from-branch`)
472 |     *   `--copy-from-current`: `Copy tasks from the currently active tag to the new tag.` (CLI: `--copy-from-current`)
473 |     *   `--copy-from <tag>`: `Copy tasks from a specific source tag to the new tag.` (CLI: `--copy-from <tag>`)
474 |     *   `--description <text>`: `Provide an optional description for the new tag.` (CLI: `-d, --description <text>`)
475 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
476 | 
477 | ### 28. Delete Tag (`delete_tag`)
478 | 
479 | *   **MCP Tool:** `delete_tag`
480 | *   **CLI Command:** `task-master delete-tag <tagName> [options]`
481 | *   **Description:** `Permanently delete a tag and all of its associated tasks.`
482 | *   **Key Parameters/Options:**
483 |     *   `tagName`: `Name of the tag to delete.` (CLI: `<tagName>` positional)
484 |     *   `--yes`: `Skip the confirmation prompt.` (CLI: `-y, --yes`)
485 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
486 | 
487 | ### 29. Use Tag (`use_tag`)
488 | 
489 | *   **MCP Tool:** `use_tag`
490 | *   **CLI Command:** `task-master use-tag <tagName>`
491 | *   **Description:** `Switch your active task context to a different tag.`
492 | *   **Key Parameters/Options:**
493 |     *   `tagName`: `Name of the tag to switch to.` (CLI: `<tagName>` positional)
494 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
495 | 
496 | ### 30. Rename Tag (`rename_tag`)
497 | 
498 | *   **MCP Tool:** `rename_tag`
499 | *   **CLI Command:** `task-master rename-tag <oldName> <newName>`
500 | *   **Description:** `Rename an existing tag.`
501 | *   **Key Parameters/Options:**
502 |     *   `oldName`: `The current name of the tag.` (CLI: `<oldName>` positional)
503 |     *   `newName`: `The new name for the tag.` (CLI: `<newName>` positional)
504 |     *   `file`: `Path to your Taskmaster 'tasks.json' file. Default relies on auto-detection.` (CLI: `-f, --file <file>`)
505 | 
506 | ### 31. Copy Tag (`copy_tag`)
507 | 
508 | *   **MCP Tool:** `copy_tag`
509 | *   **CLI Command:** `task-master copy-tag <sourceName> <targetName> [options]`
510 | *   **Description:** `Copy an entire tag context, including all its tasks and metadata, to a new tag.`
511 | *   **Key Parameters/Options:**
512 |     *   `sourceName`: `Name of the tag to copy from.` (CLI: `<sourceName>` positional)
513 |     *   `targetName`: `Name of the new tag to create.` (CLI: `<targetName>` positional)
514 |     *   `--description <text>`: `Optional description for the new tag.` (CLI: `-d, --description <text>`)
515 | 
516 | ---
517 | 
518 | ## Miscellaneous
519 | 
520 | ### 32. Sync Readme (`sync-readme`) -- experimental
521 | 
522 | *   **MCP Tool:** N/A
523 | *   **CLI Command:** `task-master sync-readme [options]`
524 | *   **Description:** `Exports your task list to your project's README.md file, useful for showcasing progress.`
525 | *   **Key Parameters/Options:**
526 |     *   `status`: `Filter tasks by status (e.g., 'pending', 'done').` (CLI: `-s, --status <status>`)
527 |     *   `withSubtasks`: `Include subtasks in the export.` (CLI: `--with-subtasks`)
528 |     *   `tag`: `Specify which tag context to export from. Defaults to the current active tag.` (CLI: `--tag <name>`)
529 | 
530 | ---
531 | 
532 | ## Environment Variables Configuration (Updated)
533 | 
534 | Taskmaster primarily uses the **`.taskmaster/config.json`** file (in project root) for configuration (models, parameters, logging level, etc.), managed via `task-master models --setup`.
535 | 
536 | Environment variables are used **only** for sensitive API keys related to AI providers and specific overrides like the Ollama base URL:
537 | 
538 | *   **API Keys (Required for corresponding provider):**
539 |     *   `ANTHROPIC_API_KEY`
540 |     *   `PERPLEXITY_API_KEY`
541 |     *   `OPENAI_API_KEY`
542 |     *   `GOOGLE_API_KEY`
543 |     *   `MISTRAL_API_KEY`
544 |     *   `AZURE_OPENAI_API_KEY` (Requires `AZURE_OPENAI_ENDPOINT` too)
545 |     *   `OPENROUTER_API_KEY`
546 |     *   `XAI_API_KEY`
547 |     *   `OLLAMA_API_KEY` (Requires `OLLAMA_BASE_URL` too)
548 | *   **Endpoints (Optional/Provider Specific inside .taskmaster/config.json):**
549 |     *   `AZURE_OPENAI_ENDPOINT`
550 |     *   `OLLAMA_BASE_URL` (Default: `http://localhost:11434/api`)
551 | 
552 | **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.
553 | 
554 | ---
555 | 
556 | For details on how these commands fit into the development process, see the [dev_workflow.md](.kiro/steering/dev_workflow.md).
```
Page 58/69FirstPrevNextLast