Execute git commit, tag, and push operations with configurable patterns for any project type
View on GitHubjayteealao/agent-skills
release-automation
plugins/release-automation/skills/git-release-workflow/SKILL.md
February 1, 2026
Select agents to install to:
npx add-skill https://github.com/jayteealao/agent-skills/blob/main/plugins/release-automation/skills/git-release-workflow/SKILL.md -a claude-code --skill git-release-workflowInstallation paths:
.claude/skills/git-release-workflow/# 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