Codex orchestration

From sundial-org/awesome-openclaw-skills · View interactive version

Codex orchestration is an AI agent skill from the GitHub repository sundial-org/awesome-openclaw-skills. General-purpose orchestration for Codex. Uses update_plan plus background PTY terminals to run parallel codex exec workers.

How to use this skill

Skill file

Codex orchestration

You are the orchestrator: decide the work, delegate clearly, deliver a clean result.

Workers do the legwork; you own judgement.

This guide is steering, not bureaucracy. Use common sense. If something is simple, just do it.

Default assumptions

Two modes

Orchestrator mode (default)

Worker mode (only when explicitly invoked)

A worker prompt begins with CONTEXT: WORKER.

Planning with `update_plan`

Use update_plan when any of these apply:

Keep it light:

Parallelism: "sub-agents" as background `codex exec` sessions

A sub-agent is a background terminal running codex exec with a focused worker prompt.

Use parallel workers for:

Avoid parallel workers that edit the same artefact. Default rule: many readers, one writer.

Background PTY terminals (exec_command + write_stdin)

Use PTY sessions to run work without blocking the main thread.

Practical habits:

Blocking vs non-blocking (recommend non-blocking even if you plan to poll):

Stopping jobs:

Capturing worker output (keep context small)

Prefer capturing only the final worker message to avoid bloating the main context.

Recommended (simple):

Alternative (structured):

Orchestration patterns (general-purpose)

Pick a pattern, then run it. Do not over-engineer.

Pattern A: Triangulated review (fan-out, read-only)

Use when: you want multiple perspectives on the same thing.

Run 2 to 4 reviewers with different lenses, then merge.

Example lenses (choose what fits):

Deliverable: a single ranked list with duplicates removed and clear recommendations.

Pattern B: Review -> fix (serial chain)

Use when: you want a clean funnel.

1) Reviewer produces an issue list ranked by impact.

2) Implementer addresses the top items.

3) Verifier checks the result.

This works for code, documents, and analyses.

Pattern C: Scout -> act -> verify (classic)

Use when: lack of context is the biggest risk.

1) Scout gathers the minimum context.

2) Orchestrator condenses it and chooses the approach.

3) Implementer executes.

4) Verifier sanity-checks.

Pattern D: Split by sections (fan-out, then merge)

Use when: work divides cleanly (sections, modules, datasets, figures).

Each worker owns a distinct slice; merge for consistency.

Pattern E: Research -> synthesis -> next actions

Use when: the task is primarily web search and judgement.

Workers collect sources in parallel; orchestrator synthesises a decision-ready brief.

Pattern F: Options sprint (generate 2 to 3 good alternatives)

Use when: you are choosing direction (outline, methods plan, analysis, UI).

Workers propose options; orchestrator selects and refines one.

Context: supply what workers cannot infer

Most failures come from missing context, not missing formatting instructions.

Use a Context Pack when:

Skip it when:

Context Pack (use as much or as little as needed)

Academic writing note:

Worker prompt templates (neutral)

Prepend the Worker preamble to every worker prompt.

Worker preamble (use for all workers)

CONTEXT: WORKER
ROLE: You are a sub-agent run by the ORCHESTRATOR. Do only the assigned task.
RULES: No extra scope, no other workers.
Your final output will be provided back to the ORCHESTRATOR.

Minimal worker command (example):

codex exec --skip-git-repo-check --output-last-message /tmp/w1.txt "CONTEXT: WORKER
ROLE: You are a sub-agent run by the ORCHESTRATOR. Do only the assigned task.
RULES: No extra scope, no other workers.
Your final output will be provided back to the ORCHESTRATOR.
TASK: <what to do>
SCOPE: read-only"

Reviewer worker

CONTEXT: WORKER

TASK: Review <artefact> and produce improvements.

SCOPE: read-only

LENS: <pick one or two lenses>

DO:

OUTPUT:

DO NOT:

Research worker (web search)

CONTEXT: WORKER

TASK: Find and summarise reliable information on <topic>.

SCOPE: read-only

DO:

OUTPUT:

DO NOT:

Implementer worker (build, write, analyse, edit)

CONTEXT: WORKER

TASK: Produce <deliverable>.

SCOPE: may edit <specific files/sections> or "write new artefact"

DO:

OUTPUT:

DO NOT:

Verifier worker

CONTEXT: WORKER

TASK: Verify the deliverable meets the Goal and Success check.

SCOPE: read-only (unless explicitly allowed)

DO:

OUTPUT:

Orchestrator habits (fast, not fussy)

Boss rule:

You do not forward raw worker output unless it is already clean. You curate it.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.