Get the FREE Ultimate OpenClaw Setup Guide →

claude-code-tasks

Scanned
npx machina-cli add skill sequenzia/agent-alchemy/claude-code-tasks --openclaw
Files (1)
SKILL.md
11.2 KB

Claude Code Tasks Reference

This skill is a shared reference for Claude Code's Task tools: TaskCreate, TaskGet, TaskUpdate, and TaskList. Load it when your skill or agent needs to create, manage, or coordinate tasks.

This reference covers:

  • Complete tool parameter tables for all four Task tools
  • Status lifecycle and transition rules
  • Naming conventions (subject vs. activeForm)
  • Dependency management with DAG design principles
  • Metadata conventions for categorization and tracking

For deeper content, load the reference files listed at the end of this document.


TaskCreate

Creates a new task. Returns the created task object with a system-assigned id.

Parameters

ParameterTypeRequiredDescription
subjectstringYesShort imperative title for the task (e.g., "Create user schema"). Displayed in the task list UI.
descriptionstringNoDetailed description of what the task involves. Supports markdown. Used to convey acceptance criteria, context, and instructions.
activeFormstringNoPresent-continuous description shown while the task is in progress (e.g., "Creating user schema"). Displayed in the task list UI during execution.
metadataobjectNoKey-value pairs for categorization and tracking. Keys and values are strings. Common keys documented in the Metadata Conventions section below.

Return Value

Returns the full task object including:

  • id — System-assigned unique identifier (integer)
  • subject — The subject provided
  • description — The description provided (if any)
  • activeForm — The activeForm provided (if any)
  • status — Always pending for newly created tasks
  • metadata — The metadata provided (if any)
  • blockedBy — Empty array (no dependencies yet)
  • blocks — Empty array (no dependents yet)

Example

TaskCreate:
  subject: "Create user authentication module"
  description: "Implement JWT-based auth with login, logout, and token refresh endpoints."
  activeForm: "Creating user authentication module"
  metadata:
    priority: "high"
    complexity: "medium"
    task_group: "user-auth"

TaskGet

Retrieves a single task by its ID. Use this to get full task details including description, metadata, and dependency information.

Parameters

ParameterTypeRequiredDescription
taskIdintegerYesThe ID of the task to retrieve.

Return Value

Returns the full task object:

  • id — Task identifier
  • subject — Task title
  • description — Full description (may be long)
  • activeForm — Present-continuous form (if set)
  • status — Current status (pending, in_progress, completed, deleted)
  • metadata — Key-value pairs
  • blockedBy — Array of task IDs this task depends on
  • blocks — Array of task IDs that depend on this task
  • owner — The agent or session that owns this task (if set)

TaskUpdate

Updates an existing task. Only the fields you provide are changed; omitted fields remain unchanged.

Parameters

ParameterTypeRequiredDescription
taskIdintegerYesThe ID of the task to update.
statusstringNoNew status. Valid values: pending, in_progress, completed, deleted. See Status Lifecycle below.
subjectstringNoUpdated subject line.
descriptionstringNoUpdated description.
activeFormstringNoUpdated present-continuous description.
ownerstringNoSet or change the task owner (agent name or session identifier).
metadataobjectNoReplace the entire metadata object. Merges are not supported — provide the full metadata object.
addBlocksinteger[]NoAdd task IDs to this task's blocks list (tasks that depend on this one).
addBlockedByinteger[]NoAdd task IDs to this task's blockedBy list (tasks this one depends on).

Return Value

Returns the updated task object with all current fields.

Example

TaskUpdate:
  taskId: 5
  status: "in_progress"
  activeForm: "Implementing user authentication module"

TaskList

Lists all tasks in the current task list. Takes no parameters.

Parameters

None.

Return Value

Returns an array of task summary objects. Each summary includes:

  • id — Task identifier
  • subject — Task title
  • status — Current status
  • blockedBy — Array of blocking task IDs
  • blocks — Array of dependent task IDs
  • metadata — Key-value pairs

Note: TaskList returns summary objects. Use TaskGet to retrieve the full description for a specific task.


Status Lifecycle

