ship

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Your Task

你的任务

Automate the complete release pipeline for this plugin using the conventional commit message provided.
Input:
$ARGUMENTS
This is a conventional commit message (e.g.,
feat: streaming URL management tools
).

使用提供的约定式提交消息,自动化完成此插件的完整发布流水线。
输入
$ARGUMENTS
这是一条约定式提交消息(例如:
feat: streaming URL management tools
)。

Ship — Automated Code Release Pipeline

Ship — 自动化代码发布流水线

You automate the entire release workflow from uncommitted changes on
main
to a published GitHub Release with version bump.
Pipeline:
[uncommitted changes on main]
  → create feature branch
  → commit with conventional commit message
  → push + create PR
  → poll CI checks until all pass (or fail)
  → merge PR
  → pull main
  → determine version bump from commit prefix
  → update plugin.json + marketplace.json + CHANGELOG + README badges
  → commit "chore: release 0.x.0"
  → push to main (triggers auto-release.yml → GitHub Release)
  → delete local feature branch

你要将main分支上未提交的变更,自动化完成从代码到发布GitHub Release并升级版本的整个工作流。
流水线:
[main分支上的未提交变更]
  → 创建功能分支
  → 使用约定式提交消息提交
  → 推送并创建PR
  → 轮询CI检查直至全部通过(或失败)
  → 合并PR
  → 拉取main分支
  → 根据提交前缀确定版本升级类型
  → 更新plugin.json + marketplace.json + CHANGELOG + README徽章
  → 提交 "chore: release 0.x.0"
  → 推送到main分支(触发auto-release.yml → GitHub Release)
  → 删除本地功能分支

Step 0: Parse Input

步骤0:解析输入

Extract from
$ARGUMENTS
:
  1. Full commit message — the entire string (e.g.,
    feat: streaming URL management tools
    )
  2. Prefix — the conventional commit type before the colon:
    feat:
    ,
    fix:
    ,
    feat!:
    ,
    docs:
    ,
    chore:
  3. Description — everything after the prefix (e.g.,
    streaming URL management tools
    )
  4. Branch name — derived from the message: lowercase, spaces to hyphens, prefix becomes the branch prefix
    • feat: streaming URL management tools
      feat/streaming-url-management-tools
    • fix: correct audio path
      fix/correct-audio-path
    • feat!: breaking change
      feat/breaking-change
    • docs: update README
      docs/update-readme
    • chore: cleanup
      chore/cleanup
  5. Version bump type:
    • feat:
      → MINOR (0.57.0 → 0.58.0)
    • fix:
      → PATCH (0.57.0 → 0.57.1)
    • feat!:
      → MAJOR (0.57.0 → 1.0.0)
    • docs:
      or
      chore:
      none (skip version bump and release steps)
If
$ARGUMENTS
is empty or doesn't match a conventional commit pattern, stop and ask the user for a commit message.

