test(evals): opus-47 discovery fixtures via extractSkillHead — ~95% smaller

Routing/fanout tests only read frontmatter + opening lines of the 14
installed skills (review 1871->54, office-hours 1706->80).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan 2026-08-15 08:50:03 -07:00
parent 43a06f9ddc
commit 9963deac37
No known key found for this signature in database
GPG Key ID: C1F69E85C74EFE1D
1 changed files with 6 additions and 2 deletions

View File

@ -20,6 +20,7 @@
import { describe, test, expect, afterAll } from 'bun:test';
import { runSkillTest } from './helpers/session-runner';
import { EvalCollector } from './helpers/eval-store';
import { extractSkillHead } from './helpers/skill-fixture';
import { spawnSync } from 'child_process';
import * as fs from 'fs';
import * as path from 'path';
@ -72,14 +73,17 @@ function mkEvalRoot(suffix: string, includeOverlay: boolean): string {
throw new Error(`gen-skill-docs failed: ${result.stderr}`);
}
// Install per-skill SKILL.md files for Skill tool discovery.
// Install per-skill SKILL.md files for Skill tool discovery. Routing only
// reads the frontmatter (name + description), so install frontmatter + the
// first ~30 body lines instead of the full 1000-1900-line files
// (CLAUDE.md: "E2E test fixtures: extract, don't copy").
const skillsDir = path.join(tmp, '.claude', 'skills');
for (const skill of INSTALLED_SKILLS) {
const src = path.join(ROOT, skill, 'SKILL.md');
if (!fs.existsSync(src)) continue;
const destDir = path.join(skillsDir, skill);
fs.mkdirSync(destDir, { recursive: true });
fs.copyFileSync(src, path.join(destDir, 'SKILL.md'));
fs.writeFileSync(path.join(destDir, 'SKILL.md'), extractSkillHead(src));
}
// Extract the opus-4-7 model-overlay content from the checked-in file