Skip to content

feat(check): add --exit-code to fail when anything is not up to date - #865

Merged
runkids merged 4 commits into
mainfrom
runkids/check-exit-code
Nov 11, 2026
Merged

runkids merged 4 commits into
mainfrom
runkids/check-exit-code

Conversation

@runkids

@runkids runkids commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

A small feature opened at the maintainer's request. There is no linked issue, so the last box stays unticked.

Linked Issue

None.

What and why

skillshare check exits 1 only when an item could not be checked. A CI job that wants to fail on pending updates or local edits has to parse --json and compare statuses itself.

--exit-code is opt-in. With it, a check that ran cleanly exits 1 when anything is not up to date:

  • skills: update_available, stale, modified
  • tracked repositories: behind, dirty, missing
  • agents (check agents): update_available, drifted, dirty

Only items whose status is local (nothing to compare) are left out; a local-path install whose source changed is update_available and counts. Without the flag the exit status is unchanged. With --json the full results are still printed and only the exit code changes. The operation log records such a run as successful, because the check itself did not fail. The flag is rejected together with --diff.

Also updated: --help, all five shell completions, check.md in English and four translations, and the built-in skill's check section.

Checks

  • make check in a devcontainer-image container on the worktree: exit 0, before the rebase onto main. The rebase only brought in docs(comparison): re-pin the npx skills comparison to v1.8.1 #864 (docs and .gitignore).
  • New integration tests: global mode with a tracked repo behind (text and --json), a single named target, project mode with a changed local source, check agents with a drifted agent, the up-to-date case, the --diff conflict, and the completion strings for five shells.
  • Reviewed with the skillshare-code-review skill; its confirmed findings are fixed.
  • Not run: the website build.

Not covered

These exist on main without the flag and are left for follow-ups:

  • check --all does not check agents, so --all --exit-code does not gate on them. Use check agents --exit-code.
  • check <unknown-name> --json prints empty results and exits 0, with or without the flag.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

`check` exits 1 only when an item could not be checked. A CI job that
wants to fail on pending updates or local edits had to parse `--json`
and compare statuses itself.

`--exit-code` makes a check that ran cleanly exit 1 when any skill,
tracked repository or agent is not up to date. Items with a local
source do not count, and the default exit status is unchanged. The
operation log still records such a run as successful, because the check
itself did not fail. The flag is rejected with `--diff`, which prints
a comparison and has no status to gate on.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T15:18:10.818956Z ef9e9b3 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The built-in skill's agents reference listed only `check agents --json`, so an agent asked to gate CI on agent drift would not learn the flag from it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a09c5c2406

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


`check` exits with code `1` if any checked item has status `error` (for example, an unreachable remote or a missing local source). Available updates, stale items, and local modifications alone do not cause failure. With `--json`, stdout still contains the complete results; inspect each item's `status` and `message` for details.

Pass `--exit-code` to also exit with code `1` when every item could be checked but something is not up to date: an available update, a stale or locally modified skill, or a tracked repository that is behind, has uncommitted changes, or is missing. Items with a local source do not count. The same applies to `check agents`, where an agent whose file changed since install also counts. It works with `--json` and cannot be combined with `--diff`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clarify which local items are excluded from the CI gate

For a supported local-path installation such as skillshare install ./vendor/team-skill -p, changing the source causes LocalSourceStatus to return update_available, and check -p --exit-code exits 1—as the new TestCheckProject_ExitCode_FailsOnceSourceChanges explicitly verifies. Thus, “Items with a local source do not count” incorrectly promises that these installations cannot fail the CI gate. Clarify that only items whose status is local are excluded, rather than all local-source installations, and correct the same statement in the Japanese, Korean, Simplified Chinese, and Traditional Chinese check.md translations.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ef9e9b3. The sentence now says that only items whose status is local (nothing to compare) are left out, and that a local-path install whose source changed is an available update and counts. Corrected in the English page and the ja, ko, zh-Hans and zh-Hant translations, and in the PR description, which had the same sentence. No code change: TestCheckProject_ExitCode_FailsOnceSourceChanges already covers the behavior. The help text, completions and built-in skill do not make the claim.

The check page said items with a local source do not count toward
--exit-code. A skill installed from a local path whose source changed
is reported as update_available and does make the command exit 1, as
the project-mode test shows. Only items with status `local`, which
have nothing to compare against, are left out. Correct the sentence in
English and the four translations.
@runkids

runkids commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: ef9e9b361f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

#861 and #863 added a parseOpts parameter to runCheck and renderAgentCheck, the same functions that take exitCode here. Keep both parameters at every call site.
@runkids
runkids merged commit 8abf3f5 into main Nov 11, 2026
9 checks passed
runkids added a commit that referenced this pull request Nov 11, 2026
The row says skills check exits 1 on updates or local changes, while the Skillshare cell listed only check and update, which reads as if Skillshare cannot gate CI on drift. check --exit-code (#865) does that.
@runkids
runkids deleted the runkids/check-exit-code branch November 15, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant