Automate project release workflow with version management, CHANGELOG updates, and git operations
Instalação
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Automate project release workflow with version management, CHANGELOG updates, and git operations
user-invocable
true
Release Skill
Automates the release management workflow for any project, following semantic versioning and Keep a Changelog conventions. Works with Python, Node.js, and other project types through automatic version file detection.
Usage
/release minor # Create minor version release (1.1.0 -> 1.2.0)
/release patch # Create patch version release (1.1.0 -> 1.1.1)
/release major # Create major version release (1.0.0 -> 2.0.0)
/release hotfix v1.1.0 # Create hotfix from v1.1.0 tag
/release test# Create TestPyPI test release
Authorization Notice
IMPORTANT: This repository uses a fork-based workflow.
Maintainers (@itdove): Can use this skill to create and push releases
Contributors: Should NOT create or push production tags
Fork the repository instead (see CONTRIBUTING.md)
Submit pull requests with changes
Update CHANGELOG.md in your PR
Maintainers will handle releases
If you are a contributor (not @itdove):
✅ You can use /release test for local testing
✅ You can use the skill to understand the process
❌ DO NOT push production tags (v1.2.0, etc.)
✅ Let maintainers create releases from your PRs
Skill Invocation
When invoked with arguments (e.g., /release minor), this skill guides you through:
Safety Checks: Verify prerequisites before starting
Release Readiness CI: Trigger automated readiness workflow and wait for results
Version Management: Update version in both required files
CHANGELOG Management: Update CHANGELOG.md with proper format
Git Operations: Create branches, commits, and tags
Post-Release Guidance: Provide checklist for manual steps (maintainers only)
Release Types
Regular Release (/release major|minor|patch)
Purpose: Create a new production release from main branch
Prerequisites:
All tests pass on main
CHANGELOG.md has Unreleased section with changes
Main branch is up-to-date
Steps:
Verify prerequisites (clean working directory, tests pass, CHANGELOG updated)
Run release readiness CI (mandatory — see Release Readiness CI section below)
Documentation review (mandatory — see checklist below)
Dependency security review (mandatory — merge open Dependabot CVE fixes)
Cursor hook compatibility verification (mandatory — see section below)
Create release branch (e.g., release-1.2)
Determine new version based on release type
Update version in both files (remove -dev suffix)
Update CHANGELOG.md (move Unreleased to version section with date)
Update install URLs in README.md to point to the release tag (e.g., v1.2.0) — MUST happen before tagging
Commit changes with proper commit message format
TestPyPI verification (recommended — see TestPyPI Verification section below)
Create tag and push
Verify PyPI publication
Provide post-release checklist
Hotfix Release (/release hotfix <tag>)
Purpose: Create a critical bug fix for an existing release
Preferred approach: If the minor release branch (release-x.y) still exists, apply the patch fix there directly instead of creating a separate hotfix branch. Only create a hotfix-x.y.z branch when the release branch has been deleted or in emergencies.
Prerequisites:
Valid release tag exists (e.g., v1.0.0)
Bug fix is truly critical
Steps:
Verify tag exists
Check if release-x.y branch exists
If yes (preferred): Switch to release-x.y, cherry-pick or apply fix there
If no (fallback): Create hotfix-x.y.z branch from the specified tag
Guide through bug fix implementation
Calculate hotfix version (increment patch)
Update version in both files
Update CHANGELOG.md with patch/hotfix entry
Provide instructions for tagging
Provide cherry-pick-to-main and cleanup guidance
Test Release (/release test)
Purpose: Test release process with TestPyPI before production
Prerequisites:
TestPyPI account configured
GitHub Actions workflow set up
Steps:
Create test release branch
Calculate test version (add -test suffix)
Update version in both files
Create test tag (v*-test* pattern)
Provide TestPyPI verification steps
Provide cleanup instructions
Version Management
Auto-Detection
On first use, the skill automatically detects version files in your project by scanning for common patterns:
Python projects:
pyproject.toml: version = "X.Y.Z"
setup.py: version="X.Y.Z"
__init__.py: __version__ = "X.Y.Z"
Node.js projects:
package.json: "version": "X.Y.Z"
Generic projects:
VERSION file: X.Y.Z
version.txt: X.Y.Z
The detected configuration is saved to .release-config.json and can be edited manually if needed.
CRITICAL: All detected version files MUST be kept in sync. The skill automatically updates all configured files together.
Version Format:
Production: "1.0.0" (semantic versioning)
Development: "1.1.0-dev" (on main branch)
Test: "1.2.0-test1" (for TestPyPI testing)
Version Transitions:
Regular release: 1.1.0-dev → 1.2.0 (remove -dev)
Hotfix: 1.1.0 → 1.1.1 (increment patch)
Test: 1.2.0-dev → 1.2.0-test1 (replace -dev with -test1)
## [Unreleased]### Added- New features
### Changed- Changes to existing functionality
### Fixed- Bug fixes
## [1.2.0] - 2026-04-08### Added- Feature X
- Feature Y
[Unreleased]: https://github.com/owner/repo/compare/v1.2.0...HEAD
[1.2.0]: https://github.com/owner/repo/releases/tag/v1.2.0
When updating for release:
Move all [Unreleased] content to new version section
Add release date in YYYY-MM-DD format
Update comparison links at bottom
Create new empty [Unreleased] section
Commit Message Format
Follow project conventions:
<type>: <subject>
<body>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Types:
chore: - Version bumps, release preparation
docs: - CHANGELOG updates
fix: - Hotfix bug fixes
feat: - New features (rare in release commits)
Always use HEREDOC for commit messages to ensure proper formatting:
git commit -m "$(cat <<'EOF'
chore: bump version to 2.2.0 for release
Prepare for v2.2.0 release:
- Update version in pyproject.toml
- Update version in devflow/__init__.py
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
EOF
)"
Safety Checks
Before starting any release:
✅ Verify git status is clean (no uncommitted changes)
✅ Verify on correct branch (main for regular, tag for hotfix)
✅ Verify tests pass: pytest
✅ Verify CHANGELOG.md has Unreleased section (regular releases only)
✅ Verify versions match between files
Error Handling:
Dirty working directory → Abort, ask user to commit/stash changes
Tests failing → Abort, ask user to fix tests first
Wrong branch → Abort, guide to correct branch
Missing CHANGELOG updates → Abort, ask user to update CHANGELOG
Release Readiness CI (mandatory)
Before creating the release branch, trigger the automated release readiness workflow to validate install, upgrade, IDE setup, daemon, detection, config, and MCP server functionality.
Workflow: .github/workflows/release-readiness.yml
Steps:
Trigger the workflow on the current branch:
gh workflow run release-readiness.yml --ref $(git branch --show-current)
Wait for completion (polls every 30 seconds):
# Get the run IDsleep 5
RUN_ID=$(gh run list --workflow=release-readiness.yml --limit 1 --json databaseId --jq '.[0].databaseId')
# Wait for it to finish
gh run watch "$RUN_ID"
Check results:
If all jobs pass: proceed with the release
If any job fails: abort the release and investigate
gh run view "$RUN_ID" --log-failed
Jobs validated:
fresh-install — Clean install across Python 3.9–3.14
upgrade-from-previous — Upgrade from last stable release
multi-agent-setup — All IDE adapters (claude, cursor, copilot, etc.)
detection-end-to-end — Secret, PII, and prompt injection detection
config-validation — Config profiles, migration, doctor checks
mcp-server — MCP server initialize and tool call response
smoke-tests — End-to-end violation detection for all types (secret, PII, prompt injection, SSRF, directory blocking, config exfil, jailbreak, context poisoning)
Skipping: The readiness check may be skipped for hotfix releases (/release hotfix) when the fix is urgent, but this should be documented in the release notes.
Note: The release readiness workflow includes smoke tests (smoke-tests.yml) as a reusable workflow — no need to run smoke tests separately.
Documentation Review (mandatory)
Before creating the release branch, compare docs against changes since the previous release tag:
Review all docs/ files for accuracy:
find docs/ -name '*.md' -type f | sort
Read each file and verify its content matches current functionality.
Cursor IDE uses its own hooks in ~/.cursor/hooks.json. Since Cursor could change hook support in any update, each release must verify all 6 hook events still fire correctly. This is a semi-automated 3-step flow.
Removes debug hooks from hooks.json, deletes debug script and log files, removes backup.
Decision
All 6 events PASS: Proceed with release. Add to CHANGELOG: "Verified Cursor hook compatibility with Cursor vX.Y.Z"
Any event FAIL: Block the release. Investigate whether Cursor dropped hook support. Only proceed with explicit override and documented justification.
Skipping: May be skipped for hotfix releases (/release hotfix) when the fix is urgent, but this should be documented in the release notes.
TestPyPI Verification (recommended)
Before creating the production tag, verify the package builds and renders correctly on TestPyPI. This catches README rendering issues, missing files, and metadata problems before they reach the real PyPI (where you can't re-upload the same version).
Workflow: .github/workflows/publish-test.yml
Steps:
Create a test tag from the release branch (after all commits including URL updates):
git tag -a vX.Y.Z-test1 -m "Test release vX.Y.Z-test1"
git push origin vX.Y.Z-test1
Wait for TestPyPI publish workflow to complete:
sleep 5
RUN_ID=$(gh run list --workflow=publish-test.yml --limit 1 --json databaseId --jq '.[0].databaseId')
gh run watch "$RUN_ID"
Verify on TestPyPI:
Check the project page: https://test.pypi.org/project/ai-guardian/X.Y.Z-test1/
Optionally test install: pip install -i https://test.pypi.org/simple/ ai-guardian==X.Y.Z.test1
If issues found: fix on release branch, delete the test tag, create a new test tag (-test2), and re-verify.
If clean: proceed with production tag creation.
Clean up test tags after production release:
git tag -d vX.Y.Z-test1
git push origin --delete vX.Y.Z-test1
Skipping: May be skipped for hotfix releases when the fix is urgent. Document the skip in the release notes.
Why this matters: PyPI does not allow re-uploading the same version. A README rendering bug or missing metadata on PyPI is permanent for that version — you'd need a patch release (X.Y.Z+1) to fix it.
Git Operations
Branch Naming:
Regular release: release-X.Y (e.g., release-2.2)
Patch fix: Prefer existing release-X.Y branch; use hotfix-X.Y.Z (e.g., hotfix-2.1.1) only when release branch is deleted
Test release: release-X.Y-test (e.g., release-2.2-test)
Tag Naming:
Production: vX.Y.Z (e.g., v2.2.0)
Test: vX.Y.Z-testN (e.g., v2.2.0-test1)
Important:
DO NOT push tags automatically - provide command for user to review and push
DO NOT run destructive operations without confirmation
DO provide clear instructions for manual steps
Post-Release Checklist
⚠️ MAINTAINERS ONLY - Check project's RELEASING.md or CONTRIBUTING.md for authorized release managers.
Ensure main branch README.md install URLs point to main (not a version tag — there is no PyPI release for dev versions)
Push main branch
(Hotfix only) Cherry-pick fix to main
Generate combined docs export — run the shell one-liner from AGENTS.md "Generating Combined Documentation for LLM Upload" section to create docs/notebooklm-export.md
Update NotebookLM sources — if the notebooklm-mcp MCP server is available, upload the generated docs/notebooklm-export.md and update other sources in the AI Guardian notebook using source_add
Generate demo guide — create X.Y-demo-guide.md in the external docs directory (see AGENTS.md) documenting new features with step-by-step demonstrations for stakeholder walkthroughs
If you are NOT authorized:
❌ DO NOT push the tag
✅ Create PR with the release branch
✅ Notify maintainers that release is ready
✅ Provide the tag command in PR description
Workflow Examples
Regular Minor Release
/release minor
# Skill will:# 1. Auto-detect version files (first run only)# 2. Verify prerequisites# 3. Run documentation review checklist# 4. Create release-1.2 branch# 5. Update version 1.1.0-dev → 1.2.0 in all detected files# 6. Update CHANGELOG.md for v1.2.0# 7. Commit changes# 8. Provide tag creation command: git tag -a v1.2.0 -m "..."# 9. Provide post-release instructions
Hotfix Release
/release hotfix v1.1.0
# Skill will:# 1. Verify v1.1.0 tag exists# 2. Check if release-1.1 branch exists# - If yes: switch to release-1.1 (preferred)# - If no: create hotfix-1.1.1 branch from v1.1.0# 3. Wait for user to implement fix (or cherry-pick from main)# 4. Update version to 1.1.1 in all configured files# 5. Update CHANGELOG.md for v1.1.1# 6. Commit changes# 7. Provide tag creation and cherry-pick-to-main commands
Test Release
/release test# Skill will:# 1. Create release-1.2-test branch# 2. Update version 1.2.0-dev → 1.2.0-test1 in all configured files# 3. Commit changes# 4. Create test tag v1.2.0-test1# 5. Provide test verification steps# 6. Provide cleanup commands
Implementation Guidelines
When user invokes this skill:
Auto-detect version files (first run only): Scan for common version file patterns
Parse arguments: Determine release type (major/minor/patch/hotfix/test)
Run safety checks: Verify prerequisites before proceeding
Release readiness CI: Trigger release-readiness.yml workflow and wait for all jobs to pass (regular releases only, may skip for urgent hotfixes)
Documentation review: Run the mandatory documentation review checklist (regular releases only)
Dependency security review: Check for open Dependabot CVE alerts and merge critical/high severity fixes (regular releases only)
Cursor hook verification: Run the semi-automated Cursor hook compatibility check (regular releases only, may skip for urgent hotfixes)
Calculate new version: Based on current version and release type
Update version files: Edit all detected version files atomically
Update CHANGELOG: Move Unreleased to version section with date
Update install URLs: Replace main with release tag in README.md install commands (before tagging — PyPI uses the tag snapshot as package README)
Create commits: Use proper commit message format
TestPyPI verification: Create test tag, verify README renders correctly on TestPyPI (recommended, may skip for hotfixes)
Create production tag: After TestPyPI verification passes
Validate: Ensure versions match between all files
Error Recovery:
If any step fails, provide clear error message and recovery steps
Never leave repository in inconsistent state
If versions are out of sync, stop and report the issue
If no version files detected, provide instructions for manual configuration
Testing Strategy
Before using this skill for production releases:
Test version detection:
python .claude/skills/release/release_helper.py get-version
# Verify all version files detected correctly
Test with test release first:
/release test# Verify workflow works end-to-end
Verify version updates:
Check all detected files updated correctly
Verify versions match across all files
Verify -dev suffix handling
Verify CHANGELOG updates:
Unreleased section moved correctly
Date added in correct format
Comparison links generated
Verify safety checks:
Test with uncommitted changes (should abort)
Test on wrong branch (should abort)
Test with missing CHANGELOG updates (should abort)