Skip to content

Workflow

Zdev has one normal loop:

next task
→ implementation sub-agent
→ independent review and verification sub-agent
→ rework and recheck when needed
→ mark done
→ commit with a stable change ID
→ next task

Your harness coordinates execution, zdev stores the area brief, task files, generated index, and branch metadata, and Git holds accepted source history and any rebase in progress.

The user guide walks through installation and a first run. This reference describes the workflow rules and how to recover when a run stops.

Your coding harness implements and verifies the work, while zdev tracks durable task files, dependency selection, branch relationships, and stable Git change IDs.

Every harness integration renders the same task contract and repository guidance in its native format. During implementation, source and tests change while .zdev stays untouched. Verification runs in a fresh, read-only context; only after both specification and repository-standards checks pass do you mark the task done and commit the accepted files.

Coding guidelines covers the shared code-quality bar, and Review and verification explains the agent requests and their stopping points.

All installed integrations share one coding guide. Planners outline responsibilities and changed contracts; implementers revisit those boundaries and check naming, side effects, structure, and completion evidence. The guide keeps design proportional to the change and honors the brief’s testing level without demanding a fixed editing order or a report on every identifier.

Verifiers check the same standards alongside task requirements. Before substantive findings trigger rework or get reported, someone other than their author verifies the locations, rules, consequences, and severity against the same code state (an independent coordinator can inspect that evidence directly; otherwise a fresh verifier runs under the retained execution profile). Zero findings and routine validation bookkeeping need no extra pass, while open questions or missing required evidence prevent a pass.

An area either follows the configured project trunk or records its own branch in isolated mode. Under personal, project, and shadow records, creating an area on the checked-out trunk without a mode flag produces a trunk area under the default workspace.branching = "on-request". On another branch, under workspace.branching = "isolated", or with a pull-request record, the area binds the checked-out branch. --trunk and --branch always override the default. An independent isolated area uses project trunk as its effective base; a dependent area names a parent area whose branch becomes its effective base. One thread per area is the usual setup, though several areas can share a thread, worktree, and branch while keeping task ownership scoped to each area and task.

zdev init records trunk automatically when HEAD names a branch; if you initialize on detached HEAD, set trunk explicitly before starting managed work. Isolated area creation records the branch and an initial base anchor when available, whereas a trunk area stores neither and resolves project.trunk dynamically.

Before the first initialization, the harness asks whether .zdev should use a personal, project, pull-request, or shadow record:

  • personal writes /.zdev/ to clone-local .git/info/exclude;
  • project leaves .zdev visible to Git as shared project history;
  • pull-request commits .zdev for branch review and removes it with zdev cleanup squash before squash merge; and
  • shadow versions .zdev in its own repository at .zdev/.git, excluded from the main repository, with branches tracking the main repository’s branches.

Record policy is independent of user or project integration scope, and repositories that already have .zdev keep their policy without asking again.

Correct an existing binding or switch to trunk mode explicitly:

zdev config trunk <trunk-branch>
zdev area bind <area> <area-branch>
zdev area bind <area> --trunk

Read branch_status from zdev status <area> --format json during orientation:

  • branch_matches: whether the area’s required branch is checked out.
  • mode: distinguishes an isolated branch binding from an explicit trunk area (branch holds the resolved required branch in both cases).
  • fresh: whether the current effective-base tip is an ancestor of the area branch.
  • anchor_valid: whether the recorded boundary between inherited and area-owned commits still exists.
  • finalized: whether that boundary has advanced to the current base tip.
  • task_work.safe: whether task selection, implementation, verification, and completion may proceed (stale_advisory separates a valid-but-stale link from an unsafe state).

A rewritten parent can leave the old anchor valid while making the link stale, so current-base ancestry (not anchor containment) determines freshness. Staleness stays advisory as long as the recorded branch is checked out, both branches and their ancestry are inspectable, the anchor is contained, child history after the anchor is linear, and no Git recovery operation is active. Status prints one rebase advisory in that case; wrong or detached branches, missing or invalid facts, nonlinear history, and active Git operations remain blockers. Trunk areas require the resolved trunk branch to be checked out and inspectable, with no anchor, freshness check, or rebase advisory.

For a two-area stack, create the parent branch and area first, branch the child from the parent, and record the parent link:

