/agent-traffic-control:pr-plan-bucket-triage-before-sizingfrom agent-traffic-control
Before writing detailed pull request plans against a codebase you have not audited, triage it by bucket so sizes rest on findings rather than assumptions.
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.
superpowers:writing-plans produces detailed task-by-task plans with exact
file paths, LOC estimates, and TDD steps. That's the right output when you
know the codebase state — but a common failure mode is writing those
plans on assumptions about: which routes already exist, whether a colleague's
in-flight module is a stub or substantial, what storage convention links
results to runs, whether a "known defect" is still real or was quietly fixed.
You burn cycles writing detailed plans, the engineer starts implementing,
and within the first hour they discover the plan was sized against a
codebase that doesn't exist. The fix is always re-plan with the new
evidence — meaning the original plan was waste.
The cost of writing plans on speculation is asymmetric:
Use this skill when all three are true:
If any of these are absent: skip this skill. Go to writing-plans directly.
**Phase 0 = a single-day investigation that outputs a findings document
Setup (~30 min, manual). Cut a triage/<short-name> branch off the
target branch (NOT main if you're triaging someone else's active work).
Push the design doc + triage plan onto it so all relative-path links
work locally. Slack the active developer: "doing 1-day triage, won't
push anything, will share findings — flag if anything's in flux."
Define investigation buckets (in writing-plans, ~30 min). The 6 standard buckets that have worked across multiple sessions:
| Bucket | What it answers | Typical output |
|---|---|---|
| Routes & UI surface state | Which routes/templates exist? Are they wired? | file:line table of all matches |
| Existing affordances | What user-facing features already exist that overlap with the planned PR? | List of existing routes/buttons + how to extend vs replace |
| Module integration | Which modules already do the thing the PR plans to add? | Public function signatures + call graph |
| Break / defect diagnosis | Reproduce reported breaks; classify (front-end / back-end / data); size fix | Single-line root cause + S/M/L size |
| Pattern audit | Grep client-facing surfaces for jargon / debt / inconsistencies | Counts per file + reusable lint script |
| Storage / persistence convention | How are results keyed and persisted? Can the PR loader reach what it needs? | Schema + walker script |
Not every project needs all 6. Pick the buckets whose answers actually affect PR sizing. Skip the rest.
Dispatch a subagent per bucket (~3-5 hours total in parallel). Use
general-purpose subagent, NOT the formal superpowers:subagent-driven-development
loop. Investigation work doesn't fit the TDD + spec-reviewer + code-quality-reviewer
pattern — there's no "spec" beyond the bucket question, and the "code"
is markdown findings. Each subagent gets:
Skip Flask-launch and cred-requiring steps in subagent dispatch — note "skipped, requires user creds" in the findings. The user can manually validate those steps later.
Synthesise (~30 min). Dispatch a final subagent to read all the bucket verdicts and produce: TL;DR, revised PR plan (table with sized PRs + sequencing), newly-discovered risks, things-the-colleague-should-know.
Decision gate (~15 min, manual). Plan reviewer (you) reads the findings doc. Outcome is one of: (a) proceed to writing-plans for PR-A with real numbers, (b) reshape the PR sequence (e.g. a 1-char fix or schema migration becomes PR-0 because it's blocking), (c) revise the brainstorming if the triage uncovered a fundamental wrong assumption.
Single file at docs/triage/<date>-<topic>.md:
# <Topic> — triage findings
**Date / Branch / Author / Companion design**
## TL;DR
_(filled by synthesis subagent — 6-8 scannable bullets)_
## Bucket 1 — <name>
_(filled by Bucket-1 subagent with citations + verdict)_
... (Bucket N)
## Revised PR plan
_(table: PR | Title | Size LOC | Depends on | Sequencing — with concrete numbers, not ranges)_
## Newly discovered risks
_(table: Risk | Severity | Mitigation)_
## Things colleague should know
_(findings + coordination asks)_
Every bucket subagent should get this shape:
You're executing <Bucket N> of a triage plan. Investigation work, not
implementation. No production code touched.
Scene-setting:
- Repo: <name>
- CWD: <absolute path>
- Branch: <triage branch> off <target branch>. Don't switch.
- Why this triage: <one-paragraph context>
- Prior buckets done: <one-line verdict per bucket so far>
Task: <bucket-specific instructions, with explicit Step 1..N>
Step N: SKIP if cred-required, record as "skipped — requires user creds"
Step N+1: Write findings to <findings doc> using this exact template: <...>
Step N+2: Commit with message "triage(bucket-N): <one-line>"
Constraints:
- Read-only inspection
- Cite file:line for every claim
- Stay in scope — Bucket N only
- Do NOT modify any file outside the findings doc + any agreed scripts/triage/* helpers
Output format:
- Status: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
- Summary: 3-5 bullets (same as Verdict)
- Files changed: path + commit SHA
- Concerns/observations
After the triage, verify against these checks:
Every PR in the revised plan has a concrete LOC number, not a range. If you still see "150-400 LOC" anywhere, that bucket failed to produce evidence — re-dispatch.
At least one "design correction" appears in the findings. In every session this pattern has been used, triage caught ≥1 wrong assumption. If your triage produced zero corrections, you probably didn't need it — but more likely your buckets weren't pointed at the load-bearing assumptions.
Coordination asks for the active developer are concrete.
"Are signatures of X stable for next 2 weeks?" beats "Can I do this?"
The findings doc references file:line for every claim. Assertions without citations are speculation in disguise.
User wanted to scope ~4 PRs of webapp work on a branch a colleague was actively shipping for a client engagement. Brainstorm produced a design doc with:
The skill triggered on: "TBD by triage" + LOC ranges + "we assume her robustness module is a stub."
Phase 0 ran with 6 buckets in ~4 hours. Result:
| Original assumption | Triage finding | Plan delta |
|---|---|---|
| "SCA UI has 224/448-spec defect" | Defect was fixed in webapp/ci/prep.py:122; caveat is stale | PR-B collapses 400→150 LOC |
| "No download route exists" | Route exists at /runs/<id>/report but serves non-self-contained HTML | PR-A scope shifts from "build" to "make self-contained" |
| "Colleague's robustness module is a stub" | Module is substantial; UI is ALREADY wired at /sensitivity, /backtest, /permutation | PR-A robustness section drops 200→80 LOC |
| "Calendar editor broken on colleague's branch" | 1-character HTML typo at calendar.html:124, introduced by user 2 months ago, pre-existing on main | New PR-cal (<1 LOC) added; provenance correction prevented blaming the colleague |
| Storage abstraction needs 200-300 LOC | SQLite covers 3/4 result types cleanly; SCA needs a 30-LOC config_hash schema add | New PR-0 (30 LOC) unblocks clean PR-A |
Net effect: 4 wrong assumptions caught + 2 new small PRs added + every final PR has a concrete LOC number. Plan went from 4 PRs with ranges to 7 PRs with sized work, AND a sized parallel "Phase 0.5 UX triage" branch emerged from the same evidence-first pattern.
Subagent-driven-development's reviewer loop doesn't help here. The formal spec-compliance and code-quality reviewers are overkill for investigation work. The "spec" is the findings template and the "code" is markdown — a quick controller-level read after each bucket subagent reports is enough.
Skip Flask / browser / cred-required steps in subagent dispatches. Have the subagent record them as "skipped — requires user creds," and validate manually later (or in a follow-up session). Saves time and avoids BLOCKED status.
Cherry-pick the design + triage-plan docs onto the triage branch.
Otherwise relative-path links in the triage plan break locally. This
is annoying enough to call out: git cherry-pick <design-commit> <plan-commit>
after cutting the triage branch.
Reusable scripts are a free bonus. Buckets that audit patterns
(jargon density) or walk storage often produce a small bash/python
script that's worth committing under scripts/triage/ — PR-D or PR-A
can reuse it as a CI lint.
Don't skip the synthesis subagent. Reading 6 bucket verdicts and weaving them into a coherent revised PR plan is real work; the same controller that dispatched the buckets has the context loss to make this tedious. Fresh synthesis subagent reads the doc cold and produces a tighter narrative.
When NOT to use this: solo work on a codebase you touched this week; greenfield projects; bug fixes you can reproduce in 5 minutes; hot-path incident response (no time for 1-day investigation — just reproduce + fix). The pattern shines when scope is medium-to-large AND you'd otherwise be sizing on assumptions.
superpowers:writing-plans — what you do AFTER this skill runs, with
real numbers in hand.superpowers:subagent-driven-development — the formal implementation
loop. This skill is its read-only sibling for investigation.superpowers:brainstorming — what produced the speculative design
this skill audits.successor-handoff — when the synthesis output becomes the next
session's kickoff context.docs/plans/2026-05-15-<client-codename>-robustness-and-report-design.md
(design), docs/plans/2026-05-15-<client-codename>-webapp-triage-plan.md (triage
plan), docs/triage/2026-05-15-<client-codename>-webapp-state.md (findings) in
the <org>/the-causal-impact-repo repo, branch triage/<client-codename>-webapp-state.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.
workflow-parallel-fanout-omits-sequential-phases — a sequential debate/consensus process silently vanished into a parallel fan-outworkflow-deterministic-compute-as-script-not-stall-prone-agent — heavy deterministic compute stalls mid-stream in an agent turn — move it into a scriptextract-workflow-markdown-from-output-json — a large markdown deliverable came back inside a structured-output field; extract it, do not retype itflatten-workflow-parallel-arrays-before-collecting — a pipeline stage returned a bare array and the collector dropped itworkflow-schema-agent-retry-cap-oversized-payload — a schema agent that did all its work returns null — "StructuredOutput retry cap" on an oversized payloadworkflow-schema-agents-empty-loop-under-ratelimit — a workflow returns fewer results than it dispatched because agents empty-looped under a rate limitworkflow-standalone-schema-agent-crash-and-args-string — two crashes that discard every completed agent's work in a dynamic workflowWhat 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