$ARGUMENTS
中提取以下信息:
  1. 完整提交消息 — 整个字符串(例如:
    feat: streaming URL management tools
  2. 前缀 — 冒号前的约定式提交类型:
    feat:
    ,
    fix:
    ,
    feat!:
    ,
    docs:
    ,
    chore:
  3. 描述 — 前缀后的所有内容(例如:
    streaming URL management tools
  4. 分支名称 — 由消息派生而来:小写,空格替换为连字符,前缀作为分支前缀
    • feat: streaming URL management tools
      feat/streaming-url-management-tools
    • fix: correct audio path
      fix/correct-audio-path
    • feat!: breaking change
      feat/breaking-change
    • docs: update README
      docs/update-readme
    • chore: cleanup
      chore/cleanup
  5. 版本升级类型:
    • feat:
      → MINOR(0.57.0 → 0.58.0)
    • fix:
      → PATCH(0.57.0 → 0.57.1)
    • feat!:
      → MAJOR(0.57.0 → 1.0.0)
    • docs:
      chore:
      (跳过版本升级和发布步骤)
如果
$ARGUMENTS
为空或不符合约定式提交格式,终止流程并要求用户提供正确的提交消息。

Step 1: Pre-flight Checks

步骤1:预检检查

Run these checks. If ANY fail, stop immediately with a clear error message.
  1. On main branch?
    bash
    git branch --show-current
    Must be
    main
    . If not: "Switch to main first:
    git checkout main && git pull
    "
  2. Uncommitted changes exist?
    bash
    git status --porcelain
    Must have output. If empty: "No changes to ship. Make some changes first."
  3. GitHub CLI authenticated?
    bash
    gh auth status
    Must succeed. If not: "Run
    gh auth login
    first."
  4. Read current version from
    .claude-plugin/plugin.json
    :
    bash
    jq -r '.version' .claude-plugin/plugin.json
    Store as
    CURRENT_VERSION
    .
Report: "Pre-flight passed. Current version: {CURRENT_VERSION}. Shipping: {commit message}"

执行以下检查。如果任意一项失败,立即终止流程并给出清晰的错误提示。
  1. 当前是否在main分支?
    bash
    git branch --show-current
    必须返回
    main
    。若不是:"请先切换到main分支:
    git checkout main && git pull
    "
  2. 是否存在未提交的变更?
    bash
    git status --porcelain
    必须有输出。若为空:"没有可发布的变更,请先进行修改。"
  3. GitHub CLI是否已认证?
    bash
    gh auth status
    必须认证成功。若未认证:"请先执行
    gh auth login
    。"
  4. .claude-plugin/plugin.json
    读取当前版本
    :
    bash
    jq -r '.version' .claude-plugin/plugin.json
    将结果保存为
    CURRENT_VERSION
完成后报告:"预检通过。当前版本:{CURRENT_VERSION}。待发布内容:{commit message}"

Step 2: Branch + Commit + Push

步骤2:分支创建 + 提交 + 推送

  1. Create feature branch:
    bash
    git checkout -b {branch-name}
  2. Stage files — use
    git status
    to identify changed files. Stage them by name. Never stage
    .env
    ,
    credentials
    , or secret files. Prefer specific filenames over
    git add -A
    .
  3. Commit with the conventional commit message + co-author:
    bash
    git commit -m "$(cat <<'EOF'
    {full commit message}
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
    EOF
    )"
  4. Push:
    bash
    git push -u origin {branch-name}

  1. 创建功能分支:
    bash
    git checkout -b {branch-name}
  2. 暂存文件 — 使用
    git status
    识别变更文件,按文件名暂存。绝对不要暂存
    .env
    credentials
    或其他包含敏感信息的文件。优先使用具体文件名而非
    git add -A
  3. 提交时使用约定式提交消息 + 共同作者:
    bash
    git commit -m "$(cat <<'EOF'
    {full commit message}
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
    EOF
    )"
  4. 推送:
    bash
    git push -u origin {branch-name}

Step 3: Create PR

步骤3:创建PR

Create a pull request using the commit message as the title:
bash
gh pr create --title "{full commit message}" --body "$(cat <<'EOF'
使用提交消息作为标题创建拉取请求:
bash
gh pr create --title "{full commit message}" --body "$(cat <<'EOF'

Summary

摘要

{1-3 bullet points summarizing what changed}
{1-3个要点总结变更内容}

Test plan

测试计划

  • CI checks pass (automated)
  • Version sync validates (automated)
🤖 Generated with Claude Code EOF )"

Capture the PR number from the output for subsequent steps.

---
  • CI检查通过(自动化)
  • 版本同步验证(自动化)
🤖 由Claude Code生成 EOF )"

从输出中捕获PR编号,用于后续步骤。

---

Step 4: Wait for CI Checks

步骤4:等待CI检查

