JuliusBrussee/caveman · error · Error
SKILL.md needs closed YAML frontmatter
Error message
SKILL.md needs closed YAML frontmatter
What it means
Error "SKILL.md needs closed YAML frontmatter" thrown in JuliusBrussee/caveman.
Source
Thrown at packages/cli/src/index.ts:1365
throw new Error(`source does not exist: ${input}`);
}
const stat = lstatSync(resolved);
const file = stat.isDirectory() ? join(resolved, SKILL_MD) : resolved;
if (!stat.isDirectory() && basename(resolved) !== SKILL_MD) throw new Error("source file must be named SKILL.md");
if (!hasFile(file)) throw new Error(`SKILL.md missing under ${resolved}`);
return { root: stat.isDirectory() ? resolved : dirname(resolved), file };
}
function cavemannifyImportedSkill(bytes: Buffer): { body: string; removedDuplicates: number; removedSeparators: number } {
if (bytes.length === 0 || bytes.length > 256 * 1024) throw new Error("SKILL.md must be 1..262144 bytes");
if (bytes.includes(0)) throw new Error("SKILL.md contains NUL bytes");
const text = bytes.toString("utf8");
if (!Buffer.from(text, "utf8").equals(bytes)) throw new Error("SKILL.md must be valid UTF-8");
if (/-----BEGIN [A-Z ]*PRIVATE KEY-----|\b(?:sk|ghp|github_pat|xox[baprs])[-_][A-Za-z0-9_-]{16,}/i.test(text)) {
throw new Error("SKILL.md contains credential-shaped material");
}
const split = splitSkillMarkdown(bytes);
if (!split) throw new Error("SKILL.md needs closed YAML frontmatter");
const blocks = split.bodyText.trim().split(/\r?\n(?:[ \t]*\r?\n)+/);
const seen = new Set<string>();
const kept: string[] = [];
let removedDuplicates = 0;
let removedSeparators = 0;
for (const block of blocks) {
const clean = block.trim();
if (/^(?:---+|\*\*\*+|___+)$/.test(clean)) {
removedSeparators++;
continue;
}
const identity = clean.replace(/\s+/g, " ");
if (seen.has(identity)) {
removedDuplicates++;
continue;
}
seen.add(identity);
kept.push(clean);View on GitHub (pinned to 27d5a3981a)
Solutions
- Add closed YAML frontmatter (--- ... ---) at the top of SKILL.md.
When it happens
Trigger: Thrown at packages/cli/src/index.ts:1365 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/9447ebe5da9df56e.
Report an issue: GitHub.