Planner/implementer/verifier harness skill for long-running Codex workflows
Dynamic long-running Codex workflow with three agent roles and a dumb runtime control plane.
Detect the user's intent from their message after $harness:
| User says | Mode |
|---|---|
$harness <goal or description> |
plan |
$harness run / go / start / launch |
run |
$harness status / progress / check |
status |
$harness stop / halt / kill |
stop |
If ambiguous, ask which mode the user wants.
The user provides a goal or description. You are the planner role in an interactive session.
id, title, descriptionacceptance_criteria (explicit, testable)priority, dependenciesstatus (set first tasks to ready, dependent ones to pending)plan.md with the human-readable plan.tasks.json with the canonical task DAG (must pass validate_tasks_payload).harness-launch.json via the helper script:python3 scripts/harness_runtime_ctl.py create-launch \
--repo <repo> \
--original-goal "<user's original message>" \
--goal "<confirmed goal>" \
--scope "<confirmed scope>" \
--stop-condition "<stop condition if any>" \
--max-task-attempts 3
$harness run to start."harness-state.json — the runtime initializes that on launch.The user wants to launch the background runtime.
Check that harness-launch.json and tasks.json exist in the repo. If not, tell the user to run $harness <goal> first to create a plan.
Run:
python3 scripts/harness_runtime_ctl.py start \
--repo <repo> \
--codex-bin codex
This initializes harness-state.json (if missing), spawns the detached background runtime, and returns the PID.
Report:
$harness status to check progress."$harness stop to halt."The background runtime loops autonomously:
harness-state.json to determine the current role.outputSchema.If tasks.json already has ready tasks, the runtime skips the initial planner turn and goes directly to the implementer.
Run:
python3 scripts/harness_runtime_ctl.py status --repo <repo>
Present the result to the user. Highlight:
running / recovery / terminal / idle)Also show recent events from harness-events.tsv if available.
Run:
python3 scripts/harness_runtime_ctl.py stop --repo <repo>
Confirm to the user that the runtime was halted and note the terminal reason if available.
planner: user-facing before launch; owns plan.md and tasks.json; may add, split, reprioritize, and close tasks.implementer: writes product code for one ready task in its task worktree and creates a trial commit.verifier: evaluates the exact trial commit and returns accept or revert.runtime: not an LLM role; communicates with Codex via the app-server JSON-RPC protocol, applies verifier verdicts, updates artifacts, and manages resume/status/stop. When the planner produces multiple independent tasks, the runtime runs implementers in parallel in isolated task worktrees, cherry-picks accepted commits back onto the main branch, and keeps scheduling until the DAG is exhausted.harness-state.json, harness-events.tsv, or harness-lessons.md.$harness <goal> (plan mode).$harness run (run mode).tasks.json (add/split/reprioritize/close tasks).accept or revert, and ambiguous verification should be surfaced as recovery rather than normal progress.in_progress, in_review, done, ready, blocked) when applying verifier verdicts, but it does not invent product work or change DAG topology.harness-launch.jsonharness-runtime.jsonharness-runtime.logharness-state.jsonharness-events.tsvharness-lessons.mdtasks.jsonplan.mdharness-servers.json (app-server PID tracking for orphan cleanup)reports/*.jsonSee references/artifacts.md for schema and ownership rules.