Skip to content

Commit fecbd4c

Browse files
grokifyclaude
andcommitted
docs(publishing): update marketplace docs for bundle API and consolidated format
Document the new bundle package API and consolidated plugin.json format: - Add Go code example using bundle.New(), AddMCPServer(), AddSkill(), etc. - Document consolidated plugin.json with embedded mcpServers and hooks - Add plugin.json fields reference table - Add MCP server configuration examples - Add hooks configuration with event types and hook types - Update directory structure to show consolidated config Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent aeb9962 commit fecbd4c

1 file changed

Lines changed: 163 additions & 7 deletions

File tree

docs/publishing/claude-marketplace.md

Lines changed: 163 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,87 @@ anthropics/claude-plugins-official/
1010
└── external_plugins/ # Community plugins
1111
└── your-plugin/
1212
├── .claude-plugin/
13-
│ └── plugin.json
14-
├── commands/
15-
├── skills/
16-
├── agents/
17-
└── README.md
13+
│ └── plugin.json # Consolidated config (MCP + hooks embedded)
14+
├── commands/ # Optional: Slash commands
15+
├── skills/ # Optional: Skills
16+
├── agents/ # Optional: Agents
17+
└── README.md # Required: Documentation
1818
```
1919

2020
## Requirements
2121

2222
Your plugin must have:
2323

24-
- `.claude-plugin/plugin.json` - Plugin metadata
24+
- `.claude-plugin/plugin.json` - Plugin manifest (with embedded MCP and hooks)
2525
- `README.md` - Documentation
2626

27+
## Generating with Bundle API
28+
29+
Use the assistantkit bundle package to generate properly formatted plugin files:
30+
31+
```go
32+
package main
33+
34+
import (
35+
"log"
36+
37+
"github.com/agentplexus/assistantkit/bundle"
38+
"github.com/agentplexus/assistantkit/hooks/core"
39+
)
40+
41+
func main() {
42+
// Create bundle
43+
b := bundle.New("my-plugin", "1.0.0", "A helpful plugin")
44+
b.Plugin.Author = "Your Name"
45+
b.Plugin.License = "MIT"
46+
b.Plugin.Repository = "https://github.com/yourname/my-plugin"
47+
48+
// Add MCP server
49+
b.AddMCPServer("my-server", bundle.MCPServer{
50+
Command: "./my-server",
51+
Env: map[string]string{
52+
"API_KEY": "${MY_API_KEY}",
53+
},
54+
})
55+
56+
// Add hooks
57+
cfg := bundle.NewHooksConfig()
58+
cfg.AddHook(core.OnStop, core.Hook{
59+
Type: "prompt",
60+
Prompt: "Task stopped. Consider follow-up actions.",
61+
})
62+
b.SetHooks(cfg)
63+
64+
// Add skill
65+
skill := bundle.NewSkill("my-skill", "Skill description")
66+
skill.Instructions = "# My Skill\n\nInstructions here..."
67+
b.AddSkill(skill)
68+
69+
// Add command
70+
cmd := bundle.NewCommand("my-cmd", "Command description")
71+
cmd.Instructions = "Command instructions..."
72+
b.AddCommand(cmd)
73+
74+
// Generate for Claude Code
75+
if err := b.Generate("claude", "./output"); err != nil {
76+
log.Fatalf("Generate failed: %v", err)
77+
}
78+
}
79+
```
80+
81+
This generates:
82+
83+
```
84+
output/
85+
├── .claude-plugin/
86+
│ └── plugin.json # Consolidated with MCP + hooks embedded
87+
├── commands/
88+
│ └── my-cmd.md
89+
└── skills/
90+
└── my-skill/
91+
└── SKILL.md
92+
```
93+
2794
## Manual Submission
2895

2996
### 1. Fork the Repository
@@ -154,17 +221,106 @@ if err != nil {
154221

155222
## plugin.json Format
156223

224+
The consolidated format embeds MCP servers and hooks directly in `plugin.json`:
225+
157226
```json
158227
{
159228
"name": "my-plugin",
160229
"version": "1.0.0",
161230
"description": "A helpful plugin for developers",
162231
"author": "Your Name",
163232
"repository": "https://github.com/yourname/my-plugin",
164-
"license": "MIT"
233+
"license": "MIT",
234+
"mcpServers": {
235+
"my-server": {
236+
"command": "./my-server",
237+
"args": ["--mode", "production"],
238+
"env": {
239+
"API_KEY": "${MY_API_KEY}"
240+
}
241+
}
242+
},
243+
"hooks": {
244+
"PreToolUse": [
245+
{
246+
"matcher": "Bash",
247+
"hooks": [
248+
{
249+
"type": "command",
250+
"command": "echo 'Running command...'"
251+
}
252+
]
253+
}
254+
],
255+
"Stop": [
256+
{
257+
"hooks": [
258+
{
259+
"type": "prompt",
260+
"prompt": "The task has stopped. Consider if follow-up is needed."
261+
}
262+
]
263+
}
264+
]
265+
},
266+
"commands": "./commands/",
267+
"skills": "./skills/",
268+
"agents": "./agents/"
165269
}
166270
```
167271

272+
### plugin.json Fields
273+
274+
| Field | Type | Required | Description |
275+
|-------|------|----------|-------------|
276+
| `name` | string | Yes | Plugin identifier (lowercase, dashes) |
277+
| `version` | string | Yes | Semantic version (e.g., `1.0.0`) |
278+
| `description` | string | Yes | Brief description |
279+
| `author` | string | No | Author name or organization |
280+
| `license` | string | No | License identifier (e.g., `MIT`) |
281+
| `repository` | string | No | GitHub repository URL |
282+
| `homepage` | string | No | Project homepage URL |
283+
| `mcpServers` | object | No | MCP server configurations |
284+
| `hooks` | object | No | Event hooks (PreToolUse, PostToolUse, Stop, etc.) |
285+
| `commands` | string | No | Path to commands directory |
286+
| `skills` | string | No | Path to skills directory |
287+
| `agents` | string | No | Path to agents directory |
288+
289+
### MCP Server Configuration
290+
291+
```json
292+
{
293+
"mcpServers": {
294+
"server-name": {
295+
"command": "./path/to/binary",
296+
"args": ["--flag", "value"],
297+
"env": {
298+
"VAR_NAME": "${ENV_VAR}"
299+
},
300+
"cwd": "/optional/working/dir",
301+
"disabled": false
302+
}
303+
}
304+
}
305+
```
306+
307+
### Hooks Configuration
308+
309+
Hooks are triggered on specific events:
310+
311+
| Event | Description |
312+
|-------|-------------|
313+
| `PreToolUse` | Before tool execution (can use `matcher` to filter) |
314+
| `PostToolUse` | After tool execution |
315+
| `Stop` | When agent stops |
316+
| `Notification` | When notifications occur |
317+
| `SubagentStop` | When subagent stops |
318+
319+
Hook types:
320+
321+
- `command` - Execute a shell command
322+
- `prompt` - Inject a prompt for the model to consider
323+
168324
## Dry Run
169325

170326
Test the publish process without creating a PR:

0 commit comments

Comments
 (0)