/dag:executefrom DAG Engineering
The execution door — walks a pre-flight-signed DAG or required Atlas portfolio, dispatching each node behind the merge gate, climbing the escalation ladder on findings, and driving every node to done-clean, wave by wave.
Ships in DAG Engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Enter through /dag:execute in Claude Code or $dag:execute in Codex.
The loop you live in from a signed pre-flight until the DAG is done. It runs the DAG wave by
wave, each node behind the merge gate, carrying the ladder, fix-completeness, the
proof ledger, and close-on-proof. Terms are defined once in ../../GLOSSARY.md, and how to respond is in
../../RESPONSE-RULES.md.
The core loop, per node: dispatch a self-contained brief → merge gate (CI + independent review whose verdict is posted to the PR + your own cold read + the proof contract satisfied, wherever the proof profile says tier 3 is reachable from a branch) → merge → close the issue. Where tier 3 needs the merged head instead, proof runs straight after the merge and the issue closes on it.
The one shape, everywhere: one teammate = one node = one worktree = one PR. You are the main orchestrator: you read the frontier, create each worktree, assign each node, and grade what comes back. Each teammate runs only its assigned node and captures the evidence its contract names; it never self-claims another node or spawns another agent. Nobody grades their own homework — the contract was fixed before the code existed, and the verdict is yours. Where the profile puts a tier behind a shared environment, that tier is yours to reach as well.
How this run behaves comes from each map's run profile — the concurrency cap, the model per role, and the autonomy level — not from this conversation, so a fresh context window runs the DAG the way the last one did. Autonomy decides how freely the loop runs:
Inputs: the signed pre-flight table (nodes, edges, proof contracts) and each node's spec. Work the steps in order; steps 2–5 repeat per wave until the DAG is done.
Locate the signed chart from GitHub rather than the previous planning conversation:
gh issue list --label dag:map,dag:preflighted --state open --json number,title,labels
An issue number or exact title named by the user wins. One eligible map selects itself. When several
signed maps belong to one Atlas, read the Atlas and their native cross-map blockers: required parallel
and dependent maps form one execution portfolio; alternatives or maps contending for an unmodelled
exclusive resource go to the user. Never ask merely because several required maps exist, and never
choose by recency. Exclude every map carrying dag:halted.
Check the signature before anything else. The map must carry the dag:preflighted label, and must
not carry dag:halted. That first label is the door between the two halves: planning is
/dag:plan's, execution is yours, and the signature is what moved the DAG across. Without it, this DAG
is not cleared for dispatch — say so plainly and hand back to /dag:plan, which routes it. A wave
dispatched off an unsigned DAG is the whole failure the gate exists to prevent, and a wave dispatched off
a halted one repeats a stop a human already raised.
Then read every selected map's inputs off GitHub, not off memory — this window may be the second one:
R=<owner>/<repo>
gh issue view <map-number> --json body,labels # run profile, proof profile, Skills line
gh issue view <map-number> --comments --json comments # the signed pre-flight table
gh api --paginate repos/$R/issues/<map-number>/sub_issues --jq '.[] | {number,title,state}'
Derive the proof ledger; never store it in this conversation. One row per open node across the portfolio — its owning map and proof contract from the node's own issue body, and whichever tiers already carry a recorded result in that issue's comments. The ledger is the record that keeps triage-clean (reviews pass) from ever passing for done-clean (proof gathered, in the PR), so it has to survive a crashed window: as each tier's result lands, post it to that node's issue. A ledger held only in context is a ledger that resumes as an empty one, and a merged-but-unproven node then looks exactly like a done-clean one.
Done when: every selected map carries dag:preflighted, each run profile and signed table has been
read off GitHub, and every open node has a ledger row derived from its issue — or you have stopped and
handed back because a required signature is absent.
Compute one combined ready set: every unstarted node in the selected map or portfolio whose blocking
edges are all closed, including native cross-map blockers — the same
predicate chart, plan and GitHub's own UI use, so the frontier you dispatch is the frontier the
tracker renders. Under close-on-proof a blocker closes when its proof lands, not when it merges.
Before assigning a node, create its branch and worktree from its owning map's current base, then give the
teammate the absolute worktree path and a self-contained brief — the fields and shape constraint are
in dispatch-brief.md. The orchestrator owns worktree creation and cleanup; a
teammate never creates its own checkout.
Choose exactly one runner from the host — never mix runners inside one DAG or portfolio:
spawn_agent once per assigned node, using a
worker role, fork_turns: "none", and the self-contained brief. Do not create user-owned sidebar
threads for node work. The main agent alone follows up, waits, interrupts and assigns; child agents do
not delegate further.The mechanics common to both runners:
Done when: every ready node has a teammate whose brief carries its owning map, acceptance criteria, proof contract, consumed edges, exact branch and worktree, and the fix-completeness rule; the team is within every owning-map cap, shared-resource cap and host capacity; every in-flight node's edges are all closed; and no teammate owns more than one node.
A node merges only when every signal is clean: CI green; an independent review — whichever the map's
Skills line names, briefed with review-brief.md and its verdict posted to the PR
as a comment, never left in a transcript; your own cold read of the full diff; and — wherever the
proof profile says tier 3 is reachable from a branch — the node's proof contract satisfied by
/dag:prove, with the evidence in the PR. Each review round returns findings; every round's findings feed the ladder (step 4), and the fix goes back through every signal.
Proof belongs at this gate whenever it can be reached from the branch. The open PR is the one moment a reviewer is actually reading, and a node whose proof can't be gathered has not earned a merge — far cheaper to learn before the merge than after. Only where tier 3 genuinely needs the merged head does proof move to step 5.
Proof must be current with the code it is about to merge with. Evidence gathered at an earlier commit is evidence about that commit, and review fixes landing after it can change the very behaviour it claimed. Here the comparison is against the PR head — not the base branch, which does not contain this node's work yet and would report the whole feature as a difference every time:
git diff <proof-head> <pr-head> -- <paths the contract's evidence covers>
Empty means the proof still describes what is about to merge. Non-empty means re-prove — and a re-proof is not merely fresher, it is often strictly better evidence, because the fixes it runs against created states the first run could not reach.
Done when: CI is green, the review verdict is posted to the PR, your cold read is clean, every finding of the last round was resolved through the ladder, and the proof contract is satisfied — or the profile says this node's tier 3 waits for the merged head.
The response to review findings, per round. Climb the moment any trigger fires — hold nothing back for the round count.
| Rung | Mode | What you do |
|---|---|---|
| 1 — Patch | triage | Fix the reported defect. The normal response for rounds 1–2. |
| 2 — Diagnose + fix (inner loop) | diagnosis | Stop patching. Invoke /dag:diagnose on the cluster; act on its verdict below. Autonomous by default. |
| 3 — Stop (outer loop, rare) | escalate | Surface to the human, pre-validated. |
Climb to rung 2 the moment any trigger fires:
Act on /dag:diagnose's verdict (the rung-2 → rung-3 stop line):
Rung 3 fires only when diagnose returns node-wrong, the node's live proof cannot be gathered, or the consolidating fix would cost more than the node is worth. It arrives pre-validated: the nest, a confidence level, and whether the fix unblocks — a stop the human can act on, not a bare "I'm stuck." Freeze dispatch immediately, then classify the planning level before you write state. Assign no fresh node. Compare every in-flight node with the named nest: interrupt the teammates whose premise or proof contract depends on it; let an in-flight node continue only when you can show it is independent.
Route the stop at the level that failed:
dag:preflighted, create one de-fog issue blocking the stopped node, and do
not add dag:halted. The open de-fog issue is the durable reason this unsigned chart cannot be
re-signed.dag:preflighted with dag:halted and comment
Class: method-wrong plus the failed mechanism. Re-plan owns the affected class.dag:halted and comment Class: destination-wrong.
Re-plan returns it to Wayfinding and the parent Atlas.R=<owner>/<repo>
# node-wrong
gh issue edit <map-number> --remove-label dag:preflighted
gh issue create --title "De-fog: <the question>" \
--label <dag:needs-grilling|dag:needs-research|dag:needs-prototype> \
--body "<the pre-validated finding, and what settling it unblocks>"
gh api repos/$R/issues/<defog-number> --jq .id
gh api -X POST repos/$R/issues/<map-number>/sub_issues -F sub_issue_id=<defog-database-id>
gh api -X POST repos/$R/issues/<stopped-node>/dependencies/blocked_by -F issue_id=<defog-database-id>
# method-wrong or destination-wrong
gh issue edit <map-number> --remove-label dag:preflighted --add-label dag:halted
gh issue comment <map-number> --body "Class: <method-wrong|destination-wrong>
<the evidence and what resolving it unblocks>"
Choose the readiness label from the unknown: a user decision is dag:needs-grilling, a look-up fact is
dag:needs-research, and uncertainty about whether the behavior can be observed is
dag:needs-prototype. Never substitute an interview for an observability spike.
Never put the readiness label on the stopped node itself. /dag:plan closes a readiness-labelled
issue the moment its move lands — that close is precisely how the build node behind it reaches the
frontier. Label the build node and planning closes the build node, unbuilt, unproven, and looking done.
The de-fog node is a separate issue that blocks it, which is the same shape chart uses everywhere else.
Both shapes stop a fresh window from resuming: a node-level stop is unsigned and visibly blocked by its
de-fog issue; a chart- or destination-level stop carries dag:halted. /dag:plan routes the first to
the de-fog move and the second to re-plan. Pre-flight is re-signed in full before execution resumes.
Fix-completeness binds every fix on every rung, the consolidating one included: before a fix is done, enumerate every branch and caller its reasoning touches, and cover each. A consolidating fix covers every call site of the nest — half a consolidation reopens the class it was meant to close.
Done when: every finding of the round is patched (rung 1, fix-complete), folded into a consolidating fix (rung 2, fix-complete over the whole nest), or raised as a pre-validated stop (rung 3) — and no finding is still being patched after a trigger has fired; on rung 3, dispatch is frozen and every in-flight node has been interrupted-or-proven-independent.
Where tier 3 was reachable from the branch, the node arrives here already proven — the merge gate took its evidence in step 3. Merge it, and close its issue on the satisfied contract.
Past the merge, currency is checked by content, never by ancestry. A squash merge does not keep the
proof commit as an ancestor, so git merge-base --is-ancestor answers "not merged" for work that merged
perfectly. Now that the base does contain the node's work, diffing against it is the reliable check:
git diff <proof-head> origin/main -- <paths the contract's evidence covers>
Empty confirms the evidence still describes what shipped. Non-empty means the merge changed something the proof spoke for — a conflict resolution, a rebase, someone else's node landing in the same paths — and the node owes a re-proof before it closes.
Where tier 3 needs the merged head, triage-clean clears the node to merge but does not make it done.
Carry it through in one sitting: merge → get the head running the way the profile says this repo runs
it → /dag:prove the node, which runs its proof contract at each tier, captures the evidence
in the form its surface calls for, commits the receipt, and posts the tier table and the evidence
into the PR → done-clean.
The contract was written when the node was created, so nothing here is invented now: the agent that built the node never chose its own bar, and you are checking evidence against a bar set before the code existed.
Proof is never deferred, and never merely asserted. You never merge a node whose proof you already
know can't be gathered (that is a rung-3 stop), you never leave a merged node's proof for "later," and a
tier with no evidence in the PR is NOT PROVEN — never promoted from a tier that was reached. Record each
tier's verdict in the ledger row. The instant the contract is satisfied, close the node's issue in the
same step — close-on-proof, so the recorded state never drifts from the real one.
Done when: /dag:prove has returned a verdict for every tier in the node's contract with the evidence
posted to the PR and the receipt committed, the node is merged, and its issue is closed — or the node is
a rung-3 stop and its ledger row says which tier failed and why.
A wave is complete when every node in it is done-clean and closed — merges alone don't complete it.
Recompute the combined ready set (step 2) and run the next wave. When every ledger row owned by one map
is satisfied-and-closed, close that map immediately with a completion comment; do not wait for dependent
maps in the portfolio. The closed dag:map issue is the durable terminal state that keeps a fresh
planning window from redispatching it and releases native cross-map blockers. The portfolio is complete
when every required selected map is closed.
gh issue close <map-number> --comment "Expedition complete: every node is done-clean and closed."
Done when: every node in the DAG or portfolio is done-clean with a closed issue and every completed map is closed, or an open rung-3 stop has returned the affected work to planning — no node left in an in-between state.
Execution runs long and unattended, so a turn ends whenever the loop pauses: a wave completed, a rung-3 stop, the DAG done, or the context window running out mid-wave.
Read ../../RESPONSE-RULES.md before you write the closing message.
Not optional and not a reference for later: the shape lives there and nowhere else, and there is
deliberately no template here to copy from.
What is specific to this door, and additional to that file:
dag:halted, so the DAG is
back in planning. A stop that reads as a failure report leaves the user holding a diagnosis with
nothing to do about it./dag:execute again. And
where planning has to happen again, name /dag:plan, the other door. Never /dag:grill, never
/dag:preflight.Done when: you have read RESPONSE-RULES.md this turn and the closing message follows it; position is
stated in nodes; in-flight work is listed separately from durable work; and "what you do" states plainly
that re-running /dag:execute resumes.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aaronabuusama/dag-engineering --plugin dag13 skills in this plugin
/chartInternal planning move reached through dag:plan — turn a grilled or specced plan into a DAG of GitHub issues with native blocking edges. Do not invoke directly outside the planning router./diagnoseFind the one design gap behind a cluster of review findings and return a consolidating fix or a pre-validated escalation. Use when a bug-class recurs, or when a fix needs a new mechanism rather than a tightened check./feedbackCapture a DAG Engineering workflow failure, wrong route, lost state, or contradicted contract with reproducible evidence and return it to the dag-plugin source repository. Use when the user asks to record feedback or an observed DAG failure should become an actionable upstream report.Other plugins' skills for the same job