feat(skills): browse + select nested GitHub-repo skills for a pack#161
Merged
Conversation
Importing a repo like mattpocock/skills failed with "no skills found": the repo nests skills as skills/<category>/<id>/SKILL.md, but discovery only matched a fixed set of top-level bases (skills, .claude/skills, .agents/skills) exactly, so anything one folder deeper was invisible. Content-fetching already resolved nested skills by leaf-dir name (Convex viewer + gateway backfill both do), so only discovery was broken. Backend (convex/skills.ts): - discoverRepoSkills finds every SKILL.md at ANY depth in one git/trees call, derives a display "category" by stripping a recognized skills-root prefix (skills/.claude/.agents/.github), and skips node_modules. Leaf id must be unique within the repo (it's the fetch key) — first wins. - New listRepoSkills action: discovers + fetches + caches each SKILL.md (so previews are instant) and returns them with category + description + the repo's AGENTS.md/CLAUDE.md, for a choose-what-you-want flow. - importSkillRepo (curated templates, add-all) now shares the same discovery, so it benefits from nested support too. A repo that resolves but has no skills now reports "no skills found", not "repo not found". Frontend: - New RepoImportDialog: a two-pane browse-and-select modal — left is the discovered skills grouped by category with per-skill / per-group / select-all checkboxes and an added-already state; right is a live SKILL.md preview (rendered markdown, served from the browse cache so it's instant). Footer lets you also pull in AGENTS.md / CLAUDE.md. This brings repo import to parity with `npx skills add` (pick individual skills, see their contents). - The pack editor's "Import a GitHub repo" now opens this dialog (Browse) instead of a blind "Import all". Tests: convex/skills.test.ts stubs a nested (mattpocock-shaped) tree and pins discovery-at-depth, category derivation, node_modules exclusion, URL normalization, caching, and the no-skills vs not-found messages. convex 239 passed; web build + biome clean.
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.
Importing
mattpocock/skills(and any nested repo) failed with "no skills found." Fixes that, and upgrades repo import to the same power asnpx skills add: browse, preview contents, and pick which skills to add.The bug
mattpocock/skillsnests skills asskills/<category>/<id>/SKILL.md, but discovery only matched a fixed set of top-level bases (skills,.claude/skills,.agents/skills) exactly — anything a folder deeper was invisible. (Content-fetching already resolved nested skills by leaf-dir name — both the Convex viewer and the gateway backfill — so only discovery was broken.)Backend (
convex/skills.ts)discoverRepoSkillsfinds every SKILL.md at any depth in onegit/treescall, derives a display category by stripping a recognized skills-root prefix, and skipsnode_modules.listRepoSkillsaction: discovers + fetches + caches each SKILL.md (so previews are instant) and returns them with category + description + the repo's AGENTS.md/CLAUDE.md — for a choose-what-you-want flow.importSkillRepo(curated templates' add-all) now shares the same discovery, so it gets nested support too. A repo that resolves but has no skills now says "no skills found," not "repo not found."Frontend
RepoImportDialog— a two-pane browse-and-select modal:Tests / checks
convex/skills.test.tsstubs a nested (mattpocock-shaped) tree and pins discovery-at-depth, category derivation,node_modulesexclusion, URL normalization, SKILL.md caching, and the no-skills-vs-repo-not-found messages.GITHUB_TOKENis already set on the prod Convex deployment, so rate limits won't bite.)After merge to staging I'll promote to main.