Skip to content

Conversation

@Crunchyman-ralph
Copy link
Collaborator

@Crunchyman-ralph Crunchyman-ralph commented Nov 25, 2025

What type of PR is this?

  • πŸ› Bug fix
  • ✨ Feature
  • πŸ”Œ Integration
  • πŸ“ Docs
  • 🧹 Refactor
  • Other:

Description

Related Issues

How to Test This

# Example commands or steps

Expected result:

Contributor Checklist

  • Created changeset: npm run changeset
  • Tests pass: npm test
  • Format check passes: npm run format-check (or npm run format to fix)
  • Addressed CodeRabbit comments (if any)
  • Linked related issues (if any)
  • Manually tested the changes

Changelog Entry


For Maintainers

  • PR title follows conventional commits
  • Target branch correct
  • Labels added
  • Milestone assigned (if applicable)

Summary by CodeRabbit

Release Notes

  • New Features

    • Added AI tools package with Context7 integration for managing MCP tools
    • Introduced automatic MCP tool detection and orchestration across multiple sources
    • Enhanced AI providers with structured output support and tool integration
  • Updates

    • Upgraded AI SDK dependencies to latest major versions (v4/v6)
    • Standardized embedding model method naming across providers
    • Improved error handling with JSON repair for object generation

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Nov 25, 2025

⚠️ No Changeset found

Latest commit: 8913342

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 25, 2025

πŸ“ Walkthrough

Walkthrough

Introduces a new @tm/ai-tools package with Context7 MCP client integration, upgrades AI SDK dependencies to v4/v6, refactors the base provider to use modern SDK patterns with structured outputs and tool support, and integrates MCP tools into the unified AI service pipeline with lifecycle management.

Changes

Cohort / File(s) Summary
New @tm/ai-tools Package Configuration
packages/ai-sdk-tools/package.json, packages/ai-sdk-tools/tsconfig.json
Module initialization with exports map, development scripts, and TypeScript configuration for the new AI tools package.
Context7 MCP Client Implementation
packages/ai-sdk-tools/src/context7/types.ts, packages/ai-sdk-tools/src/context7/client.ts, packages/ai-sdk-tools/src/context7/index.ts
Adds Context7 client factory, error handling, API key resolution, and public barrel exports for MCP tool exposure with cleanup.
MCP Tools Manager & Package Entrypoint
packages/ai-sdk-tools/src/mcp-tools-manager.ts, packages/ai-sdk-tools/src/index.ts
Orchestrates multiple MCP sources with auto-detection, tool merging, and lifecycle management; re-exports public API.
AI Service Integration
scripts/modules/ai-services-unified.js
Integrates MCP tools via singleton factory, adds process exit handlers for cleanup, conditionally passes tools to provider calls.
Provider & Config Updates
packages/ai-sdk-provider-grok-cli/package.json, packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts, packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
Bumps provider dependencies, renames textEmbeddingModel β†’ embeddingModel in Grok CLI provider.
Base Provider Migration
src/ai-providers/base-provider.js
Migrates to AI SDK v6 with Output.object() for structured outputs, adds tool support with maxSteps, JSON repair error handling, and updated result consumption patterns.
Config Manager Simplification
scripts/modules/config-manager.js
Replaces manual model name generation with explicit name field fallback; removes special-case ID parsing logic.
Dependency & Path Configuration
package.json, tsconfig.json
Upgrades @ai-sdk packages to v4, adds @ai-sdk/mcp, updates CLI provider versions; adds path aliases for @tm/ai-tools.

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant MgR as MCP Manager
    participant C7 as Context7 Client
    participant Trans as MCP Transport
    participant MCPClient as MCP Client
    participant Provider as AI Provider

    App->>MgR: createMCPTools(config)
    MgR->>C7: isContext7Available(config)
    C7-->>MgR: true/false
    
    rect rgb(200, 240, 255)
    Note over C7,MCPClient: Context7 Initialization
    MgR->>C7: createContext7Tools(options)
    C7->>C7: getApiKey(config)
    C7->>Trans: create Experimental_StdioMCPTransport
    C7->>MCPClient: experimental_createMCPClient({transport})
    MCPClient-->>C7: client instance
    C7->>MCPClient: getTools()
    MCPClient-->>C7: tools
    end
    
    C7-->>MgR: {tools, close()}
    MgR->>MgR: merge tools into combined map
    MgR-->>App: {tools, close(), enabledSources}
    
    rect rgb(240, 240, 200)
    Note over App,Provider: Tool Usage Phase
    App->>Provider: callAI(input, tools)
    Provider->>Provider: process with tools
    Provider-->>App: result
    end
    
    App->>MgR: close()
    MgR->>MCPClient: close()
    MCPClient-->>MgR: cleanup complete
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested reviewers

  • eyaltoledano

Pre-merge checks and finishing touches

βœ… Passed checks (3 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title 'feat: add context7 as an mcp tool to taskmaster ai sdk calls' directly and clearly describes the primary change: introducing Context7 as an MCP tool integration to the Taskmaster AI SDK.
Docstring Coverage βœ… Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • πŸ“ Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
CHANGELOG.md (1)

3-18: 0.35.0 changelog entry is consistent; keep Context7 changes covered in a follow‑up entry

The new 0.35.0 section follows the existing format and correctly references past PRs. Just make sure the Context7 MCP tools work in this PR also get a changeset so they show up in the next version section rather than silently riding on 0.35.0.

packages/ai-sdk-tools/package.json (1)

1-37: Align internal package version handling with existing convention

The manifest looks good overall and matches the internal tm/* pattern (exports β†’ src, main β†’ dist). The only outlier is:

  • "version": "" β€” other internal/private packages typically omit version entirely to avoid changesets trying to publish them.

To stay consistent and avoid potential tooling/validation issues, consider dropping the version field instead of setting it to an empty string:

-  "author": "Task Master AI",
-  "version": ""
+  "author": "Task Master AI"
packages/ai-sdk-tools/src/context7/client.ts (1)

1-94: Wire up onError in createContext7Tools so the option is meaningful

The Context7 client setup and API key resolution look solid for a Node/stdio MCP wrapper. One small gap: Context7ToolsOptions exposes an onError callback, but createContext7Tools never calls it, so the option is effectively dead.

You can keep the current behavior (errors still propagate) and just invoke onError as a side effect when something goes wrong:

-export async function createContext7Tools(
-  options?: Context7ToolsOptions
-): Promise<Context7ToolsResult> {
-  const apiKey = getApiKey(options?.config);
-
-  const transport = new Experimental_StdioMCPTransport({
-    command: 'npx',
-    args: ['-y', '@upstash/context7-mcp', '--api-key', apiKey]
-  });
-
-  const client = await experimental_createMCPClient({
-    transport
-  });
-
-  options?.onReady?.();
-
-  const tools = await client.tools();
-
-  return {
-    tools,
-    close: async () => {
-      await client.close();
-    }
-  };
-}
+export async function createContext7Tools(
+  options?: Context7ToolsOptions
+): Promise<Context7ToolsResult> {
+  try {
+    const apiKey = getApiKey(options?.config);
+
+    const transport = new Experimental_StdioMCPTransport({
+      command: 'npx',
+      args: ['-y', '@upstash/context7-mcp', '--api-key', apiKey],
+    });
+
+    const client = await experimental_createMCPClient({ transport });
+
+    options?.onReady?.();
+
+    const tools = await client.tools();
+
+    return {
+      tools,
+      close: async () => {
+        await client.close();
+      },
+    };
+  } catch (error) {
+    if (options?.onError && error instanceof Error) {
+      options.onError(error);
+    }
+    throw error;
+  }
+}

That keeps the API simple while making the callback genuinely useful for callers who want to hook into failures.

πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 01d4d99 and 105bd7d.

β›” Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
πŸ“’ Files selected for processing (17)
  • .changeset/calm-times-marry.md (0 hunks)
  • .changeset/dry-wombats-marry.md (0 hunks)
  • .changeset/gemini-cli-native-structured-output.md (0 hunks)
  • .changeset/modern-snakes-mate.md (0 hunks)
  • .changeset/native-structured-outputs.md (0 hunks)
  • .changeset/nine-worlds-deny.md (0 hunks)
  • .changeset/rich-kings-fold.md (0 hunks)
  • CHANGELOG.md (1 hunks)
  • package.json (1 hunks)
  • packages/ai-sdk-tools/package.json (1 hunks)
  • packages/ai-sdk-tools/src/context7/client.ts (1 hunks)
  • packages/ai-sdk-tools/src/context7/index.ts (1 hunks)
  • packages/ai-sdk-tools/src/context7/types.ts (1 hunks)
  • packages/ai-sdk-tools/src/index.ts (1 hunks)
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts (1 hunks)
  • packages/ai-sdk-tools/tsconfig.json (1 hunks)
  • tsconfig.json (1 hunks)
πŸ’€ Files with no reviewable changes (7)
  • .changeset/rich-kings-fold.md
  • .changeset/modern-snakes-mate.md
  • .changeset/gemini-cli-native-structured-output.md
  • .changeset/nine-worlds-deny.md
  • .changeset/calm-times-marry.md
  • .changeset/native-structured-outputs.md
  • .changeset/dry-wombats-marry.md
🧰 Additional context used
πŸ““ Path-based instructions (5)
package.json

πŸ“„ CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

package.json scripts must include: 'test', 'test:watch', 'test:coverage', 'test:unit', 'test:integration', 'test:e2e', and 'test:ci' commands for testing framework integration

Files:

  • package.json
**/*.ts

πŸ“„ CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

TypeScript test files must achieve minimum code coverage thresholds: 80% lines/functions and 70% branches globally, 90% for utilities, and 85% for middleware; new features must meet or exceed these thresholds

Files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/context7/types.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/context7/client.ts
**/*.{js,ts}

πŸ“„ CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/context7/types.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/context7/client.ts
**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Import modules with .js extension even in TypeScript source files for ESM compatibility

Files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/context7/types.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/context7/client.ts
**/*.md

πŸ“„ CodeRabbit inference engine (.cursor/rules/ai_providers.mdc)

Update relevant documentation (like README.md) mentioning supported providers or configuration when adding a new AI provider

Files:

  • CHANGELOG.md
🧠 Learnings (56)
πŸ““ Common learnings
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/AGENTS.md:0-0
Timestamp: 2025-11-24T18:05:23.891Z
Learning: Applies to assets/.claude/settings.json : Configure Claude Code tool allowlist in `.claude/settings.json` to allow Task Master bash commands and MCP tools
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.587Z
Learning: Refer to new_features.mdc for guidelines on integrating new features into the Task Master CLI with tagged system considerations
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.001Z
Learning: Use MCP tools (e.g., get_tasks, add_task) as the preferred method for programmatic interaction in integrated environments like Cursor, treating CLI commands as a fallback for direct user interaction and when MCP server is unavailable
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.390Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Pass the `session` object (from context parameter) to the AI service call when in MCP context
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.587Z
Learning: Refer to taskmaster.mdc for comprehensive reference of Taskmaster MCP tools and CLI commands with tagged task lists information
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.587Z
Learning: Refer to changeset.mdc for guidelines on using Changesets (npm run changeset) to manage versioning and changelogs
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: package.json:130-132
Timestamp: 2025-09-26T19:03:33.225Z
Learning: In the eyaltoledano/claude-task-master repository, packages are bundled using tsdown during the build process, which means dependencies imported by the source code (including tm internal packages like tm/ai-sdk-provider-grok-cli) are included in the final bundle and don't need to be available as separate runtime dependencies, so they should remain as devDependencies rather than being moved to dependencies.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: tsconfig.json:22-28
Timestamp: 2025-09-26T19:10:32.906Z
Learning: In the eyaltoledano/claude-task-master repository, all internal tm/ package path mappings in tsconfig.json consistently point to TypeScript source files (e.g., "./packages/*/src/index.ts") rather than built JavaScript. This is intentional architecture because tsdown bundles internal packages directly from source during build time, eliminating the need for separate compilation of internal packages.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/changeset.mdc:0-0
Timestamp: 2025-11-24T17:58:19.822Z
Learning: Run `npm run changeset` after staging a logical set of changes that should be communicated in the next release's `CHANGELOG.md` for new features, bug fixes, breaking changes, performance improvements, significant refactoring, user-facing documentation updates, dependency updates, or build/tooling changes
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/build-config/package.json:14-15
Timestamp: 2025-09-22T19:45:13.323Z
Learning: In the eyaltoledano/claude-task-master repository, Crunchyman-ralph intentionally omits version fields from internal packages (like tm/build-config) to prevent changesets from releasing new versions for these packages. This is the desired behavior for internal tooling packages that should not be published or versioned independently.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/tm-core/package.json:50-51
Timestamp: 2025-09-22T19:45:04.337Z
Learning: In the eyaltoledano/claude-task-master project, Crunchyman-ralph intentionally omits version fields from internal/private packages in package.json files to prevent changesets from releasing new versions of these packages while still allowing them to be processed for dependency updates. The changesets warnings about missing versions are acceptable as they don't break the process and achieve the desired behavior of only releasing public packages.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: packages/ai-sdk-provider-grok-cli/package.json:21-35
Timestamp: 2025-09-26T19:07:10.485Z
Learning: In the eyaltoledano/claude-task-master repository, the tsdown build configuration uses `noExternal: [/^tm\//]` which means internal tm/ packages are bundled into the final output while external npm dependencies remain external and are resolved from the root package.json dependencies at runtime. This eliminates the need for peer dependencies in internal packages since the root package.json already provides the required external dependencies.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
πŸ“š Learning: 2025-09-26T19:10:32.906Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: tsconfig.json:22-28
Timestamp: 2025-09-26T19:10:32.906Z
Learning: In the eyaltoledano/claude-task-master repository, all internal tm/ package path mappings in tsconfig.json consistently point to TypeScript source files (e.g., "./packages/*/src/index.ts") rather than built JavaScript. This is intentional architecture because tsdown bundles internal packages directly from source during build time, eliminating the need for separate compilation of internal packages.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
  • package.json
  • tsconfig.json
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-09-26T19:05:47.555Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: packages/ai-sdk-provider-grok-cli/package.json:11-13
Timestamp: 2025-09-26T19:05:47.555Z
Learning: In the eyaltoledano/claude-task-master repository, internal tm/ packages use a specific export pattern where the "exports" field points to TypeScript source files (./src/index.ts) while "main" points to compiled output (./dist/index.js) and "types" points to source files (./src/index.ts). This pattern is used consistently across internal packages like tm/core and tm/ai-sdk-provider-grok-cli because they are consumed directly during build-time bundling with tsdown rather than being published as separate packages.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
  • package.json
  • packages/ai-sdk-tools/src/index.ts
  • tsconfig.json
  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-09-03T12:16:15.866Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/package.json:13-64
Timestamp: 2025-09-03T12:16:15.866Z
Learning: For internal packages in the claude-task-master project, Crunchyman-ralph prefers pointing package.json "types" entries to src .ts files rather than dist .d.ts files for better developer experience (DX), as the packages are not being exported as SDKs.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
  • tsconfig.json
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to jest.config.js : Jest configuration must use ts-jest preset for TypeScript support, configure test environment as 'node', set roots to ['<rootDir>/src', '<rootDir>/tests'], and include testMatch patterns for both *.test.ts and *.spec.ts files with separate projects for unit, integration, and e2e tests

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
  • tsconfig.json
πŸ“š Learning: 2025-09-17T19:09:08.882Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1211
File: jest.resolver.cjs:8-15
Timestamp: 2025-09-17T19:09:08.882Z
Learning: In the eyaltoledano/claude-task-master project, the team only uses .ts files and does not plan to use .tsx or .mts extensions, so Jest resolver and build tooling should focus on .js β†’ .ts mapping only.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
  • tsconfig.json
πŸ“š Learning: 2025-09-26T19:03:33.225Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: package.json:130-132
Timestamp: 2025-09-26T19:03:33.225Z
Learning: In the eyaltoledano/claude-task-master repository, packages are bundled using tsdown during the build process, which means dependencies imported by the source code (including tm internal packages like tm/ai-sdk-provider-grok-cli) are included in the final bundle and don't need to be available as separate runtime dependencies, so they should remain as devDependencies rather than being moved to dependencies.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
  • package.json
  • tsconfig.json
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-09-26T19:07:10.485Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: packages/ai-sdk-provider-grok-cli/package.json:21-35
Timestamp: 2025-09-26T19:07:10.485Z
Learning: In the eyaltoledano/claude-task-master repository, the tsdown build configuration uses `noExternal: [/^tm\//]` which means internal tm/ packages are bundled into the final output while external npm dependencies remain external and are resolved from the root package.json dependencies at runtime. This eliminates the need for peer dependencies in internal packages since the root package.json already provides the required external dependencies.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
  • tsconfig.json
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/*.{ts,tsx} : Import modules with `.js` extension even in TypeScript source files for ESM compatibility

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
  • tsconfig.json
πŸ“š Learning: 2025-09-24T15:46:28.029Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1114
File: src/ai-providers/gemini-cli.js:12-12
Timestamp: 2025-09-24T15:46:28.029Z
Learning: When AI SDK provider packages are moved from optional dependencies to required dependencies in package.json, static imports should be used instead of dynamic imports with error handling, as the package is guaranteed to be available at runtime.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Export all utility functions explicitly in logical groups and include configuration constants from utility modules

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to src/**/*.ts : Source code must have corresponding test files either colocated (*.test.ts) or in tests/unit/ directory following established patterns from src/utils/auth.test.ts with proper mocking for external dependencies

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-09-22T19:45:04.337Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/tm-core/package.json:50-51
Timestamp: 2025-09-22T19:45:04.337Z
Learning: In the eyaltoledano/claude-task-master project, Crunchyman-ralph intentionally omits version fields from internal/private packages in package.json files to prevent changesets from releasing new versions of these packages while still allowing them to be processed for dependency updates. The changesets warnings about missing versions are acceptable as they don't break the process and achieve the desired behavior of only releasing public packages.

Applied to files:

  • package.json
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: The Task Master CLI uses a modular architecture with distinct modules responsible for different aspects: commands.js (CLI command handling), task-manager.js (task data & core logic), dependency-manager.js (dependency management), ui.js (output formatting), ai-services-unified.js (unified AI service layer), config-manager.js (configuration management), utils.js (core utility functions), and mcp-server/ (MCP interface)

Applied to files:

  • package.json
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-11-24T17:56:52.238Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/GEMINI.md:0-0
Timestamp: 2025-11-24T17:56:52.238Z
Learning: Applies to assets/.gemini/settings.json : Configure Task Master MCP server in ~/.gemini/settings.json with the command 'npx' and args ['-y', 'task-master-ai']

Applied to files:

  • package.json
πŸ“š Learning: 2025-11-24T18:05:02.103Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/.windsurfrules:0-0
Timestamp: 2025-11-24T18:05:02.103Z
Learning: Use the global CLI command `task-master` instead of `node scripts/dev.js` for all task management operations

Applied to files:

  • package.json
πŸ“š Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: Applies to scripts/modules/task-manager.js : task-manager.js should handle reading/writing tasks.json with tagged task lists support, implement CRUD operations, delegate AI interactions to ai-services-unified.js layer, and access non-AI configuration via config-manager.js getters

Applied to files:

  • package.json
πŸ“š Learning: 2025-11-24T18:02:22.277Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-11-24T18:02:22.277Z
Learning: Applies to .taskmaster/config.json : The .taskmaster/config.json file stores AI model configuration (main, research, fallback models) managed via 'task-master models' command

Applied to files:

  • package.json
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-08-07T13:00:22.966Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1090
File: apps/extension/package.json:241-243
Timestamp: 2025-08-07T13:00:22.966Z
Learning: In monorepos, local packages should use "*" as the version constraint in package.json dependencies, as recommended by npm. This ensures the local version from within the same workspace is always used, rather than attempting to resolve from external registries. This applies to packages like task-master-ai within the eyaltoledano/claude-task-master monorepo.

Applied to files:

  • package.json
πŸ“š Learning: 2025-09-22T19:45:13.323Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/build-config/package.json:14-15
Timestamp: 2025-09-22T19:45:13.323Z
Learning: In the eyaltoledano/claude-task-master repository, Crunchyman-ralph intentionally omits version fields from internal packages (like tm/build-config) to prevent changesets from releasing new versions for these packages. This is the desired behavior for internal tooling packages that should not be published or versioned independently.

Applied to files:

  • package.json
  • CHANGELOG.md
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/index.js : Import and call tool registration functions in mcp-server/src/tools/index.js to register new MCP tools with the server

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/tools/index.js : Register MCP tools by importing and calling registration functions in `mcp-server/src/tools/index.js`

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: New MCP tools should be imported and registered in mcp-server/src/tools/index.js and tool definitions should be added to mcp.json

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to apps/mcp/src/**/*.{ts,tsx} : MCP (tm/mcp) should be a thin presentation layer that calls tm-core methods and returns MCP-formatted responses; handle only MCP-specific concerns like tool schemas, parameter validation, and response formatting

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/tools/*.js : Create MCP tool definitions in `mcp-server/src/tools/` using kebab-case naming; use zod for parameter validation; make projectRoot optional as the HOF handles fallback; wrap execute method with `withNormalizedProjectRoot`

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:02:49.769Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/telemetry.mdc:0-0
Timestamp: 2025-11-24T18:02:49.769Z
Learning: Applies to mcp-server/src/tools/**/*.js : MCP tools in mcp-server/src/tools/ must call the corresponding direct function wrapper and pass the result object to handleApiResult(result, log) from mcp-server/src/tools/utils.js

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/*.js : Access API keys for AI services via the session.env object in the MCP context rather than reading environment variables directly

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/*.js : Use the AsyncOperationManager in the MCP tool layer for operations involving multiple steps or long waits beyond a single AI call; simple AI calls handled entirely within the *Direct function may not need it

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to mcp-server/src/tools/**/*.{js,ts} : Use the withNormalizedProjectRoot Higher-Order Function to wrap tool execute methods, ensuring normalized project root is injected into args

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
πŸ“š Learning: 2025-11-24T17:57:14.728Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.728Z
Learning: Use the `models` MCP tool or the `task-master models` CLI command to manage AI configurations

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
πŸ“š Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to scripts/modules/*.js : Import context gathering utilities (`ContextGatherer`, `FuzzyTaskSearch`) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/context7/types.ts
  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/*.js : Call the corresponding *Direct function wrapper from task-master-core.js within the execute method of each MCP tool, passing necessary arguments and the logger

Applied to files:

  • packages/ai-sdk-tools/src/index.ts
πŸ“š Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/*.{js,ts} : Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context

Applied to files:

  • packages/ai-sdk-tools/src/context7/types.ts
  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T17:58:47.001Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.001Z
Learning: Applies to scripts/modules/commands.js : For context-aware AI commands: use ContextGatherer utility for multi-source context extraction, support task IDs/file paths/custom context, implement fuzzy search for task discovery, and display detailed token breakdown for transparency

Applied to files:

  • packages/ai-sdk-tools/src/context7/types.ts
  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to .cursor/mcp.json : Add new tool definitions to the tools array in `.cursor/mcp.json`

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:02:22.277Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-11-24T18:02:22.277Z
Learning: Use MCP tools instead of CLI commands when available for better performance, structured data, and error handling

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/*.js : Use createErrorResponse and createContentResponse utilities from tools/utils.js for formatting MCP responses

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T17:57:31.390Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.390Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js, scripts/modules/ai-services-unified.js : Do not import or call anything from deprecated AI service files (`ai-services.js`, `ai-client-factory.js`, `ai-client-utils.js`)

Applied to files:

  • tsconfig.json
πŸ“š Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,ts} : Do not call AI-specific getters (like getMainModelId, getMainMaxTokens) from core logic functions in scripts/modules/task-manager/*. Instead, pass the role to the unified AI service

Applied to files:

  • tsconfig.json
πŸ“š Learning: 2025-11-24T17:57:14.728Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.728Z
Learning: Applies to src/ai-providers/*.js : Provider modules in `src/ai-providers/` must import `generateText`, `streamText`, `generateObject` from the `ai` package, the provider's `create<ProviderName>` function from `ai-sdk/<provider-name>`, and the `log` utility from `../../scripts/modules/utils.js`

Applied to files:

  • tsconfig.json
  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/*.spec.ts : Place package and app test files in `packages/<package-name>/src/<module>/<file>.spec.ts` or `apps/<app-name>/src/<module>/<file>.spec.ts` alongside source files

Applied to files:

  • tsconfig.json
πŸ“š Learning: 2025-10-08T19:57:00.982Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1282
File: packages/tm-core/src/utils/index.ts:16-34
Timestamp: 2025-10-08T19:57:00.982Z
Learning: For the tm-core package in the eyaltoledano/claude-task-master repository, the team prefers a minimal, need-based export strategy in index files rather than exposing all internal utilities. Exports should only be added when functions are actually consumed by other packages in the monorepo.

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-11-24T17:59:00.042Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/context_gathering.mdc:0-0
Timestamp: 2025-11-24T17:59:00.042Z
Learning: Applies to scripts/modules/utils/{contextGatherer,fuzzyTaskSearch}.js : Export utility modules using named exports: `ContextGatherer`, `createContextGatherer` from contextGatherer.js and `FuzzyTaskSearch`, `PURPOSE_CATEGORIES`, `RELEVANCE_THRESHOLDS` from fuzzyTaskSearch.js

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T17:59:00.042Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/context_gathering.mdc:0-0
Timestamp: 2025-11-24T17:59:00.042Z
Learning: Applies to scripts/**/*.js : Use the `ContextGatherer` class from `scripts/modules/utils/contextGatherer.js` to extract context from multiple sources (tasks, files, custom text, project tree) with token counting using `gpt-tokens` library

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/*.{js,ts} : Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-07-31T20:49:04.638Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 997
File: apps/extension/package.publish.json:2-8
Timestamp: 2025-07-31T20:49:04.638Z
Learning: In the eyaltoledano/claude-task-master repository, the VS Code extension uses a 3-file packaging system where package.json (with name "extension") is for development within the monorepo, while package.publish.json (with name "task-master-hamster") contains the clean manifest for VS Code marketplace publishing. The different names are intentional and serve distinct purposes in the build and publishing workflow.

Applied to files:

  • packages/ai-sdk-tools/package.json
πŸ“š Learning: 2025-07-17T21:33:57.585Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.

Applied to files:

  • packages/ai-sdk-tools/package.json
  • CHANGELOG.md
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Direct functions should receive context containing only { session } when needed for AI keys or configuration; do not pass reportProgress to direct functions

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : For AI-powered commands that benefit from project context, use the ContextGatherer utility for multi-source context extraction, support task IDs, file paths, custom context, and project tree, implement fuzzy search for automatic task discovery, and display detailed token breakdown for transparency.

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T17:57:14.728Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.728Z
Learning: API keys are essential for most AI providers and must be configured correctly. Keys should be set in `.cursor/mcp.json` env section for MCP/Cursor, or in a `.env` file in the project root for CLI usage.

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/*.{js,ts} : Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T18:00:06.781Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:06.781Z
Learning: Applies to {.env,.cursor/mcp.json} : API keys for AI providers should be placed in `.env` file in project root for CLI usage, or in `env` section of `.cursor/mcp.json` for MCP/Cursor integration

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T17:57:31.390Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.390Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : API keys must be configured in `.env` (for CLI) or `.cursor/mcp.json` (for MCP); ensure they are correctly resolved via `session.env` in MCP contexts

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-10-10T16:52:51.399Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1286
File: apps/cli/src/utils/auto-update.ts:63-110
Timestamp: 2025-10-10T16:52:51.399Z
Learning: In the claude-task-master repository, the main branch always contains the latest released code due to automatic CI releases when changes are merged. The next branch contains unreleased changes. This means main branch = latest release.

Applied to files:

  • CHANGELOG.md
πŸ“š Learning: 2025-11-24T18:00:32.587Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.587Z
Learning: Refer to new_features.mdc for guidelines on integrating new features into the Task Master CLI with tagged system considerations

Applied to files:

  • CHANGELOG.md
πŸ“š Learning: 2025-11-24T18:00:32.587Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.587Z
Learning: Refer to taskmaster.mdc for comprehensive reference of Taskmaster MCP tools and CLI commands with tagged task lists information

Applied to files:

  • CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
πŸ”‡ Additional comments (12)
package.json (1)

3-3: Version bump looks fine; ensure it’s driven by your changeset/release flow

The 0.35.0 bump aligns with the new CHANGELOG section. Just confirm this PR is the one running changeset version / release so auto‑update logic and tooling stay in sync.

packages/ai-sdk-tools/src/context7/types.ts (1)

1-45: Context7 type surface is clear and matches the client usage

The config/options/result interfaces are well-scoped and documented, and they line up cleanly with how createContext7Tools and isContext7Available are implemented.

packages/ai-sdk-tools/tsconfig.json (1)

1-36: TS config is strict and consistent with NodeNext/ESM usage

This tsconfig is aligned with the repo’s NodeNext/ESM setup and uses a solid set of strict flags for the new package. Nothing blocking from here.

tsconfig.json (1)

32-34: LGTM!

The path aliases follow the established pattern for internal packages, pointing to TypeScript source files as expected for build-time bundling with tsdown.

packages/ai-sdk-tools/src/index.ts (2)

1-14: LGTM!

Clear documentation with helpful usage examples showing both direct imports and the MCP tools manager pattern.


16-25: LGTM!

Export structure follows best practices with proper .js extensions for ESM compatibility.

packages/ai-sdk-tools/src/mcp-tools-manager.ts (5)

1-5: LGTM!

Imports follow ESM conventions with proper .js extensions.


7-35: LGTM!

Type definitions are well-structured with clear documentation. The Record<string, unknown> type for tools is appropriate for aggregating heterogeneous tool sets from multiple MCP sources.


37-80: LGTM!

Excellent documentation with clear usage examples. Function setup with separate tracking arrays for cleanup functions and enabled sources is well-organized.


81-104: Context7 initialization logic is sound.

The availability check on line 94 is necessary for the explicit configuration case (when config?.context7 is a truthy value) and provides a safeguard in the auto-detect case. The error handling pattern (warn-and-continue) is appropriate for preventing single source failures from breaking the entire tool manager.


106-126: LGTM!

Return structure is well-designed with proper async cleanup coordination. The getAvailableMCPTools utility function provides useful inspection capabilities without requiring initialization.

packages/ai-sdk-tools/src/context7/index.ts (1)

1-11: LGTM!

Clean barrel export pattern with proper .js extensions and good separation between runtime exports and type exports. The focused API surface aligns with the minimal export strategy for internal packages.

@Crunchyman-ralph Crunchyman-ralph force-pushed the claude/add-mcp-tools-01RL5weq2wgmxVJyZctujEz3 branch 2 times, most recently from d7e6396 to 5291993 Compare November 25, 2025 17:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/ai-sdk-tools/src/mcp-tools-manager.ts (1)

74-104: Config and auto-detect logic work but could be simplified

The context7 enable/disable behavior is correct (explicit false disables, otherwise auto-detects via isContext7Available), and failures in createContext7Tools are handled non-fatally, which is good. However, isContext7Available(context7Config) is evaluated both in the shouldEnableContext7 logic (when config is unset) and again in the if guard, and the Context7Config | boolean union leads to slightly convoluted branching. If you touch this again, consider computing a single context7Config and a single context7Available flag once, then using that in both createMCPTools and getAvailableMCPTools for simpler control flow.

πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 105bd7d and 5291993.

β›” Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
πŸ“’ Files selected for processing (8)
  • packages/ai-sdk-tools/package.json (1 hunks)
  • packages/ai-sdk-tools/src/context7/client.ts (1 hunks)
  • packages/ai-sdk-tools/src/context7/index.ts (1 hunks)
  • packages/ai-sdk-tools/src/context7/types.ts (1 hunks)
  • packages/ai-sdk-tools/src/index.ts (1 hunks)
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts (1 hunks)
  • packages/ai-sdk-tools/tsconfig.json (1 hunks)
  • tsconfig.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/ai-sdk-tools/package.json
  • packages/ai-sdk-tools/src/context7/types.ts
  • tsconfig.json
  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/tsconfig.json
🧰 Additional context used
πŸ““ Path-based instructions (3)
**/*.ts

πŸ“„ CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

TypeScript test files must achieve minimum code coverage thresholds: 80% lines/functions and 70% branches globally, 90% for utilities, and 85% for middleware; new features must meet or exceed these thresholds

Files:

  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/client.ts
**/*.{js,ts}

πŸ“„ CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/client.ts
**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Import modules with .js extension even in TypeScript source files for ESM compatibility

Files:

  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/client.ts
🧠 Learnings (31)
πŸ““ Common learnings
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/AGENTS.md:0-0
Timestamp: 2025-11-24T18:05:23.891Z
Learning: Applies to assets/.claude/settings.json : Configure Claude Code tool allowlist in `.claude/settings.json` to allow Task Master bash commands and MCP tools
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.587Z
Learning: Refer to new_features.mdc for guidelines on integrating new features into the Task Master CLI with tagged system considerations
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.001Z
Learning: Use MCP tools (e.g., get_tasks, add_task) as the preferred method for programmatic interaction in integrated environments like Cursor, treating CLI commands as a fallback for direct user interaction and when MCP server is unavailable
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.390Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Pass the `session` object (from context parameter) to the AI service call when in MCP context
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.587Z
Learning: Refer to taskmaster.mdc for comprehensive reference of Taskmaster MCP tools and CLI commands with tagged task lists information
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: New MCP tools should be imported and registered in mcp-server/src/tools/index.js and tool definitions should be added to mcp.json
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to apps/mcp/src/**/*.{ts,tsx} : MCP (tm/mcp) should be a thin presentation layer that calls tm-core methods and returns MCP-formatted responses; handle only MCP-specific concerns like tool schemas, parameter validation, and response formatting
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/*.js : Use the AsyncOperationManager in the MCP tool layer for operations involving multiple steps or long waits beyond a single AI call; simple AI calls handled entirely within the *Direct function may not need it
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/index.js : Import and call tool registration functions in mcp-server/src/tools/index.js to register new MCP tools with the server
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/tools/*.js : In MCP tool registration, include optional tag parameter for multi-context support in the Zod schema
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/tools/*.js : Create MCP tool definitions in `mcp-server/src/tools/` using kebab-case naming; use zod for parameter validation; make projectRoot optional as the HOF handles fallback; wrap execute method with `withNormalizedProjectRoot`
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/tools/index.js : Register MCP tools by importing and calling registration functions in `mcp-server/src/tools/index.js`
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/*.js : Include projectRoot as an optional parameter in tool definitions using zod schema
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to .cursor/mcp.json : Add new tool definitions to the tools array in `.cursor/mcp.json`
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
πŸ“š Learning: 2025-10-08T19:57:00.982Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1282
File: packages/tm-core/src/utils/index.ts:16-34
Timestamp: 2025-10-08T19:57:00.982Z
Learning: For the tm-core package in the eyaltoledano/claude-task-master repository, the team prefers a minimal, need-based export strategy in index files rather than exposing all internal utilities. Exports should only be added when functions are actually consumed by other packages in the monorepo.

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to scripts/modules/*.js : Import context gathering utilities (`ContextGatherer`, `FuzzyTaskSearch`) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-09-26T19:05:47.555Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: packages/ai-sdk-provider-grok-cli/package.json:11-13
Timestamp: 2025-09-26T19:05:47.555Z
Learning: In the eyaltoledano/claude-task-master repository, internal tm/ packages use a specific export pattern where the "exports" field points to TypeScript source files (./src/index.ts) while "main" points to compiled output (./dist/index.js) and "types" points to source files (./src/index.ts). This pattern is used consistently across internal packages like tm/core and tm/ai-sdk-provider-grok-cli because they are consumed directly during build-time bundling with tsdown rather than being published as separate packages.

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T17:57:14.728Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.728Z
Learning: Applies to src/ai-providers/*.js : Provider modules in `src/ai-providers/` must import `generateText`, `streamText`, `generateObject` from the `ai` package, the provider's `create<ProviderName>` function from `ai-sdk/<provider-name>`, and the `log` utility from `../../scripts/modules/utils.js`

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T17:59:00.042Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/context_gathering.mdc:0-0
Timestamp: 2025-11-24T17:59:00.042Z
Learning: Applies to scripts/modules/utils/{contextGatherer,fuzzyTaskSearch}.js : Export utility modules using named exports: `ContextGatherer`, `createContextGatherer` from contextGatherer.js and `FuzzyTaskSearch`, `PURPOSE_CATEGORIES`, `RELEVANCE_THRESHOLDS` from fuzzyTaskSearch.js

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/*.{js,ts} : Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-09-24T15:46:28.029Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1114
File: src/ai-providers/gemini-cli.js:12-12
Timestamp: 2025-09-24T15:46:28.029Z
Learning: When AI SDK provider packages are moved from optional dependencies to required dependencies in package.json, static imports should be used instead of dynamic imports with error handling, as the package is guaranteed to be available at runtime.

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Export all utility functions explicitly in logical groups and include configuration constants from utility modules

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T17:59:00.042Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/context_gathering.mdc:0-0
Timestamp: 2025-11-24T17:59:00.042Z
Learning: Applies to scripts/**/*.js : Use the `ContextGatherer` class from `scripts/modules/utils/contextGatherer.js` to extract context from multiple sources (tasks, files, custom text, project tree) with token counting using `gpt-tokens` library

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/*.{js,ts} : Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: New MCP tools should be imported and registered in mcp-server/src/tools/index.js and tool definitions should be added to mcp.json

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/index.js : Import and call tool registration functions in mcp-server/src/tools/index.js to register new MCP tools with the server

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/tools/index.js : Register MCP tools by importing and calling registration functions in `mcp-server/src/tools/index.js`

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/*.js : Use the AsyncOperationManager in the MCP tool layer for operations involving multiple steps or long waits beyond a single AI call; simple AI calls handled entirely within the *Direct function may not need it

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to apps/mcp/src/**/*.{ts,tsx} : MCP (tm/mcp) should be a thin presentation layer that calls tm-core methods and returns MCP-formatted responses; handle only MCP-specific concerns like tool schemas, parameter validation, and response formatting

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to .cursor/mcp.json : Add new tool definitions to the tools array in `.cursor/mcp.json`

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/tools/*.js : Create MCP tool definitions in `mcp-server/src/tools/` using kebab-case naming; use zod for parameter validation; make projectRoot optional as the HOF handles fallback; wrap execute method with `withNormalizedProjectRoot`

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:02:49.769Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/telemetry.mdc:0-0
Timestamp: 2025-11-24T18:02:49.769Z
Learning: Applies to mcp-server/src/tools/**/*.js : MCP tools in mcp-server/src/tools/ must call the corresponding direct function wrapper and pass the result object to handleApiResult(result, log) from mcp-server/src/tools/utils.js

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/tools/*.js : In MCP tool registration, include optional tag parameter for multi-context support in the Zod schema

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/*.js : Use camelCase with Tool suffix for tool registration functions (e.g., registerListTasksTool)

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/*.js : Access API keys for AI services via the session.env object in the MCP context rather than reading environment variables directly

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T18:02:22.277Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-11-24T18:02:22.277Z
Learning: Use MCP tools instead of CLI commands when available for better performance, structured data, and error handling

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/tools/*.js : Use createErrorResponse and createContentResponse utilities from tools/utils.js for formatting MCP responses

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T17:58:47.001Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.001Z
Learning: Applies to scripts/modules/commands.js : For context-aware AI commands: use ContextGatherer utility for multi-source context extraction, support task IDs/file paths/custom context, implement fuzzy search for task discovery, and display detailed token breakdown for transparency

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T18:01:06.046Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.046Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Direct functions should receive context containing only { session } when needed for AI keys or configuration; do not pass reportProgress to direct functions

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : For AI-powered commands that benefit from project context, use the ContextGatherer utility for multi-source context extraction, support task IDs, file paths, custom context, and project tree, implement fuzzy search for automatic task discovery, and display detailed token breakdown for transparency.

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T17:57:14.728Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.728Z
Learning: API keys are essential for most AI providers and must be configured correctly. Keys should be set in `.cursor/mcp.json` env section for MCP/Cursor, or in a `.env` file in the project root for CLI usage.

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/*.{js,ts} : Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T18:00:06.781Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:06.781Z
Learning: Applies to {.env,.cursor/mcp.json} : API keys for AI providers should be placed in `.env` file in project root for CLI usage, or in `env` section of `.cursor/mcp.json` for MCP/Cursor integration

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
πŸ“š Learning: 2025-11-24T17:57:31.390Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.390Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : API keys must be configured in `.env` (for CLI) or `.cursor/mcp.json` (for MCP); ensure they are correctly resolved via `session.env` in MCP contexts

Applied to files:

  • packages/ai-sdk-tools/src/context7/client.ts
🧬 Code graph analysis (1)
packages/ai-sdk-tools/src/mcp-tools-manager.ts (2)
packages/ai-sdk-tools/src/context7/types.ts (1)
  • Context7Config (4-10)
packages/ai-sdk-tools/src/context7/client.ts (2)
  • isContext7Available (87-94)
  • createContext7Tools (58-82)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
πŸ”‡ Additional comments (2)
packages/ai-sdk-tools/src/context7/client.ts (1)

9-30: API key handling and error surface look good

Context7ApiKeyError plus getApiKey give a clear, early failure mode and an explicit env/config contract for consumers; this is a sensible pattern for this package.

packages/ai-sdk-tools/src/context7/index.ts (1)

1-11: Barrel exports are minimal and aligned with usage

The index keeps the public surface tight by re-exporting only the client functions and types actually intended for consumers, and uses .js extensions for ESM compatibility.

Comment on lines +100 to +103
} catch (error) {
// Log but don't fail if Context7 connection fails
console.warn('Failed to connect to Context7 MCP server:', error);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor

Avoid direct console.warn in library code

The direct console.warn here bypasses the repo’s central logging approach; prefer routing this through whatever shared logger the rest of the codebase uses so consumers can control log levels and sinks consistently.

πŸ€– Prompt for AI Agents
In packages/ai-sdk-tools/src/mcp-tools-manager.ts around lines 100 to 103, the
catch block currently uses console.warn which bypasses the repo's central
logging; replace this with the shared/logger used across the codebase (e.g.,
module-level logger or the injected logger variable) and call its warn/error
method instead, passing a clear message and the caught error object so the
failure to connect to the Context7 MCP server is logged via the central logging
system without changing the existing non-failing behavior.

@Crunchyman-ralph
Copy link
Collaborator Author

Blocked by ai sdk v6, needs this to be merged:

OpenRouterTeam/ai-sdk-provider#307

Adds a new package @tm/ai-tools that provides AI SDK tool integrations
for Task Master. Starts with Context7 MCP support for documentation
lookup capabilities.

Package features:
- createContext7Tools() - Creates MCP client for Context7 documentation
- createMCPTools() - Auto-detects and combines available MCP tools
- isContext7Available() - Checks if CONTEXT7_API_KEY is configured
- getAvailableMCPTools() - Lists available MCP tool sources

Usage:
import { createContext7Tools } from '@tm/ai-tools/context7';
import { createMCPTools } from '@tm/ai-tools';

The package uses @ai-sdk/mcp for MCP client functionality.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts (2)

33-33: Critical: Interface and implementation method names don't match.

The interface declares textEmbeddingModel on line 33, but the implementation assigns to provider.embeddingModel on line 87. This creates a type mismatch that should prevent TypeScript compilation.

Either:

  • Update line 33 to declare embeddingModel(modelId: string): never;, or
  • Update line 87 to assign to provider.textEmbeddingModel
πŸ”Ž Proposed fix: Update the interface to match the implementation
-	textEmbeddingModel(modelId: string): never;
+	embeddingModel(modelId: string): never;

Also applies to: 87-87


87-92: Change embeddingModel method to textEmbeddingModel to match the ProviderV2 interface contract.

The interface definition (line 33) declares textEmbeddingModel(modelId: string): never;, but the implementation at line 87 uses embeddingModel. According to AI SDK v5 ProviderV2 specification, the method must be named textEmbeddingModel, not embeddingModel. The modelType: 'textEmbeddingModel' value is correctβ€”it uses the standardized AI SDK model type, not the method name.

Implementation fix
provider.textEmbeddingModel = (modelId: string) => {
	throw new NoSuchModelError({
		modelId,
		modelType: 'textEmbeddingModel'
	});
};
πŸ€– Fix all issues with AI Agents
In @packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts:
- Line 86: The inline comment incorrectly mentions textEmbeddingModel while the
actual method is embeddingModel; update the comment to reference embeddingModel
(or rename the method to textEmbeddingModel if that was intended) so the comment
and the implementation match, adjusting any surrounding docs or usages of
embeddingModel in grok-cli-provider.ts accordingly.

In @src/ai-providers/base-provider.js:
- Around line 366-381: Replace the direct console logging in the tool-steps
block with the project logging utility: where the code inspects result.steps and
builds toolSteps (variables result, toolSteps, step, call), call the imported
log function instead of console.log for the header and each tool call line so
logging respects silent mode and centralized configuration; update the three
console.log occurrences to use log and preserve the same messages (including
JSON.stringify(call.args)) and ensure the log import is used (log).
🧹 Nitpick comments (2)
scripts/modules/ai-services-unified.js (1)

125-141: Signal handler may interfere with other cleanup routines.

The process.exit(0) calls in SIGINT/SIGTERM handlers will prevent any other registered cleanup handlers from running. If this service is used as a library, the explicit exit could be problematic.

Consider letting the process terminate naturally after cleanup, or make the exit behavior configurable:

πŸ”Ž Suggested approach
 process.on('SIGINT', async () => {
 	await closeMCPTools();
-	process.exit(0);
+	// Allow other handlers to run; if this is the main entry point,
+	// the process will exit naturally after all handlers complete
 });

 process.on('SIGTERM', async () => {
 	await closeMCPTools();
-	process.exit(0);
+	// Allow other handlers to run
 });

Alternatively, if explicit exit is required, document that this module takes ownership of process termination.

src/ai-providers/base-provider.js (1)

358-358: Consider making maxSteps configurable.

The hardcoded maxSteps: 5 limits multi-step tool interactions. While reasonable as a default, complex tool workflows might benefit from configurability.

πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 5291993 and 3ad2609.

β›” Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
πŸ“’ Files selected for processing (9)
  • apps/cli/src/lib/model-management.ts
  • package.json
  • packages/ai-sdk-provider-grok-cli/package.json
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
  • packages/ai-sdk-tools/src/context7/client.ts
  • scripts/modules/ai-services-unified.js
  • scripts/modules/config-manager.js
  • src/ai-providers/base-provider.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/ai-sdk-tools/src/context7/client.ts
🧰 Additional context used
πŸ““ Path-based instructions (17)
**/*.test.{js,ts}

πŸ“„ CodeRabbit inference engine (.cursor/rules/new_features.mdc)

**/*.test.{js,ts}: Follow the mock-first-then-import pattern for Jest mocking; use jest.spyOn() for spy functions; clear mocks between tests; verify mocks with the pattern described in tests.mdc
Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
**/*.test.ts

πŸ“„ CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Unit tests must follow the describe/it pattern, use beforeEach for mock setup with jest.clearAllMocks(), include specific assertions with expect(), and test both success and error scenarios including edge cases

Files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
**/*.ts

πŸ“„ CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

TypeScript test files must achieve minimum code coverage thresholds: 80% lines/functions and 70% branches globally, 90% for utilities, and 85% for middleware; new features must meet or exceed these thresholds

Files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • apps/cli/src/lib/model-management.ts
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
**/*.{js,ts}

πŸ“„ CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • apps/cli/src/lib/model-management.ts
  • src/ai-providers/base-provider.js
  • scripts/modules/config-manager.js
  • scripts/modules/ai-services-unified.js
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
**/*.{spec,test}.ts

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

**/*.{spec,test}.ts: Always use .ts for TypeScript tests, never .js
NEVER use async/await in test functions unless testing actual asynchronous operations; use synchronous top-level imports instead of dynamic await import()

Files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Import modules with .js extension even in TypeScript source files for ESM compatibility

Files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • apps/cli/src/lib/model-management.ts
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
package.json

πŸ“„ CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

package.json scripts must include: 'test', 'test:watch', 'test:coverage', 'test:unit', 'test:integration', 'test:e2e', and 'test:ci' commands for testing framework integration

Files:

  • package.json
apps/cli/src/**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

CLI (@tm/cli) should be a thin presentation layer that calls tm-core methods and displays results; handle only CLI-specific concerns like argument parsing, output formatting, and user prompts

Files:

  • apps/cli/src/lib/model-management.ts
src/ai-providers/*.js

πŸ“„ CodeRabbit inference engine (.cursor/rules/ai_providers.mdc)

src/ai-providers/*.js: Create a new provider module in src/ai-providers/<provider-name>.js that implements generate<ProviderName>Text, stream<ProviderName>Text, and generate<ProviderName>Object functions using the Vercel AI SDK
Provider modules in src/ai-providers/ must import generateText, streamText, generateObject from the ai package, the provider's create<ProviderName> function from @ai-sdk/<provider-name>, and the log utility from ../../scripts/modules/utils.js
Provider functions must include basic validation and try/catch error handling

src/ai-providers/*.js files should contain provider-specific wrappers for Vercel AI SDK functions and interact directly with Vercel AI SDK adapters

Files:

  • src/ai-providers/base-provider.js
**/*.js

πŸ“„ CodeRabbit inference engine (.cursor/rules/architecture.mdc)

**/*.js: Always use isSilentMode() function to check current silent mode status instead of directly accessing the global silentMode variable or global.silentMode
Use try/finally block pattern when wrapping core function calls with enableSilentMode/disableSilentMode to ensure silent mode is always restored, even if errors occur
For functions that need to handle both a passed silentMode parameter and check global state, check both the function parameter and global state: const isSilent = options.silentMode || (typeof options.silentMode === 'undefined' && isSilentMode())
Functions should accept their dependencies as parameters rather than using globals to promote testability and explicit dependency injection
Define callbacks as separate functions for easier testing rather than inline functions

Files:

  • src/ai-providers/base-provider.js
  • scripts/modules/config-manager.js
  • scripts/modules/ai-services-unified.js
**/*.{js,jsx}

πŸ“„ CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

JavaScript test files using Jest must follow the same testing patterns as TypeScript files, include proper mocking of external dependencies, and achieve the same coverage thresholds

Files:

  • src/ai-providers/base-provider.js
  • scripts/modules/config-manager.js
  • scripts/modules/ai-services-unified.js
scripts/modules/config-manager.js

πŸ“„ CodeRabbit inference engine (.cursor/rules/ai_providers.mdc)

scripts/modules/config-manager.js: In scripts/modules/config-manager.js, update MODEL_MAP to include the new provider, ensure VALID_PROVIDERS includes the provider, update API key handling in keyMap and the switch statement in getMcpApiKeyStatus and isApiKeySet
For providers not requiring an API key (like Ollama), add a specific check at the beginning of isApiKeySet and getMcpApiKeyStatus to return true immediately for that provider

config-manager.js should load and validate .taskmasterconfig, provide getter functions (getMainProvider, getLogLevel, getDefaultSubtasks, etc.) for accessing settings, manage global.defaultTag and tags section for tag system settings, and NOT directly store or handle API keys

Files:

  • scripts/modules/config-manager.js
scripts/**/*.js

πŸ“„ CodeRabbit inference engine (.cursor/rules/context_gathering.mdc)

scripts/**/*.js: Use the ContextGatherer class from scripts/modules/utils/contextGatherer.js to extract context from multiple sources (tasks, files, custom text, project tree) with token counting using gpt-tokens library
Initialize ContextGatherer with project root and tasks path, then call gather() method with tasks array, files array, customContext, includeProjectTree, format ('research', 'chat', or 'system-prompt'), and includeTokenCounts options
Use the FuzzyTaskSearch class from scripts/modules/utils/fuzzyTaskSearch.js for intelligent task discovery with semantic matching, purpose categorization, and relevance scoring using Fuse.js
Implement a three-step initialization pattern for context-aware commands: (1) validate and parse parameters, (2) initialize context gatherer and find project root, (3) auto-discover relevant tasks using fuzzy search if task IDs not specified
Display token breakdown using boxen library with sections for tasks, files, and prompts, showing formatted token counts and file sizes in a clean bordered box with title
Process AI result responses using cli-highlight library to apply syntax highlighting to code blocks with language detection in the format language\ncode
Set reasonable file size limits (50KB default) and project tree depth limits (3-5 levels) when gathering context to maintain performance
Implement graceful error handling for context gathering: handle missing files with warnings, validate task IDs with helpful messages, continue processing if some context sources fail, and provide fallback behavior

Files:

  • scripts/modules/config-manager.js
  • scripts/modules/ai-services-unified.js
scripts/modules/**/*

πŸ“„ CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)

