Skip to content

Harness orchestration

The harness coordinates each task through implementation, independent verification, rework, and a commit. Zdev supplies the records and checks; each adapter uses its harness’s native workers.

Codex and Claude Code installations also include a T3 Code route. When the main thread runs in T3 Code, that route is the default and replaces native dispatch, packaged workflows, and continuation unless the request asks for native orchestration. Worker targets and profiles resolve by each worker’s harness, while ownership, verification, snapshot comparison, completion, and commits follow the common contract below. Sessions outside T3 Code, and explicitly native requests, run through the native adapters.

Each harness installs one discoverable zdev skill that routes user intents to internal contracts and harness-native adapters:

  • zdev-implement <area> selects and completes one ready task through implementation, independent verification, any task-owned rework, completion, and commit.
  • zdev-verify <area> <task-id> independently verifies the current work for one explicit task without completing or committing it. REWORK is a verdict, not a separate workflow.
  • zdev-audit [<boundary>] runs a read-only codebase audit, checks candidate findings, and returns either no findings, checked findings, or a blocker. An omitted boundary means the current repository.
  • zdev-loop <area> [focus...] (aliased as zdev-goal) continues an area one verified task and commit at a time, using any trailing words as fuzzy selection guidance. OpenCode and Pi expose a bounded form that completes at most one task and returns CONTINUE only after a verified commit when fresh ready work remains.
  • In Codex and Claude Code, an explicit Research run request uses the installed references/research.md contract to coordinate serial research on the current branch. It generates mixed work within the authorized scope, charges dispatch before work, accepts only independently verified keeps, and recovers from the run and experiment commands. Empty queues allow further proposals, while ordinary routes keep their hypothesis guards.

Packaged workflows, commands, and prompts back those routes without adding extra skills or changing the root activation name.

Harness Installed skill and adapters Native workers
Codex One zdev/SKILL.md; audit, task, verification, serial research, and continuation contracts live under zdev/references/ The root skill passes the resolved routine-implementer, implementer, verifier, or advanced-implementer profile when spawning a native Codex subagent. Its continuation route uses Codex’s native goal when clear and falls back to one task only after clear inspection when creation is unavailable.
Claude Code One skills-directory plugin whose .claude-plugin/plugin.json declares "workflows": "./workflows/", containing workflows/zdev-implement.js, workflows/zdev-verify.js, workflows/zdev-audit.js, workflows/zdev-loop.js, workflows/zdev-goal.js, and workflows/zdev-research.js with matching meta.name values, plus contracts/task-workflows.md agents/zdev-planner.md, agents/zdev-routine-implementer.md, agents/zdev-implementer.md, agents/zdev-verifier.md, and agents/zdev-advanced-implementer.md. Each agent() call selects a concise scoped role and passes a stored work-context locator. The detailed derived-work contract is loaded only when a split is needed.
OpenCode commands/zdev-implement.md, commands/zdev-verify.md, commands/zdev-audit.md, commands/zdev-parallel.md, commands/zdev-loop.md, and commands/zdev-goal.md under the selected OpenCode scope agents/zdev-planner.md, agents/zdev-routine-implementer.md, agents/zdev-implementer.md, agents/zdev-verifier.md, and agents/zdev-advanced-implementer.md; one-task commands use the native task tool and compact file/snapshot locators. The parallel command stops before mutation because foreground batches do not return coordinator control per completed child. The documented directory is plural commands/.
Pi prompts/zdev-implement.md, prompts/zdev-verify.md, prompts/zdev-audit.md, prompts/zdev-parallel.md, prompts/zdev-loop.md, and prompts/zdev-goal.md extensions/zdev-subagent.ts handles single configured roles and bounded, task-keyed planner and source-implementer batches with explicit working directories. Calls carry compact locators rather than the rendered workflow.
Oh My Pi prompts/zdev-implement.md, prompts/zdev-verify.md, prompts/zdev-audit.md, prompts/zdev-parallel.md, prompts/zdev-loop.md, and prompts/zdev-goal.md Concise blocking agents handle ordinary one-task work. Separate non-blocking routine, standard, and advanced implementers run assigned source worktrees for parallel batches, while the coordinator uses blocking planners and verifiers and keeps integration, completion, and commits.

