/agent-traffic-control:inherited-scope-doc-names-may-not-existfrom agent-traffic-control
A scope or plan doc from a prior session references dataset paths, table and column names that may not exist. Verify every `project.dataset.table` and column name exists, with a fast schema probe, before a multi hour dispatch of parallel subagents or batch jobs. NOT enum VALUES.
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.
Scope docs and plan docs authored by predecessor sessions routinely cite specific BigQuery paths, table names, and column names as if they were verified facts. Often they're not — authors write from memory, from stale schema snapshots, or from hypothetical schemas that never landed. When you mechanically copy those references into 7 parallel agent prompts and fire them against production data, you burn the entire wallclock window discovering the errors one at a time, mid-run.
The failure mode is costly because:
target_2025 looks like exactly the kind
of column name a training-features table would have. analytics.predictions_daily.predictions_daily
looks like a sensible namespaced path. Both are wrong. Obviously-wrong paths (typos) fail
loudly; plausible-wrong paths fail slowly inside agents.evt_* family" or "the engagement_* columns" when the actual warehouse
naming has no prefix at all (e.g., page_visit_8_30d, login_1d).bq ls + INFORMATION_SCHEMA.COLUMNS
probe costs <$1 and surfaces 100% of path/name errors before firing. Skipping it costs
a full overnight window.Use this skill when ALL of:
ALSO use when ANY of:
project.dataset.table), table names, or
column names verbatim.evt_* columns",
"engagement features", "SHAP rollups") without quoting actual column names.DESCRIBE or INFORMATION_SCHEMA.COLUMNS against it.Run ALL of these before firing anything. Budget: ~$1 BQ, ~5 minutes.
bq ls the project — verify dataset namesbq ls --max_results=100 <project>:
Look for the dataset(s) the scope doc references. If the scope says
project.foo_daily.foo_daily (namespaced), check whether foo_daily exists as a dataset
AND whether the same name exists as a table inside some other dataset. Common failure:
scope treats the project-level path as the dataset when actually the dataset is something
different (ml_predictions.predictions_daily vs fictional predictions_daily.predictions_daily).
bq ls each dataset — verify table namesbq ls --max_results=50 <project>:<dataset>
Confirm the exact table names. Watch for: version suffixes (_v2, _enriched, _daily
vs. singular), archived-vs-live (_archive, _deprecated), partition hints in the table
name.
INFORMATION_SCHEMA.COLUMNS — verify column names and typesFor each table you'll query:
SELECT column_name, data_type
FROM `<project>.<dataset>.INFORMATION_SCHEMA.COLUMNS`
WHERE table_name = '<table>'
ORDER BY ordinal_position
Redirect to a file and grep for the exact names the scope doc uses. If the scope says
"column target_2025" — grep for it. If not found, widen: grep -i target and
see what the actual naming is.
If the scope describes a column family by prefix ("the evt_* family has ~60 columns"),
run:
SELECT COUNT(*)
FROM `<project>.<dataset>.INFORMATION_SCHEMA.COLUMNS`
WHERE table_name = '<table>'
AND column_name LIKE 'evt_%' -- whatever prefix the scope claims
If the count is 0 or nowhere near the claimed count, the prefix assumption is wrong. Run an open-ended list of actual column names to see the real naming convention.
Write state/phase_0_probe_results.md (or equivalent) with, per-table:
This is the artefact future sessions (and reviewers) will trust instead of the scope doc for these facts.
The structural probe (steps 1-4) verifies that paths/tables/columns exist. A different failure mode survives that probe: scope docs that supply human-readable labels for codes/enums whose values DO exist in the warehouse but whose meanings have been guessed from memory. Value-coverage probes pass 100% (the codes are real) but the labels are fabricated, and they ship into client-facing UI strings, dropdown labels, and SQL CASE branches.
This step blocks dispatch when any unverified code-legend table appears in the scope doc, track prompts, or orchestrator prompt. No escape hatch — multi-hour, $50+ dispatches don't get to skip this; the friction of resolving the tags is rounding error vs. a wrong-label run.
# For each track prompt + the orchestrator prompt + the scope doc:
for f in <scope.md> <orchestrator-prompt.md> <track-prompts/*.md>; do
python3 <path-to>/session-handoff/scripts/label_audit.py \
--strict --repo-root "$(git rev-parse --show-toplevel)" "$f" || exit 1
done
Strict-mode behavior (vs. the loose mode used by the session-handoff Phase 0 pass):
status, code, category, enum, stage,
bucket, tier, type, class, flag, kind, level (singular and
plural variants, case-insensitive). Strict mode trades a small chance of
false negatives for substantially fewer false positives during multi-track
dispatch authoring.label-audit-skipped: frontmatter escape hatch — strict mode
ignores it entirely.[verified: <repo-rel-path>:<line>] tag
is resolved via git show HEAD:<file> against the live repo. If the file
has moved, the line has shifted past EOF, or the path no longer exists at
HEAD, dispatch is blocked with "stale citation — re-verify and update tag."Required tag formats:
[verified: <repo-relative-path>:<line>] — citation to authoritative source
(vendor doc, INFORMATION_SCHEMA result, internal data dictionary)[HYPOTHESIS] — explicit acknowledgment that the label is a guess; the
receiving session re-probes before relying on itExit codes: 0 (clean), 1 (blocking — untagged or stale citation). No "skipped" status in strict mode.
Why this is separate from the steps above. Steps 1-4 cover STRUCTURE (does this column exist?). This step covers SEMANTICS (does this label match the source-system meaning?). A scope doc can pass the structural probe and still ship a "Status code legend" where every label is wrong. The worked example that motivated this gate: a scope doc passed the full structural probe (every status code in the legend was a real value present in the warehouse) yet every human-readable label paired with those codes had been guessed from memory and was wrong — and those labels were headed straight into client-facing UI strings.
Either:
was X, corrected to Y per probe on YYYY-MM-DD), and regenerate any scaffolding that
embedded the wrong value.session_N_prompt.md) that the dispatching
session will read alongside the scope doc.Either way, do NOT dispatch with the wrong values still in any agent prompt.
After probing, you should have:
A good proxy for "done": a lightweight end-to-end smoke query — SELECT COUNT(*) FROM <full.corrected.path> WHERE <filter> against one panel — runs cleanly and returns a
plausible count.
Scenario: a predictive-scoring project. A predecessor session authored a v6 scope doc claiming:
analytics.predictions_daily.predictions_dailytarget_2025evt_* prefix patternProbe:
bq ls --max_results=100 analytics:
# → lists 16 datasets; NO dataset called `predictions_daily`
# → DOES have `ml_predictions`
bq ls --max_results=30 analytics:ml_predictions
# → includes `predictions_daily` (partitioned by scoring_date)
# → Correct path is ml_predictions.predictions_daily
bq query --use_legacy_sql=false "SELECT column_name FROM \`analytics.ml_features.INFORMATION_SCHEMA.COLUMNS\` WHERE table_name='v10_feature_matrix' AND column_name LIKE '%target%'"
# → Returns target_segment_a, target_segment_b, target_segment_c
# → NOT target_2025 (doesn't exist)
bq query --use_legacy_sql=false "SELECT COUNT(*) FROM \`analytics.ml_features.INFORMATION_SCHEMA.COLUMNS\` WHERE table_name='v10_feature_matrix' AND column_name LIKE 'evt_%'"
# → 0 rows
# → evt_* prefix assumption wrong; actual pattern is {event_type}_{window}d
Result: 3 corrections surfaced in ~5 min at <$1 BQ. Had 7 parallel agents fired with the scope-doc paths, all 7 would have tapped out on first bq query.
status column that exists but whose enum is {new,won,lost} where the
plan assumed {open,closed} passes this probe cleanly. Verify values separately.
(The frontmatter description used to end by routing to a sibling skill,
verify-plan-constants-against-data. No such skill exists in this repo or any installed
bundle, so the redirect gave the model nothing to route to — and the description is text
the model reads every turn. The distinction is kept, the dead name is out of the
description. It is left in "See also" below, where it sits alongside other references to
unpublished siblings; that is a repo-wide convention, not something to fix one line at a
time.)bq ls shows the
current truth.peer-cited-platform-limit-may-be-a-conflation
— the same shape where the inherited claim is a PLATFORM LIMIT a coordinator
states as fact ("the provider's ceiling forbids N workers"), and it is their own
conflation of two quantities that share a number in today's configuration.
Settled the same way: ask for the source while offering to adopt their wording
if it exists, or let the platform accept the configuration and answer it for you.injected-claude-md-is-the-worktrees-copy-not-mains — the same principle where the inherited artefact is the project's RULES rather than a scope doc. A session running in a long-lived worktree is handed that worktree's CLAUDE.md at start, so the house rules in context can be weeks retired, and there is no moment at which you chose to trust them. Verify with git show origin/main:CLAUDE.md before asserting what the file says.INFORMATION_SCHEMA reference: https://cloud.google.com/bigquery/docs/information-schema-introbq ls command reference: https://cloud.google.com/bigquery/docs/bq-command-line-tool#listing-datasetsWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
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.