Build, test, and dismantle a throwaway integration branch over a set of parallel PR branches without any fix living only on the integration branch. Use when the user asks to "merge everything onto an integration branch", "bring the stack up locally", or "check if the stack is ready to merge".
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Integration Branch Runbook?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/shishir10-integration-branch-runbook)
---
name: integration-branch-runbook
description: Build, test, and dismantle a throwaway integration branch over a set of parallel PR branches without any fix living only on the integration branch. Use when the user asks to "merge everything onto an integration branch", "bring the stack up locally", or "check if the stack is ready to merge".
---
# integration-branch-runbook
Read `sous.config.md`. The integration branch is a TEST FIXTURE. It is never
merged, never pushed as a PR, and must carry zero commits of its own.
Also read `${CLAUDE_SKILL_DIR}/../sous-rules/parallel-work-contract.md` and `${CLAUDE_SKILL_DIR}/../sous-rules/branch-and-worktree-hygiene.md`.
*Example incident (replace with your own):* three fixes committed on a local integration branch never reached the
PR branches; the stack "looked green", CI waits were skipped on the owner's
word, and the merge to main broke typecheck mid-way.
## Build
```bash
git -C <repo> worktree add -b integration/<feature> <scratch>/wt-integ <foundation-sha>
cd <scratch>/wt-integ && <install --frozen-lockfile>
for b in <intent branches in plan order>; do git merge --no-ff --no-edit "$b"; done
```
Conflicts: resolve on the OWNING intent branch (its own worktree), commit
there, come back and re-merge. If a conflict reveals a defect, same rule.
## Gate
Run the config's gates on the integration tree, then the full e2e suite.
Record which failures also fail on a clean checkout of the base; those are
pre-existing and listed separately.
## The check that makes it a fixture (run before saying "green")
```bash
git log --no-merges --format='%h %s' integration/<feature> --not origin/<default> <every intent branch>
```
Must print nothing. Anything it prints is a fix that exists only here; move
it to the owning branch (`git cherry-pick` there, then `git merge` again).
Also `git show --remerge-diff <merge-commit>` on each merge commit: a
non-empty remerge diff is a conflict resolution that the PR branch alone
does not contain; record it in that PR's body.
## Hand to the owner
- Branch name, head sha, the per-intent heads, merge order.
- The exact commands to bring the stack up locally (ports from the config).
- DB-backed suites run in ONE sequence on a fresh database; a suite that
leaves shared rows changed only fails the next suite.
- CI per PR branch: if `gh` is OK (`${CLAUDE_SKILL_DIR}/../sous-doctor/checks.md`),
paste `gh pr checks <branch>` (exit 8 = still pending); otherwise write
`CI: UNKNOWN (gh not available)` and ask the owner to check each PR's checks
page. Never write "CI green" without that output.
## Dismantle
After merge: remove the worktree by its exact recorded path, never by a
pattern.
*Example incident (replace with your own):* `git worktree list | grep agent-` once removed the owner's own worktree.
Delete the integration branch. Keep nothing of the fixture itself; `docs/specs/<ticket>/` stays (see `spec-writing`, spec drift).
## Moving a branch from a worktree
Always pass an explicit sha to `git -C <main repo> branch -f X <sha>` and verify with `git log --oneline -1 X`; a literal `HEAD` resolves in the MAIN checkout.
*Example incident (replace with your own):* `branch -f X HEAD` pointed a PR branch at the default branch.