
Validate Claude Code Marketplace Plugin Sources
Marketplace maintainers can check .claude-plugin/marketplace.json before adding or updating plugin entries. A supplied file tree shows which relative plugin directories are present, so missing paths and source field issues are visible before review. #Engineering
Validate Claude Code Marketplace Plugin Sources
Marketplace maintainers can check .claude-plugin/marketplace.json before adding or updating plugin entries.
A supplied file tree shows which relative plugin directories are present, so missing paths and source field issues are visible before review.
The validator reads only the manifest and the file tree list you provide. It does not fetch or install plugins, test runtime loading, or check whether remote repositories exist. It does not claim equivalence with claude plugin validate.
Official reference checked on 2026-12-02: Claude Code Marketplace reference. The required top-level fields are name, owner (with name), and plugins; each entry needs name and source. Supported source declarations include relative path strings and github, url, git-subdir, npm, archive, and command objects. Relative paths resolve from the marketplace root (the directory containing .claude-plugin/), not from .claude-plugin/. ./ paths containing .. are reported. Bare names are supported under metadata.pluginRoot. Unknown top-level, entry, or source fields are called out for reference review because the official page may evolve.
This checks the declaration in marketplace.json, including each plugin source. It does not inspect links inside a plugin's SKILL.md.
Use
Python 3.9 or newer; no third-party dependencies.
python3 scripts/validate_marketplace_sources.py examples/marketplace.json --tree examples/file-tree.txt
Create a file-only tree from a Git checkout with git ls-files > file-tree.txt; parent directories are inferred from listed files.
Marketplace source check: examples/marketplace.json
Recognized plugin entries: 2
Findings: 0
Scope: declarations and supplied file tree only; no fetch or install.
Exit codes: 0 no blocking findings (unknown keys are warnings); an empty plugins array reports Recognized plugin entries: 0 and a note, then returns 0; 1 documented constraint findings; 2 unreadable or unrecognized input. Each manifest entry is checked independently, so one bad entry does not hide findings for the others. Empty input and a file with no recognized plugin entries return 2.
- Check a local marketplace: relative paths against the supplied tree.
- Inspect a GitHub source:
repoowner/repo form and allowed source fields. - Review remote source declarations:
url,ref,shaand source-type fields. - Check a marketplace with no local plugins: object sources without attempting network access.
- Save a review result: stable English output and exit status (redirect to
review.txt).
--tree is a UTF-8 text file with one marketplace-root-relative file or directory path per line. The listed path set is treated as supplied evidence; the tool does not stat paths or inspect plugin contents. This static check cannot establish that a remote source exists, is trusted, or installs successfully.
Limits
The validator checks declaration shape and selected documented source constraints. It does not reproduce every version-specific behavior of Claude Code, resolve registry policy, execute command sources, download archives, inspect remote git refs, or validate plugin runtime behavior. Treat unknown-key findings as review prompts, not proof of invalidity.


