mirror of
https://github.com/hamen/material-3-skill.git
synced 2026-09-19 03:34:43 +08:00
e7f8a32796
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7iVdviBb4QhpAT1UsuyHV
36 lines
1.1 KiB
Bash
Executable File
36 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
if ! command -v jq >/dev/null 2>&1; then
|
|
printf 'jq is required to validate the .claude-plugin manifests\n' >&2
|
|
exit 1
|
|
fi
|
|
|
|
jq -e . .claude-plugin/marketplace.json >/dev/null
|
|
jq -e . skills/material-3/.claude-plugin/plugin.json >/dev/null
|
|
|
|
# Cross-check: the marketplace must point at the skill subdir that holds plugin.json.
|
|
plugin_path="$(jq -r '.plugins[0].source.path' .claude-plugin/marketplace.json)"
|
|
if [[ ! -f "$plugin_path/.claude-plugin/plugin.json" ]]; then
|
|
printf 'marketplace.json source.path (%s) has no .claude-plugin/plugin.json\n' "$plugin_path" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Guard against the wrong nested layout (skills/<plugin>/skills/...).
|
|
if [[ -d "$plugin_path/skills" ]]; then
|
|
printf 'unexpected nested skills/ directory inside %s\n' "$plugin_path" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Strict schema validation when the Claude Code CLI is available.
|
|
if command -v claude >/dev/null 2>&1; then
|
|
claude plugin validate --strict .claude-plugin/marketplace.json
|
|
claude plugin validate --strict "$plugin_path"
|
|
fi
|
|
|
|
bash tests/plugin_layout_test.sh
|
|
|
|
printf 'CI checks passed.\n'
|