From 43a06f9ddca2a398b451a47db35a892bc4c54152 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 15 Aug 2026 08:50:03 -0700 Subject: [PATCH] =?UTF-8?q?test(evals):=20context-skills=20fixtures=20via?= =?UTF-8?q?=20extractSkillBody=20=E2=80=94=2074-82%=20smaller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- test/skill-e2e-context-skills.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/skill-e2e-context-skills.test.ts b/test/skill-e2e-context-skills.test.ts index add602026..505307ca7 100644 --- a/test/skill-e2e-context-skills.test.ts +++ b/test/skill-e2e-context-skills.test.ts @@ -19,6 +19,7 @@ import { logCost, recordE2E, createEvalCollector, finalizeEvalCollector, } from './helpers/e2e-helpers'; +import { extractSkillBody } from './helpers/skill-fixture'; import { spawnSync } from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; @@ -43,11 +44,14 @@ function setupWorkdir(suffix: string): { workDir: string; gstackHome: string; sl run('git', ['commit', '-m', 'initial']); // 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'); for (const skill of ['context-save', 'context-restore']) { const destDir = path.join(skillsDir, skill); 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.