From 7160dfddf2cb1cfcfcacab6e28800f77ff82fbf8 Mon Sep 17 00:00:00 2001 From: Rohit Ghumare <48523873+rohitg00@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:44:02 +0100 Subject: [PATCH] fix: install standalone .md skills by wrapping in a directory Standalone .md skills (e.g. doc_explanation.md) were copied as plain files, then saveSkillMetadata tried to write .skillkit.json inside them causing ENOTDIR. Now detects file sources via statSync and creates a directory with SKILL.md inside instead. --- packages/cli/src/commands/install.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/install.ts b/packages/cli/src/commands/install.ts index 69a51a35..63fc89c5 100644 --- a/packages/cli/src/commands/install.ts +++ b/packages/cli/src/commands/install.ts @@ -4,6 +4,7 @@ import { cpSync, rmSync, symlinkSync, + statSync, readFileSync, writeFileSync, } from "node:fs"; @@ -499,7 +500,13 @@ export class InstallCommand extends Command { if (useSymlink && primaryPath) { symlinkSync(primaryPath, targetPath, "dir"); } else { - cpSync(sourcePath, targetPath, { recursive: true, dereference: true }); + const isStandaloneFile = statSync(sourcePath).isFile(); + if (isStandaloneFile) { + mkdirSync(targetPath, { recursive: true }); + cpSync(sourcePath, join(targetPath, "SKILL.md")); + } else { + cpSync(sourcePath, targetPath, { recursive: true, dereference: true }); + } if (isSymlinkMode && primaryPath === null) { primaryPath = targetPath; }