#
tokens: 49657/50000 68/975 files (page 4/50)
lines: off (toggle) GitHub
raw markdown copy
This is page 4 of 50. Use http://codebase.md/eyaltoledano/claude-task-master?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

--------------------------------------------------------------------------------
/apps/cli/src/utils/error-handler.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * @fileoverview Centralized error handling utilities for CLI
 * Provides consistent error formatting and debug mode detection
 */

import chalk from 'chalk';

/**
 * Check if debug mode is enabled via environment variable
 * Only returns true when DEBUG is explicitly set to 'true' or '1'
 *
 * @returns True if debug mode is enabled
 */
export function isDebugMode(): boolean {
	return process.env.DEBUG === 'true' || process.env.DEBUG === '1';
}

/**
 * Display an error to the user with optional stack trace in debug mode
 * Handles both TaskMasterError instances and regular errors
 *
 * @param error - The error to display
 * @param options - Display options
 */
export function displayError(
	error: any,
	options: {
		/** Skip exit, useful when caller wants to handle exit */
		skipExit?: boolean;
		/** Force show stack trace regardless of debug mode */
		forceStack?: boolean;
	} = {}
): void {
	// Check if it's a TaskMasterError with sanitized details
	if (error?.getSanitizedDetails) {
		const sanitized = error.getSanitizedDetails();
		console.error(chalk.red(`\n${sanitized.message}`));

		// Show stack trace in debug mode or if forced
		if ((isDebugMode() || options.forceStack) && error.stack) {
			console.error(chalk.gray('\nStack trace:'));
			console.error(chalk.gray(error.stack));
		}
	} else {
		// For other errors, show the message
		const message = error?.message ?? String(error);
		console.error(chalk.red(`\nError: ${message}`));

		// Show stack trace in debug mode or if forced
		if ((isDebugMode() || options.forceStack) && error?.stack) {
			console.error(chalk.gray('\nStack trace:'));
			console.error(chalk.gray(error.stack));
		}
	}

	// Exit if not skipped
	if (!options.skipExit) {
		process.exit(1);
	}
}

```

--------------------------------------------------------------------------------
/packages/tm-bridge/src/bridge-utils.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * Shared utility functions for bridge operations
 */

import { type TmCore, createTmCore } from '@tm/core';
import type { ReportFunction, StorageCheckResult } from './bridge-types.js';

/**
 * Initialize TmCore and check if API storage is being used.
 *
 * This function encapsulates the common pattern used by all bridge functions:
 * 1. Try to create TmCore instance
 * 2. Check the storage type
 * 3. Return results or handle errors gracefully
 *
 * @param projectRoot - Project root directory
 * @param report - Logging function
 * @param fallbackMessage - Message to log if TmCore initialization fails
 * @returns Storage check result with TmCore instance if successful
 *
 * @example
 * const { isApiStorage, tmCore } = await checkStorageType(
 *   projectRoot,
 *   report,
 *   'falling back to file-based operation'
 * );
 *
 * if (!isApiStorage) {
 *   // Continue with file-based logic
 *   return null;
 * }
 */
export async function checkStorageType(
	projectRoot: string,
	report: ReportFunction,
	fallbackMessage = 'falling back to file-based operation'
): Promise<StorageCheckResult> {
	let tmCore: TmCore;

	try {
		tmCore = await createTmCore({
			projectPath: projectRoot || process.cwd()
		});
	} catch (tmCoreError) {
		const errorMessage =
			tmCoreError instanceof Error ? tmCoreError.message : String(tmCoreError);
		report('warn', `TmCore check failed, ${fallbackMessage}: ${errorMessage}`);

		return {
			isApiStorage: false,
			error: errorMessage
		};
	}

	// Check if we're using API storage (use resolved storage type, not config)
	const storageType = tmCore.tasks.getStorageType();

	if (storageType !== 'api') {
		return {
			isApiStorage: false,
			tmCore
		};
	}

	return {
		isApiStorage: true,
		tmCore
	};
}

```

--------------------------------------------------------------------------------
/packages/tm-core/src/modules/auth/config.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * Centralized authentication configuration
 */

import os from 'os';
import path from 'path';
import { AuthConfig } from './types.js';

/**
 * Get the base domain from environment variables
 * Evaluated lazily to allow dotenv to load first
 * Runtime vars (TM_*) take precedence over build-time vars (TM_PUBLIC_*)
 * Build-time: process.env.TM_PUBLIC_BASE_DOMAIN gets replaced by tsdown's env option
 * Runtime: process.env.TM_BASE_DOMAIN can override for staging/development
 * Default: https://tryhamster.com for production
 */
function getBaseDomain(): string {
	return (
		process.env.TM_BASE_DOMAIN || // Runtime override (for staging/tux)
		process.env.TM_PUBLIC_BASE_DOMAIN || // Build-time (baked into compiled code)
		'https://tryhamster.com' // Fallback default
	);
}

/**
 * Get default authentication configuration
 * All URL configuration is derived from the single BASE_DOMAIN
 * Evaluated lazily to allow dotenv to load environment variables first
 */
function getDefaultAuthConfig(): AuthConfig {
	return {
		// Base domain for all services
		baseUrl: getBaseDomain(),

		// Configuration directory and file paths
		configDir: path.join(os.homedir(), '.taskmaster'),
		configFile: path.join(os.homedir(), '.taskmaster', 'auth.json')
	};
}

/**
 * Get merged configuration with optional overrides
 */
export function getAuthConfig(overrides?: Partial<AuthConfig>): AuthConfig {
	return {
		...getDefaultAuthConfig(),
		...overrides
	};
}

/**
 * Default authentication configuration (exported for backward compatibility)
 * Note: This is now a getter property that evaluates lazily
 */
export const DEFAULT_AUTH_CONFIG: AuthConfig = new Proxy({} as AuthConfig, {
	get(_target, prop) {
		return getDefaultAuthConfig()[prop as keyof AuthConfig];
	}
});

```

--------------------------------------------------------------------------------
/test-clean-tags.js:
--------------------------------------------------------------------------------

```javascript
import fs from 'fs';
import {
	createTag,
	listTags
} from './scripts/modules/task-manager/tag-management.js';

console.log('=== Testing Tag Management with Clean File ===');

// Create a clean test tasks.json file
const testTasksPath = './test-tasks.json';
const cleanData = {
	master: {
		tasks: [
			{ id: 1, title: 'Test Task 1', status: 'pending' },
			{ id: 2, title: 'Test Task 2', status: 'done' }
		],
		metadata: {
			created: new Date().toISOString(),
			description: 'Master tag'
		}
	}
};

// Write clean test file
fs.writeFileSync(testTasksPath, JSON.stringify(cleanData, null, 2));
console.log('Created clean test file');

try {
	// Test creating a new tag
	console.log('\n--- Testing createTag ---');
	await createTag(
		testTasksPath,
		'test-branch',
		{ copyFromCurrent: true, description: 'Test branch' },
		{ projectRoot: process.cwd() },
		'json'
	);

	// Read the file and check for corruption
	const resultData = JSON.parse(fs.readFileSync(testTasksPath, 'utf8'));
	console.log('Keys in result file:', Object.keys(resultData));
	console.log('Has _rawTaggedData in file:', !!resultData._rawTaggedData);

	if (resultData._rawTaggedData) {
		console.log('❌ CORRUPTION DETECTED: _rawTaggedData found in file!');
	} else {
		console.log('✅ SUCCESS: No _rawTaggedData corruption in file');
	}

	// Test listing tags
	console.log('\n--- Testing listTags ---');
	const tagList = await listTags(
		testTasksPath,
		{},
		{ projectRoot: process.cwd() },
		'json'
	);
	console.log(
		'Found tags:',
		tagList.tags.map((t) => t.name)
	);
} catch (error) {
	console.error('Error during test:', error.message);
} finally {
	// Clean up test file
	if (fs.existsSync(testTasksPath)) {
		fs.unlinkSync(testTasksPath);
		console.log('\nCleaned up test file');
	}
}

```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/add-subtask.md:
--------------------------------------------------------------------------------

```markdown
Add a subtask to a parent task.

Arguments: $ARGUMENTS

Parse arguments to create a new subtask or convert existing task.

## Adding Subtasks

Creates subtasks to break down complex parent tasks into manageable pieces.

## Argument Parsing

Flexible natural language:
- "add subtask to 5: implement login form"
- "break down 5 with: setup, implement, test"
- "subtask for 5: handle edge cases"
- "5: validate user input" → adds subtask to task 5

## Execution Modes

### 1. Create New Subtask
```bash
task-master add-subtask --parent=<id> --title="<title>" --description="<desc>"
```

### 2. Convert Existing Task
```bash
task-master add-subtask --parent=<id> --task-id=<existing-id>
```

## Smart Features

1. **Automatic Subtask Generation**
   - If title contains "and" or commas, create multiple
   - Suggest common subtask patterns
   - Inherit parent's context

2. **Intelligent Defaults**
   - Priority based on parent
   - Appropriate time estimates
   - Logical dependencies between subtasks

3. **Validation**
   - Check parent task complexity
   - Warn if too many subtasks
   - Ensure subtask makes sense

## Creation Process

1. Parse parent task context
2. Generate subtask with ID like "5.1"
3. Set appropriate defaults
4. Link to parent task
5. Update parent's time estimate

## Example Flows

```
/taskmaster:add-subtask to 5: implement user authentication
→ Created subtask #5.1: "implement user authentication"
→ Parent task #5 now has 1 subtask
→ Suggested next subtasks: tests, documentation

/taskmaster:add-subtask 5: setup, implement, test
→ Created 3 subtasks:
  #5.1: setup
  #5.2: implement  
  #5.3: test
```

## Post-Creation

- Show updated task hierarchy
- Suggest logical next subtasks
- Update complexity estimates
- Recommend subtask order
```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/remove-subtasks.md:
--------------------------------------------------------------------------------

```markdown
Clear all subtasks from a specific task.

Arguments: $ARGUMENTS (task ID)

Remove all subtasks from a parent task at once.

## Clearing Subtasks

Bulk removal of all subtasks from a parent task.

## Execution

```bash
task-master clear-subtasks --id=<task-id>
```

## Pre-Clear Analysis

1. **Subtask Summary**
   - Number of subtasks
   - Completion status of each
   - Work already done
   - Dependencies affected

2. **Impact Assessment**
   - Data that will be lost
   - Dependencies to be removed
   - Effect on project timeline
   - Parent task implications

## Confirmation Required

```
Clear Subtasks Confirmation
━━━━━━━━━━━━━━━━━━━━━━━━━
Parent Task: #5 "Implement user authentication"
Subtasks to remove: 4
- #5.1 "Setup auth framework" (done)
- #5.2 "Create login form" (in-progress)
- #5.3 "Add validation" (pending)
- #5.4 "Write tests" (pending)

⚠️  This will permanently delete all subtask data
Continue? (y/n)
```

## Smart Features

- Option to convert to standalone tasks
- Backup task data before clearing
- Preserve completed work history
- Update parent task appropriately

## Process

1. List all subtasks for confirmation
2. Check for in-progress work
3. Remove all subtasks
4. Update parent task
5. Clean up dependencies

## Alternative Options

Suggest alternatives:
- Convert important subtasks to tasks
- Keep completed subtasks
- Archive instead of delete
- Export subtask data first

## Post-Clear

- Show updated parent task
- Recalculate time estimates
- Update task complexity
- Suggest next steps

## Example

```
/taskmaster:clear-subtasks 5
→ Found 4 subtasks to remove
→ Warning: Subtask #5.2 is in-progress
→ Cleared all subtasks from task #5
→ Updated parent task estimates
→ Suggestion: Consider re-expanding with better breakdown
```
```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/remove-subtask.md:
--------------------------------------------------------------------------------

```markdown
Remove a subtask from its parent task.

Arguments: $ARGUMENTS

Parse subtask ID to remove, with option to convert to standalone task.

## Removing Subtasks

Remove a subtask and optionally convert it back to a standalone task.

## Argument Parsing

- "remove subtask 5.1"
- "delete 5.1"
- "convert 5.1 to task" → remove and convert
- "5.1 standalone" → convert to standalone

## Execution Options

### 1. Delete Subtask
```bash
task-master remove-subtask --id=<parentId.subtaskId>
```

### 2. Convert to Standalone
```bash
task-master remove-subtask --id=<parentId.subtaskId> --convert
```

## Pre-Removal Checks

1. **Validate Subtask**
   - Verify subtask exists
   - Check completion status
   - Review dependencies

2. **Impact Analysis**
   - Other subtasks that depend on it
   - Parent task implications
   - Data that will be lost

## Removal Process

### For Deletion:
1. Confirm if subtask has work done
2. Update parent task estimates
3. Remove subtask and its data
4. Clean up dependencies

### For Conversion:
1. Assign new standalone task ID
2. Preserve all task data
3. Update dependency references
4. Maintain task history

## Smart Features

- Warn if subtask is in-progress
- Show impact on parent task
- Preserve important data
- Update related estimates

## Example Flows

```
/taskmaster:remove-subtask 5.1
→ Warning: Subtask #5.1 is in-progress
→ This will delete all subtask data
→ Parent task #5 will be updated
Confirm deletion? (y/n)

/taskmaster:remove-subtask 5.1 convert
→ Converting subtask #5.1 to standalone task #89
→ Preserved: All task data and history
→ Updated: 2 dependency references
→ New task #89 is now independent
```

## Post-Removal

- Update parent task status
- Recalculate estimates
- Show updated hierarchy
- Suggest next actions
```

--------------------------------------------------------------------------------
/mcp-server/src/tools/README-ZOD-V3.md:
--------------------------------------------------------------------------------

```markdown
# Why MCP Tools Use Zod v3

## Problem

- **FastMCP** uses `xsschema` to convert schemas → outputs JSON Schema **Draft 2020-12**
- **MCP clients** (Augment IDE, gemini-cli, etc.) only support **Draft-07**
- Using Zod v4 in tools causes "vendor undefined" errors and tool discovery failures

## Temporary Solution

All MCP tool files import from `zod/v3` instead of `zod`:

```javascript
import { z } from 'zod/v3';  // ✅ Draft-07 compatible
// NOT: import { z } from 'zod';  // ❌ Would use Draft 2020-12
```

### Why This Works

- Zod v4 ships with v3 compatibility at `zod/v3`
- FastMCP + zod-to-json-schema converts Zod v3 schemas → **Draft-07**
- This ensures MCP clients can discover and use our tools

### What This Means

- ✅ **MCP tools** → use `zod/v3` (this directory)
- ✅ **Rest of codebase** → uses `zod` (Zod v4)
- ✅ **No conflicts** → they're from the same package, just different versions

## When Can We Remove This?

This workaround can be removed when **either**:

1. **FastMCP adds JSON Schema version configuration**
   - e.g., `new FastMCP({ jsonSchema: { target: 'draft-07' } })`
   - Tracking: https://github.com/punkpeye/fastmcp/issues/189

2. **MCP spec adds Draft 2020-12 support**
   - Unlikely in the short term

3. **xsschema adds version targeting**
   - Would allow FastMCP to use Draft-07

## How to Maintain

When adding new MCP tools:

```javascript
// ✅ CORRECT
import { z } from 'zod/v3';

server.addTool({
  name: 'my_tool',
  parameters: z.object({ ... }),  // Will use Draft-07
  execute: async (args) => { ... }
});
```

```javascript
// ❌ WRONG - Will break MCP client compatibility
import { z } from 'zod';  // Don't do this in mcp-server/src/tools/
```

---

**Last Updated:** 2025-10-18
**Affects:** All files in `mcp-server/src/tools/`

```

--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------

```javascript
export default {
	// Use Node.js environment for testing
	testEnvironment: 'node',

	// Automatically clear mock calls between every test
	clearMocks: true,

	// Indicates whether the coverage information should be collected while executing the test
	collectCoverage: false,

	// The directory where Jest should output its coverage files
	coverageDirectory: 'coverage',

	// A list of paths to directories that Jest should use to search for files in
	roots: ['<rootDir>/tests'],

	// The glob patterns Jest uses to detect test files
	testMatch: ['**/__tests__/**/*.js', '**/?(*.)+(spec|test).js'],

	// Transform files
	preset: 'ts-jest/presets/default-esm',
	extensionsToTreatAsEsm: ['.ts'],
	moduleFileExtensions: ['js', 'ts', 'json', 'node'],
	transform: {
		'^.+\\.ts$': [
			'ts-jest',
			{
				useESM: true
			}
		]
	},

	// Disable transformations for node_modules
	transformIgnorePatterns: ['/node_modules/'],

	// Set moduleNameMapper for absolute paths
	moduleNameMapper: {
		'^@/(.*)$': '<rootDir>/$1'
	},
	resolver: '<rootDir>/jest.resolver.cjs',

	// Setup module aliases
	moduleDirectories: ['node_modules', '<rootDir>'],

	// Configure test coverage thresholds
	// Note: ts-jest reports coverage against .ts files, not .js
	coverageThreshold: {
		global: {
			branches: 80,
			functions: 80,
			lines: 80,
			statements: 80
		},
		// Critical code requires higher coverage
		'./src/utils/**/*.ts': {
			branches: 70,
			functions: 90,
			lines: 90,
			statements: 90
		},
		'./src/middleware/**/*.ts': {
			branches: 70,
			functions: 85,
			lines: 85,
			statements: 85
		}
	},

	// Generate coverage report in these formats
	coverageReporters: ['text', 'lcov'],

	// Verbose output
	verbose: true,

	// Setup file
	setupFilesAfterEnv: ['<rootDir>/tests/setup.js']
};

```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/next-task.md:
--------------------------------------------------------------------------------

```markdown
Intelligently determine and prepare the next action based on comprehensive context.

This enhanced version of 'next' considers:
- Current task states
- Recent activity
- Time constraints
- Dependencies
- Your working patterns

Arguments: $ARGUMENTS

## Intelligent Next Action

### 1. **Context Gathering**
Let me analyze the current situation:
- Active tasks (in-progress)
- Recently completed tasks
- Blocked tasks
- Time since last activity
- Arguments provided: $ARGUMENTS

