feat(marketplace): add domain metadata to all plugins [BREAKING]
- domain field required in plugin.json and marketplace.json (core/data/ops) - validate-marketplace.sh enforces domain presence and allowed values - claude-launch.sh new profiles: saas, ops, debug; infra deprecated - CANONICAL-PATHS.md and CLAUDE.md updated with domain conventions BREAKING CHANGE: validate-marketplace.sh rejects plugins without domain field Version: 8.0.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,9 +6,11 @@
|
||||
#
|
||||
# Profiles:
|
||||
# sprint - Project management, git, PR review, security, docs (default)
|
||||
# infra - Infrastructure/CMDB management
|
||||
# data - Data engineering and visualization
|
||||
# saas - SaaS development (API, frontend, DB, testing)
|
||||
# ops - Operations and infrastructure (CMDB, releases, deploy)
|
||||
# review - Code review only (lightweight)
|
||||
# debug - MCP debugging tools
|
||||
# full - All plugins via marketplace.json (~22K tokens)
|
||||
#
|
||||
# Examples:
|
||||
@@ -42,18 +44,28 @@ fi
|
||||
# Define plugin lists for each profile
|
||||
declare -A PROFILES
|
||||
PROFILES[sprint]="projman git-flow pr-review code-sentinel doc-guardian clarity-assist"
|
||||
PROFILES[infra]="cmdb-assistant"
|
||||
PROFILES[data]="data-platform viz-platform"
|
||||
PROFILES[infra]="DEPRECATED"
|
||||
PROFILES[data]="data-platform viz-platform data-seed"
|
||||
PROFILES[saas]="saas-api-platform saas-react-platform saas-db-migrate saas-test-pilot"
|
||||
PROFILES[ops]="cmdb-assistant ops-release-manager ops-deploy-pipeline"
|
||||
PROFILES[review]="pr-review code-sentinel"
|
||||
PROFILES[debug]="debug-mcp"
|
||||
PROFILES[full]="" # Empty = use marketplace.json
|
||||
|
||||
# Validate profile
|
||||
if [[ ! ${PROFILES[$PROFILE]+_} ]]; then
|
||||
echo -e "${YELLOW}Unknown profile: $PROFILE${NC}"
|
||||
echo "Available profiles: sprint, infra, data, review, full"
|
||||
echo "Available profiles: sprint, data, saas, ops, review, debug, full"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Handle deprecated profiles
|
||||
if [[ "$PROFILE" == "infra" ]]; then
|
||||
echo -e "${YELLOW}Warning: 'infra' profile is deprecated. Use 'ops' instead.${NC}"
|
||||
echo -e "${YELLOW} The 'ops' profile includes cmdb-assistant plus future ops plugins.${NC}"
|
||||
PROFILE="ops"
|
||||
fi
|
||||
|
||||
# Build --plugin-dir arguments
|
||||
PLUGIN_ARGS=()
|
||||
PLUGIN_LIST="${PROFILES[$PROFILE]}"
|
||||
|
||||
@@ -4,6 +4,9 @@ set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
|
||||
# v8.0.0: Valid domain values
|
||||
VALID_DOMAINS="core data saas ops debug"
|
||||
|
||||
echo "=== Validating Marketplace ==="
|
||||
|
||||
# Check marketplace.json exists and is valid JSON
|
||||
@@ -89,6 +92,18 @@ for i in $(seq 0 $((PLUGIN_COUNT - 1))); do
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# v8.0.0: Check domain field
|
||||
PLUGIN_DOMAIN=$(jq -r ".plugins[$i].domain // empty" "$MARKETPLACE_JSON")
|
||||
if [[ -z "$PLUGIN_DOMAIN" ]]; then
|
||||
echo "ERROR: Missing 'domain' in marketplace entry for $PLUGIN_NAME (required v8.0.0+)"
|
||||
exit 1
|
||||
fi
|
||||
if ! echo "$VALID_DOMAINS" | grep -qw "$PLUGIN_DOMAIN"; then
|
||||
echo "ERROR: Invalid domain '$PLUGIN_DOMAIN' in marketplace entry for $PLUGIN_NAME (allowed: $VALID_DOMAINS)"
|
||||
exit 1
|
||||
fi
|
||||
echo " ✓ domain: $PLUGIN_DOMAIN"
|
||||
|
||||
echo "✓ Marketplace entry $PLUGIN_NAME valid"
|
||||
done
|
||||
|
||||
@@ -143,6 +158,18 @@ for plugin_dir in "$PLUGINS_DIR"/*/; do
|
||||
echo "WARNING: Missing 'keywords' array in $plugin_name/plugin.json"
|
||||
fi
|
||||
|
||||
# v8.0.0: Check domain field in plugin.json
|
||||
PLUGIN_DOMAIN_PJ=$(jq -r '.domain // empty' "$plugin_json")
|
||||
if [[ -z "$PLUGIN_DOMAIN_PJ" ]]; then
|
||||
echo "ERROR: Missing 'domain' in $plugin_name/plugin.json (required v8.0.0+)"
|
||||
exit 1
|
||||
fi
|
||||
if ! echo "$VALID_DOMAINS" | grep -qw "$PLUGIN_DOMAIN_PJ"; then
|
||||
echo "ERROR: Invalid domain '$PLUGIN_DOMAIN_PJ' in $plugin_name/plugin.json (allowed: $VALID_DOMAINS)"
|
||||
exit 1
|
||||
fi
|
||||
echo " ✓ domain: $PLUGIN_DOMAIN_PJ"
|
||||
|
||||
# Check README exists
|
||||
if [[ ! -f "$plugin_dir/README.md" ]]; then
|
||||
echo "WARNING: Missing README.md in $plugin_name/"
|
||||
@@ -297,5 +324,22 @@ if [[ ! -f "$ROOT_DIR/.mcp.json" ]]; then
|
||||
fi
|
||||
echo "✓ .mcp.json configuration exists"
|
||||
|
||||
# v8.0.0: Cross-validate domains match between marketplace.json and plugin.json
|
||||
echo ""
|
||||
echo "=== Cross-Validating Domain Fields ==="
|
||||
for i in $(seq 0 $((PLUGIN_COUNT - 1))); do
|
||||
PLUGIN_NAME=$(jq -r ".plugins[$i].name" "$MARKETPLACE_JSON")
|
||||
MARKETPLACE_DOMAIN=$(jq -r ".plugins[$i].domain" "$MARKETPLACE_JSON")
|
||||
PLUGIN_JSON_PATH="$PLUGINS_DIR/$PLUGIN_NAME/.claude-plugin/plugin.json"
|
||||
if [[ -f "$PLUGIN_JSON_PATH" ]]; then
|
||||
PLUGIN_DOMAIN=$(jq -r '.domain' "$PLUGIN_JSON_PATH")
|
||||
if [[ "$MARKETPLACE_DOMAIN" != "$PLUGIN_DOMAIN" ]]; then
|
||||
echo "ERROR: Domain mismatch for $PLUGIN_NAME: marketplace.json='$MARKETPLACE_DOMAIN' vs plugin.json='$PLUGIN_DOMAIN'"
|
||||
exit 1
|
||||
fi
|
||||
echo "✓ $PLUGIN_NAME domain consistent: $MARKETPLACE_DOMAIN"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "=== All validations passed ==="
|
||||
|
||||
Reference in New Issue
Block a user