Skip to content

v1.91.157.0 perf(gen-skill-docs): drop the "When to invoke" body section from Claude SKILL.md files (port of #3129) - #3305

Merged
capy-ai[bot] merged 10 commits into
mainfrom
crew/port-3129-when-to-invoke
Oct 19, 2026
Merged

capy-ai[bot] merged 10 commits into
mainfrom
crew/port-3129-when-to-invoke

Conversation

@garrytan

Copy link
Copy Markdown
Owner

Ports #3129 by @thanhnguyentung95 onto a crew branch so it can run the paid gate with secrets. The six commits are cherry-picks with the contributor as author. Two follow-up test commits fix what the port broke.

What changes

Every Claude SKILL.md used to open its body with ## When to invoke this skill, which holds the routing prose ("Use when asked to…", "Proactively invoke…", voice triggers). Claude Code picks a skill from its frontmatter name and description only, and loads the body after the Skill tool has already run, so that section routed nothing. It only added tokens to every invocation.

  • applyCatalogTrim no longer emits the section. The routing prose stays in each template's description, so --catalog-mode=full and the other hosts render as before.
  • Voice triggers move to the root router's routing block for Claude: one - Voice trigger "…" → invoke /<skill> line per skill (21 lines), built by a new {{VOICE_TRIGGER_ROUTING}} resolver. disabled_skills drops them like any other routing line.
  • Across 56 Claude SKILL.md files: about 23 KB less per invocation in total. The context budget drops 54 ceilings and raises only gstack (4289→4821, the voice lines), a net −5,139 tokens.

Nothing Claude sees before it invokes a skill changes: the trimmed catalog description, the ## Skill routing block in CLAUDE.md, and the frontmatter are all as before.

Follow-ups on top of the contributor's commits

  • test/gen-skill-docs.test.ts:4456: the new voice-routing test counted the connect-chrome → open-gstack-browser alias symlink as a skill. It now skips symlinks the way discoverTemplates does (486/1 → 487/0).
  • test/fixtures/context-budget.json: devex-review (20161) and eval-plan (9811) keep their old ceilings. The wholesale recapture had raised them, and this PR doesn't touch either skill.
  • scripts/harness-version.json: records the test/helpers/skill-fixture.ts change as non-behavioral, so HARNESS_VERSION stays 6. The fixture only drops a heading the generator no longer emits; extraction would throw without the change. The affected cases' new SKILL.md bytes already start their own series.
  • test/helpers/manual-judge-review-fixture.ts: one LATER_WAVE_EDITS entry puts the dropped section back when the historical cookie-workflow approval is rebuilt, so its hash still matches the approved 7f7f76…. The approval file is unchanged. v1.91.150.0 test(evals): re-pin older paid models to the current generation; prosons and cookie-judge repairs (GSTA-49 TM3) #3293 edits the same file about 8 lines lower. Both merge cleanly, but whichever lands second should re-run test/cookie-workflow-manual-review.test.ts.

Gate integrity

Every un-pin follows from the removed output. The full list of gate edits is also in the CHANGELOG entry:

  • catalog-trim: 3 tests for the deleted buildWhenToInvokeSection are removed, and the applyCatalogTrim assertions are inverted.
  • catalog-mode-full: 1 assertion flipped, 2 dropped.
  • cso-preserved: 1 assertion dropped.
  • gen-skill-docs: the benchmark routing and CSO voice tests now read the template; one new voice-routing test.
  • skill-validation: the trigger and proactive phrase checks now read SKILL.md.tmpl.
  • parity-harness: mustHaveHeadings drops the heading.
  • skill-fixture and skill-e2e-retro: the heading is gone from the section lists.
  • The claude ship golden is refreshed, and the claude/design-review size pin is lowered by 437 chars.

No threshold, trial count or case kind changed, and only the gstack budget ceiling rises.

Validation

  • Routing gate (paid, Opus 5.5, one trial each, all PASS, $0.74 total): journey-ideation, journey-plan-eng, journey-debug, journey-qa, journey-code-review, journey-ship, journey-docs, journey-retro, journey-design-system, journey-visual-qa, journey-negatives, context-save-routing. These ran at f5d982a. ce59a32 changes nothing these cases read, so the results carry over as reused evidence.

  • Focused tests:

    • catalog-trim 23, catalog-mode-full 7, catalog-budget 3, cso-preserved 10
    • gen-skill-docs 487, skill-validation 336
    • parity-suite 2, parity-sectioned 7, parity-baseline-integrity 9, skill-fixture 57
    • context-budget-ratchet 7, skill-md-size-guard 2, skill-size-budget 5, claude-md-size 2
    • host-config 103, module-size-ratchet 6, spawnsync-timeout-tripwire 3, routing-probe 7
    • template-context-parity 5, test-value-bar 32, harness-version 9
    • cookie-workflow-manual-review 27, ci-paid-coordination 16

    All pass, 0 fail. gen:skill-docs --dry-run reports 0 stale files and typecheck is clean.

  • Pregate: preflight passes 6/6. Remote free tier: 17,226 tests, 0 failed, $0.10. The first remote run caught the 3 failures the follow-up commit fixes. test/gstack-ff-update.test.ts failed once and passed on the serial retry; it is unrelated to this diff.

Overlaps: design-review/SKILL.md with #3284, which merges cleanly but needs a size-guard re-pin by whichever lands second, and setup-browser-cookies/SKILL.md with #3293, which merges cleanly.

CHANGELOG entry is under [Unreleased]. Unstamped.

Open in Capy

thanhnguyentung95 and others added 8 commits October 19, 2026 18:36
The Claude catalog trim moved each skill's routing prose ("Use when...",
"Proactively invoke...", voice triggers) out of the frontmatter description
into a "## When to invoke this skill" section at the top of the body. Claude
Code reads only name + description to choose a skill and loads the body after
the skill is invoked, so that text cannot route anything and costs tokens on
every invocation. Keep the one-line trimmed description; drop the section.

