From plugin-dev
Validate plugin structure and silent failures. TRIGGERS - plugin validation, check plugin, hook audit.
How this skill is triggered — by the user, by Claude, or both
Slash command
/plugin-dev:plugin-validatorThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Comprehensive validation for Claude Code marketplace plugins.
Comprehensive validation for Claude Code marketplace plugins.
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
Use this skill when:
# Validate a specific plugin
uv run plugins/plugin-dev/skills/plugin-validator/scripts/audit_silent_failures.py plugins/my-plugin/
# Validate with fix suggestions
uv run plugins/plugin-dev/skills/plugin-validator/scripts/audit_silent_failures.py plugins/my-plugin/ --fix
Check plugin directory structure:
/usr/bin/env bash << 'VALIDATE_EOF'
PLUGIN_PATH="${1:-.}"
# Check plugin.json exists
if [[ ! -f "$PLUGIN_PATH/plugin.json" ]]; then
echo "ERROR: Missing plugin.json" >&2
exit 1
fi
# Validate JSON syntax
if ! jq empty "$PLUGIN_PATH/plugin.json" 2>/dev/null; then
echo "ERROR: Invalid JSON in plugin.json" >&2
exit 1
fi
# Check required fields
REQUIRED_FIELDS=("name" "version" "description")
for field in "${REQUIRED_FIELDS[@]}"; do
if ! jq -e ".$field" "$PLUGIN_PATH/plugin.json" >/dev/null 2>&1; then
echo "ERROR: Missing required field: $field" >&2
exit 1
fi
done
echo "Structure validation passed"
VALIDATE_EOF
Critical Rule: All hook entry points MUST emit to stderr on failure.
Run the audit script:
uv run plugins/plugin-dev/skills/plugin-validator/scripts/audit_silent_failures.py plugins/my-plugin/
| Check | Target Files | Pattern |
|---|---|---|
| Shellcheck | hooks/*.sh | SC2155, SC2086, etc. |
| Silent bash | hooks/*.sh | mkdir|cp|mv|rm|jq without if ! |
| Silent Python | hooks/*.py | except.*: pass without stderr |
| Location | Type | Requirement |
|---|---|---|
plugins/*/hooks/*.sh | Entry point | MUST emit to stderr |
plugins/*/hooks/*.py | Entry point | MUST emit to stderr |
plugins/*/scripts/*.sh | Utility | Fallback behavior OK |
plugins/*/scripts/*.py | Utility | Fallback behavior OK |
# BAD - silent failure
mkdir -p "$DIR"
# GOOD - emits to stderr
if ! mkdir -p "$DIR" 2>&1; then
echo "[plugin] Failed to create directory: $DIR" >&2
fi
# BAD - silent failure
except (json.JSONDecodeError, OSError):
pass
# GOOD - emits to stderr
except (json.JSONDecodeError, OSError) as e:
print(f"[plugin] Warning: {e}", file=sys.stderr)
This skill is invoked in Phase 3 of the plugin-add workflow:
### 3.4 Plugin Validation
**MANDATORY**: Run plugin-validator before registration.
Task with subagent_type="plugin-dev:plugin-validator"
prompt: "Validate the plugin at plugins/$PLUGIN_NAME/"
| Code | Meaning |
|---|---|
| 0 | All validations passed |
| 1 | Violations found (see output) |
| 2 | Error (invalid path, missing files) |
| Issue | Cause | Solution |
|---|---|---|
| plugin.json not found | Missing manifest file | Create plugin.json with required fields |
| Invalid JSON syntax | Malformed plugin.json | Run jq empty plugin.json to find syntax errors |
| Missing required field | Incomplete manifest | Add name, version, description to plugin.json |
| Shellcheck errors | Bash script issues | Run shellcheck hooks/*.sh to see details |
| Silent failure in bash | Missing error handling | Add if ! check around mkdir/cp/mv/rm commands |
| Silent except:pass in Python | Missing stderr output | Add print(..., file=sys.stderr) before pass |
| Exit code 2 | Invalid path or missing files | Verify plugin path exists and has correct structure |
| Violations after --fix | Fix suggestions not applied | Manually apply suggested fixes from output |
After this skill completes, reflect before closing the task:
Do NOT defer. The next invocation inherits whatever you leave behind.
npx claudepluginhub terrylica/cc-skills --plugin plugin-devValidates plugin SKILL.md frontmatter and audits hook scripts for silent failures. Run validation to check schema, source paths, and frontmatter; run hook audit to detect unhandled errors in shell and Python scripts.
Validates Claude Code plugin structure, JSON schemas, frontmatter, security compliance, and marketplace catalog consistency using the same checks as the CI pipeline.
Validates a Claude Code plugin directory against Anthropic spec and enterprise standards. Runs structural checks (plugin.json, file refs, permissions) and content grading (SKILL.md scoring).