Poll CI using
gh pr checks
with the
--watch
flag:
bash
gh pr checks {pr-number} --watch --fail-level all
This blocks until all checks complete. Use a 10-minute timeout.
If any check fails:
  • Report which check(s) failed
  • Print the failing check URL(s) if available
  • Stop the pipeline — leave the PR open for the user to investigate
  • Say: "CI failed. Fix the issues, push to the branch, and re-run
    /bitwize-music:ship
    or merge manually."
  • Do NOT proceed to merge.
If all checks pass: Report "All CI checks passed." and continue.

使用
gh pr checks
命令的
--watch
标志轮询CI状态:
bash
gh pr checks {pr-number} --watch --fail-level all
此命令会阻塞直至所有检查完成,超时时间为10分钟。
若任意检查失败:
  • 报告失败的检查项
  • 若有可用链接,打印失败检查的URL
  • 终止流水线 — 保留PR让用户排查问题
  • 提示:"CI检查失败。请修复问题后推送到分支,重新运行
    /bitwize-music:ship
    或手动合并。"
  • 不要继续执行合并操作。
若所有检查通过:报告"所有CI检查通过。"并继续流程。

Step 5: Merge PR

步骤5:合并PR

  1. Merge the PR (merge commit, delete remote branch):
    bash
    gh pr merge {pr-number} --merge --delete-branch
  2. Switch back to main and pull:
    bash
    git checkout main && git pull origin main

  1. 合并PR(创建合并提交,删除远程分支):
    bash
    gh pr merge {pr-number} --merge --delete-branch
  2. 切换回main分支并拉取最新代码:
    bash
    git checkout main && git pull origin main

Step 6: Version Bump

步骤6:版本升级

Skip this entire step if the prefix is
docs:
or
chore:
.
如果前缀是
docs:
chore:
,请跳过整个步骤。

6a: Calculate new version

6a:计算新版本号

From
CURRENT_VERSION
and the bump type:
  • MINOR: increment middle number, reset patch to 0 (e.g., 0.57.0 → 0.58.0)
  • PATCH: increment last number (e.g., 0.57.0 → 0.57.1)
  • MAJOR: increment first number, reset others to 0 (e.g., 0.57.0 → 1.0.0)
Store as
NEW_VERSION
.
根据
CURRENT_VERSION
和升级类型计算:
  • MINOR:升级中间版本号,补丁版本号重置为0(例如:0.57.0 → 0.58.0)
  • PATCH:升级最后一位版本号(例如:0.57.0 → 0.57.1)
  • MAJOR:升级第一位版本号,其余版本号重置为0(例如:0.57.0 → 1.0.0)
将结果保存为
NEW_VERSION

6b: Update
.claude-plugin/plugin.json

6b:更新
.claude-plugin/plugin.json

Change
"version": "{CURRENT_VERSION}"
"version": "{NEW_VERSION}"
"version": "{CURRENT_VERSION}"
修改为
"version": "{NEW_VERSION}"

6c: Update
.claude-plugin/marketplace.json

6c:更新
.claude-plugin/marketplace.json

Change
"version": "{CURRENT_VERSION}"
"version": "{NEW_VERSION}"
"version": "{CURRENT_VERSION}"
修改为
"version": "{NEW_VERSION}"

6d: Update
CHANGELOG.md

6d:更新
CHANGELOG.md

  1. Find the current
    ## [Unreleased]
    section content
  2. Insert a new versioned section between
    [Unreleased]
    and the previous version:
    • Empty
      ## [Unreleased]
      section at top
    • Then
      ## [{NEW_VERSION}] - {YYYY-MM-DD}
      with the content that was under Unreleased
  3. The date is today's date
  1. 找到当前的
    ## [Unreleased]
    部分内容
  2. [Unreleased]
    和上一个版本之间插入新的版本章节:
    • 顶部保留空的
      ## [Unreleased]
      章节
    • 新增
      ## [{NEW_VERSION}] - {YYYY-MM-DD}
      章节,并将原Unreleased下的内容移入
  3. 日期为当前日期

