This is page 33 of 38. Use http://codebase.md/eyaltoledano/claude-task-master?page={x} to view the full context. # Directory Structure ``` ├── .changeset │ ├── config.json │ └── README.md ├── .claude │ ├── agents │ │ ├── task-checker.md │ │ ├── task-executor.md │ │ └── task-orchestrator.md │ ├── commands │ │ ├── dedupe.md │ │ └── tm │ │ ├── add-dependency │ │ │ └── add-dependency.md │ │ ├── add-subtask │ │ │ ├── add-subtask.md │ │ │ └── convert-task-to-subtask.md │ │ ├── add-task │ │ │ └── add-task.md │ │ ├── analyze-complexity │ │ │ └── analyze-complexity.md │ │ ├── complexity-report │ │ │ └── complexity-report.md │ │ ├── expand │ │ │ ├── expand-all-tasks.md │ │ │ └── expand-task.md │ │ ├── fix-dependencies │ │ │ └── fix-dependencies.md │ │ ├── generate │ │ │ └── generate-tasks.md │ │ ├── help.md │ │ ├── init │ │ │ ├── init-project-quick.md │ │ │ └── init-project.md │ │ ├── learn.md │ │ ├── list │ │ │ ├── list-tasks-by-status.md │ │ │ ├── list-tasks-with-subtasks.md │ │ │ └── list-tasks.md │ │ ├── models │ │ │ ├── setup-models.md │ │ │ └── view-models.md │ │ ├── next │ │ │ └── next-task.md │ │ ├── parse-prd │ │ │ ├── parse-prd-with-research.md │ │ │ └── parse-prd.md │ │ ├── remove-dependency │ │ │ └── remove-dependency.md │ │ ├── remove-subtask │ │ │ └── remove-subtask.md │ │ ├── remove-subtasks │ │ │ ├── remove-all-subtasks.md │ │ │ └── remove-subtasks.md │ │ ├── remove-task │ │ │ └── remove-task.md │ │ ├── set-status │ │ │ ├── to-cancelled.md │ │ │ ├── to-deferred.md │ │ │ ├── to-done.md │ │ │ ├── to-in-progress.md │ │ │ ├── to-pending.md │ │ │ └── to-review.md │ │ ├── setup │ │ │ ├── install-taskmaster.md │ │ │ └── quick-install-taskmaster.md │ │ ├── show │ │ │ └── show-task.md │ │ ├── status │ │ │ └── project-status.md │ │ ├── sync-readme │ │ │ └── sync-readme.md │ │ ├── tm-main.md │ │ ├── update │ │ │ ├── update-single-task.md │ │ │ ├── update-task.md │ │ │ └── update-tasks-from-id.md │ │ ├── utils │ │ │ └── analyze-project.md │ │ ├── validate-dependencies │ │ │ └── validate-dependencies.md │ │ └── workflows │ │ ├── auto-implement-tasks.md │ │ ├── command-pipeline.md │ │ └── smart-workflow.md │ └── TM_COMMANDS_GUIDE.md ├── .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 │ └── 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 │ │ ├── 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 │ │ ├── test-prd.txt │ │ └── tm-core-phase-1.txt │ ├── reports │ │ ├── task-complexity-report_cc-kiro-hooks.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.txt ├── .vscode │ ├── extensions.json │ └── settings.json ├── apps │ ├── cli │ │ ├── CHANGELOG.md │ │ ├── package.json │ │ ├── src │ │ │ ├── commands │ │ │ │ ├── auth.command.ts │ │ │ │ ├── context.command.ts │ │ │ │ ├── list.command.ts │ │ │ │ ├── set-status.command.ts │ │ │ │ ├── show.command.ts │ │ │ │ └── start.command.ts │ │ │ ├── index.ts │ │ │ ├── ui │ │ │ │ ├── components │ │ │ │ │ ├── dashboard.component.ts │ │ │ │ │ ├── header.component.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── next-task.component.ts │ │ │ │ │ ├── suggested-steps.component.ts │ │ │ │ │ └── task-detail.component.ts │ │ │ │ └── index.ts │ │ │ └── utils │ │ │ ├── auto-update.ts │ │ │ └── ui.ts │ │ └── tsconfig.json │ ├── 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 │ │ │ └── task-structure.mdx │ │ ├── CHANGELOG.md │ │ ├── docs.json │ │ ├── favicon.svg │ │ ├── getting-started │ │ │ ├── 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 │ │ ├── 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 ├── assets │ ├── .windsurfrules │ ├── AGENTS.md │ ├── claude │ │ ├── agents │ │ │ ├── task-checker.md │ │ │ ├── task-executor.md │ │ │ └── task-orchestrator.md │ │ ├── commands │ │ │ └── tm │ │ │ ├── add-dependency │ │ │ │ └── add-dependency.md │ │ │ ├── add-subtask │ │ │ │ ├── add-subtask.md │ │ │ │ └── convert-task-to-subtask.md │ │ │ ├── add-task │ │ │ │ └── add-task.md │ │ │ ├── analyze-complexity │ │ │ │ └── analyze-complexity.md │ │ │ ├── clear-subtasks │ │ │ │ ├── clear-all-subtasks.md │ │ │ │ └── clear-subtasks.md │ │ │ ├── complexity-report │ │ │ │ └── complexity-report.md │ │ │ ├── expand │ │ │ │ ├── expand-all-tasks.md │ │ │ │ └── expand-task.md │ │ │ ├── fix-dependencies │ │ │ │ └── fix-dependencies.md │ │ │ ├── generate │ │ │ │ └── generate-tasks.md │ │ │ ├── help.md │ │ │ ├── init │ │ │ │ ├── init-project-quick.md │ │ │ │ └── init-project.md │ │ │ ├── learn.md │ │ │ ├── list │ │ │ │ ├── list-tasks-by-status.md │ │ │ │ ├── list-tasks-with-subtasks.md │ │ │ │ └── list-tasks.md │ │ │ ├── models │ │ │ │ ├── setup-models.md │ │ │ │ └── view-models.md │ │ │ ├── next │ │ │ │ └── next-task.md │ │ │ ├── parse-prd │ │ │ │ ├── parse-prd-with-research.md │ │ │ │ └── parse-prd.md │ │ │ ├── remove-dependency │ │ │ │ └── remove-dependency.md │ │ │ ├── remove-subtask │ │ │ │ └── remove-subtask.md │ │ │ ├── remove-subtasks │ │ │ │ ├── remove-all-subtasks.md │ │ │ │ └── remove-subtasks.md │ │ │ ├── remove-task │ │ │ │ └── remove-task.md │ │ │ ├── set-status │ │ │ │ ├── to-cancelled.md │ │ │ │ ├── to-deferred.md │ │ │ │ ├── to-done.md │ │ │ │ ├── to-in-progress.md │ │ │ │ ├── to-pending.md │ │ │ │ └── to-review.md │ │ │ ├── setup │ │ │ │ ├── install-taskmaster.md │ │ │ │ └── quick-install-taskmaster.md │ │ │ ├── show │ │ │ │ └── show-task.md │ │ │ ├── status │ │ │ │ └── project-status.md │ │ │ ├── sync-readme │ │ │ │ └── sync-readme.md │ │ │ ├── tm-main.md │ │ │ ├── update │ │ │ │ ├── update-single-task.md │ │ │ │ ├── update-task.md │ │ │ │ └── update-tasks-from-id.md │ │ │ ├── utils │ │ │ │ └── analyze-project.md │ │ │ ├── validate-dependencies │ │ │ │ └── validate-dependencies.md │ │ │ └── workflows │ │ │ ├── auto-implement-tasks.md │ │ │ ├── command-pipeline.md │ │ │ └── smart-workflow.md │ │ └── TM_COMMANDS_GUIDE.md │ ├── config.json │ ├── env.example │ ├── example_prd.txt │ ├── 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.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 │ ├── CLI-COMMANDER-PATTERN.md │ ├── command-reference.md │ ├── configuration.md │ ├── contributor-docs │ │ └── testing-roo-integration.md │ ├── cross-tag-task-movement.md │ ├── examples │ │ └── claude-code-usage.md │ ├── examples.md │ ├── licensing.md │ ├── mcp-provider-guide.md │ ├── mcp-provider.md │ ├── migration-guide.md │ ├── models.md │ ├── providers │ │ └── gemini-cli.md │ ├── README.md │ ├── scripts │ │ └── models-json-to-markdown.js │ ├── task-structure.md │ └── tutorial.md ├── images │ └── 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 │ │ │ ├── list-tasks.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 │ │ │ ├── show-task.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 │ ├── get-task.js │ ├── get-tasks.js │ ├── index.js │ ├── initialize-project.js │ ├── list-tags.js │ ├── models.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.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 │ ├── build-config │ │ ├── CHANGELOG.md │ │ ├── package.json │ │ ├── src │ │ │ └── tsdown.base.ts │ │ └── tsconfig.json │ └── tm-core │ ├── .gitignore │ ├── CHANGELOG.md │ ├── docs │ │ └── listTasks-architecture.md │ ├── package.json │ ├── POC-STATUS.md │ ├── README.md │ ├── src │ │ ├── auth │ │ │ ├── auth-manager.test.ts │ │ │ ├── auth-manager.ts │ │ │ ├── config.ts │ │ │ ├── credential-store.test.ts │ │ │ ├── credential-store.ts │ │ │ ├── index.ts │ │ │ ├── oauth-service.ts │ │ │ ├── supabase-session-storage.ts │ │ │ └── types.ts │ │ ├── clients │ │ │ ├── index.ts │ │ │ └── supabase-client.ts │ │ ├── config │ │ │ ├── config-manager.spec.ts │ │ │ ├── config-manager.ts │ │ │ ├── index.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 │ │ ├── constants │ │ │ └── index.ts │ │ ├── entities │ │ │ └── task.entity.ts │ │ ├── errors │ │ │ ├── index.ts │ │ │ └── task-master-error.ts │ │ ├── executors │ │ │ ├── base-executor.ts │ │ │ ├── claude-executor.ts │ │ │ ├── executor-factory.ts │ │ │ ├── executor-service.ts │ │ │ ├── index.ts │ │ │ └── types.ts │ │ ├── index.ts │ │ ├── interfaces │ │ │ ├── ai-provider.interface.ts │ │ │ ├── configuration.interface.ts │ │ │ ├── index.ts │ │ │ └── storage.interface.ts │ │ ├── logger │ │ │ ├── factory.ts │ │ │ ├── index.ts │ │ │ └── logger.ts │ │ ├── mappers │ │ │ └── TaskMapper.ts │ │ ├── parser │ │ │ └── index.ts │ │ ├── providers │ │ │ ├── ai │ │ │ │ ├── base-provider.ts │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── repositories │ │ │ ├── supabase-task-repository.ts │ │ │ └── task-repository.interface.ts │ │ ├── services │ │ │ ├── index.ts │ │ │ ├── organization.service.ts │ │ │ ├── task-execution-service.ts │ │ │ └── task-service.ts │ │ ├── storage │ │ │ ├── api-storage.ts │ │ │ ├── file-storage │ │ │ │ ├── file-operations.ts │ │ │ │ ├── file-storage.ts │ │ │ │ ├── format-handler.ts │ │ │ │ ├── index.ts │ │ │ │ └── path-resolver.ts │ │ │ ├── index.ts │ │ │ └── storage-factory.ts │ │ ├── subpath-exports.test.ts │ │ ├── task-master-core.ts │ │ ├── types │ │ │ ├── database.types.ts │ │ │ ├── index.ts │ │ │ └── legacy.ts │ │ └── utils │ │ ├── id-generator.ts │ │ └── index.ts │ ├── tests │ │ ├── integration │ │ │ └── list-tasks.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 │ ├── dev.js │ ├── init.js │ ├── modules │ │ ├── ai-services-unified.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 ├── src │ ├── ai-providers │ │ ├── anthropic.js │ │ ├── azure.js │ │ ├── base-provider.js │ │ ├── bedrock.js │ │ ├── claude-code.js │ │ ├── custom-sdk │ │ │ ├── claude-code │ │ │ │ ├── errors.js │ │ │ │ ├── index.js │ │ │ │ ├── json-extractor.js │ │ │ │ ├── language-model.js │ │ │ │ ├── message-converter.js │ │ │ │ └── types.js │ │ │ └── grok-cli │ │ │ ├── errors.js │ │ │ ├── index.js │ │ │ ├── json-extractor.js │ │ │ ├── language-model.js │ │ │ ├── message-converter.js │ │ │ └── types.js │ │ ├── gemini-cli.js │ │ ├── google-vertex.js │ │ ├── google.js │ │ ├── grok-cli.js │ │ ├── groq.js │ │ ├── index.js │ │ ├── ollama.js │ │ ├── openai.js │ │ ├── openrouter.js │ │ ├── perplexity.js │ │ └── xai.js │ ├── constants │ │ ├── commands.js │ │ ├── paths.js │ │ ├── profiles.js │ │ ├── providers.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 │ ├── 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 │ ├── fixture │ │ └── test-tasks.json │ ├── fixtures │ │ ├── .taskmasterconfig │ │ ├── sample-claude-response.js │ │ ├── sample-prd.txt │ │ └── sample-tasks.js │ ├── integration │ │ ├── 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 │ ├── 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 │ │ ├── claude-code.test.js │ │ ├── custom-sdk │ │ │ └── claude-code │ │ │ └── language-model.test.js │ │ ├── gemini-cli.test.js │ │ ├── mcp-components.test.js │ │ └── openai.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 │ ├── 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 │ ├── providers │ │ └── provider-registry.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 │ │ │ ├── move-task-cross-tag.test.js │ │ │ ├── move-task.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 ``` # Files -------------------------------------------------------------------------------- /context/mcp-protocol-schema-03262025.json: -------------------------------------------------------------------------------- ```json { "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "Annotations": { "description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed", "properties": { "audience": { "description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., `[\"user\", \"assistant\"]`).", "items": { "$ref": "#/definitions/Role" }, "type": "array" }, "priority": { "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.", "maximum": 1, "minimum": 0, "type": "number" } }, "type": "object" }, "AudioContent": { "description": "Audio provided to or from an LLM.", "properties": { "annotations": { "$ref": "#/definitions/Annotations", "description": "Optional annotations for the client." }, "data": { "description": "The base64-encoded audio data.", "format": "byte", "type": "string" }, "mimeType": { "description": "The MIME type of the audio. Different providers may support different audio types.", "type": "string" }, "type": { "const": "audio", "type": "string" } }, "required": ["data", "mimeType", "type"], "type": "object" }, "BlobResourceContents": { "properties": { "blob": { "description": "A base64-encoded string representing the binary data of the item.", "format": "byte", "type": "string" }, "mimeType": { "description": "The MIME type of this resource, if known.", "type": "string" }, "uri": { "description": "The URI of this resource.", "format": "uri", "type": "string" } }, "required": ["blob", "uri"], "type": "object" }, "CallToolRequest": { "description": "Used by the client to invoke a tool provided by the server.", "properties": { "method": { "const": "tools/call", "type": "string" }, "params": { "properties": { "arguments": { "additionalProperties": {}, "type": "object" }, "name": { "type": "string" } }, "required": ["name"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "CallToolResult": { "description": "The server's response to a tool call.\n\nAny errors that originate from the tool SHOULD be reported inside the result\nobject, with `isError` set to true, _not_ as an MCP protocol-level error\nresponse. Otherwise, the LLM would not be able to see that an error occurred\nand self-correct.\n\nHowever, any errors in _finding_ the tool, an error indicating that the\nserver does not support tool calls, or any other exceptional conditions,\nshould be reported as an MCP error response.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "content": { "items": { "anyOf": [ { "$ref": "#/definitions/TextContent" }, { "$ref": "#/definitions/ImageContent" }, { "$ref": "#/definitions/AudioContent" }, { "$ref": "#/definitions/EmbeddedResource" } ] }, "type": "array" }, "isError": { "description": "Whether the tool call ended in an error.\n\nIf not set, this is assumed to be false (the call was successful).", "type": "boolean" } }, "required": ["content"], "type": "object" }, "CancelledNotification": { "description": "This notification can be sent by either side to indicate that it is cancelling a previously-issued request.\n\nThe request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n\nThis notification indicates that the result will be unused, so any associated processing SHOULD cease.\n\nA client MUST NOT attempt to cancel its `initialize` request.", "properties": { "method": { "const": "notifications/cancelled", "type": "string" }, "params": { "properties": { "reason": { "description": "An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.", "type": "string" }, "requestId": { "$ref": "#/definitions/RequestId", "description": "The ID of the request to cancel.\n\nThis MUST correspond to the ID of a request previously issued in the same direction." } }, "required": ["requestId"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "ClientCapabilities": { "description": "Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.", "properties": { "experimental": { "additionalProperties": { "additionalProperties": true, "properties": {}, "type": "object" }, "description": "Experimental, non-standard capabilities that the client supports.", "type": "object" }, "roots": { "description": "Present if the client supports listing roots.", "properties": { "listChanged": { "description": "Whether the client supports notifications for changes to the roots list.", "type": "boolean" } }, "type": "object" }, "sampling": { "additionalProperties": true, "description": "Present if the client supports sampling from an LLM.", "properties": {}, "type": "object" } }, "type": "object" }, "ClientNotification": { "anyOf": [ { "$ref": "#/definitions/CancelledNotification" }, { "$ref": "#/definitions/InitializedNotification" }, { "$ref": "#/definitions/ProgressNotification" }, { "$ref": "#/definitions/RootsListChangedNotification" } ] }, "ClientRequest": { "anyOf": [ { "$ref": "#/definitions/InitializeRequest" }, { "$ref": "#/definitions/PingRequest" }, { "$ref": "#/definitions/ListResourcesRequest" }, { "$ref": "#/definitions/ReadResourceRequest" }, { "$ref": "#/definitions/SubscribeRequest" }, { "$ref": "#/definitions/UnsubscribeRequest" }, { "$ref": "#/definitions/ListPromptsRequest" }, { "$ref": "#/definitions/GetPromptRequest" }, { "$ref": "#/definitions/ListToolsRequest" }, { "$ref": "#/definitions/CallToolRequest" }, { "$ref": "#/definitions/SetLevelRequest" }, { "$ref": "#/definitions/CompleteRequest" } ] }, "ClientResult": { "anyOf": [ { "$ref": "#/definitions/Result" }, { "$ref": "#/definitions/CreateMessageResult" }, { "$ref": "#/definitions/ListRootsResult" } ] }, "CompleteRequest": { "description": "A request from the client to the server, to ask for completion options.", "properties": { "method": { "const": "completion/complete", "type": "string" }, "params": { "properties": { "argument": { "description": "The argument's information", "properties": { "name": { "description": "The name of the argument", "type": "string" }, "value": { "description": "The value of the argument to use for completion matching.", "type": "string" } }, "required": ["name", "value"], "type": "object" }, "ref": { "anyOf": [ { "$ref": "#/definitions/PromptReference" }, { "$ref": "#/definitions/ResourceReference" } ] } }, "required": ["argument", "ref"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "CompleteResult": { "description": "The server's response to a completion/complete request", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "completion": { "properties": { "hasMore": { "description": "Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.", "type": "boolean" }, "total": { "description": "The total number of completion options available. This can exceed the number of values actually sent in the response.", "type": "integer" }, "values": { "description": "An array of completion values. Must not exceed 100 items.", "items": { "type": "string" }, "type": "array" } }, "required": ["values"], "type": "object" } }, "required": ["completion"], "type": "object" }, "CreateMessageRequest": { "description": "A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.", "properties": { "method": { "const": "sampling/createMessage", "type": "string" }, "params": { "properties": { "includeContext": { "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.", "enum": ["allServers", "none", "thisServer"], "type": "string" }, "maxTokens": { "description": "The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.", "type": "integer" }, "messages": { "items": { "$ref": "#/definitions/SamplingMessage" }, "type": "array" }, "metadata": { "additionalProperties": true, "description": "Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.", "properties": {}, "type": "object" }, "modelPreferences": { "$ref": "#/definitions/ModelPreferences", "description": "The server's preferences for which model to select. The client MAY ignore these preferences." }, "stopSequences": { "items": { "type": "string" }, "type": "array" }, "systemPrompt": { "description": "An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.", "type": "string" }, "temperature": { "type": "number" } }, "required": ["maxTokens", "messages"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "CreateMessageResult": { "description": "The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "content": { "anyOf": [ { "$ref": "#/definitions/TextContent" }, { "$ref": "#/definitions/ImageContent" }, { "$ref": "#/definitions/AudioContent" } ] }, "model": { "description": "The name of the model that generated the message.", "type": "string" }, "role": { "$ref": "#/definitions/Role" }, "stopReason": { "description": "The reason why sampling stopped, if known.", "type": "string" } }, "required": ["content", "model", "role"], "type": "object" }, "Cursor": { "description": "An opaque token used to represent a cursor for pagination.", "type": "string" }, "EmbeddedResource": { "description": "The contents of a resource, embedded into a prompt or tool call result.\n\nIt is up to the client how best to render embedded resources for the benefit\nof the LLM and/or the user.", "properties": { "annotations": { "$ref": "#/definitions/Annotations", "description": "Optional annotations for the client." }, "resource": { "anyOf": [ { "$ref": "#/definitions/TextResourceContents" }, { "$ref": "#/definitions/BlobResourceContents" } ] }, "type": { "const": "resource", "type": "string" } }, "required": ["resource", "type"], "type": "object" }, "EmptyResult": { "$ref": "#/definitions/Result" }, "GetPromptRequest": { "description": "Used by the client to get a prompt provided by the server.", "properties": { "method": { "const": "prompts/get", "type": "string" }, "params": { "properties": { "arguments": { "additionalProperties": { "type": "string" }, "description": "Arguments to use for templating the prompt.", "type": "object" }, "name": { "description": "The name of the prompt or prompt template.", "type": "string" } }, "required": ["name"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "GetPromptResult": { "description": "The server's response to a prompts/get request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "description": { "description": "An optional description for the prompt.", "type": "string" }, "messages": { "items": { "$ref": "#/definitions/PromptMessage" }, "type": "array" } }, "required": ["messages"], "type": "object" }, "ImageContent": { "description": "An image provided to or from an LLM.", "properties": { "annotations": { "$ref": "#/definitions/Annotations", "description": "Optional annotations for the client." }, "data": { "description": "The base64-encoded image data.", "format": "byte", "type": "string" }, "mimeType": { "description": "The MIME type of the image. Different providers may support different image types.", "type": "string" }, "type": { "const": "image", "type": "string" } }, "required": ["data", "mimeType", "type"], "type": "object" }, "Implementation": { "description": "Describes the name and version of an MCP implementation.", "properties": { "name": { "type": "string" }, "version": { "type": "string" } }, "required": ["name", "version"], "type": "object" }, "InitializeRequest": { "description": "This request is sent from the client to the server when it first connects, asking it to begin initialization.", "properties": { "method": { "const": "initialize", "type": "string" }, "params": { "properties": { "capabilities": { "$ref": "#/definitions/ClientCapabilities" }, "clientInfo": { "$ref": "#/definitions/Implementation" }, "protocolVersion": { "description": "The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.", "type": "string" } }, "required": ["capabilities", "clientInfo", "protocolVersion"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "InitializeResult": { "description": "After receiving an initialize request from the client, the server sends this response.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "capabilities": { "$ref": "#/definitions/ServerCapabilities" }, "instructions": { "description": "Instructions describing how to use the server and its features.\n\nThis can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a \"hint\" to the model. For example, this information MAY be added to the system prompt.", "type": "string" }, "protocolVersion": { "description": "The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.", "type": "string" }, "serverInfo": { "$ref": "#/definitions/Implementation" } }, "required": ["capabilities", "protocolVersion", "serverInfo"], "type": "object" }, "InitializedNotification": { "description": "This notification is sent from the client to the server after initialization has finished.", "properties": { "method": { "const": "notifications/initialized", "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "additionalProperties": {}, "description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.", "type": "object" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "JSONRPCBatchRequest": { "description": "A JSON-RPC batch request, as described in https://www.jsonrpc.org/specification#batch.", "items": { "anyOf": [ { "$ref": "#/definitions/JSONRPCRequest" }, { "$ref": "#/definitions/JSONRPCNotification" } ] }, "type": "array" }, "JSONRPCBatchResponse": { "description": "A JSON-RPC batch response, as described in https://www.jsonrpc.org/specification#batch.", "items": { "anyOf": [ { "$ref": "#/definitions/JSONRPCResponse" }, { "$ref": "#/definitions/JSONRPCError" } ] }, "type": "array" }, "JSONRPCError": { "description": "A response to a request that indicates an error occurred.", "properties": { "error": { "properties": { "code": { "description": "The error type that occurred.", "type": "integer" }, "data": { "description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)." }, "message": { "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.", "type": "string" } }, "required": ["code", "message"], "type": "object" }, "id": { "$ref": "#/definitions/RequestId" }, "jsonrpc": { "const": "2.0", "type": "string" } }, "required": ["error", "id", "jsonrpc"], "type": "object" }, "JSONRPCMessage": { "anyOf": [ { "$ref": "#/definitions/JSONRPCRequest" }, { "$ref": "#/definitions/JSONRPCNotification" }, { "description": "A JSON-RPC batch request, as described in https://www.jsonrpc.org/specification#batch.", "items": { "anyOf": [ { "$ref": "#/definitions/JSONRPCRequest" }, { "$ref": "#/definitions/JSONRPCNotification" } ] }, "type": "array" }, { "$ref": "#/definitions/JSONRPCResponse" }, { "$ref": "#/definitions/JSONRPCError" }, { "description": "A JSON-RPC batch response, as described in https://www.jsonrpc.org/specification#batch.", "items": { "anyOf": [ { "$ref": "#/definitions/JSONRPCResponse" }, { "$ref": "#/definitions/JSONRPCError" } ] }, "type": "array" } ], "description": "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent." }, "JSONRPCNotification": { "description": "A notification which does not expect a response.", "properties": { "jsonrpc": { "const": "2.0", "type": "string" }, "method": { "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "additionalProperties": {}, "description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.", "type": "object" } }, "type": "object" } }, "required": ["jsonrpc", "method"], "type": "object" }, "JSONRPCRequest": { "description": "A request that expects a response.", "properties": { "id": { "$ref": "#/definitions/RequestId" }, "jsonrpc": { "const": "2.0", "type": "string" }, "method": { "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "properties": { "progressToken": { "$ref": "#/definitions/ProgressToken", "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications." } }, "type": "object" } }, "type": "object" } }, "required": ["id", "jsonrpc", "method"], "type": "object" }, "JSONRPCResponse": { "description": "A successful (non-error) response to a request.", "properties": { "id": { "$ref": "#/definitions/RequestId" }, "jsonrpc": { "const": "2.0", "type": "string" }, "result": { "$ref": "#/definitions/Result" } }, "required": ["id", "jsonrpc", "result"], "type": "object" }, "ListPromptsRequest": { "description": "Sent from the client to request a list of prompts and prompt templates the server has.", "properties": { "method": { "const": "prompts/list", "type": "string" }, "params": { "properties": { "cursor": { "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.", "type": "string" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "ListPromptsResult": { "description": "The server's response to a prompts/list request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "nextCursor": { "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.", "type": "string" }, "prompts": { "items": { "$ref": "#/definitions/Prompt" }, "type": "array" } }, "required": ["prompts"], "type": "object" }, "ListResourceTemplatesRequest": { "description": "Sent from the client to request a list of resource templates the server has.", "properties": { "method": { "const": "resources/templates/list", "type": "string" }, "params": { "properties": { "cursor": { "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.", "type": "string" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "ListResourceTemplatesResult": { "description": "The server's response to a resources/templates/list request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "nextCursor": { "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.", "type": "string" }, "resourceTemplates": { "items": { "$ref": "#/definitions/ResourceTemplate" }, "type": "array" } }, "required": ["resourceTemplates"], "type": "object" }, "ListResourcesRequest": { "description": "Sent from the client to request a list of resources the server has.", "properties": { "method": { "const": "resources/list", "type": "string" }, "params": { "properties": { "cursor": { "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.", "type": "string" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "ListResourcesResult": { "description": "The server's response to a resources/list request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "nextCursor": { "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.", "type": "string" }, "resources": { "items": { "$ref": "#/definitions/Resource" }, "type": "array" } }, "required": ["resources"], "type": "object" }, "ListRootsRequest": { "description": "Sent from the server to request a list of root URIs from the client. Roots allow\nservers to ask for specific directories or files to operate on. A common example\nfor roots is providing a set of repositories or directories a server should operate\non.\n\nThis request is typically used when the server needs to understand the file system\nstructure or access specific locations that the client has permission to read from.", "properties": { "method": { "const": "roots/list", "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "properties": { "progressToken": { "$ref": "#/definitions/ProgressToken", "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications." } }, "type": "object" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "ListRootsResult": { "description": "The client's response to a roots/list request from the server.\nThis result contains an array of Root objects, each representing a root directory\nor file that the server can operate on.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "roots": { "items": { "$ref": "#/definitions/Root" }, "type": "array" } }, "required": ["roots"], "type": "object" }, "ListToolsRequest": { "description": "Sent from the client to request a list of tools the server has.", "properties": { "method": { "const": "tools/list", "type": "string" }, "params": { "properties": { "cursor": { "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.", "type": "string" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "ListToolsResult": { "description": "The server's response to a tools/list request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "nextCursor": { "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.", "type": "string" }, "tools": { "items": { "$ref": "#/definitions/Tool" }, "type": "array" } }, "required": ["tools"], "type": "object" }, "LoggingLevel": { "description": "The severity of a log message.\n\nThese map to syslog message severities, as specified in RFC-5424:\nhttps://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1", "enum": [ "alert", "critical", "debug", "emergency", "error", "info", "notice", "warning" ], "type": "string" }, "LoggingMessageNotification": { "description": "Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.", "properties": { "method": { "const": "notifications/message", "type": "string" }, "params": { "properties": { "data": { "description": "The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here." }, "level": { "$ref": "#/definitions/LoggingLevel", "description": "The severity of this log message." }, "logger": { "description": "An optional name of the logger issuing this message.", "type": "string" } }, "required": ["data", "level"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "ModelHint": { "description": "Hints to use for model selection.\n\nKeys not declared here are currently left unspecified by the spec and are up\nto the client to interpret.", "properties": { "name": { "description": "A hint for a model name.\n\nThe client SHOULD treat this as a substring of a model name; for example:\n - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`\n - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.\n - `claude` should match any Claude model\n\nThe client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:\n - `gemini-1.5-flash` could match `claude-3-haiku-20240307`", "type": "string" } }, "type": "object" }, "ModelPreferences": { "description": "The server's preferences for model selection, requested of the client during sampling.\n\nBecause LLMs can vary along multiple dimensions, choosing the \"best\" model is\nrarely straightforward. Different models excel in different areas—some are\nfaster but less capable, others are more capable but more expensive, and so\non. This interface allows servers to express their priorities across multiple\ndimensions to help clients make an appropriate selection for their use case.\n\nThese preferences are always advisory. The client MAY ignore them. It is also\nup to the client to decide how to interpret these preferences and how to\nbalance them against other considerations.", "properties": { "costPriority": { "description": "How much to prioritize cost when selecting a model. A value of 0 means cost\nis not important, while a value of 1 means cost is the most important\nfactor.", "maximum": 1, "minimum": 0, "type": "number" }, "hints": { "description": "Optional hints to use for model selection.\n\nIf multiple hints are specified, the client MUST evaluate them in order\n(such that the first match is taken).\n\nThe client SHOULD prioritize these hints over the numeric priorities, but\nMAY still use the priorities to select from ambiguous matches.", "items": { "$ref": "#/definitions/ModelHint" }, "type": "array" }, "intelligencePriority": { "description": "How much to prioritize intelligence and capabilities when selecting a\nmodel. A value of 0 means intelligence is not important, while a value of 1\nmeans intelligence is the most important factor.", "maximum": 1, "minimum": 0, "type": "number" }, "speedPriority": { "description": "How much to prioritize sampling speed (latency) when selecting a model. A\nvalue of 0 means speed is not important, while a value of 1 means speed is\nthe most important factor.", "maximum": 1, "minimum": 0, "type": "number" } }, "type": "object" }, "Notification": { "properties": { "method": { "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "additionalProperties": {}, "description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.", "type": "object" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "PaginatedRequest": { "properties": { "method": { "type": "string" }, "params": { "properties": { "cursor": { "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.", "type": "string" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "PaginatedResult": { "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "nextCursor": { "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.", "type": "string" } }, "type": "object" }, "PingRequest": { "description": "A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.", "properties": { "method": { "const": "ping", "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "properties": { "progressToken": { "$ref": "#/definitions/ProgressToken", "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications." } }, "type": "object" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "ProgressNotification": { "description": "An out-of-band notification used to inform the receiver of a progress update for a long-running request.", "properties": { "method": { "const": "notifications/progress", "type": "string" }, "params": { "properties": { "message": { "description": "An optional message describing the current progress.", "type": "string" }, "progress": { "description": "The progress thus far. This should increase every time progress is made, even if the total is unknown.", "type": "number" }, "progressToken": { "$ref": "#/definitions/ProgressToken", "description": "The progress token which was given in the initial request, used to associate this notification with the request that is proceeding." }, "total": { "description": "Total number of items to process (or total progress required), if known.", "type": "number" } }, "required": ["progress", "progressToken"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "ProgressToken": { "description": "A progress token, used to associate progress notifications with the original request.", "type": ["string", "integer"] }, "Prompt": { "description": "A prompt or prompt template that the server offers.", "properties": { "arguments": { "description": "A list of arguments to use for templating the prompt.", "items": { "$ref": "#/definitions/PromptArgument" }, "type": "array" }, "description": { "description": "An optional description of what this prompt provides", "type": "string" }, "name": { "description": "The name of the prompt or prompt template.", "type": "string" } }, "required": ["name"], "type": "object" }, "PromptArgument": { "description": "Describes an argument that a prompt can accept.", "properties": { "description": { "description": "A human-readable description of the argument.", "type": "string" }, "name": { "description": "The name of the argument.", "type": "string" }, "required": { "description": "Whether this argument must be provided.", "type": "boolean" } }, "required": ["name"], "type": "object" }, "PromptListChangedNotification": { "description": "An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.", "properties": { "method": { "const": "notifications/prompts/list_changed", "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "additionalProperties": {}, "description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.", "type": "object" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "PromptMessage": { "description": "Describes a message returned as part of a prompt.\n\nThis is similar to `SamplingMessage`, but also supports the embedding of\nresources from the MCP server.", "properties": { "content": { "anyOf": [ { "$ref": "#/definitions/TextContent" }, { "$ref": "#/definitions/ImageContent" }, { "$ref": "#/definitions/AudioContent" }, { "$ref": "#/definitions/EmbeddedResource" } ] }, "role": { "$ref": "#/definitions/Role" } }, "required": ["content", "role"], "type": "object" }, "PromptReference": { "description": "Identifies a prompt.", "properties": { "name": { "description": "The name of the prompt or prompt template", "type": "string" }, "type": { "const": "ref/prompt", "type": "string" } }, "required": ["name", "type"], "type": "object" }, "ReadResourceRequest": { "description": "Sent from the client to the server, to read a specific resource URI.", "properties": { "method": { "const": "resources/read", "type": "string" }, "params": { "properties": { "uri": { "description": "The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.", "format": "uri", "type": "string" } }, "required": ["uri"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "ReadResourceResult": { "description": "The server's response to a resources/read request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "contents": { "items": { "anyOf": [ { "$ref": "#/definitions/TextResourceContents" }, { "$ref": "#/definitions/BlobResourceContents" } ] }, "type": "array" } }, "required": ["contents"], "type": "object" }, "Request": { "properties": { "method": { "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "properties": { "progressToken": { "$ref": "#/definitions/ProgressToken", "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications." } }, "type": "object" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "RequestId": { "description": "A uniquely identifying ID for a request in JSON-RPC.", "type": ["string", "integer"] }, "Resource": { "description": "A known resource that the server is capable of reading.", "properties": { "annotations": { "$ref": "#/definitions/Annotations", "description": "Optional annotations for the client." }, "description": { "description": "A description of what this resource represents.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.", "type": "string" }, "mimeType": { "description": "The MIME type of this resource, if known.", "type": "string" }, "name": { "description": "A human-readable name for this resource.\n\nThis can be used by clients to populate UI elements.", "type": "string" }, "uri": { "description": "The URI of this resource.", "format": "uri", "type": "string" } }, "required": ["name", "uri"], "type": "object" }, "ResourceContents": { "description": "The contents of a specific resource or sub-resource.", "properties": { "mimeType": { "description": "The MIME type of this resource, if known.", "type": "string" }, "uri": { "description": "The URI of this resource.", "format": "uri", "type": "string" } }, "required": ["uri"], "type": "object" }, "ResourceListChangedNotification": { "description": "An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.", "properties": { "method": { "const": "notifications/resources/list_changed", "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "additionalProperties": {}, "description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.", "type": "object" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "ResourceReference": { "description": "A reference to a resource or resource template definition.", "properties": { "type": { "const": "ref/resource", "type": "string" }, "uri": { "description": "The URI or URI template of the resource.", "format": "uri-template", "type": "string" } }, "required": ["type", "uri"], "type": "object" }, "ResourceTemplate": { "description": "A template description for resources available on the server.", "properties": { "annotations": { "$ref": "#/definitions/Annotations", "description": "Optional annotations for the client." }, "description": { "description": "A description of what this template is for.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.", "type": "string" }, "mimeType": { "description": "The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.", "type": "string" }, "name": { "description": "A human-readable name for the type of resource this template refers to.\n\nThis can be used by clients to populate UI elements.", "type": "string" }, "uriTemplate": { "description": "A URI template (according to RFC 6570) that can be used to construct resource URIs.", "format": "uri-template", "type": "string" } }, "required": ["name", "uriTemplate"], "type": "object" }, "ResourceUpdatedNotification": { "description": "A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.", "properties": { "method": { "const": "notifications/resources/updated", "type": "string" }, "params": { "properties": { "uri": { "description": "The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.", "format": "uri", "type": "string" } }, "required": ["uri"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "Result": { "additionalProperties": {}, "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" } }, "type": "object" }, "Role": { "description": "The sender or recipient of messages and data in a conversation.", "enum": ["assistant", "user"], "type": "string" }, "Root": { "description": "Represents a root directory or file that the server can operate on.", "properties": { "name": { "description": "An optional name for the root. This can be used to provide a human-readable\nidentifier for the root, which may be useful for display purposes or for\nreferencing the root in other parts of the application.", "type": "string" }, "uri": { "description": "The URI identifying the root. This *must* start with file:// for now.\nThis restriction may be relaxed in future versions of the protocol to allow\nother URI schemes.", "format": "uri", "type": "string" } }, "required": ["uri"], "type": "object" }, "RootsListChangedNotification": { "description": "A notification from the client to the server, informing it that the list of roots has changed.\nThis notification should be sent whenever the client adds, removes, or modifies any root.\nThe server should then request an updated list of roots using the ListRootsRequest.", "properties": { "method": { "const": "notifications/roots/list_changed", "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "additionalProperties": {}, "description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.", "type": "object" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "SamplingMessage": { "description": "Describes a message issued to or received from an LLM API.", "properties": { "content": { "anyOf": [ { "$ref": "#/definitions/TextContent" }, { "$ref": "#/definitions/ImageContent" }, { "$ref": "#/definitions/AudioContent" } ] }, "role": { "$ref": "#/definitions/Role" } }, "required": ["content", "role"], "type": "object" }, "ServerCapabilities": { "description": "Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.", "properties": { "completions": { "additionalProperties": true, "description": "Present if the server supports argument autocompletion suggestions.", "properties": {}, "type": "object" }, "experimental": { "additionalProperties": { "additionalProperties": true, "properties": {}, "type": "object" }, "description": "Experimental, non-standard capabilities that the server supports.", "type": "object" }, "logging": { "additionalProperties": true, "description": "Present if the server supports sending log messages to the client.", "properties": {}, "type": "object" }, "prompts": { "description": "Present if the server offers any prompt templates.", "properties": { "listChanged": { "description": "Whether this server supports notifications for changes to the prompt list.", "type": "boolean" } }, "type": "object" }, "resources": { "description": "Present if the server offers any resources to read.", "properties": { "listChanged": { "description": "Whether this server supports notifications for changes to the resource list.", "type": "boolean" }, "subscribe": { "description": "Whether this server supports subscribing to resource updates.", "type": "boolean" } }, "type": "object" }, "tools": { "description": "Present if the server offers any tools to call.", "properties": { "listChanged": { "description": "Whether this server supports notifications for changes to the tool list.", "type": "boolean" } }, "type": "object" } }, "type": "object" }, "ServerNotification": { "anyOf": [ { "$ref": "#/definitions/CancelledNotification" }, { "$ref": "#/definitions/ProgressNotification" }, { "$ref": "#/definitions/ResourceListChangedNotification" }, { "$ref": "#/definitions/ResourceUpdatedNotification" }, { "$ref": "#/definitions/PromptListChangedNotification" }, { "$ref": "#/definitions/ToolListChangedNotification" }, { "$ref": "#/definitions/LoggingMessageNotification" } ] }, "ServerRequest": { "anyOf": [ { "$ref": "#/definitions/PingRequest" }, { "$ref": "#/definitions/CreateMessageRequest" }, { "$ref": "#/definitions/ListRootsRequest" } ] }, "ServerResult": { "anyOf": [ { "$ref": "#/definitions/Result" }, { "$ref": "#/definitions/InitializeResult" }, { "$ref": "#/definitions/ListResourcesResult" }, { "$ref": "#/definitions/ReadResourceResult" }, { "$ref": "#/definitions/ListPromptsResult" }, { "$ref": "#/definitions/GetPromptResult" }, { "$ref": "#/definitions/ListToolsResult" }, { "$ref": "#/definitions/CallToolResult" }, { "$ref": "#/definitions/CompleteResult" } ] }, "SetLevelRequest": { "description": "A request from the client to the server, to enable or adjust logging.", "properties": { "method": { "const": "logging/setLevel", "type": "string" }, "params": { "properties": { "level": { "$ref": "#/definitions/LoggingLevel", "description": "The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message." } }, "required": ["level"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "SubscribeRequest": { "description": "Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.", "properties": { "method": { "const": "resources/subscribe", "type": "string" }, "params": { "properties": { "uri": { "description": "The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.", "format": "uri", "type": "string" } }, "required": ["uri"], "type": "object" } }, "required": ["method", "params"], "type": "object" }, "TextContent": { "description": "Text provided to or from an LLM.", "properties": { "annotations": { "$ref": "#/definitions/Annotations", "description": "Optional annotations for the client." }, "text": { "description": "The text content of the message.", "type": "string" }, "type": { "const": "text", "type": "string" } }, "required": ["text", "type"], "type": "object" }, "TextResourceContents": { "properties": { "mimeType": { "description": "The MIME type of this resource, if known.", "type": "string" }, "text": { "description": "The text of the item. This must only be set if the item can actually be represented as text (not binary data).", "type": "string" }, "uri": { "description": "The URI of this resource.", "format": "uri", "type": "string" } }, "required": ["text", "uri"], "type": "object" }, "Tool": { "description": "Definition for a tool the client can call.", "properties": { "annotations": { "$ref": "#/definitions/ToolAnnotations", "description": "Optional additional tool information." }, "description": { "description": "A human-readable description of the tool.\n\nThis can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a \"hint\" to the model.", "type": "string" }, "inputSchema": { "description": "A JSON Schema object defining the expected parameters for the tool.", "properties": { "properties": { "additionalProperties": { "additionalProperties": true, "properties": {}, "type": "object" }, "type": "object" }, "required": { "items": { "type": "string" }, "type": "array" }, "type": { "const": "object", "type": "string" } }, "required": ["type"], "type": "object" }, "name": { "description": "The name of the tool.", "type": "string" } }, "required": ["inputSchema", "name"], "type": "object" }, "ToolAnnotations": { "description": "Additional properties describing a Tool to clients.\n\nNOTE: all properties in ToolAnnotations are **hints**. \nThey are not guaranteed to provide a faithful description of \ntool behavior (including descriptive properties like `title`).\n\nClients should never make tool use decisions based on ToolAnnotations\nreceived from untrusted servers.", "properties": { "destructiveHint": { "description": "If true, the tool may perform destructive updates to its environment.\nIf false, the tool performs only additive updates.\n\n(This property is meaningful only when `readOnlyHint == false`)\n\nDefault: true", "type": "boolean" }, "idempotentHint": { "description": "If true, calling the tool repeatedly with the same arguments \nwill have no additional effect on the its environment.\n\n(This property is meaningful only when `readOnlyHint == false`)\n\nDefault: false", "type": "boolean" }, "openWorldHint": { "description": "If true, this tool may interact with an \"open world\" of external\nentities. If false, the tool's domain of interaction is closed.\nFor example, the world of a web search tool is open, whereas that\nof a memory tool is not.\n\nDefault: true", "type": "boolean" }, "readOnlyHint": { "description": "If true, the tool does not modify its environment.\n\nDefault: false", "type": "boolean" }, "title": { "description": "A human-readable title for the tool.", "type": "string" } }, "type": "object" }, "ToolListChangedNotification": { "description": "An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.", "properties": { "method": { "const": "notifications/tools/list_changed", "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "additionalProperties": {}, "description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.", "type": "object" } }, "type": "object" } }, "required": ["method"], "type": "object" }, "UnsubscribeRequest": { "description": "Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.", "properties": { "method": { "const": "resources/unsubscribe", "type": "string" }, "params": { "properties": { "uri": { "description": "The URI of the resource to unsubscribe from.", "format": "uri", "type": "string" } }, "required": ["uri"], "type": "object" } }, "required": ["method", "params"], "type": "object" } } } ``` -------------------------------------------------------------------------------- /tests/manual/prompts/prompt-test.js: -------------------------------------------------------------------------------- ```javascript #!/usr/bin/env node /** * Task Master Prompt Template Testing Tool * * Interactive menu system for testing prompt templates with realistic data. * Tests all 8 prompt templates with multiple variants and error conditions. * * Usage: * node prompt-test.js # Interactive menu * node prompt-test.js --batch # Run all tests * node prompt-test.js --full # Run all tests with full prompts * node prompt-test.js --help # Show help */ import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; import readline from 'readline'; // Get project root and import prompt manager const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const projectRoot = path.resolve(__dirname, '../../..'); // Import prompt manager import { getPromptManager } from '../../../scripts/modules/prompt-manager.js'; const promptManager = getPromptManager(); // ANSI color codes for better output formatting const colors = { reset: '\x1b[0m', bright: '\x1b[1m', red: '\x1b[31m', green: '\x1b[32m', yellow: '\x1b[33m', blue: '\x1b[34m', magenta: '\x1b[35m', cyan: '\x1b[36m' }; // Test data for all prompt templates const sampleData = { 'add-task': { scenarios: [ { name: 'Basic Task Creation', params: { prompt: 'Implement user authentication with JWT tokens', newTaskId: 15, existingTasks: [ { id: 1, title: 'Setup Express Server', status: 'done' }, { id: 2, title: 'Setup Database Connection', status: 'done' }, { id: 14, title: 'Create User Model', status: 'pending' } ], gatheredContext: 'Project uses Express.js, MongoDB, and has existing user registration functionality.', contextFromArgs: 'Use bcrypt for password hashing and jsonwebtoken library.', priority: 'high', dependencies: [1, 2], useResearch: false }, variants: ['default'] }, { name: 'Research-Enhanced Task Creation', params: { prompt: 'Implement real-time chat feature with WebSockets', newTaskId: 20, existingTasks: [ { id: 1, title: 'Setup Express Server', status: 'done' }, { id: 18, title: 'User Authentication', status: 'done' } ], gatheredContext: 'Node.js project with Socket.io already installed.', priority: 'medium', dependencies: [18], useResearch: true }, variants: ['research'] } ] }, 'expand-task': { scenarios: [ { name: 'Basic Task Expansion', params: { task: { id: 8, title: 'Implement User Dashboard', description: 'Create a comprehensive user dashboard with analytics', details: 'Dashboard should include user profile, activity history, and statistics.' }, subtaskCount: 4, nextSubtaskId: 1, additionalContext: 'Use React components and Chart.js for visualizations.', complexityReasoningContext: '', gatheredContext: 'React application with existing user authentication and data models for user activities and preferences.', useResearch: false }, variants: ['default'] }, { name: 'Research-Enhanced Expansion', params: { task: { id: 12, title: 'Implement Microservices Architecture', description: 'Refactor monolith to microservices', details: 'Break down existing application into independently deployable services.' }, subtaskCount: 6, nextSubtaskId: 1, additionalContext: 'Current tech stack: Node.js, PostgreSQL, Redis. Consider Docker and Kubernetes.', complexityReasoningContext: '\nComplexity Analysis Reasoning: This task involves significant architectural changes requiring careful planning, service decomposition, data migration, and deployment orchestration.', gatheredContext: 'Monolithic Express.js application with tightly coupled modules, shared database, and existing API contracts that need to be maintained during migration.', useResearch: true }, variants: ['research'] }, { name: 'Complexity Report Driven', params: { task: { id: 15, title: 'Advanced Search Implementation', description: 'Implement full-text search with filters and sorting', details: 'Search should include autocomplete, faceted search, and relevance scoring.' }, subtaskCount: 5, nextSubtaskId: 1, additionalContext: 'Existing data is in PostgreSQL. Consider Elasticsearch integration.', complexityReasoningContext: '\nComplexity Analysis Reasoning: High complexity due to search infrastructure requirements, indexing strategy design, query optimization needs, and performance considerations.', gatheredContext: 'E-commerce application with product catalog, user reviews, and inventory data stored in PostgreSQL. Current simple search using LIKE queries is insufficient for growing data volume.', useResearch: false, expansionPrompt: 'Break down this complex search implementation focusing on: 1) Search infrastructure setup, 2) Indexing strategy, 3) Query optimization, 4) User interface components, 5) Performance testing and monitoring.' }, variants: ['complexity-report'] } ] }, 'analyze-complexity': { scenarios: [ { name: 'Standard Complexity Analysis', params: { tasks: [ { id: 5, title: 'Implement Payment Processing', description: 'Integrate Stripe payments with error handling and webhooks', details: 'Need to handle multiple payment methods, subscription billing, and compliance.' }, { id: 6, title: 'Add CSS Styling', description: 'Style the login form', details: 'Basic styling with CSS.' }, { id: 7, title: 'Setup CI/CD Pipeline', description: 'Configure automated testing and deployment', details: 'Multi-environment deployment with Docker and AWS.' } ], gatheredContext: 'E-commerce project using Node.js, React, and AWS infrastructure.', threshold: 6, useResearch: false }, variants: ['default'] }, { name: 'Research-Enhanced Complexity Analysis', params: { tasks: [ { id: 10, title: 'Implement Microservices Architecture', description: 'Refactor monolith to microservices using latest patterns', details: 'Break down existing application into independently deployable services following current industry standards.' }, { id: 11, title: 'AI-Powered Search Integration', description: 'Implement semantic search with AI/ML capabilities', details: 'Modern search implementation using vector databases and LLM integration.' } ], gatheredContext: 'Modern web application requiring scalable architecture and AI integration.', threshold: 7, useResearch: true, testName: 'research' }, variants: ['research'] } ] }, research: { scenarios: [ { name: 'Default Research Query', params: { query: 'What are the latest trends in full-stack JavaScript development?', gatheredContext: 'MERN stack application with microservices architecture. Looking to modernize tech stack.', detailLevel: 'medium', projectInfo: { root: '/project', taskCount: 25, fileCount: 80 } }, variants: ['default'] }, { name: 'Low Detail Research', params: { query: 'What are the best practices for implementing JWT authentication in Node.js?', gatheredContext: 'Express.js application with existing user registration. Using bcrypt for passwords.', detailLevel: 'low', projectInfo: { root: '/project', taskCount: 15, fileCount: 45 } }, variants: ['low'] }, { name: 'Medium Detail Research', params: { query: 'How to implement real-time notifications in a React application?', gatheredContext: 'React frontend with Redux state management. Backend uses Socket.io and Redis.', detailLevel: 'medium', projectInfo: { root: '/project', taskCount: 20, fileCount: 67 } }, variants: ['medium'] }, { name: 'High Detail Research', params: { query: 'Best architecture patterns for microservices with Node.js?', gatheredContext: 'Monolithic Express application being refactored. Uses PostgreSQL, Redis, and AWS infrastructure.', detailLevel: 'high', projectInfo: { root: '/project', taskCount: 35, fileCount: 120 } }, variants: ['high'] } ] }, 'parse-prd': { scenarios: [ { name: 'Standard PRD Parsing', params: { prdContent: `# Social Media Dashboard ## Overview Create a comprehensive social media management dashboard that allows users to manage multiple social platforms from a single interface. ## Features 1. Multi-platform integration (Twitter, Facebook, Instagram) 2. Post scheduling and automation 3. Analytics and reporting 4. Team collaboration features 5. Content calendar view ## Technical Requirements - React frontend with TypeScript - Node.js backend with Express - PostgreSQL database - Redis for caching - AWS deployment ## Success Metrics - Support for 3 social platforms - Handle 10,000+ scheduled posts - 99.9% uptime requirement`, numTasks: 8, nextId: 1, prdPath: 'social-media-dashboard-prd.txt', defaultTaskPriority: 'medium', research: false }, variants: ['default'] }, { name: 'Research-Enhanced PRD Parsing', params: { prdContent: `# AI-Powered E-commerce Platform ## Overview Build a next-generation e-commerce platform with AI-driven recommendations, voice search, and predictive analytics. ## Core Features 1. AI product recommendations using machine learning 2. Voice search integration with natural language processing 3. Predictive inventory management 4. Real-time fraud detection 5. Automated customer service chatbot ## Technical Requirements - Modern JavaScript framework (latest best practices) - Cloud-native architecture with microservices - AI/ML integration for recommendations and analytics - Real-time data processing pipeline - Enterprise-grade security and compliance ## Performance Goals - Sub-200ms API response times - Support for 1M+ concurrent users - 99.99% uptime SLA - Global CDN distribution`, numTasks: 10, nextId: 1, prdPath: 'ai-ecommerce-prd.txt', defaultTaskPriority: 'high', research: true }, variants: ['research'] } ] }, 'update-subtask': { scenarios: [ { name: 'Implementation Progress Update', params: { parentTask: { id: 8, title: 'Implement User Authentication', description: 'Build complete authentication system with JWT', status: 'in-progress' }, currentDetails: 'Implement JWT authentication middleware with token validation and refresh capabilities.', updatePrompt: 'Made significant progress on the authentication middleware. Successfully implemented JWT token validation and user session management. Encountered issue with token refresh mechanism - tokens were expiring too quickly. Modified the refresh logic to use sliding expiration. All tests are now passing.', useResearch: false, gatheredContext: 'Project uses Express.js and MongoDB for user data storage.' }, variants: ['default'] }, { name: 'Research-Enhanced Update', params: { parentTask: { id: 12, title: 'Implement OAuth Integration', description: 'Add OAuth 2.0 support for third-party login', status: 'in-progress' }, currentDetails: 'Implement OAuth 2.0 authentication flow with proper security measures.', updatePrompt: 'Researched latest OAuth 2.0 security best practices. Found vulnerability in current implementation regarding PKCE. Need to implement state parameter validation and secure code exchange. Updated implementation to follow RFC 7636 recommendations.', useResearch: true, gatheredContext: 'Security is critical for this project. Need to follow industry standards.' }, variants: ['research'] } ] }, 'update-task': { scenarios: [ { name: 'Task Details Update', params: { task: { id: 10, title: 'Implement Payment Processing', description: 'Integrate Stripe payment processing', details: 'Basic Stripe integration with credit card processing.', status: 'pending' }, taskJson: '{"id": 10, "title": "Implement Payment Processing", "description": "Integrate Stripe payment processing", "details": "Basic Stripe integration with credit card processing.", "status": "pending", "dependencies": [], "priority": "high"}', updatePrompt: 'After reviewing the current codebase, the payment integration needs to support additional payment methods beyond Stripe. Add support for PayPal and Apple Pay. Also need to implement webhook security validation and transaction logging for compliance.', useResearch: false, gatheredContext: 'E-commerce platform with existing user accounts and shopping cart functionality.' }, variants: ['default'] }, { name: 'Append Mode Update', params: { task: { id: 15, title: 'Database Migration System', description: 'Implement automated database schema migrations', details: 'Create migration scripts for PostgreSQL schema updates with rollback capabilities.', status: 'in-progress' }, taskJson: '{"id": 15, "title": "Database Migration System", "description": "Implement automated database schema migrations", "details": "Create migration scripts for PostgreSQL schema updates with rollback capabilities.", "status": "in-progress", "dependencies": [], "priority": "high"}', currentDetails: 'Create migration scripts for PostgreSQL schema updates with rollback capabilities.', updatePrompt: 'Discovered additional requirement for zero-downtime migrations. Research shows we need to implement blue-green deployment strategy with gradual schema changes. Added connection pooling considerations and automated testing for migration validation.', appendMode: true, useResearch: false, gatheredContext: 'Production database with strict uptime requirements and high transaction volume.' }, variants: ['append'] }, { name: 'Research-Enhanced Task Update', params: { task: { id: 12, title: 'Payment Security Compliance', description: 'Ensure payment processing meets security standards', details: 'Implement basic security measures for payment processing.', status: 'in-progress' }, taskJson: '{"id": 12, "title": "Payment Security Compliance", "description": "Ensure payment processing meets security standards", "details": "Implement basic security measures for payment processing.", "status": "in-progress", "dependencies": [10], "priority": "high"}', updatePrompt: 'Need to incorporate latest PCI DSS 4.0 compliance requirements and implement Strong Customer Authentication (SCA) for European markets. Research shows new requirements for biometric authentication and dynamic linking.', useResearch: true, gatheredContext: 'Security compliance is critical for international payment processing.' }, variants: ['research'] } ] }, 'update-tasks': { scenarios: [ { name: 'Bulk Task Updates', params: { tasks: [ { id: 5, title: 'User API Endpoints', description: 'Create REST endpoints for user operations', status: 'pending', dependencies: [], priority: 'high' }, { id: 6, title: 'Product API Integration', description: 'Integrate with product REST API', status: 'in-progress', dependencies: [5], priority: 'medium' }, { id: 7, title: 'Authentication API', description: 'Implement REST-based auth API', status: 'pending', dependencies: [], priority: 'high' } ], updatePrompt: 'Migration from REST API to GraphQL. All API-related tasks need to be updated to use GraphQL schemas, resolvers, and Apollo Client instead of traditional REST endpoints.', useResearch: false, projectContext: 'Full-stack application migrating from REST to GraphQL for better data fetching.' }, variants: ['default'] } ] } }; // Interactive menu system class PromptTestMenu { constructor() { this.rl = readline.createInterface({ input: process.stdin, output: process.stdout }); this.promptManager = getPromptManager(); this.showFullPrompts = true; } async start() { console.log( `${colors.cyan}${colors.bright}=== Task Master Prompt Template Testing Menu ===${colors.reset}\n` ); await this.showMainMenu(); } async showMainMenu() { console.clear(); console.log( `${colors.cyan}=== Task Master Prompt Template Testing Menu ===${colors.reset}\n` ); console.log('Main Menu:'); console.log(' 1. Test specific prompt template'); console.log(' 2. Run all tests'); console.log( ` 3. Toggle full prompt display (currently: ${this.showFullPrompts ? 'ON' : 'OFF'})` ); console.log(' 4. Generate HTML report'); console.log(' 5. Exit'); const choice = await this.getInput('\nSelect an option (1-5): '); switch (choice) { case '1': await this.showTemplateMenu(); break; case '2': await this.runAllTests(); break; case '3': this.showFullPrompts = !this.showFullPrompts; console.log( `${colors.green}Full prompt display ${this.showFullPrompts ? 'enabled' : 'disabled'}${colors.reset}` ); await this.waitForEnter(); await this.showMainMenu(); break; case '4': await this.generateHTMLReport(); break; case '5': console.log('Goodbye!'); this.rl.close(); return; default: console.log( `${colors.red}Invalid option. Please try again.${colors.reset}` ); await this.waitForEnter(); await this.showMainMenu(); } } async showTemplateMenu() { const templates = [ { key: 'add-task', name: 'Add Task', variants: ['default', 'research'] }, { key: 'expand-task', name: 'Expand Task', variants: ['default', 'research', 'complexity-report'] }, { key: 'analyze-complexity', name: 'Analyze Complexity', variants: ['default', 'research'] }, { key: 'research', name: 'Research', variants: ['default', 'low', 'medium', 'high'] }, { key: 'parse-prd', name: 'Parse PRD', variants: ['default', 'research'] }, { key: 'update-subtask', name: 'Update Subtask', variants: ['default', 'research'] }, { key: 'update-task', name: 'Update Task', variants: ['default', 'append', 'research'] }, { key: 'update-tasks', name: 'Update Tasks', variants: ['default'] } ]; console.log( `${colors.bright}Select a prompt template to test:${colors.reset}` ); templates.forEach((template, index) => { console.log( ` ${index + 1}. ${template.name} (${template.variants.join(', ')})` ); }); console.log(` ${templates.length + 1}. Back to main menu`); console.log(); const choice = await this.prompt( `Select template (1-${templates.length + 1}): ` ); const choiceNum = parseInt(choice.trim()); if (choiceNum >= 1 && choiceNum <= templates.length) { const selectedTemplate = templates[choiceNum - 1]; await this.showVariantMenu(selectedTemplate); } else if (choiceNum === templates.length + 1) { await this.showMainMenu(); } else { console.log( `${colors.red}Invalid option. Please try again.${colors.reset}\n` ); await this.showTemplateMenu(); } } async showVariantMenu(template) { console.log( `${colors.bright}${template.name} - Select variant:${colors.reset}` ); template.variants.forEach((variant, index) => { console.log(` ${index + 1}. ${variant}`); }); console.log(` ${template.variants.length + 1}. Test all variants`); console.log(` ${template.variants.length + 2}. Back to template menu`); console.log(); const choice = await this.prompt( `Select variant (1-${template.variants.length + 2}): ` ); const choiceNum = parseInt(choice.trim()); if (choiceNum >= 1 && choiceNum <= template.variants.length) { const selectedVariant = template.variants[choiceNum - 1]; await this.runSingleTest(template.key, selectedVariant); } else if (choiceNum === template.variants.length + 1) { console.log( `${colors.cyan}Testing all variants for ${template.name}...${colors.reset}\n` ); for (const variant of template.variants) { await this.runSingleTest(template.key, variant); console.log(); // Extra spacing between variants } } else if (choiceNum === template.variants.length + 2) { await this.showTemplateMenu(); } else { console.log( `${colors.red}Invalid option. Please try again.${colors.reset}\n` ); await this.showVariantMenu(template); } // After running test(s), show options to continue await this.showPostTestMenu(template); } async showPostTestMenu(template) { console.log( `${colors.bright}What would you like to do next?${colors.reset}` ); console.log(' 1. Test another variant of this template'); console.log(' 2. Choose a different template'); console.log(' 3. Back to main menu'); console.log(); const choice = await this.prompt('Select option (1-3): '); switch (choice.trim()) { case '1': await this.showVariantMenu(template); break; case '2': await this.showTemplateMenu(); break; case '3': await this.showMainMenu(); break; default: console.log( `${colors.red}Invalid option. Please try again.${colors.reset}\n` ); await this.showPostTestMenu(template); } } async runSingleTest(templateKey, variant) { console.log( `${colors.magenta}${colors.bright}Testing ${templateKey} - ${variant} variant${colors.reset}` ); console.log('='.repeat(60)); try { // Handle special research mode variants let actualVariant = variant; let useResearch = false; let research = false; let detailLevel = null; if ( (templateKey === 'add-task' || templateKey === 'analyze-complexity' || templateKey === 'update-subtask' || templateKey === 'update-task' || templateKey === 'update-tasks') && variant === 'research' ) { actualVariant = 'default'; useResearch = true; } if (templateKey === 'parse-prd' && variant === 'research') { actualVariant = 'default'; research = true; } if ( templateKey === 'research' && ['low', 'medium', 'high'].includes(variant) ) { actualVariant = 'default'; detailLevel = variant; } const testData = getTestDataForTemplate(templateKey, actualVariant); // Override useResearch, research, or detailLevel if needed if (useResearch) { testData.params.useResearch = true; } if (research) { testData.params.research = true; } if (detailLevel) { testData.params.detailLevel = detailLevel; } const result = await this.promptManager.loadPrompt( templateKey, testData.params, templateVariant ); console.log( `${colors.green}✓ SUCCESS${colors.reset} - Template loaded and processed successfully` ); console.log(`${colors.bright}Parameters used:${colors.reset}`); console.log(JSON.stringify(testData.params, null, 2)); if (this.showFullPrompts) { console.log(`\n${colors.bright}System Prompt:${colors.reset}`); console.log('-'.repeat(40)); console.log(result.systemPrompt); console.log(`\n${colors.bright}User Prompt:${colors.reset}`); console.log('-'.repeat(40)); console.log(result.userPrompt); } else { console.log(`\n${colors.bright}System Prompt Preview:${colors.reset}`); console.log(result.systemPrompt.substring(0, 200) + '...'); console.log(`\n${colors.bright}User Prompt Preview:${colors.reset}`); console.log(result.userPrompt.substring(0, 200) + '...'); console.log( `\n${colors.yellow}Tip: Use option 3 in main menu to toggle full prompt display${colors.reset}` ); } } catch (error) { console.log(`${colors.red}✗ FAILED${colors.reset} - ${error.message}`); if (error.stack) { console.log(`${colors.red}Stack trace:${colors.reset}`); console.log(error.stack); } } console.log('='.repeat(60)); } async runAllTests() { console.log( `${colors.cyan}Running all comprehensive tests...${colors.reset}\n` ); const results = await runComprehensiveTests(true); console.log(`\n${colors.bright}Test Results Summary:${colors.reset}`); console.log(`Total tests: ${results.total}`); console.log(`Passed: ${colors.green}${results.passed}${colors.reset}`); console.log(`Failed: ${colors.red}${results.failed}${colors.reset}`); if (results.failedTests.length > 0) { console.log(`\n${colors.red}Failed tests:${colors.reset}`); results.failedTests.forEach((test) => { console.log(` - ${test.template} (${test.variant}): ${test.error}`); }); } console.log(); await this.prompt('Press Enter to continue...'); await this.showMainMenu(); } prompt(question) { return new Promise((resolve) => { this.rl.question(question, resolve); }); } async getInput(question) { const answer = await this.prompt(question); return answer.trim(); } async waitForEnter() { await this.prompt('Press Enter to continue...'); } async generateHTMLReport() { const { filepath, results } = await generateAndSaveHTMLReport(); await this.waitForEnter(); await this.showMainMenu(); } } // Helper function to get test data for a specific template and variant function getTestDataForTemplate(templateKey, variant) { if (!sampleData[templateKey] || !sampleData[templateKey].scenarios) { return { name: 'Unknown Template', params: {} }; } // Find appropriate scenario for this variant const scenario = sampleData[templateKey].scenarios.find((s) => s.variants.includes(variant) ); // If no scenario found for this variant, use the first scenario but mark it as a test case if (!scenario) { const firstScenario = sampleData[templateKey].scenarios[0]; if (!firstScenario) { return { name: 'No Scenarios', params: {} }; } return { name: `${firstScenario.name} (variant test)`, params: firstScenario.params }; } return { name: scenario.name, params: scenario.params }; } // Run all comprehensive tests async function runComprehensiveTests(generateDetailed = false) { console.log('Task Master Prompt Template Comprehensive Test'); console.log('=============================================\n'); let passed = 0; let failed = 0; const failedTests = []; const detailedResults = []; // Test all combinations const testCases = [ { template: 'add-task', variant: 'default' }, { template: 'add-task', variant: 'default', useResearch: true, testName: 'research' }, { template: 'expand-task', variant: 'default' }, { template: 'expand-task', variant: 'research' }, { template: 'expand-task', variant: 'complexity-report' }, { template: 'analyze-complexity', variant: 'default' }, { template: 'analyze-complexity', variant: 'default', useResearch: true, testName: 'research' }, { template: 'research', variant: 'default', detailLevel: 'low', testName: 'low' }, { template: 'research', variant: 'default', detailLevel: 'medium', testName: 'medium' }, { template: 'research', variant: 'default', detailLevel: 'high', testName: 'high' }, { template: 'parse-prd', variant: 'default' }, { template: 'parse-prd', variant: 'default', research: true, testName: 'research' }, { template: 'update-subtask', variant: 'default' }, { template: 'update-subtask', variant: 'default', useResearch: true, testName: 'research' }, { template: 'update-task', variant: 'default' }, { template: 'update-task', variant: 'append' }, { template: 'update-task', variant: 'default', useResearch: true, testName: 'research' }, { template: 'update-tasks', variant: 'default' }, // Conditional logic tests for new helper functions { template: 'parse-prd', variant: 'default', customData: { name: 'Test Zero Tasks Conditional Logic', params: { prdContent: 'Test PRD content for zero tasks validation', numTasks: 0, nextId: 1, prdPath: 'test-zero-tasks.txt', defaultTaskPriority: 'medium', research: false } }, testName: 'conditional-zero-tasks', validateOutput: (result) => { return ( result.systemPrompt.includes('an appropriate number of') && !result.systemPrompt.includes('approximately 0') ); } }, { template: 'expand-task', variant: 'default', customData: { name: 'Test Zero Subtasks Conditional Logic', params: { task: { id: 99, title: 'Test Zero Subtasks Conditional', description: 'Test conditional logic with zero subtasks', details: 'Testing gt helper with zero value' }, subtaskCount: 0, nextSubtaskId: 1, additionalContext: 'Testing conditional logic', complexityReasoningContext: '', gatheredContext: 'Test context' } }, testName: 'conditional-zero-subtasks', validateOutput: (result) => { return ( result.systemPrompt.includes('an appropriate number of') && !result.systemPrompt.includes('0 specific subtasks') ); } }, { template: 'parse-prd', variant: 'default', customData: { name: 'Test Positive Tasks Conditional Logic', params: { prdContent: 'Test PRD content for positive tasks validation', numTasks: 5, nextId: 1, prdPath: 'test-positive-tasks.txt', defaultTaskPriority: 'medium', research: false } }, testName: 'conditional-positive-tasks', validateOutput: (result) => { return ( result.systemPrompt.includes('approximately 5') && !result.systemPrompt.includes('an appropriate number of') ); } }, { template: 'expand-task', variant: 'default', customData: { name: 'Test Positive Subtasks Conditional Logic', params: { task: { id: 98, title: 'Test Positive Subtasks Conditional', description: 'Test conditional logic with positive subtasks', details: 'Testing gt helper with positive value' }, subtaskCount: 3, nextSubtaskId: 1, additionalContext: 'Testing conditional logic', complexityReasoningContext: '', gatheredContext: 'Test context' } }, testName: 'conditional-positive-subtasks', validateOutput: (result) => { return ( result.systemPrompt.includes('3 specific subtasks') && !result.systemPrompt.includes('an appropriate number of') ); } }, // Error condition tests { template: 'expand-task', variant: 'nonexistent', expectError: true }, { template: 'nonexistent-template', variant: 'default', expectError: true }, { template: 'parse-prd', variant: 'default', params: {}, expectError: true }, { template: 'add-task', variant: 'default', params: { prompt: '' }, expectError: true }, { template: 'research', variant: 'default', detailLevel: 'invalid-detail', expectError: true, testName: 'invalid-detail' } ]; for (const testCase of testCases) { try { // Handle variant conversion for comprehensive tests let scenarioVariant = testCase.variant; let templateVariant = testCase.variant; // For templates using detail levels, convert to default with detailLevel param if ( testCase.template === 'research' && ['low', 'medium', 'high'].includes(testCase.variant) ) { templateVariant = 'default'; } // For consolidated templates, convert research variant to default for template loading only if ( (testCase.template === 'add-task' || testCase.template === 'analyze-complexity' || testCase.template === 'update-subtask' || testCase.template === 'update-task' || testCase.template === 'parse-prd') && testCase.variant === 'research' ) { templateVariant = 'default'; } // Get test data using scenario variant (research scenarios will be found correctly) const testData = testCase.customData || (testCase.params ? { name: 'Custom Test Data', params: testCase.params } : null) || getTestDataForTemplate(testCase.template, scenarioVariant); // Override test data with custom parameters if specified if (testCase.useResearch !== undefined) { testData.params.useResearch = testCase.useResearch; } if (testCase.research !== undefined) { testData.params.research = testCase.research; } if (testCase.detailLevel !== undefined) { testData.params.detailLevel = testCase.detailLevel; } const result = await promptManager.loadPrompt( testCase.template, testData.params, templateVariant ); const displayName = testCase.testName || testCase.variant; if (testCase.expectError) { console.log( `✗ FAILED - ${testCase.template} (${displayName}): Expected error but test passed` ); failedTests.push({ template: testCase.template, variant: displayName, error: 'Expected error but test passed' }); failed++; if (generateDetailed) { detailedResults.push({ template: testCase.template, variant: displayName, success: false, expectedError: true, error: 'Expected error but test passed' }); } } else { // Check output validation if provided let validationPassed = true; let validationError = null; if (testCase.validateOutput) { try { validationPassed = testCase.validateOutput(result); if (!validationPassed) { validationError = 'Output validation failed - conditional logic did not produce expected content'; } } catch (error) { validationPassed = false; validationError = `Output validation error: ${error.message}`; } } if (validationPassed) { console.log(`✓ PASSED - ${testCase.template} (${displayName})`); passed++; if (generateDetailed) { detailedResults.push({ template: testCase.template, variant: displayName, success: true, prompts: { systemPrompt: result.systemPrompt, userPrompt: result.userPrompt } }); } } else { console.log( `✗ FAILED - ${testCase.template} (${displayName}): ${validationError}` ); failedTests.push({ template: testCase.template, variant: displayName, error: validationError }); failed++; if (generateDetailed) { detailedResults.push({ template: testCase.template, variant: displayName, success: false, error: validationError, prompts: { systemPrompt: result.systemPrompt, userPrompt: result.userPrompt } }); } } } } catch (error) { const displayName = testCase.testName || testCase.variant; if (testCase.expectError) { console.log( `✓ PASSED - ${testCase.template} (${displayName}): Expected error occurred` ); passed++; if (generateDetailed) { detailedResults.push({ template: testCase.template, variant: displayName, success: true, expectedError: true, error: error.message }); } } else { console.log( `✗ FAILED - ${testCase.template} (${displayName}): ${error.message}` ); failedTests.push({ template: testCase.template, variant: displayName, error: error.message }); failed++; if (generateDetailed) { detailedResults.push({ template: testCase.template, variant: displayName, success: false, error: error.message }); } } } } const total = passed + failed; const results = { passed, failed, total, failedTests }; if (generateDetailed) { results.detailedResults = detailedResults; } return results; } // Test a specific template and variant async function testSpecificTemplate( templateKey, variant, showFullOutput = false ) { console.log( `${colors.cyan}Testing: ${templateKey} (${variant})${colors.reset}\n` ); try { // Handle special research mode variants for template loading let actualVariant = variant; let detailLevel = null; // For templates with separate research scenarios, keep the research variant // For templates using detail levels, convert to default with detailLevel param if ( templateKey === 'research' && ['low', 'medium', 'high'].includes(variant) ) { actualVariant = 'default'; detailLevel = variant; } // Get test data using the actual variant (research scenarios will be found) const testData = getTestDataForTemplate(templateKey, actualVariant); // For consolidated templates, convert research variant to default for template loading let templateVariant = actualVariant; if ( (templateKey === 'add-task' || templateKey === 'analyze-complexity' || templateKey === 'update-subtask' || templateKey === 'update-task' || templateKey === 'parse-prd') && variant === 'research' ) { templateVariant = 'default'; } // Override detailLevel if needed for research template if (detailLevel) { testData.params.detailLevel = detailLevel; } const result = await promptManager.loadPrompt( templateKey, testData.params, templateVariant ); console.log(`${colors.green}✓ SUCCESS${colors.reset}\n`); console.log(`${colors.bright}Template:${colors.reset} ${templateKey}`); console.log(`${colors.bright}Variant:${colors.reset} ${variant}`); console.log(`${colors.bright}Test Data:${colors.reset} ${testData.name}\n`); if (showFullOutput) { console.log(`${colors.bright}=== SYSTEM PROMPT ===${colors.reset}`); console.log(result.systemPrompt); console.log(`\n${colors.bright}=== USER PROMPT ===${colors.reset}`); console.log(result.userPrompt); } else { console.log(`${colors.bright}System Prompt Preview:${colors.reset}`); console.log(result.systemPrompt.substring(0, 200) + '...'); console.log(`\n${colors.bright}User Prompt Preview:${colors.reset}`); console.log(result.userPrompt.substring(0, 200) + '...'); } } catch (error) { console.log(`${colors.red}✗ FAILED: ${error.message}${colors.reset}`); return false; } return true; } // Main execution async function main() { const args = process.argv.slice(2); if (args.includes('--help') || args.includes('-h')) { console.log(`Task Master Prompt Template Testing Tool Usage: node prompt-test.js [options] Options: --help, -h Show this help message --full Run all tests and show full prompts --batch Run all tests in batch mode (non-interactive) --html Generate HTML report and open in browser --test <template>:<variant> Test specific template variant (e.g., --test add-task:default) Interactive Mode: Run without arguments to start the interactive menu system. Examples: node prompt-test.js # Interactive menu node prompt-test.js --batch # Run all tests node prompt-test.js --full # Run all tests with full prompts node prompt-test.js --html # Generate HTML report node prompt-test.js --test add-task:default # Test specific template`); process.exit(0); } const showFullPrompts = args.includes('--full'); const batchMode = args.includes('--batch'); const htmlMode = args.includes('--html'); const testArg = args.find((arg) => arg.startsWith('--test')); if (testArg) { let templateVariant; if (testArg.includes('=')) { // Handle --test=template:variant format templateVariant = testArg.split('=')[1]; } else { // Handle --test template:variant format const testIndex = args.indexOf('--test'); templateVariant = args[testIndex + 1]; } if (!templateVariant) { console.error( 'Usage: --test template:variant (e.g., --test add-task:default)' ); process.exit(1); } const [templateKey, variant] = templateVariant.split(':'); await testSpecificTemplate(templateKey, variant || 'default', true); process.exit(0); } if (htmlMode) { await generateAndSaveHTMLReport(); process.exit(0); } if (batchMode) { const results = await runComprehensiveTests(true); console.log(`\nTest Results: ${results.passed}/${results.total} passed`); process.exit(results.failed > 0 ? 1 : 0); } else if (showFullPrompts) { // Legacy full test mode const results = await runComprehensiveTests(true); console.log(`\nTest Results: ${results.passed}/${results.total} passed`); // Show sample full prompts console.log('\n=== Sample Full Prompts ===\n'); try { const promptManager = getPromptManager(); const testData = getTestDataForTemplate('add-task', 'default'); const result = await promptManager.loadPrompt( 'add-task', testData.params, 'default' ); console.log('System Prompt (add-task, default):'); console.log('-'.repeat(40)); console.log(result.systemPrompt); console.log('\nUser Prompt (add-task, default):'); console.log('-'.repeat(40)); console.log(result.userPrompt); } catch (error) { console.log('Error showing sample prompts:', error.message); } } else { // Interactive mode const menu = new PromptTestMenu(); await menu.start(); } } // Run if called directly if (import.meta.url === `file://${process.argv[1]}`) { main().catch(console.error); } export { runComprehensiveTests, getTestDataForTemplate }; // HTML report generation function generateHTMLReport(testResults, templateResults = []) { const timestamp = new Date().toISOString(); const passed = testResults.passed; const total = testResults.total; const failed = testResults.failed; // Helper function to generate consistent anchor IDs function generateAnchorId(template, variant) { return `test-${template.replace(/[^a-zA-Z0-9]/g, '_')}-${variant.replace(/[^a-zA-Z0-9]/g, '_')}`; } // Sort template results alphabetically by template name, then by variant const sortedResults = [...templateResults].sort((a, b) => { if (a.template !== b.template) { return a.template.localeCompare(b.template); } return a.variant.localeCompare(b.variant); }); let html = `<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Task Master Prompt Template Test Report</title> <style> body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 0; padding: 20px; background: #f5f5f5; } .container { max-width: 1200px; margin: 0 auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .header { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 2px solid #eee; } .title { color: #2c3e50; margin: 0; font-size: 2.5em; font-weight: 300; } .subtitle { color: #7f8c8d; margin: 10px 0; font-size: 1.1em; } .summary { display: flex; justify-content: center; gap: 30px; margin: 30px 0; flex-wrap: wrap; } .stat { text-align: center; padding: 20px; border-radius: 8px; min-width: 120px; } .stat.passed { background: #d4edda; color: #155724; } .stat.failed { background: #f8d7da; color: #721c24; } .stat.total { background: #e2e3e5; color: #383d41; } .stat-number { font-size: 2em; font-weight: bold; margin: 0; } .stat-label { margin: 5px 0 0 0; font-size: 0.9em; text-transform: uppercase; letter-spacing: 1px; } .test-section { margin: 40px 0; } .test-grid { display: block; } .test-grid .test-case { margin-bottom: 16px; } .section-title { color: #2c3e50; border-bottom: 1px solid #bdc3c7; padding-bottom: 10px; margin-bottom: 20px; font-size: 1.5em; } .summary-section { margin: 20px 0; } .template-group { margin: 4px 0; padding: 6px 10px; border-radius: 4px; background: #f8f9fa; border-left: 3px solid #dee2e6; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .template-name { font-size: 0.9em; font-weight: 600; color: #2c3e50; margin-right: 4px; } .template-status { padding: 2px 6px; border-radius: 8px; font-size: 0.7em; font-weight: 600; text-transform: uppercase; margin-left: auto; flex-shrink: 0; } .template-status.passed { background: #d4edda; color: #155724; } .template-status.failed { background: #f8d7da; color: #721c24; } .variant-item { padding: 2px 6px; border-radius: 3px; background: white; border: 1px solid #e9ecef; font-size: 0.75em; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; } .variant-item.passed { border-left: 2px solid #28a745; color: #155724; } .variant-item.failed { border-left: 2px solid #dc3545; color: #721c24; background: #fff5f5; } .variant-name { font-weight: 500; } .variant-name a { text-decoration: none; color: inherit; } .variant-name a:hover { text-decoration: underline; } .variant-badge { font-size: 0.8em; font-weight: bold; } .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-bottom: 30px; } .summary-item { padding: 15px; border-radius: 8px; border-left: 4px solid #3498db; background: #f8f9fa; display: flex; justify-content: space-between; align-items: center; } .summary-item.passed { border-left-color: #28a745; } .summary-item.failed { border-left-color: #dc3545; background: #fff5f5; } .summary-name { font-weight: 600; color: #2c3e50; } .summary-status { padding: 4px 8px; border-radius: 15px; font-size: 0.75em; font-weight: 600; text-transform: uppercase; } .summary-status.passed { background: #d4edda; color: #155724; } .summary-status.failed { background: #f8d7da; color: #721c24; } .test-case { margin: 8px 0; padding: 12px 16px; border-radius: 6px; border-left: 4px solid #3498db; background: #f8f9fa; } .test-case.passed { border-left-color: #28a745; } .test-case.failed { border-left-color: #dc3545; background: #fff5f5; } .test-header { margin-bottom: 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; } .test-name { font-weight: 600; color: #2c3e50; font-size: 1em; margin: 0; flex-shrink: 0; } .test-status { padding: 4px 8px; border-radius: 12px; font-size: 0.7em; font-weight: 600; text-transform: uppercase; display: inline-block; flex-shrink: 0; } .test-status.passed { background: #d4edda; color: #155724; } .test-status.failed { background: #f8d7da; color: #721c24; } .prompt-section { margin-top: 20px; } .prompt-title { font-weight: 600; color: #495057; margin: 20px 0 10px 0; font-size: 1em; text-transform: uppercase; letter-spacing: 0.5px; } .prompt-content { background: #f1f3f4; padding: 20px; border-radius: 6px; font-family: 'Monaco', 'Menlo', 'Consolas', monospace; font-size: 0.9em; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; border: 1px solid #e9ecef; overflow-x: auto; } .error-message { color: #dc3545; font-style: italic; margin-top: 15px; padding: 10px; background: #fff5f5; border-radius: 4px; } .toggle-button { background: #007bff; color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; font-size: 0.75em; margin: 0; transition: all 0.2s ease; margin-left: auto; min-height: 44px; min-width: 44px; touch-action: manipulation; user-select: none; } .toggle-button:hover { background: #0056b3; transform: translateY(-1px); } .toggle-button:active { background: #004085; transform: translateY(0); } .toggle-button:focus { outline: 2px solid #80bdff; outline-offset: 2px; } .toggle-content { display: none; margin-top: 8px; } .toggle-content.expanded { display: block; } .footer { text-align: center; margin-top: 50px; padding-top: 20px; border-top: 1px solid #eee; color: #6c757d; font-size: 0.9em; } .divider { height: 2px; background: linear-gradient(to right, #e9ecef, #dee2e6, #e9ecef); margin: 40px 0; border-radius: 1px; } .error-tests-section { margin: 20px 0; } .error-section-title { color: #856404; font-size: 1.1em; font-weight: 600; margin-bottom: 10px; border-bottom: 1px solid #ffc107; padding-bottom: 5px; } .error-group { margin: 4px 0; padding: 6px 10px; border-radius: 4px; background: #fff3cd; border-left: 3px solid #ffc107; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } /* Mobile Responsive Styles */ @media (max-width: 768px) { body { padding: 15px; } .container { padding: 20px; } .header { margin-bottom: 25px; padding-bottom: 15px; } .title { font-size: 2em; line-height: 1.2; } .subtitle { font-size: 0.95em; } .summary { gap: 20px; margin: 25px 0; } .stat { min-width: 90px; padding: 12px 8px; } .stat-number { font-size: 1.6em; } .stat-label { font-size: 0.75em; } .section-title { font-size: 1.25em; } .test-section { margin: 25px 0; } .test-grid .test-case { margin-bottom: 10px; } .template-group { gap: 4px; padding: 8px 12px; align-items: center; } .template-name { font-size: 0.85em; flex-shrink: 0; } .template-status { font-size: 0.65em; padding: 3px 6px; flex-shrink: 0; } .variant-item { margin: 1px; padding: 3px 5px; font-size: 0.7em; min-height: 24px; flex-shrink: 0; } .summary-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; } .test-case { margin: 6px 0; padding: 8px 12px; } .test-header { gap: 6px; justify-content: space-between; } .test-name { font-size: 0.9em; } .test-status { font-size: 0.65em; padding: 3px 6px; } .toggle-button { padding: 6px 10px; font-size: 0.7em; min-height: 38px; min-width: 38px; touch-action: manipulation; } .prompt-content { padding: 12px; font-size: 0.75em; } .prompt-title { font-size: 0.85em; margin: 12px 0 6px 0; } .divider { margin: 25px 0; } .footer { margin-top: 25px; font-size: 0.8em; } } @media (max-width: 480px) { body { padding: 10px; } .container { padding: 15px; } .title { font-size: 1.7em; } .summary { gap: 12px; } .stat { min-width: 75px; padding: 10px 6px; } .stat-number { font-size: 1.4em; } .stat-label { font-size: 0.7em; } .template-group { gap: 3px; align-items: center; } .template-name { font-size: 0.8em; flex-shrink: 0; } .template-status { font-size: 0.6em; padding: 2px 4px; flex-shrink: 0; } .variant-item { font-size: 0.65em; padding: 2px 4px; min-height: 20px; } .test-header { gap: 4px; justify-content: space-between; align-items: center; } .test-name { font-size: 0.85em; } .test-status { font-size: 0.6em; padding: 2px 4px; } .toggle-button { padding: 6px 10px; font-size: 0.7em; min-height: 40px; min-width: 40px; touch-action: manipulation; } .prompt-content { padding: 10px; font-size: 0.7em; line-height: 1.3; } .test-case { padding: 6px 8px; } .test-grid .test-case { margin-bottom: 8px; } } /* Touch-friendly enhancements */ @media (hover: none) and (pointer: coarse) { .variant-name a { padding: 6px; margin: -6px; min-height: 44px; display: inline-flex; align-items: center; } .toggle-button { min-height: 44px; min-width: 44px; } .toggle-button:hover { transform: none; } /* Disable hover effects on touch devices */ } </style> <script> function togglePrompts(buttonId) { const button = document.getElementById(buttonId); const content = document.getElementById(buttonId + '-content'); if (content.classList.contains('expanded')) { content.classList.remove('expanded'); button.textContent = 'Show Prompts'; button.style.background = '#007bff'; } else { content.classList.add('expanded'); button.textContent = 'Hide Prompts'; button.style.background = '#6c757d'; } } </script> </head> <body> <div class="container"> <div class="header"> <h1 class="title">Task Master Prompt Template Test Report</h1> <p class="subtitle">Generated on ${timestamp}</p> </div> <div class="summary"> <div class="stat total"> <p class="stat-number">${total}</p> <p class="stat-label">Total Tests</p> </div> <div class="stat passed"> <p class="stat-number">${passed}</p> <p class="stat-label">Passed</p> </div> <div class="stat failed"> <p class="stat-number">${failed}</p> <p class="stat-label">Failed</p> </div> </div>`; if (sortedResults.length > 0) { // Separate real templates from error condition tests const realTemplateResults = sortedResults.filter( (result) => !result.expectedError && result.template !== 'nonexistent-template' && !( result.template === 'research' && result.testName === 'invalid-detail' ) && !(result.template === 'expand-task' && result.variant === 'nonexistent') ); const errorConditionResults = sortedResults.filter( (result) => result.expectedError || result.template === 'nonexistent-template' || (result.template === 'research' && result.testName === 'invalid-detail') || (result.template === 'expand-task' && result.variant === 'nonexistent') ); // Group real template results by template const groupedResults = {}; realTemplateResults.forEach((result) => { if (!groupedResults[result.template]) { groupedResults[result.template] = []; } groupedResults[result.template].push(result); }); // Test Results Summary Section for Real Templates html += ` <div class="summary-section"> <h2 class="section-title">Test Results Summary</h2>`; Object.keys(groupedResults) .sort() .forEach((templateName) => { const templateResults = groupedResults[templateName]; const passedCount = templateResults.filter((r) => r.success).length; const totalCount = templateResults.length; const allPassed = passedCount === totalCount; html += ` <div class="template-group"> <span class="template-name">${templateName}:</span>`; templateResults.forEach((result) => { const status = result.success ? 'passed' : 'failed'; const badge = result.success ? '✓' : '✗'; const anchorId = generateAnchorId(result.template, result.variant); html += ` <span class="variant-item ${status}"> <span class="variant-name"><a href="#${anchorId}">${result.variant}</a></span> <span class="variant-badge">${badge}</span> </span>`; }); html += ` <span class="template-status ${allPassed ? 'passed' : 'failed'}">${passedCount}/${totalCount} passed</span> </div>`; }); // Error Condition Tests Section if (errorConditionResults.length > 0) { html += ` </div> <div class="error-tests-section"> <h3 class="error-section-title">Error Condition Tests</h3> <div class="error-group">`; errorConditionResults.forEach((result) => { const status = result.success ? 'passed' : 'failed'; const badge = result.success ? '✓' : '✗'; let testName = ''; if (result.template === 'nonexistent-template') { testName = 'nonexistent-template'; } else if ( result.template === 'expand-task' && result.variant === 'nonexistent' ) { testName = 'nonexistent-variant'; } else if (result.template === 'parse-prd' && result.error) { testName = 'missing-parameters'; } else if ( result.template === 'add-task' && result.error && result.error.includes('prompt') ) { testName = 'empty-prompt'; } else if ( result.template === 'research' && result.variant === 'invalid-detail' ) { testName = 'invalid-variant'; } else { testName = `${result.template}-${result.variant}`; } html += ` <span class="variant-item ${status}"> <span class="variant-name">${testName}</span> <span class="variant-badge">${badge}</span> </span>`; }); const errorPassedCount = errorConditionResults.filter( (r) => r.success ).length; const errorTotalCount = errorConditionResults.length; const allErrorsPassed = errorPassedCount === errorTotalCount; html += ` <span class="template-status ${allErrorsPassed ? 'passed' : 'failed'}">${errorPassedCount}/${errorTotalCount} passed</span> </div> </div>`; } html += ` <div class="divider"></div>`; // Detailed Prompts Section html += ` <div class="test-section"> <h2 class="section-title">Detailed Prompt Content</h2> <div class="test-grid">`; realTemplateResults.forEach((result, index) => { const status = result.success ? 'passed' : 'failed'; const anchorId = generateAnchorId(result.template, result.variant); html += ` <div class="test-case ${status}" id="${anchorId}"> <div class="test-header"> <div class="test-name">${result.template} (${result.variant})</div> <span class="test-status ${status}">${status}</span>`; if (result.success && result.prompts) { const safeTemplate = (result.template || 'unknown').replace( /[^a-zA-Z0-9]/g, '_' ); const safeVariant = (result.variant || 'default').replace( /[^a-zA-Z0-9]/g, '_' ); const toggleId = `toggle-${safeTemplate}-${safeVariant}-${index}`; html += ` <button class="toggle-button" id="${toggleId}" onclick="togglePrompts('${toggleId}')">Show Prompts</button> </div> <div class="toggle-content" id="${toggleId}-content"> <div class="prompt-section"> <div class="prompt-title">System Prompt</div> <div class="prompt-content">${escapeHtml(result.prompts.systemPrompt)}</div> </div> <div class="prompt-section"> <div class="prompt-title">User Prompt</div> <div class="prompt-content">${escapeHtml(result.prompts.userPrompt)}</div> </div> </div>`; } else { html += ` </div>`; } if (!result.success) { html += `<div class="error-message">Error: ${escapeHtml(result.error)}</div>`; } html += `</div>`; }); html += `</div></div>`; } html += ` <div class="footer"> <p>Task Master Prompt Template Testing Tool</p> </div> </div> </body> </html>`; return html; } // Helper function to escape HTML function escapeHtml(text) { if (!text) return ''; return text .toString() .replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/"/g, '"') .replace(/'/g, '''); } // Generate and save HTML report async function generateAndSaveHTMLReport() { console.log(`${colors.cyan}Generating HTML Report...${colors.reset}\n`); const results = await runComprehensiveTests(true); const html = generateHTMLReport(results, results.detailedResults); // Create output directory if it doesn't exist const outputDir = path.join(projectRoot, 'tests/manual/prompts/output'); if (!fs.existsSync(outputDir)) { fs.mkdirSync(outputDir, { recursive: true }); } // Generate filename with timestamp const timestamp = new Date() .toISOString() .replace(/[:.]/g, '-') .substring(0, 19); const filename = `prompt-test-report-${timestamp}.html`; const filepath = path.join(outputDir, filename); // Save HTML file fs.writeFileSync(filepath, html, 'utf8'); console.log( `${colors.green}✓ HTML report generated: ${filepath}${colors.reset}` ); console.log( `${colors.cyan}Results: ${results.passed}/${results.total} tests passed${colors.reset}` ); // Try to open in browser (cross-platform) try { const { exec } = await import('child_process'); const command = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open'; exec(`${command} "${filepath}"`); console.log(`${colors.blue}Opening report in browser...${colors.reset}`); } catch (error) { console.log( `${colors.yellow}Couldn't auto-open browser. Please open: ${filepath}${colors.reset}` ); } return { filepath, results }; } ```