|
1 | 1 | # MiniMax Code plugin compatibility |
2 | 2 |
|
3 | | -## Portable package |
| 3 | +This document describes what MiniMax Code reads from an Agent Plugin. There are two runtime |
| 4 | +layouts in active use: |
| 5 | + |
| 6 | +- The **portable Agent Plugins 1.0** layout below is the cross-runtime baseline. It is what the |
| 7 | + validator checks and what mcode 0.3.x reads. It is also what mcode 0.4.0+ continues to accept |
| 8 | + when it is found on disk. |
| 9 | +- The **v0.4.0+ plugin format** section below describes the Claude Code compatible layout that |
| 10 | + mcode 0.4.0+ adopts as the preferred form: the manifest moves to `.claude-plugin/plugin.json` |
| 11 | + and Hooks are inlined on the manifest. A Plugin that targets mcode 0.4.0+ exclusively should |
| 12 | + use this layout; a Plugin that targets both 0.3.x and 0.4.0+ should ship both layouts in |
| 13 | + parallel. |
| 14 | + |
| 15 | +The full v0.4.0+ Hooks specification is in |
| 16 | +[`proposals/hooks-v0.4-spec.md`](../proposals/hooks-v0.4-spec.md) and a working example is in |
| 17 | +[`examples/hello-mcode-hooks-v04/`](../examples/hello-mcode-hooks-v04/). |
| 18 | + |
| 19 | +## Portable package (Agent Plugins 1.0, mcode 0.3.x) |
4 | 20 |
|
5 | 21 | MiniMax Code reads the portable subset of Agent Plugins 1.0: |
6 | 22 |
|
@@ -51,20 +67,85 @@ MiniMax Code reserves `PLUGIN_ROOT` and `PLUGIN_DATA`. A plugin must not set tho |
51 | 67 | Do not embed tokens in environment values or headers. Generic OAuth configuration is not part of |
52 | 68 | this portable subset. |
53 | 69 |
|
| 70 | +## v0.4.0+ plugin format (mcode 0.4.0+ runtime) |
| 71 | + |
| 72 | +mcode 0.4.0+ (`@minimax-ai/code@0.4.0`, released 2026-09-11) adopts the Claude Code compatible |
| 73 | +plugin shape as the preferred form. A Plugin that targets mcode 0.4.0+ exclusively uses this |
| 74 | +layout; a Plugin that targets both 0.3.x and 0.4.0+ ships both layouts in parallel. |
| 75 | + |
| 76 | +```text |
| 77 | +plugin-root/ |
| 78 | +├── README.md # required by this community repository |
| 79 | +├── LICENSE # required by this community repository |
| 80 | +├── .claude-plugin/ |
| 81 | +│ └── plugin.json # the v0.4.0+ manifest, with inline `hooks` |
| 82 | +├── io.minimax.mcode/ # hook scripts, same layout as the portable package |
| 83 | +│ └── hooks/ |
| 84 | +│ └── scripts/ |
| 85 | +│ └── *.ps1 | *.mjs | *.sh # one script per event handler |
| 86 | +└── skills/ |
| 87 | + ├── SKILL.md # top-level single Skill (preferred for a focused Plugin) |
| 88 | + └── <plugin-name>/ # subdir copy, for the v0.3.x runtime and the validator |
| 89 | + └── SKILL.md |
| 90 | +``` |
| 91 | + |
| 92 | +The v0.4.0+ manifest is a single JSON object whose only strictly required field is `name`. The |
| 93 | +full schema and the inline `hooks` shape are in |
| 94 | +[`proposals/hooks-v0.4-spec.md`](../proposals/hooks-v0.4-spec.md); the short summary is: |
| 95 | + |
| 96 | +- `name` (required): Plugin name; lowercase letters, digits, single hyphens. |
| 97 | +- `version` (recommended): Semver; bump major for any breaking manifest change. |
| 98 | +- `skills`: path or array of paths to Skill files, each relative to `.claude-plugin/` and |
| 99 | + starting with `./`. Top-level `skills/SKILL.md` is the recommended layout for a focused |
| 100 | + Plugin. A Plugin that ships a top-level Skill should also ship a `skills/<plugin-name>/SKILL.md` |
| 101 | + copy under a subdirectory whose name matches the Plugin's `name`, so the v0.3.x runtime and |
| 102 | + the current validator accept the package. |
| 103 | +- `mcpServers`: same shape as the Agent Plugins 1.0 `mcpServers` field. |
| 104 | +- `hooks`: inline hook definitions, replacing the v0.3.x `io.minimax.mcode/hooks/hooks.json` |
| 105 | + document. The 12 PascalCase event names (`SessionStart`, `SessionEnd`, `PreToolUse`, |
| 106 | + `PostToolUse`, `UserPromptSubmit`, `Stop`, `PreCompact`, `Notification`, `SubagentStart`, |
| 107 | + `SubagentStop`, `PermissionRequest`, `PermissionDenied`) and the per-event handler shape are |
| 108 | + identical to the v0.3.x spec; the layout change is the only difference. See the proposal for |
| 109 | + the full event table, the matcher rules, the `timeout` units, and the hook script conventions. |
| 110 | + |
| 111 | +Three things bite Plugin authors migrating from the v0.3.x layout. The full lessons are in the |
| 112 | +proposal; the short version is: |
| 113 | + |
| 114 | +1. The manifest **must** live at `.claude-plugin/plugin.json`. A top-level `plugin.json` is |
| 115 | + ignored by mcode 0.4.0+. |
| 116 | +2. The `skills` field must point at a path the snapshot builder can resolve. A path into a |
| 117 | + nested subdirectory whose name does not match the SKILL.md frontmatter `name` is silently |
| 118 | + dropped; the Plugin does not load, no diagnostic is emitted. Use `./skills/SKILL.md` for |
| 119 | + a single-Skill Plugin, or rename the subdirectory to match the frontmatter `name`. |
| 120 | +3. Hooks **must** be inlined on the manifest under the `hooks` key. The |
| 121 | + `io.minimax.mcode/hooks/hooks.json` document is ignored by mcode 0.4.0+. |
| 122 | + |
| 123 | +A working example with one PowerShell hook script and one top-level Skill is in |
| 124 | +[`examples/hello-mcode-hooks-v04/`](../examples/hello-mcode-hooks-v04/). It ships both |
| 125 | +`skills/SKILL.md` (for the v0.4.0+ runtime) and `skills/hello-mcode-hooks-v04/SKILL.md` (for |
| 126 | +the validator and the v0.3.x runtime) as byte-identical copies, per the recommended |
| 127 | +cross-version layout. |
| 128 | + |
54 | 129 | ## Limits and unsupported capabilities |
55 | 130 |
|
56 | 131 | The runtime accepts at most 64 Skill directories and 8 MCP servers per Agent Plugin. Invalid Skills |
57 | 132 | or MCP entries are omitted with diagnostics; an invalid root manifest rejects the package. |
58 | 133 |
|
59 | | -The following are not currently public MCode Plugin capabilities: |
| 134 | +The following are not currently public MCode Plugin capabilities in either runtime: |
60 | 135 |
|
61 | | -- Hooks and lifecycle scripts |
62 | 136 | - custom Agents and Commands |
63 | 137 | - LSP configuration |
64 | 138 | - Apps or UI extensions |
65 | 139 | - generic OAuth setup |
66 | 140 | - host-specific fields hidden in `extensions` |
67 | 141 |
|
| 142 | +Hooks and lifecycle scripts are **not** a portable Agent Plugins 1.0 capability, but mcode |
| 143 | +0.4.0+ accepts them via the inline `hooks` field on `.claude-plugin/plugin.json`. Plugins that |
| 144 | +target mcode 0.3.x use the experimental `io.minimax.mcode/hooks/hooks.json` document; that |
| 145 | +document is the right reference for the 0.3.x runtime. See |
| 146 | +[`proposals/hooks-v0.4-spec.md`](../proposals/hooks-v0.4-spec.md) and |
| 147 | +[`proposals/hooks-detailed-spec.md`](../proposals/hooks-detailed-spec.md) for the two specs. |
| 148 | + |
68 | 149 | Hosted contributions may contain extra assets, but documentation must not imply that MiniMax Code |
69 | 150 | loads unsupported components. TUI Extensions are a separate product extension system, not an Agent |
70 | 151 | Plugin capability. |
0 commit comments