archivo del paquete→ .shtukbase/packages/blueprint-skilled-agent/checks/k01_skills.ts
checks/k01_skills.ts
19 líneas, 1.2 KB.
El archivo tal como está en el paquete: el código y sus comentarios no se traducen.
- // SKL-R01. An agent with skills gets every skill it names, as they are now: each skill is a valid Agent Skills page,
- // and the built prompt of the agent and the .claude/skills mirror match the skills. Read-only.
- // Run from the project root: bun .shtukbase/packages/blueprint-skilled-agent/checks/k01_skills.ts
- import { existsSync, readFileSync } from 'node:fs';
- import { join } from 'node:path';
- import { plan } from '../lib/skills.ts';
- const root = process.cwd();
- const p = plan(root);
- const out: string[] = p.problems.map((x) => `${x.at}: ${x.what} → ${x.fix}`);
- for (const [rel, text] of p.files) {
- const f = join(root, rel);
- if (!existsSync(f)) out.push(`${rel}: no such file → shtuk run blueprint-skilled-agent build`);
- else if (readFileSync(f, 'utf8') !== text) out.push(`${rel}: not built from the current skills and the agent page → shtuk run blueprint-skilled-agent build`);
- }
- for (const id of p.mirrors) out.push(`.claude/skills/${id}: the skill is gone or switched off → shtuk run blueprint-skilled-agent build`);
- for (const l of out) console.log(l);
- console.log(out.length ? `SKL-R01: violations — ${out.length}` : `SKL-R01: the skills are built (${p.files.size} files)`);
- process.exit(out.length ? 1 : 0);