git-release-workflow
Execute git commit, tag, and push operations with configurable patterns for any project type
What this skill does
# Git Release Workflow
## Purpose
Executes the git operations for a release: running pre-release hooks, staging modified files, creating a commit with proper formatting and attribution, creating an annotated git tag with configurable patterns, and running post-release hooks. Works with any project type.
## Input Context
Requires:
- **Project Configuration**: Output from `detect-project-type` skill
- **Version**: New version string (e.g., "1.2.0")
- **Commit Message**: Pre-formatted commit message (from changelog-update skill)
- **Files to Stage**: List of modified files to include in commit
## Workflow
### 1. Load Configuration
Use configuration from `detect-project-type`:
- `tag_pattern` - Pattern for git tag (e.g., "v{version}", "{package}-v{version}")
- `tag_message` - Message template for annotated tag
- `commit_message_template` - Template for commit message
- `pre_release_hook` - Script to run before git operations (optional)
- `post_release_hook` - Script to run after successful push (optional)
### 2. Run Pre-Release Hook
If `preReleaseHook` is configured, execute it before any git operations:
```bash
if [ -n "$pre_release_hook" ]; then
echo "Running pre-release hook: $pre_release_hook"
if [ -x "$pre_release_hook" ]; then
# Run hook and capture output
if ! hook_output=$($pre_release_hook 2>&1); then
# Hook failed - abort release
echo "✗ Pre-release hook failed:"
echo "$hook_output"
exit 1
else
echo "✓ Pre-release hook succeeded"
echo "$hook_output"
fi
else
echo "⚠️ Pre-release hook not executable: $pre_release_hook"
exit 1
fi
fi
```
**Common pre-release hook use cases:**
- Run tests: `npm test`, `cargo test`, `go test ./...`
- Build project: `npm run build`, `cargo build --release`
- Run linters: `npm run lint`, `cargo clippy`
- Generate documentation: `npm run docs`
- Validate package: `npm pack --dry-run`, `twine check dist/*`
### 3. Stage Modified Files
Stage all files that were modified during the release process:
```bash
git add {file1} {file2} {file3} ...
```
**Files typically include:**
- Version configuration files (plugin.json, marketplace.json, variants.json)
- Changelog files (CHANGELOG.md)
- Documentation files (README.md)
Verify staging succeeded:
```bash
git status --short
```
### 2. Create Commit
Create commit with the provided message, ensuring proper formatting and attribution:
```bash
git commit -m "$(cat <<'EOF'
{commit-message}
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
EOF
)"
```
**Commit message format:**
```
Release {scope} v{version}
{changelog-body}
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
```
**Important:** Use heredoc (`<<'EOF'`) to preserve formatting and handle multi-line messages correctly.
Capture commit hash:
```bash
git rev-parse HEAD
```
### 5. Create Annotated Git Tag
Create an annotated tag (not lightweight) using configurable pattern from configuration:
**Build tag name from pattern:**
```bash
# Get pattern from config (e.g., "v{version}", "{package}-v{version}")
tag_pattern="v{version}" # from config
# Replace placeholders
tag_name="${tag_pattern//\{version\}/$new_version}"
# For monorepo/plugins, also replace {package}
if [[ "$tag_pattern" == *"{package}"* ]]; then
tag_name="${tag_name//\{package\}/$package_name}"
fi
# Examples:
# Pattern: "v{version}" → Tag: "v1.2.0"
# Pattern: "release-{version}" → Tag: "release-1.2.0"
# Pattern: "{package}-v{version}" → Tag: "my-lib-v1.2.0"
```
**Build tag message from template:**
```bash
# Get template from config (default: "Release v{version}")
tag_message_template="Release v{version}" # from config
# Replace placeholders
tag_message="${tag_message_template//\{version\}/$new_version}"
tag_message="${tag_message//\{package\}/$package_name}"
# Example: "Release v1.2.0"
```
**Create tag:**
```bash
git tag -a "$tag_name" -m "$tag_message"
```
**Verify tag created:**
```bash
if git tag -l "$tag_name" | grep -q "$tag_name"; then
echo "✓ Created tag: $tag_name"
else
echo "✗ Failed to create tag: $tag_name"
exit 1
fi
```
### 4. Prepare Push Information
Do NOT automatically push. Instead, prepare information for the command to display:
```bash
# Get remote URL
git remote get-url origin
# Get current branch
git branch --show-current
# Show what will be pushed
git log origin/{branch}..HEAD --oneline
```
Return push command for user to execute:
```bash
git push origin {branch} --follow-tags
```
Or if using `--force-with-lease` after rebase:
```bash
git push origin {branch} --follow-tags --force-with-lease
```
### 6. Run Post-Release Hook (After Push)
**Note:** This section is executed by the `/release` command AFTER successful push, not within this skill.
If `postReleaseHook` is configured, execute it after git push succeeds:
```bash
if [ -n "$post_release_hook" ]; then
echo "Running post-release hook: $post_release_hook"
if [ -x "$post_release_hook" ]; then
# Run hook and capture output
if ! hook_output=$($post_release_hook 2>&1); then
# Hook failed - warn but don't abort (release already pushed)
echo "⚠️ Post-release hook failed:"
echo "$hook_output"
# Continue anyway - release is already public
else
echo "✓ Post-release hook succeeded"
echo "$hook_output"
fi
else
echo "⚠️ Post-release hook not executable: $post_release_hook"
fi
fi
```
**Common post-release hook use cases:**
- Publish package: `npm publish`, `cargo publish`, `twine upload dist/*`
- Deploy to CDN/hosting: `netlify deploy`, `vercel --prod`
- Send notifications: `./scripts/notify-slack.sh`, `./scripts/post-to-discord.sh`
- Update documentation site: `./scripts/deploy-docs.sh`
- Trigger CI/CD: `curl -X POST $CI_WEBHOOK_URL`
- Create GitHub release: `gh release create $TAG_NAME`
### 7. Generate Summary
Collect information for post-release summary:
- Commit hash (short: first 7 characters)
- Tag name
- Files committed (count)
- Current branch
- Remote URL (if configured)
## Output Format
Return:
```
{
"commit_hash": "a1b2c3d",
"commit_hash_full": "a1b2c3d4e5f6g7h8i9j0",
"tag_name": "daily-carry-v1.2.0",
"files_committed": [
"plugins/daily-carry/.claude-plugin/plugin.json",
"plugins/daily-carry/CHANGELOG.md",
".claude-plugin/marketplace.json"
],
"files_count": 3,
"branch": "master",
"remote_url": "https://github.com/jayteealao/agent-skills.git",
"push_command": "git push origin master --follow-tags",
"success": true
}
```
## Examples
### Example 1: Plugin Release
**Input:**
- Scope: `plugin:daily-carry`
- Version: `1.2.0`
- Commit message:
```
Release plugin:daily-carry v1.2.0
Added:
- New deployment command
Fixed:
- Git push error handling
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
```
- Files: `["plugins/daily-carry/.claude-plugin/plugin.json", "plugins/daily-carry/CHANGELOG.md", ".claude-plugin/marketplace.json"]`
**Operations:**
```bash
# Stage files
git add plugins/daily-carry/.claude-plugin/plugin.json
git add plugins/daily-carry/CHANGELOG.md
git add .claude-plugin/marketplace.json
# Create commit
git commit -m "$(cat <<'EOF'
Release plugin:daily-carry v1.2.0
Added:
- New deployment command
Fixed:
- Git push error handling
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
EOF
)"
# Create tag
git tag -a "daily-carry-v1.2.0" -m "Release plugin:daily-carry v1.2.0"
```
**Output:**
```
{
"commit_hash": "f7e8d9c",
"commit_hash_full": "f7e8d9c6b5a4e3d2c1b0a9f8e7d6c5b4",
"tag_name": "daily-carry-v1.2.0",
"files_committed": [
"plugins/daily-carry/.claude-plugin/plugin.json",
"plugins/daily-carry/CHANGELOG.md",
".claude-plugin/marketplace.json"
],
"files_count": 3,
"branch": "master",
"remote_url": "https://github.com/jayteealao/agent-skills.git",
"push_command": "git push origin master --follow-tags",
"success": true
}
```
### Example 2: Marketplace Release
**Input:**
- ScoRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.