sergio-bershadsky avatar

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-tools

Run it inside Claude Code after adding the marketplace with /plugin marketplace add sergio-bershadsky/ai.

Contents

Discovered from source

Agents 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 exist
  • 2 — Validation failed; errors on stderr are shown to Claude

Validation Rules

Required Top-Level Fields

FieldTypeDescription
namestringMarketplace name
ownerobjectOwner information
owner.namestringOwner name (required)
owner.emailstringOwner email (optional)
pluginsarrayList of plugins

Required Plugin Fields

FieldTypeDescription
namestringPlugin name
sourcestringPath to plugin directory
descriptionstringPlugin description
versionstringPlugin version

Invalid/Deprecated Fields

FieldError
pathUse source instead
keywordsNot 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

Sponsors

Details

Marketplace
sergio-bershadsky/ai
Source
plugins/marketplace-validator
Category
Development

More from sergio-bershadsky/ai

All 13