| name | release-rulez |
| description | RuleZ release workflow automation. Use when asked to "release RuleZ", "create a release", "prepare release", "tag version", "hotfix release", or "publish RuleZ". Covers version management from Cargo.toml, changelog generation from conventional commits, PR creation, tagging, hotfix workflows, and GitHub Actions release monitoring. |
| metadata | {"version":"1.0.0","project":"rulez","source_of_truth":"Cargo.toml"} |
release-rulez
Contents
Overview
Single Source of Truth: Version is stored in Cargo.toml (workspace root):
[workspace.package]
version = "1.0.0"
Release Trigger: Pushing a tag like v1.0.0 triggers .github/workflows/release.yml
Build Targets:
| Platform | Target | Asset |
|---|
| Linux x86_64 | x86_64-unknown-linux-gnu | rulez-linux-x86_64.tar.gz |
| Linux ARM64 | aarch64-unknown-linux-gnu | rulez-linux-aarch64.tar.gz |
| macOS Intel | x86_64-apple-darwin | rulez-macos-x86_64.tar.gz |
| macOS Apple Silicon | aarch64-apple-darwin | rulez-macos-aarch64.tar.gz |
| Windows | x86_64-pc-windows-msvc | rulez-windows-x86_64.exe.zip |
Repository: SpillwaveSolutions/code_agent_context_hooks
Decision Tree
What do you need?
|
+-- Starting a new release? --> Phase 1: Prepare Release
|
+-- PR merged, ready to tag? --> Phase 2: Execute Release
|
+-- Tag pushed, checking status? --> Phase 3: Verify Release
|
+-- Need to patch an existing release? --> Phase 4: Hotfix Release
|
+-- Something went wrong? --> references/troubleshooting.md
Phase 1: Prepare Release
1.1 Read Current Version
.opencode/skill/release-rulez/scripts/read-version.sh
1.2 Determine New Version
Follow semantic versioning:
- MAJOR (X.0.0): Breaking changes
- MINOR (x.Y.0): New features, backwards compatible
- PATCH (x.y.Z): Bug fixes only
Update Cargo.toml (manual step):
[workspace.package]
version = "1.1.0"
1.3 Create Release Branch
VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh)
git checkout -b release/v${VERSION}
1.4 Run Pre-flight Checks
.opencode/skill/release-rulez/scripts/preflight-check.sh
This validates:
IMPORTANT: Integration tests are REQUIRED before any release. They validate that RuleZ works correctly with the real Claude CLI end-to-end. If Claude CLI is not installed, the preflight check will warn but not block - however, you should ensure integration tests pass in CI before releasing.
1.5 Generate Changelog
VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh)
.opencode/skill/release-rulez/scripts/generate-changelog.sh ${VERSION}
Review the output and update CHANGELOG.md as needed. The script parses conventional commits (feat:, fix:, docs:, chore:).
1.6 Commit and Push
VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh)
git add CHANGELOG.md Cargo.toml
git commit -m "chore: prepare v${VERSION} release"
git push -u origin release/v${VERSION}
1.7 Create Release PR
VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh)
gh pr create \
--title "chore: prepare v${VERSION} release" \
--body "$(cat <<EOF
## Summary
Prepare for the v${VERSION} release of RuleZ.
## Changes
- Update version to ${VERSION} in Cargo.toml
- Add CHANGELOG.md entry for v${VERSION}
## Pre-merge Requirements
Before merging this PR, ensure:
- [ ] All CI checks pass (including integration tests)
- [ ] Integration tests verified locally: \`task integration-test\`
## Release Checklist
After this PR is merged:
1. Checkout main: \`git checkout main && git pull\`
2. Create tag: \`git tag v${VERSION}\`
3. Push tag: \`git push origin v${VERSION}\`
This will trigger the release workflow to build cross-platform binaries:
- Linux (x86_64, aarch64)
- macOS (x86_64, aarch64/Apple Silicon)
- Windows (x86_64)
EOF
)"
1.8 Wait for CI
gh pr checks <PR_NUMBER> --watch
All checks must pass before merging:
- Format, Clippy, Unit Tests, Code Coverage
- Integration Tests (RuleZ + Claude CLI end-to-end validation)
- Build Release (5 platforms)
- CI Success
Note: Integration tests validate that RuleZ hooks work correctly with the real Claude CLI. These are critical gate checks - do NOT skip them.
Phase 2: Execute Release
2.1 Merge the Release PR
gh pr merge <PR_NUMBER> --merge --delete-branch
2.2 Sync Local Main
git checkout main
git pull
2.3 Create and Push Tag
VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh)
git tag v${VERSION}
git push origin v${VERSION}
This triggers the release workflow automatically.
Phase 3: Verify Release
3.1 Monitor Workflow
.opencode/skill/release-rulez/scripts/verify-release.sh
Or manually:
gh run list --limit 3
gh run view <RUN_ID> --watch
3.2 Verify Release Assets
VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh)
gh release view v${VERSION}
Expected assets (6 total):
- rulez-linux-x86_64.tar.gz
- rulez-linux-aarch64.tar.gz
- rulez-macos-x86_64.tar.gz
- rulez-macos-aarch64.tar.gz
- rulez-windows-x86_64.exe.zip
- checksums.txt
3.3 Announce Release
Once verified, the release is live at:
https://github.com/SpillwaveSolutions/code_agent_context_hooks/releases/tag/v${VERSION}
Phase 4: Hotfix Release
Use this when you need to release a patch (e.g., v1.0.1) from an existing release tag.
4.1 Create Hotfix Branch from Tag
git fetch --tags
git checkout v1.0.0
git checkout -b hotfix/v1.0.1
4.2 Apply Fix
Make the minimal fix needed, then run checks:
cargo fmt --all && cargo clippy --all-targets --all-features --workspace -- -D warnings && cargo test --tests --all-features --workspace
4.3 Update Version
Edit Cargo.toml at the workspace root:
[workspace.package]
version = "1.0.1"
4.4 Update Changelog
Add entry to CHANGELOG.md:
## [1.0.1] - YYYY-MM-DD
### Fixed
- Description of the hotfix
4.5 Commit and Push
git add -A
git commit -m "fix: <description of hotfix>
Hotfix for v1.0.0 addressing <issue description>"
git push -u origin hotfix/v1.0.1
4.6 Create PR to Main
gh pr create \
--title "fix: hotfix v1.0.1" \
--body "## Hotfix Release
Patches v1.0.0 with critical fix for <issue>.
### Changes
- <description>
### Release Steps After Merge
1. \`git checkout main && git pull\`
2. \`git tag v1.0.1\`
3. \`git push origin v1.0.1\`"
4.7 After PR Merge - Tag and Release
gh pr merge <PR_NUMBER> --merge --delete-branch
git checkout main && git pull
git tag v1.0.1
git push origin v1.0.1
4.8 Verify Hotfix Release
.opencode/skill/release-rulez/scripts/verify-release.sh 1.0.1
Integration Tests (Required)
Integration tests validate RuleZ works correctly with the real Claude CLI. These must pass before any release.
Running Integration Tests
task integration-test
./test/integration/run-all.sh
task integration-test-quick
./test/integration/run-all.sh --test 01-block-force-push
Test Cases
| Test | What It Validates |
|---|
01-block-force-push | RuleZ blocks dangerous git operations |
02-context-injection | RuleZ injects context for file types |
03-session-logging | RuleZ creates proper audit logs |
04-permission-explanations | RuleZ provides permission context |
Prerequisites
- Claude CLI installed and in PATH
- RuleZ binary built (auto-built by test runner)
If Tests Fail
- Check Claude CLI is installed:
which claude
- Check RuleZ builds:
cargo build --release
- Run with debug:
DEBUG=1 ./test/integration/run-all.sh
- Check logs:
~/.claude/logs/rulez.log
For details, see Integration Test README.
Scripts Reference
| Script | Purpose | Usage |
|---|
read-version.sh | Extract version from Cargo.toml | ./scripts/read-version.sh |
generate-changelog.sh | Generate changelog from commits | ./scripts/generate-changelog.sh [version] |
preflight-check.sh | Run all pre-release checks (includes integration tests) | ./scripts/preflight-check.sh [--json] |
verify-release.sh | Monitor release workflow status | ./scripts/verify-release.sh [version] |
All scripts are located in .opencode/skill/release-rulez/scripts/.
References
Quick Command Reference
Standard Release
VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh)
git checkout -b release/v${VERSION}
.opencode/skill/release-rulez/scripts/preflight-check.sh
.opencode/skill/release-rulez/scripts/generate-changelog.sh ${VERSION}
git add CHANGELOG.md Cargo.toml
git commit -m "chore: prepare v${VERSION} release"
git push -u origin release/v${VERSION}
gh pr create --title "chore: prepare v${VERSION} release" --body "..."
gh pr checks <PR> --watch
gh pr merge <PR> --merge --delete-branch
git checkout main && git pull
git tag v${VERSION}
git push origin v${VERSION}
.opencode/skill/release-rulez/scripts/verify-release.sh
Hotfix Release
git checkout v1.0.0
git checkout -b hotfix/v1.0.1
git checkout main && git pull
git tag v1.0.1
git push origin v1.0.1