Execute pending tasks in dependency order with wave-based concurrent execution via Agent Teams
Executes task dependency graphs via wave-based agent teams with automatic retries and context management.
/plugin marketplace add sequenzia/agent-alchemy/plugin install agent-alchemy-sdd-tools@agent-alchemyThis skill is limited to using the following tools:
references/communication-protocols.mdreferences/orchestration.mdreferences/verification-patterns.mdThis skill orchestrates autonomous task execution using Claude Code's native Agent Team system. It takes tasks produced by /create-tasks, builds a dependency-aware execution plan, and executes them in waves via a 3-tier agent hierarchy: Orchestrator (this skill) plans and coordinates waves, Wave Leads manage parallel executors within each wave, and Context Managers handle knowledge flow between tasks.
All inter-agent coordination uses message-based primitives (TeamCreate, SendMessage, TaskOutput) rather than file-based signaling.
Before executing any step, load the foundational references for task management and team orchestration:
Read ${CLAUDE_PLUGIN_ROOT}/../claude-tools/skills/claude-code-tasks/SKILL.md
Read ${CLAUDE_PLUGIN_ROOT}/../claude-tools/skills/claude-code-teams/SKILL.md
These references provide tool parameters, lifecycle rules, messaging protocols, and orchestration patterns. The SDD-specific execution procedures are in the orchestration reference below.
Read ${CLAUDE_PLUGIN_ROOT}/skills/run-tasks/references/orchestration.md
If any reference file cannot be read, stop and report: "ERROR: Cannot load required reference. Verify the plugin installation is complete."
Parse the following arguments from the user's invocation:
| Argument | Format | Default | Description |
|---|---|---|---|
--task-group | <name> | (none — all tasks) | Filter tasks to those with matching metadata.task_group |
--phase | <N> or <N,M,...> | (none — all phases) | Comma-separated integers. Filter tasks by metadata.spec_phase. Tasks without spec_phase are excluded when active. |
--dry-run | (flag) | false | Complete Steps 1-3 only: load, plan, display. No agents spawned, no session directory created. |
When both --task-group and --phase are provided, both filters apply (intersection).
Validation:
--phase values must be positive integers. If a non-integer value is provided (e.g., --phase abc), report: "Invalid --phase value: must be comma-separated positive integers (e.g., --phase 1,2)." and stop.--phase: "No tasks found for phase(s) {N}. Available phases: {sorted distinct spec_phase values}." For --task-group: "No tasks found for group '{name}'. Available groups: {sorted distinct task_group values}."Load the full task list via TaskList. Apply --task-group and --phase filters if provided. Validate the resulting task set:
/create-tasks first.See references/orchestration.md Step 1 for the full procedure.
Read settings from .claude/agent-alchemy.local.md (use defaults if the file is missing). Build the execution plan:
max_parallel tasks (default: 5, configurable via settings).See references/orchestration.md Step 2 for settings and the full planning procedure.
Present the execution plan to the user via AskUserQuestion:
If --dry-run: Display the full plan details (wave breakdown, task assignments, model tiers, timeout estimates) and exit. No TaskUpdate calls, no session directory created, no agents spawned.
If the user cancels: Clean exit with no tasks modified.
See references/orchestration.md Step 3 for display format details.
Create the session directory and handle interrupted session recovery:
{task-group}-{YYYYMMDD}-{HHMMSS} (or exec-session-{YYYYMMDD}-{HHMMSS} if no group).__live_session__/ content: If found, offer the user a choice via AskUserQuestion: resume (reset in_progress tasks to pending) or fresh start (archive to .claude/sessions/interrupted-{timestamp}/)..claude/sessions/__live_session__/:
execution_context.md — empty templatetask_log.md — header row onlyexecution_plan.md — populated from Step 2progress.jsonl — session_start eventSee references/orchestration.md Step 4 for the full initialization procedure and session ID generation rules.
For each wave in the execution plan:
TaskList (dynamic unblocking after prior wave completions).TeamCreate with a wave-lead agent (foreground Task) and team members (context-manager + executors).execution_context.md.SendMessage.task_log.md, write wave_complete event to progress.jsonl, handle Tier 3 escalations (present failures to user via AskUserQuestion with options: Fix manually, Skip, Provide guidance, Abort).TaskStop, then delete the team via TeamDelete. Includes inter-wave verification and cooldown before starting the next wave.See references/orchestration.md Step 5 for the full wave execution procedure, retry escalation flow, and wave-lead crash recovery.
Generate a session summary and archive the session:
session_summary.md with pass/fail/partial/skipped counts, total execution time, per-wave breakdown, failed task list with reasons, and key decisions made during execution.session_complete event to progress.jsonl.__live_session__/ contents to .claude/sessions/{session-id}/.See references/orchestration.md Step 6 for the summary format and archival procedure.
Review execution_context.md for project-wide changes and update CLAUDE.md if warranted:
Skip updates if only task-specific or internal implementation details were recorded.
See references/orchestration.md Step 7 for the CLAUDE.md update criteria.
claude-code-teams/references/orchestration-patterns.md for the base pattern.TeamCreate, SendMessage, and TaskOutput following the claude-code-teams lifecycle. No file-based signaling.TaskStop, and confirming TeamDelete succeeds before starting the next wave. This prevents zombie agents across wave boundaries.metadata.timeout_minutes.--dry-run completes Steps 1-3 only. Displays the full execution plan without spawning agents or creating a session.--phase and --task-group can be combined (AND logic). Filters narrow the task set before planning.This skill uses Claude Code hooks for automated quality gates during execution:
verify-task-completion.sh hook runs the project's test suite. If tests fail, the completion is blocked and the task reverts to in_progress with feedback to the executor.Hook definitions are in ${CLAUDE_PLUGIN_ROOT}/hooks/hooks.json. For hook event documentation, see claude-code-teams/references/hooks-integration.md.
/run-tasks
/run-tasks --task-group user-authentication
/run-tasks --phase 1
/run-tasks --task-group payments --phase 1,2
/run-tasks --dry-run
/run-tasks --task-group payments --phase 2 --dry-run
references/orchestration.md — Detailed 7-step orchestration procedures, wave execution, retry escalation, session management, and CLAUDE.md update criteriareferences/communication-protocols.md — SDD-specific message schemas for the 3-tier hierarchy (6 protocols)references/verification-patterns.md — Verification logic for spec-generated vs general tasks${CLAUDE_PLUGIN_ROOT}/../claude-tools/skills/claude-code-tasks/SKILL.md — Task tool parameters and conventions (loaded at init)${CLAUDE_PLUGIN_ROOT}/../claude-tools/skills/claude-code-teams/SKILL.md — Team lifecycle, messaging, and orchestration patterns (loaded at init)${CLAUDE_PLUGIN_ROOT}/../claude-tools/skills/claude-code-teams/references/orchestration-patterns.md — 6 orchestration patterns (optional, for reference)Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.