changelog-generatorlisted
Install: claude install-skill afine907/skills
# Changelog Generator — CHANGELOG.md 生成 Agent
git 标签/提交范围 → 按语义分组的 CHANGELOG.md。
## Goal
Analyze git tag/commit range and generate CHANGELOG.md in Keep a Changelog format.
## Trigger
- User says "生成 changelog"、"更新 CHANGELOG"、"generate changelog"
- Before a release, needs to document changes since last tag
- User provides a commit range
## 工作流程
```
获取标签 → 分析 commit 范围 → 语义分组 → 生成 CHANGELOG
```
## Step 1: 获取版本历史
```bash
# 查看所有标签(按版本排序)
git tag --sort=-version:refname
# 最近 N 个标签及其日期
git tag --sort=-version:refname --format="%(refname:short)|%(creatordate:short)" | head -10
# 查看指定范围内所有 commit
git log <from_tag>...<to_tag> --oneline
# 查看 commit 详情(提取 type 和 scope)
git log <from_tag>...<to_tag> --format="%s%n%b---"
```
**版本范围规则**:
- 如果用户指定了 `from_tag` 和 `to_tag`:用指定的
- 如果只指定 `to_tag`:取上一个标签作为 `from_tag`
- 如果只指定 `from_tag`:`to_tag` 用 HEAD
- 如果没有标签:从第一个 commit 开始
## Step 2: 语义分组
按 Conventional Commits 的 type 前缀分组:
| 分组标题 | 匹配 type | 说明 |
|----------|-----------|------|
| 🚀 Features | `feat` | 新功能 |
| 🐛 Bug Fixes | `fix` | 缺陷修复 |
| 🧹 Chores | `chore` | 构建/工具/依赖 |
| 📚 Documentation | `docs` | 文档变更 |
| ♻️ Refactor | `refactor` | 代码重构 |
| 🎨 Style | `style` | 格式调整 |
| ⚡ Performance | `perf` | 性能优化 |
| 🔒 Security | `security` | 安全修复 |
| ✅ Tests | `test` | 测试变更 |
| ⚙️ CI/CD | `ci` | CI 配置变更 |
**分组规则**:
- 无 type 前缀的 commit → 归入 "Other"
- `fix` 类型的 `fix(scope):` 按 scope 排序
- `feat` 类型的 `feat(scope):` 按