Eyal Toledano 245c3cb398 feat(telemetry): Implement AI usage telemetry pattern and apply to add-task
This commit introduces a standardized pattern for capturing and propagating AI usage telemetry (cost, tokens, model used) across the Task Master stack and applies it to the 'add-task' functionality.

Key changes include:

- **Telemetry Pattern Definition:**
  - Added  defining the integration pattern for core logic, direct functions, MCP tools, and CLI commands.
  - Updated related rules (, ,
 Usage: mcp [OPTIONS] COMMAND [ARGS]...

 MCP development tools

╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                                │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ version   Show the MCP version.                                                                                                            │
│ dev       Run a MCP server with the MCP Inspector.                                                                                         │
│ run       Run a MCP server.                                                                                                                │
│ install   Install a MCP server in the Claude desktop app.                                                                                  │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯, , ) to reference the new telemetry rule.

- **Core Telemetry Implementation ():**
  - Refactored the unified AI service to generate and return a  object alongside the main AI result.
  - Fixed an MCP server startup crash by removing redundant local loading of  and instead using the  imported from  for cost calculations.
  - Added  to the  object.

- ** Integration:**
  - Modified  (core) to receive  from the AI service, return it, and call the new UI display function for CLI output.
  - Updated  to receive  from the core function and include it in the  payload of its response.
  - Ensured  (MCP tool) correctly passes the  through via .
  - Updated  to correctly pass context (, ) to the core  function and rely on it for CLI telemetry display.

- **UI Enhancement:**
  - Added  function to  to show telemetry details in the CLI.

- **Project Management:**
  - Added subtasks 77.6 through 77.12 to track the rollout of this telemetry pattern to other AI-powered commands (, , , , , , ).

This establishes the foundation for tracking AI usage across the application.
2025-05-07 13:41:25 -04:00
2025-04-16 11:06:18 +02:00
2025-05-03 02:17:52 -04:00
2025-03-04 13:55:17 -05:00
2025-04-09 00:30:05 +02:00
2025-04-18 23:53:38 +02:00
2025-03-31 17:09:31 +02:00
2025-04-09 00:30:05 +02:00
2025-04-09 00:30:05 +02:00
2025-05-03 02:17:52 -04:00

Task Master GitHub stars

CI npm version Discord License: MIT with Commons Clause

By @eyaltoledano & @RalphEcom

Twitter Follow Twitter Follow

A task management system for AI-driven development with Claude, designed to work seamlessly with Cursor AI.

Requirements

  • Anthropic API key (Claude API)
  • OpenAI SDK (for Perplexity API integration, optional)

Quick Start

MCP (Model Control Protocol) provides the easiest way to get started with Task Master directly in your editor.

  1. Add the MCP config to your editor (Cursor recommended, but it works with other text editors):
{
	"mcpServers": {
		"taskmaster-ai": {
			"command": "npx",
			"args": ["-y", "--package=task-master-ai", "task-master-ai"],
			"env": {
				"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE",
				"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE",
				"OPENAI_API_KEY": "YOUR_OPENAI_KEY_HERE",
				"GOOGLE_API_KEY": "YOUR_GOOGLE_KEY_HERE",
				"MISTRAL_API_KEY": "YOUR_MISTRAL_KEY_HERE",
				"OPENROUTER_API_KEY": "YOUR_OPENROUTER_KEY_HERE",
				"XAI_API_KEY": "YOUR_XAI_KEY_HERE",
				"AZURE_OPENAI_API_KEY": "YOUR_AZURE_KEY_HERE"
			}
		}
	}
}
  1. Enable the MCP in your editor

  2. Prompt the AI to initialize Task Master:

Can you please initialize taskmaster-ai into my project?
  1. Use common commands directly through your AI assistant:
Can you parse my PRD at scripts/prd.txt?
What's the next task I should work on?
Can you help me implement task 3?
Can you help me expand task 4?

Option 2: Using Command Line

Installation

# Install globally
npm install -g task-master-ai

# OR install locally within your project
npm install task-master-ai

Initialize a new project

# If installed globally
task-master init

# If installed locally
npx task-master init

This will prompt you for project details and set up a new project with the necessary files and structure.

Common Commands

# Initialize a new project
task-master init

# Parse a PRD and generate tasks
task-master parse-prd your-prd.txt

# List all tasks
task-master list

# Show the next task to work on
task-master next

# Generate task files
task-master generate

Documentation

For more detailed information, check out the documentation in the docs directory:

Troubleshooting

If task-master init doesn't respond:

Try running it with Node directly:

node node_modules/claude-task-master/scripts/init.js

Or clone the repository and run:

git clone https://github.com/eyaltoledano/claude-task-master.git
cd claude-task-master
node scripts/init.js

Contributors

Task Master project contributors

Star History

Star History Chart

Licensing

Task Master is licensed under the MIT License with Commons Clause. This means you can:

Allowed:

  • Use Task Master for any purpose (personal, commercial, academic)
  • Modify the code
  • Distribute copies
  • Create and sell products built using Task Master

Not Allowed:

  • Sell Task Master itself
  • Offer Task Master as a hosted service
  • Create competing products based on Task Master

See the LICENSE file for the complete license text and licensing details for more information.

Description
An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.
Readme MIT 42 MiB
Languages
JavaScript 71.1%
TypeScript 23.8%
MDX 3.2%
Shell 1.7%
CSS 0.2%