Repository navigation
Description
Surfaced while probing #1619. Not a defect in any shipped skill today — a latent regression path
with no gate on it.
The sharp edge
#1619 established, by direct probe, that a skill is refused in a worktree-isolated agent iff its
## Pre-computed context block contains a git command and has more than one precompute line.
A single git precompute line loads fine (proven: code-tidying:batch-simplify). A multi-line block
with no git loads fine (proven: knowledge:course-digest). Only the combination trips the guard,
because the harness composes all !`cmd` lines into one shell invocation.
That makes the following skills safe only by line count:
code-tidying:batch-simplifydiscovery:researchdiscovery:research-deepplanning:audit-answersplanning:designplanning:design-handoff
Each has exactly one precompute line, and that line is git-bearing.
Adding a second precompute line to any of them — however innocuous — silently moves it into the
refused set. The author gets no signal: it renders fine in a normal session, CI stays green (CI
never invokes a skill from an isolated agent), and the breakage only appears to whoever next invokes
that skill from a worktree-isolated agent.
The same edge applies in reverse to any skill remediated under #1619: re-introducing a git
precompute line alongside an existing one re-breaks it just as silently.
Proposal (needs a decision)
A scripts/-style static check, wired into CI alongside the existing skill gates
(check-skill-portability.sh, check-changed-skills.sh, …):
For each
plugins/**/SKILL.md: if the precompute block contains a git command and has more
than one!`…`line, fail with the file, the line count, and a pointer to #1619.
Cheap to implement, purely lexical, no harness invocation needed. It encodes the one rule the probe
actually established, and it is the only thing that can catch this class before merge — the
authoritative test (isolated-agent invocation) is not something CI can run.
Open question for the maintainer: gate at error severity, or warn-only until the #1619
remediation is complete across all 18 affected plugins? Erroring now would fail CI on the 43 skills
that are already in violation, so warn-first is probably the sequencing — but that is a call, and a
warn-only gate that never graduates is the failure mode this repo already tracks elsewhere.
Related
- fix(skills): worktree-isolated agents cannot invoke a skill whose pre-compute block contains a $-expansion (21 skills; NOT git — see correction comment) #1619 — the defect, the confirmed composition mechanism, and the full 49-skill sweep.
Activity
fix(session-flow): move git out of skill pre-compute so worktree-isol…
kyle-sexton commentedon Jul 27, 2026
Re-scope needed. The trigger this gate was proposed to catch is not what I described when filing.
A second precompute line is not the hazard — see the correction on #1619. The surviving rule is: a skill is refused under worktree isolation iff its pre-compute block contains a
$-expansion in any form other than bare$HOME/"$HOME". Line count and git content are both irrelevant (a single-line git-bearing block loads; a four-line git-bearing block with no$loads).So the gate this issue asks for should be:
That is a simpler and more precise check than the multi-line-plus-git rule originally proposed, and unlike that one it catches the real defect. The sequencing question in the body still stands: 21 skills are currently in violation, so warn-first is probably right before erroring.
The silent-regression concern that motivated this issue is unchanged and, if anything, sharper — adding a
${VAR}to any pre-compute block breaks the skill under isolation with no signal in a normal session and no CI coverage at all.fix(source-control): move git out of skill pre-compute so worktree-is…
fix(session-flow): remove $-expansion from pre-compute so isolated ag…
kyle-sexton commentedon Jul 27, 2026
Second re-scope — see #1687.
The gate rule I proposed in the previous comment ("fail if any pre-compute line contains a
$-expansion other than bare$HOME") would produce false positives.\,\, and\are substituted by the harness into literal paths before any shell sees them — they are$-shaped in source but never reach the guard, and skills using only them load fine under isolation (confirmed on three).A gate using my previous rule would flag
claude-config:audit-automation-gaps,prototype:pressure-test,docs-hygiene:audit-noise,source-control:commit, and others that are demonstrably working.Corrected rule for the gate:
Two open details before implementing:
$HOMEhandling is unsettled. Bare$HOMEand"$HOME"pass;\/c/Users/KyleSextonrefuses. Whether$HOMEinside a longer quoted string passes is being probed now and is load-bearing — merged code depends on it.A trailing
$before a quote (e.g.grep '\.md$') must not be flagged;docs-hygiene:audit-noisecarries one and loads fine.kyle-sexton commentedon Jul 27, 2026
The comment immediately above is mangled — a shell-escaping accident stripped the variable names
out of it, leaving empty backticks. Ignore it; this is the intended text.
Second re-scope — see #1687
The gate rule I proposed earlier ("fail if any pre-compute line contains a
$-expansion other thanbare
$HOME") would produce false positives.The three harness-substituted plugin variables —
CLAUDE_PLUGIN_ROOT,CLAUDE_PLUGIN_DATA,CLAUDE_SKILL_DIR— are replaced with literal paths before any shell sees them. They are$-shaped in source but never reach the guard, and skills whose pre-compute uses only them load fineunder isolation (confirmed on three).
A gate using my previous rule would flag
claude-config:audit-automation-gaps,prototype:pressure-test,docs-hygiene:audit-noise, andsource-control:commit— alldemonstrably working.
Corrected rule for the gate
Two open details before implementing
Others may exist — check the plugins-reference rather than assuming.
$HOMEhandling is unsettled. Bare$HOMEand"$HOME"pass; the braced form refuses.Whether
$HOMEinside a longer quoted string passes is being probed now and is load-bearing —merged code in
session-flow:find-handoffdepends on the answer.One exclusion the gate must get right
A trailing
$before a closing quote — as in a regex anchor likegrep '\.md$'— is not anexpansion and must not be flagged.
docs-hygiene:audit-noisecarries one and loads fine.Stated narrowly: that observation is equally explained by a lexical rule (
$not followed by anidentifier character or
{) as by real shell parsing. Do not build the gate on an assumption thatthe guard parses shell.
kyle-sexton commentedon Jul 27, 2026
This was generated by AI (triage lane — gate-audit claim). Claiming this item for one gate-audit cycle: an independent panel re-classifies whether the
needs-human/status: needs-decisiongate is still warranted, or whether the item is C2/C3 and liftable toagent-ready. Outcome comment follows in this cycle.kyle-sexton commentedon Jul 27, 2026
This was generated by AI (triage lane — gate audit). Independent panel: two fresh-context agents (one
fable, oneopus), each given only the issue content and the repo's ownplugins/autonomy/reference/guardrails/work-classes.md, plus the triage lane's own read. This lane never executes work items, authors fixes, or merges.Gate audit: GATE UPHELD — detection rule not final, plus an open severity call
Panel: 2-of-2 STAYS-GATED, both C3. Lane read concurs. (This item carries
status: needs-decisiononly, notneeds-human.)Two independent blockers, both in the issue's own words:
$HOME$-expansion, then$-expansion excluding harness-substituted plugin variables), and the latest comment leaves two load-bearing unknowns open: "Is the plugin-variable list exactly those three?" and "$HOMEhandling is unsettled … being probed now and is load-bearing — merged code insession-flow:find-handoffdepends on the answer."Implementing before the
$HOMEprobe lands risks a gate that flags demonstrably-working skills — the exact false-positive failure the second re-scope already caught once.Decision required
Ship the pre-compute
$-expansion gate at error severity now, or warn-only until remediation completes?RECOMMENDED — warn-only at launch, with a hard graduation trigger recorded in the same PR: severity flips to error when the violating-skill count reaches zero, tracked on #1619. This avoids red-lining CI on ~21 known violations while directly addressing the issue's own stated worry that "a warn-only gate that never graduates is the failure mode this repo already tracks elsewhere" — the trigger is what makes warn-first safe rather than permanent.
Alternative — error immediately with a checked-in baseline allowlist of the 21 current violators that may only shrink (the
scripts/*-baseline.txtpattern already exists in this repo). Stricter and self-enforcing, at the cost of a second file to keep in sync.Sequencing constraint either way: the
$HOME-in-quoted-string probe must land first — the lexical rule depends on its answer, andsession-flow:find-handoffalready depends on the behaviour.kyle-sexton commentedon Jul 27, 2026
This was generated by AI (triage lane — claim release). Gate-audit cycle complete for this item; the triage claim posted earlier this cycle is released. No lease is held — another instance or lane may pick this up immediately. The outcome comment above this one carries the classification and either the lift rationale or the decision summary.