The routing prose stays in each template's description, which
--catalog-mode=full and the other hosts still render. Tests that pinned the
section now assert its absence, or check the template instead.

(cherry picked from commit 707ccd6)
The Claude catalog trim drops each skill's "Voice triggers (speech-to-text
aliases)" line from its description, and the body section that used to hold
it is gone. {{VOICE_TRIGGER_ROUTING}} renders them in the root router's
routing block instead: one "Voice trigger ... → invoke /<skill>" line per
skill, read from the templates' voice-triggers lists, so disabled-skill
filtering applies to them like any other routing line. Other hosts keep the
line in each description and render nothing here.

extractVoiceTriggers moves to the new resolver so the generator and the
resolver share one parser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 645e75b)
Output of `bun run gen:skill-docs --host all` after the previous commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ff4c813)
`bun test/helpers/capture-context-budget.ts`. Against a recapture of the base
commit, 55 skills that lost the section get a lower ceiling and the root
gstack router rises by 532 tokens for the voice-trigger routing lines (5,369
tokens lower in total). devex-review and eval-plan differ from the committed
fixture only because it already lagged main. alwaysOnTotal is unchanged: the
catalog descriptions did not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d886fce)
…tion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f1789dc)
The size guard (#3199) asks for it: claude/design-review shrank by 437 chars
without its "When to invoke" section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 3a446fc)
…budget ceilings, add #3129 CHANGELOG entry

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…, record the skill-fixture change as non-behavioral

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

E2E Evals: ❌ FAIL

[test:paid] VERDICT RED — lane gate/pr, attempt 1
  rule 107/108 · behavior 0/0 · judge 24/24 · quarantined 0 (0 failing the lane)
  SKIPPED 0 · INFRA 0 · INCOMPLETE 0 · unattributed 0 · ACTION REQUIRED 2
  wall 6m43s · cost $32.58 known + 54 of 132 trial(s) cost unknown

121 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $32.58 rule/judge cost | reconcile exit: 1

Profile: pr / mode full-fallback; selected behaviors: 108, judges: 24. Deferred to scheduled/release coverage: 139 behaviors and 17 changed prompt files. Deferred checks did not run and receive no PR-pass credit.

Derived dependents (scripts/pr-dependencies.ts):

  • scripts/harness-version.json: 246 case(s), 24 judge(s)
  • scripts/resolvers/voice-triggers.ts: 246 case(s), 24 judge(s)
