Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:20:31 +08:00
commit 6bee51f8ec
20 changed files with 4266 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
#!/bin/bash
# Script: validate-semver.sh
# Purpose: Validate semantic versioning format
# Version: 1.0.0
#
# Usage: ./validate-semver.sh <version>
# Returns: 0 - Valid semver, 1 - Invalid format
VERSION="$1"
if [ -z "$VERSION" ]; then
echo "ERROR: Version required"
exit 2
fi
# Semantic versioning pattern: MAJOR.MINOR.PATCH with optional pre-release and build metadata
SEMVER_PATTERN='^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$'
if echo "$VERSION" | grep -Eq "$SEMVER_PATTERN"; then
echo "✅ Valid semantic version: $VERSION"
exit 0
else
echo "❌ Invalid semantic version: $VERSION"
echo ""
echo "Semantic versioning format: MAJOR.MINOR.PATCH"
echo " - MAJOR: Breaking changes"
echo " - MINOR: New features (backwards compatible)"
echo " - PATCH: Bug fixes"
echo ""
echo "Valid examples:"
echo " - 1.0.0"
echo " - 2.1.3"
echo " - 1.0.0-alpha"
echo " - 1.0.0-beta.1"
echo " - 1.0.0+20250113"
exit 1
fi

View File

@@ -0,0 +1,40 @@
---
description: Create, validate, and update plugin metadata including plugin.json and marketplace entries
---
# Plugin Metadata Skill
Expert metadata management for Claude Code plugins with validation, versioning, and marketplace entry generation.
## Operations
- **validate** - Validate plugin.json completeness and correctness
- **update-version** - Update version with semantic versioning validation
- **add-keywords** - Add or update keywords for plugin discoverability
- **marketplace-entry** - Generate marketplace.json plugin entry
## Usage Examples
```bash
# Validate metadata
/plugin-metadata validate plugin:my-plugin
# Update version
/plugin-metadata update-version plugin:my-plugin version:1.1.0
# Add keywords
/plugin-metadata add-keywords plugin:my-plugin keywords:"testing,automation,python"
# Generate marketplace entry
/plugin-metadata marketplace-entry plugin:my-plugin source:"github:username/plugin-name"
```
## Router Logic
Parse operation from $ARGUMENTS and route to appropriate instruction file:
- "validate" → `{plugin-path}/commands/plugin-metadata/validate-metadata.md`
- "update-version" → `{plugin-path}/commands/plugin-metadata/update-version.md`
- "add-keywords" → `{plugin-path}/commands/plugin-metadata/add-keywords.md`
- "marketplace-entry" → `{plugin-path}/commands/plugin-metadata/create-marketplace-entry.md`
**Current request**: $ARGUMENTS