Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

update-release

БесплатноБез исполняемых скриптовНе проверен

Automates the release process for the ts-oauth2-server project.

jasonraimondiот jasonraimondi★ 312 звёзд на GitHub19 установок в других каталогах

Об этом скилле

Release Creator Skill

Purpose

Automates the release process for the ts-oauth2-server project by:

  1. Bumping version numbers in both package.json and jsr.json
  2. Generating changelog entries based on git commits since the last tagged version
  3. Updating the CHANGELOG.md file with proper formatting
  4. Maintaining Keep a Changelog format and Semantic Versioning compliance
  5. Always running the full pre-flight (pnpm typecheck && pnpm build && pnpm test) before release, aborting if any step fails
  6. Pausing for user confirmation, then committing, tagging, pushing, and creating the GitHub release (which triggers npm + JSR publish via .github/workflows/publish.yml)

When to Use This Skill

Use this skill when the user requests:

  • Creating a new release
  • Bumping the version (patch, minor, major, premajor, preminor, prepatch, prerelease)
  • Updating the changelog
  • Preparing for a release
  • Publishing a new version

Prerequisites

  • Git repository with commit history
  • Existing tags for version tracking
  • package.json and jsr.json files present
  • CHANGELOG.md file exists

Core Functionality

Version Bump Types

Supported version bump types (following semver):

  • patch: Bug fixes (1.0.0 → 1.0.1)
  • minor: New features (1.0.0 → 1.1.0)
  • major: Breaking changes (1.0.0 → 2.0.0)
  • prepatch: Pre-release patch (1.0.0 → 1.0.1-rc.0)
  • preminor: Pre-release minor (1.0.0 → 1.1.0-rc.0)
  • premajor: Pre-release major (1.0.0 → 2.0.0-rc.0)
  • prerelease: Increment pre-release (1.0.0-rc.0 → 1.0.0-rc.1)

Prerelease format (REQUIRED): -rc.#. This project's prereleases are always X.Y.Z-rc.N, starting at rc.0 and incrementing the trailing number (rc.0 → rc.1 → …). Never use bare -0 or -next.N suffixes. The new prerelease number must be strictly greater than the previous one for the same X.Y.Z.

Implementation Steps

1. Get Current Version

import { readFileSync } from 'fs';

function getCurrentVersion(): string {
  const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
  return pkg.version;
}

2. Calculate New Version

// Prereleases use the REQUIRED `-rc.#` convention (e.g. 5.0.0-rc.0, 5.0.0-rc.1).
function bumpVersion(current: string, bumpType: string): string {
  const parts = current.split('-');
  const [major, minor, patch] = parts[0].split('.').map(Number);
  const prerelease = parts[1]; // e.g. "rc.0"

  switch (bumpType) {
    case 'major':
      return `${major + 1}.0.0`;
    case 'minor':
      return `${major}.${minor + 1}.0`;
    case 'patch':
      return `${major}.${minor}.${patch + 1}`;
    case 'premajor':
      return `${major + 1}.0.0-rc.0`;
    case 'preminor':
      return `${major}.${minor + 1}.0-rc.0`;
    case 'prepatch':
      return `${major}.${minor}.${patch + 1}-rc.0`;
    case 'prerelease':
      if (prerelease) {
        // Increment the trailing rc number: "rc.0" -> "rc.1". Reject non-rc suffixes.
        const match = prerelease.match(/^rc\.(\d+)$/);
        if (!match) {
          throw new Error(`Prerelease must use the -rc.# format, got: ${prerelease}`);
        }
        return `${parts[0]}-rc.${parseInt(match[1], 10) + 1}`;
      }
      return `${major}.${minor}.${patch + 1}-rc.0`;
    default:
      throw new Error(`Invalid bump type: ${bumpType}`);
  }
}

3. Get Git Commits Since Last Tag

# Get the last tag
last_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "")

# Get commits since last tag
if [ -z "$last_tag" ]; then
  # No previous tag, get all commits
  commits=$(git log --pretty=format:"%s" --no-merges)
else
  # Get commits since last tag
  commits=$(git log ${last_tag}..HEAD --pretty=format:"%s" --no-merges)
fi

4. Categorize Commits

Parse commits and categorize them based on conventional commit format:

  • feat: or feature: → Added section
  • fix: → Fixed section
  • BREAKING CHANGE: or !: → Changed section (breaking)
  • docs: → Skip (or note in documentation)
  • chore:, refactor:, test: → Skip or group under "Changed"
  • security: → Security section

5. Generate Changelog Entry

Follow Keep a Changelog format:

## [Version] - YYYY-MM-DD

### Added
- New feature A
- New feature B

### Changed
- **BREAKING**: Changed behavior X
- Updated Y

### Fixed
- Fixed bug in Z
- Resolved issue with W

### Security
- Security fix for vulnerability V

6. Update Files

Update both package.json and jsr.json with the new version, and prepend the new changelog entry to CHANGELOG.md under the ## [Unreleased] section.

7. Run the Full Pre-flight (REQUIRED)

Always run the full pre-flight locally before pausing for confirmation. The publish workflow runs pnpm build && pnpm test in CI, but failures there fire only after the release event — too late to undo a consumed version. Catch them locally first.

Run all three, in order, and abort the release if any fails:

pnpm typecheck   # tsc -p t
Полный SKILL.md на GitHub

Установить update-release в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл update-release?

Automates the release process for the ts-oauth2-server project.

Как установить скилл update-release?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл update-release запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить update-release с