Rule and judge shards
Shard Automated result Manual/unscored Executed Reused Status Cost
e2e-deploy/skill-e2e-deploy--setup-deploy-workflow 1/1 0 1 0 ✅ $0.1
e2e/skill-e2e-coverage-audit 2/2 0 2 0 ✅ $0.25
llm-judge/skill-llm-eval 24/24 0 24 0 ✅ $1.44
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-current 1/1 0 1 0 ✅ $0.96
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-store 1/1 0 1 0 ✅ $1.13
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-completion 1/1 0 1 0 ✅ $1.02
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-plan-checks 1/1 0 1 0 ✅ $0.77
e2e/skill-e2e-test-value 3/3 0 3 0 ✅ $0.69
e2e-qa-callers/skill-e2e-qa-callers--review-exploratory-small-cli 1/1 0 1 0 ✅ $0.71
e2e-qa-workflow/skill-e2e-qa-workflow--qa-only-no-fix 0/1 0 1 0 ❌ $0.56
e2e/skill-e2e-shared-libs--shared-libs-read-only 1/1 0 1 0 ✅ $0.25
e2e-docsync-spawned/skill-e2e-docsync-spawned 1/1 0 1 0 ✅ $0.44
e2e-deploy/skill-e2e-deploy--land-and-deploy-first-run 1/1 0 1 0 ✅ $0.38
e2e-deploy/skill-e2e-deploy--land-and-deploy-review-gate 1/1 0 1 0 ✅ $0.23
e2e-review-army/skill-e2e-review-army--review-army-migration-safety 1/1 0 1 0 ✅ $0.27
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-stale-after 1/1 0 1 0 ✅ $0.35
e2e-learnings/skill-e2e-learnings 1/1 0 1 0 ✅ $0.07
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-late-result 1/1 0 1 0 ✅ $0.34
e2e-review-army/skill-e2e-review-army--review-army-json-findings 1/1 0 1 0 ✅ $0.07
e2e-deploy/skill-e2e-deploy--benchmark-workflow 1/1 0 1 0 ✅ $0.25
e2e/skill-e2e-investigate-owned-completion 1/1 0 1 0 ✅ $0.07
e2e/skill-e2e-shared-libs-paths--shared-libs-review-index-flags 1/1 0 1 0 ✅ $1
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-small-cli 1/1 0 1 0 ✅ $0.89
e2e-review-army/skill-e2e-review-army--review-army-perf-n-plus-one 1/1 0 1 0 ✅ $0.33
e2e-triage/skill-e2e-triage 1/1 0 1 0 ✅ $0.09
e2e-qa-workflow/skill-e2e-qa-workflow--qa-bootstrap 1/1 0 1 0 ✅ $0.08
e2e-third-party-actions/skill-e2e-third-party-actions 5/5 0 5 0 ✅ $0.43
e2e-design/skill-e2e-design--plan-design-review-no-ui-scope 1/1 0 1 0 ✅ $0.08
e2e-deploy/skill-e2e-deploy--canary-workflow 1/1 0 1 0 ✅ $0.11
e2e/skill-e2e-investigate-owned-termination 2/2 0 2 0 ✅ $0.18
e2e/skill-e2e-ship-hook-consent 2/2 0 2 0 ✅ $0.25
e2e-review-army/skill-e2e-review-army--review-army-delivery-audit 1/1 0 1 0 ✅ $0.14
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-timeout-unsettled 1/1 0 1 0 ✅ $0.17
e2e-session-intelligence/skill-e2e-session-intelligence 4/4 0 4 0 ✅ $0.29
e2e-design/skill-e2e-design--design-review-detector-shim 1/1 0 1 0 ✅ $0.13
e2e-plan-tune/skill-e2e-plan-tune 1/1 0 1 0 ✅ $0.13
e2e-safety-pair-agent/skill-e2e-safety-pair-agent 1/1 0 1 0 ✅ $0.1
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-launch-failure 1/1 0 1 0 ✅ $0.15
e2e/skill-e2e-ship-hook-refresh 1/1 0 1 0 ✅ $0.1
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-unavailable 1/1 0 1 0 ✅ $0.68
e2e/skill-e2e-plan--plan-review-report 1/1 0 1 0 ✅ $1.33
e2e-retro/skill-e2e-retro 1/1 0 1 0 ✅ $0.32
e2e-qa-functional-fix/skill-e2e-qa-functional-fix 2/2 0 2 0 ✅ $0.94
e2e/skill-e2e-ship-skip 1/1 0 1 0 ✅ $0.23
e2e-qa-workflow/skill-e2e-qa-workflow--qa-quick 1/1 0 1 0 ✅ $0.45
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-stale-before 1/1 0 1 0 ✅ $0.36
e2e-review-attribution/skill-e2e-review-attribution 3/3 0 3 0 ✅ $0.28
e2e/skill-e2e-shared-libs-paths--shared-libs-review-prior-coverage 1/1 0 1 0 ✅ $0.92
e2e/skill-e2e-shared-libs--shared-libs-review-lifecycle 1/1 0 1 0 ✅ $0.9
e2e-safety-codex-consult/skill-e2e-safety-codex-consult 1/1 0 1 0 ✅ $0.27
e2e-deploy/skill-e2e-deploy--land-and-deploy-workflow 1/1 0 1 0 ✅ $0.57
e2e/skill-e2e-workflow 4/4 0 4 0 ✅ $0.94
e2e-review-army/skill-e2e-review-army--review-army-quality-score 1/1 0 1 0 ✅ $0.1
e2e-hermetic/skill-e2e-hermetic-canary 2/2 0 2 0 ✅ $0.03
e2e-browse/skill-e2e-bws 6/6 0 6 0 ✅ $0.29
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-missing-asset 1/1 0 1 0 ✅ $0.41
e2e-design/skill-e2e-design--design-review-plugin-handoff 1/1 0 1 0 ✅ $0.14
e2e-design/skill-e2e-design--design-review-detector-shim-dom 1/1 0 1 0 ✅ $0.24
e2e-safety-ship-evidence/skill-e2e-safety-ship-evidence 1/1 0 1 0 ✅ $0.12
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-missing-marker 1/1 0 1 0 ✅ $0.15
e2e/skill-e2e-shared-libs--shared-libs-unsupported-git 1/1 0 1 0 ✅ $0.18
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-recovery 1/1 0 1 0 ✅ $0.35
e2e-review/skill-e2e-review 2/2 0 2 0 ✅ $0.37
e2e/skill-e2e-shared-libs--shared-libs-review-revalidation 1/1 0 1 0 ✅ $1.84
e2e-qa-functional/skill-e2e-qa-functional 2/2 0 2 0 ✅ $0.78
e2e-cso/skill-e2e-cso 1/1 0 1 0 ✅ $0.39
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-late-input 1/1 0 1 0 ✅ $0.94
e2e-skillify/skill-e2e-skillify 3/3 0 3 0 ✅ $0.9
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-failure 1/1 0 1 0 ✅ $0.68
e2e/skill-e2e-shared-libs-paths--shared-libs-review-path-eligibility 1/1 0 1 0 ✅ $1.48
Fail-closed reconciliation
skill-e2e-hermetic-canary.test.ts
  slice 14  passed             50s  test/skill-e2e-third-party-actions.test.ts
  slice 14  passed             25s  test/skill-e2e-plan-tune.test.ts
  slice 14  passed             18s  test/skill-e2e-triage.test.ts
  slice 14  passed             32s  test/skill-e2e-ship-docsync.test.ts#ship-docsync-timeout-unsettled
  slice 14  passed             32s  test/skill-e2e-ask-user-question-format-compliance.test.ts
  slice 14  passed             27s  test/skill-e2e-ship-docsync.test.ts#ship-docsync-launch-failure
  slice 14  passed             28s  test/skill-e2e-session-intelligence.test.ts
  slice 14  passed             33s  test/skill-e2e-ship-hook-consent.test.ts
  slice 14  passed             24s  test/skill-e2e-investigate-owned-termination.test.ts
  slice 14  passed             30s  test/skill-e2e-design.test.ts#design-review-detector-shim
  slice 14  passed             24s  test/skill-e2e-deploy.test.ts#canary-workflow
  slice 14  passed             32s  test/skill-e2e-ship-hook-refresh.test.ts
  slice 14  passed             17s  test/skill-e2e-design.test.ts#plan-design-review-no-ui-scope
  slice 14  passed             29s  test/skill-e2e-review-army.test.ts#review-army-delivery-audit
  slice 14  passed             28s  test/skill-e2e-safety-pair-agent.test.ts
  slice 14  passed             21s  test/skill-e2e-qa-workflow.test.ts#qa-bootstrap
  slice 15  passed             12s  test/skill-e2e-learnings.test.ts
  slice 15  passed             13s  test/skill-e2e-diagram.test.ts
