Orchestrate Long Task
Treat Git and .task-orchestrator/missions/<mission-id>/ as the source of
truth; chats are temporary. Each mission uses the deterministic branch
codex/mission/<mission-id>. Do not let missions share a state directory or
working branch.
Resolve SKILL_ROOT to the directory containing this SKILL.md. Run bundled
scripts from SKILL_ROOT/scripts/; never expect them to exist in the target
project.
Read references/orchestration-protocol.md before initialize, resume, replan,
integrate, or migrate. Read references/state-schema.md before editing
coordination files.
Locate the mission
Use this priority order:
- Explicit
mission=<id>.
- Current branch name
codex/mission/<id>.
- The only directory under
.task-orchestrator/missions/.
- If multiple missions remain, list their IDs and ask which one to use.
For a new account with no local clone, require both repo=<repository-url> and
mission=<id>. Clone or fetch the repository normally, check out
codex/mission/<id>, then run the validator. Never guess a repository or
mission from chat history. Stop on a dirty tree, non-fast-forward update,
repository mismatch, mission mismatch, branch mismatch, or missing checkpoint.
Operations
- Initialize: Require
mission=<id>. Start from a non-mission base branch,
create codex/mission/<id>, then run
python3 "$SKILL_ROOT/scripts/init_workspace.py" <project> --mission <id> --base-branch <base>.
Inspect evidence and write the verified mission, plan, task contracts, state,
decisions, and initial handoff.
- Resume: Read
AGENTS.md, the selected mission's mission, state, handoff,
active task, and decisions. Run
python3 "$SKILL_ROOT/scripts/validate_workspace.py" <project> --mission <id> --require-clean.
Continue only the recorded next_action.
- Execute: Perform one ready task in the selected mission. Honor owned and
forbidden paths, run acceptance commands, then checkpoint a portable commit.
- Handoff: On a usage warning or requested account switch, finish the
smallest safe step, record evidence, run
python3 "$SKILL_ROOT/scripts/render_handoff.py" <project> --mission <id>,
validate, commit, push the mission branch, and return the generated complete
resume command.
- Migrate: For an old single-task layout, first create and check out its
mission branch, then run
python3 "$SKILL_ROOT/scripts/migrate_workspace.py" <project> --mission <id> --base-branch <base>.
Never silently move legacy files.
- Replan: Use high reasoning after two failures of one criterion, a
contradiction, an interface change, or a scope change.
- Integrate: Use high reasoning and mark complete only after all criteria
have evidence and branch integration is verified.
Do not ask the user to restate this workflow. Inspect the repository and infer
all discoverable facts. Ask only for a missing repository address or mission
ID, a missing mission or acceptance criterion, an unresolved product choice,
permission for an external or destructive action, or a real state conflict.
Use low reasoning for bounded implementation and specified checks. Use high
reasoning for planning, replan, integration, and final verification. Never
store credentials or private chat transcripts in coordination files. Do not
automate login or quota bypass.
1---2name: orchestrate-long-task3description: Migrate, coordinate, resume, checkpoint, hand off, replan, verify, and integrate very large Codex tasks across accounts, chats, models, or reasoning levels using Git-backed, mission-isolated durable state. Use when a task may outlast one account's usage, when several long tasks share a repository, or when a worker must resume a task by repository address and mission ID. Do not use for small self-contained tasks.4---56# Orchestrate Long Task78Treat Git and `.task-orchestrator/missions/<mission-id>/` as the source of9truth; chats are temporary. Each mission uses the deterministic branch10`codex/mission/<mission-id>`. Do not let missions share a state directory or11working branch.1213Resolve `SKILL_ROOT` to the directory containing this `SKILL.md`. Run bundled14scripts from `SKILL_ROOT/scripts/`; never expect them to exist in the target15project.1617Read `references/orchestration-protocol.md` before initialize, resume, replan,18integrate, or migrate. Read `references/state-schema.md` before editing19coordination files.2021## Locate the mission2223Use this priority order:24251. Explicit `mission=<id>`.262. Current branch name `codex/mission/<id>`.273. The only directory under `.task-orchestrator/missions/`.284. If multiple missions remain, list their IDs and ask which one to use.2930For a new account with no local clone, require both `repo=<repository-url>` and31`mission=<id>`. Clone or fetch the repository normally, check out32`codex/mission/<id>`, then run the validator. Never guess a repository or33mission from chat history. Stop on a dirty tree, non-fast-forward update,34repository mismatch, mission mismatch, branch mismatch, or missing checkpoint.3536## Operations3738- **Initialize:** Require `mission=<id>`. Start from a non-mission base branch,39 create `codex/mission/<id>`, then run40 `python3 "$SKILL_ROOT/scripts/init_workspace.py" <project> --mission <id> --base-branch <base>`.41 Inspect evidence and write the verified mission, plan, task contracts, state,42 decisions, and initial handoff.43- **Resume:** Read `AGENTS.md`, the selected mission's mission, state, handoff,44 active task, and decisions. Run45 `python3 "$SKILL_ROOT/scripts/validate_workspace.py" <project> --mission <id> --require-clean`.46 Continue only the recorded `next_action`.47- **Execute:** Perform one ready task in the selected mission. Honor owned and48 forbidden paths, run acceptance commands, then checkpoint a portable commit.49- **Handoff:** On a usage warning or requested account switch, finish the50 smallest safe step, record evidence, run51 `python3 "$SKILL_ROOT/scripts/render_handoff.py" <project> --mission <id>`,52 validate, commit, push the mission branch, and return the generated complete53 resume command.54- **Migrate:** For an old single-task layout, first create and check out its55 mission branch, then run56 `python3 "$SKILL_ROOT/scripts/migrate_workspace.py" <project> --mission <id> --base-branch <base>`.57 Never silently move legacy files.58- **Replan:** Use high reasoning after two failures of one criterion, a59 contradiction, an interface change, or a scope change.60- **Integrate:** Use high reasoning and mark complete only after all criteria61 have evidence and branch integration is verified.6263Do not ask the user to restate this workflow. Inspect the repository and infer64all discoverable facts. Ask only for a missing repository address or mission65ID, a missing mission or acceptance criterion, an unresolved product choice,66permission for an external or destructive action, or a real state conflict.6768Use low reasoning for bounded implementation and specified checks. Use high69reasoning for planning, replan, integration, and final verification. Never70store credentials or private chat transcripts in coordination files. Do not71automate login or quota bypass.