garage44.eu/jeroen/midas

logclone: git clone https://garage44.eu/jeroen/midas.git

.. /skills/finish-branch/SKILL.md

raw


name: finish-branch description: Land a session's finished branch on main — ask the person "Shall it land?" with the evidence, check it does what was asked, read what moved on main, gate it on a build node, fast-forward main. Use when the work is done and verified (to ask), and when the person answers "Land it" or says to merge or land it.

finish-branch

Land a branch, having first checked it is what was asked for — and only on the person's word: their answer to "Shall it land?", or their own "merge it", "land it", "merge to main".

Asking

When the work is done and verified, do not wait to be told: ask, with AskUserQuestion, so the question reaches the person on the hub's page (and their phone) as one card they can answer in a tap.

Two things come before the question, because each, found after the person's "yes", costs them another round:

What landing it changes, first. Before the evidence, write a fenced block of language impact, which the page draws as its own panel ("Once it lands"):

The person decides on what the session's outcome means for them, not on what the diff touches: a landing question that gave only the evidence made them ask "so, how would it work when landed?" before they could answer (2026-11).

Then put the evidence in your message just before the question, as short Markdown — what was asked, what the branch does, how it was verified (the gate and where it ran, other tests, the picture), and anything risky or touching another session's work. The question itself stays a line or two: "Shall it land?", the project and branch, and the one thing to weigh if there is one — a phone shows it as a card, and a long one buries the choices. The options:

There is no "keep working" answer: a session that stayed open after landing took the next wish, and the next, and did not end. When the person writes a new wish into their answer ("land it, and also …"), weigh it — but first:

Then:

A question in their answer is answered, not asked over. When the person's "Other" asks something ("looks good — what is X for?"), they have not said yes or no: answer it in your message, as visible text, and end your turn without asking "Shall it land?" again. Their next message is the answer to the landing — "land it" lands, anything else is a "not yet". An agent that put its answer only in its thinking and opened the same landing card again left the person with no answer and a second card to dismiss (2026-11-19).

Land without --finish otherwise only when they say, in their own words, to keep this session open — or when what landed still needs a step only the person can take before this session's task is done (a token, a DNS record, an OAuth app). Then land without --finish and declare that step with midas await (the session_await tool), --secret for a token, before your turn ends. Said only in prose, the session sat under "Landed today" with the step undone and listed nowhere (2026-11-14); declared, the page lists it under Needs you until the person does it, and midas tells you when. With the session's autopilot on, it answers this question for them, from the evidence you give: one with the gate's pass in it is one it can decide.

When the targets are a real choice (an optional one changed, or the person may want one left out), name the proposal in the question ("builds sim, web; wasm later") and let the answer change it: land with --targets +wasm, -apk, or a list (sim,web), as midas land targets --pick takes it. The person's "Other" answer may say which.

Holding the deploy is not one of the answers: the person holds deploys on the Workspace page. Land with --hold-deploy "why" only when they ask for it.

The person's answer is their word for this landing, and for nothing after it: a branch changed since asks again.

A session in several projects

A session started from the page can work in several projects, a worktree of each in its folder (project_add). Ask once, for all of them, naming each project and what its branch does. Then land each from inside its own worktree, the one depended on first: each landing must stand on its own on main, because the second can still fail its gate after the first is in. With "Land it and finish", pass --finish to every landing; the hub finishes the session once all of them are live. A project with nothing to land is left out.

Order

1. Check what the branch was for. Re-read what the person asked for in this session, the commit bodies (git log origin/main..HEAD) and, if the branch was handed over, the handover note. A branch drifts across sessions; if what you are about to land no longer matches what was asked, this is a conversation, not a merge.

2. Confirm it is finished. Nothing left stubbed, the open questions answered, the verification actually run — not merely claimed in a commit message. A wip: commit is a handover's sweep and is refused (see the handover skill).

3. Land it, in the background — the wait for the turn and the gate are part of the run:

~/.claude/skills/finish-branch/land --verify-only            # gate only, push nothing: before asking
~/.claude/skills/finish-branch/land --finish                 # land; finish the session once live
~/.claude/skills/finish-branch/land                          # land; open on the person's own word
~/.claude/skills/finish-branch/land --finish --targets +wasm # land; build the optional web client too
~/.claude/skills/finish-branch/land --hold-deploy "why"      # land; on main, not live
~/.claude/skills/finish-branch/land --deploy sim             # land, then `midas deploy sim`

--deploy is only for a target the hub does not deploy after landings (midas deploy lists which it does): those go out by themselves, once no other landing is in line, so one deploy carries every landing of the hour.

It refuses a dirty tree, a detached HEAD and a branch with a wip: commit, and otherwise:

  1. takes the turn to land at the hub (midas land take; midas land status shows the line) and keeps it until its push is done, so a landing in progress is never overtaken and its gate never tests a main that another landing has already moved;
  2. fetches main and runs the project's pre-land check, if it has one;
  3. stops when main changed a file this branch changes too (exit 4), naming the commits. Read them — git log -p as it prints — for what git cannot see: a number main took, a function it renamed, a meaning it changed. Then re-run with --seen <sha> as it says. Landings collide in ways that merge clean;
  4. rebases onto main (a conflict stops it: resolving one is a judgement about two people's work), runs the project's gate on a build node — the one this worktree holds, else the free one fastest at this gate — and records the pass at the hub (midas verified, which midas deploy asks for);
  5. holds the deploys after landings if --hold-deploy says so, pushes the branch, fast-forwards main (never forced), gives the turn back, deploys what --deploy names, and with --finish asks the hub to finish the session once the landing is live.

Keep the node you worked on: releasing it first only buys a wait.

The project's part

The gate, which nodes may run it, the pre-land check and the name of main are the project's, kept at the hub (hub.conf projects) and read with:

midas project            # all of it, for this checkout's repository
midas project --get gate

A project with no gate is refused; --allow-unverified lands without one and exists to be visible in a transcript on the person's explicit word, not to be routine. A project that needs a landing of its own keeps a finish-branch skill in its repository's .claude/skills/, which takes precedence over this one.

Follow the commit skill for any fixup commit along the way, and run this from the session's own worktree: a checkout several sessions share always has somebody's work in it.