From 3a19c0b6159c7af6753c17dfac3989d3abf31751 Mon Sep 17 00:00:00 2001 From: EricXu-0805 Date: Mon, 11 May 2026 11:32:57 -0500 Subject: [PATCH] fix(skill-check): honor primary host skipSkills in Templates check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When `hosts/claude.ts` has `generation.skipSkills: ['claude']` (the existing config — the /claude outside-voice skill is intentionally for non-Claude hosts), `bun run gen:skill-docs` correctly skips generating `claude/SKILL.md`. But `scripts/skill-check.ts` Templates section still flags it as `❌ generated file missing!` and the script exits 1. Fix: mirror the same `skipSkills` filter that `gen-skill-docs.ts` already uses (see `scripts/gen-skill-docs.ts:510-516`). Read the primary host's skipSkills once, then in the Templates loop, if the output file is missing AND the skill dir is in skipSkills, log it as `- skipped per host config` and skip the error flag instead of marking it missing. Impact: `bun run skill:check` now exits 0 for any host config that uses `skipSkills`. No behavior change when skipSkills is empty (default for most hosts) or when the skipped skill's output is in fact missing for some other reason. Test plan: configure `skipSkills: ['claude']` (default `hosts/claude.ts`), run `bun run gen:skill-docs`, confirm `claude/SKILL.md` is not generated, then `bun run skill:check` — before the patch, exit=1 with `❌ claude/SKILL.md — generated file missing!`; after the patch, exit=0 with `- claude/SKILL.md — skipped per claude host config`. --- scripts/skill-check.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/skill-check.ts b/scripts/skill-check.ts index 9182737ee..11b3ab4fd 100644 --- a/scripts/skill-check.ts +++ b/scripts/skill-check.ts @@ -10,6 +10,7 @@ import { validateSkill } from '../test/helpers/skill-parser'; import { discoverTemplates, discoverSkillFiles } from './discover-skills'; +import { claude as PRIMARY_HOST } from '../hosts/index'; import * as fs from 'fs'; import * as path from 'path'; import { execSync } from 'child_process'; @@ -64,15 +65,25 @@ for (const file of SKILL_FILES) { console.log('\n Templates:'); const TEMPLATES = discoverTemplates(ROOT); +// Repo-root SKILL.md outputs reflect what the primary host (claude) generates. +// If a skill is in claude's skipSkills (e.g. the `/claude` outside-voice skill +// is intentionally not bundled into the Claude host), its generated file is +// expected to be absent — flagging it as missing here is a false positive. +const PRIMARY_SKIP_SKILLS = new Set(PRIMARY_HOST.generation?.skipSkills ?? []); for (const { tmpl, output } of TEMPLATES) { const tmplPath = path.join(ROOT, tmpl); const outPath = path.join(ROOT, output); + const skillDir = output.includes('/') ? output.split('/')[0] : ''; if (!fs.existsSync(tmplPath)) { console.log(` \u26a0\ufe0f ${output.padEnd(30)} — no template`); continue; } if (!fs.existsSync(outPath)) { + if (skillDir && PRIMARY_SKIP_SKILLS.has(skillDir)) { + console.log(` - ${output.padEnd(30)} — skipped per ${PRIMARY_HOST.name} host config`); + continue; + } hasErrors = true; console.log(` \u274c ${output.padEnd(30)} — generated file missing! Run: bun run gen:skill-docs`); continue;