Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/skill-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ export function installCanonicalSkill({
function validGitHubInstallMetadata(value) {
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
const required = ["github-path", "github-ref", "github-repo", "github-tree-sha"];
return Object.keys(value).every((key) => required.includes(key))
&& required.every((key) => typeof value[key] === "string" && value[key].length > 0);
const allowed = [...required, "github-pinned"];
return Object.keys(value).every((key) => allowed.includes(key))
&& required.every((key) => typeof value[key] === "string" && value[key].length > 0)
&& (value["github-pinned"] === undefined
|| (typeof value["github-pinned"] === "string" && value["github-pinned"].length > 0));
}

function defaultInstallParent(platform, scope, { cwd, home, codexHome }) {
Expand Down
3 changes: 2 additions & 1 deletion test/validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ test("canonical Skill validates and installs for Codex and Claude Code", async (
await assert.rejects(() => main(["skill", "install", "codex", "--out", tmp]), /overwrite existing Skill/);
});

test("Skill validation accepts GitHub CLI source metadata on an installed copy", () => {
test("Skill validation accepts GitHub CLI source and pin metadata on an installed copy", () => {
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "loop-engineering-github-skill-"));
const installed = path.join(tmp, "loop-engineering");
fs.cpSync("skills/loop-engineering", installed, { recursive: true });
Expand All @@ -164,6 +164,7 @@ test("Skill validation accepts GitHub CLI source metadata on an installed copy",
const tracking = [
"metadata:",
" github-path: skills/loop-engineering",
" github-pinned: v1.0.1",
" github-ref: refs/tags/v1.0.1",
" github-repo: https://github.com/sheepxux/Loop-Engineering",
" github-tree-sha: 0123456789abcdef0123456789abcdef01234567"
Expand Down