agentleFS
anderson-c-santosanderson-c-santos/claude-skills-network/skills/create-release/SKILL.md

create-release

Skill1 starsChanged 5 months agoMITView on GitHub

Create a GitHub Release with changelog and version tag. Trigger for: /create-release, release, cut a release, tag release, publish release, ship version. Bumps version, generates changelog from commits, tags, and publishes via gh CLI.

  • Commits and pushes

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If output is not empty → STOP: "Working tree is dirty — commit or stash first."

    line 50
  2. Distinctive:

    Check that local branch is up to date with remote:

    line 52
  3. Distinctive:

    If commits exist that aren't pushed → warn: "Unpushed commits exist — push first."

    line 56
  4. Very specific:

    Default when no tags exist: v0.1.0 (first release is always a MINOR).

    line 63
  5. Very specific:

    If no commits → STOP: "Nothing to release — no commits since ${LAST_TAG}."

    line 69
  6. Distinctive:

    If user provided a version explicitly → skip steps 4–5, use it directly.

    line 107
  7. Distinctive:

    If no version file exists in the project → skip this step, tag only.

    line 146
  8. Very specific:

    If a feat!: commit exists, it appears in Breaking Changes AND is omitted from Features

    line 182
  9. Very specific:

    Use --generate-notes when the project uses PRs with good titles — it pulls from merged PR titles automatically.

    line 229
  10. Distinctive:

    Ask: "Attach build artifacts?

    line 233
  11. Very specific:

    When --dry-run is given:

    line 270
  12. Distinctive:

    Do NOT create tag, release, or commit anything

    line 273
  13. Distinctive:

    If a release needs to be pulled:

    line 279

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Release

Tag a version, bump version files, write a changelog, and publish a GitHub Release with optional artifacts.

Invocation Forms

  • /create-release — auto-detect next version from tags + commits
  • /create-release <version> — exact version, e.g. v1.2.0
  • /create-release <version> --pre — pre-release, e.g. v1.2.0-rc.1
  • /create-release <version> --dry-run — show what would happen, do nothing

Versioning — Semantic Versioning

Format: vMAJOR.MINOR.PATCH (always with v prefix)

BumpTrigger
PATCHonly fix/, chore/, docs/, refactor/, ci/ commits
MINORany feat/ commit
MAJORcommit body contains BREAKING CHANGE:, or type uses ! (e.g. feat!:, fix!:)

Pre-release convention: v1.2.0-beta.1, v1.2.0-rc.1, v1.2.0-alpha.1


Workflow

0. Prerequisites

# Git identity required for annotated tags
git config user.name  || { echo "ERROR: Set git user.name first"; exit 1; }
git config user.email || { echo "ERROR: Set git user.email first"; exit 1; }

# gh CLI must be authenticated
gh auth status 2>&1 | grep -q "Logged in" || { echo "ERROR: Run gh auth login"; exit 1; }

# Must be on the correct branch (main or release/*)
git branch --show-current

1. Verify clean state

git fetch --tags --prune
git status --porcelain

If output is not empty → STOP: "Working tree is dirty — commit or stash first."

Check that local branch is up to date with remote:

git log origin/$(git branch --show-current)..HEAD --oneline | wc -l

If commits exist that aren't pushed → warn: "Unpushed commits exist — push first."

2. Find latest tag

LAST_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]' | head -1)
echo "Last release: ${LAST_TAG:-none (first release)}"

Default when no tags exist: v0.1.0 (first release is always a MINOR).

3. List commits since last tag

git log ${LAST_TAG:+${LAST_TAG}...HEAD} --oneline --no-merges

If no commits → STOP: "Nothing to release — no commits since ${LAST_TAG}."

4. Auto-detect version bump

COMMITS=$(git log ${LAST_TAG:+${LAST_TAG}...HEAD} --format="%s%n%b" --no-merges)

# MAJOR: breaking change
echo "$COMMITS" | grep -qE '(BREAKING CHANGE:|^[a-z]+(\(.+\))?!:)' && BUMP=major

# MINOR: new feature
echo "$COMMITS" | grep -qE '^feat(\(.+\))?:' && [ -z "$BUMP" ] && BUMP=minor

# PATCH: everything else
BUMP=${BUMP:-patch}

echo "Bump type: $BUMP"

5. Calculate next version

# Strip 'v' prefix and split
IFS='.' read -r MAJOR MINOR PATCH <<< "${LAST_TAG#v}"
MAJOR=${MAJOR:-0}; MINOR=${MINOR:-0}; PATCH=${PATCH:-0}

case $BUMP in
  major) MAJOR=$((MAJOR+1)); MINOR=0; PATCH=0 ;;
  minor) MINOR=$((MINOR+1)); PATCH=0 ;;
  patch) PATCH=$((PATCH+1)) ;;
esac

VERSION="v${MAJOR}.${MINOR}.${PATCH}"

# Pre-release suffix
[ -n "$PRE" ] && VERSION="${VERSION}-${PRE}"   # e.g. rc.1 passed via --pre rc.1

echo "Next version: $VERSION"

If user provided a version explicitly → skip steps 4–5, use it directly.

6. Verify tag does not exist

git tag --list "$VERSION" | grep -q . \
  && { echo "Tag $VERSION already exists: $(gh release view $VERSION --json url --jq .url)"; exit 1; }

7. Bump version in project files

Detect and update version references:

