/agent-traffic-control:large-redesign-parallel-branch-collision-auditfrom agent-traffic-control
Before a redesign, restructure or migration replaces shared templates, layouts or views, audit all unmerged branches, including client variants, releases and staging. Prevent clean merges from stranding accessibility or hotfix work that later conflicts. Run before fixing the plan. Not for two PRs racing on one scope or cosmetic restyling.
Ships in agent-traffic-control. 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.
None: SKILL.md is the whole skill.
You're about to start a large multi-PR redesign that branches from main. The branch is clean, tests are green, the plan is locked. You execute 14 PRs overnight, all merge cleanly to main.
The next day someone asks: "What about the changes on release-uk / feature/whitelabel-X / staging-customer-Y?" — and you discover that long-running branch has 10 unmerged commits, including a11y/safety hotfixes on a file (progress.html, report.html, _base.html) that your redesign has just completely rewritten with the bold-editorial markup.
Now those 10 commits can't be cherry-picked cleanly. The a11y improvements you'd want to keep (innerHTML→DOM migration, button-onclick→href fixes, focus-trap fixes) collide directly with the redesigned markup. Hand-merge required, possibly losing safety improvements if not careful.
The root cause: the redesigner audited main, not main + parallel branches.
Use this audit BEFORE starting work when all of these apply:
release-uk, client-acme)feature/whitelabel-X)If only restyling in-place (CSS class renames, no structural rewrite), the audit is less critical — git merge can usually combine the changes.
# 1. List all non-stale branches with commits ahead of main
for branch in $(git branch -r --no-merged origin/main 2>/dev/null | grep -v HEAD); do
count=$(git log --oneline origin/main..$branch 2>/dev/null | wc -l | tr -d ' ')
if [ "$count" -gt 0 ]; then
last_activity=$(git log -1 --format="%ar" $branch)
echo "$count commits ahead — $branch (last: $last_activity)"
fi
done
# 2. For each non-stale branch (last activity < 30 days), check file collisions
# with the files your redesign will touch
PLANNED_FILES="webapp/templates/progress.html webapp/templates/report.html webapp/templates/_base.html"
for branch in $(git branch -r --no-merged origin/main | grep -v HEAD); do
hits=$(git log --oneline origin/main..$branch -- $PLANNED_FILES 2>/dev/null | wc -l | tr -d ' ')
if [ "$hits" -gt 0 ]; then
echo "COLLISION RISK: $branch has $hits commits touching planned files:"
git log --oneline origin/main..$branch -- $PLANNED_FILES
fi
done
For each collision-risk branch, ask:
progress.html redesign until parallel branch lands.)The user owns this decision. Don't decide unilaterally — surface it.
Add a section to the implementation plan: "Parallel-branch awareness." List each non-stale branch, file collisions if any, and the chosen disposition.
After the redesign lands on main, run:
# Are there branches whose unmerged commits touch files we rewrote?
git log --oneline origin/main..origin/<parallel-branch> -- <files-we-rewrote>
If empty: clean — the parallel branch can be rebased onto main without manual file-level conflicts on the redesigned files.
If non-empty: the conflict resolution work was correctly anticipated and (per upfront planning) is queued for a follow-up PR.
Scenario (S75 bold-editorial redesign, real):
Worktree on worktree-redesigned-UI branching from main 1ae1c4e. Plan to redesign 13 templates including progress.html, report.html, _base.html, home.html, etc.
What was missed: release-uk branch had 10 commits ahead of main (last activity 1 week before S75 started), including:
f10b87c per-test re-run buttons modifying validate.html / progress.html JSbc913c0 progress.html a11y + innerHTML migration finish125f178 progress.html innerHTML sinks → DOM construction2410c37 decommission orphaned /permutation routeWhat happened: S75 PR #166 rewrote progress.html wholesale with bold-editorial markup. The a11y / innerHTML / DOM-construction improvements from #133 and #142 (still on release-uk) now conflict head-on. They can't be cherry-picked — they must be hand-merged into the new markup, preserving the safety improvements.
What the audit would have shown:
COLLISION RISK: origin/release-uk has 4 commits touching planned files:
f10b87c feat(report): per-test re-run buttons + /api/validation/rerun (#143)
bc913c0 fix(progress): a11y + finish innerHTML migration (#139 items 3-7) (#142)
125f178 fix(progress): migrate innerHTML sinks to DOM construction (#133) (#138)
2410c37 chore(routes): decommission orphaned /permutation route + dead helpers (#120) (#137)
The right move was to surface this in the kickoff AskUserQuestion and ask whether to:
(a) cherry-pick the 4 commits to main BEFORE starting the redesign
(b) defer progress.html / validate.html from the redesign scope
(c) accept the cost and plan a manual-merge follow-up PR
--no-merged filter excludes branches whose tips are already on main. Branches with squash-merged equivalents (different SHA, same content) will still show ahead — that's fine, the file-touch check is the actual filter.PLANNED_FILES set).pre-merge-client-variant-regression-audit (which fires when bringing a variant branch INTO main, looking for regressions to the original client). Both should run on long-running multi-branch projects.pre-merge-client-variant-regression-audit (audit BEFORE merging a variant branch into main)parallel-pr-scope-overlap-tiebreaker-delta-check (two simultaneous PRs vs one redesign on main + WIP elsewhere)flask-route-decommission-blast-radius (similar audit, but for route consumers within a single branch)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wan-huiyan/agent-traffic-control --plugin agent-traffic-control118 skills in this plugin
/agent-refusal-with-evidence-beats-literal-complianceA dispatched agent that does exactly what you asked can ship a defect you would
have stopped yourself, because it can see something at the worksite that you
could not see when you wrote the brief. Use when: (1) you are writing a brief
that prescribes a specific fix, threshold, wording or value rather than the
outcome you want; (2) an agent reports that it did not do what you asked and
you are deciding whether that is insubordination or judgement; (3) an agent
asserts "this is fine" or "not needed" with no measurement behind it; (4) you
are reviewing overnight output and want to know which decisions were checked
and which were assumed. Two halves, and both are needed: give the agent
explicit permission to satisfy the INTENT of an instruction while refusing its
letter, and REQUIRE the evidence with the refusal — what it built or measured,
what that showed, what it did instead. Evidence is the whole difference between
a refusal you can bank and one you have to re-litigate. Four agents correctly
declined an instruction in a single run; one built the suggested fix, measured
that it turned a silent safe refusal into a permanently red pipeline, and
reverted it unpushed.
/auto-merge-rearms-while-agent-live-kill-then-disarm-verify