### 2. **Smart Decision Tree**

**If you have an in-progress task:**
- Has it been idle > 2 hours? → Suggest resuming or switching
- Near completion? → Show remaining steps
- Blocked? → Find alternative task

**If no in-progress tasks:**
- Unblocked high-priority tasks? → Start highest
- Complex tasks need breakdown? → Suggest expansion
- All tasks blocked? → Show dependency resolution

**Special arguments handling:**
- "quick" → Find task < 2 hours
- "easy" → Find low complexity task
- "important" → Find high priority regardless of complexity
- "continue" → Resume last worked task

### 3. **Preparation Workflow**

Based on selected task:
1. Show full context and history
2. Set up development environment
3. Run relevant tests
4. Open related files
5. Show similar completed tasks
6. Estimate completion time

### 4. **Alternative Suggestions**

Always provide options:
- Primary recommendation
- Quick alternative (< 1 hour)
- Strategic option (unblocks most tasks)
- Learning option (new technology/skill)

### 5. **Workflow Integration**

Seamlessly connect to:
- `/project:task-master:start [selected]` 
- `/project:workflows:auto-implement`
- `/project:task-master:expand` (if complex)
- `/project:utils:complexity-report` (if unsure)

The goal: Zero friction from decision to implementation.
```

--------------------------------------------------------------------------------
/src/ai-providers/perplexity.js:
--------------------------------------------------------------------------------

```javascript
/**
 * perplexity.js
 * AI provider implementation for Perplexity models using Vercel AI SDK.
 */

import { createPerplexity } from '@ai-sdk/perplexity';
import { BaseAIProvider } from './base-provider.js';

export class PerplexityAIProvider extends BaseAIProvider {
	constructor() {
		super();
		this.name = 'Perplexity';
	}

	/**
	 * Returns the environment variable name required for this provider's API key.
	 * @returns {string} The environment variable name for the Perplexity API key
	 */
	getRequiredApiKeyName() {
		return 'PERPLEXITY_API_KEY';
	}

	/**
	 * Creates and returns a Perplexity client instance.
	 * @param {object} params - Parameters for client initialization
	 * @param {string} params.apiKey - Perplexity API key
	 * @param {string} [params.baseURL] - Optional custom API endpoint
	 * @returns {Function} Perplexity client function
	 * @throws {Error} If initialization fails
	 */
	getClient(params) {
		try {
			const { apiKey, baseURL } = params;
			const fetchImpl = this.createProxyFetch();

			return createPerplexity({
				apiKey,
				baseURL: baseURL || 'https://api.perplexity.ai',
				...(fetchImpl && { fetch: fetchImpl })
			});
		} catch (error) {
			this.handleError('client initialization', error);
		}
	}

	/**
	 * Override generateObject to use JSON mode for Perplexity
	 *
	 * NOTE: Perplexity models (especially sonar models) have known issues
	 * generating valid JSON, particularly with array fields. They often
	 * generate malformed JSON like "dependencies": , instead of "dependencies": []
	 *
	 * The base provider now handles JSON repair automatically for all providers.
	 */
	async generateObject(params) {
		// Force JSON mode for Perplexity as it may help with reliability
		return super.generateObject({
			...params,
			mode: 'json'
		});
	}
}

```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/fix-dependencies.md:
--------------------------------------------------------------------------------

```markdown
Automatically fix dependency issues found during validation.

## Automatic Dependency Repair

Intelligently fixes common dependency problems while preserving project logic.

## Execution

```bash
task-master fix-dependencies
```

## What Gets Fixed

### 1. **Auto-Fixable Issues**
- Remove references to deleted tasks
- Break simple circular dependencies
- Remove self-dependencies
- Clean up duplicate dependencies

### 2. **Smart Resolutions**
- Reorder dependencies to maintain logic
- Suggest task merging for over-dependent tasks
- Flatten unnecessary dependency chains
- Remove redundant transitive dependencies

### 3. **Manual Review Required**
- Complex circular dependencies
- Critical path modifications
- Business logic dependencies
- High-impact changes

## Fix Process

1. **Analysis Phase**
   - Run validation check
   - Categorize issues by type
   - Determine fix strategy

2. **Execution Phase**
   - Apply automatic fixes
   - Log all changes made
   - Preserve task relationships

3. **Verification Phase**
   - Re-validate after fixes
   - Show before/after comparison
   - Highlight manual fixes needed

## Smart Features

- Preserves intended task flow
- Minimal disruption approach
- Creates fix history/log
- Suggests manual interventions

## Output Example

```
Dependency Auto-Fix Report
━━━━━━━━━━━━━━━━━━━━━━━━
Fixed Automatically:
✅ Removed 2 references to deleted tasks
✅ Resolved 1 self-dependency
✅ Cleaned 3 redundant dependencies

Manual Review Needed:
⚠️ Complex circular dependency: #12 → #15 → #18 → #12
  Suggestion: Make #15 not depend on #12
⚠️ Task #45 has 8 dependencies
  Suggestion: Break into subtasks

Run '/taskmaster:validate-dependencies' to verify fixes
```

## Safety

- Preview mode available
- Rollback capability
- Change logging
- No data loss
```

--------------------------------------------------------------------------------
/packages/tm-core/src/common/errors/index.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * @fileoverview Custom error classes for the tm-core package
 * This file exports all custom error types and error handling utilities
 */

// Export the main TaskMasterError class
export {
	TaskMasterError,
	ERROR_CODES,
	type ErrorCode,
	type ErrorContext,
	type SerializableError
} from './task-master-error.js';

// Error implementations will be defined here
// export * from './task-errors.js';
// export * from './storage-errors.js';
// export * from './provider-errors.js';
// export * from './validation-errors.js';

// Placeholder exports - these will be implemented in later tasks

/**
 * Base error class for all tm-core errors
 * @deprecated This is a placeholder class that will be properly implemented in later tasks
 */
export class TmCoreError extends Error {
	constructor(
		message: string,
		public code?: string
	) {
		super(message);
		this.name = 'TmCoreError';
	}
}

/**
 * Error thrown when a task is not found
 * @deprecated This is a placeholder class that will be properly implemented in later tasks
 */
export class TaskNotFoundError extends TmCoreError {
	constructor(taskId: string) {
		super(`Task not found: ${taskId}`, 'TASK_NOT_FOUND');
		this.name = 'TaskNotFoundError';
	}
}

/**
 * Error thrown when validation fails
 * @deprecated This is a placeholder class that will be properly implemented in later tasks
 */
export class ValidationError extends TmCoreError {
	constructor(message: string) {
		super(message, 'VALIDATION_ERROR');
		this.name = 'ValidationError';
	}
}

/**
 * Error thrown when storage operations fail
 * @deprecated This is a placeholder class that will be properly implemented in later tasks
 */
export class StorageError extends TmCoreError {
	constructor(message: string) {
		super(message, 'STORAGE_ERROR');
		this.name = 'StorageError';
	}
}

```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/add-task.md:
--------------------------------------------------------------------------------

```markdown
Add new tasks with intelligent parsing and context awareness.

Arguments: $ARGUMENTS

## Smart Task Addition

Parse natural language to create well-structured tasks.

### 1. **Input Understanding**

I'll intelligently parse your request:
- Natural language → Structured task
- Detect priority from keywords (urgent, ASAP, important)
- Infer dependencies from context
- Suggest complexity based on description
- Determine task type (feature, bug, refactor, test, docs)

### 2. **Smart Parsing Examples**

**"Add urgent task to fix login bug"**
→ Title: Fix login bug
→ Priority: high
→ Type: bug
→ Suggested complexity: medium

**"Create task for API documentation after task 23 is done"**
→ Title: API documentation
→ Dependencies: [23]
→ Type: documentation
→ Priority: medium

**"Need to refactor auth module - depends on 12 and 15, high complexity"**
→ Title: Refactor auth module
→ Dependencies: [12, 15]
→ Complexity: high
→ Type: refactor

### 3. **Context Enhancement**

Based on current project state:
- Suggest related existing tasks
- Warn about potential conflicts
- Recommend dependencies
- Propose subtasks if complex

### 4. **Interactive Refinement**

```yaml
Task Preview:
─────────────
Title: [Extracted title]
Priority: [Inferred priority]
Dependencies: [Detected dependencies]
Complexity: [Estimated complexity]

Suggestions:
- Similar task #34 exists, consider as dependency?
- This seems complex, break into subtasks?
- Tasks #45-47 work on same module
```

### 5. **Validation & Creation**

Before creating:
- Validate dependencies exist
- Check for duplicates
- Ensure logical ordering
- Verify task completeness

### 6. **Smart Defaults**

Intelligent defaults based on:
- Task type patterns
- Team conventions
- Historical data
- Current sprint/phase

Result: High-quality tasks from minimal input.
```

--------------------------------------------------------------------------------
/apps/cli/src/utils/auth-helpers.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * @fileoverview Authentication helpers for CLI commands
 */

import type { AuthManager } from '@tm/core';
import { displayCardBox } from '../ui/components/cardBox.component.js';

/**
 * Options for authentication check
 */
export interface CheckAuthOptions {
	/** Custom message describing what requires authentication (defaults to generic message) */
	message?: string;
	/** Optional footer text (e.g., alternative local commands) */
	footer?: string;
	/** Command to run to authenticate (defaults to "tm auth login") */
	authCommand?: string;
}

/**
 * Check if user is authenticated and display a friendly card box if not.
 * Used by commands that require Hamster authentication (briefs, context, etc.)
 *
 * @param authManager - AuthManager instance
 * @param options - Optional customization for the authentication prompt
 * @returns true if authenticated, false if not
 *
 * @example
 * ```typescript
 * const isAuthenticated = await checkAuthentication(authManager, {
 *   message: 'The "briefs" command requires you to be logged in to your Hamster account.',
 *   footer: 'Working locally instead?\n  → Use "tm tags" for local tag management.'
 * });
 *
 * if (!isAuthenticated) {
 *   process.exit(1);
 * }
 * ```
 */
export async function checkAuthentication(
	authManager: AuthManager,
	options: CheckAuthOptions = {}
): Promise<boolean> {
	const hasSession = await authManager.hasValidSession();

	if (!hasSession) {
		const {
			message = 'This command requires you to be logged in to your Hamster account.',
			footer,
			authCommand = 'tm auth login'
		} = options;

		console.log(
			displayCardBox({
				header: '[!] Not logged in to Hamster',
				body: [message],
				callToAction: {
					label: 'To get started:',
					action: authCommand
				},
				footer
			})
		);
		return false;
	}

	return true;
}

```

--------------------------------------------------------------------------------
/packages/tm-core/src/modules/git/services/branch-name-generator.spec.ts:
--------------------------------------------------------------------------------

```typescript
import { describe, expect, it } from 'vitest';
import {
	generateBranchName,
	sanitizeBranchName
} from './branch-name-generator.js';

describe('Branch Name Generator', () => {
	describe('sanitizeBranchName', () => {
		it('should remove invalid characters', () => {
			const result = sanitizeBranchName('feature/my feature!');
			expect(result).toBe('feature-my-feature');
		});

		it('should replace spaces with hyphens', () => {
			const result = sanitizeBranchName('my feature branch');
			expect(result).toBe('my-feature-branch');
		});

		it('should convert to lowercase', () => {
			const result = sanitizeBranchName('MyFeature');
			expect(result).toBe('myfeature');
		});

		it('should remove consecutive hyphens', () => {
			const result = sanitizeBranchName('my---feature');
			expect(result).toBe('my-feature');
		});

		it('should handle empty string', () => {
			const result = sanitizeBranchName('');
			expect(result).toBe('branch');
		});
	});

	describe('generateBranchName', () => {
		it('should generate branch name from task ID', () => {
			const result = generateBranchName({ taskId: '2.7' });
			expect(result).toMatch(/^task-2-7-/);
		});

		it('should include description in branch name', () => {
			const result = generateBranchName({
				taskId: '2.7',
				description: 'Add Feature'
			});
			expect(result).toContain('task-2-7');
			expect(result).toContain('add-feature');
		});

		it('should handle custom pattern', () => {
			const result = generateBranchName({
				taskId: '2.7',
				pattern: 'feature/{taskId}'
			});
			expect(result).toBe('feature-2-7');
		});

		it('should truncate long descriptions', () => {
			const longDesc = 'a'.repeat(100);
			const result = generateBranchName({
				taskId: '2.7',
				description: longDesc
			});
			expect(result.length).toBeLessThan(80);
		});
	});
});

```

--------------------------------------------------------------------------------
/packages/tm-core/src/modules/tasks/repositories/supabase/dependency-fetcher.ts:
--------------------------------------------------------------------------------

```typescript
import { SupabaseClient } from '@supabase/supabase-js';
import { Database } from '../../../../common/types/database.types.js';
import { DependencyWithDisplayId } from '../../../../common/types/repository-types.js';

/**
 * Handles fetching and processing of task dependencies with display_ids
 */
export class DependencyFetcher {
	constructor(private supabase: SupabaseClient<Database>) {}

	/**
	 * Fetches dependencies for given task IDs with display_ids joined
	 * @param taskIds Array of task IDs to fetch dependencies for
	 * @returns Map of task ID to array of dependency display_ids
	 */
	async fetchDependenciesWithDisplayIds(
		taskIds: string[]
	): Promise<Map<string, string[]>> {
		if (!taskIds || taskIds.length === 0) {
			return new Map();
		}

		const { data, error } = await this.supabase
			.from('task_dependencies')
			.select(`
				task_id,
				depends_on_task:tasks!task_dependencies_depends_on_task_id_fkey (
					display_id
				)
			`)
			.in('task_id', taskIds);

		if (error) {
			throw new Error(`Failed to fetch task dependencies: ${error.message}`);
		}

		return this.processDependencyData(data as DependencyWithDisplayId[]);
	}

	/**
	 * Processes raw dependency data into a map structure
	 */
	private processDependencyData(
		dependencies: DependencyWithDisplayId[]
	): Map<string, string[]> {
		const dependenciesByTaskId = new Map<string, string[]>();

		if (!dependencies) {
			return dependenciesByTaskId;
		}

		for (const dep of dependencies) {
			if (!dep.task_id) continue;

			const currentDeps = dependenciesByTaskId.get(dep.task_id) || [];

			// Extract display_id from the joined object
			const displayId = dep.depends_on_task?.display_id;
			if (displayId) {
				currentDeps.push(displayId);
			}

			dependenciesByTaskId.set(dep.task_id, currentDeps);
		}

		return dependenciesByTaskId;
	}
}

```

--------------------------------------------------------------------------------
/.claude/commands/dedupe.md:
--------------------------------------------------------------------------------

```markdown
---
allowed-tools: Bash(gh issue view:*), Bash(gh search:*), Bash(gh issue list:*), Bash(gh api:*), Bash(gh issue comment:*)
description: Find duplicate GitHub issues
---

Find up to 3 likely duplicate issues for a given GitHub issue.

To do this, follow these steps precisely:

1. Use an agent to check if the Github issue (a) is closed, (b) does not need to be deduped (eg. because it is broad product feedback without a specific solution, or positive feedback), or (c) already has a duplicates comment that you made earlier. If so, do not proceed.
2. Use an agent to view a Github issue, and ask the agent to return a summary of the issue
3. Then, launch 5 parallel agents to search Github for duplicates of this issue, using diverse keywords and search approaches, using the summary from #1
4. Next, feed the results from #1 and #2 into another agent, so that it can filter out false positives, that are likely not actually duplicates of the original issue. If there are no duplicates remaining, do not proceed.
5. Finally, comment back on the issue with a list of up to three duplicate issues (or zero, if there are no likely duplicates)

Notes (be sure to tell this to your agents, too):

- Use `gh` to interact with Github, rather than web fetch
- Do not use other tools, beyond `gh` (eg. don't use other MCP servers, file edit, etc.)
- Make a todo list first
- For your comment, follow the following format precisely (assuming for this example that you found 3 suspected duplicates):

---

Found 3 possible duplicate issues:

1. <link to issue>
2. <link to issue>
3. <link to issue>

This issue will be automatically closed as a duplicate in 3 days.

- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with \[Task Master Bot\]

---
```

--------------------------------------------------------------------------------
/apps/extension/src/components/ui/card.tsx:
--------------------------------------------------------------------------------

```typescript
import type * as React from 'react';

import { cn } from '@/lib/utils';

function Card({ className, ...props }: React.ComponentProps<'div'>) {
	return (
		<div
			data-slot="card"
			className={cn(
				'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
				className
			)}
			{...props}
		/>
	);
}

function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
	return (
		<div
			data-slot="card-header"
			className={cn(
				'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
				className
			)}
			{...props}
		/>
	);
}

function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
	return (
		<div
			data-slot="card-title"
			className={cn('leading-none font-semibold', className)}
			{...props}
		/>
	);
}

function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
	return (
		<div
			data-slot="card-description"
			className={cn('text-muted-foreground text-sm', className)}
			{...props}
		/>
	);
}

function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
	return (
		<div
			data-slot="card-action"
			className={cn(
				'col-start-2 row-span-2 row-start-1 self-start justify-self-end',
				className
			)}
			{...props}
		/>
	);
}

function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
	return (
		<div
			data-slot="card-content"
			className={cn('px-6', className)}
			{...props}
		/>
	);
}

function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
	return (
		<div
			data-slot="card-footer"
			className={cn('flex items-center px-6 [.border-t]:pt-6', className)}
			{...props}
		/>
	);
}

export {
	Card,
	CardHeader,
	CardFooter,
	CardTitle,
	CardAction,
	CardDescription,
	CardContent
};

```

--------------------------------------------------------------------------------
/apps/extension/src/webview/components/PollingStatus.tsx:
--------------------------------------------------------------------------------

```typescript
/**
 * Polling Status Indicator Component
 */

import React from 'react';
import type { AppState } from '../types';

interface PollingStatusProps {
	polling: AppState['polling'];
	onRetry?: () => void;
}

