Skip to content

fix(skill): stop registering auxiliary docs inside a skill bundle as skills - #2127

Open
he-yufeng wants to merge 2 commits into
MoonshotAI:mainfrom
he-yufeng:fix/skill-bundle-payload-not-skills
Open

fix(skill): stop registering auxiliary docs inside a skill bundle as skills#2127
he-yufeng wants to merge 2 commits into
MoonshotAI:mainfrom
he-yufeng:fix/skill-bundle-payload-not-skills

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

What

A plugin manifest's skills entries each become a scan root with isTopLevel=true, so the scanner's flat .md loop ran inside skill bundle directories and registered payload files as standalone skills. With mattpocock-skills the manifest lists 22 bundles, yet ~43 skills show up: files like teach/GLOSSARY-FORMAT.md get registered as a skill named GLOSSARY-FORMAT, even though they are reference docs the bundle's SKILL.md cites.

Fix

Flat .md registration now only runs when the scan root is not itself a skill bundle (no SKILL.md directly at the root). A bundle dir's other markdown files stay payload. The plugin-root bundle fallback (a root holding SKILL.md being registered as a single skill) is unchanged, and flat .md files in collection dirs (no top-level SKILL.md) still register.

Tests

Two new scanner tests:

  • a bundle dir holding SKILL.md plus an auxiliary GLOSSARY-FORMAT.md yields only the bundle's skill
  • a collection dir without a top-level SKILL.md still registers both a flat .md skill and a bundle subdirectory

pnpm test for @moonshot-ai/agent-core: 3998 passed, 0 failed. pnpm typecheck clean.

Fixes #2124

…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-bot

changeset-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3a92b0d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/agent-core Patch

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

@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: 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) {

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 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 👍 / 👎.

@he-yufeng

Copy link
Copy Markdown
Contributor Author

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.

@pkg-pr-new

pkg-pr-new Bot commented Aug 16, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@3a92b0d
npx https://pkg.pr.new/@moonshot-ai/kimi-code@3a92b0d

commit: 3a92b0d

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