6e: Update README.md badges

6e:更新README.md中的徽章

Update these badge lines:
  • Version badge:
    ![Version](https://img.shields.io/badge/version-{NEW_VERSION}-blue)
  • Skills count badge: count directories in
    skills/*/
    and update
    ![Skills](https://img.shields.io/badge/skills-{COUNT}-green)
  • Test count badge: run
    pytest --co -q 2>/dev/null | tail -1
    to get the count, update
    ![Tests](https://img.shields.io/badge/tests-{COUNT}-brightgreen)
更新以下徽章行:
  • 版本徽章:
    ![Version](https://img.shields.io/badge/version-{NEW_VERSION}-blue)
  • 技能数量徽章:统计
    skills/*/
    目录的数量,更新
    ![Skills](https://img.shields.io/badge/skills-{COUNT}-green)
  • 测试数量徽章:执行
    pytest --co -q 2>/dev/null | tail -1
    获取数量,更新
    ![Tests](https://img.shields.io/badge/tests-{COUNT}-brightgreen)

6f: Update README "What's New" table (for
feat:
and
feat!:
only)

6f:更新README中的“What's New”表格(仅适用于
feat:
feat!:
提交)

If the commit is a
feat:
or
feat!:
:
  • Read the CHANGELOG entry for this version
  • Add a row to the "What's New" table in README.md at the top (below the header row)
  • Format:
    | **{MINOR_VERSION}** | {brief highlight} |
  • Example:
    | **0.58** | Ship skill for automated code release pipeline |
如果提交类型是
feat:
feat!:
  • 读取此版本的CHANGELOG条目
  • 在README.md的“What's New”表格顶部(表头行下方)添加一行
  • 格式:
    | **{MINOR_VERSION}** | {简要亮点} |
  • 示例:
    | **0.58** | 用于自动化代码发布流水线的Ship技能 |

6g: Update README skill count text

6g:更新README中的技能数量文本

If a new skill was added, update the "collection of N specialized skills" text in README.md to match the badge count.

如果新增了技能,更新README.md中“collection of N specialized skills”文本,使其与徽章中的数量一致。

Step 7: Release Commit + Push

步骤7:发布提交 + 推送

Skip if
docs:
or
chore:
prefix (no version bump happened).
  1. Stage the version files:
    bash
    git add .claude-plugin/plugin.json .claude-plugin/marketplace.json CHANGELOG.md README.md
  2. Commit:
    bash
    git commit -m "$(cat <<'EOF'
    chore: release {NEW_VERSION}
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
    EOF
    )"
  3. Push to main — this triggers
    auto-release.yml
    which creates the GitHub Release:
    bash
    git push origin main

如果前缀是
docs:
chore:
(未执行版本升级),请跳过此步骤。
  1. 暂存版本相关文件:
    bash
    git add .claude-plugin/plugin.json .claude-plugin/marketplace.json CHANGELOG.md README.md
  2. 提交:
    bash
    git commit -m "$(cat <<'EOF'
    chore: release {NEW_VERSION}
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
    EOF
    )"
  3. 推送到main分支 — 此操作会触发
    auto-release.yml
    工作流,创建GitHub Release:
    bash
    git push origin main

Step 8: Cleanup

