fix(registry): reject whole-repo source when publishing a skill#5962
Merged
Conversation
A skill published with a bare GitHub repo-root source (owner/repo, or a branch root with no sub-path) silently mass-installs every SKILL.md in the repo: the installsource planner misses plugin detection for repos that only ship a .claude-plugin manifest and falls through to a full-repo skill scan. Validate at publish time — a kind:skill submission whose source resolves to a whole repo is now rejected with a 422 and guidance to point source at a single skill (a /tree/<branch>/<path> subtree or a raw SKILL.md URL). MCP kinds and non-GitHub sources are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Publishing a
kind: skillpackage with a bare GitHub repo-rootsource(
owner/repo, or a branch root with no sub-path) silently mass-installs therepo's entire skill library. This validates
sourceat publish time and rejectsthat shape.
Why
For
kind: autoa bare repo URL goes throughinternal/installsource/plan.go:plugin detection only recognizes
reasonix-plugin.json/.codex-plugin/plugin.json(
plugin_package.go:30), so a repo whose only manifest is.claude-plugin/plugin.jsonfalls through to
scanGitHubSkills, which walks the whole repo and installsevery
SKILL.mdit finds (bounded only at 200). A package named for oneskill can thus drop dozens of unrelated skills into a user's setup, with no error.
Motivating case: a community submission
hello_world/grill-mewithsource: https://github.com/mattpocock/skills— that repo carries 38SKILL.mdfiles.
How
PublishSchema.superRefine: whenkind === "skill"andsourceresolves to awhole GitHub repo (bare
owner/repo, or.../tree/<branch>with no path),reject with a 422 and point the publisher at a single-skill source
(a
.../tree/<branch>/skills/<name>subtree, or a rawSKILL.mdURL). MCP kinds,scoped/blob/raw URLs, and non-GitHub sources are unaffected.
Test
Verified the classifier against a 13-case table (bare root,
.gitsuffix,trailing slash, branch-root, scoped subtree, blob file,
raw.githubusercontenthost,
git:prefix, scheme-less, non-github, non-URL, empty) plus the kind gate(skill rejects, mcp allows) — all pass. The worker has no local test runner; the
change is a standard zod v3 refinement.
Deploy
Merging to
main-v2triggersdeploy-crash-worker.yml→wrangler deploytocrash.reasonix.io.