Skip to content

fix: namespace generated Hermes skill names - #1054

Closed
dkoh12 wants to merge 1 commit into
garrytan:mainfrom
dkoh12:fix/hermes-skill-namespacing
Closed

dkoh12 wants to merge 1 commit into
garrytan:mainfrom
dkoh12:fix/hermes-skill-namespacing

Conversation

@dkoh12

@dkoh12 dkoh12 commented Apr 18, 2026

Copy link
Copy Markdown

Summary

  • add host-config support for host-specific emitted skill names
  • namespace generated Hermes skill frontmatter names to match their gstack-* directories
  • add a regression test covering Hermes skill-name generation

Problem

Hermes deduplicates skills by frontmatter name, not by directory name. Generated Hermes skills were written to namespaced directories like gstack-review/, but their frontmatter still used generic names like review, causing Hermes to suppress them as duplicates of existing skills.

Test Plan

  • bun test test/gen-skill-docs.test.ts -t "Hermes frontmatter names are namespaced to match generated skill names"
  • bun run scripts/gen-skill-docs.ts --host hermes
  • verify hermes skills list shows gstack-review, gstack-qa, and gstack-ship

Co-authored-by: Hermes Agent (GitHub Copilot GPT-5.4) <[email protected]>
@dkoh12-hermes
dkoh12-hermes Bot force-pushed the fix/hermes-skill-namespacing branch from b6e3439 to abc734b Compare April 18, 2026 02:32
@sixianli

Copy link
Copy Markdown

+1 — independently hit this exact bug on Hermes Agent today (fresh install via

./setup). Confirming the diagnosis: only 2 of 42 generated gstack-* skills

were registered, and the 2 that survived (gstack-upgrade, gstack-open-gstack-browser)

are precisely the ones whose frontmatter name happens to be unique enough not

to collide.

The 6 skills that silently lose to existing Hermes skills via name collision in

my setup: ship, qa, review, autoplan, retro, browse.

Just checked out this branch, ran bun run scripts/gen-skill-docs.ts --host hermes,

and hermes skills list | grep gstack | wc -l now returns 42 (up from 2). Fix

works as advertised.

Would love to see this merged — without it, gstack on Hermes is effectively

unusable out of the box.

@time-attack

time-attack commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

@dkoh12 Rewrite generated Hermes frontmatter names with the same namespace as their gstack-prefixed directories to prevent registry collisions.

@yolo-jared

Copy link
Copy Markdown
Contributor

Adjacent instance of the same "frontmatter name disagrees with the prefixed directory" class, but on the consumption side and on the Claude host — so I don't think this issue's fix covers it. Posting here rather than opening a new issue; happy to split it out if you'd prefer.

Where this differs from the Hermes case above: #1054 is generation writing an unprefixed name into a prefixed directory, and the symptom is silent dedup. This one is the reverse — the installer writes a prefixed name and a consumer hardcodes the unprefixed one, and the symptom is a hard abort.

/autoplan aborts at every phase when skill_prefix: true

gstack-autoplan-snapshot: Methodology skill identity does not match this phase

Exit 1. /autoplan's instruction for that step is "On helper errors, stop", so it terminates at Phase 1. All four phases (ceo, design, dx, eng) share the validator, so none run.

Cause

bin/gstack-patch-names:19-21, invoked by bin/gstack-relink:367-368 when skill_prefix is true, rewrites the installed frontmatter:

if [ "$DO_PREFIX" -eq 1 ]; then
  case "$cur" in gstack-*) continue ;; esac
  new="gstack-$cur"

bin/gstack-autoplan-snapshot.ts:496,508 then requires the bare spelling:

const skill = `plan-${phase === 'dx' ? 'devex' : phase}-review`;
...
if (!frontmatter?.[1]!.split(/\r?\n/).includes(`name: ${skill}`)) {
  throw new Error('Methodology skill identity does not match this phase');
}

The .tmpl carries the unprefixed name and generation preserves it; the prefix is applied afterwards to the installed copy only. The validator was written against the template's spelling.

Reproduction

Clean checkout of origin/main @ a6b3a57 (v1.87.4.0), no local customization:

$ bun bin/gstack-autoplan-snapshot.ts methodology ceo <scratch>/plan-ceo-review/SKILL.md <restore>
exit 0     # JSON manifest emitted

$ bin/gstack-patch-names <scratch> true
  patched name: field in 1 skills
$ grep -m1 '^name:' <scratch>/plan-ceo-review/SKILL.md
name: gstack-plan-ceo-review

$ bun bin/gstack-autoplan-snapshot.ts methodology ceo <scratch>/plan-ceo-review/SKILL.md <restore>
exit 1
gstack-autoplan-snapshot: Methodology skill identity does not match this phase

Single variable: the frontmatter name: line, changed by gstack's own patcher.

Why it shipped

Both halves are tested; the seam isn't. test/relink.test.ts covers prefix mode thoroughly (including the #2738 render-dir regression) and test/autoplan-snapshot.test.ts covers the helper in 451 lines, but grep -rl "skill_prefix" test/autoplan-*.test.ts returns zero across all 37 files — nothing sets skill_prefix: true and then calls the methodology subcommand.

Scope

A sweep of bin/, scripts/, and hosts/ (no --include filter) for the same defect class on the Claude side — a runtime comparison of installed frontmatter name: against a hardcoded literal — found exactly one instance, the line above. Prefix mode is otherwise consistent there: gstack-relink renames the host-side directory and the frontmatter together and keeps them in sync across upgrades and gbrain renders, and bin/gstack-uninstall:195-207 already accepts both spellings.

Suggested fix

Accept either spelling. The prefix is applied uniformly to all four phase skills, never selectively, so tolerating it can't let one phase's methodology pass as another's:

const identities = [`name: ${skill}`, `name: gstack-${skill}`];
if (!frontmatter?.[1]!.split(/\r?\n/).some(line => identities.includes(line))) {
  throw new Error('Methodology skill identity does not match this phase');
}

I have this plus a regression test running locally against a prefixed install — all four phases green, and the test goes red against unpatched code (4 of 12 cases). Full autoplan suite 738 pass / 11 fail vs 726 / 11 on byte-identical-to-upstream code; same 11 pre-existing PTY failures, no regressions. Say the word if a PR would help, or feel free to take the two-line fix directly.

Environment: v1.87.4.0, skill_prefix: true, macOS arm64, Claude Code host.

@capy-ai

capy-ai Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for this, @dkoh12. The fix is now on main: Hermes frontmatter names are fixed (#2825) (fixed in v1.91.16.0, #3014). Closing as superseded; if you still see the problem on the latest gstack, please open an issue with ./setup --status output.

@capy-ai capy-ai Bot closed this Oct 3, 2026
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.

4 participants