release

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Release Skill

Release Skill

Purpose: Take a project from "code is ready" to "tagged and ready to push."
Pre-flight validation, changelog from git history, version bumps across package files, release commit, annotated tag, and optional draft GitHub Release. Everything is local and reversible. Publishing is CI's job.

用途: 将项目从“代码已就绪”状态推进到“已打标签,可推送”状态。
包含预飞验证、基于git历史生成变更日志、批量升级各包文件版本号、创建发布提交、带注释的标签,以及可选的GitHub Release草稿创建。所有操作均在本地执行且可回滚,发布工作由CI负责。

Quick Start

快速开始

bash
/release 1.7.0                # full release: changelog + bump + commit + tag
/release 1.7.0 --dry-run      # show what would happen, change nothing
/release --check               # readiness validation only (GO/NO-GO)
/release                       # suggest version from commit analysis
/release 1.7.0 --no-gh-release # skip GitHub Release draft

bash
/release 1.7.0                # 完整发布流程:变更日志 + 版本升级 + 提交 + 打标签
/release 1.7.0 --dry-run      # 模拟执行,仅展示操作内容,不实际修改
/release --check               # 仅执行就绪性验证(通过/不通过)
/release                       # 通过提交分析建议版本号
/release 1.7.0 --no-gh-release # 跳过GitHub Release草稿创建

Arguments

参数说明

ArgumentRequiredDescription
version
NoSemver string (e.g.,
1.7.0
). If omitted, suggest based on commit analysis
--check
NoReadiness validation only — don't generate or write anything
--dry-run
NoShow generated changelog + version bumps without writing
--skip-checks
NoSkip pre-flight validation (tests, lint)
--no-gh-release
NoSkip draft GitHub Release creation
--changelog-only
NoOnly update CHANGELOG.md — no version bumps, no commit, no tag

参数是否必填描述
version
Semver格式字符串(例如:
1.7.0
)。若省略,将通过提交分析建议版本号
--check
仅执行就绪性验证 — 不生成或写入任何内容
--dry-run
展示生成的变更日志和版本升级内容,但不实际写入
--skip-checks
跳过预飞验证(测试、代码检查)
--no-gh-release
跳过GitHub Release草稿创建
--changelog-only
仅更新CHANGELOG.md — 不升级版本号、不创建提交、不打标签

Modes

模式说明

Default: Full Release

默认:完整发布

/release [version]
— the complete local release workflow.
Steps: pre-flight → changelog → release notes → version bump → user review → write → release commit → tag → draft GitHub Release → guidance.
/release [version]
— 完整的本地发布工作流。
步骤:预飞检查 → 生成变更日志 → 发布说明 → 版本升级 → 用户审核 → 写入变更 → 创建发布提交 → 打标签 → 生成GitHub Release草稿 → 后续操作指引。

Check Mode

检查模式

/release --check
— standalone readiness validation.
Runs all pre-flight checks and reports GO/NO-GO. Useful before starting the release, in CI as a gate, or composed with
/vibe
. Does not generate or write anything.
/release --check
— 独立的就绪性验证。
执行所有预飞检查并返回通过/不通过结果。适用于发布前检查、作为CI的准入门槛,或与
/vibe
组合使用。不生成或写入任何内容。

Changelog Only

仅更新变更日志

/release 1.7.0 --changelog-only
— just update CHANGELOG.md.
Generates the changelog entry and writes it. No version bumps, no commit, no tag.

/release 1.7.0 --changelog-only
— 仅更新CHANGELOG.md。
生成变更日志条目并写入文件。不升级版本号、不创建提交、不打标签。

Workflow

工作流

Step 1: Pre-flight

步骤1:预飞检查