[test:paid] collector final outcomes: 121 executed, 0 reused; 120 passed, 1 failed, 0 manual accepted (unscored; no score-cache credit) (121 attempt records from 70 collectors; every record counts)
[test:paid] deselected testcases, zero credit (312):
[test:paid]    298  sibling case of a case shard (its own shard runs it)
[test:paid]      8  periodic-tier case (this lane runs gate)
[test:paid]      6  Bun hook placeholder of a skipped describe block (not a test)
[test:paid] VERDICT RED — lane gate/pr, attempt 1
  rule 107/108 · behavior 0/0 · judge 24/24 · quarantined 0 (0 failing the lane)
  SKIPPED 0 · INFRA 0 · INCOMPLETE 0 · unattributed 0 · ACTION REQUIRED 2
  wall 6m43s · cost $32.58 known + 54 of 132 trial(s) cost unknown
[test:paid] failures and split verdicts:
  ✗ qa-only-no-fix  rule  FAIL  assertion — QA deadline: unsupported outer shell composition  · cause assertion  [slice 8, attempt 1]  evidence: paid-slice-8-a1/shards/skill-e2e-qa-workflow--qa-only-no-fix (fetch: bun run eval:pass-rates --run 39332134395 --case qa-only-no-fix)  after a repair: bun run scripts/test-paid-shards.ts --tier gate --case qa-only-no-fix
