Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 80 additions & 2 deletions .cursor/skills/orchestrator-executor/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,84 @@
---
name: orchestrator-executor
description: Fable 5 orchestrator-executor pattern for big tasks
description: Coordinate large, long-running, parallel, architecture-sequenced, or isolated-worktree tasks with a cost-conscious orchestrator/executor model. Use when work needs a dependency graph, multiple agents, staged integration, durable asynchronous coordination, or independently reviewable changes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH (consensus) — Trigger text (“dependency graph”, “multiple agents”, durable async coordination) overlaps almost entirely with .cursor/skills/proof/SKILL.md DAG/fan-out triggers, inviting nondeterministic skill choice and conflicting model maps.

Minimal fix: Narrow to worktrees, board protocol, exclusive ownership, and staged integration. Add a router note: native Task + worktrees/board → this skill; @flatbread/proof CLI/DAG → proof.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

severity: HIGH (docs-and-positioning, dx-and-examples)

This description triggers on “dependency graph, multiple agents, staged integration…” — the same center of gravity as .cursor/skills/proof/SKILL.md / pnpm exec proof. Agents can pick the wrong orchestration substrate.

minimal fix: Add one explicit routing sentence here (or immediately under Role and routing): use this skill for native Cursor Task + worktree + board orchestration; use pnpm exec proof for repo DAG / Kahn-rank runs.

---

You (Fable) are the orchestrator. Plan, decompose, synthesize. Reasoning-heavy phases go to deep-reasoner (5.6 Terra). Mechanical work goes to fast-worker (5.6 Luna). For high-stakes decisions, run deep-reasoner twice with slightly different framings and synthesize the best of both. Keep your own context lean. Delegate rather than doing mechanical work yourself.
## Role and routing

The top-level agent is the **orchestrator only**: decompose, schedule, monitor, route information, resolve dependencies, integrate, verify, clean up, and report. When delegation is available, it MUST NOT do routine implementation itself.

Use models by explicit `model` argument in **every** spawned-agent call:

- `claude-fable-5-thinking-high` (Fable 5): orchestration and final synthesis only. NEVER use it for implementation, routine research, tests, formatting, or mechanical work.
- `gpt-5.6-terra-medium` (5.6 Terra): architecture, difficult reasoning, adversarial review, and high-risk decisions.
- `gpt-5.6-luna-medium` (5.6 Luna): implementation, tests, repository searches, formatting, and other bounded execution.
Comment on lines +12 to +14

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKER (consensus) — These model strings are not Cursor.models.list() / @flatbread/proof catalog ids. Catalog base ids are claude-fable-5, gpt-5.6-terra, and gpt-5.6-luna with params (thinking/effort, reasoning). Proof rejects hand-composed CLI-suffix ids.

Minimal fix: Document spawn path explicitly:

  • SDK/proof: { "id": "gpt-5.6-terra", "params": [{ "id": "reasoning", "value": "medium" }] } (same pattern for Fable/Luna).
  • If Task-tool kebab slugs are intentional, say so and forbid using them with @flatbread/proof.

Note: gpt-5.6-terra-medium / gpt-5.6-luna-medium are also absent from the common Task allowlist (which currently surfaces gpt-5.6-sol-*, not terra/luna suffixes).

Comment on lines +12 to +14

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

severity: BLOCKER (consensus — all three reviewers)

These exact strings fail SDK catalog lookup (list_models.ts): catalog base ids are claude-fable-5, gpt-5.6-terra, gpt-5.6-luna; thinking / effort / reasoning are params, not slug suffixes. @flatbread/proof rejects suffix-style ids. Documenting always-invalid SDK ids makes the “if unavailable, stop” path the happy path and reopens silent Fable-for-executor fallback.

minimal fix: Document spawnable forms per surface — e.g. SDK/proof { id: "gpt-5.6-terra", params: [{ id: "reasoning", value: "medium" }] } (and Luna/Fable equivalents); cite Task kebab slugs only if validated against the Task allowlist. Update the compact example (model: "gpt-5.6-*-medium") the same way.


Do not route by vague labels such as “deep-reasoner” or “fast-worker.” If the required model is unavailable, stop and report the constraint; never silently substitute Fable for an executor.

Before spawning, record for every task: `role`, `complexity`, `write_scope`, `dependencies`, `acceptance_criteria`, and `expected_deliverable`. Represent tasks as a dependency graph and move only dependency-free tasks to `ready`.

## Ownership and lifecycle

Task states are: `pending` → `ready` → `running` → (`blocked` | `failed` | `completed`) → `integrating` → `verified`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH — This chain treats blocked and failed as predecessors of integrating → verified, which encodes a false success path and contradicts the later retry/escalation rules.

Minimal fix: Success path only: completed → integrating → verified. Add explicit recovery edges: blocked → ready|running, failed → ready|cancelled.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

severity: HIGH (agent-operating-model)

This chain allows blocked / failed → integrating and omits unblock/retry edges (blocked → ready/running, retry after reframe).

minimal fix: Only completed proceeds to integrating; add explicit unblock and retry transitions (and keep this lifecycle scoped to native Task orchestration, or map it to proof’s PENDING/RUNNING/FINISHED/ERROR).