Run these checks before anything else:
bash
git rev-parse --git-dir           # must be in a git repo
git status --porcelain            # warn if dirty
git branch --show-current         # show current branch
Checks:
CheckHowSeverity
Git repo
git rev-parse --git-dir
Block — cannot proceed
CHANGELOG.md existsGlob for changelog (case-insensitive)Offer to create if missing
Has
[Unreleased]
section
Read CHANGELOG.mdWarn
Working tree clean
git status --porcelain
Warn (show dirty files)
On expected branch
git branch --show-current
Warn if not main/master/release
Tests passDetect and run test commandWarn (show failures)
Lint cleanDetect and run lint commandWarn (show issues)
Version consistencyCompare versions across package filesWarn (show mismatches)
Commits since last tag
git log --oneline <range>
Block if empty — nothing to release
Test/lint detection:
FileTest CommandLint Command
go.mod
go test ./...
golangci-lint run
(if installed)
package.json
npm test
npm run lint
(if script exists)
pyproject.toml
pytest
ruff check .
(if installed)
Cargo.toml
cargo test
cargo clippy
(if installed)
Makefile
with
test:
make test
make lint
(if target exists)
If
--skip-checks
is passed, skip tests and lint (still check git state and versions).
In
--check
mode, run all checks and output a summary table:
Release Readiness: NO-GO

  [PASS] Git repo
  [PASS] CHANGELOG.md exists
  [PASS] Working tree clean
  [WARN] Branch: feature/foo (expected main)
  [FAIL] Tests: 2 failures in auth_test.go
  [PASS] Lint clean
  [PASS] Version consistency (1.6.0 in all 2 files)
  [PASS] 14 commits since v1.6.0