Tasks follow a simple three-state lifecycle with an additional terminal state.

pending --> in_progress --> completed
   |
   +--> deleted

States

StatusMeaningEntry Condition
pendingTask is created and waiting to be startedDefault on creation via TaskCreate
in_progressTask is actively being worked onExplicitly set via TaskUpdate
completedTask is finishedExplicitly set via TaskUpdate
deletedTask is removed (soft delete)Explicitly set via TaskUpdate

Transition Rules

  • pending -> in_progress: Set when an agent begins working on the task.
  • in_progress -> completed: Set when the task is verified as done. Only mark complete after verification passes.
  • in_progress -> pending: Valid for resetting a task (e.g., after a failed attempt or interrupted session).
  • pending -> deleted: Remove a task that is no longer needed.
  • in_progress -> deleted: Cancel a task that is in progress.
  • Blocked tasks: A task with non-empty blockedBy (where blockers are not yet completed) should not be started. The system does not enforce this automatically — your orchestration logic must check dependencies before transitioning to in_progress.

Naming Conventions

Subject (Imperative)

The subject field uses imperative mood — a command that describes what the task will accomplish:

GoodBad
"Create user schema""Creating user schema"
"Add JWT authentication""JWT authentication addition"
"Fix login timeout bug""Login timeout bug"
"Implement rate limiting""Rate limiting implementation"

activeForm (Present-Continuous)

The activeForm field uses present-continuous tense — describing what is happening while the task runs:

SubjectactiveForm
"Create user schema""Creating user schema"
"Add JWT authentication""Adding JWT authentication"
"Fix login timeout bug""Fixing login timeout bug"
"Implement rate limiting""Implementing rate limiting"

The activeForm appears in the task list UI while the task status is in_progress. If omitted, the UI falls back to the subject.


Dependency Management

Tasks support dependency tracking via blockedBy and blocks fields, forming a Directed Acyclic Graph (DAG).

Fields

  • blockedBy: Array of task IDs that must complete before this task can start. Set via addBlockedBy in TaskUpdate.
  • blocks: Array of task IDs that are waiting on this task. Set via addBlocks in TaskUpdate. This is the inverse of blockedBy.

Setting Dependencies

Dependencies are set after task creation using TaskUpdate:

TaskUpdate:
  taskId: 5
  addBlockedBy: [3, 4]

This means task 5 cannot start until tasks 3 and 4 are both completed.

DAG Design Principles

  1. No cycles: Never create circular dependencies (A blocks B, B blocks C, C blocks A). This creates deadlocks where no task can proceed.
  2. Minimize depth: Prefer wider, shallower dependency graphs. Deep chains (A -> B -> C -> D -> E) serialize execution and slow throughput.
  3. Depend on producers, not peers: A task should depend on the task that produces what it needs, not on unrelated tasks at the same level.
  4. One-way information flow: Dependencies should follow the data flow — upstream tasks produce artifacts that downstream tasks consume.
  5. Independent tasks run in parallel: Tasks at the same dependency level (no dependencies between them) can execute concurrently.

Common Dependency Patterns

PatternStructureUse Case
Linear chainA -> B -> CSequential steps where each builds on the previous
Fan-outA -> [B, C, D]One task produces input for multiple parallel tasks
Fan-in[A, B, C] -> DMultiple tasks must complete before a summary/merge task
DiamondA -> [B, C] -> DFan-out followed by fan-in; B and C are independent but D needs both

Metadata Conventions

The metadata field accepts arbitrary string key-value pairs. These common keys are used across the agent-alchemy ecosystem:

KeyValuesPurpose
prioritycritical, high, medium, low, unprioritizedExecution ordering within a wave; higher priority tasks run first
complexitytrivial, low, medium, highEstimate of implementation effort; used for planning
task_groupAny string (e.g., user-auth, payments)Groups related tasks for filtered execution via --task-group
spec_pathFile path (e.g., internal/specs/auth-SPEC.md)Links the task back to its source specification
feature_nameAny string (e.g., user-authentication)Associates the task with a feature for tracking
task_uidComposite key (e.g., auth:create-schema)Enables idempotent merge mode — matching UIDs update existing tasks instead of creating duplicates
spec_phasePhase identifier (e.g., phase-1)Tracks which spec phase generated this task
source_sectionSection reference (e.g., Section 5.1)Links to the specific spec section that defined this task

