Create release

From richkuo/rk-skills · View interactive version

Create release is an AI agent skill from the GitHub repository richkuo/rk-skills. Creates a versioned GitHub release with release notes for the current repo. Use when the user asks to "create a release", "cut a release", "tag a version", or "publish release notes".

How to use this skill

Skill file

create-release

Tag a SHA on origin/<default> (annotated semver) and publish a GitHub release with generated notes. The local branch never decides what ships. Never push to the default branch: the version bump and notes entry land through a pull request (PR).

Preconditions: verify ALL before doing anything

gh auth status
git status --porcelain -- . ':(exclude).claude/worktrees'
DEFAULT=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name)
git fetch origin --tags

gh auth status must succeed. git status --porcelain must print nothing; if the tree is dirty, stop and surface the diff. Every later read uses origin/$DEFAULT. Any failure: stop and tell the user.

Tag-target invariant. The tagged commit must pass git merge-base --is-ancestor <sha> "origin/$DEFAULT" right after a fresh git fetch origin. No confirmation, flag, or caller instruction overrides this. On failure, stop and report the SHA and origin/$DEFAULT.

Steps

  1. Inspect actual tags. Never trust memory or CHANGELOG: git tag --sort=-v:refname | head -10.
  1. Review commits since the last tag: git log <last-tag>..origin/$DEFAULT --oneline; with no semver tag (first release), git log origin/$DEFAULT --oneline.
  1. Determine the semver bump and state the rationale. Breaking = major (never patch), feature = minor, fixes and polish = patch. Proceed without confirmation: the only question is the bump PR merge. Ask about the bump only when its type is genuinely ambiguous (for example, unclear whether commits are breaking). Then git ls-remote --tags origin refs/tags/vX.Y.Z must print nothing. Never force-overwrite a tag that exists locally or on origin: ask the user.

Previous version. The newest semver tag without its v. With no semver tag, the value all table manifests below agree on; if they disagree or none exists, ask the user (AskUserQuestion) for the first version and treat each manifest version field's value as its previous value. A first release takes X.Y.Z from the user's version, else from that agreed value.

  1. Land the version bump and the release-notes entry through a PR.

| File | Field |

|---|---|

| package.json | "version" |

| .claude-plugin/plugin.json | "version" |

| app.json / app.config.js / app.config.ts | expo.version |

| pubspec.yaml | version |

| Cargo.toml | [package] version |

| pyproject.toml | [project] version or [tool.poetry] version |

| iOS *.xcodeproj/project.pbxproj | MARKETING_VERSION |

| Android build.gradle | versionName |

  1. Create an annotated tag on the resolved SHA. Recheck the invariant first:

```bash

git fetch origin

git merge-base --is-ancestor "$SHA" "origin/$DEFAULT"

git tag -a vX.Y.Z "$SHA" -m "vX.Y.Z"

```

  1. Push the tag: git push origin vX.Y.Z.
  1. Create the release with auto-generated notes: gh release create vX.Y.Z --verify-tag --generate-notes --title "vX.Y.Z", and print the URL from its output. Never hand-write notes, and never let gh release create create the tag.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.