This repository includes automated validation to ensure plugin versions in marketplace.json match their corresponding plugin.json files.
Claude Code reads plugin versions from the marketplace catalog (.claude-plugin/marketplace.json), not from individual plugin.json files. This means:
- ❌ Problem: If you update
plugins/frontend/plugin.jsonto v3.1.1 but forget to update.claude-plugin/marketplace.json, users will see the old version - ✅ Solution: Automated validation ensures both files stay in sync before releases
# From repository root
node scripts/validate-versions.jsAutomatically validate on every commit:
# From repository root
./scripts/install-hooks.shThis installs a pre-commit hook that blocks commits if versions don't match.
The validation script checks:
- ✅ Plugin versions match between marketplace.json and plugin.json
- ✅ Plugin names match
- ✅ plugin.json files exist for all marketplace entries
⚠️ Description length (recommends < 200 chars for UX)⚠️ Author email consistency
All passing:
🔍 Validating plugin versions...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📦 Marketplace: mag-claude-plugins v2.9.0
Plugin root: ./plugins
🔧 Checking plugin: frontend
✅ Version matches: v3.1.1
🔧 Checking plugin: code-analysis
✅ Version matches: v1.1.0
🔧 Checking plugin: bun
✅ Version matches: v1.2.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Validation Summary:
✅ Passed: 3
⚠️ Warnings: 0
❌ Errors: 0
✅ All version checks passed!
Safe to release.
Version mismatch found:
🔧 Checking plugin: frontend
❌ Version mismatch:
marketplace.json: 2.7.0
plugin.json: 3.1.1
❌ ERRORS FOUND:
1. [frontend] Version mismatch: marketplace="2.7.0", plugin.json="3.1.1"
Fix: Update marketplace.json line for "frontend" version to "3.1.1"
❌ Validation failed! Please fix the errors above.
When releasing a new plugin version:
-
Update plugin version:
# Edit the plugin's version vim plugins/frontend/plugin.json # Update "version": "3.1.1"
-
Update marketplace catalog:
# Update the marketplace version vim .claude-plugin/marketplace.json # Update version in plugins array
-
Validate:
node scripts/validate-versions.js
-
Commit if passing:
git add . git commit -m "chore: Release frontend v3.1.1"
When Git hooks are installed:
-
Update both versions:
vim plugins/frontend/plugin.json # v3.1.1 vim .claude-plugin/marketplace.json # v3.1.1
-
Commit (validation runs automatically):
git add . git commit -m "chore: Release frontend v3.1.1" # Hook runs automatically and blocks if versions don't match
./scripts/install-hooks.shThis copies hooks from scripts/hooks/ to .git/hooks/ and makes them executable.
- pre-commit: Validates plugin versions before allowing commit
- Runs
scripts/validate-versions.js - Blocks commit if validation fails
- Exit code 0 (pass) or 1 (fail)
- Runs
Not recommended, but if needed:
git commit --no-verifyrm .git/hooks/pre-commitAdd to your CI pipeline:
name: Validate Plugin Versions
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Validate plugin versions
run: node scripts/validate-versions.jsvalidate-versions:
stage: test
image: node:18
script:
- node scripts/validate-versions.jsscripts/validate-versions.js- Main validation scriptscripts/hooks/pre-commit- Pre-commit hook templatescripts/install-hooks.sh- Hook installation scriptdocs/VALIDATION.md- This documentation
Problem: marketplace.json references a plugin that doesn't exist
Fix: Check the source path in marketplace.json:
{
"name": "frontend",
"source": "./plugins/frontend", // Must contain plugin.json
"version": "3.1.1"
}Problem: Versions don't match between files
Fix: Update both files to the same version:
plugins/frontend/plugin.json→"version": "3.1.1".claude-plugin/marketplace.json→"version": "3.1.1"(in plugins array)
Problem: Commits succeed even with version mismatches
Fix: Reinstall hooks:
./scripts/install-hooks.sh
# Verify hook exists and is executable
ls -la .git/hooks/pre-commit- ✅ Always run validation before pushing
- ✅ Install Git hooks for automatic validation
- ✅ Update both files in the same commit
- ✅ Use semantic versioning (MAJOR.MINOR.PATCH)
- ❌ Never commit version mismatches
- ❌ Never bypass hooks without good reason
- Source of truth for the plugin's actual version
- Follows semantic versioning
- Updated when plugin changes
- Catalog entry that users see in plugin list
- Must match plugin.json version
- Updated together with plugin.json
- Version of the marketplace catalog itself
- Independent of individual plugin versions
- Update when marketplace structure changes or major plugin updates
# 1. Update plugin version
vim plugins/frontend/plugin.json
# Change: "version": "3.1.1" → "3.2.0"
# 2. Update marketplace catalog
vim .claude-plugin/marketplace.json
# Change in plugins array: "version": "3.1.1" → "3.2.0"
# Optional: Update metadata.version if desired
# 3. Validate
node scripts/validate-versions.js
# Should show: ✅ Version matches: v3.2.0
# 4. Commit
git add .
git commit -m "chore(frontend): Release v3.2.0"
# Pre-commit hook validates automatically
# 5. Tag
git tag plugins/frontend/v3.2.0
git push origin main --tagsMaintained by: Jack Rudenko @ MadAppGang Last Updated: November 12, 2025