#2921·gstack

/autoplan: all four phases fail on a --prefix install (methodology skill identity check)

Author: josimarguilbaudCreated Sep 21, 2026Updated Sep 27, 2026

Summary

With ./setup --prefix, every phase of /autoplan fails at the methodology step:

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

bin/gstack-autoplan-snapshot.ts expects the review skills' frontmatter name: to be unprefixed, but setup --prefix rewrites that exact line to the prefixed form. The two disagree, so methodology (and therefore create, and therefore the whole phase dispatch) never runs.

init and scope succeed, which makes it look like the run is healthy right up until the first phase.

Environment

  • gstack 1.87.4.0 (a6b3a57)
  • Installed with --prefix (skill_prefix = true)
  • Windows 11, Git Bash, bun
  • Host: Claude Code

Reproduce

bash
./setup --prefix
# then, in any repo, on any plan file:
bun ~/.claude/skills/gstack/bin/gstack-autoplan-snapshot.ts \
  methodology ceo ~/.claude/skills/gstack/plan-ceo-review/SKILL.md <restore-path>
# → gstack-autoplan-snapshot: Methodology skill identity does not match this phase

Root cause

bin/gstack-autoplan-snapshot.ts:496 builds the expected name without the prefix:

typescript
const skill = `plan-${phase === 'dx' ? 'devex' : phase}-review`;

and :508 requires that literal line to be present in the frontmatter:

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

Meanwhile setup rewrites name: at install time — setup:231:

bash
sed "1,/^---\$/ s/^name:[[:space:]].*/name: $name/" "$src"

and the comment at setup:224-225 states this is deliberate:

"A real SKILL.md that differs from our source (raw, or with its name: line rewritten to NAME, which is how alias and prefixed copies differ)"

Evidence

All four review phases are affected, not just CEO:

Phase Installed frontmatter name: Helper expects
ceo gstack-plan-ceo-review plan-ceo-review
design gstack-plan-design-review plan-design-review
dx gstack-plan-devex-review plan-devex-review
eng gstack-plan-eng-review plan-eng-review

The .tmpl sources still carry the unprefixed name, confirming the rewrite happens at install:

$ grep -m1 '^name:' plan-ceo-review/SKILL.md
name: gstack-plan-ceo-review
$ grep -m1 '^name:' plan-ceo-review/SKILL.md.tmpl
name: plan-ceo-review

Impact

/autoplan cannot complete any phase on a --prefix install. Since the failure surfaces as an identity/integrity error rather than a config mismatch, it reads like a tampered-skill problem rather than an install-flag problem.

/plan-ceo-review and the other phase skills still work when invoked directly — only the autoplan snapshot path is affected.

Suggested fix

Accept either spelling in methodologyContent, e.g.:

typescript
const skill = `plan-${phase === 'dx' ? 'devex' : phase}-review`;
const accepted = [`name: ${skill}`, `name: gstack-${skill}`];
const lines = frontmatter?.[1]!.split(/\r?\n/) ?? [];
if (!accepted.some((n) => lines.includes(n))) { /* throw */ }

Or resolve the expected name from gstack-config get skill_prefix, so the check follows the same source of truth setup used. The first is narrower and needs no new read.

Possibly worth a regression test that installs both ways and runs methodology for all four phases — the .tmpl / installed divergence is invisible to anyone testing only --no-prefix.

Workaround (for anyone else hitting this)

Run the phases degraded: read each plan-*-review/SKILL.md directly and hand each subagent only the plan's ## Implementation plan section, extracted manually. That reproduces what the helper would have fed them, but without the hash-pinning and the atomic amend/check retention guarantees, so the integrity checks are on the operator rather than the tool.