task-dependency-patterns
$
npx mdskill add yonatangross/orchestkit/task-dependency-patternsDecomposes complex work into trackable tasks with dependency chains for multi-step implementations.
- Helps manage parallel work and track completion status in large projects.
- Integrates with TaskCreate, TaskUpdate, TaskGet, and TaskList tools for task management.
- Decides based on structured patterns to coordinate dependencies and progress visibility.
- Presents results through task lists with status summaries and dependency tracking.
SKILL.md
.github/skills/task-dependency-patternsView on GitHub ↗
---
name: task-dependency-patterns
license: MIT
compatibility: "Claude Code 2.1.86+."
description: 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, workflow, coordination]
user-invocable: false
disable-model-invocation: true
complexity: medium
persuasion-type: reference
metadata:
category: workflow-automation
allowed-tools:
- Read
- Glob
- Grep
- WebFetch
- WebSearch
---
# 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
```
- **pending**: Task created but not started
- **in_progress**: Actively being worked on
- **completed**: Work finished and verified
- **deleted**: Task removed — permanently removes the task
### Task Deletion
Use `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
Agent Teams provides 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. Agent(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
Agent(
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")
```
## Context Exhaustion Handling
When using Agent Teams, if context limit is reached mid-workflow:
- Collect partial results from completed teammates via `TaskList`
- Synthesize available outputs — prefer partial results over silent failure
- Log skipped tasks with `TaskUpdate(status: "cancelled", note: "context limit")`
## 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
- `ork:implement` - Implementation workflow with task tracking and progress updates
- `ork:verify` - Verification tasks and completion checklists
- `ork:fix-issue` - Issue resolution with hypothesis-based RCA tracking
- `ork:brainstorm` - Design exploration with parallel agent tasks
## References
Load on demand with `Read("${CLAUDE_SKILL_DIR}/references/<file>")`:
| File | Content |
|------|---------|
| `dependency-tracking.md` | Dependency tracking patterns |
| `status-workflow.md` | Status workflow details |
| `multi-agent-coordination.md` | Multi-agent coordination |
More from yonatangross/orchestkit
- agent-orchestrationAgent orchestration patterns for agentic loops, multi-agent coordination, alternative frameworks, and multi-scenario workflows. Use when building autonomous agent loops, coordinating multiple agents, evaluating CrewAI/AutoGen/Swarm, or orchestrating complex multi-step scenarios.
- ai-ui-generationAI-assisted UI generation patterns for json-render, v0, Bolt, and Cursor workflows. Covers prompt engineering for component generation, review checklists for AI-generated code, design token injection, refactoring for design system conformance, and CI gates for quality assurance. Use when generating UI components with AI tools, rendering multi-surface MCP visual output, reviewing AI-generated code, or integrating AI output into design systems.
- analyticsQuery cross-project usage analytics. Use when reviewing agent, skill, hook, or team performance across OrchestKit projects. Also replay sessions, estimate costs, and view model delegation trends.
- animation-motion-designAnimation and motion design patterns using Motion library (formerly Framer Motion) and View Transitions API. Use when implementing component animations, page transitions, micro-interactions, gesture-driven UIs, or ensuring motion accessibility with prefers-reduced-motion.
- architecture-patternsArchitecture validation and patterns for clean architecture, backend structure enforcement, project structure validation, test standards, and context-aware sizing. Use when designing system boundaries, enforcing layered architecture, validating project structure, defining test standards, or choosing the right architecture tier for project scope.
- ascii-visualizerASCII diagram patterns for architecture, workflows, file trees, and data visualizations. Use when creating terminal-rendered diagrams, box-drawing layouts, progress bars, swimlanes, or blast radius visualizations.
- assessAssesses and rates quality 0-10 with pros/cons analysis. Use when evaluating code, designs, or approaches.
- async-jobsAsync job processing patterns for background tasks, Celery workflows, task scheduling, retry strategies, and distributed task execution. Use when implementing background job processing, task queues, or scheduled task systems.
- audit-fullFull-codebase audit using 1M context window. Security, architecture, and dependency analysis in a single pass. Use when you need whole-project analysis.
- audit-skillsAudits all OrchestKit skills for quality, completeness, and compliance with authoring standards. Use when checking skill health, before releases, or after bulk skill edits to surface SKILL.md files that are too long, have missing frontmatter, lack rules/references, or are unregistered in manifests.