zfc 3225368ae5 release: v0.1.0227.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 16:49:20 +08:00

110 lines
2.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: changelog
description: 一键发版:生成更新日志 → commit → 打 tag全流程自动化。
---
# Changelog - 一键发版
> **定位**:发版全流程。`/changelog 1.0.0227.1` 一个命令搞定日志生成 + commit + tag。
## 用法
```
/changelog <version> # 例: /changelog 1.0.0227.1
/changelog # 不传版本号则自动推断
```
## 执行流程
### 1. 确定版本号
**有参数**:直接使用用户传入的版本号。
**无参数**:自动推断。读取最新 tagbump build 号 +1。例如当前最新 `v1.1.0211.1` → 推断为 `1.1.0211.2`。若无 tag 则提示用户输入。
版本格式:`{major}.{minor}.{MMDD}.{build}`
### 2. 获取 Commits
```bash
# 找到上一个 tag
git tag --sort=-creatordate
# 读取 commits从上一个 tag 到 HEAD
git log {prev_tag}..HEAD --oneline --no-merges
```
如果没有上一个 tag则从初始 commit 开始。
### 3. AI 总结
将 commit 列表总结为用户友好的中文更新说明:
| type | emoji | 说明 |
|------|-------|------|
| feat | ✨ | 新功能 / 新 Skill |
| fix | 🐛 | Bug 修复 |
| refactor | ♻️ | 代码重构 |
| docs | 📝 | 文档更新 |
| chore | 🔧 | 杂项维护 |
规则:
- 每条说明 1 句话,简洁明了
- 合并相关的小 commit 为一条
- 面向用户描述(不要出现技术细节如文件名、函数名)
- summary一句话概括本次更新的核心主题
### 4. 展示草稿,等待确认
```
📦 v{version} · {date}
{summary}
✨ 新增 /go 执行按钮 Skill...
📝 更新 README 文档格式...
🐛 修复仓库 URL 配置...
```
**必须等用户确认或修改后才继续**
### 5. 写入文件
用户确认后,更新 `CHANGELOG.md`
- 文件不存在时创建,头部加 `# Changelog` 标题
- 将新条目插入已有内容**头部**(标题行之后,最新版本在前),保持现有条目不变
- 条目格式:
```markdown
## v{version} ({YYYY-MM-DD})
{summary}
- ✨ xxx
- 🐛 xxx
- ♻️ xxx
```
### 6. Commit + Tag
```bash
# Stage 变更文件
git add CHANGELOG.md
# Commit
git commit -m "release: v{version}"
# 打 tag
git tag v{version}
```
### 7. 完成提示
```
✅ 发版完成!
- 📝 CHANGELOG.md: 新增 v{version} 条目
- 🏷️ git tag: v{version}
需要 push 到远程吗?(git push && git push --tags)
```