Agent skill
ai-dispatch
Use when an approved plan exists (plan.md + tasks.md) and you need to execute it. Dispatches subagents per task with two-stage review and progress tracking.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/ai-dispatch
SKILL.md
Dispatch
Purpose
Execution engine for approved plans. Reads plan.md and tasks.md, dispatches one subagent per task (fresh context), runs two-stage review on each deliverable, and tracks progress. If stuck: STOP and re-plan.
When to Use
- After
/ai-planproduces an approved plan - To resume execution:
/ai-dispatch --resume - Never without an approved plan (run
/ai-planfirst)
Process
- Load plan -- read
specs/spec.md->specs/plan.md - Load decisions -- read
decision-store.jsonfor constraints - Build DAG -- parse task dependencies, identify parallel groups
- Execute phase by phase -- for each phase: a. Dispatch one subagent per task (fresh context window) b. Each subagent receives: task description, file scope, boundaries, constraints c. Run two-stage review on deliverable (see below) d. Update task status in tasks.md e. Check phase gate before advancing
- Track progress -- update tasks.md checkboxes after each task
- Report completion -- summary of all tasks, any concerns raised
Task Statuses
| Status | Meaning | Action |
|---|---|---|
DONE |
Task completed, reviews passed | Check off, advance |
DONE_WITH_CONCERNS |
Completed but reviewer flagged issues | Check off, log concerns for follow-up |
NEEDS_CONTEXT |
Agent needs information not in the plan | Pause, ask user, then resume |
BLOCKED |
Cannot proceed (dependency, access, ambiguity) | STOP execution, re-plan |
Two-Stage Review
Every task deliverable goes through two reviews before marking DONE:
Stage 1: Spec Compliance
- Does the deliverable match the task description?
- Does it satisfy the acceptance criteria from spec.md?
- Are all file scope boundaries respected (no out-of-scope changes)?
Stage 2: Code Quality
- Stack validation passes (ruff, tsc, cargo check, etc.)
- No new lint warnings introduced
- Test coverage maintained or improved
- No governance advisory warnings from guard
If either stage fails: fix and re-review (max 2 retries per stage).
DAG Construction
Independent (can run in parallel):
- Different file scopes with no overlap
- No producer-consumer relationship
- Different modules with no shared state
Dependent (must serialize):
- Task B reads files Task A creates
- Task B depends on Task A's output
- Both modify governance artifacts (
.ai-engineering/must serialize) - Plan explicitly orders them
Subagent Context
Each subagent receives a focused context window:
task: T-2.1
description: "Implement the parse_config function"
agent: build
scope:
files: ["src/config.py", "tests/test_config.py"]
boundaries: ["Do NOT modify src/main.py", "Do NOT touch hooks/"]
constraints:
- "Follow existing ConfigParser pattern in src/base_config.py"
- "TDD: test files from T-2.0 are IMMUTABLE"
gate:
post: ["ruff check", "pytest tests/test_config.py"]
Stuck Protocol
If a task fails after 2 retries:
- Mark task as BLOCKED with reason
- Check if other tasks in the phase can proceed independently
- If phase is blocked entirely: STOP execution
- Report to user: what failed, what was tried, options (re-plan, skip, manual fix)
Never loop silently. Never retry the same approach more than twice.
Progress Tracking
Update tasks.md in real-time:
- [x] T-1.1: Create config module @build -- DONE
- [x] T-1.2: Add validation logic @build -- DONE_WITH_CONCERNS (perf warning)
- [ ] T-2.1: Write integration tests @build -- IN PROGRESS
- [ ] T-2.2: Security scan @verify -- PENDING
Common Mistakes
- Dispatching without an approved plan.
- Giving subagents the entire codebase context (scope them tightly).
- Skipping the two-stage review.
- Continuing past a BLOCKED task without user input.
- Modifying test files from a RED phase during a GREEN phase task.
Integration
- Called by: user directly (after
/ai-planapproval) - Calls:
ai-build agent(build tasks),/ai-verify(scan tasks),/ai-guard(gate checks) - Transitions to:
/ai-commit(after all tasks DONE), or back to/ai-plan(if re-plan needed)
$ARGUMENTS
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?