/agent-traffic-control:subagent-pre-existing-misattributionfrom agent-traffic-control
Catch subagent reviewers misattributing test failures across the pre-existing / PR-introduced boundary — in BOTH directions. Use when: (1) a multi-task subagent-driven plan reports "N pre-existing failures, unrelated" across consecutive tasks and the count never changes, (2) an architectural / final reviewer at the end catches assertions that should have been updated 5 tasks ago, (3) an implementer reports "verified pre-existing on clean tree by running git stash" but the breaking change is already committed on the branch, (4) you're building or executing a multi-task plan with subagent reviewers that compare suite-wide pass/fail counts to a "baseline", (5) **a single code-review subagent reviewing one PR flags failures as "Critical / PR-introduced" and reasons "the PR correctly updated X but forgot the test" — without ever diffing against origin/main** (the over-flagging mirror image: the reviewer infers causation from the *current file state* and assumes your PR made a change it never made). Root cause (both directions): the reviewer never compared to mainline. `git stash` only stashes UNCOMMITTED changes — it does NOT reset to mainline; and the current file state says nothing about whether *this PR* changed it. Fix: verify the pre-existing/introduced boundary with `git diff origin/main...HEAD -- <file>` + `git show origin/main:<file>` + running the flagged tests on a real `origin/main` checkout — not by `git stash`, and not by eyeballing the working tree.
Trending skills
7-day visitors to each skill page
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, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
In subagent-driven development, each task's reviewer evaluates spec compliance + code quality for THAT task in isolation. When the implementer or reviewer runs the full suite and finds N failures, they look up whether those failures are "new from this task" or "pre-existing baseline." If they classify them wrong, the failures get carried forward as "known unrelated failures" through every subsequent task — and the final architectural reviewer is the only checkpoint that catches the misattribution.
The specific failure mode: an early task removes an item from a list (e.g., a sidebar nav entry, a collection of dashboard cards). Other test files have HARDCODED COUNT ASSERTIONS for that list (assert count == 5) that nobody notices because:
superpowers:subagent-driven-development or similargit stash or "clean tree check" as verification mechanismgit stash is Insufficientgit stash saves the working directory's uncommitted modifications and restores HEAD to a clean state. But on a feature branch where the breaking commit has already landed, the working directory IS HEAD — there's nothing to stash. The "clean tree" the stash produces is identical to the dirty tree, because the breaking change is part of HEAD itself.
$ git status # already clean — no uncommitted changes
$ git stash # "No local changes to save"
$ pytest tests/ -q # same failures as before — they're committed
$ # but reviewer reports: "verified failures pre-existing on clean tree"
The reviewer isn't lying — git stash ran and the suite ran "on the clean tree" — but that "clean tree" is the post-breaking-change branch state, not mainline.
The original pattern is under-flagging: a reviewer calls a PR-introduced
failure "pre-existing." The mirror image is over-flagging: a single
code-review subagent reviewing one PR calls a pre-existing failure
"Critical / PR-introduced." Same root cause — the reviewer never diffed
against origin/main — opposite error.
The mechanism: the reviewer reads the current file state, sees a mismatch
(e.g. _ACTIONS_COLD_OPEN_HISTORICAL["a1"]["peer"] == "~5.3-7.4%" but a test
asserts == "4.84%"), and infers "this PR updated the value and forgot
the test." It never checks whether the PR actually touched that value. If a
prior PR changed it and left the test stale, the failure predates this PR
entirely — but the reviewer's report says "Critical, PR-introduced, must fix
before merge."
Trigger signs for this variant:
code-review / feature-dev:code-reviewer subagent on one PR
(not a multi-task plan) returns a "Critical" finding phrased as "the PR
correctly updated X but didn't update the test" — note the unverified
assumption baked into "the PR updated X."git diff or git show.Don't merge on the reviewer's say-so and don't reflexively "fix" the flagged tests (that's scope creep onto a pre-existing bug). Verify the boundary first (see Solution). If the failures are pre-existing: leave them, note it in the PR test plan, and spawn a separate follow-up task for the real bug. The reviewer's other findings still stand — only the attribution was wrong.
When reporting "N failures, all pre-existing":
git fetch origin main # ensure mainline ref is current
git stash 2>/dev/null # save WIP if any
git checkout origin/main -- tests/ # restore tests dir to mainline state
pytest tests/<failing-file> -q # verify failures on actual mainline
git checkout HEAD -- tests/ # restore branch state
git diff origin/main...HEAD -- tests/<file>
If the file has changed in your branch, "pre-existing" claims need extra scrutiny.origin/main directly:
git worktree add /tmp/main-check origin/main
cd /tmp/main-check && pytest tests/<failing-file>
git worktree remove /tmp/main-check
When a subagent reports "N pre-existing failures":
git fetch origin main
diff <(pytest tests/ --co -q 2>/dev/null) <(git checkout origin/main -- tests/ && pytest tests/ --co -q 2>/dev/null)
If your plan removes items from a UI list (sidebar tabs, library cards, sub-navs, primary routes), add an explicit task step:
- [ ] Grep for hardcoded COUNT assertions on the affected list. Update both the
parametrize/fixture lists AND any `assert count == N` integer assertions.
Search: `rg "count == [0-9]" tests/ | grep -i <list_concept>`.
A claim of "pre-existing failures" is verified when:
git diff origin/main...HEAD -- <test_file> showing the file unchanged.origin/main directly (worktree, checkout, or git show origin/main:<file> extraction) and observed the same failure.In session 2026-05-06, a 12-task plan executed via subagent-driven-development for issue #272 (Drivers tab + per-value drilldown):
tests/test_loading_overlay_wiring.py lines 109 and 133 with assert count == 5 for .library-card and .library-subtab.test_loading_overlay_wiring.py.git stash'd clean tree." git stash saved nothing (no uncommitted changes); the suite ran identically.origin/main and surfaced 5 of those 8 failures as direct consequences of Task 6.Fix landed in commit 0361a582: change 5 → 4 in two places + comment refresh.
Total cost of misattribution: ~4 task cycles where reviewers didn't catch the issue + final-review cycle to surface it. Could have been caught at Task 6 review with the right verification framing.
lint-allowlist-substring-stale-after-rewrite (which covers stale STRING substring assertions); this skill covers stale NUMERIC count assertions specifically.git diff origin/main...HEAD -- <file> quick-check is sufficient for most cases. Three dots, not two — 2-dot compares tip to tip, so a file that main changed after your branch point shows as changed by you, which is the exact misattribution this skill exists to stop. (This file's own description has prescribed the 3-dot form since 1.1.0; the body said 2-dot in three places until 1.1.1.)superpowers:subagent-driven-development should require the verification ref. Consider amending the reviewer template to explicitly forbid "verified on clean tree" and require "verified vs origin/main at SHA ."0361a582 (issue #272)lint-allowlist-substring-stale-after-rewrite (string-version sibling)multi-agent-skill-silent-phase-compression (different failure mode in multi-agent orchestration)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-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.