Gate CI on drift
Make a CI job fail when installed skills drift from the lockfile, or when newer skill versions are available. GSKILL is non-interactive by default, so these commands are CI-safe out of the box.
Before you start
Section titled “Before you start”- A committed
skills-lock.json. - A CI job that checks out the repo and has
gskillavailable.
Recipe 1 — Fail on drift
Section titled “Recipe 1 — Fail on drift”gskill install --frozen-lockfile # restore exactly; exit 4 if lock is out of syncgskill project check --fail-on-drift # exit 7 if installed state drifts from the lockExpected: both exit 0 on a clean, in-sync project. check --fail-on-drift exits 7 if drift
is detected; install --frozen-lockfile exits 4 if the lock cannot be restored exactly as recorded.
Recipe 2 — Fail when updates are available
Section titled “Recipe 2 — Fail when updates are available”gskill outdated --exit-code # exit 8 if any skill has a newer versionExpected: exit 0 when everything is current; exit 8 when at least one update is available.
Use this in a scheduled job to be notified, not in the main build if you don’t want updates to break it.
Reading results in scripts
Section titled “Reading results in scripts”gskill project check --json # structured status on stdoutDiagnostics go to stderr; the --json result is the only thing on stdout, so it stays
parseable.