fix(skill): stop registering auxiliary docs inside a skill bundle as skills - #2127
fix(skill): stop registering auxiliary docs inside a skill bundle as skills#2127he-yufeng wants to merge 2 commits into
Conversation
…skills Every plugin manifest skills entry becomes a scan root with isTopLevel=true, so the flat .md loop ran inside bundle dirs and registered payload files (GLOSSARY-FORMAT.md and friends) as standalone skills. Flat .md registration now only runs when the root is not itself a bundle (no top-level SKILL.md).
🦋 Changeset detectedLatest commit: 3a92b0d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 899920092d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // When the root itself is a skill bundle (it holds SKILL.md), its other | ||
| // .md files are payload (references, glossaries), not flat skills. | ||
| // Flat .md registration only makes sense for collection dirs. | ||
| if (!isBundleDir) { |
There was a problem hiding this comment.
Keep flat skills visible in non-plugin roots
In a normal user/project skill collection, if the root contains an incidental top-level SKILL.md plus flat skills such as review.md, this new guard skips the entire flat-skill registration loop. Existing behavior treats top-level SKILL.md in non-plugin roots as not a skill, but it should not make every sibling flat skill disappear; only plugin roots use SKILL.md as the bundle fallback, so the suppression should be gated to that case.
Useful? React with 👍 / 👎.
|
Added the missing changeset in 3a92b0d (patch on @moonshot-ai/agent-core). The scanner behavior is unchanged: a directory that holds SKILL.md is a bundle and its other .md files stay payload, only collection directories register flat .md skills. |
commit: |
What
A plugin manifest's
skillsentries each become a scan root withisTopLevel=true, so the scanner's flat.mdloop ran inside skill bundle directories and registered payload files as standalone skills. Withmattpocock-skillsthe manifest lists 22 bundles, yet ~43 skills show up: files liketeach/GLOSSARY-FORMAT.mdget registered as a skill namedGLOSSARY-FORMAT, even though they are reference docs the bundle'sSKILL.mdcites.Fix
Flat
.mdregistration now only runs when the scan root is not itself a skill bundle (noSKILL.mddirectly at the root). A bundle dir's other markdown files stay payload. The plugin-root bundle fallback (a root holdingSKILL.mdbeing registered as a single skill) is unchanged, and flat.mdfiles in collection dirs (no top-levelSKILL.md) still register.Tests
Two new scanner tests:
SKILL.mdplus an auxiliaryGLOSSARY-FORMAT.mdyields only the bundle's skillSKILL.mdstill registers both a flat.mdskill and a bundle subdirectorypnpm testfor@moonshot-ai/agent-core: 3998 passed, 0 failed.pnpm typecheckclean.Fixes #2124