home / skills / yonatangross / orchestkit / task-dependency-patterns

task-dependency-patterns skill

/plugins/ork/skills/task-dependency-patterns

This skill helps decompose complex work into trackable tasks with dependency chains, enabling parallel work and clear progress across teams.

npx playbooks add skill yonatangross/orchestkit --skill task-dependency-patterns

Review the files below or copy the command above to add this skill to your agents.

Files (12)
SKILL.md
5.7 KB
---
name: task-dependency-patterns
license: MIT
compatibility: "Claude Code 2.1.34+."
description: CC 2.1.16 Task Management patterns with TaskCreate, TaskUpdate, TaskGet, TaskList tools. Decompose complex work into trackable tasks with dependency chains. Use when managing multi-step implementations, coordinating parallel work, or tracking completion status.
context: fork
version: 1.0.0
author: OrchestKit
agent: workflow-architect
tags: [task-management, dependencies, orchestration, cc-2.1.16, workflow, coordination]
user-invocable: false
complexity: medium
metadata:
  category: workflow-automation
---

# Task Dependency Patterns

## Overview

Claude Code 2.1.16 introduces a native Task Management System with four tools:
- **TaskCreate**: Create new tasks with subject, description, and activeForm
- **TaskUpdate**: Update status (pending → in_progress → completed), set dependencies
- **TaskGet**: Retrieve full task details including blockers
- **TaskList**: View all tasks with status and dependency summary

Tasks enable structured work tracking, parallel coordination, and clear progress visibility.

## When to Use

- Breaking down complex multi-step implementations
- Coordinating parallel work across multiple files
- Tracking progress on large features
- Managing dependencies between related changes
- Providing visibility into work status

## Key Patterns

### 1. Task Decomposition

Break complex work into atomic, trackable units:

```
Feature: Add user authentication

Tasks:
#1. [pending] Create User model
#2. [pending] Add auth endpoints (blockedBy: #1)
#3. [pending] Implement JWT tokens (blockedBy: #2)
#4. [pending] Add auth middleware (blockedBy: #3)
#5. [pending] Write integration tests (blockedBy: #4)
```

### 2. Dependency Chains

Use `addBlockedBy` to create execution order:

```json
// Task #3 cannot start until #1 and #2 complete
{"taskId": "3", "addBlockedBy": ["1", "2"]}
```

### 3. Status Workflow

```
pending → in_progress → completed
   ↓           ↓
(unblocked)  (active)

pending/in_progress → deleted (CC 2.1.20)
```

- **pending**: Task created but not started
- **in_progress**: Actively being worked on
- **completed**: Work finished and verified
- **deleted**: Task removed (CC 2.1.20) - permanently removes the task

### Task Deletion (CC 2.1.20)

CC 2.1.20 adds `status: "deleted"` to permanently remove tasks:

```json
// Delete a task
{"taskId": "3", "status": "deleted"}
```

**When to delete:**
- Orphaned tasks whose blockers have all failed
- Tasks superseded by a different approach
- Duplicate tasks created in error
- Tasks from a cancelled pipeline

**When NOT to delete:**
- Tasks that might be retried later (keep as pending)
- Tasks with useful history (mark completed instead)
- Tasks blocked by in_progress work (wait for resolution)

### 4. activeForm Pattern

Provide present-continuous form for spinner display:

| subject (imperative) | activeForm (continuous) |
|---------------------|------------------------|
| Run tests | Running tests |
| Update schema | Updating schema |
| Fix authentication | Fixing authentication |

## Agent Teams (CC 2.1.33+)

CC 2.1.33 introduces Agent Teams for multi-agent coordination with shared task lists and peer-to-peer messaging.

### Team Workflow

```
1. TeamCreate("my-feature")           → Creates team + shared task list
2. TaskCreate(subject, description)    → Add tasks to shared list
3. Task(prompt, team_name, name)       → Spawn teammates
4. TaskUpdate(owner: "teammate-name")  → Assign tasks
5. SendMessage(type: "message")        → Direct teammate communication
6. SendMessage(type: "shutdown_request") → Graceful shutdown
```

### When to Use Teams vs Task Tool

| Criteria | Task Tool (subagents) | Agent Teams |
|----------|----------------------|-------------|
| Independent tasks | Yes | Overkill |
| Cross-cutting changes | Limited | Yes |
| Agents need to talk | No (star topology) | Yes (mesh) |
| Cost sensitivity | Lower (~1x) | Higher (~2.5x) |
| Complexity < 3.0 | Yes | No |
| Complexity > 3.5 | Possible | Recommended |

### Team Task Patterns

```
# Spawn teammate into shared task list
Task(
  prompt="You are the backend architect...",
  team_name="my-feature",
  name="backend-architect",
  subagent_type="backend-system-architect"
)

# Teammate claims and works tasks
TaskList → find unblocked, unowned tasks
TaskUpdate(taskId, owner: "backend-architect", status: "in_progress")
# ... do work ...
TaskUpdate(taskId, status: "completed")
TaskList → find next task
```

### Peer Messaging

```
# Direct message between teammates
SendMessage(type: "message", recipient: "frontend-dev",
  content: "API contract ready: GET /users/:id returns {...}",
  summary: "API contract shared")

# Broadcast to all (use sparingly)
SendMessage(type: "broadcast",
  content: "Breaking change: auth header format changed",
  summary: "Breaking auth change")
```

## Anti-Patterns

- Creating tasks for trivial single-step work
- Circular dependencies (A blocks B, B blocks A)
- Leaving tasks in_progress when blocked
- Not marking tasks completed after finishing
- Using broadcast for messages that only concern one teammate
- Spawning teams for simple sequential work (use Task tool instead)

## Related Skills

- `worktree-coordination` - Multi-instance task coordination across git worktrees
- `implement` - Implementation workflow with task tracking and progress updates
- `verify` - Verification tasks and completion checklists
- `fix-issue` - Issue resolution with hypothesis-based RCA tracking
- `brainstorming` - Design exploration with parallel agent tasks

## References

- [Dependency Tracking](references/dependency-tracking.md)
- [Status Workflow](references/status-workflow.md)
- [Multi-Agent Coordination](references/multi-agent-coordination.md)

Overview

This skill provides Task Dependency Patterns for the native Task Management tools (TaskCreate, TaskUpdate, TaskGet, TaskList) to decompose work into trackable tasks with dependency chains. It documents practical patterns for decomposition, dependency chains, status workflow, activeForm usage, and multi-agent team coordination. Use it to coordinate multi-step implementations, parallel work, and clear progress visibility.

How this skill works

The skill shows how to create atomic tasks with TaskCreate, link execution order with TaskUpdate (addBlockedBy), inspect full task state and blockers with TaskGet, and list tasks and dependency summaries with TaskList. It formalizes a three-step status workflow (pending → in_progress → completed) and covers deletion semantics (status: deleted) for cleanup. It also covers Agent Teams patterns: shared task lists, spawning teammates, claiming tasks, and peer messaging for coordinated multi-agent work.

When to use it

  • Breaking down complex multi-step implementations into clear units
  • Coordinating parallel work across multiple files or teams
  • Tracking progress and blockers on large features
  • Managing dependencies between related changes or steps
  • Coordinating multi-agent workflows where agents must communicate

Best practices

  • Decompose work into atomic, verifiable tasks that can be completed independently
  • Model execution order with addBlockedBy to avoid ad-hoc sequencing
  • Use activeForm (present-continuous) for spinner-friendly progress messages
  • Avoid circular dependencies; validate blocker graphs before starting work
  • Prefer marking tasks completed for history; use deleted only for true orphan or superseded tasks
  • Use Agent Teams when cross-cutting changes require peer-to-peer messaging

Example use cases

  • Implementing authentication: model each step (models, endpoints, tokens, middleware, tests) and chain blockers
  • Large refactor spanning backend and frontend: spawn teammates, assign owner, and claim unblocked tasks
  • Feature rollout with parallel work: create tasks for docs, tests, API, UI and coordinate via TaskList
  • Bug pipeline: create a triage task, then dependent fix and verification tasks; delete duplicates or cancelled items
  • Multi-agent design exercise: TeamCreate, TaskCreate shared list, spawn specialists, and exchange messages for API contracts

FAQ

How do I enforce execution order between tasks?

Use TaskUpdate with addBlockedBy to list prerequisite task IDs; TaskList and TaskGet will reflect blockers and show which tasks are unblocked.

When should I delete a task vs mark it completed?

Delete only for orphaned, superseded, duplicate, or cancelled tasks. Keep tasks for history or retry by leaving them pending or marking completed when finished.

When should I use Agent Teams instead of plain Task tools?

Use Agent Teams for cross-cutting changes or when agents need peer-to-peer messaging and a shared task list. For simple independent tasks or sequential work, the Task tools are lighter and more cost-effective.