git switch -c <parent-branch>
zdev area create <parent> --title <title> --objective <objective>
git switch -c <child-branch>
zdev area create <child> --title <title> --objective <objective>
zdev area parent <child> <parent>

Area parents model branch ancestry, whereas blocked_by models task order and may name a full task ID from another area such as platform-009 (bundle keys stay local to their bundle). Cross-area blockers do not alter branch parents, rebase order, or freshness checks. A task becomes ready once every blocker’s task file in the current checkout is done. When every open task in an area waits on another area, the queue is blocked, and zdev area close refuses to close an area whose open tasks still block tasks elsewhere.

Rebasing is the supported way to pull effective-base changes into an isolated area. Run this on the area’s branch with a clean worktree:

zdev area rebase <area>

For an explicit trunk area, the command returns unchanged because the area already tracks the configured trunk.

Zdev replays area-owned commits from the stored anchor onto the current effective-base tip. It never merges, switches branches, touches another worktree, force-pushes, resolves conflicts, or rebases descendants; a fresh, finalized link is a no-op.

If Git stops on conflicts, resolve and stage them, then continue or abort:

zdev area rebase <area> --continue
zdev area rebase <area> --abort

The anchor advances only after the rebase completes. If you finish with git rebase --continue, run zdev area rebase <area> afterward so zdev can verify the result and finalize the anchor.

For a longer stack, rebase one link at a time from parent to child. The parent does not need to be finished first, and child work can continue on a stale-but-safe link until it needs newer parent commits or approaches integration.

An area captures one coherent objective. Shared conclusions belong in brief.md, while task-specific details live in each task file.

When an area spans several related increments, optional slice briefs under .zdev/<area>/slices/ give each increment a name, objective, and boundaries:

Terminal window
zdev slice create <area> <key> --title <title> --objective <objective> \
--boundary <text> --boundary <text>
zdev slice list <area>
zdev slice show <area> <key>

Slices carry no stored status and tasks do not need to belong to one. When a task names an existing slice in its routing frontmatter, zdev derives per-slice ready, blocked, and done counts (including zeros for an empty slice), while unsliced tasks appear only in area totals. Task list, show, next, status, and generated index output include the slice context, and the area brief stays authoritative for shared decisions and testing.

During approved area shaping or an authorized investigation task, save research under .zdev/<area>/background/ only when later tasks need readable, stable, source-backed material. Index every retained file from the brief and link only relevant files from each task; leave out transcripts, raw tool dumps, copied source files, temporary prototypes, and lifecycle metadata. Background files never override the brief or a task’s outcome, boundaries, and done conditions, and standalone investigations stay report-only unless you ask to save their findings. Unfinished plans, future ideas, and collected research can live in .zdev/_notes/ as individual files or nested folders without metadata or an index, outside the task queue. The skill routes add-note, list-notes, and make-area-from-note through normal filesystem tools and the area workflow (see Notes for future work).

Review the initial task split before import: this human checkpoint settles scope, sequencing, and dependencies, after which execution continues until it hits a decision that would cross that boundary.

Planning, audits, research, diagnosis, and prototypes are harness methods rather than zdev record types; they refine the brief or propose tasks, while only reviewed, agent-ready implementation work enters the queue.

Use general as a conventional standing area for small, unrelated improvements that do not warrant a new area each time. It follows the exact same lifecycle rules as any other area. On the checked-out trunk under default workspace.branching = "on-request", create a trunk area with:

Terminal window
zdev area create general \
--title "General work" \
--objective "Keep concrete one-off improvements as reviewed tasks."

For an isolated area, switch to or create the branch first so the same command binds that branch (pull-request records always use the isolated form).

Keep its brief short and reusable (shared engineering boundaries, testing level, and validation commands), and put each one-off task’s outcome, context, boundaries, done conditions, and validation in the task itself. Leave most one-off tasks unsliced unless several share one narrower objective.

Every area starts open, and an empty or exhausted queue leaves the objective open until you run zdev area close <area>. Use zdev area reopen <area> before importing or reopening tasks; both mutations use the normal task-work branch-safety gate.

Discussion can move straight to exact task-bundle review when a request asks for task creation and already settles the product and testing choices, skipping unnecessary research or a new brief. Import still requires exact-bundle approval or existing delegated authority covering that scope, and execution keeps the same branch-safety, testing, independent verification, completion, and commit gates. Zdev never creates or switches the general branch; the harness asks first unless you already authorized that change.

Task creation stores a valid candidate before independent challenge. A fresh reviewer reads the returned Markdown path, and concrete revisions replace the stored candidate: focused corrections go back to the same reviewer against the prior findings and full revised document, while material changes to scope, boundaries, dependencies, task splitting, or testing strategy receive a fresh full challenge. The final challenged document is presented for your approval unless you already delegated task creation and import for that scope (storage and challenge alone never grant import authority).

Zdev must be active before intent routing. Saying zdev or $zdev, asking to work in an existing .zdev area, or clearly referring to stored zdev work activates it; the mere presence of .zdev or generic words such as “audit”, “explore”, or “discuss” do not. Once active, the harness selects one direct interaction:

  • Explore an objective builds or revises the area brief (wayfind and shape are aliases).
  • Discuss the brief surfaces consequential choices, tests them in breadth-first rounds, and records decisions (grill is an alias).
  • Improve, Investigate, Create tasks, Implement, and Verify remain separate actions.

Every interaction follows the same question policy: ask one focused question when the answer determines the next step, batch only independent questions, recommend an option with its trade-off, treat no answer as no consent, and reuse choices already stated. Discussion and read-only orientation start in the current checkout. Implementation reuses any explicit workspace choice; otherwise the harness checks workspace.branching. Under the default on-request, it implements in the current checkout and creates a branch or worktree only when you ask or when the route requires one (parallel batches, rolling research, or an assigned source worktree). Under isolated, it creates a worktree as its authoritative checkout and reports that path. Switching branches in the existing checkout still needs your consent unless already authorized.

An explicitly requested assigned-worktree implementation keeps the admitted checkout as its destination: it stores context for the exact task, gives the worker a linked worktree at that baseline, and transports only an inspected source commit back via a no-commit three-way Git merge (using Git’s normal merge semantics for destination drift, deletions, binary files, and executable bits). Verification snapshots, completion records, staging, and the final zdev commit all stay in the destination checkout.

An explicit Parallel request can overlap a finite, user-approved batch of compatible ready tasks in separate assigned worktrees, with you choosing the destination, total delegated-role limit, and cleanup preference. Codex, Claude Code, and Pi support this route, and Oh My Pi supports it when live background-worker capabilities qualify. OpenCode checks its Task surface before mutating anything and falls back to sequential implementation because its foreground batches do not return coordinator control per completed child; T3 orchestration supports sequential work only. Even when workers overlap, destination integration, independent verification, task completion, and commits stay serial.

After each interaction, zdev reports the result and relevant next actions. One message can explicitly order several interactions (for example, approving an exact bundle and asking to implement), in which case zdev imports the approved bundle and starts the next ready task if every gate passes. Discussion remains an optional checkpoint before task creation, creating tasks still needs an explicit request, and importing still requires approval of the exact displayed bundle.

Run zdev work-context <area> --format json before dispatch. For open work, require matching nested status and goal projections along with branch_status.task_work.safe, retaining HEAD and the exact Git evidence. Report a stale-but-safe rebase advisory once and continue without asking for rebase consent; stop on any unsafe branch, anchor, ancestry, history, or active Git operation. When the task needs newer base changes or reaches an integration boundary, run the managed rebase and collect fresh work-context.

In trunk mode, resolve project.trunk dynamically, require it to be checked out and safe, and skip freshness and rebase checks. Sharing trunk never grants ownership of another area’s changes or unrelated edits.

The implementation agent receives the brief, one task, and relevant repository context. It reads the brief first, loads task-relevant files selectively, and edits source and tests without modifying .zdev or committing.

Inspect the diff before verification so unrelated changes stay out of the task.

New task-only commits are expected and do not interrupt the active task; the coordinator considers them after finishing the current task and running zdev next again. Any intervening commit that changes an existing task, the brief, area metadata, lifecycle state, or source code should be reviewed before continuing.

