Get the FREE Ultimate OpenClaw Setup Guide →

bump-release

Scanned
npx machina-cli add skill PaulRBerg/agent-skills/bump-release --openclaw
Files (1)
SKILL.md
6.1 KB

Bump Release

Support for both regular and beta releases.

Parameters

  • version: Optional explicit version to use (e.g., 2.0.0). When provided, skips automatic version inference
  • --beta: Create a beta release with -beta.X suffix
  • --dry-run: Preview the release without making any changes (no file modifications, commits, or tags)

Steps

  1. Locate the package - The user may be in a monorepo where the package to release lives in a subdirectory. Look for package.json in the current working directory first; if not found, ask which package to release. All file paths (CHANGELOG.md, package.json, justfile) are relative to the package directory.
  2. Update the CHANGELOG.md file with all changes since the last version release (skip this step for beta releases).
  3. Bump the version in package.json:
    • Regular release: Follow semantic versioning (e.g., 1.2.3)
    • Beta release: Add -beta.X suffix (e.g., 1.2.3-beta.1)
  4. Format files - If a justfile exists in the repository, run just full-write to ensure CHANGELOG.md and package.json are properly formatted
  5. Commit the changes with a message like "docs: release <version>"
  6. Create a new git tag by running git tag -a v<version> -m "<version>"

Note: When --dry-run flag is provided, display what would be done without making any actual changes to files, creating commits, or tags.

Tasks

Process

  1. Check for arguments - Determine if version was provided, if this is a beta release (--beta), and/or dry-run (--dry-run)
  2. Check for clean working tree - Run git status --porcelain to verify there are no uncommitted changes unrelated to this release. If there are, run the commit skill to commit them before proceeding
  3. Write Changelog - Examine diffs between the current branch and the previous tag to write Changelog. Then find relevant PRs by looking at the commit history and add them to each changelog (when available). If package.json contains a files field, only include changes within those specified files/directories. If no files field exists, include all changes except test changes, CI/CD workflows, and development tooling
  4. Follow format - Consult references/common-changelog.md for the Common Changelog specification
  5. Check version - Get current version from package.json
  6. Bump version - If version argument provided, use it directly. Otherwise, if unchanged since last release, increment per Semantic Versioning rules:
    • For regular releases:
      • PATCH (x.x.X) - Bug fixes, documentation updates
      • MINOR (x.X.x) - New features, backward-compatible changes
      • MAJOR (X.x.x) - Breaking changes
    • For beta releases (--beta flag):
      • If current version has no beta suffix: Add -beta.1 to the version
      • If current version already has beta suffix: Increment beta number (e.g., -beta.1-beta.2)
      • If moving from beta to release: Remove beta suffix and use the base version

Beta Release Logic

When --beta flag is provided in the $ARGUMENTS

  1. Check for explicit version - If version provided:
    • If version already has beta suffix → use as-is
    • If version has no beta suffix → append -beta.1
  2. Otherwise, parse current version from package.json and determine beta version:
    • If current version is 1.2.3: Create 1.2.4-beta.1 (increment patch + beta.1)
    • If current version is 1.2.3-beta.1: Create 1.2.3-beta.2 (increment beta number)
    • If current version is 1.2.3-beta.5: Create 1.2.3-beta.6 (increment beta number)
  3. Skip CHANGELOG.md update - Beta releases don't update the changelog
  4. Commit and tag with beta version (e.g., v1.2.4-beta.1)

Output

For regular releases only, generate changelog entries in CHANGELOG.md following the format and writing guidelines in references/common-changelog.md. Use the Changed, Added, Removed, Fixed categories (in that order). Every entry must begin with a present-tense verb in imperative mood.

Inclusion Criteria

For regular releases only (changelog generation is skipped for beta releases):

  • Files field constraint - If package.json contains a files field, only include changes to files/directories specified in that array. All other codebase changes should be excluded from the CHANGELOG
  • Production changes only - When no files field exists, exclude test changes, CI/CD workflows, and development tooling
  • Reference pull requests - Link to PRs when available for context
  • Net changes only - Examine diffs between the current branch and the previous tag to identify changes
  • Only dependencies and peerDependencies changes - Exclude changes to devDependencies

Examples

Regular Release

# Create a regular patch/minor/major release
/bump-release

# Preview what a regular release would do
/bump-release --dry-run

Beta Release

# Create a beta release with -beta.X suffix
/bump-release --beta

# Preview what a beta release would do
/bump-release --beta --dry-run

Explicit Version

# Specify exact version
/bump-release 2.0.0

# Specify exact beta version
/bump-release 2.0.0-beta.1

# Combine with flags
/bump-release 2.0.0 --dry-run

Version Examples

Current VersionRelease TypeNew Version
1.2.3Regular1.2.4 (patch)
1.2.3Beta1.2.4-beta.1
1.2.3-beta.1Beta1.2.3-beta.2
1.2.3-beta.5Regular1.2.3
1.2.32.0.02.0.0
1.2.32.0.0 + Beta2.0.0-beta.1

Resources

  • references/common-changelog.md — Common Changelog format and writing guidelines

Source

git clone https://github.com/PaulRBerg/agent-skills/blob/main/skills/bump-release/SKILL.mdView on GitHub

Overview

Bump Release automates version bumps, changelog updates, and git tagging for both regular and beta releases. It updates package.json, optionally updates CHANGELOG.md, formats files, commits changes, and creates an annotated git tag. This ensures consistent release workflows across monorepos and multiple packages.

How This Skill Works

The skill analyzes input arguments (version, --beta, --dry-run), locates the target package.json, and updates CHANGELOG.md unless performing a beta release. It bumps the package.json version (adding -beta.X for beta releases), formats files with just full-write if a justfile exists, commits changes with a release message, and creates an annotated git tag (v<version>). If --dry-run is provided, no files are changed, no commits are made, and no tags are created.

When to Use It

  • You want to cut a regular release for a package in a repo with or without a monorepo layout.
  • You need to create a beta pre-release to gather feedback before a full release.
  • You are releasing a package that includes a CHANGELOG and you want it updated automatically.
  • You want to preview changes without applying them (--dry-run) before actual release.
  • You are releasing in a multi-package repository and need a consistent tagging scheme (v<version>).

Quick Start

  1. Step 1: In the repository, ensure you’re in the package directory (containing package.json) or specify which package to release.
  2. Step 2: Run a release command, e.g., bump-release --version 2.0.0 or bump-release --beta --version 2.0.0, and optionally add --dry-run to preview.
  3. Step 3: Review the generated changes (CHANGELOG.md, package.json, and the git tag), then push the commits and tags if not using --dry-run.

Best Practices

  • Ensure the working tree is clean before releasing to avoid unintended changes.
  • Pass an explicit version when you require deterministic releases and avoid auto-inference.
  • If not releasing a beta, update CHANGELOG.md only for regular releases; beta releases skip this step.
  • Use --dry-run first to preview changes before applying commits and tags.
  • In monorepos, verify the correct package.json is targeted and that all changes stay within the package scope.

Example Use Cases

  • Release 2.0.0 for a package in a monorepo: bump-release --version 2.0.0
  • Create a beta pre-release: bump-release --beta --version 2.1.0-beta.1
  • Dry-run preview for a patch release: bump-release --version 2.0.1 --dry-run
  • Generate changelog and tag for a minor release: bump-release --version 2.3.0
  • Skip changelog for a beta while bumping patch: bump-release --beta --version 2.1.4

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers