Taskmaster AI

repository·main·Indexed 12 days ago

https://github.com/eyaltoledano/claude-task-master

An AI-driven task management system designed for AI chat interfaces and IDEs like Cursor. It features a VS Code extension with an interactive Kanban board, MCP and CLI interfaces for managing complex workflows, and a core library (@task-master/tm-core) for task orchestration. Version 0.43.1.

Tokens
241.7K
Snippets
779
Records
1.1K
Agent score
94%

What's inside Taskmaster

  1. Overview of the Task Master Prompt Management System

    main

    The Task Master Prompt Management System is a centralized system for managing AI prompt templates used across the application. It provides:

    • Centralized Storage: All prompts are located in /src/prompts.
    • JSON Schema Validation: Uses AJV to ensure structural integrity, parameter type safety, and template syntax (Handlebars).
    • Variant Support: Allows different prompt versions based on context (e.g., research mode or complexity levels).
    • Template Variables: Supports dynamic generation via variable substitution.
    • IDE Integration: Provides VS Code IntelliSense and validation support via JSON schemas.
  2. Understand Task Master licensing terms

    main

    Task Master is licensed under the MIT License with Commons Clause.

    Permitted Uses

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

    Prohibited Uses

    • Selling Task Master itself.
    • Offering Task Master as a hosted service.
    • Creating competing products based on Task Master.
  3. What is the Repository Planning Graph (RPG) Method?

    main

    The RPG (Repository Planning Graph) method is an advanced approach to creating Product Requirements Documents (PRDs) that generate highly-structured, dependency-aware task graphs. It is based on Microsoft Research's methodology for scalable codebase generation.

    When to Use RPG

    Use the RPG template (example_prd_rpg.md) for:

    • Complex multi-module systems with intricate dependencies.
    • Large-scale codebases being built from scratch.
    • Projects requiring explicit architecture and clear module boundaries.
    • Teams needing dependency visibility for parallel development.

    For simpler features or smaller projects, the standard example_prd.md template is more appropriate.

  4. Understand the extension CI/CD workflow

    main

    The extension uses a two-stage CI/CD process driven by changesets and GitHub Actions:

    1. Extension CI (extension-ci.yml)

    Triggers: Push or Pull Request to main or next branches (only if extension files change). Actions:

    • Lints and type-checks code.
    • Builds the extension (npm run build).
    • Creates a clean package (npm run package).
    • Runs tests via the VS Code test framework.
    • Creates a test VSIX package and uploads build artifacts.

    2. Version & Publish (version.yml)

    Triggers: Push to main branch. Actions:

    • Detects pending changesets and creates a "Version Packages" PR.
    • Upon merging the Version PR:
      • Builds and packages the extension.
      • Creates git tags (e.g., taskr-kanban@1.0.1).
      • Publishes to VS Code Marketplace (requires VSCE_PAT).
      • Publishes to Open VSX Registry (requires OVSX_PAT).
      • Updates CHANGELOG and package versions.
  5. Understand the Task Update Migration Architecture

    main

    The task update system is designed using an Object-Oriented approach within tm-core and apps/cli. It employs a Strategy Pattern to handle different update modes (Bulk, Single, and Subtask) through a unified interface.

    Key architectural components include:

    • UpdateTaskService: The main orchestrator that coordinates validation, strategy selection, context building, execution, and result display.
    • IUpdateStrategy: A contract defining the lifecycle of an update: validate -> loadTasks -> buildPrompts -> callAIService -> mergeResults.
    • BaseUpdateStrategy: An abstract class implementing the Template Method Pattern, providing a shared execute workflow for all concrete strategies.
    • UpdateStrategyFactory: Responsible for detecting the update mode based on input parameters and instantiating the correct strategy.
    • Service Layer: Specialized services like ContextBuilderService (AI context), PromptBuilderService (prompt construction), and DataMergerService (merging AI results with local data) handle specific business logic.
    ┌─────────────────────────┐
    │  UpdateTaskService      │ ◄─── Main Orchestrator
    │  (Coordinates)          │
    └───────┬─────────────────┘
            │ uses
            ├──► UpdateStrategyFactory ──creates──► IUpdateStrategy
            │                                           │
            ├──► ContextBuilderService                 │ implements
            │                                           ▼
            ├──► IDisplayManager ◄──creates── UpdateDisplayFactory
            │         │
            │         ├── CLIDisplayManager
            │         └── JSONDisplayManager
            │
            └──► ConfigManager (existing)
                 IStorage (existing)
                 Logger (existing)
    
    ┌────────────────────────────────────────────────────┐
    │                 IUpdateStrategy                    │
    └────────────────────────────────────────────────────┘
                            △
                            │ extends
                ┌───────────┴────────────┐
                │                        │
    ┌───────────────────────┐    ┌──────────────────────┐
    │   BaseUpdateStrategy  │    │  Abstract base with  │
    │  (Template Method)   │    │  common workflow     │
    └───────────┬───────────┘    └──────────────────────┘
                │ extends
        ┌───────┼──────────┬─────────────┐
        │       │          │             │
    ┌───▼───┐ ┌─▼────┐  ┌─▼──────────┐  │
    │ Bulk  │ │Single│  │  Subtask   │  │
    │Update │ │Task  │  │  Update    │  │
    │       │ │Update│  │            │  │
    └───────┘ └──────┘  └────────────┘  │
                                         ├──► ContextBuilderService
                                         │      ├─uses─► ContextGatherer (existing)
                                         │      └─uses─► FuzzyTaskSearch (existing)
                                         │
                                         ├──► PromptBuilderService
                                         │      └─uses─► PromptManager (existing)
                                         │
                                         └──► DataMergerService
  6. Understand Task Dependency Logic in Task Master

    main

    Task Master uses an intelligent dependency system when creating new tasks. When a user requests a new task, the system performs two types of dependency analysis:

    1. Explicit Dependencies: These are task IDs manually provided by the user or identified via specific numeric inputs. The system focuses on these and analyzes their own dependency chains to build a complete context for the AI.
    2. Auto-discovery Mode: If no explicit dependencies are provided, the system performs keyword matching against existing tasks and analyzes recent tasks to build a relevant context for the AI.

    The AI is then prompted to return a JSON object that includes a dependencies array containing only the task IDs that the new task directly depends on, based on the provided project context.

    {
      "title": "Task title goes here",
      "description": "A concise one or two sentence description of what the task involves",
      "details": "In-depth implementation details, considerations, and guidance.",
      "testStrategy": "Detailed approach for verifying task completion.",
      "dependencies": [1, 2, 3] // Optional: Array of existing task IDs that this task depends on
    }
  7. Use Tagged Task Lists and Git Integration

    main

    Taskmaster (v0.17+) supports tagged task lists for managing tasks across different contexts.

    Global Tag Settings

    In .taskmaster/config.json, you can define the default context:

    "global": {
      "defaultTag": "master"
    }

    Git Integration

    Taskmaster provides manual git integration to link tags to branches:

    • Create Tag from Branch: Use task-master add-tag --from-branch to create a new tag based on your current git branch name.
    • Workflow: Tag switching is manual; Taskmaster does not automatically switch tags when you change branches, giving you full control over the workflow.
    task-master add-tag --from-branch
  8. Types of task updates supported

    main

    Task updates can be categorized into three main types:

    1. Content Updates: Enhancing descriptions, adding requirements, clarifying details, or updating acceptance criteria.
    2. Metadata Updates: Changing priority, adjusting time estimates, updating complexity, or modifying dependencies.
    3. Strategic Updates: Revising the approach, changing test strategies, updating implementation notes, or adjusting subtask needs.
  9. Configure Prompt Variants with conditions

    main

    Variants allow you to serve different system and user prompts based on the input parameters. Each variant defines a condition which is a JavaScript expression evaluated against the provided parameter values.

    Condition Evaluation Rules:

    • Expressions are evaluated with parameter values as the context.
    • Supported: useResearch === true, threshold >= 5, priority === 'high', and complex logic like useResearch && threshold > 7.
    • Important: Always provide a default variant to serve as a fallback when no conditions are met.
    {
      "prompts": {
        "default": {
          "system": "Default system prompt",
          "user": "Default user prompt"
        },
        "research": {
          "condition": "useResearch === true",
          "system": "Research-focused system prompt",
          "user": "Research-focused user prompt"
        }
      }
    }
  10. How subtask updates work

    main

    Subtask updates are designed to append information rather than overwrite existing data. When you update a subtask using the update-task --id=parent.child pattern, the system performs the following:

    1. Context Gathering: The AI is provided with the parent task's ID and title, the previous subtask's context, the next subtask's context, and the current subtask's existing details.
    2. Content Appending: The AI-generated content is wrapped in ISO timestamped tags: `<info added on ${timestamp}> ${content}

    </info added on ${timestamp}>3. **Details Update**: This snippet is appended to thesubtask.detailsfield. 4. **Description Update**: If the provided--promptis shorter than 100 characters, the system also appends[Updated: ${date}]to the subtask'sdescription` field to provide a quick visual indicator.