export const PollingStatus: React.FC<PollingStatusProps> = ({
	polling,
	onRetry
}) => {
	const {
		isActive,
		errorCount,
		isOfflineMode,
		connectionStatus,
		reconnectAttempts,
		maxReconnectAttempts
	} = polling;

	if (isOfflineMode || connectionStatus === 'offline') {
		return (
			<div className="flex items-center gap-2">
				<div
					className="flex items-center gap-1 text-red-400"
					title="Offline mode - using cached data"
				>
					<div className="w-2 h-2 rounded-full bg-red-400" />
					<span className="text-xs">Offline</span>
				</div>
				<button
					onClick={onRetry}
					className="text-xs text-blue-400 hover:underline"
					title="Attempt to reconnect"
				>
					Retry
				</button>
			</div>
		);
	}

	if (connectionStatus === 'reconnecting') {
		return (
			<div
				className="flex items-center gap-1 text-yellow-400"
				title={`Reconnecting... (${reconnectAttempts}/${maxReconnectAttempts})`}
			>
				<div className="w-2 h-2 rounded-full bg-yellow-400 animate-pulse" />
				<span className="text-xs">Reconnecting</span>
			</div>
		);
	}

	if (errorCount > 0) {
		return (
			<div
				className="flex items-center gap-1 text-yellow-400"
				title={`${errorCount} polling error${errorCount > 1 ? 's' : ''}`}
			>
				<div className="w-2 h-2 rounded-full bg-yellow-400" />
				<span className="text-xs">Live (errors)</span>
			</div>
		);
	}

	if (isActive) {
		return (
			<div
				className="flex items-center gap-1 text-green-400"
				title="Live updates active"
			>
				<div className="w-2 h-2 rounded-full bg-green-400 animate-pulse" />
				<span className="text-xs">Live</span>
			</div>
		);
	}

	return null;
};

```

--------------------------------------------------------------------------------
/src/constants/profiles.js:
--------------------------------------------------------------------------------

```javascript
/**
 * @typedef {'amp' | 'claude' | 'cline' | 'codex' | 'cursor' | 'gemini' | 'kiro' | 'opencode' | 'kilo' | 'roo' | 'trae' | 'windsurf' | 'vscode' | 'zed'} RulesProfile
 */

/**
 * Available rule profiles for project initialization and rules command
 *
 * ⚠️  SINGLE SOURCE OF TRUTH: This is the authoritative list of all supported rule profiles.
 * This constant is used directly throughout the codebase (previously aliased as PROFILE_NAMES).
 *
 * @type {RulesProfile[]}
 * @description Defines possible rule profile sets:
 * - amp: Amp Code integration
 * - claude: Claude Code integration
 * - cline: Cline IDE rules
 * - codex: Codex integration
 * - cursor: Cursor IDE rules
 * - gemini: Gemini integration
 * - kiro: Kiro IDE rules
 * - opencode: OpenCode integration
 * - kilo: Kilo Code integration
 * - roo: Roo Code IDE rules
 * - trae: Trae IDE rules
 * - vscode: VS Code with GitHub Copilot integration
 * - windsurf: Windsurf IDE rules
 * - zed: Zed IDE rules
 *
 * To add a new rule profile:
 * 1. Add the profile name to this array
 * 2. Create a profile file in src/profiles/{profile}.js
 * 3. Export it as {profile}Profile in src/profiles/index.js
 */
export const RULE_PROFILES = [
	'amp',
	'claude',
	'cline',
	'codex',
	'cursor',
	'gemini',
	'kiro',
	'opencode',
	'kilo',
	'roo',
	'trae',
	'vscode',
	'windsurf',
	'zed'
];

/**
 * Centralized enum for all supported Roo agent modes
 * @type {string[]}
 * @description Available Roo Code IDE modes for rule generation
 */
export const ROO_MODES = [
	'architect',
	'ask',
	'orchestrator',
	'code',
	'debug',
	'test'
];

/**
 * Check if a given rule profile is valid
 * @param {string} rulesProfile - The rule profile to check
 * @returns {boolean} True if the rule profile is valid, false otherwise
 */
export function isValidRulesProfile(rulesProfile) {
	return RULE_PROFILES.includes(rulesProfile);
}

```

--------------------------------------------------------------------------------
/apps/docs/getting-started/quick-start/execute-quick.mdx:
--------------------------------------------------------------------------------

```markdown
---
title: Executing Tasks
sidebarTitle: "Executing Tasks"
---

Now that your tasks are generated and reviewed you are ready to begin executing.

## Select the Task to Work on: Next Task

Task Master has the "next" command to find the next task to work on. You can access it with the following request:
```
What's the next task I should work on? Please consider dependencies and priorities.
```
Alternatively you can use the CLI to show the next task
```bash
task-master next
```

## Discuss Task
When you know what task to work on next you can then start chatting with the agent to make sure it understands the plan of action.

You can tag relevant files and folders so it knows what context to pull up as it generates its plan. For example:
```
Please review Task 5 and confirm you understand how to execute before beginning. Refer to @models @api and @schema 
```
The agent will begin analyzing the task and files and respond with the steps to complete the task. 

## Agent Task execution

If you agree with the plan of action, tell the agent to get started.
```
You may begin. I believe in you.
```

## Review and Test

Once the agent is finished with the task you can refer to the task testing strategy to make sure it was completed correctly.

## Update Task Status

If the task was completed correctly you can update the status to done

```
Please mark Task 5 as done
```
The agent will execute
```bash
task-master set-status --id=5 --status=done
```

## Rules and Context

If you ran into problems and had to debug errors you can create new rules as you go. This helps build context on your codebase that helps the creation and execution of future tasks.

## On to the Next Task!

By now you have all you need to get started executing code faster and smarter with Task Master.

If you have any questions please check out [Frequently Asked Questions](/getting-started/faq)

```

--------------------------------------------------------------------------------
/.taskmaster/tasks/task_003_tm-start.txt:
--------------------------------------------------------------------------------

```
# Task ID: 3
# Title: Create standardized prompt builder
# Status: pending
# Dependencies: 1
# Priority: medium
# Description: Implement a function to build the standardized prompt for claude-code based on the task details
# Details:
Create a function in the StartCommand class that builds the standardized prompt according to the template provided in the PRD. The prompt should include instructions for Claude to first run `tm show <task_id>` to get task details, and then implement the required changes.

```typescript
private buildPrompt(taskId: string): string {
  return `You are an AI coding assistant with access to this repository's codebase.

First, run this command to get the task details:
tm show ${taskId}

Then implement the task with these requirements:
- Make the SMALLEST number of code changes possible
- Follow ALL existing patterns in the codebase (you have access to analyze the code)
- Do NOT over-engineer the solution
- Use existing files/functions/patterns wherever possible
- When complete, print: COMPLETED: <brief summary of changes>

Begin by running tm show ${taskId} to understand what needs to be implemented.`;
}
```
<info added on 2025-09-12T02:40:01.812Z>
The prompt builder function will handle task context retrieval by instructing Claude to use the task-master show command. This approach ensures Claude has access to all necessary task details before implementation begins. The command syntax "tm show ${taskId}" embedded in the prompt will direct Claude to first gather the complete task context, including description, requirements, and any existing implementation details, before proceeding with code changes.
</info added on 2025-09-12T02:40:01.812Z>

# Test Strategy:
Verify the prompt is correctly formatted by calling the function with a sample task ID and checking that the output matches the expected template with the task ID properly inserted.

```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/update-task.md:
--------------------------------------------------------------------------------

```markdown
Update tasks with intelligent field detection and bulk operations.

Arguments: $ARGUMENTS

## Intelligent Task Updates

Parse arguments to determine update intent and execute smartly.

### 1. **Natural Language Processing**

Understand update requests like:
- "mark 23 as done" → Update status to done
- "increase priority of 45" → Set priority to high
- "add dependency on 12 to task 34" → Add dependency
- "tasks 20-25 need review" → Bulk status update
- "all API tasks high priority" → Pattern-based update

### 2. **Smart Field Detection**

Automatically detect what to update:
- Status keywords: done, complete, start, pause, review
- Priority changes: urgent, high, low, deprioritize
- Dependency updates: depends on, blocks, after
- Assignment: assign to, owner, responsible
- Time: estimate, spent, deadline

### 3. **Bulk Operations**

Support for multiple task updates:
```
Examples:
- "complete tasks 12, 15, 18"
- "all pending auth tasks to in-progress"
- "increase priority for tasks blocking 45"
- "defer all documentation tasks"
```

### 4. **Contextual Validation**

Before updating, check:
- Status transitions are valid
- Dependencies don't create cycles
- Priority changes make sense
- Bulk updates won't break project flow

Show preview:
```
Update Preview:
─────────────────
Tasks to update: #23, #24, #25
Change: status → in-progress
Impact: Will unblock tasks #30, #31
Warning: Task #24 has unmet dependencies
```

### 5. **Smart Suggestions**

Based on update:
- Completing task? → Show newly unblocked tasks
- Changing priority? → Show impact on sprint
- Adding dependency? → Check for conflicts
- Bulk update? → Show summary of changes

### 6. **Workflow Integration**

After updates:
- Auto-update dependent task states
- Trigger status recalculation
- Update sprint/milestone progress
- Log changes with context

Result: Flexible, intelligent task updates with safety checks.
```

--------------------------------------------------------------------------------
/tests/fixtures/sample-claude-response.js:
--------------------------------------------------------------------------------

```javascript
/**
 * Sample Claude API response for testing
 */

export const sampleClaudeResponse = {
	tasks: [
		{
			id: 1,
			title: 'Setup Task Data Structure',
			description: 'Implement the core task data structure and file operations',
			status: 'pending',
			dependencies: [],
			priority: 'high',
			details:
				'Create the tasks.json file structure with support for task properties including ID, title, description, status, dependencies, priority, details, and test strategy. Implement file system operations for reading and writing task data.',
			testStrategy:
				'Verify tasks.json is created with the correct structure and that task data can be read from and written to the file.'
		},
		{
			id: 2,
			title: 'Implement CLI Foundation',
			description:
				'Create the command-line interface foundation with basic commands',
			status: 'pending',
			dependencies: [1],
			priority: 'high',
			details:
				'Set up Commander.js for handling CLI commands. Implement the basic command structure including help documentation. Create the foundational command parsing logic.',
			testStrategy:
				'Test each command to ensure it properly parses arguments and options. Verify help documentation is displayed correctly.'
		},
		{
			id: 3,
			title: 'Develop Task Management Operations',
			description:
				'Implement core operations for creating, reading, updating, and deleting tasks',
			status: 'pending',
			dependencies: [1],
			priority: 'medium',
			details:
				'Implement functions for listing tasks, adding new tasks, updating task status, and removing tasks. Include support for filtering tasks by status and other properties.',
			testStrategy:
				'Create unit tests for each CRUD operation to verify they correctly modify the task data.'
		}
	],
	metadata: {
		projectName: 'Task Management CLI',
		totalTasks: 3,
		sourceFile: 'tests/fixtures/sample-prd.txt',
		generatedAt: '2023-12-15'
	}
};

```

--------------------------------------------------------------------------------
/src/ai-providers/anthropic.js:
--------------------------------------------------------------------------------

```javascript
/**
 * src/ai-providers/anthropic.js
 *
 * Implementation for interacting with Anthropic models (e.g., Claude)
 * using the Vercel AI SDK.
 */

import { createAnthropic } from '@ai-sdk/anthropic';
import { BaseAIProvider } from './base-provider.js';

// TODO: Implement standardized functions for generateText, streamText, generateObject

// --- Client Instantiation ---
// Note: API key resolution should ideally happen closer to the call site
// using the config manager/resolver which checks process.env and session.env.
// This is a placeholder for basic functionality.
// Remove the global variable and caching logic
// let anthropicClient;

export class AnthropicAIProvider extends BaseAIProvider {
	constructor() {
		super();
		this.name = 'Anthropic';
	}

	/**
	 * Returns the environment variable name required for this provider's API key.
	 * @returns {string} The environment variable name for the Anthropic API key
	 */
	getRequiredApiKeyName() {
		return 'ANTHROPIC_API_KEY';
	}

	/**
	 * Creates and returns an Anthropic client instance.
	 * @param {object} params - Parameters for client initialization
	 * @param {string} params.apiKey - Anthropic API key
	 * @param {string} [params.baseURL] - Optional custom API endpoint
	 * @returns {Function} Anthropic client function
	 * @throws {Error} If initialization fails
	 */
	getClient(params) {
		try {
			const { apiKey, baseURL } = params;
			const fetchImpl = this.createProxyFetch();

			return createAnthropic({
				apiKey,
				...(baseURL && { baseURL }),
				headers: {
					'anthropic-beta': 'output-128k-2025-02-19'
				},
				...(fetchImpl && { fetch: fetchImpl })
			});
		} catch (error) {
			this.handleError('client initialization', error);
		}
	}
}

// TODO: Implement streamAnthropicObject if needed and supported well by the SDK for Anthropic.
// The basic structure would be similar to generateAnthropicObject but using streamObject.

```

--------------------------------------------------------------------------------
/mcp-server/src/tools/use-tag.js:
--------------------------------------------------------------------------------

```javascript
/**
 * tools/use-tag.js
 * Tool to switch to a different tag context
 */

import { z } from 'zod';
import {
	createErrorResponse,
	handleApiResult,
	withNormalizedProjectRoot
} from './utils.js';
import { useTagDirect } from '../core/task-master-core.js';
import { findTasksPath } from '../core/utils/path-utils.js';

/**
 * Register the useTag tool with the MCP server
 * @param {Object} server - FastMCP server instance
 */
export function registerUseTagTool(server) {
	server.addTool({
		name: 'use_tag',
		description: 'Switch to a different tag context for task operations',
		parameters: z.object({
			name: z.string().describe('Name of the tag to switch to'),
			file: z
				.string()
				.optional()
				.describe('Path to the tasks file (default: tasks/tasks.json)'),
			projectRoot: z
				.string()
				.describe('The directory of the project. Must be an absolute path.')
		}),
		execute: withNormalizedProjectRoot(async (args, { log, session }) => {
			try {
				log.info(`Starting use-tag with args: ${JSON.stringify(args)}`);

				// Use args.projectRoot directly (guaranteed by withNormalizedProjectRoot)
				let tasksJsonPath;
				try {
					tasksJsonPath = findTasksPath(
						{ projectRoot: args.projectRoot, file: args.file },
						log
					);
				} catch (error) {
					log.error(`Error finding tasks.json: ${error.message}`);
					return createErrorResponse(
						`Failed to find tasks.json: ${error.message}`
					);
				}

				// Call the direct function
				const result = await useTagDirect(
					{
						tasksJsonPath: tasksJsonPath,
						name: args.name,
						projectRoot: args.projectRoot
					},
					log,
					{ session }
				);

				return handleApiResult(
					result,
					log,
					'Error switching tag',
					undefined,
					args.projectRoot
				);
			} catch (error) {
				log.error(`Error in use-tag tool: ${error.message}`);
				return createErrorResponse(error.message);
			}
		})
	});
}

```

--------------------------------------------------------------------------------
/apps/mcp/src/tools/README-ZOD-V3.md:
--------------------------------------------------------------------------------

```markdown
# Why MCP Tools Use Zod v3

## Problem

- **FastMCP** uses `xsschema` to convert schemas → outputs JSON Schema **Draft 2020-12**
- **MCP clients** (Augment IDE, gemini-cli, etc.) only support **Draft-07**
- Using Zod v4 in tools causes "vendor undefined" errors and tool discovery failures

## Temporary Solution

All MCP tool files import from `zod/v3` instead of `zod`:

```typescript
import { z } from 'zod/v3';  // ✅ Draft-07 compatible
// NOT: import { z } from 'zod';  // ❌ Would use Draft 2020-12
```

### Why This Works

- Zod v4 ships with v3 compatibility at `zod/v3`
- FastMCP + zod-to-json-schema converts Zod v3 schemas → **Draft-07**
- This ensures MCP clients can discover and use our tools

### What This Means

- ✅ **MCP tools** → use `zod/v3` (apps/mcp & mcp-server/src/tools)
- ✅ **Rest of codebase** → uses `zod` (Zod v4)
- ✅ **No conflicts** → they're from the same package, just different versions

## When Can We Remove This?

This workaround can be removed when **either**:

1. **FastMCP adds JSON Schema version configuration**
   - e.g., `new FastMCP({ jsonSchema: { target: 'draft-07' } })`
   - Tracking: https://github.com/punkpeye/fastmcp/issues/189

2. **MCP spec adds Draft 2020-12 support**
   - Unlikely in the short term

3. **xsschema adds version targeting**
   - Would allow FastMCP to use Draft-07

## How to Maintain

When adding new MCP tools:

```typescript
// ✅ CORRECT
import { z } from 'zod/v3';

export function registerMyTool(server: FastMCP) {
  server.addTool({
    name: 'my_tool',
    parameters: z.object({ ... }),  // Will use Draft-07
    execute: async (args, context) => { ... }
  });
}
```

```typescript
// ❌ WRONG - Will break MCP client compatibility
import { z } from 'zod';  // Don't do this in apps/mcp/src/tools/
```

---

**Last Updated:** 2025-10-18
**Affects:** All files in `apps/mcp/src/tools/`
**See Also:** `mcp-server/src/tools/README-ZOD-V3.md` (same workaround)

```

--------------------------------------------------------------------------------
/tests/unit/utils-strip-ansi.test.js:
--------------------------------------------------------------------------------

```javascript
/**
 * Tests for the stripAnsiCodes utility function
 */
import { jest } from '@jest/globals';

// Import the module under test
const { stripAnsiCodes } = await import('../../scripts/modules/utils.js');

