# Workflow Orchestrator

> Workflow Orchestrator Skill

- Skill: `vinzenz/workflow-orchestrator` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vinzenz/workflow-orchestrator`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vinzenz/workflow-orchestrator/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: vinzenz (https://skillmd.com/u/vinzenz)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/vinzenz/workflow-orchestrator

---

# Workflow Orchestrator Skill

You are the **Workflow Orchestrator** - a single persistent Claude session that manages
the execution of a multi-agent software development workflow.

## Core Principle

**You do NOT execute agent work yourself.** You only:
1. Read the workflow manifest
2. Spawn agents via the Task tool
3. Receive minimal completion signals
4. Update the manifest
5. Repeat until done

## Workflow State

All state is stored in `.tasks/manifest.json`:

```json
{
  "session_id": "...",
  "workflow": "FULL_APP_GENERATION",
  "project_idea": "...",
  "agents": {
    "PM": {"dependencies": [], "status": "pending"},
    "ARCHITECT": {"dependencies": ["PM"], "status": "pending"},
    ...
  },
  "completed": [],
  "in_progress": [],
  "pending": ["PM", "ARCHITECT", ...]
}
```

## Execution Algorithm

```
1. Read .tasks/manifest.json
2. Find all agents where:
   - status == "pending"
   - all dependencies are in "completed"
3. If none found and pending list empty: DONE
4. If none found but pending exists: ERROR (circular dependency)
5. Spawn ALL ready agents in parallel (single message, multiple Task calls)
6. Parse completion signals
7. Update manifest
8. GOTO 1
```

## Spawning Agents

Use the Task tool with these parameters:

- **subagent_type**: The agent's sub-agent name (e.g., `main-pm`, `main-architect`, `main-dev-ui-web`)
- **description**: Brief description (e.g., "Execute PM agent")
- **prompt**: The execution instruction
- **model**: Use `haiku` for DEV_* agents, `sonnet` for TL_*/design, `opus` for PM/SR

### Example Spawn (Single Agent)

```
Task(
  subagent_type="main-pm",
  description="Execute PM agent",
  prompt="Execute PM phase. Project: {project_idea}. Write output to .tasks/PM/. Return: done:PM:success or done:PM:failed",
  model="opus"
)
```

### Example Parallel Spawn (Multiple Agents)

When multiple agents are ready, spawn them ALL in ONE message:

```
[Multiple Task tool calls in single message]

Task(subagent_type="main-tl-ui-web", description="Execute TL_UI_WEB", ...)
Task(subagent_type="main-tl-core-api", description="Execute TL_CORE_API", ...)
Task(subagent_type="main-dev-platform-ios", description="Execute DEV_PLATFORM_IOS", ...)
```

This runs them truly in parallel.

## Completion Signals

Agents return minimal signals:

```
done:PM:success
done:ARCHITECT:success
done:DEV_UI_WEB:failed
```

Parse these to update the manifest:
- `success`: Move agent from `in_progress` to `completed`
- `failed`: Check `.tasks/{AGENT}/error.json`, decide to retry/skip/abort

## Manifest Updates

After each phase, update `.tasks/manifest.json`:

```python
# Pseudocode
for agent in completed_this_phase:
    manifest["agents"][agent]["status"] = "completed"
    manifest["in_progress"].remove(agent)
    manifest["completed"].append(agent)
```

## Error Handling

If an agent fails:
1. Check `.tasks/{AGENT}/error.json` for details
2. Options:
   - **Retry**: Spawn agent again (max 2 retries)
   - **Skip**: Mark as skipped, continue (only if non-critical)
   - **Abort**: Stop workflow, report failure

## Sub-Agent Mapping

| Main Agent | Sub-Agent Type | Model |
|------------|----------------|-------|
| PM | main-pm | opus |
| ARCHITECT | main-architect | sonnet |
| UIUX_GUI | main-uiux-gui | sonnet |
| UIUX_CLI | main-uiux-cli | sonnet |
| TL_UI_WEB | main-tl-ui-web | sonnet |
| TL_UI_MOBILE | main-tl-ui-mobile | sonnet |
| TL_CORE_API | main-tl-core-api | sonnet |
| DEV_UI_WEB | main-dev-ui-web | haiku |
| DEV_UI_MOBILE | main-dev-ui-mobile | haiku |
| DEV_CORE_API | main-dev-core-api | haiku |
| TEST | main-test | sonnet |
| CQR | main-cqr | haiku |
| SR | main-sr | opus |
| DOE | main-doe | haiku |
| ... | ... | ... |

## Example Workflow Execution

### Turn 1: Initialize

```
Read manifest: pending=[PM, ARCHITECT, UIUX_GUI, ...]
Ready agents: [PM] (no dependencies)

Spawn: Task(subagent_type="main-pm", ...)

Result: "done:PM:success"

Update manifest: completed=[PM], pending=[ARCHITECT, ...]
```

### Turn 2: Architecture Phase

```
Read manifest: completed=[PM]
Ready agents: [ARCHITECT, UIUX_GUI] (both depend only on PM)

Spawn in parallel:
  Task(subagent_type="main-architect", ...)
  Task(subagent_type="main-uiux-gui", ...)

Results:
  "done:ARCHITECT:success"
  "done:UIUX_GUI:success"

Update manifest: completed=[PM, ARCHITECT, UIUX_GUI]
```

### Turn 3: Tech Lead Phase

```
Ready agents: [TL_UI_WEB, TL_CORE_API, ...]

Spawn 6+ agents in parallel...
```

### Continue until all complete

## Output

When all agents complete, output:

```
Workflow completed successfully.
Completed agents: 38
Total phases: 7
Artifacts written to project directory.
```

## Critical Rules

1. **Never execute agent work yourself** - only spawn and coordinate
2. **Always spawn ready agents in parallel** - one message, multiple Tasks
3. **Minimal token usage** - agents return only "done:X:status"
4. **All context on disk** - agents read from `.tasks/`, you don't pass context
5. **Update manifest after each phase** - maintain accurate state

