gstack icon indicating copy to clipboard operation
gstack copied to clipboard

Generated SKILL.md trigger vocabulary lives in a 'triggers:' frontmatter key the Claude Code skill router never reads

Open cathrynlavery opened this issue 4 months ago • 2 comments

Problem

gstack-generated SKILL.md files (via gen:skill-docs / scripts/gen-skill-docs.ts) store their real trigger vocabulary in a nonstandard triggers: YAML frontmatter key. Claude Code's skill router only reads name: and description: from frontmatter — it never sees triggers: — so those phrases contribute nothing to routing and the affected skills are under-triggered.

Concrete example from qa/SKILL.md at v1.60.1.0:

description: Systematically QA test a web application and fix bugs found. (gstack)
triggers:
  - qa test this
  - find bugs on site
  - test the site

A user saying "find bugs on site" has no lexical overlap with the description the router actually reads, so the skill often doesn't fire. In practice we see roughly 30 gstack skills that under-trigger this way; on main at v1.60.1.0, 55 of 59 generated SKILL.md files carry a triggers: key.

Users also can't fix this locally: hand-edits to installed SKILL.md files are clobbered by the next /gstack-upgrade regeneration.

Proposed fix

Have the generator merge the triggers: list into the generated description:, e.g. appending:

Use when the user says "qa test this", "find bugs on site", "test the site".

so the router-visible surface carries the trigger vocabulary. The generator already does exactly this for the voice-triggers: key (processVoiceTriggers in scripts/gen-skill-docs.ts folds the list into the description and strips the field), so the plumbing pattern exists — it just doesn't cover triggers:.

I'm deliberately filing this as an issue rather than a PR: the change sits in a generator that emits ~400 skills, and it interacts with the catalog-trim work (the v1.45 "Catalog Trim" intentionally moved routing prose out of description: into ## When to invoke sections and scripts/proactive-suggestions.json to cut always-loaded token cost). Merging triggers: into description: partially reverses that tradeoff, so the token budget vs. routing-recall balance deserves a maintainer decision rather than a drive-by patch.

Environment

  • gstack v1.60.1.0 (also confirmed on current main)
  • Claude Code as the skill host

cathrynlavery avatar Jul 16 '26 21:07 cathrynlavery

Still present on 1.91.6.0 (65bfb0c, 2026-09-28): all 57 generated SKILL.md files carry triggers: and none uses when_to_use.

One extra detail for whoever picks this up: the default --catalog-mode trim (buildTrimmedDescription in scripts/gen-skill-docs.ts) cuts description: down to its first sentence, so a "Use when…" sentence added to a template is dropped too. The fold-in needs to survive that trim, or the triggers can be emitted as when_to_use:, which Claude Code reads alongside description (the two share a 1,536-character cap in the skill listing, per https://code.claude.com/docs/en/skills).

preamble-tier: and version: are also not in Claude Code's frontmatter reference; metadata: is the documented place for custom keys.

jtheyse avatar Oct 07 '26 19:10 jtheyse

Thanks, @cathrynlavery, and @jtheyse for the follow-up on the trim and when_to_use details. This is the same problem as #2118, so we're tracking it there and have carried over the when_to_use idea.

capy-ai[bot] avatar Oct 11 '26 14:10 capy-ai[bot]