/t-stack:tstack-merge-queuefrom t-stack
Use when you, the PM, land approved PRs in a sfora software factory: merge each only if its card says APPROVED for that head, on the head SHA's own checks with gh pr merge --match-head-commit, never while a master deploy runs (check right before each merge), batch PRs that touch generated files into one integration branch proven with git merge-tree, then confirm a deploy run exists for the merge SHA, check the live site, and write the MERGED line on the card. Skip for a PR whose card has no APPROVED line (use tstack-review), and for the live checks themselves (use tstack-verify-production).
Ships in t-stack. 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.
Every merge to master deploys, and a new merge cancels a deploy that is still running. So you land one PR at a time, only on the commit that was reviewed, and you confirm each deploy before the next merge. Green checks are not an approval. The card is.
Read the card. Merge only if it has APPROVED #n and the approval names the head you are about to merge:
sfora cat /projects/hq/board/03-in-progress/<card-file>.md --bot claude-code
Read the PR's head and state, then the check runs for that head SHA itself. Not gh pr checks, and not a status page: both can lag after a push and show an older commit's green.
gh pr view <pr> --json headRefOid,mergeable,mergeStateStatus
gh api repos/<repo>/commits/<sha>/check-runs
<repo> is owner/name, and <sha> is the headRefOid you just read. Every required run must be completed with conclusion success for that SHA. If headRefOid isn't the approved SHA, stop: the card was approved for different code. If checks were queued and then cancelled, look at mergeable before re-running anything: it usually means a conflict.
Right before this merge (not just at the start of the queue), check that no master deploy is running or queued:
gh run list --branch master --limit 5
If one is in progress, wait for it to finish. Merging now cancels it.
Merge on the approved head only. --match-head-commit makes GitHub refuse the merge if the head moved:
gh pr merge <pr> --merge --match-head-commit <sha>
Confirm a deploy run exists for the merge commit, and that it succeeded. GitHub once created no run for a merge, and nothing shipped:
gh pr view <pr> --json mergeCommit
gh run list --commit <sha>
gh run view <run-id>
Check the live site for the change (headers, the page, a real request), with tstack-verify-production.
Write the result on the card, by round-trip: MERGED as <sha>; deploy <run-id> OK; checked <what you checked>.
sfora cat /projects/hq/board/03-in-progress/<card-file>.md --bot claude-code > card.md
sfora put /projects/hq/board/03-in-progress/<card-file>.md card.md --bot claude-code
sfora cat /projects/hq/board/03-in-progress/<card-file>.md --bot claude-code
Post one line in the mission room (join it first; joining twice is harmless), then go back to step 1 for the next PR:
sfora join <room> --bot claude-code
sfora chat <room> -m "<message>" --bot claude-code
Files written by a script (the census, the design graph) conflict on every merge. Don't merge those PRs one by one, and never hand-merge a generated file:
git merge-tree --write-tree <branch> <sha> must report no conflict and print the branch's own tree (git rev-parse <branch>^{tree}): the head adds nothing the branch lacks. Then git diff --stat <base> <branch> must list only the heads' files plus the regenerated ones.The commands are in references/merge-queue.md.
APPROVED #n on the card for this head: no merge. A chat "approved" doesn't count.--match-head-commit. Never merge with --admin, and never change branch protection to get a merge through.For each PR: the card, the merged SHA, the deploy run and its result, and what you checked live. Then anything left in the queue and why it waits.
Detail: references/merge-queue.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wavyrai/sfora-skills --plugin t-stack28 skills in this plugin
/tstack-architectUse when a change is big enough that writing code first would fix the wrong shape: a new module, a new data model, a change to who owns some state, or a card whose design the owner must see. Sketch the caller's usage, the types and the signatures first, compare at least two shapes, put the chosen sketch on the card or a doc, then build against it and scrap it when it keeps fighting you. Skip for a one-file fix with an obvious shape (just build it, with tstack-tdd), and for comparing finished candidates (use tstack-arena)./tstack-arenaUse when one attempt at a non-trivial piece of work would fix the wrong shape: a contested design, an API, a tricky algorithm, a page of copy. Run two to four independent candidates on the same brief, have a separate judge score them against a written rubric, pick one as the base, graft the best parts of the others into it by hand, and verify the result. Covers the brief, the rubric, the judge and the synthesis note on the card. Skip for work with one obvious answer, and for splitting work into slices (use tstack-swarm)./tstack-benchmark-checklistUse before you report or act on a performance number you measured: a speedup or regression in a PR, a CI step's time, a job's duration, a choice between two libraries or settings. Seven questions to answer with evidence from runs: what limits it, was each side tuned, does it break physical limits, did it error, does it repeat, does it matter end to end, and did the work happen at all. Covers how to state the number on a card. Skip for numbers you didn't measure, and for finding the slow code in the first place (use tstack-how, then measure).