Metadata Replacement Behavior

TaskUpdate's metadata field performs a full replacement, not a merge. To add a single key, you must read the existing metadata first, add the key, and provide the complete object:

TaskGet: taskId=5
# Returns metadata: { priority: "high", task_group: "auth" }

TaskUpdate:
  taskId: 5
  metadata:
    priority: "high"
    task_group: "auth"
    complexity: "medium"

Reference Files

For deeper content on task design patterns and common mistakes, load these reference files:

Task Patterns

Covers dependency graph design patterns (linear, fan-out, fan-in, diamond), task right-sizing guidance, multi-agent coordination via tasks, and metadata strategies.

Read ${CLAUDE_PLUGIN_ROOT}/skills/claude-code-tasks/references/task-patterns.md

Anti-Patterns

Documents common mistakes when using Tasks: circular dependencies, over-granular tasks, missing activeForm, batch status update pitfalls, duplicate task creation, and more. Each anti-pattern includes the problem, why it matters, and the correct alternative.

Read ${CLAUDE_PLUGIN_ROOT}/skills/claude-code-tasks/references/anti-patterns.md

Source

git clone https://github.com/sequenzia/agent-alchemy/blob/main/claude/claude-tools/skills/claude-code-tasks/SKILL.mdView on GitHub

Overview

A practical reference for Claude Code's Task tools (TaskCreate, TaskGet, TaskUpdate, TaskList). It explains parameters, status lifecycle, naming conventions, dependency management, and metadata conventions to help you create, coordinate, and track tasks effectively.

How This Skill Works

Use TaskCreate to create a new task and receive a system-assigned id with status pending. TaskGet retrieves a full task object by taskId, including description, metadata, and dependency arrays (blockedBy/blocks) and optional owner. TaskUpdate applies only the fields you provide (status, subject, description, activeForm, owner, metadata) and preserves others; status values follow a defined lifecycle (pending, in_progress, completed, deleted).

When to Use It

  • Creating a new task with a clear subject, optional description, and metadata for categorization
  • Querying a task to inspect its full details, dependencies, and ownership before action
  • Advancing a task by updating its status or progress indicators (e.g., to in_progress or completed)
  • Renaming or refining a task's title/description as requirements evolve
  • Managing task dependencies using blockedBy and blocks to enforce DAG-based coordination

Quick Start

  1. Step 1: TaskCreate with subject, optional description, and metadata to initialize a new task
  2. Step 2: TaskGet by the returned taskId to review details and dependencies
  3. Step 3: TaskUpdate to advance status (e.g., to in_progress) or modify fields as work begins

Best Practices

  • Always provide a descriptive subject and optional detailed description to clarify acceptance criteria
  • Use metadata to categorize tasks (priority, complexity, task_group) for filtering and reporting
  • Model dependencies with blockedBy and blocks; design tasks with DAG principles to avoid cycles
  • Keep activeForm in sync with the task’s progress to show real-time status in UI
  • Use TaskGet and TaskUpdate to verify and adjust task state before triggering downstream work

Example Use Cases

  • TaskCreate: subject: "Create user authentication module", description: "Implement JWT-based auth with login, logout, and token refresh endpoints.", activeForm: "Creating user authentication module", metadata: { priority: "high", complexity: "medium", task_group: "user-auth" }
  • TaskGet: Retrieve taskId 42 to inspect its subject, description, metadata, and dependency arrays (blockedBy/blocks) before assigning work
  • TaskUpdate: taskId 42, status: "in_progress", activeForm: "Implementing auth flow", owner: "agent-xyz"
  • TaskCreate: subject: "Design API schema for product catalog", description: "Define endpoints, request/response models, and validation rules.", metadata: { priority: "medium", task_group: "api-design" }
  • TaskUpdate: taskId 55, metadata: { reviewedBy: "team-lead" }, subject: "Refine product catalog API", description: "Update endpoints to include search and pagination"

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers