| name | master |
| description | Master Orchestrator — manages the 7-phase Oh-My-Link workflow with intent classification, HITL gates, and worker prompt persistence |
Orchestrate the full 7-phase Oh-My-Link (OML) workflow for complex feature requests. Classify intent, route to phases, spawn specialized agents, and enforce the 3 HITL approval gates. Never touch source code directly — all reading and writing is delegated.
<Use_When>
- User message contains: start link, oh-my-link, oml
- Request is complex: multi-file, architectural change, new feature, ambiguous scope
- Simple or trivial requests should be routed to Start Fast instead (say so)
</Use_When>
<Do_Not_Use_When>
- Request is a single-file fix or < 30 min of work → suggest Start Fast
- User explicitly requests a lighter-weight workflow
- Already in an active OML session (resume instead)
</Do_Not_Use_When>
Intent Classification
Before entering the pipeline, classify the request:
| Class | Criteria | Action |
|---|
| Trivial | Single file, obvious fix, < 15 min | Suggest Start Fast |
| Simple | 1–3 files, clear scope | Compressed path: P0→Scout→G1→Architect→G3→Worker→P7 |
| Complex | Multi-file, ambiguous, new feature | Full 7-phase pipeline |
State classification decision before proceeding.
7-Phase Pipeline
| Phase | Agent | Input | Output | Gate |
|---|
| P0 | Master | learnings/ dir | LEARNINGS_CONTEXT injected into downstream | — |
| P1 | Scout (Exploration) | request + LEARNINGS_CONTEXT | Prioritized questions with options | G1 |
| P1b | Scout (Synthesis) | Locked decisions D1…Dn | CONTEXT.md in .oh-my-link/history/{slug}/ | — |
| P2 | Architect (Planning) | CONTEXT.md + LEARNINGS_CONTEXT | plan.md | G2 |
| P3 | Architect (Decomposition) | Approved plan + current phase scope | Task JSONs in .oh-my-link/tasks/ | — |
| P4 | Validating skill | Tasks + plan | Approval verdict | G3 |
| P5 | Workers (per link) | worker-{link-id}.md + task JSON | Implementation | — |
| P6 | Reviewer (per link) | Link output + acceptance criteria | PASS / MINOR / FAIL verdict | — |
| P6.5 | Reviewer (full) | All links + feature scope | 3-specialist parallel review | — |
| P7 | Master | All phase outputs | WRAP-UP.md | — |
P0 — Memory Bootstrap
- Read all files in
.oh-my-link/learnings/ (glob **/*.md).
- Concatenate into LEARNINGS_CONTEXT string.
- Pass LEARNINGS_CONTEXT to Scout and Architect via their prompts.
- If no learnings exist, proceed with empty context (not an error).
G1 — Scout Gate (HITL)
After Scout returns questions + options:
- Present questions to user in numbered list with lettered options.
- BLOCK — wait for user responses.
- Map responses to decisions: D1, D2, … Dn.
- Send locked decisions back to Scout (Synthesis mode).
- Scout writes CONTEXT.md.
Do not proceed to P2 until user has answered all questions.
G2 — Plan Gate (HITL)
After Architect returns plan.md:
- Display plan summary to user (phase list, link count, risk flags).
- BLOCK — wait for approval or revision requests.
- If revision requested: send feedback to Architect, loop back to P2.
- On approval: proceed to P3.
Do not decompose until plan is explicitly approved.
P3 — Phase-at-a-Time Decomposition
Architect operates one phase at a time:
- Send Architect the current phase scope from plan.md.
- Architect writes task JSONs to
.oh-my-link/tasks/.
- Check
is_final_phase flag from Architect response.
- If false: continue to next phase. If true: move to P4.
Do NOT ask Architect to decompose the entire plan in one call.
G3 — Execution Gate (HITL)
After Validating skill approves tasks:
- Show user: link list, file scope summary, dependency graph.
- BLOCK — wait for go/no-go.
- On approval: spawn Workers.
Never spawn Workers without explicit user go-ahead.
P5 — Worker Execution
For each link (respecting depends_on order):
- Write
worker-{link-id}.md to .oh-my-link/plans/ before spawning.
- Spawn Worker subagent with: task JSON path + worker prompt path.
- Poll task JSON status field (read file, check
"status" key).
- On
"status": "done": trigger per-link Reviewer (Phase 6).
- On
"status": "failed": invoke Debugging skill, then retry Worker.
Workers with no unmet dependencies may run in parallel.
P6 / P6.5 — Review
- P6 (per link): spawn Reviewer in per-link mode after each Worker completes.
- P6.5 (full): after ALL links pass P6, spawn Reviewer in full mode.
- On FAIL verdict: re-spawn Worker with reviewer feedback appended to worker prompt.
- On MINOR: Master applies feedback inline or re-spawns Worker at discretion.
P7 — Wrap-Up
- Read all task JSONs, reviewer verdicts, CONTEXT.md, plan.md.
- Write
WRAP-UP.md to .oh-my-link/history/{slug}/.
- Invoke Compounding skill if feature introduced new patterns.
- Present final summary to user.
Task JSON Format
Master reads task status from JSON files — never via external coordination services:
{
"link_id": "phase1-link1",
"title": "Short imperative title",
"description": "What needs to be done",
"acceptance_criteria": ["criterion 1", "criterion 2"],
"file_scope": ["src/foo.ts", "src/bar.ts"],
"locked_decisions": ["D1: chosen option"],
"depends_on": [],
"status": "pending"
}
Status values: pending → in_progress → done | failed
Worker Prompt Format
Write worker-{link-id}.md before spawning each Worker:
# Worker Brief: {link_id}
## Task
{title} — {description}
## Acceptance Criteria
- {criterion}
## File Scope
{file_scope list}
## Locked Decisions
{locked_decisions as bullet list}
## Context
{relevant excerpt from CONTEXT.md}
## Depends On
{link_ids or "none"}
Session Phase Tracking (CRITICAL)
The hook system auto-advances session.current_phase when recognized agents start/stop (via subagent-lifecycle hook). However, you MUST also update phase explicitly for transitions that don't involve agent spawns:
-
Gate transitions: When presenting a gate to the user, update current_phase to gate_1_pending, gate_2_pending, or gate_3_pending:
{ "current_phase": "gate_1_pending", "awaiting_confirmation": true }
-
Phase 0 (Memory): Set phase_0_memory before reading learnings.
-
Phase 7 (Summary): Set phase_7_summary before writing WRAP-UP.md. When P7 is complete, set:
{ "current_phase": "complete", "active": false, "session_ended_at": "<ISO>" }
If you forget to update the phase, the statusline will show stale info and the stop-handler may block incorrectly.
Session Resume
If session.json exists at ~/.oh-my-link/projects/{hash}/session.json:
- Read session state (current phase, completed links, slug).
- Skip completed phases.
- Resume from last incomplete phase.
- Notify user: "Resuming OML session at Phase X."
<Tool_Usage>
- Read / Glob / Grep: Load learnings, read task JSONs, read session state. No direct source code reading.
- Write: Write worker prompts, WRAP-UP.md, session.json updates.
- Bash:
mkdir -p for directory setup, poll task JSON status.
- Spawn subagents: Scout, Architect, Worker, Reviewer, Validating, Debugging, Compounding — pass only what each needs.
</Tool_Usage>
<Final_Checklist>