- Parallelize only independent tasks. Each writing worker exclusively owns assigned files or its worktree; concurrent workers MUST NOT edit the same files.
- Workers must report scope overlap before editing anything outside their assignment.
- Use worktrees for overlapping timelines, risky work, competing implementations, or independently reviewable units. Skip them for small read-only or strictly disjoint work when isolation costs more than it saves.
- The orchestrator creates worktrees and branches, assigns ownership, chooses integration order, resolves conflicts, verifies, and cleans up. Workers never merge, rebase, push, or modify another worker’s worktree unless explicitly told to.
- Every writing worker returns: branch/worktree, changed files, verification results, unresolved risks, and integration instructions.

## Communication and context

Subagents cannot message sibling agents directly. The orchestrator is the sole router: prefer native completion events and orchestrator-issued follow-up prompts for control and prompt delivery. A filesystem board is durable, pull-based coordination only; it neither wakes workers nor replaces follow-up messaging. Do not keep workers alive merely to poll shared state.

For durable asynchronous coordination, the orchestrator creates a run-specific board directory **outside all worker worktrees** and passes its absolute path to each worker. Use one atomic JSON event file per message (write a temporary file, then rename it); never concurrently append to a shared file.

```json
{
"event_id": "evt-001",
"run_id": "run-2026-07-17-a",
"timestamp": "2026-07-17T23:47:00Z",
"sender": "impl-schema",
"recipient": "orchestrator",
"task_id": "schema",
"type": "blocked",
"summary": "Need the chosen identifier invariant.",
"artifact_paths": [],
"blocked_by": ["architecture-decision"],
"requested_action": "Provide the invariant and resume instructions."
}
```

Allowed `type` values: `started`, `progress`, `finding`, `question`, `blocked`, `artifact_ready`, `verification`, `failed`, `completed`. Workers emit only meaningful events—on a material finding, blocker, artifact, verification result, failure, or completion—not heartbeats or continuous polling.

The orchestrator consumes each event once, checkpoints its event cursor, and compacts or archives consumed events. It reads the board at bounded orchestration checkpoints or after native completion—not through worker polling. The board holds durable coordination state only; it does not replace direct follow-up prompts or justify copying an expanding transcript into worker context.

Keep orchestrator context to task state, short summaries, decisions, ownership, and artifact paths. Give workers only their task contract, relevant upstream summaries, permitted paths, board path, and acceptance criteria. Put detailed results in artifacts and reference paths.

## Failure, escalation, and termination

Set bounded retry and idle/timeout limits when launching a task. On failure, record evidence, change the prompt or framing, and retry only when that change makes progress plausible. Cancel obsolete work and replace a worker with a newly scoped task when appropriate.

Escalate a Luna task to Terra only after recording the failure evidence and reframing the decision or reasoning problem. Never blindly retry an unchanged prompt. The orchestrator completes only after integration verification, worktree/board cleanup, and a concise delivery report.

## Compact execution example

1. Create isolated worktrees and graph: `architecture` (Terra, no writes) → `api` and `ui` (independent Luna implementation tasks).
2. Spawn Terra with `model: "gpt-5.6-terra-medium"` to choose the interface contract. Route its short decision artifact to both Luna tasks.
3. Spawn the two Luna workers in parallel with `model: "gpt-5.6-luna-medium"`, exclusive worktrees and the board path. The `api` worker emits a `blocked` event requesting a field invariant.
Comment on lines +67 to +68

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKER / HIGH — Compact example repeats the invalid suffix model strings and skips executable spawn/board/resume/integrate mechanics, so agents copy a broken contract.

Minimal fix: Use base id + params (or clearly labeled Task-only slugs), and show concrete worktree create → board path → blocked event → orchestrator follow-up/resume → verify → cleanup steps.

4. The orchestrator reads and checkpoints that event, sends a native follow-up prompt with Terra’s invariant to `api`, and does not ask `ui` to poll.
Comment on lines +67 to +69

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

severity: BLOCKER / HIGH (model strings + blocked coordination)

  1. Repeats SDK-invalid gpt-5.6-terra-medium / gpt-5.6-luna-medium (same BLOCKER as the routing list).
  2. Step 4 assumes a native follow-up to api after a blocked board event, but the board is defined as pull-only and non-waking — with no stay-live vs exit + resume/respawn contract.

minimal fix: Use validated per-surface model forms; state that a blocked worker either remains addressable for follow-up or exits and must be resumed/respawned after the orchestrator checkpoints the event. Include creating the board directory outside worktrees in the example steps.

5. After both workers complete, the orchestrator integrates branches in dependency order, runs final verification, archives the board, removes worktrees, and reports changed artifacts plus verification.

## Before spawning

- [ ] Is the task classified with role, complexity, write scope, dependencies, deliverable, and acceptance criteria?
- [ ] Is the selected explicit model permitted for that role (never Fable for execution)?
- [ ] Are write scopes exclusive and graph dependencies satisfied?
- [ ] Are worktrees justified, owned by the orchestrator, and paired with a known integration order?
- [ ] Does every worker have only required context, an absolute board path if needed, and a clear return contract?

## Done when

- [ ] Every executor used explicit Terra or Luna model routing; no implementation silently used Fable.
- [ ] Dependencies, ownership, events, blockers, retries, and escalations were recorded and routed by the orchestrator.
- [ ] Integration verification passed, worktrees and board artifacts were cleaned up or archived, and the delivery report is concise.
Loading