Every installation also includes one rendered references/parallel.md route. Codex maps it to live-agent inspection, bounded collaboration dispatch, waits, supported interruption, explicit source cwd values, and the configured role profiles. OpenCode returns an explicit unsupported result with a sequential option, and its command checks the current Task surface before mutation. Oh My Pi checks its live conditional Task schema, background job controls, agent discovery, and explicit path access before creating zdev worktrees; it omits native isolation so automatic merge and cleanup cannot bypass coordinator gates. Pi uses a transient session-local handle to return one completed source result at a time, then requires serial destination verification before continuing. The shared route owns admission, isolation, serial integration, recovery, and cleanup rules; no adapter introduces a persistent scheduler or batch record.

For an ongoing goal or loop with blanket parallel approval, the coordinator keeps the approved area, eligible work, worker limit, destination, and worktree and cleanup choices in its handoff. Later compatible finite batches reuse that authority while repeating fresh admission and every per-task verification and commit gate. One-batch approval ends with its batch, and any change outside blanket authority requires a new decision. Claude uses its finite parallel workflow under coordinator control for this continuation rather than its ordinary sequential loop workflow. Unsupported or bounded adapters keep their documented limits.

Install and check render the same files from the same inputs, using the worker model and effort contract in Worker profiles.

Worker prompts carry only their short role, repository guidance, task and file locators, snapshot IDs, and the preceding role’s small result. Coordination passes the resolved route-contract path when a worker may need rare details such as the derived-work form, rather than pasting the full coordinator contract into every child call. Claude can also reference ${CLAUDE_PLUGIN_ROOT} for its plugin contract.

Codex installation targets the shared skills/ root and manages only zdev/, leaving unrelated skills untouched.

Forced migration removes only hard-coded legacy zdev-owned files: the five split Codex skill directories from 1.1.0, two singular command/ files under OpenCode, and prompts/zdev-task.md under Pi, pruning empty legacy directories. A non-forced install or readiness check reports those old files as a conflict without removing anything.

The installed references/research.md contract owns the ordered run route. One coordinator holds the resolved concrete worker profiles, reads run context before costly work, recovers unfinished effects, admits and commits generated tasks, and dispatches one task at a time. Supporting tasks follow ordinary fresh verification and completion. Every preparation, support, rework, repair, rerun, and confirmation dispatch is counted against the run budget, while measurement runs through the bound local lifecycle. Only finalize handles managed hypothesis retention or restoration, task completion, and commits.

A proposed keep uses the checkpoint’s verification snapshot and a fresh independent verifier’s strict semantic result; the coordinator compares the snapshot and builds the public envelope before calling finalize. Discards and terminal failures use coordinator checks and record lessons for the next proposal. Shared failures halt affected experiments, allow counted supporting repair, and require an actual rebaseline once resolved. Resuming preserves run identity, scope, target, deadline, and accumulated costs.

Native continuation follows the exposed get_goal, create_goal, and update_goal capabilities and lifecycle rules. Clear inspection with unavailable goal creation allows at most one foreground work-item iteration; uncertain state blocks. Neither a transient blocker nor queue or allowance exhaustion counts as completing an unfinished native objective. Deterministic local scenarios verify the contract and API; authenticated live Codex execution is separate acceptance work.

zdev-implement collects a stored work-context snapshot first. The command validates goal lifecycle before reading branch or Git state, so a validated closed area returns no work without those reads. Open results carry nested status and goal projections along with HEAD and exact staged, unstaged, and untracked evidence. The coordinator checks that the projections agree, requires branch_status.task_work.safe, reports stale_advisory once, and works only on the ready goal’s task. Structurally unsafe state blocks. Workers receive the opaque stored locator and read the exact context themselves rather than relying on a model relay.

For an area-only loop or goal, the binary selects ready work by AFK suitability, priority, and then numeric task ID. When the user supplies fuzzy focus words, the coordinator reads every task in the ready frontier, picks the best fit, and admits that explicit ID with work-context --task. It repeats selection after every commit and never writes the focus into zdev state.

An implement context that is open / empty, open / exhausted, or closed is a successful no-work result: no worker starts and no state changes. Closed requires no branch or Git evidence, while open no-work keeps the open-work gates. A malformed graph, unsafe open branch, changed focus task, or other validation error is a blocker. The stored-and-shown verification snapshot also serves as fresh context admission after implementation and after each rework. Before each rework implementation handoff, the coordinator reruns ordinary work-context and requires the same task ID so a long conversation cannot drift onto a different task.

zdev-verify requires the explicit task ID to match the current ready focus task; any no-work context is a blocker and starts no worker. Its single stored-and-shown snapshot call serves as both admission preflight and verifier snapshot, without invoking an implementer. The verifier reads the supplied snapshot and runs validation, and coordination compares the snapshot afterward. zdev-audit takes no area selection and does not call zdev goal.

The native goal behavior in Explicit area continuation across harnesses applies only to zdev-loop and zdev-goal. Codex and Oh My Pi apply the short native condition when no conflicting native goal exists; Claude uses its standalone workflow; OpenCode and Pi use bounded continuation. Ordinary implementation and verification use work-context regardless of native goal support.

The coordinating session owns:

  • area and task selection, branch gates, the Git baseline, and overlap checks;
  • user questions and product decisions;
  • choosing the dated or configured worker profile;
  • dispatch, result validation, diff inspection, and rework routing;
  • zdev task done, zdev commit, and the final user report.

The implementer owns only task-approved source and test changes and the recorded validation. It does not edit .zdev, delegate, change task lifecycle, or commit. The verifier is a fresh worker for every verdict: it reads the brief, task, supplied snapshot, full diff, and relevant source, runs required checks, and makes no intentional edits. If a validation command writes files, the run reports REWORK and attributes those writes before continuing. Coordination owns snapshot collection, comparison, advisory attachment, and public identity.

The opt-in assigned-worktree path keeps the same ownership contract. Coordination records absolute authoritative and source roots, pins admission with --task, and uses an ordinary source commit plus no-commit three-way integration as durable transport. Harness adapters handle dispatch and cwd placement only; they do not add a separate scheduler, lifecycle, record copy, merge policy, or completion path. Codex sets the source cwd explicitly because its collaboration surface shares the parent directory.

Implementation role selection follows the task’s authored complexity: routine uses routine-implementer; standard and omitted complexity use implementer; and advanced first obtains one fresh read-only plan from planner (which falls back to advanced-implementer when omitted), then uses advanced-implementer for the edits. Every verdict comes from a fresh standard verifier. Ordinary rework returns to the selected implementation tier without replanning. After standard implementation only, a verifier may recommend one escalation to advanced-implementer during the current in-memory task run, followed by another fresh standard verifier; routine and already advanced work cannot escalate. zdev-verify starts a fresh verifier. Before substantive findings drive rework or reporting, an independent coordinator inspects their evidence or a different fresh verifier checks them. Claude’s executable routes use a fresh verifier and compare the task snapshot again afterward. Zero findings and valid mechanical validation-write markers need no extra reviewer.

zdev-audit starts one verifier, or one per explicit lens, and substantive findings get the same independent check; a default audit with no findings and a lens audit whose reviewers all pass need no checking worker. Audits use the resolved worker profiles rather than inventing an auditor or advanced-verifier role.

The harness runtime owns child execution, cancellation, and delivery only; a child session, job, transcript, or agent ID is never zdev state. Audit reviewers are read-only. For a large boundary or an explicit swarm request, the coordinator may fan out independent audit lenses, with one fresh verifier checking and deduplicating their findings before they reach the user.

The first line is the machine-checkable envelope. The remainder is concise Markdown evidence; harness-native structured output may carry the same fields as long as it renders this public form.

Workflow Allowed first line Required body
zdev-implement PASS zdev-implement <area> <task-id> or BLOCKER zdev-implement <area> <task-id> Exact repeated area/task fields, summary, changed files, validation, verifier evidence, and commit ID on pass; stage, reason, and preserved state on blocker.
zdev-verify One coordinator-constructed strict verifier JSON object with verdict pass, rework, or blocker Exact schema version, kind, area, task ID, summary, generated snapshot/advisory evidence, findings, and constrained escalation.
zdev-audit PASS zdev-audit, FINDINGS zdev-audit, or BLOCKER zdev-audit Boundary, what was inspected and omitted, and checked findings with location, impact, and confidence.

An implementer handoff has nine required JSON fields. Planners return the four semantic fields verdict, summary, plan, and findings; task verifiers return verdict, summary, findings, and escalation. Coordination extracts one balanced JSON object and validates the required fields (a short surrounding sentence or Markdown fence is harmless). It passes an accepted semantic plan unchanged to the advanced implementer and constructs the compatible nine-key public planner or verifier envelope itself, comparing the stored snapshot first for verifier results. Missing output, legacy or malformed JSON, duplicate or missing required keys, multiple objects, contradictory verdict or escalation, or an unavailable required artifact all become a coordinator-generated BLOCKER and are never treated as success.

Each verifier rework result returns the concrete findings to the same implementer when the harness can preserve that worker context, or to a replacement implementer with the current goal, baseline, and full findings. Oh My Pi can message the existing implementer through hub; OpenCode can resume its implementer child; Codex and Claude Code can use their native follow-up mechanisms; Pi starts a fresh child. A fresh verifier then runs a focused recheck of accepted corrections, affected contracts, and repair regressions, keeping conclusions for unchanged code and running required validation.

The ordinary cycle allows one full review, one correction pass, and one focused recheck. If required corrections still remain, automatic repair stops with the task open and work preserved, and further repair requires an explicit user decision. That stage carries through recovery and goal or loop continuation. Transport errors, unavailable models, permission failures, timeouts, and invalid envelopes surface as blockers rather than being hidden behind blind retries or turning the adapter into a scheduler.

The shared review guidance watches for death loops across retries, worker replacement, recovery, and task splitting. A repeated failure requires a concrete changed approach and a checkable reason to retry; if that returns to the same failure without useful evidence, automatic retries stop and work is preserved. New task IDs or fresh workers do not reset the attempt history.

Only a verified pass allows zdev-implement to complete the task and run zdev commit. If completion or commit fails, the public result becomes BLOCKER, naming the successful verification and the exact remaining state. zdev-verify and zdev-audit never change lifecycle state or commit, and an audit never creates tasks automatically; the user decides whether a checked finding becomes durable work.

If a named worker artifact is unavailable but the harness can start a fresh generic child with the required tools and resolved model controls, the coordinator supplies the same role prompt and records the fallback. If it cannot create a separate verification context, the workflow stops with BLOCKER; the coordinating model never verifies its own work and calls that independent.

If a harness lacks a native goal, the JSON projection acts as ordinary prompt context. If a model or effort is unavailable, the worker-profile rules apply without model search or silent substitution. If a native adapter is absent, the installed zdev skill follows the internal route contract directly and reports the bounded behavior it completed.

What stays common and what stays Claude-specific

Section titled “What stays common and what stays Claude-specific”

Every adapter shares the same core workflow guarantees:

  • a read-only preflight before delegation;
  • one coordinator owning the baseline and task lifecycle;
  • a separate implementation handoff and fresh evidence-based verification;
  • a small verdict vocabulary with invalid output failing closed;
  • task-owned rework followed by full verification;
  • an audit fan-out followed by one evidence-vetting pass.

The JavaScript execution details stay Claude-specific: the literal meta block, global args, top-level await, agent(), pipeline(), labels, workflow progress rendering, and the plugin workflow namespace. Other adapters express the same sequence through their own skills, commands, prompts, and tools rather than imitating a JavaScript runtime.

Claude ships zdev-implement.js, zdev-verify.js, zdev-audit.js, and zdev-parallel.js, along with one continuation source rendered as zdev-loop.js and its zdev-goal.js alias. The parallel workflow accepts an explicitly consented finite batch, overlaps bounded implementation lanes in assigned worktrees, and serializes transport, independent verification, completion, and commits in the authoritative checkout. The implementation workflow pairs deterministic preflight, implementation, fresh verification, and while (REWORK) control flow with scoped named roles, refreshed work-context before each handoff, common envelope validation, and evidence sufficient for the coordinator to complete and commit. The audit workflow uses a review-and-vet pipeline. These are Claude-native capabilities rather than behavior other harnesses must reimplement in JavaScript.

Codex supports reusable skills and native subagents. Skills are invoked with $name; the main thread can spawn, message, wait for, interrupt, and close agent threads. Project or skill instructions may request delegation, and a custom agent can set its own model, reasoning effort, instructions, and sandbox. The parent runtime still controls live approval and sandbox choices. See Codex skills and subagent orchestration.

This is enough for a zdev skill to remain the coordinator and use fresh native workers. Zdev does not need an SDK process, task queue, or stored session ID.

Claude Code plugins can package skills, named agents, and JavaScript workflows. A workflow script lives in workflows/ at the plugin root by default; the manifest’s workflows string-or-array field can replace that default path. Plugin workflows are distributed and resolved under the plugin namespace, so meta.name = 'release-audit' in plugin acme-tools becomes /acme-tools:release-audit. See Dynamic workflow distribution and plugin component paths.

Dynamic workflows require Claude Code 2.1.154 or later. Their runtime executes plain JavaScript with top-level await; meta supplies identity, args supplies invocation data, agent() starts a subagent, and pipeline() maps a list to agents. Script variables hold intermediate results, and the runtime keeps the orchestration repeatable and resumable within the session. Named plugin agents still provide the role prompts, tool constraints, models, and effort controls used by the workflow. See Workflow behavior and API and plugin subagent configuration.

Zdev uses native JavaScript workflows for Claude task work and audits. Named agents supply their roles and model settings.

OpenCode discovers Markdown commands from commands/; the file name becomes the slash command and its body becomes a prompt. It also discovers named Markdown subagents. A primary agent can invoke a subagent through the task tool, which creates a child session and returns its text. Supplying the prior task_id resumes that child; omitting it creates a fresh child. Zdev’s sequential implementation and verification cycle runs in the session without needing background subagents or the OpenCode SDK. See Commands, agents, and the OpenCode SDK.

Stock Pi has no built-in subagent system. It supports skills, Markdown prompt templates, and TypeScript extensions that register tools and commands. Zdev follows Pi’s isolated-child pattern with zdev_subagent: each call starts a no-session pi process with a restricted tool list and captures JSON output. That gives implementation and verification fresh contexts, though it cannot resume an implementer for rework; a rework pass starts another child with the earlier findings and current checkout state. See the Pi README and extension model and the subagent extension example.

Oh My Pi has native task and hub tools. task discovers named agents, supports blocking or background execution, returns structured result details, and can keep a completed non-isolated agent available. hub can message a finished agent and revive it when necessary. Custom prompt templates under .omp/prompts/ expand as slash commands. See Oh My Pi’s task documentation, hub documentation, and agent discovery.

Oh My Pi also offers background jobs, batch fan-out, isolation, process supervision, and session artifacts. None is required for the ordinary zdev cycle. The adapter uses blocking named workers in the current checkout; zdev, not Oh My Pi’s job system, remains the workflow owner.

The installed zdev-research workflow reuses the ordinary one-task body for supporting work and coordinates hypotheses through the binary lifecycle, using only args and sequential agent() calls. It resolves all five native Claude roles before dispatch and passes the concrete model and effort options to each planner, implementer, and verifier. Each supporting dispatch and hypothesis retry takes a fresh reservation before launch: begin charges initial candidate preparation, and evaluate charges correctness and evaluator commands. Only a proposed keep starts a fresh independent acceptance verifier with strict snapshot equality.

Pausing and continuing a live run uses Claude’s native workflow controls. After a stop or failure, resume with a new invocation identity on the same durable run and recover unfinished effects before reserving more work. Because Claude can replay completed cached agent calls during recovery, restarting an interrupted worker under its old reservation would distort accounting. The installed reference also documents a bounded one-work-item foreground fallback when packaged execution is unavailable, with no /goal dependency and no invented shell, clock, or cancellation APIs. Deterministic command tests and authenticated provider execution are separate acceptance evidence. See Claude workflow execution and plugin workflow discovery.