Node.js — package.json:

npm version "$VERSION" --no-git-tag-version
# or manually:
node -e "const p=require('./package.json'); p.version='${VERSION#v}'; \
  require('fs').writeFileSync('package.json', JSON.stringify(p, null, 2)+'\n')"
git add package.json package-lock.json
git commit -m "chore: bump version to $VERSION"
git push origin $(git branch --show-current)

Python — pyproject.toml or setup.cfg:

sed -i "s/^version = .*/version = \"${VERSION#v}\"/" pyproject.toml
git add pyproject.toml
git commit -m "chore: bump version to $VERSION"
git push

Go — cmd/<name>/version.go (if exists):

sed -i "s/Version = .*/Version = \"$VERSION\"/" cmd/*/version.go
git add .
git commit -m "chore: bump version to $VERSION"
git push

If no version file exists in the project → skip this step, tag only.

8. Generate changelog

Build the changelog from commit history:

git log ${LAST_TAG:+${LAST_TAG}...HEAD} --format="%s %h" --no-merges

Group by prefix into sections:

## What's Changed in <VERSION>

### Breaking Changes
- <subject> (<sha>)   ← from `feat!:`, `fix!:`, `BREAKING CHANGE:` in body

### Features
- <subject> (<sha>)   ← from `feat:`, `feat(<scope>):`

### Bug Fixes
- <subject> (<sha>)   ← from `fix:`, `fix(<scope>):`

### Refactors
- <subject> (<sha>)   ← from `refactor:`

### Chores / Maintenance
- <subject> (<sha>)   ← from `chore:`, `docs:`, `ci:`, `build:`, `style:`, `test:`

**Full Changelog:** https://github.com/<owner>/<repo>/compare/<LAST_TAG>...<VERSION>

Rules:

  • Omit sections with no commits
  • Omit merge commits (Merge branch, Merge pull request)
  • If a feat!: commit exists, it appears in Breaking Changes AND is omitted from Features

9. Append to CHANGELOG.md

# Prepend new entry at the top of CHANGELOG.md
ENTRY="## [$VERSION] - $(date +%Y-%m-%d)\n\n<changelog sections>\n"
if [ -f CHANGELOG.md ]; then
  sed -i "1s/^/$ENTRY\n/" CHANGELOG.md
else
  printf "# Changelog\n\n$ENTRY" > CHANGELOG.md
fi
git add CHANGELOG.md
git commit -m "docs: update CHANGELOG for $VERSION"
git push

10. Create and push tag

git tag -a "$VERSION" -m "Release $VERSION"
git push origin "$VERSION"

Verify tag pushed:

git ls-remote --tags origin "$VERSION" | grep -q . \
  || { echo "ERROR: Tag push failed"; exit 1; }

11. Publish GitHub Release

gh release create "$VERSION" \
  --title "Release $VERSION" \
  --notes "$(cat <<'EOF'
<changelog>
EOF
)" \
  ${PRE:+--prerelease}

Alternatively, use GitHub's auto-generated notes as a supplement:

gh release create "$VERSION" \
  --title "Release $VERSION" \
  --generate-notes \
  --notes-start-tag "${LAST_TAG}"

Use --generate-notes when the project uses PRs with good titles — it pulls from merged PR titles automatically.

12. Build and attach artifacts (ask user)

Ask: "Attach build artifacts? (yes/no)"

Go:

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-X main.Version=$VERSION" \
  -o dist/app-linux-amd64 ./cmd/...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-X main.Version=$VERSION" \
  -o dist/app-darwin-arm64 ./cmd/...
gh release upload "$VERSION" dist/app-linux-amd64 dist/app-darwin-arm64

Node.js:

npm run build
zip -r dist-$VERSION.zip dist/
gh release upload "$VERSION" dist-$VERSION.zip

Docker:

docker build -t ghcr.io/12MICKY/<name>:$VERSION -t ghcr.io/12MICKY/<name>:latest .
docker push ghcr.io/12MICKY/<name>:$VERSION
docker push ghcr.io/12MICKY/<name>:latest
# Note image in release body — no file upload needed

13. Output

Released: v1.2.0
URL:      https://github.com/<owner>/<repo>/releases/tag/v1.2.0
Includes: 2 features, 1 fix, 3 chores
Artifacts: app-linux-amd64, app-darwin-arm64  (if attached)

Dry Run Mode

When --dry-run is given:

  • Show computed version, bump type, and full changelog
  • Show which files would be modified
  • Do NOT create tag, release, or commit anything

Rollback a Bad Release

If a release needs to be pulled:

# 1. Delete the GitHub Release (keeps the tag)
gh release delete "$VERSION" --yes

# 2. Delete the tag remotely and locally
git push origin :refs/tags/"$VERSION"
git tag -d "$VERSION"

# 3. Revert the version bump commit if it was pushed
git revert <commit-sha> --no-edit
git push

# 4. Re-release when fixed
# /create-release <same-version>

Edge Cases

SituationBehavior
No commits since last tagSTOP — nothing to release
Tag already existsSTOP — show existing release URL
No prior tagsStart at v0.1.0
Dirty working treeSTOP — must be clean
Git identity not setSTOP before tagging
--pre without suffixDefault to -beta.1
--dry-runPrint plan only, no changes
No version file foundSkip bump step, tag only
No CI on repoSkip Gate 3 (no status checks)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.