In
--check
mode, stop here. In default mode, continue (warnings don't block).
在执行任何操作前先运行以下检查:
bash
git rev-parse --git-dir           # 验证当前目录是否为git仓库
git status --porcelain            # 若工作区未清理则发出警告
git branch --show-current         # 显示当前分支
检查项:
检查项实现方式严重程度
Git仓库验证
git rev-parse --git-dir
阻塞 — 无法继续执行
CHANGELOG.md存在验证全局搜索变更日志文件(不区分大小写)若缺失则提示创建
存在
[Unreleased]
章节
读取CHANGELOG.md内容警告
工作区已清理
git status --porcelain
警告(显示未提交文件)
当前分支符合预期
git branch --show-current
若不在main/master/release分支则警告
测试通过自动检测并运行测试命令警告(显示失败用例)
代码检查通过自动检测并运行代码检查命令警告(显示问题)
版本号一致性对比各包文件中的版本号警告(显示不一致项)
上次标签后有新提交
git log --oneline <range>
阻塞 — 无新提交则无需发布
测试/代码检查自动检测规则:
存在文件测试命令代码检查命令
go.mod
go test ./...
golangci-lint run
(若已安装)
package.json
npm test
npm run lint
(若存在该脚本)
pyproject.toml
pytest
ruff check .
(若已安装)
Cargo.toml
cargo test
cargo clippy
(若已安装)
包含
test:
目标的
Makefile
make test
make lint
(若存在该目标)
若传入
--skip-checks
参数,将跳过测试和代码检查(仍会检查git状态和版本号一致性)。
--check
模式下,执行所有检查并输出汇总表格:
发布就绪性:不通过

  [通过] Git仓库验证
  [通过] CHANGELOG.md已存在
  [通过] 工作区已清理
  [警告] 当前分支:feature/foo(预期为main分支)
  [失败] 测试:auth_test.go中有2个失败用例
  [通过] 代码检查通过
  [通过] 版本号一致(所有2个文件中版本均为1.6.0)
  [通过] 自v1.6.0以来有14个新提交
--check
模式下,执行到此处即停止。在默认模式下,将继续执行(警告不会阻塞流程)。

Step 2: Determine range

步骤2:确定提交范围

Find the last release tag:
bash
git tag --sort=-version:refname -l 'v*' | head -1
  • If no
    v*
    tags exist, use the first commit:
    git rev-list --max-parents=0 HEAD
  • The range is
    <last-tag>..HEAD
  • If range is empty (no new commits), stop and tell the user
查找最近的发布标签:
bash
git tag --sort=-version:refname -l 'v*' | head -1
  • 若不存在
    v*
    格式的标签,则使用第一个提交:
    git rev-list --max-parents=0 HEAD
  • 提交范围为
    <last-tag>..HEAD
  • 若范围为空(无新提交),则停止执行并告知用户

Step 3: Read git history

步骤3:读取git历史

Gather commit data for classification:
bash
git log --oneline --no-merges <range>
git log --format="%H %s" --no-merges <range>
git diff --stat <range>
Use
--oneline
for the summary view and full hashes for detail lookups when a commit message is ambiguous.
收集提交数据用于分类:
bash
git log --oneline --no-merges <range>
git log --format="%H %s" --no-merges <range>
git diff --stat <range>
使用
--oneline
格式生成摘要视图,当提交信息不明确时,使用完整哈希值查询详细内容。

Step 4: Classify and group

步骤4:提交分类与分组

Classify each commit into one of four categories:
CategorySignal
AddedNew features, new files, "add", "create", "implement", "introduce",
feat
ChangedModifications, updates, refactors, "update", "refactor", "rename", "migrate"
FixedBug fixes, corrections, "fix", "correct", "resolve", "patch"
RemovedDeletions, "remove", "delete", "drop", "deprecate"
Grouping rules:
  • Group related commits that share a component prefix (e.g.,
    auth:
    ,
    api:
    ,
    feat(users)
    )
  • Combine grouped commits into a single bullet with a merged description
  • Match the existing CHANGELOG style — read the most recent versioned entry and replicate its bullet format, separator style, and heading structure
  • If a commit message is ambiguous, read the diff with
    git show --stat <hash>
    to clarify
Key rules:
  • Don't invent — only document what git log shows
  • Omit empty sections — don't include
    ### Removed
    if nothing was removed
  • Commits, not diffs — classify from commit messages; read diffs only when ambiguous
  • Merge-commit subjects are noise — already filtered by
    --no-merges
将每个提交分为以下四类之一:
分类识别关键词
新增新功能、新文件、“add”、“create”、“implement”、“introduce”、
feat
变更修改、更新、重构、“update”、“refactor”、“rename”、“migrate”
修复Bug修复、修正、“fix”、“correct”、“resolve”、“patch”
移除删除、“remove”、“delete”、“drop”、“deprecate”
分组规则:
  • 将共享组件前缀的相关提交分组(例如:
    auth:
    api:
    feat(users)
  • 将分组后的合并为单个项目,使用合并后的描述
  • 匹配现有变更日志风格 — 读取最近的版本化条目,复制其项目符号格式、分隔符样式和标题结构
  • 若提交信息不明确,通过
    git show --stat <hash>
    查看diff内容以明确分类
核心规则:
  • 不编造内容 — 仅记录git log中显示的信息
  • 省略空章节 — 若没有移除内容,则不包含
    ### Removed
    章节
  • 基于提交信息分类 — 仅在信息不明确时才查看diff内容
  • 忽略合并提交主题 — 已通过
    --no-merges
    过滤

Step 5: Suggest version

步骤5:版本号建议

If no version was provided, suggest one based on the commit classification:
ConditionSuggestion
Any commit contains "BREAKING", "breaking change", or
!:
(conventional commits)
Major bump
Any commits classified as Added (new features)Minor bump
Only Fixed/Changed commitsPatch bump
Show the suggestion with reasoning:
Suggested version: 1.7.0 (minor)
Reason: 3 new features added, no breaking changes

Current version: 1.6.0 (from package.json, go tags)
Use AskUserQuestion to confirm or let the user provide a different version.
若未提供版本号,将根据提交分类结果建议版本号:
条件建议版本
任何提交包含“BREAKING”、“breaking change”或
!:
(约定式提交)
主版本号升级
存在分类为“新增”的提交次版本号升级
仅存在“修复”/“变更”类提交修订号升级
展示建议版本及理由:
建议版本:1.7.0(次版本号升级)
理由:新增3项功能,无破坏性变更

当前版本:1.6.0(来自package.json、go标签)
通过询问用户确认或让用户提供其他版本号。

Step 6: Generate changelog entry

步骤6:生成变更日志条目

Produce a markdown block in Keep a Changelog format:
markdown
undefined
按照Keep a Changelog格式生成markdown块:
markdown
undefined

[X.Y.Z] - YYYY-MM-DD

[X.Y.Z] - YYYY-MM-DD

Added

Added

  • description of new feature
  • 新功能描述

Changed

Changed

  • description of change
  • 变更内容描述

Fixed

Fixed

  • description of fix

Use today's date in `YYYY-MM-DD` format.

**Style adaptation:** Read the existing CHANGELOG entries and match their conventions:
- Bullet format (plain text vs bold names vs backtick names)
- Separator style (em-dash ` — `, hyphen ` - `, colon `: `)
- Grouping patterns (flat list vs sub-sections)
- Level of detail (terse vs verbose)

If no existing entries to reference (first release), use plain Keep a Changelog defaults.
  • 修复内容描述

使用`YYYY-MM-DD`格式的当前日期。

**风格适配:** 读取现有变更日志条目,匹配其约定:
- 项目符号格式(纯文本/加粗名称/反引号包裹名称)
- 分隔符样式(破折号` — `、连字符` - `、冒号`: `)
- 分组模式(扁平列表/子章节)
- 详细程度(简洁/详细)

若没有现有条目(首次发布),则使用Keep a Changelog的默认格式。

Step 7: Detect and offer version bumps

步骤7:检测并提示版本号升级

Scan for files containing version strings:
FilePatternExample
package.json
"version": "X.Y.Z"
"version": "1.6.0"
pyproject.toml
version = "X.Y.Z"
version = "1.6.0"
Cargo.toml
version = "X.Y.Z"
version = "1.6.0"
*.go
const Version = "X.Y.Z"
or
var version = "X.Y.Z"
const Version = "1.6.0"
version.txt
Plain version string
1.6.0
VERSION
Plain version string
1.6.0
.goreleaser.yml
Version from ldflags (show, don't modify — goreleaser reads from git tags)
Show what was found:
Version strings detected:

  package.json:       "version": "1.6.0"  → "1.7.0"
  src/version.go:     const Version = "1.6.0"  → "1.7.0"
  .goreleaser.yml:    (reads from git tag — no change needed)
Use AskUserQuestion: "Update these version strings?" — "Yes, update all" / "Let me choose" / "Skip version bumps"
扫描包含版本号字符串的文件:
文件匹配模式示例
package.json
"version": "X.Y.Z"
"version": "1.6.0"
pyproject.toml
version = "X.Y.Z"
version = "1.6.0"
Cargo.toml
version = "X.Y.Z"
version = "1.6.0"
*.go
const Version = "X.Y.Z"
var version = "X.Y.Z"
const Version = "1.6.0"
version.txt
纯版本号字符串
1.6.0
VERSION
纯版本号字符串
1.6.0
.goreleaser.yml
从ldflags读取版本号(仅展示,不修改 — goreleaser从git标签读取版本)
展示检测结果:
检测到版本号字符串:

  package.json:       "version": "1.6.0"  → "1.7.0"
  src/version.go:     const Version = "1.6.0"  → "1.7.0"
  .goreleaser.yml:    (从git标签读取 — 无需修改)
询问用户:“是否更新这些版本号字符串?” — 选项:“是,全部更新” / “让我选择要更新的文件” / “跳过版本号升级”

Step 8: User review

步骤8:用户审核

Present everything that will change:
  1. The generated changelog entry (fenced markdown block)
  2. The version bumps (file-by-file diff preview)
  3. What will happen: "Will write CHANGELOG.md, update 2 version files, create release commit, create tag v1.7.0"
If
--dry-run
was passed, stop here.
Use AskUserQuestion:
  • "Proceed with this release?"
  • Options: "Yes, do it" / "Let me edit the changelog first" / "Abort"
展示所有即将执行的变更:
  1. 生成的变更日志条目(带围栏的markdown块)
  2. 版本号升级预览(按文件展示diff)
  3. 即将执行的操作:“将写入CHANGELOG.md、更新2个版本文件、创建发布提交、创建标签v1.7.0”
若传入
--dry-run
参数,执行到此处即停止。
询问用户:
  • “是否继续执行本次发布?”
  • 选项:“是,执行” / “让我先编辑变更日志” / “终止操作”

Step 9: Write changes

步骤9:写入变更

After user confirms:
  1. Update CHANGELOG.md:
    • Find the
      ## [Unreleased]
      line
    • Find where the unreleased section ends (next
      ## [
      line or EOF)
    • Replace with: fresh empty
      ## [Unreleased]
      + blank line + versioned entry
  2. Update version files (if user accepted bumps)
用户确认后执行:
  1. 更新CHANGELOG.md:
    • 找到
      ## [Unreleased]
    • 找到未发布章节的结束位置(下一个
      ## [
      行或文件末尾)
    • 替换为:新的空
      ## [Unreleased]
      + 空行 + 带版本号的条目
  2. 更新版本文件(若用户同意升级版本号)

Step 10: Release commit

步骤10:创建发布提交

Stage and commit all release changes together:
bash
git add CHANGELOG.md <version-files...>
git commit -m "Release v<version>"
The commit message is intentionally simple. The changelog has the details.
将所有发布相关变更暂存并提交:
bash
git add CHANGELOG.md <version-files...>
git commit -m "Release v<version>"
提交信息保持简洁,详细内容已记录在变更日志中。

Step 11: Tag

步骤11:打标签

Create an annotated tag:
bash
git tag -a v<version> -m "Release v<version>"
创建带注释的标签:
bash
git tag -a v<version> -m "Release v<version>"

Step 12: Generate release notes

步骤12:生成发布说明

Release notes are not the changelog. The changelog is comprehensive and developer-facing. Release notes are what users see on the GitHub Release page — they should be approachable and highlight what matters.
Audience: People scrolling their GitHub feed. They haven't read your commit log, don't know your internal architecture names, and will spend 10 seconds deciding if this release matters to them. Write for THEM, not for contributors.
Quality bar — the feed test:
  • Would a first-time visitor understand every bullet?
  • Are internal code names explained or omitted? (e.g., "Gate 4" means nothing — say "retry loop after validation failure")
  • Does the Highlights paragraph answer "why should I care?" in plain English?
  • Is every bullet about user-visible impact, not implementation detail?
Structure:
markdown
undefined
发布说明不等于变更日志。变更日志面向开发者,内容全面详细;发布说明面向GitHub Release页面的访问者,应通俗易懂,突出重点。
受众: 浏览GitHub动态的用户。他们未阅读过提交日志、不了解项目内部架构,只会花10秒判断本次发布是否与自己相关。请为他们撰写内容,而非贡献者。
质量标准 — 动态测试:
  • 首次访问的用户能否理解每一个项目符号?
  • 内部代码名称是否已解释或省略?(例如:“Gate 4”无意义 — 应改为“验证失败后的重试循环”)
  • 亮点段落是否用简单语言回答了“这对我有什么用?”?
  • 每个项目符号是否都与用户可见的影响相关,而非实现细节?
结构:
markdown
undefined

Highlights

亮点

<2-4 sentence plain-English summary of what's new and why it matters. Written for users, not contributors. No jargon. No internal architecture names. Answer: "What can I do now that I couldn't before?">
<2-4句简单易懂的总结,说明新增内容及价值。 面向用户,而非贡献者。无专业术语、无内部架构名称。 回答:“我现在能做以前做不到的什么事?”>

What's New

新增内容

<Top 3-5 most important changes, each as a short bullet. Pick from Added/Changed/Fixed — prioritize user-visible impact. Explain internal terms or don't use them.>
<最重要的3-5项变更,每项用简短的项目符号列出。 从新增/变更/修复中挑选 — 优先展示用户可见的影响。 解释内部术语或直接省略。>

All Changes

所有变更

<CONDENSED version of the changelog — NOT a raw copy-paste from CHANGELOG.md. Strip: issue IDs (ag-xxx), file paths, internal tool names, architecture jargon. Keep: what changed, described in plain English. Each bullet: one sentence, no bold lead-in, no parenthetical issue refs. End with a link to the full CHANGELOG.md for those who want raw detail.>
Full changelog

**The All Changes section is NOT the CHANGELOG.** The CHANGELOG is for contributors who want file paths, issue IDs, and implementation detail. The release page condenses that into plain-English bullets a user can scan in 15 seconds. When in doubt, leave it out — the link is there for the curious.

**Condensing rules:**
- Remove issue IDs: `(ag-ab6)` → gone
- Remove file paths: `skills/council/scripts/validate-council.sh` → "council validation script"
- Remove internal terms: "progressive-disclosure reference files" → "reference content loaded on demand"
- Collapse related items: "5 broken links" + "7 doc inaccuracies" → "12 broken links and doc inaccuracies fixed"
- Bold sparingly: only in What's New section, not in All Changes

**Example:**

```markdown
<变更日志的精简版 — 不要直接复制CHANGELOG.md的内容。 移除:问题ID(ag-xxx)、文件路径、内部工具名称、架构术语。 保留:变更内容,用简单语言描述。 每个项目符号:一句话,无加粗前缀、无括号包裹的问题引用。 末尾添加指向完整CHANGELOG.md的链接,供需要详细内容的用户查看。>
完整变更日志

**所有变更章节不是变更日志的复制。** 变更日志面向贡献者,包含文件路径、问题ID和实现细节;发布页面的内容是其精简版,用用户能在15秒内扫完的简单语言描述。拿不准的内容就删掉 — 好奇的用户可以通过链接查看详细内容。

**精简规则:**
- 移除问题ID:`(ag-ab6)` → 删除
- 移除文件路径:`skills/council/scripts/validate-council.sh` → “委员会验证脚本”
- 替换内部术语:“progressive-disclosure reference files” → “按需加载的参考内容”
- 合并相关项:“5个失效链接” + “7处文档错误” → “修复12个失效链接和文档错误”
- 谨慎使用加粗:仅在新增内容章节使用,所有变更章节不使用

**示例:**

```markdown

Highlights

亮点

Three security vulnerabilities patched in hook scripts. The validation lifecycle now retries automatically when validation fails instead of stopping — no manual intervention needed. The five largest skills now load significantly faster by loading reference docs only when needed.
修复了钩子脚本中的3个安全漏洞。验证生命周期现在会在验证失败时自动重试,无需手动干预。5个最大的Skill现在加载速度显著提升,因为参考文档改为按需加载。

What's New

新增内容

  • Self-healing validation — Failed code reviews now retry automatically with failure context, instead of stopping and waiting for you
  • Faster skill loading — Five core skills restructured to load reference content on demand instead of all at once
  • 3 security fixes — Command injection, regex injection, and JSON injection vulnerabilities patched in hook scripts
  • 自修复验证 — 代码审查失败后会自动重试并携带失败上下文,无需等待手动干预
  • Skill加载加速 — 5个核心Skill重构为按需加载参考内容,而非一次性加载全部
  • 3项安全修复 — 修复了钩子脚本中的命令注入、正则注入和JSON注入漏洞

All Changes

所有变更

Added

Added

  • Self-healing retry loop for the validation lifecycle
  • Security and documentation sections for Go, Python, Rust, JSON, YAML standards
  • 26 hook integration tests (injection resistance, kill switches, allowlist enforcement)
  • Monorepo-friendly quickstart detection
  • 验证生命周期新增自修复重试循环
  • 新增Go、Python、Rust、JSON、YAML标准的安全和文档章节
  • 新增26个钩子集成测试(注入防护、终止开关、白名单验证)
  • 新增对单体仓库的快速开始检测

Fixed

Fixed

  • Command injection in task validation hook (now allowlist-based)
  • Regex injection in task validation hook (now literal matching)
  • JSON injection in prompt nudge hook (now safe escaping)
  • 12 broken links and doc inaccuracies fixed across the project
  • 任务验证钩子中的命令注入漏洞(改为基于白名单)
  • 任务验证钩子中的正则注入漏洞(改为字面量匹配)
  • 提示推送钩子中的JSON注入漏洞(改为安全转义)
  • 修复项目中12个失效链接和文档错误

Removed

Removed

  • Deprecated
    /judge
    skill (use
    /council
    instead)

**Always write release notes to a file immediately after generating:**

```bash
mkdir -p .agents/releases
Write to
.agents/releases/YYYY-MM-DD-v<version>-notes.md
— this is the public-facing file used by
gh release create
and is what users see. It contains ONLY the Highlights + What's New + All Changes structure above, ending with a link to the full CHANGELOG.md. No internal metadata, no pre-flight results, no next steps, no issue IDs, no file paths.
Show the release notes to the user as part of Step 8 review, alongside the changelog and version bumps.
  • 移除已弃用的
    /judge
    Skill(使用
    /council
    替代)

**生成后立即将发布说明写入文件:**

```bash
mkdir -p .agents/releases
写入到
.agents/releases/YYYY-MM-DD-v<version>-notes.md
— 这是面向公众的文件,用于
gh release create
命令,也是用户在GitHub上看到的内容。仅包含亮点、新增内容、所有变更结构,末尾指向完整CHANGELOG.md。不包含内部元数据、预飞检查结果、后续步骤、问题ID或文件路径。
在步骤8的用户审核环节,将发布说明与变更日志、版本升级内容一起展示给用户。

Step 13: Draft GitHub Release

步骤13:生成GitHub Release草稿

Unless
--no-gh-release
was passed, create a draft GitHub Release using the notes file written in Step 12.
Check for
gh
CLI:
bash
which gh
If available:
bash
gh release create v<version> --draft --title "v<version>" --notes-file .agents/releases/YYYY-MM-DD-v<version>-notes.md
If the tag hasn't been pushed yet (common — we don't push),
gh release create
will fail. In that case, tell the user to push first, then create the release:
Tag not pushed yet. After pushing, create the release with:
  gh release create v<version> --draft --title "v<version>" --notes-file .agents/releases/YYYY-MM-DD-v<version>-notes.md
Draft, not published — the user reviews and publishes from the GitHub UI or via
gh release edit v<version> --draft=false
.
If
gh
is not available, tell the user the notes file is ready to paste into the GitHub Release page manually.
除非传入
--no-gh-release
参数,否则将使用步骤12中写入的说明文件创建GitHub Release草稿。
检查是否安装
gh
CLI:
bash
which gh
若已安装:
bash
gh release create v<version> --draft --title "v<version>" --notes-file .agents/releases/YYYY-MM-DD-v<version>-notes.md
若标签尚未推送(常见情况 — 我们不执行推送操作),
gh release create
会失败。此时告知用户先推送标签,再创建Release:
标签尚未推送。推送后执行以下命令创建Release:
  gh release create v<version> --draft --title "v<version>" --notes-file .agents/releases/YYYY-MM-DD-v<version>-notes.md
创建的是草稿,而非已发布状态 — 用户可在GitHub UI中审核后发布,或通过
gh release edit v<version> --draft=false
命令发布。
若未安装
gh
CLI,告知用户说明文件已准备好,可手动粘贴到GitHub Release页面。

Step 14: Post-release guidance

步骤14:发布后指引

Show the user what to do next:
Release v1.7.0 prepared locally.

Next steps:
  git push origin main --tags     # push commit + tag

Your CI will handle: build, validate, publish
  (detected: .github/workflows/release.yml, .goreleaser.yml)
If no CI detected:
Next steps:
  git push origin main --tags     # push commit + tag
  gh release edit v1.7.0 --draft=false  # publish the GitHub Release

No release CI detected. Consider adding a workflow for automated publishing.
向用户展示后续操作步骤:
本地已完成v1.7.0版本的发布准备。

下一步:
  git push origin main --tags     # 推送提交和标签

你的CI将负责:构建、验证、发布
  (已检测到:.github/workflows/release.yml, .goreleaser.yml)
若未检测到CI:
下一步:
  git push origin main --tags     # 推送提交和标签
  gh release edit v1.7.0 --draft=false  # 发布GitHub Release

未检测到发布CI。建议添加工作流实现自动化发布。

Step 15: Audit trail

步骤15:审计记录

Write an internal release record (separate from the public release notes written in Step 12):
bash
mkdir -p .agents/releases
Write to
.agents/releases/YYYY-MM-DD-v<version>-audit.md
:
markdown
undefined
写入内部发布记录(与步骤12中写入的面向公众的发布说明分离):
bash
mkdir -p .agents/releases
写入到
.agents/releases/YYYY-MM-DD-v<version>-audit.md
markdown
undefined

Release v<version> — Audit

Release v<version> — 审计记录

Date: YYYY-MM-DD Previous: v<previous-version> Commits: N commits in range
日期: YYYY-MM-DD 上一版本: v<previous-version> 提交数量: 范围内共N个提交

Version Bumps

版本号升级

<files updated>
<已更新的文件列表>

Pre-flight Results

预飞检查结果

<check summary table> ```
This is an internal record for the knowledge flywheel. It does NOT go on the GitHub Release page — that's the
-notes.md
file from Step 12.
Two files, two audiences:
FileAudienceContains
*-notes.md
GitHub feed readersHighlights, What's New, All Changes
*-audit.md
Internal/flywheelVersion bumps, pre-flight results

<检查汇总表格>

这是**内部**记录,用于知识积累。不会发布到GitHub Release页面 — 该页面使用步骤12中的`-notes.md`文件。

**两个文件,两个受众:**

| 文件 | 受众 | 内容 |
|------|----------|----------|
| `*-notes.md` | GitHub动态浏览者 | 亮点、新增内容、所有变更 |
| `*-audit.md` | 内部团队/知识积累 | 版本号升级记录、预飞检查结果 |

---

New Changelog Template

新变更日志模板

When no
CHANGELOG.md
exists and the user accepts creation, write:
markdown
undefined
当CHANGELOG.md不存在且用户同意创建时,写入以下内容:
markdown
undefined

Changelog

变更日志

All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
本项目所有重要变更均记录在此文件中。
基于Keep a Changelog格式, 本项目遵循语义化版本控制规范。

[Unreleased]

[Unreleased]


Then proceed with the normal workflow to populate the first versioned entry.

---

然后继续执行正常工作流,填充第一个带版本号的条目。

---

Boundaries

边界说明

What this skill does

本Skill支持的操作

  • Pre-flight validation (tests, lint, clean tree, versions, branch)
  • Changelog generation from git history
  • Semver suggestion from commit classification
  • Version string bumps in package files
  • Release commit + annotated tag
  • Release notes (highlights + changelog) for GitHub Release page
  • Draft GitHub Release (default, opt-out with
    --no-gh-release
    )
  • Post-release guidance
  • Audit trail
  • 预飞验证(测试、代码检查、工作区清理、版本号一致性、分支验证)
  • 基于git历史生成变更日志
  • 基于提交分类建议Semver版本号
  • 批量升级包文件中的版本号字符串
  • 创建发布提交 + 带注释的标签
  • 生成GitHub Release页面用的发布说明(亮点+精简变更日志)
  • 生成GitHub Release草稿(默认开启,可通过
    --no-gh-release
    关闭)
  • 发布后操作指引
  • 审计记录

What this skill does NOT do

本Skill不支持的操作

  • No publishing — no
    npm publish
    ,
    cargo publish
    ,
    twine upload
    . CI handles this.
  • No building — no
    go build
    ,
    npm pack
    ,
    docker build
    . CI handles this.
  • No pushing — no
    git push
    , no
    git push --tags
    . The user decides when to push.
  • No CI triggering — the tag push (done by the user) triggers CI.
  • No monorepo multi-version — one version, one changelog, one tag. Scope for v2.
Everything this skill does is local and reversible:
  • Bad changelog → edit the file
  • Wrong version bump →
    git reset HEAD~1
  • Bad tag →
    git tag -d v<version>
  • Draft GitHub Release → delete from the UI

  • 不执行发布 — 不执行
    npm publish
    cargo publish
    twine upload
    。由CI负责发布。
  • 不执行构建 — 不执行
    go build
    npm pack
    docker build
    。由CI负责构建。
  • 不执行推送 — 不执行
    git push
    git push --tags
    。由用户决定何时推送。
  • 不触发CI — 用户推送标签后才会触发CI。
  • 不支持单体仓库多版本 — 仅支持单版本、单变更日志、单标签。该功能计划在v2版本中支持。
本Skill执行的所有操作均在本地且可回滚:
  • 变更日志错误 → 直接编辑文件
  • 版本号升级错误 →
    git reset HEAD~1
  • 标签错误 →
    git tag -d v<version>
  • GitHub Release草稿错误 → 在UI中删除

Universal Rules

通用规则

  • Don't invent — only document what git log shows
  • No commit hashes in the final output
  • No author names in the final output
  • Concise — one sentence per bullet, technical but readable
  • Adapt, don't impose — match the project's existing style rather than forcing a particular format
  • User confirms — never write without showing the draft first
  • Local only — never push, publish, or trigger remote actions
  • Two audiences — CHANGELOG.md is for contributors (file paths, issue IDs, implementation detail). Release notes are for feed readers (plain English, user-visible impact, no insider jargon). Never copy-paste the changelog into the release notes.
  • 不编造内容 — 仅记录git log中显示的信息
  • 最终输出不包含提交哈希
  • 最终输出不包含作者名称
  • 简洁明了 — 每个项目符号一句话,技术但易懂
  • 适配现有风格 — 匹配项目现有风格,而非强制特定格式
  • 用户确认后执行 — 展示草稿前绝不写入任何内容
  • 仅本地操作 — 绝不执行推送、发布或触发远程操作
  • 区分受众 — CHANGELOG.md面向贡献者(包含文件路径、问题ID、实现细节)。发布说明面向动态浏览者(简单语言、用户可见影响、无内部术语)。绝不要直接复制变更日志到发布说明中。