步骤8:清理

  1. Delete local feature branch (it was already deleted from remote by
    --delete-branch
    ):
    bash
    git branch -d {branch-name}
  2. Report success:
    Ship complete!
    
    Commit: {full commit message}
    Version: {CURRENT_VERSION} → {NEW_VERSION}
    PR: {PR URL}
    Release: auto-release.yml will create GitHub Release for v{NEW_VERSION}
    
    Branch {branch-name} cleaned up (local + remote).
    For
    docs:
    /
    chore:
    (no version bump):
    Ship complete!
    
    Commit: {full commit message}
    Version: unchanged ({CURRENT_VERSION})
    PR: {PR URL}
    
    No version bump for {prefix} commits.
    Branch {branch-name} cleaned up (local + remote).

  1. 删除本地功能分支(远程分支已在合并时通过
    --delete-branch
    删除):
    bash
    git branch -d {branch-name}
  2. 报告成功:
    发布完成!
    
    提交消息:{full commit message}
    版本:{CURRENT_VERSION} → {NEW_VERSION}
    PR:{PR URL}
    发布:auto-release.yml将为v{NEW_VERSION}创建GitHub Release
    
    分支{branch-name}已清理(本地+远程)。
    对于
    docs:
    /
    chore:
    类型的提交(未升级版本):
    发布完成!
    
    提交消息:{full commit message}
    版本:未变更({CURRENT_VERSION})
    PR:{PR URL}
    
    {prefix}类型的提交无需升级版本。
    分支{branch-name}已清理(本地+远程)。

Error Handling

错误处理

ScenarioAction
Not on
main
Stop. Tell user to
git checkout main && git pull
.
No uncommitted changesStop. "Nothing to ship."
gh
not authenticated
Stop. Suggest
gh auth login
.
CI check failsStop. Report failure details. Leave PR open.
Merge conflictStop. Report conflict. Let user resolve.
Push rejectedStop. Report error. Suggest
git pull --rebase
.
Invalid commit messageStop. Show expected format with examples.
Never force-push. Never skip CI. Never auto-close a failed PR.

场景操作
不在
main
分支
终止流程。告知用户执行
git checkout main && git pull
无未提交变更终止流程。“没有可发布的内容。”
gh
未认证
终止流程。建议执行
gh auth login
CI检查失败终止流程。报告失败详情。保留PR。
合并冲突终止流程。报告冲突情况。让用户自行解决。
推送被拒绝终止流程。报告错误。建议执行
git pull --rebase
提交消息无效终止流程。展示预期格式及示例。
绝对不要强制推送。绝对不要跳过CI检查。绝对不要自动关闭失败的PR。

Remember

注意事项

  1. Parse the commit message first — everything flows from the prefix
  2. Pre-flight is non-negotiable — stop if any check fails
  3. Stage files by name — never
    git add -A
    or
    git add .
  4. CI must pass — never merge with failing checks
  5. Version bump follows conventional commits
    feat:
    = MINOR,
    fix:
    = PATCH,
    feat!:
    = MAJOR
  6. Both JSON files must match — plugin.json and marketplace.json versions stay in sync
  7. CHANGELOG gets the content — move Unreleased to versioned section
  8. Badges must match — version, skills count, test count in README
  9. chore: release
    commit triggers auto-release.yml
    — which creates the GitHub Release
  10. Clean up branches — delete local and remote after merge
Your deliverable: Changes shipped from uncommitted code to published GitHub Release in one automated pipeline.
  1. 先解析提交消息 — 所有流程都基于前缀展开
  2. 预检检查不可省略 — 任意检查失败则终止流程
  3. 按文件名暂存文件 — 绝不使用
    git add -A
    git add .
  4. CI必须通过 — 绝不合并检查失败的PR
  5. 版本升级遵循约定式提交
    feat:
    = MINOR,
    fix:
    = PATCH,
    feat!:
    = MAJOR
  6. 两个JSON文件版本必须一致 — plugin.json和marketplace.json的版本要保持同步
  7. CHANGELOG要同步内容 — 将Unreleased部分的内容移至对应版本章节
  8. 徽章信息必须准确 — README中的版本、技能数量、测试数量徽章要与实际一致
  9. chore: release
    提交触发auto-release.yml
    — 该工作流会创建GitHub Release
  10. 清理分支 — 合并后删除本地和远程分支
你的交付成果:将未提交的代码变更通过一条自动化流水线,发布为GitHub Release。