mirror of https://github.com/garrytan/gstack.git
test(evals): context-skills fixtures via extractSkillBody — 74-82% smaller
context-save 1037->267 lines, context-restore 952->168; the 8 tests exercise full save/restore/list flows so the body stays, preamble drops. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
cf601a0f58
commit
43a06f9ddc
|
|
@ -19,6 +19,7 @@ import {
|
||||||
logCost, recordE2E,
|
logCost, recordE2E,
|
||||||
createEvalCollector, finalizeEvalCollector,
|
createEvalCollector, finalizeEvalCollector,
|
||||||
} from './helpers/e2e-helpers';
|
} from './helpers/e2e-helpers';
|
||||||
|
import { extractSkillBody } from './helpers/skill-fixture';
|
||||||
import { spawnSync } from 'child_process';
|
import { spawnSync } from 'child_process';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
@ -43,11 +44,14 @@ function setupWorkdir(suffix: string): { workDir: string; gstackHome: string; sl
|
||||||
run('git', ['commit', '-m', 'initial']);
|
run('git', ['commit', '-m', 'initial']);
|
||||||
|
|
||||||
// Install skills into .claude/skills/ for claude -p auto-discovery.
|
// Install skills into .claude/skills/ for claude -p auto-discovery.
|
||||||
|
// The tests exercise the full save/restore/list flows, so keep the whole
|
||||||
|
// skill-specific body but drop the ~780-line shared preamble the tests
|
||||||
|
// never touch (CLAUDE.md: "E2E test fixtures: extract, don't copy").
|
||||||
const skillsDir = path.join(workDir, '.claude', 'skills');
|
const skillsDir = path.join(workDir, '.claude', 'skills');
|
||||||
for (const skill of ['context-save', 'context-restore']) {
|
for (const skill of ['context-save', 'context-restore']) {
|
||||||
const destDir = path.join(skillsDir, skill);
|
const destDir = path.join(skillsDir, skill);
|
||||||
fs.mkdirSync(destDir, { recursive: true });
|
fs.mkdirSync(destDir, { recursive: true });
|
||||||
fs.copyFileSync(path.join(ROOT, skill, 'SKILL.md'), path.join(destDir, 'SKILL.md'));
|
fs.writeFileSync(path.join(destDir, 'SKILL.md'), extractSkillBody(path.join(ROOT, skill)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Install the bin scripts referenced by the preamble.
|
// Install the bin scripts referenced by the preamble.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue