/agent-traffic-control:merge-conflict-generated-filesfrom agent-traffic-control
The conflicting files are derived output from a generator: resolve their source, re-run it and stage the fresh result rather than hand merging the output.
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.
A project generates output files (HTML, JSON, CSS, TypeScript declarations, OpenAPI specs, etc.) from a source-of-truth input. Both branches modified the source AND committed fresh generated outputs. The merge/rebase now shows conflicts in the generated files — but hand- merging them is both futile (the generator will overwrite them) and error-prone (computed totals, sorted indexes, and aggregated summaries can't be correctly resolved by text diffing).
The key mistake to avoid: treating generated file conflicts as real conflicts requiring line-by-line resolution. They're not — they're a side effect of forgetting that the files are derived.
Apply this skill when ALL of these hold:
make docs, npm run build, openapi-generator, etc.git diff --name-only origin/main...HEAD shows the same generator SOURCE (not output) was
also modified on your branch, meaning both sides touched the source AND re-ran the generator.If only condition 4 holds — the conflicting thing is one derived NUMBER inside a file a human wrote (a stated test count, a coverage percentage, a totals row) — conditions 1–3 all fail: the conflicting file is hand-authored rather than generated output; nobody generates it; and there is no generator source for either side to have modified. The reasoning still holds and the remedy is different, because there is no generator to re-run. Skip to Variant — the derived thing is a VALUE inside a hand-authored file, below.
Common generator → output patterns:
| Generator source | Generated outputs |
|---|---|
| Tracker/roadmap Python script | docs/site/*.html, dist/roadmap.html |
| OpenAPI YAML spec | openapi.json, client/api/*.ts |
Sphinx .rst / .md | docs/_build/html/** |
Docusaurus sidebars.js | .docusaurus/, build/** |
CHANGELOG.md source blocks | CHANGELOG.html, release notes |
| Tailwind config | dist/styles.css (if committed) |
package.json scripts | dist/*.js, *.d.ts (if committed) |
| ADR index script | docs/decisions/index.md |
# Look for "generated" header comments in the conflicting files
head -3 <conflicting-file> # often says "# DO NOT EDIT — generated by ..."
# Look for generator scripts near the source files
ls docs/ # generate_*.py, build_*.sh?
cat Makefile | grep -A2 "html\|docs\|site"
# Check if output files are in .gitignore (they shouldn't be, if committed)
git check-ignore -v <conflicting-file>
For each file in the conflict set:
| File type | Action |
|---|---|
| Generator source (Python/JS/YAML input) | Hand-resolve this one carefully — it's the real conflict |
| Generated outputs (HTML/JSON/CSS derived from source) | Take either side (doesn't matter — you'll overwrite) |
| Add/add: same filename, different content | Read both; keep the richer/more complete version, OR keep both under different names if they represent genuinely different artifacts |
| Human-authored docs (README, handoffs, analysis) | Hand-merge normally |
The generator source (e.g., the Python tracker script, the OpenAPI YAML, the Sphinx .rst)
is the ONLY file where the conflict is real. Resolve it carefully:
Union semantics (append-only registers like tracker entries, ADR lists, lessons): Keep ALL entries from both sides. Order chronologically. For the same entry ID with different content on each side, keep whichever version is more complete/recent — this is often the main branch's version if a later PR updated it after your branch diverged.
Merge semantics (config files, schemas, structured data): Resolve like any other content conflict — pick the semantically correct combination.
# After manually editing the source to have both sides' content:
git add <generator-source-file>
# During a merge (merging main INTO branch):
git checkout --theirs -- <generated-output-1> <generated-output-2>
# or --ours, it doesn't matter — you'll regenerate in the next step
# During a rebase (replaying branch ONTO main):
# WARNING: --ours/--theirs are REVERSED in rebase!
# In rebase: --ours = upstream (main), --theirs = your branch being replayed
# Still doesn't matter for generated files — just pick one side
git checkout --ours -- <generated-output-1> <generated-output-2>
git add <generated-output-1> <generated-output-2>
# Run whatever command produces the output files
python3 docs/generate_website.py
# or: npm run build:docs
# or: make html
# or: openapi-generator generate ...
# or: sphinx-build docs/ docs/_build/
# The fresh outputs will replace the conflict-resolved stubs you staged in Step 4
git add <generated-output-1> <generated-output-2>
# Confirm no conflict markers anywhere
grep -rn "<<<<<<\|>>>>>>>\|=======" <generated-output-files>
# Spot-check the output: does it contain BOTH branches' contributions?
# (e.g., does the HTML contain both tracker entries? Does the JSON contain all entries?)
git status # should show "All conflicts fixed but you are still merging" (if merge)
# or let you continue the rebase
git commit -m "merge: resolve generated-file conflicts + regen from unified source"
# or: git rebase --continue
<<<<<< / ======= / >>>>>>> markers remain in any file.git diff is clean after regen).A Python script docs/generate_tracker.py produces docs/site/index.html and
docs/site/roadmap.html. Branch A added Item("id-101", ...) to the script and committed
fresh HTML. Branch B (main) added Item("id-102", ...) and also committed fresh HTML.
When Branch A merges main:
docs/generate_tracker.py — real conflict → hand-union both Item() entriesdocs/site/index.html — generated → git checkout --theirs -- docs/site/index.htmldocs/site/roadmap.html — generated → git checkout --theirs -- docs/site/roadmap.htmlpython3 docs/generate_tracker.pyindex.html now contains both id-101 AND id-102Everything above assumes a generator you can re-run. The same insight applies one level down, to a single derived NUMBER embedded in a file a human wrote — and that is exactly the case trigger condition 2 excludes, so without this section a model in a stacked rebase never loads this skill at all.
The usual shapes: a README gate table row stating how many tests a suite collects
(pytest docs → N), a coverage percentage in a badge line, an "N skills" / "N endpoints"
figure in an intro paragraph, a row count in a data dictionary. Nothing generates these.
Whoever last measured typed them in by hand.
In a stack of PRs where each one adds tests and each one edits the same counted line, the correct merged value exists on NEITHER side of the conflict:
Synthetic example across a stack of changes:
| Change | Value chosen during rebase | Final tree's measured count |
|---|---|---|
| First | 100 | 103 |
| Second | 103 | 111 |
| Third | 111 | 115 |
Each chosen value described an earlier tree. None described the final combined tree. The counts illustrate the mechanism and are not historical measurements.
# 1. During the rebase, put a literal that CANNOT be mistaken for a measurement:
# | `pytest docs` | **PENDING-REMEASURE** collected |
$EDITOR README.md
git add README.md
git rebase --continue
# 2. AFTER the rebase completes — not between two --continue steps, which would measure a
# tree that exists only mid-replay — measure the final tree, once:
pytest docs -q --co 2>&1 | tail -1
# 3. Put that number in, then prove no placeholder survived:
grep -rn "PENDING-REMEASURE" . # must be empty before you push
Why a placeholder and not "take the more recent side": a half-plausible number survives
by inertia. Nobody re-checks a value that already looks like a value, so a
wrong-but-reasonable count ships and then gets copied into the next document.
**PENDING-REMEASURE** cannot ship quietly — it fails a grep, a reviewer's eye, and often
the repo's own doc gate.
And "bigger is newer" is not a tiebreak, because the count can go DOWN. For example, a synthetic sequence might move from 90 to 96 and then to 84 after obsolete tests are removed. Tests get deleted, renamed, and moved between suites; monotonic growth is an assumption, not a property of the number.
handoff_prompt.md, CHANGELOG.v2.md) but for different purposes.
These are NOT generated files — they're real content. Rename the later-discovered one
rather than overwriting; both files represent distinct artifacts. Pre-detect with:
git ls-tree origin/main -- path/to/filename before committing.git rebase, --ours means the upstream
(main), not your branch. Always verify with git diff --cached <file> | head -5 to
confirm you got the right side before staging.synthetic-id-collision-rebase — when the conflict isn't about content but about two
branches claiming the same synthetic ID (tracker IDs, ADR numbers, migration filenames)pr-conflict-from-mid-flight-merges — broader recipe for identifying and clearing all
mid-flight conflicts across a stale PRovernight-multi-issue-implementation (its own plugin in the wan-huiyan-overnight-workflows marketplace, not here)
(overnight-workflows) — carries the
sibling rule for where a stated number comes from in the first place ("the rule survives;
the numbers do not — measure the baseline yourself, never carry a count from a document").
It says nothing about how to get through the conflict, which is what the variant above adds.These carry disable-model-invocation: true. They never appear in the skill
listing and the Skill tool refuses them, so the only way in is to open the file
with Read when one of these matches what you are looking at.
recover-from-an-async-post-commit-hook — a background post-commit hook stalls a multi-commit rebase, sweeps thousands of unrelated deletions into a git add -u amend, or makes --amend rewrite the hook's commit instead of yoursclean-merge-lands-line-guard-on-a-value-neither-branch-predicted — the no-conflict sibling: both branches re-aim the same line-number citation and the merged tree matches neitherWhat 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-verifyDisarming auto-merge on a PR whose agent is still running does not hold it —
the agent re-arms within minutes and the PR merges, because arming is a step in
the agent's brief and disarming is not an instruction to the agent at all. Use
when: (1) you want to STOP a pull request from merging that an agent opened and
armed, for review, for a rethink, or because it is landing into a queue you are
trying to drain; (2) a PR you disarmed merged anyway; (3) you are telling agents
which PRs are on hold and want the hold to be enforced rather than announced;
(4) you are about to run `gh pr merge --disable-auto` and have not decided what
to do about the agent. The order is KILL THE AGENT FIRST, THEN DISARM, THEN
VERIFY the disarm by reading `autoMergeRequest` back — a disarm you did not read
back is not a hold. The stronger form needs no ordering at all: convert the PR
to a draft with `gh pr ready --undo`. A draft cannot merge whatever any agent
does to it, so the hold survives an agent you missed, an agent that restarts,
and an agent you did not know about.
/batch-member-cites-a-path-only-a-non-member-addsYou wrote something correct that the default reader cannot reach: a batch member citing a
path only a NON-member adds, or a rule, ruling or ledger sitting on an unlanded branch.
/batch-merge-subject-is-not-evidence-a-member-landedYou are about to close, delete the branch of, or mark as landed a pull
request because a batch, roll-up or merge-train commit on the target branch
names it in the subject line, and because the member's own commits all
predate that merge by wall clock. Neither of those is evidence. A batch
branch is assembled at some moment BEFORE it merges, so anything the member
pushed after assembly is outside it, and the subject records INTENT at
assembly time rather than CONTENT at merge time. Use before closing a
member, when an ancestry check against a squashed batch says no, or when a
member's branch still shows commits ahead of the target. Compare file
content against the target branch instead, expecting exactly one legitimate
difference: the shared aggregate file every member appends to.
/check-a-stale-branch-is-not-undoing-newer-main-workA branch built on an out-of-date main is about to merge, or has merged, and may undo work
that landed since. Use when a green, conflict-free PR deletes files you never touched,
newer values or a whole redesign vanish after a sibling PR merged, rows of a shared ledger
(tracker, registry, CHANGELOG) disappear or revert, or when `git diff main...HEAD` or a
reviewer says your small PR touches dozens of files you did not change.
/ci-leg-skipping-moves-minutes-it-does-not-remove-themYou are about to propose, price or approve a CI cost saving that works by
making a job or matrix leg SKIP on pull requests — a path filter, a safe
list, a changed-files gate, an exemption list. Check first whether the
pipeline runs a complement or backstop on merge, on push, or nightly:
many do, and then the legs a pull request skipped are exactly the legs some
later run executes, so a branch that goes green once and merges bills the
same total either way and the wall clock does not move at all. Use when
pricing a filter change, when a percentage saving is quoted with no basis,
or when choosing between filtering legs and batching pull requests. The
question that separates money from bookkeeping is whether the change
removes RUNS or merely moves LEGS.