Skip to content

docs(plugins): publish Plugin V1 format contract, schemas and a dependency-free public validator - #484

Open
hetaoBackend wants to merge 6 commits into
mainfrom
docs/plugin-format-contract
Open

hetaoBackend wants to merge 6 commits into
mainfrom
docs/plugin-format-contract

Conversation

@hetaoBackend

@hetaoBackend hetaoBackend commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

背景

外部作者目前没有任何路径接触到 MiniMax Code 的 Plugin 包格式:

  • 格式契约、5 个 JSON Schema、参考向量、validator 全部位于内网 marketplace 仓(gitlab.xaminim.com/matrix/minimax-plugin-marketplace);
  • 公开仓 minimax-code 里没有任何 Plugin 资产;
  • 唯一的上手工具 plugin-creator 是私有 skill,只产出本地包,不是官方 Marketplace 包。

外部作者即使看了 GitHub 也看不到官方 Plugin 的存在,更看不到格式契约。

变更

  • docs/plugins/ — package-format-v1.md、host-bindings.md、showcases.md,以及新增的 README.md(从 clone 到提交的完整上手路径)
  • schemas/plugins/ — plugin-v1 / mcp-v1 / app-v1 / host-binding-v1 / marketplace-v1
  • test-vectors/plugins/ — content-digest-v1 的 source / expected 参考向量
  • tools/plugins/validate-plugin.mjs — 公开 validator
  • scripts/source-inventory.mjs — check:source 现在会调用 validator
  • package.json — 新增 pnpm check:plugin

validator 的设计约束

零运行时依赖。这不是偏好,是硬约束:check:source 也会在导出后的 source 快照里执行(该快照没有 node_modules),任何第三方 import 都会让门禁失败。因此 Skill frontmatter 用内联解析器处理 V1 所需的标量映射子集。

不重复实现官方规则。catalog 成员资格、跨文件能力闭合、archive 上限、content_digest 仍由官方 Marketplace validator 在提交时执行,validator 会显式声明这一点。

与 CI 同源。外部作者跑的 node tools/plugins/validate-plugin.mjs 和 check:source 跑的是同一段代码,本地通过意味着 CI 通过。

验证

正例——官方四类 fixture 全部通过:

app-only     passed the public Plugin V1 checks.
mcp-only     passed the public Plugin V1 checks.
skill-only   passed the public Plugin V1 checks.
composite    passed the public Plugin V1 checks.

负例——四种坏包全部被拒:

用例 报出的问题
非法 category SCHEMA_ENUM + SCHEMA_ANY_OF
name 与目录不符 NAME_MISMATCH
skills 引用 ../outside/SKILL.md SCHEMA_PATTERN + PATH_SEGMENT + SKILL_MISSING
Skill frontmatter 缺 description SKILL_DESCRIPTION

门禁:pnpm verify --profile docs → 4 gates PASS(55 tests / 54 pass / 1 skip)。

对 @开源布道者 的依赖

本 PR 只搬契约,不动闸门四文件。外部 Plugin 走的是公开仓 PR 通道,因此:

  • CONTRIBUTING.md / docs/maintainers.md / ISSUE_TEMPLATE / PULL_REQUEST_TEMPLATE 需要在 Plugin 贡献路径上同步说明(建议作为第 5 处联动);
  • CODEOWNERS 建议把 docs/plugins/、schemas/plugins/、tools/plugins/ 路由给 reviewer,否则外部 Plugin PR 会撞到 * @hetaoBackend。

🤖 Generated with MiniMax Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Register the two new community documents in the public source inventory so
check:source passes.

- docs/community/oncall.md: role split (chat vs GitHub), rotation windows,
  48h triage SLA, label hygiene rules, contribution-request rules, weekly
  feedback replay, reply templates, weekly metrics.
- docs/community/groups.md: three community layers and what belongs in each,
  the single entry point, movement rules, Insider external-disclosure rule,
  showcase wall and AMA format.
…validator

External authors had no path to the Plugin package format: the contract,
the four JSON Schemas, the reference vectors and the validator all lived in
the internal marketplace repository, and the only onboarding tool
(plugin-creator) is private.

This publishes the contract into the public repository:

- docs/plugins/package-format-v1.md, host-bindings.md, showcases.md
- schemas/plugins/{plugin,mcp,app,host-binding,marketplace}-v1.schema.json
- test-vectors/plugins/content-digest-v1.{source,expected}.json
- tools/plugins/validate-plugin.mjs

The public validator runs the same code path an external author runs, and
check:source now calls it, so the published schemas and the validator cannot
drift apart. It uses only dependencies the repository already declares.

Catalog membership, cross-file capability closure, archive limits and
content_digest remain the responsibility of the official Marketplace
validator at submission time.
check:source also runs inside the exported source snapshot, which has no
node_modules, so importing a YAML parser made the gate fail there. The Skill
frontmatter subset the V1 contract requires is a flat scalar mapping, so it is
parsed inline instead.
…gin entry

The contract was published without a way in. This adds docs/plugins/README.md
with the clone-to-submit path and a pnpm check:plugin script so an author can
run the same validation the CI runs.
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