feat: add automated plugin validation scripts#112
feat: add automated plugin validation scripts#112gn00295120 wants to merge 3 commits intoanthropics:mainfrom
Conversation
Adds scripts/validate-plugin.sh and scripts/validate-all.sh to give contributors and CI a fast, zero-dependency way to check plugin health. Closes anthropics#18. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds repository-local validation tooling to standardize and automate checks for plugin manifests/config and markdown metadata, addressing issue #18 and making it easier to catch formatting/structure mistakes early.
Changes:
- Introduces
scripts/validate-plugin.shto validate a single plugin directory (manifest JSON, command/skill frontmatter, optional MCP config, and~~placeholder conventions). - Introduces
scripts/validate-all.shto discover all plugins (by.claude-plugin/plugin.json) and run validation across the repo with an overall summary.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/validate-plugin.sh | Implements per-plugin validation checks and summarizes pass/fail/warn counts. |
| scripts/validate-all.sh | Discovers plugin directories and runs the per-plugin validator across the repository with a consolidated report. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
- Replace echo -e with printf for reliable escape sequence handling - Replace \s with [[:space:]] in awk regex for BSD awk compatibility - Use printf %s/%d format specifiers instead of variable interpolation Addresses review feedback on PR anthropics#112.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| if [[ ! -x "$VALIDATE_SCRIPT" ]]; then | ||
| printf "${RED}ERROR:${RESET} validate-plugin.sh not found or not executable at:\n" >&2 |
| set -euo pipefail | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Color helpers |
| if echo "$output" | grep -q "\[WARN\]"; then | ||
| WARNED+=("$plugin_name") | ||
| else | ||
| PASSED+=("$plugin_name") |
Summary
scripts/validate-plugin.shto validate a single plugin's structure and contentscripts/validate-all.shto run validation across all plugins in the repositoryWhat It Validates
.claude-plugin/plugin.jsonexists and is valid JSONplugin.jsonhas required fields (name, version, description)commands/*.mdfiles have YAML frontmatter withdescriptionskills/*/SKILL.mdfiles have frontmatter withnameanddescription.mcp.jsonis valid JSON withmcpServerskey~~placeholders have matchingCONNECTORS.mdUsage
Current Results
19 plugins discovered, all pass (5 warnings on
cowork-plugin-managementfor~~placeholders without CONNECTORS.md — expected for a meta-plugin).Motivation
From issue discussion: "It's proven hard to develop these locally. Getting the formatting correct... it's easy to make a mistake but hard to spot." — @Rucknar
Fixes #18