cli/cli PR #13894 — Support nested skill discovery — PR #13894
cli/cli · pull request #13894 ·
Transcript
PlainEnglish
Let's walk through pull request thirteen thousand eight hundred ninety four for the GitHub CLI. This PR expands skill discovery to support nested skills at any directory depth, removing the requirement for a skills directory prefix.
PlainEnglish
This pull request pursues five objectives. The primary goal is enabling nested skill discovery without requiring a skills directory. Supporting that are improvements to version parsing for scoped packages, path-based disambiguation when skill names collide, upstream path preservation during redirects, and updated help text.
PlainEnglish
Previously, the Agent Skills spec required skills to follow specific conventions like skills slash star slash skill dot m d. This limited flexibility for repository layouts. The PR broadens discovery to accept skill dot m d files at any directory depth, excluding hidden directories, enabling layouts like performance slash r eight analyzer.
Architecture
The changes touch three main areas. Discovery logic in internal skills discovery gains nested convention support. The install command gains smarter path matching and version parsing. And search gets path-based deduplication to preserve skills with identical names in different locations.
Architecture
Here's the core discovery change. The match skill conventions function now recognizes a nested convention for skill dot m d files in arbitrary non-hidden directories. If the parent isn't the root and there's no hidden segment, it sets convention to nested, enabling paths like performance slash r eight analyzer.
Architecture
Version parsing got smarter to handle scoped package names. The new cut skill version function splits on the last at sign only if it appears after position zero and the text after it contains no slashes. This correctly handles scoped names like packages slash at acme slash lint while still parsing versions like at v one dot zero.
Architecture
To disambiguate skills with identical names, the new skill selection key helper returns the exact skill dot m d path when multiple skills share the same display name, otherwise it returns the display name. This enables UIs to show paths like category a slash lint slash skill dot m d versus category b slash lint slash skill dot m d.
Architecture
When redirecting to upstream repositories, the code now preserves the skill's path from metadata. If the user specified a path and the upstream path is available from the github dash path field in skill dot m d, it uses that. Otherwise it falls back to the skill name. This ensures correct reinstallation from upstream repos with different layouts.
Architecture
Help text and error messages got an update too. Install help now explains that skills are discovered by finding skill dot m d at any depth, with examples of both skills slash code review and performance slash r eight analyzer layouts. Error messages moved from enumerating all conventions to a generic description, and publish help references nested category layouts.
PlainEnglish
After this PR lands, the skill discovery system accepts skill dot m d files at any directory depth except hidden directories. Repository layouts can mix nested skills like performance slash r eight analyzer with traditional skills slash code review. Users can disambiguate identical names by specifying exact paths. Version parsing handles scoped packages correctly. And upstream detection preserves paths from metadata, enabling correct re-installation from upstream repos.
CodeQuality
There are a few things to watch. The upstream redirect logic assumes is skill path works correctly for nested paths. Version parsing relies on the slash check to distinguish scoped names from versions, which is a subtle invariant. The ambiguous name error assumes path fields end in directories not slash skill dot m d. Prompt install passes the path without a guard, so an empty path would silently pass a bad argument. And the new command field uses a nil-check lazy-init pattern that's non-standard for this codebase.
PlainEnglish
That's pull request thirteen thousand eight hundred ninety four. A focused refactor that broadens skill discovery to support flexible nested layouts while strengthening path-based disambiguation. The new nested convention lives at discovery dot go lines four six eight through four seven four. The cut skill version helper was added at install dot go six fifteen through six twenty three. And skill selection key enables path-based UI at install dot go eight eighty four through eight ninety one.
How this was made
Lenzon read cli/cli at pull request #13894 and generated this walkthrough automatically. The narration above is the transcript of what it says.
Explain a pull request from your own repo
Point Lenzon at a repo or a pull request and get a narrated walkthrough like this one.
Try it