
marketplace-validator
Validates marketplace.json schema after every edit in this repository
- version
- 1.0.0
- GitHub stars
- 16
Install
/plugin install marketplace-validator@bershadsky-claude-toolsRun it inside Claude Code after adding the marketplace with /plugin marketplace add sergio-bershadsky/ai.
Contents
Discovered from sourceAgents 1
Marketplace Validator Plugin
Validates marketplace.json schema after every edit in this repository.
Installation
/plugin marketplace add sergio-bershadsky/ai
/plugin install marketplace-validator@bershadsky-claude-tools
Overview
This plugin automatically validates the .claude-plugin/marketplace.json file after any Write or Edit operation, ensuring the marketplace registry maintains a consistent schema.
How It Works
Write/Edit Tool → PostToolUse Hook → Validate Schema
↓
Pass: Continue silently
Fail: Report errors to Claude
Hooks
Validate Marketplace (PostToolUse)
- Trigger: After Write|Edit tool use
- Action: Validates marketplace.json against required schema
- Behavior: Runs after the write has happened, so it cannot undo it. On failure it prints the errors to stderr and exits 2; Claude Code feeds them back to Claude, which then fixes the file.
Exit Codes:
0— Validation passed or file doesn't exist2— Validation failed; errors on stderr are shown to Claude
Validation Rules
Required Top-Level Fields
| Field | Type | Description |
|---|---|---|
name | string | Marketplace name |
owner | object | Owner information |
owner.name | string | Owner name (required) |
owner.email | string | Owner email (optional) |
plugins | array | List of plugins |
Required Plugin Fields
| Field | Type | Description |
|---|---|---|
name | string | Plugin name |
source | string | Path to plugin directory |
description | string | Plugin description |
version | string | Plugin version |
Invalid/Deprecated Fields
| Field | Error |
|---|---|
path | Use source instead |
keywords | Not allowed in marketplace plugins |
Example marketplace.json
{
"name": "my-marketplace",
"owner": {
"name": "John Doe",
"email": "john@example.com"
},
"plugins": [
{
"name": "my-plugin",
"source": "plugins/my-plugin",
"description": "A useful plugin",
"version": "1.0.0"
}
]
}
Error Messages
Missing Field
marketplace.json validation failed:
- plugins[0]: missing required field 'source' (did you use 'path' instead?)
Invalid JSON
marketplace.json is not valid JSON: Expecting ',' delimiter: line 5 column 3
Type Errors
marketplace.json validation failed:
- Field 'name' must be a string
- owner.name must be a string
Use Cases
- Plugin Development — Validate changes while developing new plugins
- Multi-developer Repos — Catch schema errors early
License
Unlicense - Public Domain
Hooks 1
Sponsors
Details
- Marketplace
- sergio-bershadsky/ai
- Source
- plugins/marketplace-validator
- Category
- Development