Skip to main content Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/peterfei/ai-agent-team --skill changelog-generatorThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... name changelog-generator description 智能变更日志生成器 - 自动分析Git提交历史,生成符合规范的CHANGELOG.md。支持语义化版本管理、多种输出格式、增量更新和GitHub/GitLab集成。 license MIT
changelog-generator - 智能变更日志生成器
概述
当用户需要生成或更新 CHANGELOG 时,此 skill 会自动完成以下流程:
分析 Git 提交历史
根据 Conventional Commits 规范解析提交
智能分类和组织变更
生成符合 Keep a Changelog 标准的 CHANGELOG.md
支持版本发布和增量更新
支持的触发指令
用户可以通过以下方式触发此 skill:
"changelog" - 简易触发词
"变更日志" - 简易触发词
"帮我生成 CHANGELOG" - 生成完整的 CHANGELOG
"更新 CHANGELOG" - 增量更新 CHANGELOG
"发布新版本" - 发布正式版本
"初始化 changelog 配置" - 创建配置文件
工作流程
步骤 1: 初始化配置(首次使用)
命令 :
cd ~/.claude/skills/changelog-generator
npm install
cd /path/to/your/project
changelog-generate init
配置文件 : .changelogrc.json
交互式配置会询问:
当前版本号
语言选择(中文/英文)
是否使用 emoji
是否显示作者信息
步骤 2: 生成 CHANGELOG
场景 A: 首次生成完整 CHANGELOG
changelog-generate generate --all
changelog-generate generate --from v1.0.0 --to v2.0.0
场景 B: 增量更新 CHANGELOG
changelog-generate update
changelog-generate update --from v2.0.0
changelog-generate release
changelog-generate release --version 2.1.0
changelog-generate release --version 2.1.0 --date 2023-11-10
步骤 3: 输出文件 # Changelog
All notable changes to this project will be documented in this file.
## [Unreleased]
## [2.0.0] - 2023-11-10
### 💥 BREAKING CHANGES
- **api:** Remove deprecated v1 endpoints (#123)
### ✨ Features
- **auth:** Add JWT authentication (#120)
- **api:** Add user profile endpoint (#121)
### 🐛 Bug Fixes
- **ui:** Fix button alignment issue (#122)
### 📝 Documentation
- Update API documentation
## [1.0.0] - 2023-10-01
...
核心功能
1. 智能提交解析 支持 Conventional Commits 规范:
feat(auth): add login functionality
^ ^ ^
type scope subject
BREAKING CHANGE: Remove old auth API
feat: ✨ Features
fix: 🐛 Bug Fixes
docs: 📝 Documentation
style: 💄 Styles (可隐藏)
refactor: ♻️ Code Refactoring
perf: ⚡ Performance
test: ✅ Tests
build: 📦 Build System
ci: 👷 CI/CD
chore: 🔧 Chores (可隐藏)
2. 自动版本管理 提交类型 版本影响 示例 BREAKING CHANGE Major 1.0.0 → 2.0.0 feat Minor 1.0.0 → 1.1.0 fix Patch 1.0.0 → 1.0.1
3. PR 和 Issue 引用 feat: add new feature (#123)
fix: resolve bug (fixes #456)
- **feat:** add new feature ([#123 ](https://github.com/user/repo/pull/123 ))
4. 破坏性变更检测 方式 1 : 使用 BREAKING CHANGE footer
feat: add new API
BREAKING CHANGE: Old API is removed
feat!: remove deprecated method
配置选项
完整配置示例 {
"version" : "1.0.0" ,
"format" : "keepachangelog" ,
"language" : "zh-CN" ,
"display" : {
"emoji" : true ,
"groupByType" : true ,
"showAuthor" : true ,
"showPR" : true ,
"showIssue" : true
} ,
"types" : [
{ "type" : "feat" , "section" : "Features" , "emoji" : "✨" } ,
{ "type" : "fix" , "section" : "Bug Fixes" , "emoji" : "🐛" } ,
{ "type" : "chore" , "hidden" : true }
] ,
"exclude" : {
"types" : [ "style" , "chore" ] ,
"scopes" : [ "deps" ]
}
}
使用场景
场景 1: 新项目首次生成
changelog-generate init
changelog-generate generate --all
场景 2: 日常开发增量更新
git pull
changelog-generate update
changelog-generate preview
场景 3: 发布新版本
changelog-generate update
changelog-generate preview
changelog-generate release
git add CHANGELOG.md
git commit -m "chore(release): 2.0.0"
git tag v2.0.0
git push && git push --tags
场景 4: CI/CD 自动化 name: Update Changelog
on:
push:
branches: [main ]
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Update Changelog
run: |
npm install -g changelog-generate
changelog-generate update
- name: Commit
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md
git commit -m "docs: update changelog" || true
git push
CLI 命令参考
init - 初始化配置交互式创建 .changelogrc.json 配置文件。
generate - 生成 CHANGELOGchangelog-generate generate [options]
Options:
-f, --from <tag> 起始标签
-t, --to <tag> 结束标签 (默认: HEAD)
-o, --output <file> 输出文件 (默认: CHANGELOG.md)
--all 包含所有历史提交
update - 增量更新changelog-generate update [options]
Options:
-f, --from <tag> 起始标签(默认为最新标签)
-o, --output <file> CHANGELOG 文件 (默认: CHANGELOG.md)
release - 发布版本changelog-generate release [options]
Options:
-v, --version <version> 版本号
-d, --date <date > 发布日期
-o, --output <file> CHANGELOG 文件
preview - 预览 Unreleasedchangelog-generate preview
最佳实践
1. 规范的 Commit Message 使用 Conventional Commits 规范:
git commit -m "feat(auth): add OAuth2 support"
git commit -m "fix(ui): resolve button alignment issue"
git commit -m "docs: update installation guide"
git commit -m "update code"
git commit -m "fix bug"
git commit -m "wip"
2. 使用 Commitlint npm install --save-dev @commitlint/cli @commitlint/config-conventional
{
"extends" : [ "@commitlint/config-conventional" ]
}
3. Git Hooks 自动化 npm install --save-dev husky
npx commitlint --edit $1
4. 定期更新
5. 版本发布流程
git status
changelog-generate update
changelog-generate preview
changelog-generate release
git diff CHANGELOG.md
git add CHANGELOG.md
git commit -m "chore(release): 2.0.0"
git tag v2.0.0
git push && git push --tags
依赖安装
nvm use 18
cd ~/.claude/skills/changelog-generator
npm install
技术栈
simple-git : Git 操作
conventional-commits-parser : 提交解析
semver : 版本管理
handlebars : 模板引擎
commander : CLI 框架
inquirer : 交互式命令行
chalk : 终端颜色
ora : 加载动画
故障排除
问题 1: 找不到 Git 仓库
问题 2: 无法解析提交 原因 : 提交消息不符合 Conventional Commits 规范
解决 : 修改配置,将不符合规范的提交归类到 "Other" 类型。
问题 3: 生成的 CHANGELOG 为空
git log --oneline
cat .changelogrc.json | grep exclude
扩展和自定义
自定义模板 创建自定义模板 custom-template.hbs:
# 变更日志
{{#each versions}}
## 版本 {{version}} ({{date}})
{{#each changes}}
**{{section}}**
{{#each commits}}
- {{subject}}
{{/each}}
{{/each}}
{{/each}}
{
"template" : {
"path" : "./custom-template.hbs"
}
}
添加新的提交类型 {
"types" : [
{
"type" : "security" ,
"section" : "Security" ,
"emoji" : "🔒" ,
"priority" : 2
}
]
}
与其他工具集成
与 semantic-release 集成 {
"plugins" : [
"@semantic-release/commit-analyzer" ,
"@semantic-release/changelog" ,
"@semantic-release/npm" ,
"@semantic-release/git"
]
}
与 Renovate 集成 {
"automerge" : true ,
"prCreation" : "immediate" ,
"commitMessagePrefix" : "chore(deps):"
}
版本 : 1.0.0
作者 : Peter Fei
许可 : MIT
More from this repository
Related occupations SOC
Based on SOC occupation classification