A fresh agent reads the brief first, then the task and relevant sources, and runs separate Spec and Standards passes. The Spec pass checks every done condition, boundary, and area decision; the Standards pass checks repository conventions, maintainability, unrelated changes, and risks at touched interfaces. It runs the task’s validation and returns either a pass on both axes or concrete, classified findings.

Verification includes reviewing design, naming, and readability against the shared coding guidelines; passing tests alone is not enough for acceptance. Independence comes from the fresh, read-only context rather than from storing an execution transcript.

Required corrections name a location, consequence, and proportionate remedy; optional suggestions stay feedback and never block acceptance.

A task gets one full review, one correction pass, and one focused recheck covering the accepted corrections, affected contracts, and repair regressions while keeping conclusions for unchanged code. If required corrections remain after that recheck, keep the task open, preserve the work, and report a blocker requiring a user continuation decision. Recovery and goal/loop continuation preserve this stage. The installed coding reference links the full review procedure and conditionally loaded language and framework guidance.

Collect fresh work-context again before completion. zdev task done allows a stale-but-safe link with one advisory and blocks unsafe branch, anchor, ancestry, history, or Git-operation states.

After a pass, zdev task done updates the task file and regenerates TASKS.md. Stage the intended source and area files, then run zdev commit. Under project and pull-request records, zdev commit adds a stable Zdev-Change-Id trailer; personal and shadow records leave the main commit message unchanged.

Completion records only a short result and validation summary rather than copying prompts, transcripts, diffs, commit hashes, or agent trees into another store.

If an active authorized task hits an incidental planner-written restriction (for example, needing a different helper or file to achieve the agreed outcome), the coordinator may update the active task or brief after checking the agreed outcome, explicit user constraints, compatibility promises, original Git baseline, and ownership. It explains the adjustment, captures fresh work-context, and resumes the task; verification runs against the updated records and original baseline, and completion commits those clarified records with the task. Pending reviewed task bundles still require exact renewed approval after any edit.

To resume interrupted work, inspect the task, working tree, and Git history:

  • the task file shows whether work is open or done;
  • the working tree holds any unfinished edits;
  • Git holds committed work;
  • zdev status reports branch, effective-base, anchor, and finalization state; and
  • the stable change ID locates a logical change across rebases.

If Git has a rebase in progress, use zdev area rebase <area> --continue or --abort; otherwise rerun zdev area rebase <area> to finalize a manually completed rebase. Rebase a stale-but-safe link when you need newer base changes or are preparing to integrate (ordinary task work can resume without it). There is no separate zdev execution log to recover.

For a ready hypothesis task, configure named correctness_commands alongside the evaluator and commit the area records. Run zdev research experiment <area> <task> begin --path <code-file> before editing, then evaluate to run the commands and record samples and invocation costs. The starting revision may precede HEAD when intervening commits touch only development records.

finalize --decision keep --lesson <lesson> --verification <verifier.json> requires a fresh independent verifier bound to the reported candidate snapshot, then commits accepted code and advances the area baseline. finalize --decision discard --lesson <lesson> keeps the candidate reference, restores owned code, and commits the measured result. Exhausted attempts can finish as failed-to-run or inconclusive. Unrelated staged, unstaged, and untracked files stay untouched.

See the experiment contract for the verifier envelope and retained-code rules. After an interruption, inspect shows the checkpoint and recover finishes pending steps without re-running recorded measurements, completion, or an already-succeeded commit (unresolved measurements remain open and are not relaunched automatically).

For isolated hypotheses, start an authorized run with separate worker and measurement budgets, create a source branch and worktree from admitted HEAD, and run zdev research experiment <area> <task> admit --source <root> --path <file>. Its context records authoritative paths and required measurements; source workers edit and validate only inside the source tree. The coordinator confirms worker stop with return --worker-stopped, measures with evaluate, and applies measured Git transport with integrate. A fresh independent verifier checks the destination snapshot before keep.

If another candidate or supporting task updates accepted code, reconcile the stopped source and remeasure against the new baseline. Changed evaluator or workload settings pause candidates until a counted rebaseline completes. Rejected isolated candidates retain their code, observations, and lessons while leaving accepted destination code intact. Recover pending effects before new dispatch: workers or processes with unknown state retain their capacity slots, and the binary never deletes their worktrees. The installed task-format reference defines this candidate contract across harnesses.