Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Collection of baoyu productivity skills for content creation, AI generation, and utility tools in Claude Code.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: release-skills3description: Universal release workflow. Auto-detects version files and changelogs. Supports Node.js, Python, Rust, Claude Plugin, GitHub Releases, annotated tags, historical release backfill, and generic projects. Use when user says "release", "发布", "new version", "bump version", "push", "推送", "release notes", "GitHub Release", or "回填 Release".4---56# Release Skills78Universal release workflow supporting any project type with multi-language changelog.910## User Input Tools1112When this skill prompts the user, follow this tool-selection rule (priority order):13141. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.152. **Fallback**: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each question.163. **Batching**: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question, ask them one at a time in priority order.1718Concrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.1920## Quick Start2122Just run `/release-skills` - auto-detects your project configuration.2324## Supported Projects2526| Project Type | Version File | Auto-Detected |27|--------------|--------------|---------------|28| Node.js | package.json | ✓ |29| Python | pyproject.toml | ✓ |30| Rust | Cargo.toml | ✓ |31| Claude Plugin | marketplace.json | ✓ |32| Generic | VERSION / version.txt | ✓ |3334## Options3536| Flag | Description |37|------|-------------|38| `--dry-run` | Preview changes without executing |39| `--major` | Force major version bump |40| `--minor` | Force minor version bump |41| `--patch` | Force patch version bump |42| `--backfill-releases` | Create missing GitHub Releases for existing tags from changelog sections |4344## Workflow4546### Step 1: Detect Project Configuration47481. Check for `.releaserc.yml` (optional config override)49- If present, inspect whether it defines release hooks502. Auto-detect version file by scanning (priority order):51- `package.json` (Node.js)52- `pyproject.toml` (Python)53- `Cargo.toml` (Rust)54- `marketplace.json` or `.claude-plugin/marketplace.json` (Claude Plugin)55- `VERSION` or `version.txt` (Generic)563. Scan for changelog files using glob patterns:57- `CHANGELOG*.md`58- `HISTORY*.md`59- `CHANGES*.md`604. Identify language of each changelog by filename suffix615. Detect GitHub release support:62- Check whether `origin` points to GitHub63- Check whether `gh` is installed and authenticated64- Check existing releases with `gh release list --limit 5` when available656. Display detected configuration6667**Project Hook Contract**:6869If `.releaserc.yml` defines `release.hooks`, keep the release workflow generic and delegate project-specific packaging/publishing to those hooks.7071Supported hooks:7273| Hook | Purpose | Expected Responsibility |74|------|---------|-------------------------|75| `prepare_artifact` | Make one target releasable | Validate the target is self-contained, sync/embed local dependencies, optionally stage extra files |76| `publish_artifact` | Publish one releasable target | Upload the prepared target (or a staged directory if the project uses one), attach version/changelog/tags |7778Supported placeholders:7980| Placeholder | Meaning |81|-------------|---------|82| `{project_root}` | Absolute path to repository root |83| `{target}` | Absolute path to the module/skill being released |84| `{artifact_dir}` | Absolute path to a temporary staging directory for this target, when the project uses one |85| `{version}` | Version selected by the release workflow |86| `{dry_run}` | `true` or `false` |87| `{release_notes_file}` | Absolute path to a UTF-8 file containing release notes/changelog text |8889Execution rules:90- Keep the skill generic: do not hardcode registry/package-manager/project layout details into this SKILL.91- If `prepare_artifact` exists, run it once per target before publish-related checks that need the final releasable target state.92- Write release notes to a temp file and pass that file path to `publish_artifact`; do not inline multiline changelog text into shell commands.93- If hooks are absent, fall back to the default project-agnostic release workflow.9495**Language Detection Rules**:9697Changelog files follow the pattern `CHANGELOG_{LANG}.md` or `CHANGELOG.{lang}.md`, where `{lang}` / `{LANG}` is a language or region code.9899| Pattern | Example | Language |100|---------|---------|----------|101| No suffix | `CHANGELOG.md` | en (default) |102| `_{LANG}` (uppercase) | `CHANGELOG_CN.md`, `CHANGELOG_JP.md` | Corresponding language |103| `.{lang}` (lowercase) | `CHANGELOG.zh.md`, `CHANGELOG.ja.md` | Corresponding language |104| `.{lang-region}` | `CHANGELOG.zh-CN.md` | Corresponding region variant |105106Common language codes: `zh` (Chinese), `ja` (Japanese), `ko` (Korean), `de` (German), `fr` (French), `es` (Spanish).107108**Output Example**:109```110Project detected:111Version file: package.json (1.2.3)112Changelogs:113- CHANGELOG.md (en)114- CHANGELOG.zh.md (zh)115- CHANGELOG.ja.md (ja)116```117118### Step 2: Analyze Changes Since Last Tag119120```bash121LAST_TAG=$(git tag --sort=-v:refname | head -1)122git log ${LAST_TAG}..HEAD --oneline123git diff ${LAST_TAG}..HEAD --stat124```125126Categorize by conventional commit types:127128| Type | Description |129|------|-------------|130| feat | New features |131| fix | Bug fixes |132| docs | Documentation |133| refactor | Code refactoring |134| perf | Performance improvements |135| test | Test changes |136| style | Formatting, styling |137| chore | Maintenance (skip in changelog) |138139**Breaking Change Detection**:140- Commit message starts with `BREAKING CHANGE`141- Commit body/footer contains `BREAKING CHANGE:`142- Removed public APIs, renamed exports, changed interfaces143144If breaking changes detected, warn user: "Breaking changes detected. Consider major version bump (--major flag)."145146### Step 3: Determine Version Bump147148Rules (in priority order):1491. User flag `--major/--minor/--patch` → Use specified1502. BREAKING CHANGE detected → Major bump (1.x.x → 2.0.0)1513. `feat:` commits present → Minor bump (1.2.x → 1.3.0)1524. Otherwise → Patch bump (1.2.3 → 1.2.4)153154Display version change: `1.2.3 → 1.3.0`155156### Step 4: Generate Multi-language Changelogs157158For each detected changelog file:1591601. **Identify language** from filename suffix1612. **Detect third-party contributors**:162- Check merge commits: `git log ${LAST_TAG}..HEAD --merges --pretty=format:"%H %s"`163- For each merged PR, identify the PR author via `gh pr view <number> --json author --jq '.author.login'`164- Compare against repo owner (`gh repo view --json owner --jq '.owner.login'`)165- If PR author ≠ repo owner → third-party contributor1663. **Generate content in that language**:167- Section titles in target language168- Change descriptions written naturally in target language (not translated)169- Date format: YYYY-MM-DD (universal)170- **Third-party contributions**: Append contributor attribution `(by @username)` to the changelog entry1714. **Insert at file head** (preserve existing content)172173**Section Title Translations** (built-in):174175| Type | en | zh | ja | ko | de | fr | es |176|------|----|----|----|----|----|----|-----|177| feat | Features | 新功能 | 新機能 | 새로운 기능 | Funktionen | Fonctionnalités | Características |178| fix | Fixes | 修复 | 修正 | 수정 | Fehlerbehebungen | Corrections | Correcciones |179| docs | Documentation | 文档 | ドキュメント | 문서 | Dokumentation | Documentation | Documentación |180| refactor | Refactor | 重构 | リファクタリング | 리팩토링 | Refactoring | Refactorisation | Refactorización |181| perf | Performance | 性能优化 | パフォーマンス | 성능 | Leistung | Performance | Rendimiento |182| breaking | Breaking Changes | 破坏性变更 | 破壊的変更 | 주요 변경사항 | Breaking Changes | Changements majeurs | Cambios importantes |183184**Changelog Format**:185186```markdown187## {VERSION} - {YYYY-MM-DD}188189### Features190- Description of new feature191- Description of third-party contribution (by @username)192193### Fixes194- Description of fix195196### Documentation197- Description of docs changes198```199200Only include sections that have changes. Omit empty sections.201202**Third-Party Attribution Rules**:203- Only add `(by @username)` for contributors who are NOT the repo owner204- Use GitHub username with `@` prefix205- Place at the end of the changelog entry line206- Apply to all languages consistently (always use `(by @username)` format, not translated)207208**Multi-language Example**:209210English (CHANGELOG.md):211```markdown212## 1.3.0 - 2026-01-22213214### Features215- Add user authentication module (by @contributor1)216- Support OAuth2 login217218### Fixes219- Fix memory leak in connection pool220```221222Chinese (CHANGELOG.zh.md):223```markdown224## 1.3.0 - 2026-01-22225226### 新功能227- 新增用户认证模块 (by @contributor1)228- 支持 OAuth2 登录229230### 修复231- 修复连接池内存泄漏问题232```233234Japanese (CHANGELOG.ja.md):235```markdown236## 1.3.0 - 2026-01-22237238### 新機能239- ユーザー認証モジュールを追加 (by @contributor1)240- OAuth2 ログインをサポート241242### 修正243- コネクションプールのメモリリークを修正244```245246### Step 5: Group Changes by Skill/Module247248Analyze commits since last tag and group by affected skill/module:2492501. **Identify changed files** per commit2512. **Group by skill/module**:252- `skills/<skill-name>/*` → Group under that skill253- Root files (CLAUDE.md, etc.) → Group as "project"254- Multiple skills in one commit → Split into multiple groups2553. **For each group**, identify related README updates needed256257**Example Grouping**:258```259baoyu-cover-image:260- feat: add new style options261- fix: handle transparent backgrounds262→ README updates: options table263264baoyu-comic:265- refactor: improve panel layout algorithm266→ No README updates needed267268project:269- docs: update CLAUDE.md architecture section270```271272### Step 6: Commit Each Skill/Module Separately273274For each skill/module group (in order of changes):2752761. **Check README updates needed**:277- Scan `README*.md` for mentions of this skill/module278- Verify options/flags documented correctly279- Update usage examples if syntax changed280- Update feature descriptions if behavior changed2812822. **Stage and commit**:283```bash284git add skills/<skill-name>/*285git add README.md README.zh.md # If updated for this skill286git commit -m "<type>(<skill-name>): <meaningful description>"287```2882893. **Commit message format**:290- Use conventional commit format: `<type>(<scope>): <description>`291- `<type>`: feat, fix, refactor, docs, perf, etc.292- `<scope>`: skill name or "project"293- `<description>`: Clear, meaningful description of changes294295**Example Commits**:296```bash297git commit -m "feat(baoyu-cover-image): add watercolor and minimalist styles"298git commit -m "fix(baoyu-comic): improve panel layout for long dialogues"299git commit -m "docs(project): update architecture documentation"300```301302**Common README Updates Needed**:303| Change Type | README Section to Check |304|-------------|------------------------|305| New options/flags | Options table, usage examples |306| Renamed options | Options table, usage examples |307| New features | Feature description, examples |308| Breaking changes | Migration notes, deprecation warnings |309| Restructured internals | Architecture section (if exposed to users) |310311### Step 7: Generate Changelog and Update Version3123131. **Generate multi-language changelogs** (as described in Step 4)3142. **Update version file**:315- Read version file (JSON/TOML/text)316- Update version number317- Write back (preserve formatting)3183. **Create release notes file**:319- Prefer the new version section from `CHANGELOG.md`320- If no English/default changelog exists, use the first detected changelog321- Extract only the exact `## {VERSION} - {YYYY-MM-DD}` section through the next `##`322- Match both plain version and tag-prefixed headings when needed, e.g. `1.2.3` and `v1.2.3`323- Keep breaking changes near the top; if needed, add a short highlight before other sections324- Write notes to a UTF-8 temp file and reuse it for annotated tag messages, GitHub Releases, and `publish_artifact`325- In normal mode, stop rather than creating an empty tag or GitHub Release when notes cannot be found326327**Version Paths by File Type**:328329| File | Path |330|------|------|331| package.json | `$.version` |332| pyproject.toml | `project.version` |333| Cargo.toml | `package.version` |334| marketplace.json | `$.metadata.version` |335| VERSION / version.txt | Direct content |336337### Step 8: User Confirmation338339Before creating the release commit, ask user to confirm:340341**Use AskUserQuestion with three questions**:3423431. **Version bump** (single select):344- Show recommended version based on Step 3 analysis345- Options: recommended (with label), other semver options346- Example: `1.2.3 → 1.3.0 (Recommended)`, `1.2.3 → 1.2.4`, `1.2.3 → 2.0.0`3473482. **Push to remote** (single select):349- Options: "Yes, push after commit", "No, keep local only"3503513. **Publish GitHub Release** (single select):352- Offer this only when GitHub release support is available353- Default to "Yes, publish after tag push" when the user also chose push354- If the user keeps the release local, do not create or edit a GitHub Release355356**Example Output Before Confirmation**:357```358Commits created:3591. feat(baoyu-cover-image): add watercolor and minimalist styles3602. fix(baoyu-comic): improve panel layout for long dialogues3613. docs(project): update architecture documentation362363Changelog preview (en):364## 1.3.0 - 2026-01-22365### Features366- Add watercolor and minimalist styles to cover-image367### Fixes368- Improve panel layout for long dialogues in comic369370Release notes source: CHANGELOG.md#1.3.0371Ready to create release commit, annotated tag, and GitHub Release.372```373374### Step 9: Create Release Commit and Annotated Tag375376After user confirmation:3773781. **Stage version and changelog files**:379```bash380git add <version-file>381git add CHANGELOG*.md382```3833842. **Create release commit**:385```bash386git commit -m "chore: release v{VERSION}"387```3883893. **Create annotated tag**:390```bash391git tag -a v{VERSION} -F <release-notes-file>392```393If `.releaserc.yml` sets `tag.sign: true`, use `git tag -s` with the same notes file.3943954. **Push if user confirmed** (Step 8):396```bash397git push origin main398git push origin v{VERSION}399```400401**Note**: Do NOT add Co-Authored-By line. This is a release commit, not a code contribution.402403### Step 10: Publish Release Artifacts and GitHub Release404405Project artifact publishing and GitHub Releases are separate outputs:4064071. **Project artifacts**:408- If `release.hooks.publish_artifact` exists, run it once per prepared target409- Pass the same `{release_notes_file}` used for the tag and GitHub Release410- In dry-run mode, pass `{dry_run}=true` and report what would be published4114122. **GitHub Release**:413- Run only if the user confirmed remote publishing and GitHub support is available414- Ensure the tag exists on the remote before creating the release415- Create or update using the extracted notes:416```bash417if gh release view v{VERSION} >/dev/null 2>&1; then418gh release edit v{VERSION} --title "v{VERSION}" --notes-file <release-notes-file>419else420gh release create v{VERSION} --title "v{VERSION}" --notes-file <release-notes-file> --verify-tag421fi422```423- Never inline multiline release notes into shell commands424425**Post-Release Output**:426```427Release v1.3.0 created.428429Commits:4301. feat(baoyu-cover-image): add watercolor and minimalist styles4312. fix(baoyu-comic): improve panel layout for long dialogues4323. docs(project): update architecture documentation4334. chore: release v1.3.0434435Tag: v1.3.0436Tag type: annotated437GitHub Release: published # or "skipped/local only"438Status: Pushed to origin # or "Local only - run git push when ready"439```440441## Backfill Existing GitHub Releases442443Use this mode when the user asks to backfill historical releases or passes `--backfill-releases`.4444451. Do not bump versions, edit changelogs, or create release commits.4462. List existing tags in version order and detect missing releases:447```bash448git tag --sort=v:refname449gh release view <tag>450```4513. For each tag without a GitHub Release:452- Normalize the changelog lookup by stripping the configured tag prefix, e.g. `v1.2.3` -> `1.2.3`453- Extract the matching section from `CHANGELOG.md`; fall back to the first matching changelog file454- Skip or ask before publishing if no matching changelog section exists455- Create the release with:456```bash457gh release create <tag> --title "<tag>" --notes-file <release-notes-file> --verify-tag458```4594. Detect lightweight tags with `git cat-file -t <tag>` (`commit` means lightweight, `tag` means annotated).4605. Do not rewrite public lightweight tags by default. Converting an existing remote tag to an annotated tag requires explicit user confirmation because it rewrites a published reference.461462## Configuration (.releaserc.yml)463464Optional config file in project root to override defaults:465466```yaml467# .releaserc.yml - Optional configuration468469# Version file (auto-detected if not specified)470version:471file: package.json472path: $.version # JSONPath for JSON, dotted path for TOML473474# Changelog files (auto-detected if not specified)475changelog:476files:477- path: CHANGELOG.md478lang: en479- path: CHANGELOG.zh.md480lang: zh481- path: CHANGELOG.ja.md482lang: ja483484# Section mapping (conventional commit type → changelog section)485# Use null to skip a type in changelog486sections:487feat: Features488fix: Fixes489docs: Documentation490refactor: Refactor491perf: Performance492test: Tests493chore: null494495# Commit message format496commit:497message: "chore: release v{version}"498499# Tag format500tag:501prefix: v # Results in v1.0.0502sign: false503504# Additional files to include in release commit505include:506- README.md507- package.json508```509510## Dry-Run Mode511512When `--dry-run` is specified:513514```515=== DRY RUN MODE ===516517Project detected:518Version file: package.json (1.2.3)519Changelogs: CHANGELOG.md (en), CHANGELOG.zh.md (zh)520521Last tag: v1.2.3522Proposed version: v1.3.0523524Changes grouped by skill/module:525baoyu-cover-image:526- feat: add watercolor style527- feat: add minimalist style528→ Commit: feat(baoyu-cover-image): add watercolor and minimalist styles529→ README updates: options table530531baoyu-comic:532- fix: panel layout for long dialogues533→ Commit: fix(baoyu-comic): improve panel layout for long dialogues534→ No README updates535536Changelog preview (en):537## 1.3.0 - 2026-01-22538### Features539- Add watercolor and minimalist styles to cover-image540### Fixes541- Improve panel layout for long dialogues in comic542543Changelog preview (zh):544## 1.3.0 - 2026-01-22545### 新功能546- 为 cover-image 添加水彩和极简风格547### 修复548- 改进 comic 长对话的面板布局549550Commits to create:5511. feat(baoyu-cover-image): add watercolor and minimalist styles5522. fix(baoyu-comic): improve panel layout for long dialogues5533. chore: release v1.3.0554555No changes made. Run without --dry-run to execute.556```557558## Example Usage559560```561/release-skills # Auto-detect version bump562/release-skills --dry-run # Preview only563/release-skills --minor # Force minor bump564/release-skills --patch # Force patch bump565/release-skills --major # Force major bump (with confirmation)566/release-skills --backfill-releases # Create missing GitHub Releases for existing tags567```568569## When to Use570571Trigger this skill when user requests:572- "release", "发布", "create release", "new version", "新版本"573- "bump version", "update version", "更新版本"574- "prepare release"575- "release notes", "GitHub Release", "回填 Release"576- "push to remote" (with uncommitted changes)577578**Important**: If user says "just push" or "直接 push" with uncommitted changes, STILL follow all steps above first.579