{"record":{"id":"60dffd3ddf860a3c","repo":"JuliusBrussee/caveman","slug":"source-file-must-be-named-skill-md","errorCode":null,"errorMessage":"source file must be named SKILL.md","messagePattern":"source file must be named SKILL\\.md","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/index.ts","lineNumber":1579,"sourceCode":"\tentry_condition: { status: string; value?: string };\n\tstop_condition: { status: string; value?: string };\n\tprompt: { bytes: number; byte_budget: number; status: string };\n\tresources: { scripts: string[]; references: string[]; assets: string[]; status: string };\n\ttransformations: { exact_duplicate_blocks_removed: number; decorative_separators_removed: number };\n\tconflicts: { status: \"needs_review\"; declared: string[] };\n\tbenchmarks: { status: \"required\"; fixtures: string[] };\n\tevidence_status: \"unevaluated\";\n\tpublication: { status: \"blocked\"; blockers: string[] };\n};\n\nfunction importedSkillSource(input: string): { root: string; file: string } {\n\tlet resolved: string;\n\ttry { resolved = realpathSync(resolve(process.cwd(), expandTilde(input))); } catch {\n\t\tthrow new Error(`source does not exist: ${input}`);\n\t}\n\tconst stat = lstatSync(resolved);\n\tconst file = stat.isDirectory() ? join(resolved, SKILL_MD) : resolved;\n\tif (!stat.isDirectory() && basename(resolved) !== SKILL_MD) throw new Error(\"source file must be named SKILL.md\");\n\tif (!hasFile(file)) throw new Error(`SKILL.md missing under ${resolved}`);\n\treturn { root: stat.isDirectory() ? resolved : dirname(resolved), file };\n}\n\nfunction cavemannifyImportedSkill(bytes: Buffer): { body: string; removedDuplicates: number; removedSeparators: number } {\n\tif (bytes.length === 0 || bytes.length > 256 * 1024) throw new Error(\"SKILL.md must be 1..262144 bytes\");\n\tif (bytes.includes(0)) throw new Error(\"SKILL.md contains NUL bytes\");\n\tconst text = bytes.toString(\"utf8\");\n\tif (!Buffer.from(text, \"utf8\").equals(bytes)) throw new Error(\"SKILL.md must be valid UTF-8\");\n\tif (/-----BEGIN [A-Z ]*PRIVATE KEY-----|\\b(?:sk|ghp|github_pat|xox[baprs])[-_][A-Za-z0-9_-]{16,}/i.test(text)) {\n\t\tthrow new Error(\"SKILL.md contains credential-shaped material\");\n\t}\n\tconst split = splitSkillMarkdown(bytes);\n\tif (!split) throw new Error(\"SKILL.md needs closed YAML frontmatter\");\n\tconst blocks = split.bodyText.trim().split(/\\r?\\n(?:[ \\t]*\\r?\\n)+/);\n\tconst seen = new Set<string>();\n\tconst kept: string[] = [];\n\tlet removedDuplicates = 0;","sourceCodeStart":1561,"sourceCodeEnd":1597,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/cli/src/index.ts#L1561-L1597","documentation":"When the skill import source is a file (not a directory), importedSkillSource requires that the file be named SKILL.md, since only that filename is treated as a skill manifest. Importing any other single file throws this error.","triggerScenarios":"Passing a file path like ./notes.md or ./my-skill/README.md directly as the import source.","commonSituations":"Pointing the importer at README.md or a prompt file instead of the skill manifest; renamed manifests (skill.md lowercase on case-sensitive filesystems); exporting a single doc and trying to import it.","solutions":["Point the source at the SKILL.md file itself","Pass the containing directory instead — the importer then looks for SKILL.md inside it","Rename the file to SKILL.md (exact case) on case-sensitive filesystems"],"exampleFix":"// before\nimportSkillSource(\"./my-skill/README.md\");\n// after\nimportSkillSource(\"./my-skill/SKILL.md\");","handlingStrategy":"validation","validationCode":"const stat = lstatSync(resolve(input));\nif (!stat.isDirectory() && basename(resolve(input)) !== \"SKILL.md\") throw new Error(\"pass the SKILL.md file or its directory\");","typeGuard":"null","tryCatchPattern":"try { import(input); } catch (e) { if (e.message === \"source file must be named SKILL.md\") { input = join(dirname(input), \"SKILL.md\"); } else throw e; }","preventionTips":["Always import either a directory or the SKILL.md file itself","Keep the manifest named exactly SKILL.md (mind case on Linux)","Document in skill templates that README.md is not the manifest"],"tags":["filesystem","skills","naming"],"backgroundTag":"invalid-argument-value","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}