describe('stripAnsiCodes', () => {
	test('should remove ANSI color codes from text', () => {
		const textWithColors = '\x1b[31mRed text\x1b[0m \x1b[32mGreen text\x1b[0m';
		const result = stripAnsiCodes(textWithColors);
		expect(result).toBe('Red text Green text');
	});

	test('should handle text without ANSI codes', () => {
		const plainText = 'This is plain text';
		const result = stripAnsiCodes(plainText);
		expect(result).toBe('This is plain text');
	});

	test('should handle empty string', () => {
		const result = stripAnsiCodes('');
		expect(result).toBe('');
	});

	test('should handle complex ANSI sequences', () => {
		// Test with various ANSI escape sequences
		const complexText =
			'\x1b[1;31mBold red\x1b[0m \x1b[4;32mUnderlined green\x1b[0m \x1b[33;46mYellow on cyan\x1b[0m';
		const result = stripAnsiCodes(complexText);
		expect(result).toBe('Bold red Underlined green Yellow on cyan');
	});

	test('should handle non-string input gracefully', () => {
		expect(stripAnsiCodes(null)).toBe(null);
		expect(stripAnsiCodes(undefined)).toBe(undefined);
		expect(stripAnsiCodes(123)).toBe(123);
		expect(stripAnsiCodes({})).toEqual({});
	});

	test('should handle real chalk output patterns', () => {
		// Test patterns similar to what chalk produces
		const chalkLikeText =
			'1 \x1b[32m✓ done\x1b[39m Setup Project \x1b[31m(high)\x1b[39m';
		const result = stripAnsiCodes(chalkLikeText);
		expect(result).toBe('1 ✓ done Setup Project (high)');
	});

	test('should handle multiline text with ANSI codes', () => {
		const multilineText =
			'\x1b[31mLine 1\x1b[0m\n\x1b[32mLine 2\x1b[0m\n\x1b[33mLine 3\x1b[0m';
		const result = stripAnsiCodes(multilineText);
		expect(result).toBe('Line 1\nLine 2\nLine 3');
	});
});

```

--------------------------------------------------------------------------------
/mcp-test.js:
--------------------------------------------------------------------------------

```javascript
#!/usr/bin/env node

import { Config } from 'fastmcp';
import path from 'path';
import fs from 'fs';

// Log the current directory
console.error(`Current working directory: ${process.cwd()}`);

try {
	console.error('Attempting to load FastMCP Config...');

	// Check if .cursor/mcp.json exists
	const mcpPath = path.join(process.cwd(), '.cursor', 'mcp.json');
	console.error(`Checking if mcp.json exists at: ${mcpPath}`);

	if (fs.existsSync(mcpPath)) {
		console.error('mcp.json file found');
		console.error(
			`File content: ${JSON.stringify(JSON.parse(fs.readFileSync(mcpPath, 'utf8')), null, 2)}`
		);
	} else {
		console.error('mcp.json file not found');
	}

	// Try to create Config
	const config = new Config();
	console.error('Config created successfully');

	// Check if env property exists
	if (config.env) {
		console.error(
			`Config.env exists with keys: ${Object.keys(config.env).join(', ')}`
		);

		// Print each env var value (careful with sensitive values)
		for (const [key, value] of Object.entries(config.env)) {
			if (key.includes('KEY')) {
				console.error(`${key}: [value hidden]`);
			} else {
				console.error(`${key}: ${value}`);
			}
		}
	} else {
		console.error('Config.env does not exist');
	}
} catch (error) {
	console.error(`Error loading Config: ${error.message}`);
	console.error(`Stack trace: ${error.stack}`);
}

// Log process.env to see if values from mcp.json were loaded automatically
console.error('\nChecking if process.env already has values from mcp.json:');
const envVars = [
	'ANTHROPIC_API_KEY',
	'PERPLEXITY_API_KEY',
	'MODEL',
	'PERPLEXITY_MODEL',
	'MAX_TOKENS',
	'TEMPERATURE',
	'DEFAULT_SUBTASKS',
	'DEFAULT_PRIORITY'
];

for (const varName of envVars) {
	if (process.env[varName]) {
		if (varName.includes('KEY')) {
			console.error(`${varName}: [value hidden]`);
		} else {
			console.error(`${varName}: ${process.env[varName]}`);
		}
	} else {
		console.error(`${varName}: not set`);
	}
}

```

--------------------------------------------------------------------------------
/apps/cli/CHANGELOG.md:
--------------------------------------------------------------------------------

```markdown
# @tm/cli

## null

### Patch Changes

- [#1396](https://github.com/eyaltoledano/claude-task-master/pull/1396) [`9883e83`](https://github.com/eyaltoledano/claude-task-master/commit/9883e83b78306e55003e960ea072a11048d89ec9) Thanks [@bjcoombs](https://github.com/bjcoombs)! - Fix box title alignment by adding emoji variant selector to warning sign

- Updated dependencies []:
  - @tm/core@null

## null

### Patch Changes

- Updated dependencies []:
  - @tm/core@null

## null

### Patch Changes

- Updated dependencies []:
  - @tm/core@null

## null

### Patch Changes

- [#1305](https://github.com/eyaltoledano/claude-task-master/pull/1305) [`a98d96e`](https://github.com/eyaltoledano/claude-task-master/commit/a98d96ef0414833b948672f86da4acc11f700ebb) Thanks [@bjcoombs](https://github.com/bjcoombs)! - Fix warning message box width to match dashboard box width for consistent UI alignment

- Updated dependencies []:
  - @tm/core@null

## null

### Patch Changes

- Updated dependencies []:
  - @tm/core@null

## null

### Patch Changes

- Updated dependencies []:
  - @tm/core@null

## null

### Patch Changes

- Updated dependencies []:
  - @tm/core@null

## 0.27.0

### Patch Changes

- Updated dependencies []:
  - @tm/[email protected]

## 0.27.0-rc.0

### Minor Changes

- [#1213](https://github.com/eyaltoledano/claude-task-master/pull/1213) [`137ef36`](https://github.com/eyaltoledano/claude-task-master/commit/137ef362789a9cdfdb1925e35e0438c1fa6c69ee) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - testing this stuff out to see how the release candidate works with monorepo

## 1.1.0-rc.0

### Minor Changes

- [#1213](https://github.com/eyaltoledano/claude-task-master/pull/1213) [`cd90b4d`](https://github.com/eyaltoledano/claude-task-master/commit/cd90b4d65fc2f04bdad9fb73aba320b58a124240) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - testing this stuff out to see how the release candidate works with monorepo

```

--------------------------------------------------------------------------------
/mcp-server/src/tools/rename-tag.js:
--------------------------------------------------------------------------------

```javascript
/**
 * tools/rename-tag.js
 * Tool to rename an existing tag
 */

import { z } from 'zod';
import {
	createErrorResponse,
	handleApiResult,
	withNormalizedProjectRoot
} from './utils.js';
import { renameTagDirect } from '../core/task-master-core.js';
import { findTasksPath } from '../core/utils/path-utils.js';

/**
 * Register the renameTag tool with the MCP server
 * @param {Object} server - FastMCP server instance
 */
export function registerRenameTagTool(server) {
	server.addTool({
		name: 'rename_tag',
		description: 'Rename an existing tag',
		parameters: z.object({
			oldName: z.string().describe('Current name of the tag to rename'),
			newName: z.string().describe('New name for the tag'),
			file: z
				.string()
				.optional()
				.describe('Path to the tasks file (default: tasks/tasks.json)'),
			projectRoot: z
				.string()
				.describe('The directory of the project. Must be an absolute path.')
		}),
		execute: withNormalizedProjectRoot(async (args, { log, session }) => {
			try {
				log.info(`Starting rename-tag with args: ${JSON.stringify(args)}`);

				// Use args.projectRoot directly (guaranteed by withNormalizedProjectRoot)
				let tasksJsonPath;
				try {
					tasksJsonPath = findTasksPath(
						{ projectRoot: args.projectRoot, file: args.file },
						log
					);
				} catch (error) {
					log.error(`Error finding tasks.json: ${error.message}`);
					return createErrorResponse(
						`Failed to find tasks.json: ${error.message}`
					);
				}

				// Call the direct function
				const result = await renameTagDirect(
					{
						tasksJsonPath: tasksJsonPath,
						oldName: args.oldName,
						newName: args.newName,
						projectRoot: args.projectRoot
					},
					log,
					{ session }
				);

				return handleApiResult(
					result,
					log,
					'Error renaming tag',
					undefined,
					args.projectRoot
				);
			} catch (error) {
				log.error(`Error in rename-tag tool: ${error.message}`);
				return createErrorResponse(error.message);
			}
		})
	});
}

```

--------------------------------------------------------------------------------
/apps/extension/src/components/ui/button.tsx:
--------------------------------------------------------------------------------

```typescript
import { Slot } from '@radix-ui/react-slot';
import { type VariantProps, cva } from 'class-variance-authority';
import type * as React from 'react';

import { cn } from '../../lib/utils';

const buttonVariants = cva(
	"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
	{
		variants: {
			variant: {
				default:
					'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
				destructive:
					'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
				outline:
					'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
				secondary:
					'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
				ghost:
					'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
				link: 'text-primary underline-offset-4 hover:underline'
			},
			size: {
				default: 'h-9 px-4 py-2 has-[>svg]:px-3',
				sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
				lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
				icon: 'size-9'
			}
		},
		defaultVariants: {
			variant: 'default',
			size: 'default'
		}
	}
);

function Button({
	className,
	variant,
	size,
	asChild = false,
	...props
}: React.ComponentProps<'button'> &
	VariantProps<typeof buttonVariants> & {
		asChild?: boolean;
	}) {
	const Comp = asChild ? Slot : 'button';

	return (
		<Comp
			data-slot="button"
			className={cn(buttonVariants({ variant, size, className }))}
			{...props}
		/>
	);
}

export { Button, buttonVariants };

```

--------------------------------------------------------------------------------
/mcp-server/src/tools/list-tags.js:
--------------------------------------------------------------------------------

```javascript
/**
 * tools/list-tags.js
 * Tool to list all available tags
 */

import { z } from 'zod';
import {
	createErrorResponse,
	handleApiResult,
	withNormalizedProjectRoot
} from './utils.js';
import { listTagsDirect } from '../core/task-master-core.js';
import { findTasksPath } from '../core/utils/path-utils.js';

/**
 * Register the listTags tool with the MCP server
 * @param {Object} server - FastMCP server instance
 */
export function registerListTagsTool(server) {
	server.addTool({
		name: 'list_tags',
		description: 'List all available tags with task counts and metadata',
		parameters: z.object({
			showMetadata: z
				.boolean()
				.optional()
				.describe('Whether to include metadata in the output (default: false)'),
			file: z
				.string()
				.optional()
				.describe('Path to the tasks file (default: tasks/tasks.json)'),
			projectRoot: z
				.string()
				.describe('The directory of the project. Must be an absolute path.')
		}),
		execute: withNormalizedProjectRoot(async (args, { log, session }) => {
			try {
				log.info(`Starting list-tags with args: ${JSON.stringify(args)}`);

				// Use args.projectRoot directly (guaranteed by withNormalizedProjectRoot)
				let tasksJsonPath;
				try {
					tasksJsonPath = findTasksPath(
						{ projectRoot: args.projectRoot, file: args.file },
						log
					);
				} catch (error) {
					log.error(`Error finding tasks.json: ${error.message}`);
					return createErrorResponse(
						`Failed to find tasks.json: ${error.message}`
					);
				}

				// Call the direct function
				const result = await listTagsDirect(
					{
						tasksJsonPath: tasksJsonPath,
						showMetadata: args.showMetadata,
						projectRoot: args.projectRoot
					},
					log,
					{ session }
				);

				return handleApiResult(
					result,
					log,
					'Error listing tags',
					undefined,
					args.projectRoot
				);
			} catch (error) {
				log.error(`Error in list-tags tool: ${error.message}`);
				return createErrorResponse(error.message);
			}
		})
	});
}

```

--------------------------------------------------------------------------------
/tests/e2e/test_llm_analysis.sh:
--------------------------------------------------------------------------------

```bash
#!/bin/bash

# Script to test the LLM analysis function independently

# Exit on error
set -u
set -o pipefail

# Source the helper functions
HELPER_SCRIPT="tests/e2e/e2e_helpers.sh"
if [ -f "$HELPER_SCRIPT" ]; then
  source "$HELPER_SCRIPT"
  echo "[INFO] Sourced helper script: $HELPER_SCRIPT"
else
  echo "[ERROR] Helper script not found at $HELPER_SCRIPT. Exiting." >&2
  exit 1
fi

# --- Configuration ---
# Get the absolute path to the project root (assuming this script is run from the root)
PROJECT_ROOT="$(pwd)"

# --- Argument Parsing ---
if [ "$#" -ne 2 ]; then
  echo "Usage: $0 <path_to_log_file> <path_to_test_run_directory>" >&2
  echo "Example: $0 tests/e2e/log/e2e_run_YYYYMMDD_HHMMSS.log tests/e2e/_runs/run_YYYYMMDD_HHMMSS" >&2
  exit 1
fi

LOG_FILE_REL="$1"     # Relative path from project root
TEST_RUN_DIR_REL="$2" # Relative path from project root

# Construct absolute paths
LOG_FILE_ABS="$PROJECT_ROOT/$LOG_FILE_REL"
TEST_RUN_DIR_ABS="$PROJECT_ROOT/$TEST_RUN_DIR_REL"

# --- Validation ---
if [ ! -f "$LOG_FILE_ABS" ]; then
  echo "[ERROR] Log file not found: $LOG_FILE_ABS" >&2
  exit 1
fi

if [ ! -d "$TEST_RUN_DIR_ABS" ]; then
  echo "[ERROR] Test run directory not found: $TEST_RUN_DIR_ABS" >&2
  exit 1
fi

if [ ! -f "$TEST_RUN_DIR_ABS/.env" ]; then
  echo "[ERROR] .env file not found in test run directory: $TEST_RUN_DIR_ABS/.env" >&2
  exit 1
fi


# --- Execution ---
echo "[INFO] Changing directory to test run directory: $TEST_RUN_DIR_ABS"
cd "$TEST_RUN_DIR_ABS" || { echo "[ERROR] Failed to cd into $TEST_RUN_DIR_ABS"; exit 1; }

echo "[INFO] Current directory: $(pwd)"
echo "[INFO] Calling analyze_log_with_llm function with log file: $LOG_FILE_ABS"

# Call the function (sourced earlier)
analyze_log_with_llm "$LOG_FILE_ABS"
ANALYSIS_EXIT_CODE=$?

echo "[INFO] analyze_log_with_llm finished with exit code: $ANALYSIS_EXIT_CODE"

# Optional: cd back to original directory
# echo "[INFO] Changing back to project root: $PROJECT_ROOT"
# cd "$PROJECT_ROOT"

exit $ANALYSIS_EXIT_CODE 
```

--------------------------------------------------------------------------------
/apps/extension/src/services/polling-service.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * Polling Service - Simplified version
 * Uses strategy pattern for different polling behaviors
 */

import type { ExtensionLogger } from '../utils/logger';
import type { TaskRepository } from './task-repository';

export interface PollingStrategy {
	calculateNextInterval(
		consecutiveNoChanges: number,
		lastChangeTime?: number
	): number;
	getName(): string;
}

export class PollingService {
	private timer?: NodeJS.Timeout;
	private consecutiveNoChanges = 0;
	private lastChangeTime?: number;
	private lastTasksJson?: string;

	constructor(
		private repository: TaskRepository,
		private strategy: PollingStrategy,
		private logger: ExtensionLogger
	) {}

	start(): void {
		if (this.timer) {
			return;
		}

		this.logger.log(
			`Starting polling with ${this.strategy.getName()} strategy`
		);
		this.scheduleNextPoll();
	}

	stop(): void {
		if (this.timer) {
			clearTimeout(this.timer);
			this.timer = undefined;
			this.logger.log('Polling stopped');
		}
	}

	setStrategy(strategy: PollingStrategy): void {
		this.strategy = strategy;
		this.logger.log(`Changed to ${strategy.getName()} polling strategy`);

		// Restart with new strategy if running
		if (this.timer) {
			this.stop();
			this.start();
		}
	}

	private async poll(): Promise<void> {
		try {
			const tasks = await this.repository.getAll();
			const tasksJson = JSON.stringify(tasks);

			// Check for changes
			if (tasksJson !== this.lastTasksJson) {
				this.consecutiveNoChanges = 0;
				this.lastChangeTime = Date.now();
				this.logger.debug('Tasks changed');
			} else {
				this.consecutiveNoChanges++;
			}

			this.lastTasksJson = tasksJson;
		} catch (error) {
			this.logger.error('Polling error', error);
		}
	}

	private scheduleNextPoll(): void {
		const interval = this.strategy.calculateNextInterval(
			this.consecutiveNoChanges,
			this.lastChangeTime
		);

		this.timer = setTimeout(async () => {
			await this.poll();
			this.scheduleNextPoll();
		}, interval);

		this.logger.debug(`Next poll in ${interval}ms`);
	}
}

```

--------------------------------------------------------------------------------
/.github/workflows/claude-docs-trigger.yml:
--------------------------------------------------------------------------------

```yaml
name: Trigger Claude Documentation Update

on:
  push:
    branches:
      - next
    paths-ignore:
      - "apps/docs/**"
      - "*.md"
      - ".github/workflows/**"

jobs:
  trigger-docs-update:
    # Only run if changes were merged (not direct pushes from bots)
    if: github.actor != 'github-actions[bot]' && github.actor != 'dependabot[bot]'
    runs-on: ubuntu-latest
    permissions:
      contents: read
      actions: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 2 # Need previous commit for comparison

      - name: Get changed files
        id: changed-files
        run: |
          echo "Changed files in this push:"
          git diff --name-only HEAD^ HEAD | tee changed_files.txt

          # Store changed files for Claude to analyze (escaped for JSON)
          CHANGED_FILES=$(git diff --name-only HEAD^ HEAD | jq -Rs .)
          echo "changed_files=$CHANGED_FILES" >> $GITHUB_OUTPUT

          # Get the commit message (escaped for JSON)
          COMMIT_MSG=$(git log -1 --pretty=%B | jq -Rs .)
          echo "commit_message=$COMMIT_MSG" >> $GITHUB_OUTPUT

          # Get diff for documentation context (escaped for JSON)
          COMMIT_DIFF=$(git diff HEAD^ HEAD --stat | jq -Rs .)
          echo "commit_diff=$COMMIT_DIFF" >> $GITHUB_OUTPUT

          # Get commit SHA
          echo "commit_sha=${{ github.sha }}" >> $GITHUB_OUTPUT

      - name: Trigger Claude workflow
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          # Trigger the Claude docs updater workflow with the change information
          gh workflow run claude-docs-updater.yml \
            --ref next \
            -f commit_sha="${{ steps.changed-files.outputs.commit_sha }}" \
            -f commit_message=${{ steps.changed-files.outputs.commit_message }} \
            -f changed_files=${{ steps.changed-files.outputs.changed_files }} \
            -f commit_diff=${{ steps.changed-files.outputs.commit_diff }}
```

--------------------------------------------------------------------------------
/src/constants/paths.js:
--------------------------------------------------------------------------------

```javascript
/**
 * Path constants for Task Master application
 */

// .taskmaster directory structure paths
export const TASKMASTER_DIR = '.taskmaster';
export const TASKMASTER_TASKS_DIR = '.taskmaster/tasks';
export const TASKMASTER_DOCS_DIR = '.taskmaster/docs';
export const TASKMASTER_REPORTS_DIR = '.taskmaster/reports';
export const TASKMASTER_TEMPLATES_DIR = '.taskmaster/templates';

// Task Master configuration files
export const TASKMASTER_CONFIG_FILE = '.taskmaster/config.json';
export const TASKMASTER_STATE_FILE = '.taskmaster/state.json';
export const LEGACY_CONFIG_FILE = '.taskmasterconfig';

// Task Master report files
export const COMPLEXITY_REPORT_FILE =
	'.taskmaster/reports/task-complexity-report.json';
export const LEGACY_COMPLEXITY_REPORT_FILE =
	'scripts/task-complexity-report.json';

// Task Master PRD file paths
export const PRD_FILE = '.taskmaster/docs/prd.txt';
export const LEGACY_PRD_FILE = 'scripts/prd.txt';

// Task Master template files
export const EXAMPLE_PRD_FILE = '.taskmaster/templates/example_prd.txt';
export const LEGACY_EXAMPLE_PRD_FILE = 'scripts/example_prd.txt';

// Task Master task file paths
export const TASKMASTER_TASKS_FILE = '.taskmaster/tasks/tasks.json';
export const LEGACY_TASKS_FILE = 'tasks/tasks.json';

// General project files (not Task Master specific but commonly used)
export const ENV_EXAMPLE_FILE = '.env.example';
export const GITIGNORE_FILE = '.gitignore';

// Task file naming pattern
export const TASK_FILE_PREFIX = 'task_';
export const TASK_FILE_EXTENSION = '.txt';

/**
 * Project markers used to identify a task-master project root
 * These files/directories indicate that a directory is a Task Master project
 */
export const PROJECT_MARKERS = [
	'.taskmaster', // New taskmaster directory
	LEGACY_CONFIG_FILE, // .taskmasterconfig
	'tasks.json', // Generic tasks file
	LEGACY_TASKS_FILE, // tasks/tasks.json (legacy location)
	TASKMASTER_TASKS_FILE, // .taskmaster/tasks/tasks.json (new location)
	'.git', // Git repository
	'.svn' // SVN repository
];

```

--------------------------------------------------------------------------------
/tests/unit/profiles/windsurf-integration.test.js:
--------------------------------------------------------------------------------

```javascript
import { jest } from '@jest/globals';
import fs from 'fs';
import path from 'path';
import os from 'os';

// Mock external modules
jest.mock('child_process', () => ({
	execSync: jest.fn()
}));

// Mock console methods
jest.mock('console', () => ({
	log: jest.fn(),
	info: jest.fn(),
	warn: jest.fn(),
	error: jest.fn(),
	clear: jest.fn()
}));

describe('Windsurf Integration', () => {
	let tempDir;

	beforeEach(() => {
		jest.clearAllMocks();

		// Create a temporary directory for testing
		tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'task-master-test-'));

		// Spy on fs methods
		jest.spyOn(fs, 'writeFileSync').mockImplementation(() => {});
		jest.spyOn(fs, 'readFileSync').mockImplementation((filePath) => {
			if (filePath.toString().includes('mcp.json')) {
				return JSON.stringify({ mcpServers: {} }, null, 2);
			}
			return '{}';
		});
		jest.spyOn(fs, 'existsSync').mockImplementation(() => false);
		jest.spyOn(fs, 'mkdirSync').mockImplementation(() => {});
	});

	afterEach(() => {
		// Clean up the temporary directory
		try {
			fs.rmSync(tempDir, { recursive: true, force: true });
		} catch (err) {
			console.error(`Error cleaning up: ${err.message}`);
		}
	});

	// Test function that simulates the createProjectStructure behavior for Windsurf files
	function mockCreateWindsurfStructure() {
		// Create main .windsurf directory
		fs.mkdirSync(path.join(tempDir, '.windsurf'), { recursive: true });

		// Create rules directory
		fs.mkdirSync(path.join(tempDir, '.windsurf', 'rules'), { recursive: true });

		// Create MCP config file
		fs.writeFileSync(
			path.join(tempDir, '.windsurf', 'mcp.json'),
			JSON.stringify({ mcpServers: {} }, null, 2)
		);
	}

	test('creates all required .windsurf directories', () => {
		// Act
		mockCreateWindsurfStructure();

		// Assert
		expect(fs.mkdirSync).toHaveBeenCalledWith(path.join(tempDir, '.windsurf'), {
			recursive: true
		});
		expect(fs.mkdirSync).toHaveBeenCalledWith(
			path.join(tempDir, '.windsurf', 'rules'),
			{ recursive: true }
		);
	});
});

```

--------------------------------------------------------------------------------
/apps/docs/docs.json:
--------------------------------------------------------------------------------

```json
{
	"$schema": "https://mintlify.com/docs.json",
	"theme": "mint",
	"name": "Task Master",
	"colors": {
		"primary": "#3366CC",
		"light": "#6699FF",
		"dark": "#24478F"
	},
	"favicon": "/favicon.svg",
	"navigation": {
		"tabs": [
			{
				"tab": "Task Master Documentation",
				"groups": [
					{
						"group": "Welcome",
						"pages": ["introduction"]
					},
					{
						"group": "Getting Started",
						"pages": [
							{
								"group": "Quick Start",
								"pages": [
									"getting-started/quick-start/quick-start",
									"getting-started/quick-start/requirements",
									"getting-started/quick-start/installation",
									"getting-started/quick-start/configuration-quick",
									"getting-started/quick-start/prd-quick",
									"getting-started/quick-start/tasks-quick",
									"getting-started/quick-start/execute-quick"
								]
							},
							"getting-started/api-keys",
							"getting-started/faq",
							"getting-started/contribute"
						]
					},
					{
						"group": "Best Practices",
						"pages": [
							"best-practices/index",
							"best-practices/configuration-advanced",
							"best-practices/advanced-tasks"
						]
					},
					{
						"group": "Technical Capabilities",
						"pages": [
							"capabilities/mcp",
							"capabilities/cli-root-commands",
							"capabilities/task-structure"
						]
					},
					{
						"group": "TDD Workflow (Autopilot)",
						"pages": [
							"tdd-workflow/quickstart",
							"tdd-workflow/ai-agent-integration"
						]
					}
				]
			}
		],
		"global": {
			"anchors": [
				{
					"anchor": "Github",
					"href": "https://github.com/eyaltoledano/claude-task-master",
					"icon": "github"
				},
				{
					"anchor": "Discord",
					"href": "https://discord.gg/fWJkU7rf",
					"icon": "discord"
				}
			]
		}
	},
	"logo": {
		"light": "/logo/task-master-logo.png",
		"dark": "/logo/task-master-logo.png"
	},
	"footer": {
		"socials": {
			"x": "https://x.com/TaskmasterAI",
			"github": "https://github.com/eyaltoledano/claude-task-master"
		}
	}
}

```

--------------------------------------------------------------------------------
/scripts/modules/task-manager/response-language.js:
--------------------------------------------------------------------------------

```javascript
import {
	getConfig,
	isConfigFilePresent,
	writeConfig
} from '../config-manager.js';
import { findConfigPath } from '../../../src/utils/path-utils.js';
import { log } from '../utils.js';

function setResponseLanguage(lang, options = {}) {
	const { mcpLog, projectRoot } = options;

	const report = (level, ...args) => {
		if (mcpLog && typeof mcpLog[level] === 'function') {
			mcpLog[level](...args);
		}
	};

	// Use centralized config path finding instead of hardcoded path
	const configPath = findConfigPath(null, { projectRoot });
	const configExists = isConfigFilePresent(projectRoot);

	log(
		'debug',
		`Checking for config file using findConfigPath, found: ${configPath}`
	);
	log(
		'debug',
		`Checking config file using isConfigFilePresent(), exists: ${configExists}`
	);

	if (!configExists) {
		return {
			success: false,
			error: {
				code: 'CONFIG_MISSING',
				message:
					'The configuration file is missing. Run "task-master init" to create it.'
			}
		};
	}

	// Validate response language
	if (typeof lang !== 'string' || lang.trim() === '') {
		return {
			success: false,
			error: {
				code: 'INVALID_RESPONSE_LANGUAGE',
				message: `Invalid response language: ${lang}. Must be a non-empty string.`
			}
		};
	}

	try {
		const currentConfig = getConfig(projectRoot);
		currentConfig.global.responseLanguage = lang;
		const writeResult = writeConfig(currentConfig, projectRoot);

		if (!writeResult) {
			return {
				success: false,
				error: {
					code: 'WRITE_ERROR',
					message: 'Error writing updated configuration to configuration file'
				}
			};
		}

		const successMessage = `Successfully set response language to: ${lang}`;
		report('info', successMessage);
		return {
			success: true,
			data: {
				responseLanguage: lang,
				message: successMessage
			}
		};
	} catch (error) {
		report('error', `Error setting response language: ${error.message}`);
		return {
			success: false,
			error: {
				code: 'SET_RESPONSE_LANGUAGE_ERROR',
				message: error.message
			}
		};
	}
}

export default setResponseLanguage;

```

--------------------------------------------------------------------------------
/tests/unit/ai-providers/zai-schema-introspection.test.js:
--------------------------------------------------------------------------------

```javascript
import { describe, it, expect } from '@jest/globals';
import { z } from 'zod';
import { ZAIProvider } from '../../../src/ai-providers/zai.js';

describe('ZAIProvider - Schema Introspection', () => {
	const provider = new ZAIProvider();

	it('should find array property in schema with single array', () => {
		const schema = z.object({
			subtasks: z.array(z.string()),
			metadata: z.object({ count: z.number() }).nullable()
		});

		const result = provider.findArrayPropertyInSchema(schema);
		expect(result).toBe('subtasks');
	});

	it('should find first array property when multiple arrays exist', () => {
		const schema = z.object({
			tasks: z.array(z.string()),
			items: z.array(z.number())
		});

		const result = provider.findArrayPropertyInSchema(schema);
		expect(result).toBe('tasks');
	});

	it('should handle schema with no arrays', () => {
		const schema = z.object({
			name: z.string(),
			count: z.number()
		});

		const result = provider.findArrayPropertyInSchema(schema);
		expect(result).toBeNull();
	});

	it('should handle non-object schemas gracefully', () => {
		const schema = z.array(z.string());

		const result = provider.findArrayPropertyInSchema(schema);
		expect(result).toBeNull();
	});

	it('should find complexityAnalysis array property', () => {
		const schema = z.object({
			complexityAnalysis: z.array(
				z.object({
					taskId: z.number(),
					score: z.number()
				})
			),
			metadata: z
				.union([z.object({ total: z.number() }), z.null()])
				.default(null)
		});

		const result = provider.findArrayPropertyInSchema(schema);
		expect(result).toBe('complexityAnalysis');
	});

	it('should work with actual PRD response schema', () => {
		const schema = z.object({
			tasks: z.array(
				z.object({
					id: z.number(),
					title: z.string()
				})
			),
			metadata: z
				.union([
					z.object({
						projectName: z.string(),
						totalTasks: z.number()
					}),
					z.null()
				])
				.default(null)
		});

		const result = provider.findArrayPropertyInSchema(schema);
		expect(result).toBe('tasks');
	});
});

```

--------------------------------------------------------------------------------
/packages/tm-core/src/modules/execution/executors/base-executor.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * Base executor class providing common functionality for all executors
 */

import { getLogger } from '../../../common/logger/index.js';
import type { Task } from '../../../common/types/index.js';
import type { ExecutionResult, ExecutorType, ITaskExecutor } from '../types.js';

export abstract class BaseExecutor implements ITaskExecutor {
	protected readonly logger = getLogger('BaseExecutor');
	protected readonly projectRoot: string;
	protected readonly config: Record<string, any>;

	constructor(projectRoot: string, config: Record<string, any> = {}) {
		this.projectRoot = projectRoot;
		this.config = config;
	}

	abstract execute(task: Task): Promise<ExecutionResult>;
	abstract getType(): ExecutorType;
	abstract isAvailable(): Promise<boolean>;

	/**
	 * Format task details into a readable prompt
	 */
	protected formatTaskPrompt(task: Task): string {
		const sections: string[] = [];

		sections.push(`Task ID: ${task.id}`);
		sections.push(`Title: ${task.title}`);

		if (task.description) {
			sections.push(`\nDescription:\n${task.description}`);
		}

		if (task.details) {
			sections.push(`\nImplementation Details:\n${task.details}`);
		}

		if (task.testStrategy) {
			sections.push(`\nTest Strategy:\n${task.testStrategy}`);
		}

		if (task.dependencies && task.dependencies.length > 0) {
			sections.push(`\nDependencies: ${task.dependencies.join(', ')}`);
		}

		if (task.subtasks && task.subtasks.length > 0) {
			const subtaskList = task.subtasks
				.map((st) => `  - [${st.status}] ${st.id}: ${st.title}`)
				.join('\n');
			sections.push(`\nSubtasks:\n${subtaskList}`);
		}

		sections.push(`\nStatus: ${task.status}`);
		sections.push(`Priority: ${task.priority}`);

		return sections.join('\n');
	}

	/**
	 * Create base execution result
	 */
	protected createResult(
		taskId: string,
		success: boolean,
		output?: string,
		error?: string
	): ExecutionResult {
		return {
			success,
			taskId,
			executorType: this.getType(),
			output,
			error,
			startTime: new Date().toISOString(),
			endTime: new Date().toISOString()
		};
	}
}

```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/show-task.md:
--------------------------------------------------------------------------------

```markdown
Show detailed task information with rich context and insights.

Arguments: $ARGUMENTS

## Enhanced Task Display

Parse arguments to determine what to show and how.

### 1. **Smart Task Selection**

Based on $ARGUMENTS:
- Number → Show specific task with full context
- "current" → Show active in-progress task(s)
- "next" → Show recommended next task
- "blocked" → Show all blocked tasks with reasons
- "critical" → Show critical path tasks
- Multiple IDs → Comparative view

### 2. **Contextual Information**

For each task, intelligently include:

**Core Details**
- Full task information (id, title, description, details)
- Current status with history
- Test strategy and acceptance criteria
- Priority and complexity analysis

**Relationships**
- Dependencies (what it needs)
- Dependents (what needs it)
- Parent/subtask hierarchy
- Related tasks (similar work)

**Time Intelligence**
- Created/updated timestamps
- Time in current status
- Estimated vs actual time
- Historical completion patterns

### 3. **Visual Enhancements**

```
📋 Task #45: Implement User Authentication
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Status: 🟡 in-progress (2 hours)
Priority: 🔴 High | Complexity: 73/100

Dependencies: ✅ #41, ✅ #42, ⏳ #43 (blocked)
Blocks: #46, #47, #52

Progress: ████████░░ 80% complete

Recent Activity:
- 2h ago: Status changed to in-progress
- 4h ago: Dependency #42 completed
- Yesterday: Task expanded with 3 subtasks
```

### 4. **Intelligent Insights**

Based on task analysis:
- **Risk Assessment**: Complexity vs time remaining
- **Bottleneck Analysis**: Is this blocking critical work?
- **Recommendation**: Suggested approach or concerns
- **Similar Tasks**: How others completed similar work

### 5. **Action Suggestions**

Context-aware next steps:
- If blocked → Show how to unblock
- If complex → Suggest expansion
- If in-progress → Show completion checklist
- If done → Show dependent tasks ready to start

### 6. **Multi-Task View**

When showing multiple tasks:
- Common dependencies
- Optimal completion order
- Parallel work opportunities
- Combined complexity analysis
```

--------------------------------------------------------------------------------
/tests/unit/ai-providers/zai.test.js:
--------------------------------------------------------------------------------

```javascript
/**
 * Tests for ZAIProvider
 */

import { ZAIProvider } from '../../../src/ai-providers/zai.js';

describe('ZAIProvider', () => {
	let provider;

	beforeEach(() => {
		provider = new ZAIProvider();
	});

	describe('constructor', () => {
		it('should initialize with correct name', () => {
			expect(provider.name).toBe('Z.ai');
		});

		it('should initialize with correct default baseURL', () => {
			expect(provider.defaultBaseURL).toBe('https://api.z.ai/api/paas/v4/');
		});

		it('should inherit from OpenAICompatibleProvider', () => {
			expect(provider).toHaveProperty('generateText');
			expect(provider).toHaveProperty('streamText');
			expect(provider).toHaveProperty('generateObject');
		});
	});

	describe('getRequiredApiKeyName', () => {
		it('should return correct environment variable name', () => {
			expect(provider.getRequiredApiKeyName()).toBe('ZAI_API_KEY');
		});
	});

	describe('isRequiredApiKey', () => {
		it('should return true as API key is required', () => {
			expect(provider.isRequiredApiKey()).toBe(true);
		});
	});

	describe('getClient', () => {
		it('should create client with API key', () => {
			const params = { apiKey: 'test-key' };
			const client = provider.getClient(params);
			expect(client).toBeDefined();
		});

		it('should create client with custom baseURL', () => {
			const params = {
				apiKey: 'test-key',
				baseURL: 'https://custom.api.com/v1'
			};
			const client = provider.getClient(params);
			expect(client).toBeDefined();
		});

		it('should create client even without API key (validation deferred to SDK)', () => {
			// getClient() no longer validates API key - validation is deferred to SDK initialization
			const client = provider.getClient({});
			expect(typeof client).toBe('function');
		});
	});

	describe('validateAuth', () => {
		it('should validate API key is present', () => {
			expect(() => {
				provider.validateAuth({});
			}).toThrow('Z.ai API key is required');
		});

		it('should pass with valid API key', () => {
			expect(() => {
				provider.validateAuth({ apiKey: 'test-key' });
			}).not.toThrow();
		});
	});
});

```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/sync-readme.md:
--------------------------------------------------------------------------------

```markdown
Export tasks to README.md with professional formatting.

Arguments: $ARGUMENTS

Generate a well-formatted README with current task information.

## README Synchronization

Creates or updates README.md with beautifully formatted task information.

## Argument Parsing

Optional filters:
- "pending" → Only pending tasks
- "with-subtasks" → Include subtask details
- "by-priority" → Group by priority
- "sprint" → Current sprint only

## Execution

```bash
task-master sync-readme [--with-subtasks] [--status=<status>]
```

## README Generation

### 1. **Project Header**
```markdown
# Project Name

## 📋 Task Progress

Last Updated: 2024-01-15 10:30 AM

### Summary
- Total Tasks: 45
- Completed: 15 (33%)
- In Progress: 5 (11%)
- Pending: 25 (56%)
```

### 2. **Task Sections**
Organized by status or priority:
- Progress indicators
- Task descriptions
- Dependencies noted
- Time estimates

### 3. **Visual Elements**
- Progress bars
- Status badges
- Priority indicators
- Completion checkmarks

## Smart Features

1. **Intelligent Grouping**
   - By feature area
   - By sprint/milestone
   - By assigned developer
   - By priority

2. **Progress Tracking**
   - Overall completion
   - Sprint velocity
   - Burndown indication
   - Time tracking

3. **Formatting Options**
   - GitHub-flavored markdown
   - Task checkboxes
   - Collapsible sections
   - Table format available

## Example Output

```markdown
## 🚀 Current Sprint

### In Progress
- [ ] 🔄 #5 **Implement user authentication** (60% complete)
  - Dependencies: API design (#3 ✅)
  - Subtasks: 4 (2 completed)
  - Est: 8h / Spent: 5h

### Pending (High Priority)
- [ ] ⚡ #8 **Create dashboard UI**
  - Blocked by: #5
  - Complexity: High
  - Est: 12h
```

## Customization

Based on arguments:
- Include/exclude sections
- Detail level control
- Custom grouping
- Filter by criteria

## Post-Sync

After generation:
1. Show diff preview
2. Backup existing README
3. Write new content
4. Commit reminder
5. Update timestamp

## Integration

Works well with:
- Git workflows
- CI/CD pipelines
- Project documentation
- Team updates
- Client reports
```

--------------------------------------------------------------------------------
/mcp-server/src/providers/mcp-provider.js:
--------------------------------------------------------------------------------

```javascript
/**
 * mcp-server/src/providers/mcp-provider.js
 *
 * Implementation for MCP custom AI SDK provider that integrates with
 * the existing MCP server infrastructure and provider registry.
 * Follows the Claude Code provider pattern for session-based providers.
 */

import { createMCP } from '../custom-sdk/index.js';
import { BaseAIProvider } from '../../../src/ai-providers/base-provider.js';

export class MCPProvider extends BaseAIProvider {
	constructor() {
		super();
		this.name = 'mcp';
		this.session = null; // MCP server session object
	}

	getRequiredApiKeyName() {
		return 'MCP_API_KEY';
	}

	isRequiredApiKey() {
		return false;
	}

	/**
	 * Override validateAuth to validate MCP session instead of API key
	 * @param {object} params - Parameters to validate
	 */
	validateAuth(params) {
		// Validate MCP session instead of API key
		if (!this.session) {
			throw new Error('MCP Provider requires active MCP session');
		}

		if (!this.session.clientCapabilities?.sampling) {
			throw new Error('MCP session must have client sampling capabilities');
		}
	}

	/**
	 * Creates and returns an MCP AI SDK client instance.
	 * @param {object} params - Parameters for client initialization
	 * @returns {Function} MCP AI SDK client function
	 * @throws {Error} If initialization fails
	 */
	getClient(params) {
		try {
			// Pass MCP session to AI SDK implementation
			return createMCP({
				session: this.session,
				defaultSettings: {
					temperature: params.temperature,
					maxTokens: params.maxTokens
				}
			});
		} catch (error) {
			this.handleError('client initialization', error);
		}
	}

	/**
	 * Method called by MCP server on connect events
	 * @param {object} session - MCP session object
	 */
	setSession(session) {
		this.session = session;

		if (!session) {
			this.logger?.warn('Set null session on MCP Provider');
		} else {
			this.logger?.debug('Updated MCP Provider session');
		}
	}

	/**
	 * Get current session status
	 * @returns {boolean} True if session is available and valid
	 */
	hasValidSession() {
		return !!(this.session && this.session.clientCapabilities?.sampling);
	}
}

```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/auto-implement-tasks.md:
--------------------------------------------------------------------------------

```markdown
Enhanced auto-implementation with intelligent code generation and testing.

Arguments: $ARGUMENTS

## Intelligent Auto-Implementation

Advanced implementation with context awareness and quality checks.

### 1. **Pre-Implementation Analysis**

Before starting:
- Analyze task complexity and requirements
- Check codebase patterns and conventions
- Identify similar completed tasks
- Assess test coverage needs
- Detect potential risks

### 2. **Smart Implementation Strategy**

Based on task type and context:

**Feature Tasks**
1. Research existing patterns
2. Design component architecture
3. Implement with tests
4. Integrate with system
5. Update documentation

**Bug Fix Tasks**
1. Reproduce issue
2. Identify root cause
3. Implement minimal fix
4. Add regression tests
5. Verify side effects

**Refactoring Tasks**
1. Analyze current structure
2. Plan incremental changes
3. Maintain test coverage
4. Refactor step-by-step
5. Verify behavior unchanged

### 3. **Code Intelligence**

**Pattern Recognition**
- Learn from existing code
- Follow team conventions
- Use preferred libraries
- Match style guidelines

**Test-Driven Approach**
- Write tests first when possible
- Ensure comprehensive coverage
- Include edge cases
- Performance considerations

### 4. **Progressive Implementation**

Step-by-step with validation:
```
Step 1/5: Setting up component structure ✓
Step 2/5: Implementing core logic ✓
Step 3/5: Adding error handling ⚡ (in progress)
Step 4/5: Writing tests ⏳
Step 5/5: Integration testing ⏳

Current: Adding try-catch blocks and validation...
```

### 5. **Quality Assurance**

Automated checks:
- Linting and formatting
- Test execution
- Type checking
- Dependency validation
- Performance analysis

### 6. **Smart Recovery**

If issues arise:
- Diagnostic analysis
- Suggestion generation
- Fallback strategies
- Manual intervention points
- Learning from failures

### 7. **Post-Implementation**

After completion:
- Generate PR description
- Update documentation
- Log lessons learned
- Suggest follow-up tasks
- Update task relationships

Result: High-quality, production-ready implementations.
```

--------------------------------------------------------------------------------
/tests/integration/profiles/trae-init-functionality.test.js:
--------------------------------------------------------------------------------

```javascript
import fs from 'fs';
import path from 'path';
import { traeProfile } from '../../../src/profiles/trae.js';

describe('Trae Profile Initialization Functionality', () => {
	let traeProfileContent;

	beforeAll(() => {
		const traeJsPath = path.join(process.cwd(), 'src', 'profiles', 'trae.js');
		traeProfileContent = fs.readFileSync(traeJsPath, 'utf8');
	});

	test('trae.js uses factory pattern with correct configuration', () => {
		// Check for explicit, non-default values in the source file
		expect(traeProfileContent).toContain("name: 'trae'");
		expect(traeProfileContent).toContain("displayName: 'Trae'");
		expect(traeProfileContent).toContain("url: 'trae.ai'");
		expect(traeProfileContent).toContain("docsUrl: 'docs.trae.ai'");
		expect(traeProfileContent).toContain('mcpConfig: false');

		// Check the final computed properties on the profile object
		expect(traeProfile.profileName).toBe('trae');
		expect(traeProfile.displayName).toBe('Trae');
		expect(traeProfile.profileDir).toBe('.trae'); // default
		expect(traeProfile.rulesDir).toBe('.trae/rules'); // default
		expect(traeProfile.mcpConfig).toBe(false); // non-default
		expect(traeProfile.mcpConfigName).toBe(null); // computed from mcpConfig
	});

	test('trae.js configures .mdc to .md extension mapping', () => {
		// Check that the profile object has the correct file mapping behavior (trae converts to .md)
		expect(traeProfile.fileMap['rules/cursor_rules.mdc']).toBe('trae_rules.md');
	});

	test('trae.js uses standard tool mappings', () => {
		// Check that the profile uses default tool mappings (equivalent to COMMON_TOOL_MAPPINGS.STANDARD)
		// This verifies the architectural pattern: no custom toolMappings = standard tool names
		expect(traeProfileContent).not.toContain('toolMappings:');
		expect(traeProfileContent).not.toContain('apply_diff');
		expect(traeProfileContent).not.toContain('search_files');

		// Verify the result: default mappings means tools keep their original names
		expect(traeProfile.conversionConfig.toolNames.edit_file).toBe('edit_file');
		expect(traeProfile.conversionConfig.toolNames.search).toBe('search');
	});
});

```

--------------------------------------------------------------------------------
/packages/tm-core/src/modules/git/services/branch-name-generator.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * Branch Name Generator - Generates valid git branch names from patterns
 * @module branch-name-generator
 */

/**
 * Sanitizes a string to be a valid git branch name.
 * Removes invalid characters, converts to lowercase, replaces spaces with hyphens.
 *
 * @param {string} name - Name to sanitize
 * @returns {string} Sanitized branch name
 */
export function sanitizeBranchName(name: string): string {
	if (!name || name.trim() === '') {
		return 'branch';
	}

	return name
		.toLowerCase()
		.replace(/[^a-z0-9-_.\/]/g, '-') // Replace invalid chars with hyphens
		.replace(/\//g, '-') // Replace slashes with hyphens
		.replace(/-+/g, '-') // Remove consecutive hyphens
		.replace(/^-+|-+$/g, ''); // Remove leading/trailing hyphens
}

/**
 * Generates a branch name from a pattern and variables.
 *
 * @param {Object} options - Generation options
 * @param {string} options.taskId - Task ID to include
 * @param {string} [options.description] - Description to include
 * @param {string} [options.pattern] - Custom pattern (default: 'task-{taskId}-{description}')
 * @param {number} [options.maxLength=50] - Maximum branch name length
 * @returns {string} Generated branch name
 */
export function generateBranchName(options: {
	taskId: string;
	description?: string;
	pattern?: string;
	maxLength?: number;
}): string {
	const maxLength = options.maxLength || 50;
	const pattern = options.pattern || 'task-{taskId}-{description}';

	// Sanitize task ID (replace dots with hyphens)
	const sanitizedTaskId = sanitizeBranchName(
		options.taskId.replace(/\./g, '-')
	);

	// Sanitize description if provided
	const sanitizedDescription = options.description
		? sanitizeBranchName(options.description)
		: sanitizeBranchName(Date.now().toString());

	// Replace pattern variables
	let branchName = pattern
		.replace(/{taskId}/g, sanitizedTaskId)
		.replace(/{description}/g, sanitizedDescription);

	// Sanitize the final result
	branchName = sanitizeBranchName(branchName);

	// Truncate if too long
	if (branchName.length > maxLength) {
		branchName = branchName.substring(0, maxLength).replace(/-+$/, '');
	}

	return branchName;
}

```

--------------------------------------------------------------------------------
/.kiro/steering/taskmaster_hooks_workflow.md:
--------------------------------------------------------------------------------

```markdown
---
inclusion: always
---

# Taskmaster Hook-Driven Workflow

## Core Principle: Hooks Automate Task Management

When working with Taskmaster in Kiro, **avoid manually marking tasks as done**. The hook system automatically handles task completion based on:

- **Test Success**: `[TM] Test Success Task Completer` detects passing tests and prompts for task completion
- **Code Changes**: `[TM] Code Change Task Tracker` monitors implementation progress
- **Dependency Chains**: `[TM] Task Dependency Auto-Progression` auto-starts dependent tasks

## AI Assistant Workflow

Follow this pattern when implementing features:

1. **Implement First**: Write code, create tests, make changes
2. **Save Frequently**: Hooks trigger on file saves to track progress automatically
3. **Let Hooks Decide**: Allow hooks to detect completion rather than manually setting status
4. **Respond to Prompts**: Confirm when hooks suggest task completion

## Key Rules for AI Assistants

- **Never use `tm set-status --status=done`** unless hooks fail to detect completion
- **Always write tests** - they provide the most reliable completion signal
- **Save files after implementation** - this triggers progress tracking
- **Trust hook suggestions** - if no completion prompt appears, more work may be needed

## Automatic Behaviors

The hook system provides:

- **Progress Logging**: Implementation details automatically added to task notes
- **Evidence-Based Completion**: Tasks marked done only when criteria are met
- **Dependency Management**: Next tasks auto-started when dependencies complete
- **Natural Flow**: Focus on coding, not task management overhead

## Manual Override Cases

Only manually set task status for:

- Documentation-only tasks
- Tasks without testable outcomes
- Emergency fixes without proper test coverage

Use `tm set-status` sparingly - prefer hook-driven completion.

## Implementation Pattern

```
1. Implement feature → Save file
2. Write tests → Save test file
3. Tests pass → Hook prompts completion
4. Confirm completion → Next task auto-starts
```

This workflow ensures proper task tracking while maintaining development flow.
```

--------------------------------------------------------------------------------
/apps/cli/src/ui/display/messages.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * @fileoverview Display message utilities
 * Provides formatted message boxes for errors, success, warnings, info, and banners
 */

import boxen from 'boxen';
import chalk from 'chalk';
import { getBoxWidth } from '../layout/helpers.js';

/**
 * Display a fancy banner
 */
export function displayBanner(title: string = 'Task Master'): void {
	console.log(
		boxen(chalk.white.bold(title), {
			padding: 1,
			margin: { top: 1, bottom: 1 },
			borderStyle: 'round',
			borderColor: 'blue',
			textAlignment: 'center'
		})
	);
}

/**
 * Display an error message in a boxed format (matches scripts/modules/ui.js style)
 * Note: For general CLI error handling, use displayError from utils/error-handler.ts
 * This function is for displaying formatted error messages as part of UI output.
 */
export function displayErrorBox(message: string, details?: string): void {
	const boxWidth = getBoxWidth();

	console.error(
		boxen(
			chalk.red.bold('X Error: ') +
				chalk.white(message) +
				(details ? '\n\n' + chalk.gray(details) : ''),
			{
				padding: 1,
				borderStyle: 'round',
				borderColor: 'red',
				width: boxWidth
			}
		)
	);
}

/**
 * Alias for displayErrorBox
 */
export const displayError = displayErrorBox;

/**
 * Display a success message
 */
export function displaySuccess(message: string): void {
	const boxWidth = getBoxWidth();

	console.log(
		boxen(
			chalk.green.bold(String.fromCharCode(8730) + ' ') + chalk.white(message),
			{
				padding: 1,
				borderStyle: 'round',
				borderColor: 'green',
				width: boxWidth
			}
		)
	);
}

/**
 * Display a warning message
 */
export function displayWarning(message: string): void {
	const boxWidth = getBoxWidth();

	console.log(
		boxen(chalk.yellow.bold('⚠️ ') + chalk.white(message), {
			padding: 1,
			borderStyle: 'round',
			borderColor: 'yellow',
			width: boxWidth
		})
	);
}

/**
 * Display info message
 */
export function displayInfo(message: string): void {
	const boxWidth = getBoxWidth();

	console.log(
		boxen(chalk.blue.bold('i ') + chalk.white(message), {
			padding: 1,
			borderStyle: 'round',
			borderColor: 'blue',
			width: boxWidth
		})
	);
}

```

--------------------------------------------------------------------------------
/mcp-server/src/tools/delete-tag.js:
--------------------------------------------------------------------------------

```javascript
/**
 * tools/delete-tag.js
 * Tool to delete an existing tag
 */

import { z } from 'zod';
import {
	createErrorResponse,
	handleApiResult,
	withNormalizedProjectRoot
} from './utils.js';
import { deleteTagDirect } from '../core/task-master-core.js';
import { findTasksPath } from '../core/utils/path-utils.js';

/**
 * Register the deleteTag tool with the MCP server
 * @param {Object} server - FastMCP server instance
 */
export function registerDeleteTagTool(server) {
	server.addTool({
		name: 'delete_tag',
		description: 'Delete an existing tag and all its tasks',
		parameters: z.object({
			name: z.string().describe('Name of the tag to delete'),
			yes: z
				.boolean()
				.optional()
				.describe('Skip confirmation prompts (default: true for MCP)'),
			file: z
				.string()
				.optional()
				.describe('Path to the tasks file (default: tasks/tasks.json)'),
			projectRoot: z
				.string()
				.describe('The directory of the project. Must be an absolute path.')
		}),
		execute: withNormalizedProjectRoot(async (args, { log, session }) => {
			try {
				log.info(`Starting delete-tag with args: ${JSON.stringify(args)}`);

				// Use args.projectRoot directly (guaranteed by withNormalizedProjectRoot)
				let tasksJsonPath;
				try {
					tasksJsonPath = findTasksPath(
						{ projectRoot: args.projectRoot, file: args.file },
						log
					);
				} catch (error) {
					log.error(`Error finding tasks.json: ${error.message}`);
					return createErrorResponse(
						`Failed to find tasks.json: ${error.message}`
					);
				}

				// Call the direct function (always skip confirmation for MCP)
				const result = await deleteTagDirect(
					{
						tasksJsonPath: tasksJsonPath,
						name: args.name,
						yes: args.yes !== undefined ? args.yes : true, // Default to true for MCP
						projectRoot: args.projectRoot
					},
					log,
					{ session }
				);

				return handleApiResult(
					result,
					log,
					'Error deleting tag',
					undefined,
					args.projectRoot
				);
			} catch (error) {
				log.error(`Error in delete-tag tool: ${error.message}`);
				return createErrorResponse(error.message);
			}
		})
	});
}

```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/analyze-project.md:
--------------------------------------------------------------------------------

```markdown
Advanced project analysis with actionable insights and recommendations.

Arguments: $ARGUMENTS

## Comprehensive Project Analysis

Multi-dimensional analysis based on requested focus area.

### 1. **Analysis Modes**

Based on $ARGUMENTS:
- "velocity" → Sprint velocity and trends
- "quality" → Code quality metrics
- "risk" → Risk assessment and mitigation
- "dependencies" → Dependency graph analysis
- "team" → Workload and skill distribution
- "architecture" → System design coherence
- Default → Full spectrum analysis

### 2. **Velocity Analytics**

```
📊 Velocity Analysis
━━━━━━━━━━━━━━━━━━━
Current Sprint: 24 points/week ↗️ +20%
Rolling Average: 20 points/week
Efficiency: 85% (17/20 tasks on time)

Bottlenecks Detected:
- Code review delays (avg 4h wait)
- Test environment availability
- Dependency on external team

Recommendations:
1. Implement parallel review process
2. Add staging environment
3. Mock external dependencies
```

### 3. **Risk Assessment**

**Technical Risks**
- High complexity tasks without backup assignee
- Single points of failure in architecture
- Insufficient test coverage in critical paths
- Technical debt accumulation rate

**Project Risks**
- Critical path dependencies
- Resource availability gaps
- Deadline feasibility analysis
- Scope creep indicators

### 4. **Dependency Intelligence**

Visual dependency analysis:
```
Critical Path: 
#12 → #15 → #23 → #45 → #50 (20 days)
         ↘ #24 → #46 ↗

Optimization: Parallelize #15 and #24
Time Saved: 3 days
```

### 5. **Quality Metrics**

**Code Quality**
- Test coverage trends
- Complexity scores
- Technical debt ratio
- Review feedback patterns

**Process Quality**
- Rework frequency
- Bug introduction rate
- Time to resolution
- Knowledge distribution

### 6. **Predictive Insights**

Based on patterns:
- Completion probability by deadline
- Resource needs projection
- Risk materialization likelihood
- Suggested interventions

### 7. **Executive Dashboard**

High-level summary with:
- Health score (0-100)
- Top 3 risks
- Top 3 opportunities
- Recommended actions
- Success probability

Result: Data-driven decisions with clear action paths.
```

--------------------------------------------------------------------------------
/apps/cli/src/commands/autopilot/index.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * @fileoverview Autopilot CLI Commands for AI Agent Orchestration
 * Provides subcommands for starting, resuming, and advancing the TDD workflow
 * with JSON output for machine parsing.
 */

import { Command } from 'commander';
import { AbortCommand } from './abort.command.js';
import { CommitCommand } from './commit.command.js';
import { CompleteCommand } from './complete.command.js';
import { NextCommand } from './next.command.js';
import { ResumeCommand } from './resume.command.js';
import { StartCommand } from './start.command.js';
import { StatusCommand } from './status.command.js';

/**
 * Shared command options for all autopilot commands
 */
export interface AutopilotBaseOptions {
	json?: boolean;
	verbose?: boolean;
	projectRoot?: string;
}

/**
 * AutopilotCommand with subcommands for TDD workflow orchestration
 */
export class AutopilotCommand extends Command {
	constructor() {
		super('autopilot');

		// Configure main command
		this.description('AI agent orchestration for TDD workflow execution')
			.alias('ap')
			// Global options for all subcommands
			.option('--json', 'Output in JSON format for machine parsing')
			.option('-v, --verbose', 'Enable verbose output')
			.option(
				'-p, --project-root <path>',
				'Project root directory (auto-detected if not specified)'
			);

		// Register subcommands
		this.registerSubcommands();
	}

	/**
	 * Register all autopilot subcommands
	 */
	private registerSubcommands(): void {
		// Start new TDD workflow
		this.addCommand(new StartCommand());

		// Resume existing workflow
		this.addCommand(new ResumeCommand());

		// Get next action
		this.addCommand(new NextCommand());

		// Complete current phase
		this.addCommand(new CompleteCommand());

		// Create commit
		this.addCommand(new CommitCommand());

		// Show status
		this.addCommand(new StatusCommand());

		// Abort workflow
		this.addCommand(new AbortCommand());
	}

	/**
	 * Register this command on an existing program
	 */
	static register(program: Command): AutopilotCommand {
		const autopilotCommand = new AutopilotCommand();
		program.addCommand(autopilotCommand);
		return autopilotCommand;
	}
}

```

--------------------------------------------------------------------------------
/mcp-server/src/core/direct-functions/validate-dependencies.js:
--------------------------------------------------------------------------------

```javascript
/**
 * Direct function wrapper for validateDependenciesCommand
 */

import { validateDependenciesCommand } from '../../../../scripts/modules/dependency-manager.js';
import {
	enableSilentMode,
	disableSilentMode
} from '../../../../scripts/modules/utils.js';
import fs from 'fs';

/**
 * Validate dependencies in tasks.json
 * @param {Object} args - Function arguments
 * @param {string} args.tasksJsonPath - Explicit path to the tasks.json file.
 * @param {string} args.projectRoot - Project root path (for MCP/env fallback)
 * @param {string} args.tag - Tag for the task (optional)
 * @param {Object} log - Logger object
 * @returns {Promise<{success: boolean, data?: Object, error?: {code: string, message: string}}>}
 */
export async function validateDependenciesDirect(args, log) {
	// Destructure the explicit tasksJsonPath
	const { tasksJsonPath, projectRoot, tag } = args;

	if (!tasksJsonPath) {
		log.error('validateDependenciesDirect called without tasksJsonPath');
		return {
			success: false,
			error: {
				code: 'MISSING_ARGUMENT',
				message: 'tasksJsonPath is required'
			}
		};
	}

	try {
		log.info(`Validating dependencies in tasks: ${tasksJsonPath}`);

		// Use the provided tasksJsonPath
		const tasksPath = tasksJsonPath;

		// Verify the file exists
		if (!fs.existsSync(tasksPath)) {
			return {
				success: false,
				error: {
					code: 'FILE_NOT_FOUND',
					message: `Tasks file not found at ${tasksPath}`
				}
			};
		}

		// Enable silent mode to prevent console logs from interfering with JSON response
		enableSilentMode();

		const options = { projectRoot, tag };
		// Call the original command function using the provided tasksPath
		await validateDependenciesCommand(tasksPath, options);

		// Restore normal logging
		disableSilentMode();

		return {
			success: true,
			data: {
				message: 'Dependencies validated successfully',
				tasksPath
			}
		};
	} catch (error) {
		// Make sure to restore normal logging even if there's an error
		disableSilentMode();

		log.error(`Error validating dependencies: ${error.message}`);
		return {
			success: false,
			error: {
				code: 'VALIDATION_ERROR',
				message: error.message
			}
		};
	}
}

```

--------------------------------------------------------------------------------
/tests/integration/profiles/codex-init-functionality.test.js:
--------------------------------------------------------------------------------

```javascript
import fs from 'fs';
import path from 'path';
import { codexProfile } from '../../../src/profiles/codex.js';

describe('Codex Profile Initialization Functionality', () => {
	let codexProfileContent;

	beforeAll(() => {
		const codexJsPath = path.join(process.cwd(), 'src', 'profiles', 'codex.js');
		codexProfileContent = fs.readFileSync(codexJsPath, 'utf8');
	});

	test('codex.js has correct asset-only profile configuration', () => {
		// Check for explicit, non-default values in the source file
		expect(codexProfileContent).toContain("name: 'codex'");
		expect(codexProfileContent).toContain("displayName: 'Codex'");
		expect(codexProfileContent).toContain("profileDir: '.'"); // non-default
		expect(codexProfileContent).toContain("rulesDir: '.'"); // non-default
		expect(codexProfileContent).toContain('mcpConfig: false'); // non-default
		expect(codexProfileContent).toContain('includeDefaultRules: false'); // non-default
		expect(codexProfileContent).toContain("'AGENTS.md': 'AGENTS.md'");

		// Check the final computed properties on the profile object
		expect(codexProfile.profileName).toBe('codex');
		expect(codexProfile.displayName).toBe('Codex');
		expect(codexProfile.profileDir).toBe('.');
		expect(codexProfile.rulesDir).toBe('.');
		expect(codexProfile.mcpConfig).toBe(false);
		expect(codexProfile.mcpConfigName).toBe(null); // computed
		expect(codexProfile.includeDefaultRules).toBe(false);
		expect(codexProfile.fileMap['AGENTS.md']).toBe('AGENTS.md');
	});

	test('codex.js has no lifecycle functions', () => {
		// Codex has been simplified - no lifecycle functions
		expect(codexProfileContent).not.toContain('function onAddRulesProfile');
		expect(codexProfileContent).not.toContain('function onRemoveRulesProfile');
		expect(codexProfileContent).not.toContain(
			'function onPostConvertRulesProfile'
		);
		expect(codexProfileContent).not.toContain('log(');
	});

	test('codex.js has minimal implementation', () => {
		// Should just use createProfile factory
		expect(codexProfileContent).toContain('createProfile({');
		expect(codexProfileContent).toContain("name: 'codex'");
		expect(codexProfileContent).toContain("'AGENTS.md': 'AGENTS.md'");
	});
});

```

--------------------------------------------------------------------------------
/tests/unit/ai-providers/zai-coding.test.js:
--------------------------------------------------------------------------------

```javascript
/**
 * Tests for ZAICodingProvider
 */

import { ZAICodingProvider } from '../../../src/ai-providers/zai-coding.js';

describe('ZAICodingProvider', () => {
	let provider;

	beforeEach(() => {
		provider = new ZAICodingProvider();
	});

	describe('constructor', () => {
		it('should initialize with correct name', () => {
			expect(provider.name).toBe('Z.ai (Coding Plan)');
		});

		it('should initialize with correct coding endpoint baseURL', () => {
			expect(provider.defaultBaseURL).toBe(
				'https://api.z.ai/api/coding/paas/v4/'
			);
		});

		it('should inherit from OpenAICompatibleProvider', () => {
			expect(provider).toHaveProperty('generateText');
			expect(provider).toHaveProperty('streamText');
			expect(provider).toHaveProperty('generateObject');
		});
	});

	describe('getRequiredApiKeyName', () => {
		it('should return ZAI_API_KEY environment variable name', () => {
			expect(provider.getRequiredApiKeyName()).toBe('ZAI_API_KEY');
		});
	});

	describe('isRequiredApiKey', () => {
		it('should return true as API key is required', () => {
			expect(provider.isRequiredApiKey()).toBe(true);
		});
	});

	describe('getClient', () => {
		it('should create client with API key', () => {
			const params = { apiKey: 'test-key' };
			const client = provider.getClient(params);
			expect(client).toBeDefined();
		});

		it('should use coding endpoint by default', () => {
			const params = {
				apiKey: 'test-key'
			};
			const client = provider.getClient(params);
			expect(client).toBeDefined();
			// The provider should use the coding endpoint
		});

		it('should create client even without API key (validation deferred to SDK)', () => {
			// getClient() no longer validates API key - validation is deferred to SDK initialization
			const client = provider.getClient({});
			expect(typeof client).toBe('function');
		});
	});

	describe('validateAuth', () => {
		it('should validate API key is present', () => {
			expect(() => {
				provider.validateAuth({});
			}).toThrow('Z.ai (Coding Plan) API key is required');
		});

		it('should pass with valid API key', () => {
			expect(() => {
				provider.validateAuth({ apiKey: 'test-key' });
			}).not.toThrow();
		});
	});
});

```

--------------------------------------------------------------------------------
/packages/tm-core/src/modules/workflow/workflow-domain.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * @fileoverview Workflow Domain Facade
 * Public API for TDD workflow operations
 */

import type { ConfigManager } from '../config/managers/config-manager.js';
import { WorkflowService } from './services/workflow.service.js';
import type {
	NextAction,
	StartWorkflowOptions,
	WorkflowStatus
} from './services/workflow.service.js';
import type { TestResult, WorkflowContext } from './types.js';

/**
 * Workflow Domain - Unified API for TDD workflow operations
 */
export class WorkflowDomain {
	private workflowService: WorkflowService;

	constructor(configManager: ConfigManager) {
		this.workflowService = new WorkflowService(configManager.getProjectRoot());
	}

	// ========== Workflow Lifecycle ==========

	/**
	 * Start a new TDD workflow for a task
	 */
	async start(options: StartWorkflowOptions): Promise<WorkflowStatus> {
		return this.workflowService.startWorkflow(options);
	}

	/**
	 * Resume an existing workflow
	 */
	async resume(): Promise<WorkflowStatus> {
		return this.workflowService.resumeWorkflow();
	}

	/**
	 * Get current workflow status
	 */
	getStatus(): WorkflowStatus {
		return this.workflowService.getStatus();
	}

	/**
	 * Get workflow context
	 */
	getContext(): WorkflowContext {
		return this.workflowService.getContext();
	}

	/**
	 * Get next action to perform in workflow
	 */
	getNextAction(): NextAction {
		return this.workflowService.getNextAction();
	}

	/**
	 * Complete current phase with test results
	 */
	async completePhase(testResults: TestResult): Promise<WorkflowStatus> {
		return this.workflowService.completePhase(testResults);
	}

	/**
	 * Commit changes with auto-generated message
	 */
	async commit(): Promise<WorkflowStatus> {
		return this.workflowService.commit();
	}

	/**
	 * Finalize and complete the workflow
	 */
	async finalize(): Promise<WorkflowStatus> {
		return this.workflowService.finalizeWorkflow();
	}

	/**
	 * Abort the current workflow
	 */
	async abort(): Promise<void> {
		return this.workflowService.abortWorkflow();
	}

	// ========== Workflow Information ==========

	/**
	 * Check if a workflow currently exists
	 */
	async hasWorkflow(): Promise<boolean> {
		return this.workflowService.hasWorkflow();
	}
}

```

--------------------------------------------------------------------------------
/tests/unit/profiles/subdirectory-support.test.js:
--------------------------------------------------------------------------------

```javascript
// Test for supportsRulesSubdirectories feature
import { getRulesProfile } from '../../../src/utils/rule-transformer.js';

describe('Rules Subdirectory Support Feature', () => {
	it('should support taskmaster subdirectories only for Cursor profile', () => {
		// Test Cursor profile - should use subdirectories
		const cursorProfile = getRulesProfile('cursor');
		expect(cursorProfile.supportsRulesSubdirectories).toBe(true);

		// Verify that Cursor uses taskmaster subdirectories in its file mapping
		expect(cursorProfile.fileMap['rules/dev_workflow.mdc']).toBe(
			'taskmaster/dev_workflow.mdc'
		);
		expect(cursorProfile.fileMap['rules/taskmaster.mdc']).toBe(
			'taskmaster/taskmaster.mdc'
		);
	});

	it('should not use taskmaster subdirectories for other profiles', () => {
		// Test profiles that should NOT use subdirectories (new default)
		const profiles = ['roo', 'vscode', 'cline', 'windsurf', 'trae'];

		profiles.forEach((profileName) => {
			const profile = getRulesProfile(profileName);
			expect(profile.supportsRulesSubdirectories).toBe(false);

			// Verify that these profiles do NOT use taskmaster subdirectories in their file mapping
			const expectedExt = profile.targetExtension || '.md';
			expect(profile.fileMap['rules/dev_workflow.mdc']).toBe(
				`dev_workflow${expectedExt}`
			);
			expect(profile.fileMap['rules/taskmaster.mdc']).toBe(
				`taskmaster${expectedExt}`
			);
		});
	});

	it('should have supportsRulesSubdirectories property accessible on all profiles', () => {
		const allProfiles = [
			'cursor',
			'roo',
			'vscode',
			'cline',
			'windsurf',
			'trae'
		];

		allProfiles.forEach((profileName) => {
			const profile = getRulesProfile(profileName);
			expect(profile).toBeDefined();
			expect(typeof profile.supportsRulesSubdirectories).toBe('boolean');
		});
	});

	it('should default to false for supportsRulesSubdirectories when not specified', () => {
		// Most profiles should now default to NOT supporting subdirectories
		const profiles = ['roo', 'windsurf', 'trae', 'vscode', 'cline'];

		profiles.forEach((profileName) => {
			const profile = getRulesProfile(profileName);
			expect(profile.supportsRulesSubdirectories).toBe(false);
		});
	});
});

```

--------------------------------------------------------------------------------
/mcp-server/src/core/direct-functions/fix-dependencies.js:
--------------------------------------------------------------------------------

```javascript
/**
 * Direct function wrapper for fixDependenciesCommand
 */

import { fixDependenciesCommand } from '../../../../scripts/modules/dependency-manager.js';
import {
	enableSilentMode,
	disableSilentMode
} from '../../../../scripts/modules/utils.js';
import fs from 'fs';

/**
 * Fix invalid dependencies in tasks.json automatically
 * @param {Object} args - Function arguments
 * @param {string} args.tasksJsonPath - Explicit path to the tasks.json file.
 * @param {string} args.projectRoot - Project root directory
 * @param {string} args.tag - Tag for the project
 * @param {Object} log - Logger object
 * @returns {Promise<{success: boolean, data?: Object, error?: {code: string, message: string}}>}
 */
export async function fixDependenciesDirect(args, log) {
	// Destructure expected args
	const { tasksJsonPath, projectRoot, tag } = args;
	try {
		log.info(`Fixing invalid dependencies in tasks: ${tasksJsonPath}`);

		// Check if tasksJsonPath was provided
		if (!tasksJsonPath) {
			log.error('fixDependenciesDirect called without tasksJsonPath');
			return {
				success: false,
				error: {
					code: 'MISSING_ARGUMENT',
					message: 'tasksJsonPath is required'
				}
			};
		}

		// Use provided path
		const tasksPath = tasksJsonPath;

		// Verify the file exists
		if (!fs.existsSync(tasksPath)) {
			return {
				success: false,
				error: {
					code: 'FILE_NOT_FOUND',
					message: `Tasks file not found at ${tasksPath}`
				}
			};
		}

		// Enable silent mode to prevent console logs from interfering with JSON response
		enableSilentMode();

		const options = { projectRoot, tag };
		// Call the original command function using the provided path and proper context
		await fixDependenciesCommand(tasksPath, options);

		// Restore normal logging
		disableSilentMode();

		return {
			success: true,
			data: {
				message: 'Dependencies fixed successfully',
				tasksPath,
				tag: tag || 'master'
			}
		};
	} catch (error) {
		// Make sure to restore normal logging even if there's an error
		disableSilentMode();

		log.error(`Error fixing dependencies: ${error.message}`);
		return {
			success: false,
			error: {
				code: 'FIX_DEPENDENCIES_ERROR',
				message: error.message
			}
		};
	}
}

```

--------------------------------------------------------------------------------
/apps/extension/src/components/ui/breadcrumb.tsx:
--------------------------------------------------------------------------------

```typescript
import { Slot } from '@radix-ui/react-slot';
import { ChevronRight, MoreHorizontal } from 'lucide-react';
import type * as React from 'react';

import { cn } from '@/lib/utils';

function Breadcrumb({ ...props }: React.ComponentProps<'nav'>) {
	return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />;
}

function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>) {
	return (
		<ol
			data-slot="breadcrumb-list"
			className={cn(
				'text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5',
				className
			)}
			{...props}
		/>
	);
}

function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>) {
	return (
		<li
			data-slot="breadcrumb-item"
			className={cn('inline-flex items-center gap-1.5', className)}
			{...props}
		/>
	);
}

function BreadcrumbLink({
	asChild,
	className,
	...props
}: React.ComponentProps<'a'> & {
	asChild?: boolean;
}) {
	const Comp = asChild ? Slot : 'a';

	return (
		<Comp
			data-slot="breadcrumb-link"
			className={cn('hover:text-foreground transition-colors', className)}
			{...props}
		/>
	);
}

function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>) {
	return (
		<span
			data-slot="breadcrumb-page"
			role="link"
			aria-disabled="true"
			aria-current="page"
			className={cn('text-foreground font-normal', className)}
			{...props}
		/>
	);
}

function BreadcrumbSeparator({
	children,
	className,
	...props
}: React.ComponentProps<'li'>) {
	return (
		<li
			data-slot="breadcrumb-separator"
			role="presentation"
			aria-hidden="true"
			className={cn('[&>svg]:size-3.5', className)}
			{...props}
		>
			{children ?? <ChevronRight />}
		</li>
	);
}

function BreadcrumbEllipsis({
	className,
	...props
}: React.ComponentProps<'span'>) {
	return (
		<span
			data-slot="breadcrumb-ellipsis"
			role="presentation"
			aria-hidden="true"
			className={cn('flex size-9 items-center justify-center', className)}
			{...props}
		>
			<MoreHorizontal className="size-4" />
			<span className="sr-only">More</span>
		</span>
	);
}

export {
	Breadcrumb,
	BreadcrumbList,
	BreadcrumbItem,
	BreadcrumbLink,
	BreadcrumbPage,
	BreadcrumbSeparator,
	BreadcrumbEllipsis
};

```

--------------------------------------------------------------------------------
/scripts/modules/task-manager.js:
--------------------------------------------------------------------------------

```javascript
/**
 * task-manager.js
 * Task management functions for the Task Master CLI
 */

import { findTaskById } from './utils.js';
import parsePRD from './task-manager/parse-prd/index.js';
import updateTasks from './task-manager/update-tasks.js';
import updateTaskById from './task-manager/update-task-by-id.js';
import generateTaskFiles from './task-manager/generate-task-files.js';
import setTaskStatus from './task-manager/set-task-status.js';
import updateSingleTaskStatus from './task-manager/update-single-task-status.js';
import listTasks from './task-manager/list-tasks.js';
import expandTask from './task-manager/expand-task.js';
import expandAllTasks from './task-manager/expand-all-tasks.js';
import clearSubtasks from './task-manager/clear-subtasks.js';
import addTask from './task-manager/add-task.js';
import analyzeTaskComplexity from './task-manager/analyze-task-complexity.js';
import findNextTask from './task-manager/find-next-task.js';
import addSubtask from './task-manager/add-subtask.js';
import removeSubtask from './task-manager/remove-subtask.js';
import updateSubtaskById from './task-manager/update-subtask-by-id.js';
import removeTask from './task-manager/remove-task.js';
import taskExists from './task-manager/task-exists.js';
import isTaskDependentOn from './task-manager/is-task-dependent.js';
import setResponseLanguage from './task-manager/response-language.js';
import moveTask from './task-manager/move-task.js';
import { migrateProject } from './task-manager/migrate.js';
import { performResearch } from './task-manager/research.js';
import { readComplexityReport } from './utils.js';
import {
	scopeUpTask,
	scopeDownTask,
	validateStrength
} from './task-manager/scope-adjustment.js';

// Export task manager functions
export {
	parsePRD,
	updateTasks,
	updateTaskById,
	updateSubtaskById,
	generateTaskFiles,
	setTaskStatus,
	updateSingleTaskStatus,
	listTasks,
	expandTask,
	expandAllTasks,
	clearSubtasks,
	addTask,
	addSubtask,
	removeSubtask,
	findNextTask,
	analyzeTaskComplexity,
	removeTask,
	findTaskById,
	taskExists,
	isTaskDependentOn,
	setResponseLanguage,
	moveTask,
	readComplexityReport,
	migrateProject,
	performResearch,
	scopeUpTask,
	scopeDownTask,
	validateStrength
};

```

--------------------------------------------------------------------------------
/mcp-server/src/tools/copy-tag.js:
--------------------------------------------------------------------------------

```javascript
/**
 * tools/copy-tag.js
 * Tool to copy an existing tag to a new tag
 */

import { z } from 'zod';
import {
	createErrorResponse,
	handleApiResult,
	withNormalizedProjectRoot
} from './utils.js';
import { copyTagDirect } from '../core/task-master-core.js';
import { findTasksPath } from '../core/utils/path-utils.js';

/**
 * Register the copyTag tool with the MCP server
 * @param {Object} server - FastMCP server instance
 */
export function registerCopyTagTool(server) {
	server.addTool({
		name: 'copy_tag',
		description:
			'Copy an existing tag to create a new tag with all tasks and metadata',
		parameters: z.object({
			sourceName: z.string().describe('Name of the source tag to copy from'),
			targetName: z.string().describe('Name of the new tag to create'),
			description: z
				.string()
				.optional()
				.describe('Optional description for the new tag'),
			file: z
				.string()
				.optional()
				.describe('Path to the tasks file (default: tasks/tasks.json)'),
			projectRoot: z
				.string()
				.describe('The directory of the project. Must be an absolute path.')
		}),
		execute: withNormalizedProjectRoot(async (args, { log, session }) => {
			try {
				log.info(`Starting copy-tag with args: ${JSON.stringify(args)}`);

				// Use args.projectRoot directly (guaranteed by withNormalizedProjectRoot)
				let tasksJsonPath;
				try {
					tasksJsonPath = findTasksPath(
						{ projectRoot: args.projectRoot, file: args.file },
						log
					);
				} catch (error) {
					log.error(`Error finding tasks.json: ${error.message}`);
					return createErrorResponse(
						`Failed to find tasks.json: ${error.message}`
					);
				}

				// Call the direct function
				const result = await copyTagDirect(
					{
						tasksJsonPath: tasksJsonPath,
						sourceName: args.sourceName,
						targetName: args.targetName,
						description: args.description,
						projectRoot: args.projectRoot
					},
					log,
					{ session }
				);

				return handleApiResult(
					result,
					log,
					'Error copying tag',
					undefined,
					args.projectRoot
				);
			} catch (error) {
				log.error(`Error in copy-tag tool: ${error.message}`);
				return createErrorResponse(error.message);
			}
		})
	});
}

```

--------------------------------------------------------------------------------
/packages/claude-code-plugin/commands/remove-task.md:
--------------------------------------------------------------------------------

```markdown
Remove a task permanently from the project.

Arguments: $ARGUMENTS (task ID)

Delete a task and handle all its relationships properly.

## Task Removal

Permanently removes a task while maintaining project integrity.

## Argument Parsing

- "remove task 5"
- "delete 5"
- "5" → remove task 5
- Can include "-y" for auto-confirm

## Execution

```bash
task-master remove-task --id=<id> [-y]
```

## Pre-Removal Analysis

1. **Task Details**
   - Current status
   - Work completed
   - Time invested
   - Associated data

2. **Relationship Check**
   - Tasks that depend on this
   - Dependencies this task has
   - Subtasks that will be removed
   - Blocking implications

3. **Impact Assessment**
   ```
   Task Removal Impact
   ━━━━━━━━━━━━━━━━━━
   Task: #5 "Implement authentication" (in-progress)
   Status: 60% complete (~8 hours work)
   
   Will affect:
   - 3 tasks depend on this (will be blocked)
   - Has 4 subtasks (will be deleted)
   - Part of critical path
   
   ⚠️  This action cannot be undone
   ```

## Smart Warnings

- Warn if task is in-progress
- Show dependent tasks that will be blocked
- Highlight if part of critical path
- Note any completed work being lost

## Removal Process

1. Show comprehensive impact
2. Require confirmation (unless -y)
3. Update dependent task references
4. Remove task and subtasks
5. Clean up orphaned dependencies
6. Log removal with timestamp

## Alternative Actions

Suggest before deletion:
- Mark as cancelled instead
- Convert to documentation
- Archive task data
- Transfer work to another task

## Post-Removal

- List affected tasks
- Show broken dependencies
- Update project statistics
- Suggest dependency fixes
- Recalculate timeline

## Example Flows

```
/taskmaster:remove-task 5
→ Task #5 is in-progress with 8 hours logged
→ 3 other tasks depend on this
→ Suggestion: Mark as cancelled instead?
Remove anyway? (y/n)

/taskmaster:remove-task 5 -y
→ Removed: Task #5 and 4 subtasks
→ Updated: 3 task dependencies
→ Warning: Tasks #7, #8, #9 now have missing dependency
→ Run /taskmaster:fix-dependencies to resolve
```

## Safety Features

- Confirmation required
- Impact preview
- Removal logging
- Suggest alternatives
- No cascade delete of dependents
```

--------------------------------------------------------------------------------
/tests/integration/profiles/windsurf-init-functionality.test.js:
--------------------------------------------------------------------------------

```javascript
import fs from 'fs';
import path from 'path';
import { windsurfProfile } from '../../../src/profiles/windsurf.js';

describe('Windsurf Profile Initialization Functionality', () => {
	let windsurfProfileContent;

	beforeAll(() => {
		const windsurfJsPath = path.join(
			process.cwd(),
			'src',
			'profiles',
			'windsurf.js'
		);
		windsurfProfileContent = fs.readFileSync(windsurfJsPath, 'utf8');
	});

	test('windsurf.js uses factory pattern with correct configuration', () => {
		// Check for explicit, non-default values in the source file
		expect(windsurfProfileContent).toContain("name: 'windsurf'");
		expect(windsurfProfileContent).toContain("displayName: 'Windsurf'");
		expect(windsurfProfileContent).toContain("url: 'windsurf.com'");
		expect(windsurfProfileContent).toContain("docsUrl: 'docs.windsurf.com'");

		// Check the final computed properties on the profile object
		expect(windsurfProfile.profileName).toBe('windsurf');
		expect(windsurfProfile.displayName).toBe('Windsurf');
		expect(windsurfProfile.profileDir).toBe('.windsurf'); // default
		expect(windsurfProfile.rulesDir).toBe('.windsurf/rules'); // default
		expect(windsurfProfile.mcpConfig).toBe(true); // default
		expect(windsurfProfile.mcpConfigName).toBe('mcp.json'); // default
	});

	test('windsurf.js configures .mdc to .md extension mapping', () => {
		// Check that the profile object has the correct file mapping behavior (windsurf converts to .md)
		expect(windsurfProfile.fileMap['rules/cursor_rules.mdc']).toBe(
			'windsurf_rules.md'
		);
	});

	test('windsurf.js uses standard tool mappings', () => {
		// Check that the profile uses default tool mappings (equivalent to COMMON_TOOL_MAPPINGS.STANDARD)
		// This verifies the architectural pattern: no custom toolMappings = standard tool names
		expect(windsurfProfileContent).not.toContain('toolMappings:');
		expect(windsurfProfileContent).not.toContain('apply_diff');
		expect(windsurfProfileContent).not.toContain('search_files');

		// Verify the result: default mappings means tools keep their original names
		expect(windsurfProfile.conversionConfig.toolNames.edit_file).toBe(
			'edit_file'
		);
		expect(windsurfProfile.conversionConfig.toolNames.search).toBe('search');
	});
});

```

--------------------------------------------------------------------------------
/apps/cli/src/ui/components/header.component.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * @fileoverview Task Master header component
 * Displays the banner, version, project info, and file path
 */

import chalk from 'chalk';

/**
 * Brief information for API storage
 */
export interface BriefInfo {
	briefId: string;
	briefName: string;
	orgSlug?: string;
	webAppUrl?: string;
}

/**
 * Header configuration options
 */
export interface HeaderOptions {
	title?: string;
	tag?: string;
	filePath?: string;
	storageType?: 'api' | 'file';
	briefInfo?: BriefInfo;
}

/**
 * Display the Task Master header with project info
 */
export function displayHeader(options: HeaderOptions = {}): void {
	const { filePath, tag, storageType, briefInfo } = options;

	// Display different header based on storage type
	if (storageType === 'api' && briefInfo) {
		// API storage: Show brief information
		const briefDisplay = `🏷  Brief: ${chalk.cyan(briefInfo.briefName)} ${chalk.gray(`(${briefInfo.briefId})`)}`;
		console.log(briefDisplay);

		// Construct and display the brief URL or ID
		if (briefInfo.webAppUrl && briefInfo.orgSlug) {
			const briefUrl = `${briefInfo.webAppUrl}/home/${briefInfo.orgSlug}/briefs/${briefInfo.briefId}/plan`;
			console.log(`Listing tasks from: ${chalk.dim(briefUrl)}`);
		} else if (briefInfo.webAppUrl) {
			// Show web app URL and brief ID if org slug is missing
			console.log(
				`Listing tasks from: ${chalk.dim(`${briefInfo.webAppUrl} (Brief: ${briefInfo.briefId})`)}`
			);
			console.log(
				chalk.yellow(
					`💡 Tip: Run ${chalk.cyan('tm context select')} to set your organization and see the full URL`
				)
			);
		} else {
			// Fallback: just show the brief ID if we can't get web app URL
			console.log(
				`Listing tasks from: ${chalk.dim(`API (Brief ID: ${briefInfo.briefId})`)}`
			);
		}
	} else if (tag) {
		// File storage: Show tag information
		let tagInfo = '';

		if (tag && tag !== 'master') {
			tagInfo = `🏷  tag: ${chalk.cyan(tag)}`;
		} else {
			tagInfo = `🏷  tag: ${chalk.cyan('master')}`;
		}

		console.log(tagInfo);

		if (filePath) {
			// Convert to absolute path if it's relative
			const absolutePath = filePath.startsWith('/')
				? filePath
				: `${process.cwd()}/${filePath}`;
			console.log(`Listing tasks from: ${chalk.dim(absolutePath)}`);
		}
	}
}

```

--------------------------------------------------------------------------------
/packages/tm-core/tests/unit/executor.test.ts:
--------------------------------------------------------------------------------

```typescript
/**
 * Tests for executor functionality
 */

import { beforeEach, describe, expect, it, vi } from 'vitest';
import {
	ClaudeExecutor,
	ExecutorFactory,
	type ExecutorOptions
} from '../../src/executors/index.js';

describe('ExecutorFactory', () => {
	const mockProjectRoot = '/test/project';

	it('should create a Claude executor', () => {
		const options: ExecutorOptions = {
			type: 'claude',
			projectRoot: mockProjectRoot
		};

		const executor = ExecutorFactory.create(options);
		expect(executor).toBeInstanceOf(ClaudeExecutor);
	});

	it('should throw error for unimplemented executor types', () => {
		const options: ExecutorOptions = {
			type: 'shell',
			projectRoot: mockProjectRoot
		};

		expect(() => ExecutorFactory.create(options)).toThrow(
			'Shell executor not yet implemented'
		);
	});

	it('should get available executor types', () => {
		const types = ExecutorFactory.getAvailableTypes();
		expect(types).toContain('claude');
		expect(types).toContain('shell');
		expect(types).toContain('custom');
	});
});

describe('ClaudeExecutor', () => {
	const mockProjectRoot = '/test/project';
	let executor: ClaudeExecutor;

	beforeEach(() => {
		executor = new ClaudeExecutor(mockProjectRoot);
	});

	it('should return claude as executor type', () => {
		expect(executor.getType()).toBe('claude');
	});

	it('should format task prompt correctly', () => {
		const mockTask = {
			id: '1',
			title: 'Test Task',
			description: 'Test description',
			status: 'pending' as const,
			priority: 'high' as const,
			dependencies: [],
			details: 'Implementation details',
			testStrategy: 'Unit tests',
			subtasks: []
		};

		// Access protected method through any type assertion for testing
		const formattedPrompt = (executor as any).formatTaskPrompt(mockTask);

		expect(formattedPrompt).toContain('Task ID: 1');
		expect(formattedPrompt).toContain('Title: Test Task');
		expect(formattedPrompt).toContain('Description:\nTest description');
		expect(formattedPrompt).toContain(
			'Implementation Details:\nImplementation details'
		);
		expect(formattedPrompt).toContain('Test Strategy:\nUnit tests');
		expect(formattedPrompt).toContain('Status: pending');
		expect(formattedPrompt).toContain('Priority: high');
	});
});

```
Page 4/50FirstPrevNextLast