Skip to content

feat: add automated plugin validation scripts#112

Open
gn00295120 wants to merge 3 commits intoanthropics:mainfrom
gn00295120:feat/plugin-validation-scripts
Open

feat: add automated plugin validation scripts#112
gn00295120 wants to merge 3 commits intoanthropics:mainfrom
gn00295120:feat/plugin-validation-scripts

Conversation

@gn00295120
Copy link

@gn00295120 gn00295120 commented Mar 12, 2026

Summary

  • Adds scripts/validate-plugin.sh to validate a single plugin's structure and content
  • Adds scripts/validate-all.sh to run validation across all plugins in the repository
  • Zero external dependencies — only bash + python3 (for JSON parsing)

What It Validates

Check Level
.claude-plugin/plugin.json exists and is valid JSON FAIL
plugin.json has required fields (name, version, description) FAIL
commands/*.md files have YAML frontmatter with description FAIL
skills/*/SKILL.md files have frontmatter with name and description FAIL
.mcp.json is valid JSON with mcpServers key WARN
~~ placeholders have matching CONNECTORS.md WARN

Usage

# Validate a single plugin
./scripts/validate-plugin.sh sales/

# Validate all plugins
./scripts/validate-all.sh

Current Results

19 plugins discovered, all pass (5 warnings on cowork-plugin-management for ~~ 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

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>
Copilot AI review requested due to automatic review settings March 12, 2026 03:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh to validate a single plugin directory (manifest JSON, command/skill frontmatter, optional MCP config, and ~~ placeholder conventions).
  • Introduces scripts/validate-all.sh to 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.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +32 to +33
if [[ ! -x "$VALIDATE_SCRIPT" ]]; then
printf "${RED}ERROR:${RESET} validate-plugin.sh not found or not executable at:\n" >&2
Comment on lines +12 to +15
set -euo pipefail

# ---------------------------------------------------------------------------
# Color helpers
Comment on lines +89 to +92
if echo "$output" | grep -q "\[WARN\]"; then
WARNED+=("$plugin_name")
else
PASSED+=("$plugin_name")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create automated validation scripts for plugin structure and MCP configuration

2 participants