devopschangelog-generation
Featured自动生成 CHANGELOG,基于 git 提交历史和 pipeline 产物信息,遵循 Conventional Commits 和 Keep a Changelog 规范
AI & Automation 547 stars
50 forks Updated 4 days ago MIT
Install
Quality Score: 95/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# CHANGELOG 自动生成
## 适用场景
在部署成功完成后自动生成或追加 CHANGELOG,记录本次发布的所有变更。适用于:
- 部署完成后的发布记录
- 版本发布前的变更汇总
- 对外发布说明的自动生成
## 核心方法
### 步骤 1:信息收集
1. **Git 历史解析**:
```bash
# 获取从上次 tag 到 HEAD 的所有提交
git log $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD --pretty=format:"%H|%s|%an|%ai"
```
- 如果没有 tag,取最近 50 条提交
- 解析 Conventional Commits 格式:`type(scope): description`
2. **Pipeline 产物读取**:
- `.boss/<feature>/prd.md` → 功能描述和用户价值
- `.boss/<feature>/deploy-report.md` → 部署环境和版本信息
- `.boss/<feature>/tasks.md` → 完成的任务列表
3. **版本号确定**:
- 优先使用 `package.json` 中的 version
- 其次使用最新 git tag
- 如无法确定,使用日期格式 `YYYY.MM.DD`
### 步骤 2:变更分类
按 Conventional Commits 规范分类:
| 类型 | CHANGELOG 分类 | 说明 |
|------|---------------|------|
| `feat` | **Added** | 新增功能 |
| `fix` | **Fixed** | 修复问题 |
| `perf` | **Performance** | 性能优化 |
| `refactor` | **Changed** | 重构(非功能变更) |
| `docs` | **Documentation** | 文档更新 |
| `style` | _(不记录)_ | 代码格式 |
| `test` | _(不记录)_ | 测试相关 |
| `chore` | _(不记录)_ | 构建/工具变更 |
| `BREAKING CHANGE` | **⚠️ Breaking Changes** | 破坏性变更(始终置顶) |
对于非 Conventional Commits 格式的提交:
- 根据关键词推断分类(add/new → Added, fix/bug → Fixed, update/change → Changed)
- 无法分类的归入 **Changed**
### 步骤 3:内容生成
#### 格式规范(Keep a Changelog)
```markdown
## [版本号] - YYYY-MM-DD
### ⚠️ Breaking Changes
- 破坏性变更描述 ([commit-hash])
### Added
- 新功能描述(来自 PRD 的用户价值说明) ([commit-hash])
### Changed
- 变更描述 ([commit-hash])
### Fixed
- 修复描述 ([commit-hash])
### Performance
-...
Details
- Author
- echoVic
- Repository
- echoVic/boss-skill
- Created
- 7 months ago
- Last Updated
- 4 days ago
- Language
- TypeScript
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
changelog-generator
从 Git 提交记录自动生成用户友好的 CHANGELOG,按 Conventional Commits 分类归组,支持版本号推断。由 documenter 在 /ship 流程中调用。
1 Updated today
Kucell AI & Automation Featured
changelog-gen
Changelog 生成器 - 从 Git 历史自动生成 CHANGELOG
783 Updated 2 days ago
laolaoshiren AI & Automation Listed
changelog-generation
当用户要求"生成 changelog/写变更日志/补 changelog"时触发。 按 Keep a Changelog 规范生成变更日志。
1 Updated 1 weeks ago
structure-projects