Bring back the standalone /plan-eng-review command (GST-2726) (#4375)

Garry, 2026-11-15: people rely on /plan-eng-review, so it returns as its own
command on every host that had it before GST-1698 (#4108). /autoplan's eng
phase is unchanged: external hosts still ship the same methodology beside
gstack-autoplan/SKILL.md, now rendered from the same pass as the standalone
skill, and the Kiro sibling copy and ownership guards from #4108 stay.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-15 02:11:18 +00:00
1 parent caa7140eee
commit 8837fda399
82 files changed
+362 -279

No files matched your search

+2 -2
View File
@@ -77,7 +77,7 @@ describe('A2: the guard decides on a journal larger than its shrunk bounds', ()
const output = await bounded(() => f.hook(input), RECORD, 4 * 1024);
expect(codeOf(output)).toBe('oversized_invocation');
expect(denial(output)).toContain('retained-data bound');
expect(denial(output)).toContain('/plan-ceo-review, then /plan-devex-review by hand');
expect(denial(output)).toContain('/plan-ceo-review, then /plan-devex-review, then /plan-eng-review');
expect(f.log().at(-1)).toMatchObject({ decision: 'deny', disposition: 'fallback', code: 'oversized_invocation' });
await bounded(() => expect(ownedRetainedLimit()).toBe(OWNED_RETAINED_MAX_BYTES), RECORD, OWNED_RETAINED_MAX_BYTES * 4);
});
@@ -157,7 +157,7 @@ describe('A2: append-tolerant reads with prefix identity', () => {
test('a journal that shrinks between two reads is an identity denial', async () => {
const { output } = await twoReads(file => fs.truncateSync(file, Math.floor(fs.statSync(file).size / 2)));
expect(codeOf(output)).toBe('identity');
expect(denial(output)).toContain('/plan-ceo-review, then /plan-devex-review by hand');
expect(denial(output)).toContain('/plan-ceo-review, then /plan-devex-review, then /plan-eng-review');
});
test('the reader itself: a changed prefix is rewritten, fewer bytes than the prefix is identity', () => {
+1 -1
View File
@@ -30,7 +30,7 @@ describe('guard reason inventory', () => {
if (reason.disposition === 'unverified') expect(text).toContain('Phase-report enforcement was skipped for this call');
if (reason.disposition === 'corrective') expect(text).not.toContain(FALLBACK);
}
expect(FALLBACK).toContain('/plan-ceo-review, then /plan-devex-review by hand');
expect(FALLBACK).toContain('/plan-ceo-review, then /plan-devex-review, then /plan-eng-review');
expect(FALLBACK).toContain('/context-save');
expect(FALLBACK).toContain('/context-restore, then /autoplan <plan path>');
});
+7 -7
View File
@@ -4,7 +4,7 @@ import { chmodSync, cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rm
import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
import { createSnapshot, prepareMethodology } from '../bin/gstack-autoplan-snapshot';
import { RETIRED_SKILLS } from '../scripts/discover-skills';
import { AUTOPLAN_SIBLING_METHODOLOGIES } from '../scripts/discover-skills';
const ROOT = resolve(import.meta.dir, '..');
const owned: string[] = [];
@@ -23,16 +23,16 @@ function fixture(phase: string, layout: string) {
});
expect(generated.status, generated.stderr).toBe(0);
}
// A retired skill's external render is a methodology file beside /autoplan.
const retiredInline = layout === 'inlineCodex' && RETIRED_SKILLS.includes(skill);
const source = layout === 'inlineCodex' ? join(dir, '.agents/skills', retiredInline ? 'gstack-autoplan' : `gstack-${skill}`) : join(ROOT, skill);
const fileName = retiredInline ? `${skill}.md` : 'SKILL.md';
const target = join(dir, retiredInline ? 'gstack-autoplan' : skill);
// /autoplan reads a sibling methodology file beside its own SKILL.md on external hosts.
const siblingInline = layout === 'inlineCodex' && AUTOPLAN_SIBLING_METHODOLOGIES.includes(skill);
const source = layout === 'inlineCodex' ? join(dir, '.agents/skills', siblingInline ? 'gstack-autoplan' : `gstack-${skill}`) : join(ROOT, skill);
const fileName = siblingInline ? `${skill}.md` : 'SKILL.md';
const target = join(dir, siblingInline ? 'gstack-autoplan' : skill);
mkdirSync(target);
cpSync(join(source, fileName), join(target, fileName));
// C4: Codex carves plan-ceo-review too, so an install that has sections/ copies it.
// Every tier 2+ skill ships sections/preamble.md; carving is the review section.
const carved = !retiredInline && existsSync(join(source, 'sections', 'review-sections.md'));
const carved = !siblingInline && existsSync(join(source, 'sections', 'review-sections.md'));
if (existsSync(join(source, 'sections'))) cpSync(join(source, 'sections'), join(target, 'sections'), { recursive: true });
if (layout === 'patchedClaude') {
const result = spawnSync('bash', [join(ROOT, 'bin/gstack-patch-names'), dir, 'true'], { encoding: 'utf8', timeout: 10_000 });
+1 -1
View File
@@ -156,7 +156,7 @@ describe('Autoplan hook journal-root verdicts', () => {
const reason: string = output.hookSpecificOutput.permissionDecisionReason;
expect(reason).toContain(`code ${code}`);
expect(reason).toContain('Claude Code 2.1.284');
expect(reason).toContain('/plan-ceo-review, then /plan-devex-review by hand');
expect(reason).toContain('/plan-ceo-review, then /plan-devex-review, then /plan-eng-review');
expect(reason).toContain('docs/autoplan-guard-troubleshooting.md');
expect(reason).not.toContain('no missing-publication conclusion');
const records = fs.readFileSync(s.log, 'utf8').trim().split('\n').map(line => JSON.parse(line));
+1 -1
View File
@@ -156,7 +156,7 @@ describe('Publication flush: a report counts only once a later journaled record
f.report(f.nextMessage()); f.journal();
const output = await f.hook(next(f));
expect(codeOf(output)).toBe('publication_repeat');
expect(denial(output)).toContain('/plan-ceo-review, then /plan-devex-review by hand');
expect(denial(output)).toContain('/plan-ceo-review, then /plan-devex-review, then /plan-eng-review');
});
test('a denied call after the report proves the report was journaled, so the next attempt counts it', async () => {
+5 -5
View File
@@ -8,12 +8,12 @@ import { ALL_HOST_CONFIGS } from '../hosts';
import { generateAutoplanReviewFile } from '../scripts/resolvers/composition';
import { HOST_PATHS, type TemplateContext } from '../scripts/resolvers/types';
import { E2E_TOUCHFILES } from './helpers/touchfiles';
import { RETIRED_SKILLS } from '../scripts/discover-skills';
import { AUTOPLAN_SIBLING_METHODOLOGIES } from '../scripts/discover-skills';
const ROOT = path.resolve(import.meta.dir, '..');
const REVIEWS = ['plan-ceo-review', 'plan-design-review', 'plan-devex-review', 'plan-eng-review'];
/** External hosts: a retired review ships beside gstack-autoplan/SKILL.md as <review>.md (GST-1698). */
const externalRef = (review: string) => RETIRED_SKILLS.includes(review) ? `${review}.md` : `../gstack-${review}/SKILL.md`;
/** External hosts: /autoplan reads a sibling methodology beside gstack-autoplan/SKILL.md as <review>.md (GST-1698). */
const externalRef = (review: string) => AUTOPLAN_SIBLING_METHODOLOGIES.includes(review) ? `${review}.md` : `../gstack-${review}/SKILL.md`;
let owned: string;
let rendered: string;
@@ -78,8 +78,8 @@ describe('autoplan reads installed host methodology', () => {
// Read the path actually emitted in the entrypoint. Resolving it from
// the installed entrypoint works for copied installs and symlinked ones.
const refs = [...body.matchAll(/`(\.\.\/gstack-plan-[a-z-]+\/SKILL\.md)`/g)].map(match => match[1]!);
expect([...new Set(refs)].sort()).toEqual(REVIEWS.filter(name => !RETIRED_SKILLS.includes(name)).map(externalRef).sort());
for (const name of REVIEWS.filter(review => RETIRED_SKILLS.includes(review))) {
expect([...new Set(refs)].sort()).toEqual(REVIEWS.filter(name => !AUTOPLAN_SIBLING_METHODOLOGIES.includes(name)).map(externalRef).sort());
for (const name of REVIEWS.filter(review => AUTOPLAN_SIBLING_METHODOLOGIES.includes(review))) {
expect(body).toContain(`the file \`${name}.md\` in the installed \`/autoplan\` SKILL.md directory`);
expect(body).not.toContain(`gstack-${name}/SKILL.md`);
}
+4 -1
View File
@@ -18,7 +18,10 @@ describe('carved-skill cases each get a complete paid process budget', () => {
const cases = [...source.matchAll(/test\('carve-section-loading-([a-z-]+)', \(\) => runCarveSectionCase\('([a-z-]+)'\), CAPTURE_LONG_MS\)/g)]
.map(match => ({ id: `carve-section-loading-${match[1]}`, skill: match[2]! }));
// A retired skill keeps its carve guard (its methodology still renders) but no section-loading case.
const generic = Object.values(CARVE_GUARDS).filter(guard => (guard.behavioral === 'plan' || guard.behavioral === 'prompt') && !RETIRED_SKILLS.includes(guard.skill)).map(guard => guard.skill).sort();
// plan-eng-review's case was deleted with the GST-1698 cut; the skill came back in GST-2726 without
// it, and whether the paid case returns is the GST-1966 measurement plan's call.
const NO_LOADING_CASE = [...RETIRED_SKILLS, 'plan-eng-review'];
const generic = Object.values(CARVE_GUARDS).filter(guard => (guard.behavioral === 'plan' || guard.behavioral === 'prompt') && !NO_LOADING_CASE.includes(guard.skill)).map(guard => guard.skill).sort();
test('every generic registry entry has exactly one periodic case, under its own case id, and no external entry does', () => {
expect(source).toContain("describeE2ETier('periodic')");
+3 -2
View File
@@ -67,14 +67,15 @@ function findInteractiveSkills(): string[] {
/**
* Scan a test file's contents for any of the supported real-interactive
* coverage patterns. Either: direct canUseTool usage in runAgentSdkTest,
* the legacy plan-mode-helpers wrapper, or the new real-PTY observation
* helper.
* the legacy plan-mode-helpers wrapper, or a real-PTY helper that answers
* the skill's native questions (observation or counting).
*/
function hasCanUseToolCoverage(testFile: string): boolean {
const content = fs.readFileSync(testFile, 'utf-8');
if (content.includes('canUseTool')) return true;
if (content.includes('runPlanModeSkillTest')) return true;
if (content.includes('runPlanSkillObservation')) return true;
if (content.includes('runPlanSkillCounting')) return true;
return false;
}
+1 -1
View File
@@ -158,7 +158,7 @@ describe('engineering review routing contracts', () => {
test('#3106: an unpersisted review gets no saved credit; /ship names the PERSIST: line or a rerun', () => {
const ctx = (skillName: string) => ({ skillName, tmplPath: `${skillName}/SKILL.md.tmpl`, host: 'claude', paths: HOST_PATHS.claude } as TemplateContext);
const ship = compact(generateReviewDashboard(ctx('ship')));
expect(ship).toContain('With no Eng Review record, say "no saved Eng Review: run the `PERSIST:` line a read-only eng review printed, or rerun /autoplan"');
expect(ship).toContain('With no Eng Review record, say "no saved Eng Review: run the `PERSIST:` line a read-only /plan-eng-review printed, or rerun it"');
expect(ship).toContain('docs/troubleshooting.md#plan-eng-review-not-persisted');
expect(generateReviewDashboard(ctx('plan-eng-review'))).not.toContain('PERSIST:');
const gate = compact(generateExitPlanModeGate(ctx('plan-eng-review')));
+2 -2
View File
@@ -396,7 +396,7 @@ and outside_status; retain partial coverage. These details do not clear Eng Revi
**3. Choose the historical verdict.** CLEARED requires the selected Eng Review
to be `clean`, within 7 days and fresh under step 2. Otherwise report NOT CLEARED
and its missing, stale or open-issue reason. With no Eng Review record, say "no saved Eng Review: run the `PERSIST:` line a read-only eng review printed, or rerun /autoplan" (docs/troubleshooting.md#plan-eng-review-not-persisted). If `skip_eng_review` is true, show
and its missing, stale or open-issue reason. With no Eng Review record, say "no saved Eng Review: run the `PERSIST:` line a read-only /plan-eng-review printed, or rerun it" (docs/troubleshooting.md#plan-eng-review-not-persisted). If `skip_eng_review` is true, show
"SKIPPED (global)" for Eng Review and CLEARED for this dashboard.
This verdict never skips Step 9 or its finding, approval and convergence gates. Continue Step 1 even when history is NOT CLEARED.
@@ -424,7 +424,7 @@ VERDICT: {CLEARED or NOT CLEARED} — {reason}
An outside review with status `unverified` or `unavailable` is missing coverage, never a pass.
Over 200 lines, `DIFF:` recommends `/autoplan`. `SCOPE: frontend=true` (from
Over 200 lines, `DIFF:` recommends `/plan-eng-review` or `/autoplan`. `SCOPE: frontend=true` (from
`gstack-diff-scope <base>`) (Lit or htm templates in .ts/.js count) with no design review: mention "Design Review: static (no preview declared) — Step 9 runs the lite check only; consider /design-review on a served page for a visual audit."
Continue to Step 2 without asking; Step 9 applies the review gates.
+2 -2
View File
@@ -395,7 +395,7 @@ and outside_status; retain partial coverage. These details do not clear Eng Revi
**3. Choose the historical verdict.** CLEARED requires the selected Eng Review
to be `clean`, within 7 days and fresh under step 2. Otherwise report NOT CLEARED
and its missing, stale or open-issue reason. With no Eng Review record, say "no saved Eng Review: run the `PERSIST:` line a read-only eng review printed, or rerun /autoplan" (docs/troubleshooting.md#plan-eng-review-not-persisted). If `skip_eng_review` is true, show
and its missing, stale or open-issue reason. With no Eng Review record, say "no saved Eng Review: run the `PERSIST:` line a read-only /plan-eng-review printed, or rerun it" (docs/troubleshooting.md#plan-eng-review-not-persisted). If `skip_eng_review` is true, show
"SKIPPED (global)" for Eng Review and CLEARED for this dashboard.
This verdict never skips Step 9 or its finding, approval and convergence gates. Continue Step 1 even when history is NOT CLEARED.
@@ -423,7 +423,7 @@ VERDICT: {CLEARED or NOT CLEARED} — {reason}
An outside review with status `unverified` or `unavailable` is missing coverage, never a pass.
Over 200 lines, `DIFF:` recommends `/autoplan`. `SCOPE: frontend=true` (from
Over 200 lines, `DIFF:` recommends `/plan-eng-review` or `/autoplan`. `SCOPE: frontend=true` (from
`gstack-diff-scope <base>`) (Lit or htm templates in .ts/.js count) with no design review: mention "Design Review: static (no preview declared) — Step 9 runs the lite check only; consider /design-review on a served page for a visual audit."
Continue to Step 2 without asking; Step 9 applies the review gates.
+2 -2
View File
@@ -395,7 +395,7 @@ and outside_status; retain partial coverage. These details do not clear Eng Revi
**3. Choose the historical verdict.** CLEARED requires the selected Eng Review
to be `clean`, within 7 days and fresh under step 2. Otherwise report NOT CLEARED
and its missing, stale or open-issue reason. With no Eng Review record, say "no saved Eng Review: run the `PERSIST:` line a read-only eng review printed, or rerun /autoplan" (docs/troubleshooting.md#plan-eng-review-not-persisted). If `skip_eng_review` is true, show
and its missing, stale or open-issue reason. With no Eng Review record, say "no saved Eng Review: run the `PERSIST:` line a read-only /plan-eng-review printed, or rerun it" (docs/troubleshooting.md#plan-eng-review-not-persisted). If `skip_eng_review` is true, show
"SKIPPED (global)" for Eng Review and CLEARED for this dashboard.
This verdict never skips Step 9 or its finding, approval and convergence gates. Continue Step 1 even when history is NOT CLEARED.
@@ -423,7 +423,7 @@ VERDICT: {CLEARED or NOT CLEARED} — {reason}
An outside review with status `unverified` or `unavailable` is missing coverage, never a pass.
Over 200 lines, `DIFF:` recommends `/autoplan`. `SCOPE: frontend=true` (from
Over 200 lines, `DIFF:` recommends `/plan-eng-review` or `/autoplan`. `SCOPE: frontend=true` (from
`gstack-diff-scope <base>`) (Lit or htm templates in .ts/.js count) with no design review: mention "Design Review: static (no preview declared) — Step 9 runs the lite check only; consider /design-review on a served page for a visual audit."
Continue to Step 2 without asking; Step 9 applies the review gates.
+2 -2
View File
@@ -397,7 +397,7 @@ and outside_status; retain partial coverage. These details do not clear Eng Revi
**3. Choose the historical verdict.** CLEARED requires the selected Eng Review
to be `clean`, within 7 days and fresh under step 2. Otherwise report NOT CLEARED
and its missing, stale or open-issue reason. With no Eng Review record, say "no saved Eng Review: run the `PERSIST:` line a read-only eng review printed, or rerun /autoplan" (docs/troubleshooting.md#plan-eng-review-not-persisted). If `skip_eng_review` is true, show
and its missing, stale or open-issue reason. With no Eng Review record, say "no saved Eng Review: run the `PERSIST:` line a read-only /plan-eng-review printed, or rerun it" (docs/troubleshooting.md#plan-eng-review-not-persisted). If `skip_eng_review` is true, show
"SKIPPED (global)" for Eng Review and CLEARED for this dashboard.
This verdict never skips Step 9 or its finding, approval and convergence gates. Continue Step 1 even when history is NOT CLEARED.
@@ -425,7 +425,7 @@ VERDICT: {CLEARED or NOT CLEARED} — {reason}
An outside review with status `unverified` or `unavailable` is missing coverage, never a pass.
Over 200 lines, `DIFF:` recommends `/autoplan`. `SCOPE: frontend=true` (from
Over 200 lines, `DIFF:` recommends `/plan-eng-review` or `/autoplan`. `SCOPE: frontend=true` (from
`gstack-diff-scope <base>`) (Lit or htm templates in .ts/.js count) with no design review: mention "Design Review: static (no preview declared) — Step 9 runs the lite check only; consider /design-review on a served page for a visual audit."
Continue to Step 2 without asking; Step 9 applies the review gates.
+30 -30
View File
@@ -2,55 +2,55 @@
"_comment": "Generated SKILL.md files over the limit, pinned at their exact character count (#3199). test/skill-md-size-guard.test.ts fails when a pinned skill grows past its pin or shrinks below it: lower the pin when a skill shrinks and delete it once the skill is within the limit. Raising a pin is an owner decision. The shared-preamble hoist (GSTA-96) moved every tier 2+ skill's shared preamble into sections/preamble.md; the pins below are what remains.",
"limit": 100000,
"pins": {
"agy/gstack-autoplan": 109540,
"agy/gstack-plan-design-review": 109096,
"agy/gstack-plan-devex-review": 114924,
"agy/gstack-autoplan": 109449,
"agy/gstack-plan-design-review": 109103,
"agy/gstack-plan-devex-review": 114944,
"agy/gstack-plan-eng-review": 143580,
"agy/gstack-review": 104735,
"codex/gstack-autoplan": 108283,
"codex/gstack-plan-design-review": 110453,
"codex/gstack-plan-devex-review": 116432,
"codex/gstack-autoplan": 108192,
"codex/gstack-plan-design-review": 110460,
"codex/gstack-plan-devex-review": 116452,
"codex/gstack-plan-eng-review": 144745,
"codex/gstack-review": 104119,
"copilot/gstack-autoplan": 108983,
"copilot/gstack-plan-design-review": 109362,
"copilot/gstack-plan-devex-review": 114386,
"copilot/gstack-autoplan": 108892,
"copilot/gstack-plan-design-review": 109369,
"copilot/gstack-plan-devex-review": 114406,
"copilot/gstack-plan-eng-review": 143745,
"copilot/gstack-review": 104316,
"cursor/gstack-autoplan": 108215,
"cursor/gstack-plan-design-review": 107904,
"cursor/gstack-plan-devex-review": 113656,
"cursor/gstack-autoplan": 108124,
"cursor/gstack-plan-design-review": 107911,
"cursor/gstack-plan-devex-review": 113676,
"cursor/gstack-plan-eng-review": 142335,
"cursor/gstack-review": 122788,
"factory/gstack-autoplan": 110493,
"factory/gstack-plan-design-review": 111002,
"factory/gstack-plan-devex-review": 117019,
"factory/gstack-autoplan": 110402,
"factory/gstack-plan-design-review": 111009,
"factory/gstack-plan-devex-review": 117039,
"factory/gstack-plan-eng-review": 145443,
"factory/gstack-review": 126561,
"gbrain/gstack-autoplan": 108622,
"gbrain/gstack-autoplan": 108531,
"gbrain/gstack-plan-eng-review": 124963,
"gemini/gstack-autoplan": 108773,
"gemini/gstack-plan-design-review": 109190,
"gemini/gstack-plan-devex-review": 114214,
"gemini/gstack-autoplan": 108682,
"gemini/gstack-plan-design-review": 109197,
"gemini/gstack-plan-devex-review": 114234,
"gemini/gstack-plan-eng-review": 143578,
"gemini/gstack-review": 104138,
"hermes/gstack-autoplan": 108576,
"hermes/gstack-autoplan": 108536,
"hermes/gstack-plan-eng-review": 124999,
"kiro/gstack-autoplan": 107989,
"kiro/gstack-plan-design-review": 107750,
"kiro/gstack-plan-devex-review": 113508,
"kiro/gstack-autoplan": 107898,
"kiro/gstack-plan-design-review": 107757,
"kiro/gstack-plan-devex-review": 113528,
"kiro/gstack-plan-eng-review": 142197,
"kiro/gstack-review": 122612,
"openclaw/gstack-autoplan": 108445,
"openclaw/gstack-autoplan": 108354,
"openclaw/gstack-plan-eng-review": 123478,
"opencode/gstack-autoplan": 108964,
"opencode/gstack-plan-design-review": 109218,
"opencode/gstack-plan-devex-review": 114264,
"opencode/gstack-autoplan": 108873,
"opencode/gstack-plan-design-review": 109225,
"opencode/gstack-plan-devex-review": 114284,
"opencode/gstack-plan-eng-review": 143604,
"opencode/gstack-review": 123410,
"slate/gstack-autoplan": 108102,
"slate/gstack-plan-design-review": 107827,
"slate/gstack-plan-devex-review": 113582,
"slate/gstack-autoplan": 108011,
"slate/gstack-plan-design-review": 107834,
"slate/gstack-plan-devex-review": 113602,
"slate/gstack-plan-eng-review": 142266,
"slate/gstack-review": 122700
}
+5 -5
View File
@@ -917,13 +917,13 @@ describe('REVIEW_DASHBOARD resolver', () => {
});
}
test('plan-ceo-review chaining mentions eng (via /autoplan) and design reviews', () => {
test('plan-ceo-review chaining mentions eng and design reviews', () => {
// Carved skill: the chaining prose lives in sections/*.md. (It used to
// pass against the skeleton only because the preamble's routing-injection
// rules incidentally named these skills — that prose moved into
// bin/gstack-skill-start in token-reduction Phase 2.)
const content = readSkillUnion('plan-ceo-review');
expect(content).toContain('Run /autoplan next (eng review)');
expect(content).toContain('/plan-eng-review');
expect(content).toContain('/plan-design-review');
});
@@ -933,9 +933,9 @@ describe('REVIEW_DASHBOARD resolver', () => {
expect(content).toContain('/plan-ceo-review');
});
test('plan-design-review chaining mentions eng (via /autoplan), ceo, and design skills', () => {
test('plan-design-review chaining mentions eng, ceo, and design skills', () => {
const content = readSkillUnion('plan-design-review');
expect(content).toContain('Run /autoplan next (eng review)');
expect(content).toContain('/plan-eng-review');
expect(content).toContain('/plan-ceo-review');
expect(content).toContain('/design-shotgun');
expect(content).toContain('/design-html');
@@ -1303,7 +1303,7 @@ describe('PLAN_FILE_REVIEW_REPORT resolver', () => {
expect(content).toContain('Findings');
expect(content).toContain('VERDICT');
expect(content).toContain('/plan-ceo-review');
expect(content).toContain('| Eng Review | `/autoplan` |');
expect(content).toContain('/plan-eng-review');
expect(content).toContain('/plan-design-review');
expect(content).toContain('/codex review');
});
@@ -9,7 +9,7 @@ When the user's request matches an available skill, invoke it via the Skill tool
Key routing rules:
- Product ideas/brainstorming → invoke /office-hours
- Strategy/scope → invoke /plan-ceo-review
- Architecture → invoke /autoplan
- Architecture → invoke /plan-eng-review
- Design system/plan review → invoke /design-consultation or /plan-design-review
- Full review pipeline → invoke /autoplan
- Bugs/errors → fix them directly: one read-only check of the cause, or a focused failing test first when the cause is unclear; then fix it and run that test
+3 -3
View File
@@ -161,7 +161,7 @@ export const CARVE_GUARDS: Record<string, CarveGuard> = {
},
behavioral: 'external',
externalTest: 'test/skill-e2e-ship-section-loading.test.ts',
maxSkeletonBytes: 61_420, // GSTA-152 token cap (2026-10-29, Garry's "Do it" on plan v3): the skeleton's Budget paragraph (the --token-cap, --resume and --continue flags, start/check/close, the budget-handoff pointer) and the section index's budget-handoff line; measured 61,420 (before: 60,958 on edf4c2e). Before that: GSTA-131 token efficiency (2026-10-27, Garry's D1): Step 1's delta carry (dry run, pregate at HEAD, then carry --pregate) and Step 11.5's fix-check and planned-skip binding, +60 bytes after tightening Step 1 and the Review policy paragraph; measured 60,960 (before: 60,900 on 10b77de4). Before that: GSTA-96 hoist merged with GSTA-92 phase 2 (2026-10-26): the hoisted skeleton (59,706) plus this PR's growth, keeping the hoist's 65-byte headroom; measured 60,848. Before: + v2.0 {{ASIDE_RESEARCH}} (Aside first, WebSearch fallback); measured 78_275. + gate integrity (HONEST_WORK_GATE_INTEGRITY W3): Step 16 stage 4 ZERO-RUN/unknown receipt rows, stage 5 honesty inventory, Step 17 open-gate ready-PR gate; measured 80,540 (2026-10-10). + rule 22 / GBRA-108 (2026-10-25): Step 22's terminal line (gstack-ship-receipt result, the GSTACK_RESULT line a parent greps) and Step 18's unattended routing (an open PR at HEAD gets its body updated, else handoff), offset in part by tightening Steps 14, 16, 18 and 20 prose after the 2026-10-14 tightening left 2 bytes of headroom; measured 81,535. + harness lane E (2026-10-26, issue row 3: four Captains re-ran /ship on identical product code): Step 1's carry check (gstack-ship-receipt carry binds an earlier receipt to HEAD when the product patch-id is unchanged); measured 82,165. + the Review policy paragraph (the blocking floor, pass structure and cap, NO FINDINGS, the review_loop receipt counters, the review_scope knob), stated in the skeleton because gstack is the canonical holder of its review policy (docs/review-policy.md); measured 82,645.
maxSkeletonBytes: 61_438, // GST-2726 (2026-11-15, Garry: bring /plan-eng-review back): Step 1's DIFF hint and the no-Eng-Review line name /plan-eng-review again, the wording GST-1698 removed; measured 61,438 (before: 61,417 on 81fb900). Before that: GSTA-152 token cap (2026-10-29, Garry's "Do it" on plan v3): the skeleton's Budget paragraph (the --token-cap, --resume and --continue flags, start/check/close, the budget-handoff pointer) and the section index's budget-handoff line; measured 61,420 (before: 60,958 on edf4c2e). Before that: GSTA-131 token efficiency (2026-10-27, Garry's D1): Step 1's delta carry (dry run, pregate at HEAD, then carry --pregate) and Step 11.5's fix-check and planned-skip binding, +60 bytes after tightening Step 1 and the Review policy paragraph; measured 60,960 (before: 60,900 on 10b77de4). Before that: GSTA-96 hoist merged with GSTA-92 phase 2 (2026-10-26): the hoisted skeleton (59,706) plus this PR's growth, keeping the hoist's 65-byte headroom; measured 60,848. Before: + v2.0 {{ASIDE_RESEARCH}} (Aside first, WebSearch fallback); measured 78_275. + gate integrity (HONEST_WORK_GATE_INTEGRITY W3): Step 16 stage 4 ZERO-RUN/unknown receipt rows, stage 5 honesty inventory, Step 17 open-gate ready-PR gate; measured 80,540 (2026-10-10). + rule 22 / GBRA-108 (2026-10-25): Step 22's terminal line (gstack-ship-receipt result, the GSTACK_RESULT line a parent greps) and Step 18's unattended routing (an open PR at HEAD gets its body updated, else handoff), offset in part by tightening Steps 14, 16, 18 and 20 prose after the 2026-10-14 tightening left 2 bytes of headroom; measured 81,535. + harness lane E (2026-10-26, issue row 3: four Captains re-ran /ship on identical product code): Step 1's carry check (gstack-ship-receipt carry binds an earlier receipt to HEAD when the product patch-id is unchanged); measured 82,165. + the Review policy paragraph (the blocking floor, pass structure and cap, NO FINDINGS, the review_loop receipt counters, the review_scope knob), stated in the skeleton because gstack is the canonical holder of its review policy (docs/review-policy.md); measured 82,645.
minUnionBytes: 181_000, // token-reduction Phases 1-2 (v1.69.x branch); measured union 201,464
mustContain: ['VERSION', 'CHANGELOG', 'review', 'merge', 'PR'],
// v1.58.5.0: pre-push-guard install (#2077) stacks on the shared first-run-guidance preamble.
@@ -359,7 +359,7 @@ do not launch the downstream skill or open a browser.`,
maxSkeletonBytes: 43_885, // GSTA-134 skill diet (2026-10-28): lowered from 80_533 to the measured skeleton after the second opinion and visual design moved to sections, 43,885. Before: GSTA-96 hoist (2026-10-26): lowered from 95_900 by the shared preamble that moved to sections/preamble.md, keeping the pre-hoist headroom of 952 bytes; measured 79,581. Before: Office-hours + sketch outside voices include host guards and completion checks. + v1.91.19.0 wave: Q<N> open-question prose form (#2729, approved Q3), DESIGN_READY --version probe (B4), Aside ~/.local/bin fallback (E7), verdict-form outside voice (INV-1), plus v1.91.17.0's round accounting (#3022) merged in; measured 89,684 (2026-10-03). + Oct 6 fix wave A3/CEO-12: free text reaches commands only through agent-written mktemp files (mktemp block, write rule, path rebuild and refusal at each posting, prompt and brief site); skeleton measured 92,590 (2026-10-06). + Oct 7 wave B3: the Codex probe runs as a command (select-model capture lines, check-sandbox/probe-model/run-with-timeout subcommands) instead of being sourced; skeleton measured 92,869 (2026-10-07). + Oct 7 wave CEO-28/DX-11: review prompts ask for a severity per finding and design proposals use the proposal gate; skeleton measured 92,930 (2026-10-07). + Oct 7 wave guard (CEO-20): conditional `run_in_background` request plus the background-run recovery at each foreground dispatch site; skeleton measured 92,756 (2026-10-07). Merged with the guard area: measured skeleton 93,099 (2026-10-07). + fix wave PR D: the Phase 4.5 builder-profile read before the session log (#2801) and the pre-telemetry design-doc check (#1049); measured skeleton 94,877 (2026-10-07). + Honest Work wave merged (W2/W3 gate integrity in review/ship, W4 kernel + DONE line in every tier-2+ skill, W5/W7 in spec/ship): re-measured on the integrated tree (2026-10-10).
minUnionBytes: 115_800, // Phase 4 wave 4; measured union 118,175
mustContain: ['design doc', 'problem statement'],
maxSizeRatio: 1.1921, // GSTA-134 (2026-10-28, raised from 1.1796 by GStack Minder as merge-queue owner): +1,662 B union: second-opinion question moved into the main file while CODEX_SECOND_OPINION keeps its copy; per-run load 73,248→43,885 B; measured 156,286 / 131,110 = 1.19202, rounded up. Before: + Oct 6 fix wave A3/CEO-12: free text reaches commands only through agent-written mktemp files (mktemp block, write rule, path rebuild and refusal at each posting, prompt and brief site); measured 149,758 / 131,110 = 1.1422 (2026-10-06). + Oct 7 wave B3: the Codex probe runs as a command (select-model capture lines, check-sandbox/probe-model/run-with-timeout subcommands) instead of being sourced; measured 150,037 / 131,110 = 1.1444 (2026-10-07). + Oct 7 wave CEO-28/DX-11: review prompts ask for a severity per finding and design proposals use the proposal gate; measured 150,098 / 131,110 = 1.1448 (2026-10-07). + Oct 7 wave guard (CEO-20): conditional `run_in_background` request plus the background-run recovery at each foreground dispatch site; measured 150,011 / 131,110 = 1.1442 (2026-10-07). Merged with the guard area: measured 150,354 / 131,110 = 1.1468 (2026-10-07). + fix wave PR D: builder-profile read before the session log with Phase 6 using the carried values (#2801), the inline design doc before approval (#879) and the pre-telemetry design-doc check (#1049); measured 153,206 / 131,110 = 1.1685 (2026-10-07). + empty LAST_ASSIGNMENT/LAST_PROJECT guards in the welcome_back and regular greetings (backfilled profiles); measured 153,469 / 131,110 = 1.1705 (2026-10-08). + Honest Work wave merged (W2/W3 gate integrity in review/ship, W4 kernel + DONE line in every tier-2+ skill, W5/W7 in spec/ship): re-measured on the integrated tree (2026-10-10). + GSTA-96 shared-preamble hoist (owner-approved raise, Garry 2026-10-25: "do it"): the union now holds sections/preamble.md, so a fresh invocation reads the pointer plus the shared file and its own copies of shared sections; measured 160,989 / 131,110 = 1.2279 (2026-10-25). Before: 1.18. - GSTA-96 dedupe: the Q<N> open-question form is office-hours' own appended subsection, so its copies of the shared Format and fallback subsections go; measured 154,653 / 131,110 = 1.1796 (2026-10-26), 154,624 = 1.1793 after the main merge. Before: 1.2279.
maxSizeRatio: 1.1922, // GST-2726 (2026-11-15, Garry: bring /plan-eng-review back): the handoff menu, its default and the design-doc line name /plan-eng-review again, +42 B union; measured 156,298 / 131,110 = 1.19211, rounded up (before: 156,256 = 1.19179 on 81fb900). Before that: GSTA-134 (2026-10-28, raised from 1.1796 by GStack Minder as merge-queue owner): +1,662 B union: second-opinion question moved into the main file while CODEX_SECOND_OPINION keeps its copy; per-run load 73,248→43,885 B; measured 156,286 / 131,110 = 1.19202, rounded up. Before: + Oct 6 fix wave A3/CEO-12: free text reaches commands only through agent-written mktemp files (mktemp block, write rule, path rebuild and refusal at each posting, prompt and brief site); measured 149,758 / 131,110 = 1.1422 (2026-10-06). + Oct 7 wave B3: the Codex probe runs as a command (select-model capture lines, check-sandbox/probe-model/run-with-timeout subcommands) instead of being sourced; measured 150,037 / 131,110 = 1.1444 (2026-10-07). + Oct 7 wave CEO-28/DX-11: review prompts ask for a severity per finding and design proposals use the proposal gate; measured 150,098 / 131,110 = 1.1448 (2026-10-07). + Oct 7 wave guard (CEO-20): conditional `run_in_background` request plus the background-run recovery at each foreground dispatch site; measured 150,011 / 131,110 = 1.1442 (2026-10-07). Merged with the guard area: measured 150,354 / 131,110 = 1.1468 (2026-10-07). + fix wave PR D: builder-profile read before the session log with Phase 6 using the carried values (#2801), the inline design doc before approval (#879) and the pre-telemetry design-doc check (#1049); measured 153,206 / 131,110 = 1.1685 (2026-10-07). + empty LAST_ASSIGNMENT/LAST_PROJECT guards in the welcome_back and regular greetings (backfilled profiles); measured 153,469 / 131,110 = 1.1705 (2026-10-08). + Honest Work wave merged (W2/W3 gate integrity in review/ship, W4 kernel + DONE line in every tier-2+ skill, W5/W7 in spec/ship): re-measured on the integrated tree (2026-10-10). + GSTA-96 shared-preamble hoist (owner-approved raise, Garry 2026-10-25: "do it"): the union now holds sections/preamble.md, so a fresh invocation reads the pointer plus the shared file and its own copies of shared sections; measured 160,989 / 131,110 = 1.2279 (2026-10-25). Before: 1.18. - GSTA-96 dedupe: the Q<N> open-question form is office-hours' own appended subsection, so its copies of the shared Format and fallback subsections go; measured 154,653 / 131,110 = 1.1796 (2026-10-26), 154,624 = 1.1793 after the main merge. Before: 1.2279.
},
'document-release': {
skill: 'document-release',
@@ -733,7 +733,7 @@ do not launch the downstream skill or open a browser.`,
gateAfterStop: undefined,
},
behavioral: 'prompt',
maxSkeletonBytes: 51_622, // GSTA-96 hoist (2026-10-26): lowered from 73_450 by the shared preamble that moved to sections/preamble.md, keeping the pre-hoist headroom of 937 bytes; measured 50,685. Before: + v1.78 AUQ spawned-trigger objectivity (explicit declaration + interactive fence); measured 73_059
maxSkeletonBytes: 51_626, // GST-2726 (2026-11-15, Garry: bring /plan-eng-review back): the EUREKA example names /plan-eng-review again; measured 51,626 (before: 51,619 on 81fb900). Before that: GSTA-96 hoist (2026-10-26): lowered from 73_450 by the shared preamble that moved to sections/preamble.md, keeping the pre-hoist headroom of 937 bytes; measured 50,685. Before: + v1.78 AUQ spawned-trigger objectivity (explicit declaration + interactive fence); measured 73_059
minUnionBytes: 66_000, // measured union 73,496
mustContain: ['retrospective', '45-minute gap', 'Ship of the week', 'Praise'],
},
+1 -1
View File
@@ -223,7 +223,7 @@ export function validateOfficeHoursCompletion(evidence: OfficeHoursCompletionEvi
const handoff = sectionBody(evidence.output, ['handoff', 'handoff — the relationship closing', 'handoff - the relationship closing'])
|| sectionBody(evidence.output, ['relationship closing']);
if (!substantive(handoff)) fail('REPORT.md lacks a substantive Handoff');
if (!/\/(?:autoplan|plan-(?:ceo|design|devex)-review)\b/.test(handoff)) fail('Handoff lacks the next-skill recommendation');
if (!/\/(?:autoplan|plan-(?:ceo|eng|design|devex)-review)\b/.test(handoff)) fail('Handoff lacks the next-skill recommendation');
if (!/\b(?:declined|deferred|not now|later)\b/i.test(handoff)) fail('Handoff does not record the declined downstream launch');
// The caller separately checks actual tool calls for downstream launch;
// recording the user's choice here is not proof that it was respected.
+2 -2
View File
@@ -24,8 +24,8 @@ export const PERIODIC_CI_EXCLUDE: Record<string, { reason: string; tracking: str
tracking: 'TODOS.md "CI-unrunnable paid evals" (re-entry: OPENROUTER_API_KEY in the periodic slice env and a new preregistration; review by 2026-12-28)',
},
'test/skill-e2e-plan-eng-multi-finding-batching.test.ts': {
reason: 'retired with standalone /plan-eng-review (GST-1698): it checks one interactive question per eng finding, and /autoplan Phase 3 auto-decides findings, so no shipped entry reaches the behavior; running it weekly is known waste',
tracking: 'TODOS.md "/plan-eng-review retirement follow-ups" (re-entry: none; delete the file with its batching counter helpers and fixtures)',
reason: 'excluded when standalone /plan-eng-review was cut (GST-1698), because /autoplan Phase 3 auto-decides findings; the standalone skill is back (GST-2726) and reaches the behavior again, so re-entry waits on the GST-1966 measurement plan rather than weekly spend',
tracking: 'TODOS.md "/plan-eng-review return follow-up" (re-entry: GST-1966 decides whether the weekly lane runs it again)',
},
'test/skill-e2e-ios-device.test.ts': {
reason: 'needs a physical iPhone over USB/devicectl — manual hardware, not a CI runner capability',
+7 -7
View File
@@ -392,17 +392,17 @@ describe('office-hours fixture completion', () => {
expect(() => validateOfficeHoursCompletion({ ...completed(), output: noDecline })).toThrow('declined downstream launch');
});
test('accepts every next skill the handoff menu offers and rejects the retired /plan-eng-review', () => {
// #4108 moved the default recommendation to /autoplan; run 42371706491 failed a
// correct /autoplan handoff against the old list.
test('accepts every next skill the handoff menu offers, and /autoplan', () => {
// Run 42371706491 failed a correct handoff against a stale list; the menu
// offers /plan-eng-review again since GST-2726, and /autoplan stays valid.
const menu = fs.readFileSync(path.join(import.meta.dir, '..', 'office-hours', 'sections', 'design-and-handoff.md'), 'utf8');
const offered = [...menu.matchAll(/^[A-C]\) Run (\/[\w-]+) now/gm)].map(match => match[1]);
expect(offered).toEqual(['/autoplan', '/plan-ceo-review', '/plan-design-review']);
for (const skill of offered) {
expect(offered).toEqual(['/plan-eng-review', '/plan-ceo-review', '/plan-design-review']);
for (const skill of [...offered, '/autoplan']) {
expect(() => validateOfficeHoursCompletion({ ...completed(), output: report.replace('Next: /autoplan', `Next: ${skill}`) })).not.toThrow();
}
const retired = report.replace('Next: /autoplan', 'Next: /plan-eng-review');
expect(() => validateOfficeHoursCompletion({ ...completed(), output: retired })).toThrow('next-skill recommendation');
const unknown = report.replace('Next: /autoplan', 'Next: /plan-qa-review');
expect(() => validateOfficeHoursCompletion({ ...completed(), output: unknown })).toThrow('next-skill recommendation');
});
});
+1 -2
View File
@@ -5,7 +5,6 @@ import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
import { ALL_HOST_CONFIGS } from '../hosts';
import { ALL_MODEL_NAMES } from '../scripts/models';
import { RETIRED_SKILLS } from '../scripts/discover-skills';
import { HOST_PATHS, type TemplateContext } from '../scripts/resolvers/types';
import { outsideVoiceFor, outsideVoiceCommand } from '../scripts/resolvers/outside-voice';
import { RESOLVERS } from '../scripts/resolvers';
@@ -82,7 +81,7 @@ describe('generated automatic review coverage', () => {
for (const skill of skills) {
test(`Codex /${skill} invokes Claude Code, including lazy sections`, () => {
const host = ALL_HOST_CONFIGS.find(h => h.name === 'codex')!;
const text = RETIRED_SKILLS.includes(skill) ? readFileSync(join(skillDir(host, 'autoplan'), `${skill}.md`), 'utf8') : readUnion(skillDir(host, skill));
const text = readUnion(skillDir(host, skill));
expect(text).toContain('gstack-claude-code');
// Prose about the CLI is permitted; executable codex review commands are not.
expect(shellLines(text).filter(line => /\bcodex\s+(?:exec|review)\b/.test(line))).toEqual([]);
+3 -3
View File
@@ -265,12 +265,12 @@ describe('plan report persistence precedes completion logging', () => {
|| artifact.relativePath.endsWith(`/gstack-${skill}/sections/review-sections.md`));
const carved = new Set(generated.artifacts.filter(isSection).map(a => `${a.host}:${a.relativePath.replace(/\/sections\/review-sections\.md$/, '')}`));
const carriers = generated.artifacts.filter(artifact => isSection(artifact)
|| (artifact.kind === 'skill' && plans.some(skill => artifact.relativePath.endsWith(`/gstack-${skill}/SKILL.md`) || artifact.relativePath.endsWith(`/gstack-autoplan/${skill}.md`))
|| (artifact.kind === 'skill' && plans.some(skill => artifact.relativePath.endsWith(`/gstack-${skill}/SKILL.md`))
&& !carved.has(`${artifact.host}:${artifact.relativePath.replace(/\/SKILL\.md$/, '')}`)));
expect(carriers).toHaveLength(plans.length * ALL_HOST_CONFIGS.length);
for (const carrier of carriers) {
const content = readFileSync(join(outputRoot, carrier.relativePath), 'utf8');
if (carrier.relativePath.includes('plan-eng-review')) {
if (carrier.relativePath.includes('plan-eng-review/')) {
const dispatch = compactProse(content.slice(content.indexOf('**Pending-record checkpoint.**'), content.indexOf('## Scope Challenge')));
ordered(dispatch, ['AskUserQuestion({ questions: [currentDecision] })', /stop until the actual answer arrives/i, '### Record the answer', 'For the next choice']);
}
@@ -280,7 +280,7 @@ describe('plan report persistence precedes completion logging', () => {
const dashboard = content.indexOf('\n## Review Readiness Dashboard\n');
expect({ carrier: carrier.relativePath, ordered: 0 < report && report < readback && readback < log && log < dashboard }).toMatchObject({ ordered: true });
expect(content.slice(report, readback)).toContain('current Completion Summary');
expect(content.slice(readback, log)).toMatch(carrier.relativePath.includes('plan-eng-review')
expect(content.slice(readback, log)).toMatch(carrier.relativePath.includes('plan-eng-review/')
? /follow \*\*Blocked outcome\*\* before Review Log or decision logging/i
: /stop before Review Log or decision logging/i);
}
+70 -56
View File
@@ -1,11 +1,11 @@
/**
* GST-1698: /plan-eng-review is cut. Its source stays as /autoplan's eng-phase
* methodology, and no host registers it. setup and gstack-relink treat it as a
* disabled skill that config cannot re-enable (GSTACK_RETIRED_SKILLS), so an
* existing gstack-owned entry is removed on the next setup or upgrade and a
* user's own same-name skill stays. External hosts carry the methodology beside
* gstack-autoplan/SKILL.md as plan-eng-review.md (Codex and Copilot register
* every nested SKILL.md).
* Retired skills: no host registers them, and setup and gstack-relink treat
* each as a disabled skill that config cannot re-enable (GSTACK_RETIRED_SKILLS),
* so an existing gstack-owned entry is removed on the next setup or upgrade and
* a user's own same-name skill stays. /investigate is retired (GST-1717).
* /plan-eng-review was retired in GST-1698 and came back in GST-2726: every host
* registers it again, and external hosts still carry its methodology beside
* gstack-autoplan/SKILL.md as plan-eng-review.md for /autoplan's eng phase.
*/
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
import { spawnSync } from 'child_process';
@@ -18,13 +18,13 @@ import { runGeneration } from '../scripts/gen-skill-docs';
const ROOT = path.resolve(import.meta.dir, '..');
const REGISTRY = path.join(ROOT, 'bin', 'gstack-install-registry.sh');
const BINS = ['gstack-config', 'gstack-relink', 'gstack-patch-names', 'gstack-skill-name.sh', 'gstack-state-root.sh', 'gstack-install-registry.sh'];
const PLAN_ENG = 'plan-eng-review'; // pregate-literal: GSTACK_RETIRED_SKILLS=plan-eng-review still retired; GST-1717 appended investigate to the list
const PLAN_ENG = 'plan-eng-review'; // pregate-literal: GST-2726 took plan-eng-review off GSTACK_RETIRED_SKILLS; investigate stays retired
test('setup and gstack-relink retire the same skills as the generator', () => {
const r = spawnSync('bash', ['-c', '. "$1" && printf %s "$GSTACK_RETIRED_SKILLS"', '_', REGISTRY], { encoding: 'utf8', timeout: 10_000 });
expect(r.status, r.stderr).toBe(0);
expect(r.stdout.split(/\s+/).filter(Boolean)).toEqual(RETIRED_SKILLS);
expect(RETIRED_SKILLS.join(' ')).toBe('plan-eng-review investigate');
expect(RETIRED_SKILLS.join(' ')).toBe('investigate');
});
describe('gstack-relink after an upgrade removed /investigate (GST-1717)', () => {
@@ -104,7 +104,7 @@ describe('gstack-relink after an upgrade removed /investigate (GST-1717)', () =>
});
});
describe('gstack-relink on an install that still has /plan-eng-review', () => {
describe('gstack-relink after /plan-eng-review returned (GST-2726)', () => {
let tmp: string;
let install: string;
let skills: string;
@@ -137,27 +137,17 @@ describe('gstack-relink on an install that still has /plan-eng-review', () => {
});
afterEach(() => fs.rmSync(tmp, { recursive: true, force: true }));
test('an upgrade removes the old gstack-owned entry and keeps the methodology source', () => {
setRegistry('');
const before = relink();
expect(before.status, before.stderr).toBe(0);
expect(fs.existsSync(path.join(skills, PLAN_ENG, 'SKILL.md'))).toBe(true);
setRegistry(PLAN_ENG);
const after = relink();
expect(after.status, after.stderr).toBe(0);
test('an install whose upgrade removed the entry gets /plan-eng-review back on the next relink', () => {
setRegistry(`${PLAN_ENG} investigate`);
const cut = relink();
expect(cut.status, cut.stderr).toBe(0);
expect(fs.lstatSync(path.join(skills, PLAN_ENG), { throwIfNoEntry: false })).toBeUndefined();
expect(fs.existsSync(path.join(skills, 'ship', 'SKILL.md'))).toBe(true);
expect(fs.existsSync(path.join(install, PLAN_ENG, 'SKILL.md'))).toBe(true);
expect(after.stdout).not.toContain('Disabled (gstack-config disabled_skills');
});
test('a gstack-plan-eng-review entry from a prefixed install goes too', () => {
fs.mkdirSync(path.join(skills, 'gstack-plan-eng-review'), { recursive: true });
fs.symlinkSync(path.join(install, PLAN_ENG, 'SKILL.md'), path.join(skills, 'gstack-plan-eng-review', 'SKILL.md'));
const r = relink();
expect(r.status, r.stderr).toBe(0);
expect(fs.lstatSync(path.join(skills, 'gstack-plan-eng-review'), { throwIfNoEntry: false })).toBeUndefined();
fs.copyFileSync(REGISTRY, path.join(install, 'bin', 'gstack-install-registry.sh'));
const back = relink();
expect(back.status, back.stderr).toBe(0);
expect(fs.readFileSync(path.join(skills, PLAN_ENG, 'SKILL.md'), 'utf8')).toContain(`# ${PLAN_ENG}`);
expect(fs.existsSync(path.join(skills, 'ship', 'SKILL.md'))).toBe(true);
});
test("a user's own plan-eng-review skill is left alone", () => {
@@ -179,29 +169,35 @@ describe('setup prunes external-host entries for a retired skill whose source st
return SETUP_SRC.slice(start, end + 2);
};
test('the old gstack-plan-eng-review render and its host link are removed, live skills stay', () => {
const pruneScript = (src: string, gen: string, host: string, retired?: string) => [
'set -e', 'log() { echo "$@"; }', `. "${REGISTRY}"`, ...(retired ? [`GSTACK_RETIRED_SKILLS="${retired}"`] : []),
...['_gstack_link_target_abs', '_gstack_target_is_ours', '_gstack_generated_header', '_backup_skill_md', '_cleanup_weak_dir',
'_owned_for_windows_refresh', '_skill_source_exists', '_prune_stale_generated'].map(extractFn),
`_prune_stale_generated "${src}" "${gen}" "${host}"`,
].join('\n');
const pruneFixture = (t: string, live: string[]) => {
const src = path.join(t, 'src'), gen = path.join(t, 'gen'), host = path.join(t, 'host');
for (const s of live) {
fs.mkdirSync(path.join(src, s), { recursive: true });
fs.writeFileSync(path.join(src, s, 'SKILL.md.tmpl'), `---\nname: ${s}\n---\nx\n`);
}
fs.mkdirSync(host);
for (const s of live) {
const g = `gstack-${s}`;
fs.mkdirSync(path.join(gen, g), { recursive: true });
fs.writeFileSync(path.join(gen, g, 'SKILL.md'), `<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->\n# ${g}\n`);
fs.symlinkSync(path.join(gen, g) + '/', path.join(host, g));
}
return { src, gen, host };
};
test('a retired skill whose source still exists loses its render and host link, live skills stay', () => {
const t = fs.mkdtempSync(path.join(os.tmpdir(), 'retired-prune-'));
try {
const src = path.join(t, 'src'), gen = path.join(t, 'gen'), host = path.join(t, 'host');
for (const s of [PLAN_ENG, 'autoplan']) {
fs.mkdirSync(path.join(src, s), { recursive: true });
fs.writeFileSync(path.join(src, s, 'SKILL.md.tmpl'), `---\nname: ${s}\n---\nx\n`);
}
for (const g of ['gstack-plan-eng-review', 'gstack-autoplan']) {
fs.mkdirSync(path.join(gen, g), { recursive: true });
fs.writeFileSync(path.join(gen, g, 'SKILL.md'), `<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->\n# ${g}\n`);
}
fs.mkdirSync(host);
for (const g of ['gstack-plan-eng-review', 'gstack-autoplan']) fs.symlinkSync(path.join(gen, g) + '/', path.join(host, g));
const script = [
'set -e', 'log() { echo "$@"; }', `. "${REGISTRY}"`,
...['_gstack_link_target_abs', '_gstack_target_is_ours', '_gstack_generated_header', '_backup_skill_md', '_cleanup_weak_dir',
'_owned_for_windows_refresh', '_skill_source_exists', '_prune_stale_generated'].map(extractFn),
`_prune_stale_generated "${src}" "${gen}" "${host}"`,
].join('\n');
const r = spawnSync('bash', ['-c', script], { encoding: 'utf-8', timeout: 30_000 });
const { src, gen, host } = pruneFixture(t, ['old-review', 'autoplan']);
const r = spawnSync('bash', ['-c', pruneScript(src, gen, host, 'old-review investigate')], { encoding: 'utf-8', timeout: 30_000 });
expect(r.status, r.stderr).toBe(0);
expect(r.stdout).toContain('pruned retired skill: gstack-plan-eng-review');
expect(r.stdout).toContain('pruned retired skill: gstack-old-review');
expect(fs.readdirSync(gen)).toEqual(['gstack-autoplan']);
expect(fs.readdirSync(host)).toEqual(['gstack-autoplan']);
} finally {
@@ -209,6 +205,20 @@ describe('setup prunes external-host entries for a retired skill whose source st
}
});
test('the gstack-plan-eng-review render and its host link stay now that the skill is back (GST-2726)', () => {
const t = fs.mkdtempSync(path.join(os.tmpdir(), 'retired-prune-back-'));
try {
const { src, gen, host } = pruneFixture(t, [PLAN_ENG, 'autoplan']);
const r = spawnSync('bash', ['-c', pruneScript(src, gen, host)], { encoding: 'utf-8', timeout: 30_000 });
expect(r.status, r.stderr).toBe(0);
expect(r.stdout).not.toContain('pruned retired skill');
expect(fs.readdirSync(gen).sort()).toEqual(['gstack-autoplan', 'gstack-plan-eng-review']);
expect(fs.readdirSync(host).sort()).toEqual(['gstack-autoplan', 'gstack-plan-eng-review']);
} finally {
fs.rmSync(t, { recursive: true, force: true });
}
});
test('a copied gstack-investigate whose source is gone: an edited SKILL.md is backed up, a pristine copy goes (GST-1717)', () => {
const t = fs.mkdtempSync(path.join(os.tmpdir(), 'retired-prune-gone-'));
try {
@@ -271,24 +281,28 @@ describe('setup prunes external-host entries for a retired skill whose source st
});
});
test('no host renders a plan-eng-review skill; external hosts get the methodology beside gstack-autoplan', async () => {
test('every host renders /plan-eng-review; external hosts also keep the same methodology beside gstack-autoplan', async () => {
const out = fs.mkdtempSync(path.join(os.tmpdir(), 'retired-gen-'));
try {
const result = await runGeneration({ host: 'all', outputRoot: out });
expect(result.diagnostics.filter(d => d.kind === 'error'), JSON.stringify(result.diagnostics.filter(d => d.kind === 'error'))).toEqual([]);
const paths = result.artifacts.map(a => a.relativePath);
expect(paths.filter(p => /gstack-plan-eng-review\//.test(p))).toEqual([]);
expect(paths).toContain('plan-eng-review/SKILL.md');
const external = result.artifacts.filter(a => a.host && a.host !== 'claude' && a.kind === 'skill');
const hosts = new Set(external.map(a => a.host));
expect(hosts.size).toBeGreaterThan(5);
for (const host of hosts) {
const copy = external.find(a => a.host === host && a.relativePath.endsWith('/skills/gstack-autoplan/plan-eng-review.md'));
expect(copy, host).toBeDefined();
expect(fs.readFileSync(path.join(out, copy!.relativePath), 'utf8')).toMatch(/^---\nname: (gstack-)?plan-eng-review\n/);
const standalone = external.find(a => a.host === host && a.relativePath.endsWith('/skills/gstack-plan-eng-review/SKILL.md'));
const sibling = external.find(a => a.host === host && a.relativePath.endsWith('/skills/gstack-autoplan/plan-eng-review.md'));
expect(standalone, host).toBeDefined();
expect(sibling, host).toBeDefined();
const body = fs.readFileSync(path.join(out, standalone!.relativePath), 'utf8');
expect(body).toMatch(/^---\nname: (gstack-)?plan-eng-review\n/);
expect(fs.readFileSync(path.join(out, sibling!.relativePath), 'utf8')).toBe(body);
}
const router = fs.readFileSync(path.join(out, 'SKILL.md'), 'utf8');
expect(router).not.toContain('/plan-eng-review');
expect(fs.readFileSync(path.join(out, 'gstack', 'llms.txt'), 'utf8')).not.toContain(PLAN_ENG);
expect(router).toContain('→ invoke `/plan-eng-review`');
expect(fs.readFileSync(path.join(out, 'gstack', 'llms.txt'), 'utf8')).toContain('[/plan-eng-review](plan-eng-review/SKILL.md)');
expect(paths.filter(p => /(^|\/)(gstack-)?investigate\//.test(p))).toEqual([]);
expect(router).not.toContain('/investigate');
expect(fs.readFileSync(path.join(out, 'gstack', 'llms.txt'), 'utf8')).not.toContain('/investigate');
+1 -2
View File
@@ -4,7 +4,7 @@ import { mkdtempSync, readFileSync, readdirSync, existsSync, rmSync } from 'node
import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
import { ALL_HOST_CONFIGS } from '../hosts';
import { discoverTemplates, RETIRED_SKILLS } from '../scripts/discover-skills';
import { discoverTemplates } from '../scripts/discover-skills';
import { sharedLibsPlanExcerpt } from './helpers/shared-libs-plan-excerpt';
import { readSkillEffective } from './helpers/skill-startup';
@@ -12,7 +12,6 @@ const ROOT = resolve(import.meta.dir, '..');
let output: string;
function rendered(host: (typeof ALL_HOST_CONFIGS)[number], skill: string): string {
if (host.name !== 'claude' && RETIRED_SKILLS.includes(skill)) return readFileSync(join(output, host.hostSubdir, 'skills', 'gstack-autoplan', `${skill}.md`), 'utf8');
const dir = host.name === 'claude' ? join(output, skill)
: join(output, host.hostSubdir, 'skills', `gstack-${skill}`);
const sections = join(dir, 'sections');
@@ -0,0 +1,4 @@
{
"bytes": 21,
"why": "GST-2726: /plan-eng-review is back; the preflight DIFF hint and the no-Eng-Review line name it again"
}
-6
View File
@@ -15,7 +15,6 @@ import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import { ALL_HOST_CONFIGS } from '../hosts/index';
import { RETIRED_SKILLS } from '../scripts/discover-skills';
const ROOT = path.resolve(import.meta.dir, '..');
const ALLOWLIST_FILE = 'test/fixtures/skill-md-size-allowlist.json';
@@ -83,11 +82,6 @@ function renderAllHosts(outDir: string): Record<string, number> {
if (host.name === 'claude' && !fs.existsSync(`${file}.tmpl`)) continue;
sizes[`${host.name}/${dir === '.' ? 'gstack' : dir}`] = countChars(fs.readFileSync(file, 'utf-8'));
}
// A retired skill's methodology ships beside /autoplan; it keeps its pin.
for (const skill of RETIRED_SKILLS) {
const file = path.join(skillsRoot, 'gstack-autoplan', `${skill}.md`);
if (host.name !== 'claude' && fs.existsSync(file)) sizes[`${host.name}/gstack-${skill}`] = countChars(fs.readFileSync(file, 'utf-8'));
}
}
return sizes;
}
+2 -2
View File
@@ -73,7 +73,7 @@ if (evalsEnabled && process.env.EVALS_TIER) {
function installSkills(tmpDir: string) {
const skillDirs = [
'', // root gstack SKILL.md
'qa', 'qa-only', 'ship', 'review', 'plan-ceo-review', 'autoplan',
'qa', 'qa-only', 'ship', 'review', 'plan-ceo-review', 'plan-eng-review', 'autoplan',
'plan-design-review', 'design-review', 'design-consultation', 'retro',
'document-release', 'office-hours', 'browse', 'setup-browser-cookies',
'gstack-upgrade', 'humanizer',
@@ -241,7 +241,7 @@ describeE2E('Skill Routing E2E — Developer Journey', () => {
spawnSync('git', ['commit', '-m', 'initial'], { cwd: tmpDir, stdio: 'pipe', timeout: 5000 });
const testName = 'journey-plan-eng';
const expectedSkill = 'autoplan';
const expectedSkill = 'plan-eng-review';
const result = await runSkillTest({
prompt: "I wrote up a plan for the waitlist app in plan.md. Can you take a look at the architecture and make sure I'm not missing any edge cases or failure modes before I start coding?",
workingDirectory: tmpDir,