Restart the MCP server if core logic in scripts/modules or MCP tool definitions change

Files:

  • scripts/modules/config-manager.js
  • scripts/modules/ai-services-unified.js
scripts/modules/*.js

πŸ“„ CodeRabbit inference engine (.cursor/rules/mcp.mdc)

When implementing MCP support for a command, ensure the core logic function can suppress console output via an outputFormat parameter or other mechanism

scripts/modules/*.js: Use consistent file naming conventions: task_${id.toString().padStart(3, '0')}.txt for task files; use path.join() for composing paths; use appropriate extensions (.txt for tasks, .json for data)
Export all core functions, helper functions, and utility methods needed by dependent code from their respective modules; explicitly verify module export blocks at the bottom of files
Use structured error objects with code and message properties; include clear error messages; handle both function-specific and file system errors; log errors at appropriate severity levels
Use isSilentMode() function to check global silent mode status; wrap core function calls within direct functions using enableSilentMode() and disableSilentMode() in try/finally blocks if the core function produces console output not reliably controlled by outputFormat parameter
Ensure AI calls correctly handle and propagate telemetryData as described in telemetry.mdc
Import context gathering utilities (ContextGatherer, FuzzyTaskSearch) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display
Prefer generateTextService for calls sending large context (like stringified JSON) where incremental display is not needed; import necessary service functions from ai-services-unified.js and prepare parameters (role, session, systemPrompt, prompt)
Create a clear unidirectional flow of dependencies between modules; separate business logic from UI rendering to avoid circular dependencies
Design functions to accept dependencies as parameters; avoid hard-coded dependencies that are difficult to mock
Keep pure logic separate from I/O operations or UI rendering to allow testing logic without mocking complex dependencies
Design core logic to work wi...

Files:

  • scripts/modules/config-manager.js
  • scripts/modules/ai-services-unified.js
scripts/modules/**/*.{js,ts}

πŸ“„ CodeRabbit inference engine (.cursor/rules/utilities.mdc)

scripts/modules/**/*.{js,ts}: Implement silent migration for tasks.json files that transforms old format to tagged format, marking global flag and performing complete migration
Implement tag resolution functions (getTasksForTag, setTasksForTag, getCurrentTag) that provide backward compatibility with legacy format and default to master tag
Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking
When a logger object is passed as a parameter to core functions, ensure the receiving function can call methods like .info, .warn, .error on that object

Files:

  • scripts/modules/config-manager.js
  • scripts/modules/ai-services-unified.js
scripts/modules/ai-services-unified.js

πŸ“„ CodeRabbit inference engine (.cursor/rules/ai_providers.mdc)

In scripts/modules/ai-services-unified.js, import new providers and add entries to the PROVIDER_FUNCTIONS map with generateText, streamText, and generateObject properties

ai-services-unified.js should export generateTextService and generateObjectService, handle provider/model selection based on role and .taskmasterconfig, resolve API keys, implement fallback and retry logic, and orchestrate calls to provider-specific implementations

Files:

  • scripts/modules/ai-services-unified.js
🧠 Learnings (56)
πŸ““ Common learnings
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/AGENTS.md:0-0
Timestamp: 2025-12-11T14:45:14.973Z
Learning: Applies to assets/**/CLAUDE.md : Update `CLAUDE.md` file with project-specific context, task summaries, and custom command examples for Claude Code integration
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.617Z
Learning: Refer to new_features.mdc for guidelines on integrating new features into the Task Master CLI with tagged system considerations
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/AGENTS.md:0-0
Timestamp: 2025-12-11T14:45:14.973Z
Learning: Applies to assets/.claude/settings.json : Add Claude Code tool allowlist configuration in `.claude/settings.json` to include 'Edit', 'Bash(task-master *)', 'Bash(git commit:*)', 'Bash(git add:*)', 'Bash(npm run *)', and 'mcp__task_master_ai__*'
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: package.json:130-132
Timestamp: 2025-09-26T19:03:33.225Z
Learning: In the eyaltoledano/claude-task-master repository, packages are bundled using tsdown during the build process, which means dependencies imported by the source code (including tm internal packages like tm/ai-sdk-provider-grok-cli) are included in the final bundle and don't need to be available as separate runtime dependencies, so they should remain as devDependencies rather than being moved to dependencies.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: New MCP tools should be imported and registered in mcp-server/src/tools/index.js and tool definitions should be added to mcp.json
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: package.json:130-132
Timestamp: 2025-09-26T19:03:33.225Z
Learning: In the eyaltoledano/claude-task-master repository, all packages with tm prefix are internal packages that are part of the monorepo structure and are not published externally.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to mcp-server/src/tools/index.js : Register MCP tools by importing and calling registration functions in `mcp-server/src/tools/index.js`
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/index.js : Import and call tool registration functions in mcp-server/src/tools/index.js to register new MCP tools with the server
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: packages/ai-sdk-provider-grok-cli/package.json:11-13
Timestamp: 2025-09-26T19:05:47.555Z
Learning: In the eyaltoledano/claude-task-master repository, internal tm/ packages use a specific export pattern where the "exports" field points to TypeScript source files (./src/index.ts) while "main" points to compiled output (./dist/index.js) and "types" points to source files (./src/index.ts). This pattern is used consistently across internal packages like tm/core and tm/ai-sdk-provider-grok-cli because they are consumed directly during build-time bundling with tsdown rather than being published as separate packages.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.455Z
Learning: Applies to apps/mcp/src/**/*.{ts,tsx} : MCP (tm/mcp) should be a thin presentation layer that calls tm-core methods and returns MCP-formatted responses; handle only MCP-specific concerns like tool schemas, parameter validation, and response formatting
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to .cursor/mcp.json : Add new tool definitions to the tools array in `.cursor/mcp.json`
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1282
File: packages/tm-core/src/utils/index.ts:16-34
Timestamp: 2025-10-08T19:57:00.982Z
Learning: For the tm-core package in the eyaltoledano/claude-task-master repository, the team prefers a minimal, need-based export strategy in index files rather than exposing all internal utilities. Exports should only be added when functions are actually consumed by other packages in the monorepo.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
πŸ“š Learning: 2025-09-26T19:03:33.225Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: package.json:130-132
Timestamp: 2025-09-26T19:03:33.225Z
Learning: In the eyaltoledano/claude-task-master repository, packages are bundled using tsdown during the build process, which means dependencies imported by the source code (including tm internal packages like tm/ai-sdk-provider-grok-cli) are included in the final bundle and don't need to be available as separate runtime dependencies, so they should remain as devDependencies rather than being moved to dependencies.

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
  • package.json
πŸ“š Learning: 2025-09-24T15:46:28.029Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1114
File: src/ai-providers/gemini-cli.js:12-12
Timestamp: 2025-09-24T15:46:28.029Z
Learning: When AI SDK provider packages are moved from optional dependencies to required dependencies in package.json, static imports should be used instead of dynamic imports with error handling, as the package is guaranteed to be available at runtime.

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • package.json
  • src/ai-providers/base-provider.js
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: To add a new AI provider with official Vercel AI SDK support, install the provider package via `npm install ai-sdk/<provider-name>`

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
  • package.json
  • src/ai-providers/base-provider.js
  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to src/ai-providers/*.js : Provider modules in `src/ai-providers/` must import `generateText`, `streamText`, `generateObject` from the `ai` package, the provider's `create<ProviderName>` function from `ai-sdk/<provider-name>`, and the `log` utility from `../../scripts/modules/utils.js`

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • package.json
  • src/ai-providers/base-provider.js
  • scripts/modules/ai-services-unified.js
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
πŸ“š Learning: 2025-09-22T19:45:04.337Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/tm-core/package.json:50-51
Timestamp: 2025-09-22T19:45:04.337Z
Learning: In the eyaltoledano/claude-task-master project, Crunchyman-ralph intentionally omits version fields from internal/private packages in package.json files to prevent changesets from releasing new versions of these packages while still allowing them to be processed for dependency updates. The changesets warnings about missing versions are acceptable as they don't break the process and achieve the desired behavior of only releasing public packages.

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
  • package.json
πŸ“š Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to src/ai-providers/*.js : src/ai-providers/*.js files should contain provider-specific wrappers for Vercel AI SDK functions and interact directly with Vercel AI SDK adapters

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • package.json
  • src/ai-providers/base-provider.js
  • scripts/modules/ai-services-unified.js
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to src/ai-providers/*.js : Create a new provider module in `src/ai-providers/<provider-name>.js` that implements `generate<ProviderName>Text`, `stream<ProviderName>Text`, and `generate<ProviderName>Object` functions using the Vercel AI SDK

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • package.json
  • src/ai-providers/base-provider.js
  • scripts/modules/ai-services-unified.js
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to tests/unit/ai-providers/*.test.js : Create unit tests in `tests/unit/ai-providers/<provider-name>.test.js` that mock the provider's AI SDK module and test each exported function for correct client instantiation, parameter passing, result handling, and error handling

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • src/ai-providers/base-provider.js
πŸ“š Learning: 2025-11-24T18:03:13.456Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.456Z
Learning: Applies to jest.config.js : Jest configuration must use ts-jest preset for TypeScript support, configure test environment as 'node', set roots to ['<rootDir>/src', '<rootDir>/tests'], and include testMatch patterns for both *.test.ts and *.spec.ts files with separate projects for unit, integration, and e2e tests

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
πŸ“š Learning: 2025-11-24T18:03:13.456Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.456Z
Learning: Applies to package.json : package.json scripts must include: 'test', 'test:watch', 'test:coverage', 'test:unit', 'test:integration', 'test:e2e', and 'test:ci' commands for testing framework integration

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
πŸ“š Learning: 2025-09-26T19:05:47.555Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: packages/ai-sdk-provider-grok-cli/package.json:11-13
Timestamp: 2025-09-26T19:05:47.555Z
Learning: In the eyaltoledano/claude-task-master repository, internal tm/ packages use a specific export pattern where the "exports" field points to TypeScript source files (./src/index.ts) while "main" points to compiled output (./dist/index.js) and "types" points to source files (./src/index.ts). This pattern is used consistently across internal packages like tm/core and tm/ai-sdk-provider-grok-cli because they are consumed directly during build-time bundling with tsdown rather than being published as separate packages.

Applied to files:

  • packages/ai-sdk-provider-grok-cli/package.json
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to scripts/modules/ai-services-unified.js : In `scripts/modules/ai-services-unified.js`, import new providers and add entries to the `PROVIDER_FUNCTIONS` map with `generateText`, `streamText`, and `generateObject` properties

Applied to files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • src/ai-providers/base-provider.js
  • scripts/modules/ai-services-unified.js
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
πŸ“š Learning: 2025-10-31T18:07:17.402Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1360
File: src/ai-providers/glm.js:0-0
Timestamp: 2025-10-31T18:07:17.402Z
Learning: In src/ai-providers/glm.js, the GLM provider's getClient method should allow defaulting to the 'coding' endpoint when an invalid or unspecified route parameter is provided, as this is the correct behavior per Z.ai's OpenAI-compatible API documentation. Do not enforce strict route validation that throws errors for unknown routes.

Applied to files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to src/ai-providers/*.js : Provider functions must include basic validation and try/catch error handling

Applied to files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • src/ai-providers/base-provider.js
πŸ“š Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Each module should have well-defined exports that can be mocked in tests

Applied to files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
πŸ“š Learning: 2025-08-07T13:00:22.966Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1090
File: apps/extension/package.json:241-243
Timestamp: 2025-08-07T13:00:22.966Z
Learning: In monorepos, local packages should use "*" as the version constraint in package.json dependencies, as recommended by npm. This ensures the local version from within the same workspace is always used, rather than attempting to resolve from external registries. This applies to packages like task-master-ai within the eyaltoledano/claude-task-master monorepo.

Applied to files:

  • package.json
πŸ“š Learning: 2025-11-24T18:00:32.617Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.617Z
Learning: Refer to changeset.mdc for guidelines on using Changesets (npm run changeset) to manage versioning and changelogs

Applied to files:

  • package.json
πŸ“š Learning: 2025-07-17T21:33:57.585Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.

Applied to files:

  • package.json
πŸ“š Learning: 2025-09-26T19:07:10.485Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: packages/ai-sdk-provider-grok-cli/package.json:21-35
Timestamp: 2025-09-26T19:07:10.485Z
Learning: In the eyaltoledano/claude-task-master repository, the tsdown build configuration uses `noExternal: [/^tm\//]` which means internal tm/ packages are bundled into the final output while external npm dependencies remain external and are resolved from the root package.json dependencies at runtime. This eliminates the need for peer dependencies in internal packages since the root package.json already provides the required external dependencies.

Applied to files:

  • package.json
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to scripts/modules/supported-models.json : Update `scripts/modules/supported-models.json` to add a new provider key with an array of model objects, each containing `id`, `name` (optional), `swe_score`, `cost_per_1m_tokens` (optional), `allowed_roles`, and `max_tokens` (optional but recommended)

Applied to files:

  • apps/cli/src/lib/model-management.ts
  • scripts/modules/config-manager.js
πŸ“š Learning: 2025-11-24T18:02:49.782Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/telemetry.mdc:0-0
Timestamp: 2025-11-24T18:02:49.782Z
Learning: The telemetryData object structure must include: timestamp (ISO string), userId, commandName, modelUsed, providerName, inputTokens, outputTokens, totalTokens, totalCost, and currency fields

Applied to files:

  • apps/cli/src/lib/model-management.ts
πŸ“š Learning: 2025-10-01T19:53:34.261Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1262
File: scripts/modules/task-manager/update-tasks.js:216-233
Timestamp: 2025-10-01T19:53:34.261Z
Learning: For scripts/modules/task-manager/*.js: Use generateObjectService with Zod schemas for structured AI responses rather than generateTextService + manual JSON parsing, as modern AI providers increasingly support the tool use and generateObject paradigm with improved reliability.

Applied to files:

  • src/ai-providers/base-provider.js
  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to scripts/modules/ai-services-unified.js : ai-services-unified.js should export generateTextService and generateObjectService, handle provider/model selection based on role and .taskmasterconfig, resolve API keys, implement fallback and retry logic, and orchestrate calls to provider-specific implementations

Applied to files:

  • src/ai-providers/base-provider.js
  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Use `generateTextService` with robust manual JSON parsing and Zod validation instead of `generateObjectService` for structured output needs

Applied to files:

  • src/ai-providers/base-provider.js
πŸ“š Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Be aware of potential reliability issues with `generateObjectService` across different providers and complex schemas; prefer `generateTextService` + manual parsing for robustness

Applied to files:

  • src/ai-providers/base-provider.js
πŸ“š Learning: 2025-11-24T18:02:49.782Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/telemetry.mdc:0-0
Timestamp: 2025-11-24T18:02:49.782Z
Learning: Applies to scripts/modules/task-manager/**/*.js : AI service functions in core logic (e.g., in scripts/modules/task-manager/) must call the appropriate AI service function (e.g., generateObjectService) and pass commandName and outputType in the params object

Applied to files:

  • src/ai-providers/base-provider.js
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to scripts/modules/config-manager.js : In `scripts/modules/config-manager.js`, update `MODEL_MAP` to include the new provider, ensure `VALID_PROVIDERS` includes the provider, update API key handling in `keyMap` and the `switch` statement in `getMcpApiKeyStatus` and `isApiKeySet`

Applied to files:

  • scripts/modules/config-manager.js
  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Do not fetch AI-specific parameters (model ID, max tokens, temperature) using `config-manager.js` getters for AI calls; pass the `role` parameter instead to the unified service

Applied to files:

  • scripts/modules/config-manager.js
  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,ts} : Do not call AI-specific getters (like getMainModelId, getMainMaxTokens) from core logic functions in scripts/modules/task-manager/*. Instead, pass the role to the unified AI service

Applied to files:

  • scripts/modules/config-manager.js
  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Use `config-manager.js` getters only for non-AI related application logic (e.g., `getDefaultSubtasks`), not for fetching AI parameters; the unified service handles AI parameter resolution internally based on the `role`

Applied to files:

  • scripts/modules/config-manager.js
πŸ“š Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Handle different ID formats consistently when removing dependencies

Applied to files:

  • scripts/modules/config-manager.js
πŸ“š Learning: 2025-08-08T11:33:15.297Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.

Applied to files:

  • scripts/modules/config-manager.js
πŸ“š Learning: 2025-08-08T11:34:45.482Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: .changeset/vast-weeks-fetch.md:5-5
Timestamp: 2025-08-08T11:34:45.482Z
Learning: This repo’s supported models list is CI-generated into docs/models.md from scripts/modules/supported-models.json (workflow: .github/workflows/update-models-md.yml using docs/scripts/models-json-to-markdown.js). Don’t request manual edits to the Markdown; ensure the JSON is correct instead. README links to docs/models.md.

Applied to files:

  • scripts/modules/config-manager.js
πŸ“š Learning: 2025-08-08T11:34:45.482Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: .changeset/vast-weeks-fetch.md:5-5
Timestamp: 2025-08-08T11:34:45.482Z
Learning: In this repo, supported-models.md is auto-generated by CI from supported-models.json; do not request manual edits to that fileβ€”ensure JSON entries are correct instead.

Applied to files:

  • scripts/modules/config-manager.js
πŸ“š Learning: 2025-08-08T11:34:45.482Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: .changeset/vast-weeks-fetch.md:5-5
Timestamp: 2025-08-08T11:34:45.482Z
Learning: In this repo, the supported models list is auto-generated by CI into docs/models.md from scripts/modules/supported-models.json via .github/workflows/update-models-md.yml and docs/scripts/models-json-to-markdown.js. Don’t request manual edits to the Markdown; ensure the JSON is correct instead.

Applied to files:

  • scripts/modules/config-manager.js
πŸ“š Learning: 2025-07-21T14:14:48.694Z
Learnt from: rtmcrc
Repo: eyaltoledano/claude-task-master PR: 933
File: scripts/modules/supported-models.json:238-238
Timestamp: 2025-07-21T14:14:48.694Z
Learning: Model version updates in scripts/modules/supported-models.json may be included in feature PRs if they provide practical improvements like reduced error rates, even if not directly related to the main feature being implemented.

Applied to files:

  • scripts/modules/config-manager.js
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Use the AsyncOperationManager in the MCP tool layer for operations involving multiple steps or long waits beyond a single AI call; simple AI calls handled entirely within the *Direct function may not need it

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Do not initialize AI clients (Anthropic, Perplexity, etc.) directly within core logic or MCP direct functions; use the unified service layer instead

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/index.js : Import and call tool registration functions in mcp-server/src/tools/index.js to register new MCP tools with the server

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to mcp-server/src/tools/index.js : Register MCP tools by importing and calling registration functions in `mcp-server/src/tools/index.js`

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Access API keys for AI services via the session.env object in the MCP context rather than reading environment variables directly

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: New MCP tools should be imported and registered in mcp-server/src/tools/index.js and tool definitions should be added to mcp.json

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Do not wrap unified AI service calls (generateTextService, generateObjectService) in silent mode; their logging is handled internally

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Pass the `session` object (from context parameter) to the AI service call when in MCP context

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T18:02:49.782Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/telemetry.mdc:0-0
Timestamp: 2025-11-24T18:02:49.782Z
Learning: Applies to mcp-server/src/tools/**/*.js : MCP tools in mcp-server/src/tools/ must call the corresponding direct function wrapper and pass the result object to handleApiResult(result, log) from mcp-server/src/tools/utils.js

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js, scripts/modules/ai-services-unified.js : Do not import or call anything from deprecated AI service files (`ai-services.js`, `ai-client-factory.js`, `ai-client-utils.js`)

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Use the `models` MCP tool or the `task-master models` CLI command to manage AI configurations

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : For MCP tools, implement caching using `getCachedOrExecute` from `../../tools/utils.js` if appropriate, or directly call core logic in try/catch block

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to mcp-server/src/tools/*.js : Create MCP tool definitions in `mcp-server/src/tools/` using kebab-case naming; use zod for parameter validation; make projectRoot optional as the HOF handles fallback; wrap execute method with `withNormalizedProjectRoot`

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Use the initialize_project tool for setting up new projects in integrated environments without requiring a project root

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Determine the appropriate `role` (`main`, `research`, `fallback`) in core logic and pass it to the AI service call

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: For provider troubleshooting: verify the correct API key for the selected provider exists in the appropriate location, check that the model ID set for the role is valid, check provider service status, and restart MCP if configuration or provider code changes were made.

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Task Master uses three roles for AI models: `main` (primary model for general tasks), `research` (model with web access when --research flag is used), and `fallback` (model used if primary fails). Each role is configured with a specific `provider:modelId` pair.

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Call the corresponding *Direct function wrapper from task-master-core.js within the execute method of each MCP tool, passing necessary arguments and the logger

Applied to files:

  • scripts/modules/ai-services-unified.js
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: When setting a model ID using the `models` MCP tool or CLI command, DO NOT include the `provider:` prefixβ€”use only the model ID itself (e.g., `gpt-4o` not `openai:gpt-4o`)

Applied to files:

  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
🧬 Code graph analysis (2)
scripts/modules/config-manager.js (3)
src/profiles/base-profile.js (1)
  • name (28-47)
scripts/modules/ai-services-unified.js (1)
  • modelId (632-632)
scripts/modules/update-config-tokens.js (1)
  • modelId (25-25)
scripts/modules/ai-services-unified.js (1)
packages/ai-sdk-tools/src/context7/client.ts (1)
  • isContext7Available (98-106)
πŸ”‡ Additional comments (8)
apps/cli/src/lib/model-management.ts (1)

19-28: LGTM!

The addition of the optional name property to ModelData aligns with the changes in config-manager.js that now prefer explicit model names from definitions. This is a non-breaking, additive change to the interface.

scripts/modules/config-manager.js (1)

1013-1014: LGTM!

Simplifying name derivation to prefer explicit modelObj.name from supported-models.json over computed names is cleaner and more maintainable. This aligns with the ModelData interface update.

scripts/modules/ai-services-unified.js (2)

65-108: Well-implemented singleton pattern for MCP tools.

The promise-based caching correctly handles concurrent initialization requests, and error handling gracefully degrades to empty tools without breaking the service.


619-628: Clean integration of MCP tools into the service pipeline.

The tools are efficiently fetched from the singleton cache and conditionally passed to providers only when available. The debug logging aids troubleshooting without cluttering production output.

Also applies to: 762-762

src/ai-providers/base-provider.js (1)

294-307: Proper AI SDK v6 migration with Output.object().

The migration from generateObject/streamObject to generateText/streamText with Output.object() correctly implements the v6 pattern for structured output with tool support. The result handling properly accesses result.output for the structured object.

Also applies to: 345-359, 390-392

packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts (1)

29-29: LGTM!

Tests correctly updated to reflect the public API rename from textEmbeddingModel to embeddingModel. The test behavior remains consistent - verifying that NoSuchModelError is thrown for unsupported model types.

Also applies to: 91-96

package.json (1)

56-75: Verify OpenRouter compatibility with AI SDK v6.

The AI SDK v6 migration is complete in the package.json ("ai": "^6.0.13" and all @ai-sdk/* packages updated), and base-provider.js uses AI SDK v6 APIs. However, @openrouter/ai-sdk-provider v1.5.4 targets AI SDK v5 with no official v6-compatible release available yet. Test OpenRouter functionality against AI SDK v6 to confirm compatibility, as the version mismatch could cause unexpected failures in edge cases or future spec changes.

packages/ai-sdk-provider-grok-cli/package.json (1)

17-25: Compatibility confirmed for @ai-sdk/provider v3.0 and @ai-sdk/provider-utils v4.0.

The dependencies have been upgraded across major versions, but the implementation is already compatible with these versions. The code correctly uses the v3 API surface (baseURL instead of baseUrl), modern factory patterns (createGrokCli), and avoids deprecated APIs. No breaking-change API usage detected.

@@ -84,7 +84,7 @@ export function createGrokCli(
provider.chat = createModel; // Alias for languageModel

// Add textEmbeddingModel method that throws NoSuchModelError
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor

Update the comment to reflect the current method name.

The comment refers to textEmbeddingModel, but the implementation on line 87 uses embeddingModel.

πŸ”Ž Proposed fix
-	// Add textEmbeddingModel method that throws NoSuchModelError
+	// Add embeddingModel method that throws NoSuchModelError
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Add textEmbeddingModel method that throws NoSuchModelError
// Add embeddingModel method that throws NoSuchModelError
πŸ€– Prompt for AI Agents
In @packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts at line 86, The
inline comment incorrectly mentions textEmbeddingModel while the actual method
is embeddingModel; update the comment to reference embeddingModel (or rename the
method to textEmbeddingModel if that was intended) so the comment and the
implementation match, adjusting any surrounding docs or usages of embeddingModel
in grok-cli-provider.ts accordingly.

Comment on lines 366 to 381
// Log tool usage if any tools were called (AI SDK v6 uses steps for multi-turn tool calls)
if (result.steps && result.steps.length > 0) {
const toolSteps = result.steps.filter(
(step) => step.toolCalls && step.toolCalls.length > 0
);
if (toolSteps.length > 0) {
console.log(
`[AI Tools] Tool calls made across ${toolSteps.length} step(s):`
);
for (const step of toolSteps) {
for (const call of step.toolCalls) {
console.log(` - ${call.toolName}: ${JSON.stringify(call.args)}`);
}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor

Use the log utility instead of console.log.

Per coding guidelines, direct console.log calls should be avoided. Use the imported log function for consistent logging behavior and to respect silent mode.

πŸ”Ž Proposed fix
 			if (toolSteps.length > 0) {
-				console.log(
-					`[AI Tools] Tool calls made across ${toolSteps.length} step(s):`
+				log(
+					'info',
+					`[AI Tools] Tool calls made across ${toolSteps.length} step(s)`
 				);
 				for (const step of toolSteps) {
 					for (const call of step.toolCalls) {
-						console.log(`  - ${call.toolName}: ${JSON.stringify(call.args)}`);
+						log('debug', `  - ${call.toolName}: ${JSON.stringify(call.args)}`);
 					}
 				}
 			}
πŸ€– Prompt for AI Agents
In @src/ai-providers/base-provider.js around lines 366 - 381, Replace the direct
console logging in the tool-steps block with the project logging utility: where
the code inspects result.steps and builds toolSteps (variables result,
toolSteps, step, call), call the imported log function instead of console.log
for the header and each tool call line so logging respects silent mode and
centralized configuration; update the three console.log occurrences to use log
and preserve the same messages (including JSON.stringify(call.args)) and ensure
the log import is used (log).

- todo, upgrade to ai sdk v6 (openrouter not upgraded to ai sdk v6 yet, waiting on that)
@Crunchyman-ralph Crunchyman-ralph force-pushed the claude/add-mcp-tools-01RL5weq2wgmxVJyZctujEz3 branch from 3ad2609 to 8913342 Compare January 6, 2026 16:29
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/ai-sdk-tools/src/mcp-tools-manager.ts (1)

82-92: Minor inefficiency: isContext7Available may be called twice.

When config is undefined (auto-detection mode), isContext7Available(context7Config) is invoked at line 92 to compute shouldEnableContext7, then again at line 94 in the guard. Consider caching the result to avoid redundant API key lookups.

πŸ”Ž Proposed optimization
 	// Context7 tools
 	const context7Config =
 		config?.context7 === true
 			? {}
 			: config?.context7 === false
 				? undefined
 				: config?.context7;

-	// Only create Context7 tools if explicitly enabled or auto-detect available
-	const shouldEnableContext7 =
-		config?.context7 !== false &&
-		(config?.context7 !== undefined || isContext7Available(context7Config));
+	// Cache availability check to avoid redundant API key lookups
+	const context7Available =
+		config?.context7 !== false ? isContext7Available(context7Config) : false;

-	if (shouldEnableContext7 && isContext7Available(context7Config)) {
+	// Only create Context7 tools if explicitly enabled or auto-detect available
+	const shouldEnableContext7 =
+		config?.context7 !== false &&
+		(config?.context7 !== undefined || context7Available);
+
+	if (shouldEnableContext7 && context7Available) {
packages/ai-sdk-tools/tsconfig.json (1)

12-23: Remove redundant strict type-checking flags.

Lines 13-19 are redundant when strict: true is set on line 12. The strict flag already enables all of these individual flags: noImplicitAny, strictNullChecks, strictFunctionTypes, strictBindCallApply, strictPropertyInitialization, noImplicitThis, and alwaysStrict. Keeping them adds unnecessary maintenance overhead.

πŸ”Ž Proposed simplification
 	"compilerOptions": {
 		"target": "ES2022",
 		"module": "NodeNext",
 		"lib": ["ES2022"],
 		"declaration": true,
 		"declarationMap": true,
 		"sourceMap": true,
 		"outDir": "./dist",
 		"baseUrl": ".",
 		"rootDir": "./src",
 		"strict": true,
-		"noImplicitAny": true,
-		"strictNullChecks": true,
-		"strictFunctionTypes": true,
-		"strictBindCallApply": true,
-		"strictPropertyInitialization": true,
-		"noImplicitThis": true,
-		"alwaysStrict": true,
 		"noUnusedLocals": true,
 		"noUnusedParameters": true,
 		"noImplicitReturns": true,
 		"noFallthroughCasesInSwitch": true,
 		"esModuleInterop": true,
πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 3ad2609 and 8913342.

β›” Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
πŸ“’ Files selected for processing (11)
  • package.json
  • packages/ai-sdk-provider-grok-cli/package.json
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
  • packages/ai-sdk-tools/package.json
  • packages/ai-sdk-tools/src/context7/client.ts
  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/src/context7/types.ts
  • packages/ai-sdk-tools/src/index.ts
  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/ai-sdk-provider-grok-cli/package.json
  • packages/ai-sdk-tools/src/context7/types.ts
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.ts
  • package.json
  • packages/ai-sdk-tools/package.json
  • packages/ai-sdk-tools/src/context7/client.ts
  • packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
  • packages/ai-sdk-tools/src/index.ts
🧰 Additional context used
πŸ““ Path-based instructions (3)
**/*.ts

πŸ“„ CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

TypeScript test files must achieve minimum code coverage thresholds: 80% lines/functions and 70% branches globally, 90% for utilities, and 85% for middleware; new features must meet or exceed these thresholds

Files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/index.ts
**/*.{js,ts}

πŸ“„ CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/index.ts
**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Import modules with .js extension even in TypeScript source files for ESM compatibility

Files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
  • packages/ai-sdk-tools/src/context7/index.ts
🧠 Learnings (43)
πŸ““ Common learnings
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: To add a new AI provider with official Vercel AI SDK support, install the provider package via `npm install ai-sdk/<provider-name>`
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:06.827Z
Learning: Interacting via MCP server is the preferred method for AI agents and integrated development environments over CLI usage
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Pass the `session` object (from context parameter) to the AI service call when in MCP context
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Access API keys for AI services via the session.env object in the MCP context rather than reading environment variables directly
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Use the `models` MCP tool or the `task-master models` CLI command to manage AI configurations
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Use the AsyncOperationManager in the MCP tool layer for operations involving multiple steps or long waits beyond a single AI call; simple AI calls handled entirely within the *Direct function may not need it
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Do not initialize AI clients (Anthropic, Perplexity, etc.) directly within core logic or MCP direct functions; use the unified service layer instead
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.455Z
Learning: Applies to apps/mcp/src/**/*.{ts,tsx} : MCP (tm/mcp) should be a thin presentation layer that calls tm-core methods and returns MCP-formatted responses; handle only MCP-specific concerns like tool schemas, parameter validation, and response formatting
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to src/ai-providers/*.js : Create a new provider module in `src/ai-providers/<provider-name>.js` that implements `generate<ProviderName>Text`, `stream<ProviderName>Text`, and `generate<ProviderName>Object` functions using the Vercel AI SDK
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
πŸ“š Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: New MCP tools should be imported and registered in mcp-server/src/tools/index.js and tool definitions should be added to mcp.json

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/index.js : Import and call tool registration functions in mcp-server/src/tools/index.js to register new MCP tools with the server

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to mcp-server/src/tools/index.js : Register MCP tools by importing and calling registration functions in `mcp-server/src/tools/index.js`

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T22:09:45.455Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.455Z
Learning: Applies to apps/mcp/src/**/*.{ts,tsx} : MCP (tm/mcp) should be a thin presentation layer that calls tm-core methods and returns MCP-formatted responses; handle only MCP-specific concerns like tool schemas, parameter validation, and response formatting

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Use the AsyncOperationManager in the MCP tool layer for operations involving multiple steps or long waits beyond a single AI call; simple AI calls handled entirely within the *Direct function may not need it

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-26T21:57:48.927Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1451
File: apps/mcp/src/tools/tasks/set-task-status.tool.ts:23-25
Timestamp: 2025-11-26T21:57:48.927Z
Learning: Applies to apps/mcp/src/tools/**/*.ts : In the new apps/mcp MCP tool architecture, projectRoot is a required parameter in Zod schemas (not optional like in the legacy mcp-server structure)

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to mcp-server/src/tools/*.js : Create MCP tool definitions in `mcp-server/src/tools/` using kebab-case naming; use zod for parameter validation; make projectRoot optional as the HOF handles fallback; wrap execute method with `withNormalizedProjectRoot`

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to .cursor/mcp.json : Add new tool definitions to the tools array in `.cursor/mcp.json`

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-07-17T21:33:57.585Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1002
File: .changeset/puny-friends-give.md:2-3
Timestamp: 2025-07-17T21:33:57.585Z
Learning: In the eyaltoledano/claude-task-master repository, the MCP server code in mcp-server/src/ is part of the main "task-master-ai" package, not a separate "mcp-server" package. When creating changesets for MCP server changes, use "task-master-ai" as the package name.

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:02:49.782Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/telemetry.mdc:0-0
Timestamp: 2025-11-24T18:02:49.782Z
Learning: Applies to mcp-server/src/tools/**/*.js : MCP tools in mcp-server/src/tools/ must call the corresponding direct function wrapper and pass the result object to handleApiResult(result, log) from mcp-server/src/tools/utils.js

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Wrap core function calls and AI calls in try/catch blocks, log errors with appropriate severity and context, and return standardized error objects with code and message

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to mcp-server/src/**/*.{js,ts} : Use the logger wrapper pattern when passing loggers to prevent mcpLog[level] is not a function errors, wrapping FastMCP's log object with standard methods

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Do not wrap unified AI service calls (generateTextService, generateObjectService) in silent mode; their logging is handled internally

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to mcp-server/src/core/direct-functions/**/*.{js,ts} : In direct functions that call core functions, ensure console output from the core function is suppressed to avoid breaking MCP JSON responses

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Direct functions (mcp-server/src/core/direct-functions/*Direct functions) should implement silent mode to prevent console logs from interfering with structured JSON responses required by MCP, using enableSilentMode/disableSilentMode around core function calls and passing the MCP logger via standard wrapper pattern

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Do not add direct console.log calls outside the logging utility - use the central log function instead

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/**/*.js : Do not log entire large data structures or sensitive information in direct functions and tools

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Do not initialize AI clients (Anthropic, Perplexity, etc.) directly within core logic or MCP direct functions; use the unified service layer instead

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:02:49.782Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/telemetry.mdc:0-0
Timestamp: 2025-11-24T18:02:49.782Z
Learning: Applies to mcp-server/src/core/direct-functions/**/*.js : Direct function wrappers in mcp-server/src/core/direct-functions/ must call the corresponding core logic function with appropriate context including session, mcpLog, projectRoot, commandName, and outputType set to 'mcp'

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Direct functions should include telemetryData from core logic involving AI in their successful data payload following the standard pattern from telemetry.mdc

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Access API keys for AI services via the session.env object in the MCP context rather than reading environment variables directly

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:02:22.305Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-11-24T18:02:22.305Z
Learning: Use MCP tools instead of CLI commands when available for better performance, structured data, and error handling

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Use createErrorResponse and createContentResponse utilities from tools/utils.js for formatting MCP responses

Applied to files:

  • packages/ai-sdk-tools/src/mcp-tools-manager.ts
πŸ“š Learning: 2025-10-08T19:57:00.982Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1282
File: packages/tm-core/src/utils/index.ts:16-34
Timestamp: 2025-10-08T19:57:00.982Z
Learning: For the tm-core package in the eyaltoledano/claude-task-master repository, the team prefers a minimal, need-based export strategy in index files rather than exposing all internal utilities. Exports should only be added when functions are actually consumed by other packages in the monorepo.

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Import context gathering utilities (`ContextGatherer`, `FuzzyTaskSearch`) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-09-26T19:05:47.555Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: packages/ai-sdk-provider-grok-cli/package.json:11-13
Timestamp: 2025-09-26T19:05:47.555Z
Learning: In the eyaltoledano/claude-task-master repository, internal tm/ packages use a specific export pattern where the "exports" field points to TypeScript source files (./src/index.ts) while "main" points to compiled output (./dist/index.js) and "types" points to source files (./src/index.ts). This pattern is used consistently across internal packages like tm/core and tm/ai-sdk-provider-grok-cli because they are consumed directly during build-time bundling with tsdown rather than being published as separate packages.

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to src/ai-providers/*.js : Provider modules in `src/ai-providers/` must import `generateText`, `streamText`, `generateObject` from the `ai` package, the provider's `create<ProviderName>` function from `ai-sdk/<provider-name>`, and the `log` utility from `../../scripts/modules/utils.js`

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T17:59:00.056Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/context_gathering.mdc:0-0
Timestamp: 2025-11-24T17:59:00.056Z
Learning: Applies to scripts/modules/utils/{contextGatherer,fuzzyTaskSearch}.js : Export utility modules using named exports: `ContextGatherer`, `createContextGatherer` from contextGatherer.js and `FuzzyTaskSearch`, `PURPOSE_CATEGORIES`, `RELEVANCE_THRESHOLDS` from fuzzyTaskSearch.js

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-09-24T15:46:28.029Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1114
File: src/ai-providers/gemini-cli.js:12-12
Timestamp: 2025-09-24T15:46:28.029Z
Learning: When AI SDK provider packages are moved from optional dependencies to required dependencies in package.json, static imports should be used instead of dynamic imports with error handling, as the package is guaranteed to be available at runtime.

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Export all utility functions explicitly in logical groups and include configuration constants from utility modules

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-11-24T17:59:00.056Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/context_gathering.mdc:0-0
Timestamp: 2025-11-24T17:59:00.056Z
Learning: Applies to scripts/**/*.js : Use the `ContextGatherer` class from `scripts/modules/utils/contextGatherer.js` to extract context from multiple sources (tasks, files, custom text, project tree) with token counting using `gpt-tokens` library

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic

Applied to files:

  • packages/ai-sdk-tools/src/context7/index.ts
πŸ“š Learning: 2025-09-26T19:10:32.906Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: tsconfig.json:22-28
Timestamp: 2025-09-26T19:10:32.906Z
Learning: In the eyaltoledano/claude-task-master repository, all internal tm/ package path mappings in tsconfig.json consistently point to TypeScript source files (e.g., "./packages/*/src/index.ts") rather than built JavaScript. This is intentional architecture because tsdown bundles internal packages directly from source during build time, eliminating the need for separate compilation of internal packages.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-09-03T12:16:15.866Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/package.json:13-64
Timestamp: 2025-09-03T12:16:15.866Z
Learning: For internal packages in the claude-task-master project, Crunchyman-ralph prefers pointing package.json "types" entries to src .ts files rather than dist .d.ts files for better developer experience (DX), as the packages are not being exported as SDKs.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-11-24T18:03:13.456Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.456Z
Learning: Applies to jest.config.js : Jest configuration must use ts-jest preset for TypeScript support, configure test environment as 'node', set roots to ['<rootDir>/src', '<rootDir>/tests'], and include testMatch patterns for both *.test.ts and *.spec.ts files with separate projects for unit, integration, and e2e tests

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-09-17T19:09:08.882Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1211
File: jest.resolver.cjs:8-15
Timestamp: 2025-09-17T19:09:08.882Z
Learning: In the eyaltoledano/claude-task-master project, the team only uses .ts files and does not plan to use .tsx or .mts extensions, so Jest resolver and build tooling should focus on .js β†’ .ts mapping only.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-09-26T19:03:33.225Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: package.json:130-132
Timestamp: 2025-09-26T19:03:33.225Z
Learning: In the eyaltoledano/claude-task-master repository, packages are bundled using tsdown during the build process, which means dependencies imported by the source code (including tm internal packages like tm/ai-sdk-provider-grok-cli) are included in the final bundle and don't need to be available as separate runtime dependencies, so they should remain as devDependencies rather than being moved to dependencies.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-09-26T19:07:10.485Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: packages/ai-sdk-provider-grok-cli/package.json:21-35
Timestamp: 2025-09-26T19:07:10.485Z
Learning: In the eyaltoledano/claude-task-master repository, the tsdown build configuration uses `noExternal: [/^tm\//]` which means internal tm/ packages are bundled into the final output while external npm dependencies remain external and are resolved from the root package.json dependencies at runtime. This eliminates the need for peer dependencies in internal packages since the root package.json already provides the required external dependencies.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:02.683Z
Learning: Applies to .taskmaster/config.json : Store Taskmaster configuration settings (AI model selections, parameters, logging level, default subtasks/priority, project name, tag management) in `.taskmaster/config.json` in the project root. Do not configure these via environment variables.

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-11-24T22:09:45.455Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.455Z
Learning: Applies to **/*.{ts,tsx} : Import modules with `.js` extension even in TypeScript source files for ESM compatibility

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
πŸ“š Learning: 2025-11-24T18:03:13.456Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.456Z
Learning: Applies to src/**/*.ts : Source code must have corresponding test files either colocated (*.test.ts) or in tests/unit/ directory following established patterns from src/utils/auth.test.ts with proper mocking for external dependencies

Applied to files:

  • packages/ai-sdk-tools/tsconfig.json
🧬 Code graph analysis (1)
packages/ai-sdk-tools/src/mcp-tools-manager.ts (4)
packages/ai-sdk-tools/src/index.ts (4)
  • MCPToolsManagerConfig (20-20)
  • MCPToolsResult (21-21)
  • createMCPTools (18-18)
  • getAvailableMCPTools (19-19)
packages/ai-sdk-tools/src/context7/index.ts (3)
  • Context7Config (8-8)
  • isContext7Available (3-3)
  • createContext7Tools (2-2)
packages/ai-sdk-tools/src/context7/types.ts (1)
  • Context7Config (4-10)
packages/ai-sdk-tools/src/context7/client.ts (2)
  • isContext7Available (98-106)
  • createContext7Tools (58-93)
πŸ”‡ Additional comments (6)
packages/ai-sdk-tools/src/mcp-tools-manager.ts (5)

1-5: LGTM!

Imports are correctly structured with .js extension for ESM compatibility as required by the coding guidelines.


10-15: LGTM!

The interface cleanly supports both explicit configuration objects and boolean shorthand for enabling/disabling Context7.


20-35: LGTM!

The result interface is well-documented and properly exposes the lifecycle management via the close function.


106-113: LGTM!

The return structure properly aggregates tools and provides lifecycle cleanup via Promise.all for concurrent connection termination.


118-126: LGTM!

Clean utility function for querying available MCP tools based on environment configuration.

packages/ai-sdk-tools/src/context7/index.ts (1)

1-11: LGTM!

Clean barrel file with proper separation between runtime exports and type-only exports. Uses .js extensions for ESM compatibility as required by the coding guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Explicit rules to force LLM to check for Context7 MCP if available

3 participants