/zcf-release
Automate version release and code commit using changeset
$ npx -y skills add UfoMiao/zcf --skill zcf-release --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition ā
- You can call itInvoke it directly when you want it.
- Slash command
/zcf-release
Context preview
The summary Claude sees to decide when to auto-load this skill.
Automate version release and code commit using changeset
SKILL.md
zcf-release.SKILL.mdname: zcf-release
description: Automate version release and code commit using changeset
disable-model-invocation: true
allowed-tools: Read(**), Exec(git, pnpm, node, date, cat, gh)
ZCF Release - Automated Release and Commit
Automate version release and code commit using changeset.
Usage
/zcf-release [-p|-mi|-ma|<version>]
Parameters
- `-p` or `--patch`: Patch version (default) - bug fixes, minor changes
- `-mi` or `--minor`: Minor version - new features, backward compatible
- `-ma` or `--major`: Major version - breaking changes, incompatible
- `<version>`: Specific version number (e.g., 1.2.3, 2.0.0-beta.1) - directly use provided version
Context
- Automatically analyze code changes and generate bilingual CHANGELOG
- Use changeset for version management
- Create release branch and pull request for protected main branch
- Auto commit code changes (NO manual tags)
- Support GitHub Actions auto publish to npm with automatic tagging after PR merge
Your Role
You are a professional release management assistant responsible for:
1. Analyzing code changes 2. Generating standardized CHANGELOG 3. Executing version release process
Execution Flow
Parse arguments: $ARGUMENTS
1. Parameter Parsing
VERSION_TYPE="patch" # Default to patch version
SPECIFIC_VERSION="" # For user-specified exact version
# Check if argument looks like a version number (matches semver pattern)
if [[ "$ARGUMENTS" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-].*)?$ ]]; then
SPECIFIC_VERSION="$ARGUMENTS"
VERSION_TYPE="custom"
echo "š Preparing to release exact version: $SPECIFIC_VERSION"
else
case "$ARGUMENTS" in
-p|--patch)
VERSION_TYPE="patch"
;;
-mi|--minor)
VERSION_TYPE="minor"
;;
-ma|--major)
VERSION_TYPE="major"
;;
"")
VERSION_TYPE="patch"
;;
*)
echo "ā Unknown parameter: $ARGUMENTS"
echo "Usage: /zcf-release [-p|-mi|-ma|<version>]"
echo "Examples:"
echo " /zcf-release -p # Patch version bump"
echo " /zcf-release -mi # Minor version bump"
echo " /zcf-release -ma # Major version bump"
echo " /zcf-release 1.2.3 # Exact version"
echo " /zcf-release 2.0.0-beta.1 # Pre-release version"
exit 1
;;
esac
echo "š Preparing to release $VERSION_TYPE version"
fi2. Check Working Directory Status
Check if the current working directory meets release conditions:
# Ensure in project root directory
if [ ! -f "package.json" ]; then
echo "ā Error: package.json not found, please run in project root"
exit 1
fi
# Check for uncommitted changes and handle automatically
HAS_UNCOMMITTED=false
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "ā ļø Detected uncommitted changes:"
git status --short
echo ""
HAS_UNCOMMITTED=true
fi
echo "ā
Working directory status OK"
3. Analyze Version Changes
Analyze all changes since last release:
# Get last release tag
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -z "$LAST_TAG" ]; then
echo "š No previous version tag found, analyzing all commits"
COMMITS=$(git log --oneline)
else
echo "š Last version: $LAST_TAG"
echo "Analyzing changes since $LAST_TAG..."
COMMITS=$(git log $LAST_TAG..HEAD --oneline)
fi
# Show commit history
echo -e "\nš Changes:"
echo "$COMMITS"
# Analyze file changes
echo -e "\nš File change statistics:"
if [ -z "$LAST_TAG" ]; then
git diff --stat
else
git diff --stat $LAST_TAG..HEAD
fi
4. Generate CHANGELOG Content
Based on code change analysis, I will generate CHANGELOG following these standards:
**Format Requirements**:
1. English description first, Chinese description second 2. No mixing Chinese and English on the same line 3. Organize by category: New Features, Optimization, Fixes, Documentation, etc. 4. Each entry should be concise and clear
**Example Format**:
## New Features
- Add technical execution guidelines with command best practices
- Support automated release command /zcf-release
- Automatic quote handling for Windows paths
## ę°åč½
- ę·»å ęęÆę§č”ęåę攣ļ¼ęä¾å½ä»¤ę§č”ęä½³å®č·µ
- ęÆęčŖåØååēå½ä»¤ /zcf-release
- Windows č·Æå¾čŖåØå å¼å·å¤ē
## Optimization
- Prioritize ripgrep for better search performance
- Improve template file organization
## ä¼å
- ä¼å
ä½æēØ ripgrep ęåęē“¢ę§č½
- ę¹čæęØ”ęæęä»¶ē»ē»ē»ę
## Fixes
- Fix Windows path backslash escaping issue
## äæ®å¤
- äæ®å¤ Windows č·Æå¾åęę 丢失é®é¢
5. Create Changeset
Create changeset file based on analysis:
# Generate timestamp
TIMESTAMP=$(date +%Y%m%d%H%M%S)
CHANGESET_FILE=".changeset/release-$TIMESTAMP.md"
# Create changeset file
echo "š Creating changeset file..."
if [ "$VERSION_TYPE" = "custom" ]; then
# For specific version, use the exact version number
cat > "$CHANGESET_FILE" << EOF
---
"zcf": $SPECIFIC_VERSION
---
[Bilingual CHANGELOG content generated based on actual changes]
EOF
echo "ā
Changeset file created with exact version: $SPECIFIC_VERSION"
else
# For version type (patch/minor/major), use the type
cat > "$CHANGESET_FILE" << EOF
---
"zcf": $VERSION_TYPE
---
[Bilingual CHANGELOG content generated based on actual changes]
EOF
echo "ā
Changeset file created with version type: $VERSION_TYPE"
fi
6. Update Version Number
Use changeset to update version number and CHANGELOG:
echo "š Updating version number and CHANGELOG..."
pnpm changeset version
# Note: The changeset version command will automatically:
# 1. Update package.json version
# 2. Generate/update CHANGELOG.md
# 3. DELETE the temporary changeset file in .changeset/ directory
# No manual cleanup needed!
# Get new version number
NEW_VERSION=$(node -p "require('./package.json').version")
if [ "$VERSION_TYPE" = "custom" ]; then
echo "š¦ New version set to: v$NEW_VERSION (specified: $SPECIFIC_VERSION)"
else
echo "š¦ New version: v$NEW_VERSION"
fi
# Show CHANGELOG update
echo -e "\nš CHANGELOG has been updated, pleaRead more
name: zcf-release description: Automate version release and code commit using changeset disable-model-invocation: true allowed-tools: Read(**), Exec(git, pnpm, node, date, cat, gh)
ZCF Release - Automated Release and Commit
Automate version release and code commit using changeset.
Usage
/zcf-release [-p|-mi|-ma|<version>]
Parameters
- `-p` or `--patch`: Patch version (default) - bug fixes, minor changes
- `-mi` or `--minor`: Minor version - new features, backward compatible
- `-ma` or `--major`: Major version - breaking changes, incompatible
- `<version>`: Specific version number (e.g., 1.2.3, 2.0.0-beta.1) - directly use provided version
Context
- Automatically analyze code changes and generate bilingual CHANGELOG
- Use changeset for version management
- Create release branch and pull request for protected main branch
- Auto commit code changes (NO manual tags)
- Support GitHub Actions auto publish to npm with automatic tagging after PR merge
Your Role
You are a professional release management assistant responsible for:
1. Analyzing code changes 2. Generating standardized CHANGELOG 3. Executing version release process
Execution Flow
Parse arguments: $ARGUMENTS
1. Parameter Parsing
VERSION_TYPE="patch" # Default to patch version
SPECIFIC_VERSION="" # For user-specified exact version
# Check if argument looks like a version number (matches semver pattern)
if [[ "$ARGUMENTS" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-].*)?$ ]]; then
SPECIFIC_VERSION="$ARGUMENTS"
VERSION_TYPE="custom"
echo "š Preparing to release exact version: $SPECIFIC_VERSION"
else
case "$ARGUMENTS" in
-p|--patch)
VERSION_TYPE="patch"
;;
-mi|--minor)
VERSION_TYPE="minor"
;;
-ma|--major)
VERSION_TYPE="major"
;;
"")
VERSION_TYPE="patch"
;;
*)
echo "ā Unknown parameter: $ARGUMENTS"
echo "Usage: /zcf-release [-p|-mi|-ma|<version>]"
echo "Examples:"
echo " /zcf-release -p # Patch version bump"
echo " /zcf-release -mi # Minor version bump"
echo " /zcf-release -ma # Major version bump"
echo " /zcf-release 1.2.3 # Exact version"
echo " /zcf-release 2.0.0-beta.1 # Pre-release version"
exit 1
;;
esac
echo "š Preparing to release $VERSION_TYPE version"
fi2. Check Working Directory Status
Check if the current working directory meets release conditions:
# Ensure in project root directory if [ ! -f "package.json" ]; then echo "ā Error: package.json not found, please run in project root" exit 1 fi # Check for uncommitted changes and handle automatically HAS_UNCOMMITTED=false if ! git diff --quiet || ! git diff --cached --quiet; then echo "ā ļø Detected uncommitted changes:" git status --short echo "" HAS_UNCOMMITTED=true fi echo "ā Working directory status OK"
3. Analyze Version Changes
Analyze all changes since last release:
# Get last release tag LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") if [ -z "$LAST_TAG" ]; then echo "š No previous version tag found, analyzing all commits" COMMITS=$(git log --oneline) else echo "š Last version: $LAST_TAG" echo "Analyzing changes since $LAST_TAG..." COMMITS=$(git log $LAST_TAG..HEAD --oneline) fi # Show commit history echo -e "\nš Changes:" echo "$COMMITS" # Analyze file changes echo -e "\nš File change statistics:" if [ -z "$LAST_TAG" ]; then git diff --stat else git diff --stat $LAST_TAG..HEAD fi
4. Generate CHANGELOG Content
Based on code change analysis, I will generate CHANGELOG following these standards:
**Format Requirements**:
1. English description first, Chinese description second 2. No mixing Chinese and English on the same line 3. Organize by category: New Features, Optimization, Fixes, Documentation, etc. 4. Each entry should be concise and clear
**Example Format**:
## New Features - Add technical execution guidelines with command best practices - Support automated release command /zcf-release - Automatic quote handling for Windows paths ## ę°åč½ - ę·»å ęęÆę§č”ęåę攣ļ¼ęä¾å½ä»¤ę§č”ęä½³å®č·µ - ęÆęčŖåØååēå½ä»¤ /zcf-release - Windows č·Æå¾čŖåØå å¼å·å¤ē ## Optimization - Prioritize ripgrep for better search performance - Improve template file organization ## ä¼å - ä¼å ä½æēØ ripgrep ęåęē“¢ę§č½ - ę¹čæęØ”ęæęä»¶ē»ē»ē»ę ## Fixes - Fix Windows path backslash escaping issue ## äæ®å¤ - äæ®å¤ Windows č·Æå¾åęę 丢失é®é¢
5. Create Changeset
Create changeset file based on analysis:
# Generate timestamp TIMESTAMP=$(date +%Y%m%d%H%M%S) CHANGESET_FILE=".changeset/release-$TIMESTAMP.md" # Create changeset file echo "š Creating changeset file..." if [ "$VERSION_TYPE" = "custom" ]; then # For specific version, use the exact version number cat > "$CHANGESET_FILE" << EOF --- "zcf": $SPECIFIC_VERSION --- [Bilingual CHANGELOG content generated based on actual changes] EOF echo "ā Changeset file created with exact version: $SPECIFIC_VERSION" else # For version type (patch/minor/major), use the type cat > "$CHANGESET_FILE" << EOF --- "zcf": $VERSION_TYPE --- [Bilingual CHANGELOG content generated based on actual changes] EOF echo "ā Changeset file created with version type: $VERSION_TYPE" fi
6. Update Version Number
Use changeset to update version number and CHANGELOG:
echo "š Updating version number and CHANGELOG..."
pnpm changeset version
# Note: The changeset version command will automatically:
# 1. Update package.json version
# 2. Generate/update CHANGELOG.md
# 3. DELETE the temporary changeset file in .changeset/ directory
# No manual cleanup needed!
# Get new version number
NEW_VERSION=$(node -p "require('./package.json').version")
if [ "$VERSION_TYPE" = "custom" ]; then
echo "š¦ New version set to: v$NEW_VERSION (specified: $SPECIFIC_VERSION)"
else
echo "š¦ New version: v$NEW_VERSION"
fi
# Show CHANGELOG update
echo -e "\nš CHANGELOG has been updated, pleaRepo: UfoMiao/zcf
Other skills on zcf.
- /zcf-add-sponsor
Quickly add a new corporate sponsor to ZCF ā sponsor list by default, with optional API preset and documentation ad placements
Open skill - /zcf-pr
Create pull request based on current branch changes
Open skill - /zcf-update-docs
Automatically check code changes since last tag and update documentation in docs/ directory (en, zh-CN, ja-JP) and CLAUDE.md to ensure consistency with actual code implementation
Open skill - /bmad-init
Initialize or update BMad-Method (V6) in your project
Open skill - /feat
Add New Feature
Open skill - /git-clean-branches
Safely find and clean up merged or stale Git branches with dry-run mode and custom base/protected branches support
Open skill

