{"record":{"id":"ca93052b4022a3e8","repo":"JuliusBrussee/caveman","slug":"skill-md-missing-under-resolved","errorCode":null,"errorMessage":"SKILL.md missing under ${resolved}","messagePattern":"SKILL\\.md missing under (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/index.ts","lineNumber":1580,"sourceCode":"\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;\n\tlet removedSeparators = 0;","sourceCodeStart":1562,"sourceCodeEnd":1598,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/cli/src/index.ts#L1562-L1598","documentation":"After resolving the source, importedSkillSource computes the manifest path (directory + SKILL.md, or the file itself) and checks it exists via hasFile. If a directory was given but no SKILL.md exists directly under it, this error is thrown.","triggerScenarios":"Importing a directory that lacks a top-level SKILL.md, e.g. ./my-skill when the manifest lives at ./my-skill/docs/SKILL.md.","commonSituations":"Skill folders scaffolded without a manifest; SKILL.md nested in a subdirectory; case mismatch (skill.md) on Linux; manifest deleted during refactoring.","solutions":["Create a SKILL.md at the root of the directory being imported","If the manifest is nested, point the import at the directory that directly contains SKILL.md","Fix filename casing to exactly SKILL.md","Verify with ls <dir>/SKILL.md before importing"],"exampleFix":"// before\n// skills/my-skill/docs/SKILL.md\nimportSkillSource(\"./skills/my-skill\");\n// after\n// move to skills/my-skill/SKILL.md (or pass the subdir)\nimportSkillSource(\"./skills/my-skill/docs\");","handlingStrategy":"validation","validationCode":"const manifest = stat.isDirectory() ? join(resolved, \"SKILL.md\") : resolved;\nif (!existsSync(manifest)) throw new Error(\"SKILL.md not found at \" + manifest);","typeGuard":"null","tryCatchPattern":"try { import(input); } catch (e) { if (e.message.startsWith(\"SKILL.md missing under\")) { console.error(\"Create a SKILL.md at the directory root\"); } else throw e; }","preventionTips":["Scaffold skills with a template that includes a root SKILL.md","Never nest the manifest in a subdirectory","Check ls <dir>/SKILL.md before scripted imports"],"tags":["filesystem","skills","missing-file"],"backgroundTag":"file-not-found","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"}