[test:paid] exercised-path map (shadow, non-blocking): 7 MAP_GAP line(s) over 101 executed case(s) with recorded commands
  MAP_GAP document-release bin/gstack-banned-terms: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP plan-review-report bin/gstack-plan-reality: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP plan-review-report browse/dist/browse: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP plan-review-report design/dist/design: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP review-army-migration-safety bin/gstack-approval-classes: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP shared-libs-review-revalidation bin/gstack-approval-classes: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP test-audit-report-only design/dist/design: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)

Sliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry.

Failures and split verdicts

✗ qa-only-no-fix  rule  FAIL  assertion — QA deadline: unsupported outer shell composition  · cause assertion  [slice 8, attempt 1]  evidence: paid-slice-8-a1/shards/skill-e2e-qa-workflow--qa-only-no-fix (fetch: bun run eval:pass-rates --run 39332134395 --case qa-only-no-fix)  after a repair: bun run scripts/test-paid-shards.ts --tier gate --case qa-only-no-fix

garrytan and others added 2 commits October 19, 2026 21:56
…o-invoke

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
…ion from Claude SKILL.md files (port of #3129)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title perf(gen-skill-docs): drop the "When to invoke" body section from Claude SKILL.md files (port of #3129) v1.91.157.0 perf(gen-skill-docs): drop the "When to invoke" body section from Claude SKILL.md files (port of #3129) Oct 19, 2026
@capy-ai

capy-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

flaky: qa-only-no-fix, failed in https://github.com/garrytan/gstack/actions/runs/39332134395/attempts/1 (eval-slices (8)), passed on rerun https://github.com/garrytan/gstack/actions/runs/39332134395/attempts/2, logged for the daily flaky-fix pass.

flaky: review-exploratory-small-cli, failed in https://github.com/garrytan/gstack/actions/runs/39332134395/attempts/2 (it passed in attempt 1), passed on rerun https://github.com/garrytan/gstack/actions/runs/39332134395/attempts/3, logged for the daily flaky-fix pass.

@capy-ai

capy-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Merging under Garry's flaky-test rule (2026-10-19). Every case passed after rule-16 reruns of only the failing slices: qa-only-no-fix (failed in attempt 1, passed twice on rerun) and review-exploratory-small-cli (failed once, passed on its next rerun). Both are logged in the flaky ledger and are unrelated to this diff. slices-report stays bound to attempt 1 by design until F1 lands. — GStack Minder

@capy-ai
capy-ai Bot merged commit 6237994 into main Oct 19, 2026
119 of 124 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants