1// Is there a newer version? Read-only: compares this installed skill and its templates with the2// repository they came from and prints one JSON. It changes nothing and runs no update; the3// commands that would are in the output.4//5// node <SKILL_ROOT>/install/check.mjs6//7// Two layers, two answers:8// skill the installed skill folder (SKILL.md, guides/, install/) against the9// repository head: `current`, `behind` (with the files that differ), or `unknown`.10// templates `templates/.source` commit against the head: `current` or `behind`, with the11// verticals touched and the commit messages in between.12// Updating the skill changes how the agent works, not the project. Refreshing the templates changes13// what future deploys copy and what the agent reads, not `src/`. Nothing here touches `src/`.
53 ? { status: "behind", differs, ...(missingHere.length ? { missingHere } : {}), note: "a file that differs may also be one edited here; the update reinstalls the skill folder" }
54 : { status: "current" };
55}
56
57// ---- templates: the recorded commit against the head ------------------------------------------
74 out.templates.detail = git(["-C", tmp, "cat-file", "-e", src.commit]).status === 0 ? "no template changes between the two commits" : "the recorded commit is not in the repository's history (a branch that was deleted?)";
75 }
76 }
77}
78rmSync(tmp, { recursive: true, force: true });
79
80// ---- what would act on each ------------------------------------------------------------------