Install any skill in seconds. Free to start, no credit card required.
Get Started Free →智能变更日志生成器 - 自动分析Git提交历史,生成符合规范的CHANGELOG.md。支持语义化版本管理、多种输出格式、增量更新和GitHub/GitLab集成。
.claude/skills/peterfei-changelog-generator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 232% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 188% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 126% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -1% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 95% | 0% |
当用户需要生成或更新 CHANGELOG 时,此 skill 会自动完成以下流程:
用户可以通过以下方式触发此 skill:
命令:
bashcd ~/.claude/skills/changelog-generator npm install # 在项目目录中初始化配置 cd /path/to/your/project changelog-generate init
配置文件: .changelogrc.json
交互式配置会询问:
场景 A: 首次生成完整 CHANGELOG
bash# 生成所有历史提交的 CHANGELOG changelog-generate generate --all # 生成指定范围的 CHANGELOG changelog-generate generate --from v1.0.0 --to v2.0.0
场景 B: 增量更新 CHANGELOG
bash# 更新 [Unreleased] 区域 changelog-generate update # 从指定标签开始更新 changelog-generate update --from v2.0.0
场景 C: 发布新版本
bash# 自动确定版本号(交互式) changelog-generate release # 手动指定版本号 changelog-generate release --version 2.1.0 # 指定日期 changelog-generate release --version 2.1.0 --date 2023-11-10
默认输出路径: ./CHANGELOG.md
生成的 CHANGELOG 示例:
markdown# 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 ...
支持 Conventional Commits 规范:
feat(auth): add login functionality
^ ^ ^
type scope subject
BREAKING CHANGE: Remove old auth API支持的提交类型:
feat: ✨ Featuresfix: 🐛 Bug Fixesdocs: 📝 Documentationstyle: 💄 Styles (可隐藏)refactor: ♻️ Code Refactoringperf: ⚡ Performancetest: ✅ Testsbuild: 📦 Build Systemci: 👷 CI/CDchore: 🔧 Chores (可隐藏)根据提交类型自动确定版本号:
| 提交类型 | 版本影响 | 示例 | |---------|---------|------| | 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 |
自动识别和链接:
feat: add new feature (#123)
fix: resolve bug (fixes #456)生成链接:
markdown- **feat:** add new feature ([#123](https://github.com/user/repo/pull/123))
两种检测方式:
方式 1: 使用 BREAKING CHANGE footer
feat: add new API
BREAKING CHANGE: Old API is removed方式 2: 使用 "!" (感叹号) 标记
feat!: remove deprecated methodjson{ "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"] } }
bash# 1. 初始化配置 changelog-generate init # 2. 生成 CHANGELOG changelog-generate generate --all # 输出: CHANGELOG.md 包含所有历史提交
bash# 在每次 PR 合并后或定期更新 git pull changelog-generate update # 查看 [Unreleased] 的内容 changelog-generate preview
bash# 1. 更新 CHANGELOG changelog-generate update # 2. 预览将要发布的内容 changelog-generate preview # 3. 发布版本 changelog-generate release # 4. 提交和推送 git add CHANGELOG.md git commit -m "chore(release): 2.0.0" git tag v2.0.0 git push && git push --tags
GitHub Actions:
yamlname: 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
init - 初始化配置bashchangelog-generate init
交互式创建 .changelogrc.json 配置文件。
generate - 生成 CHANGELOGbashchangelog-generate generate [options] Options: -f, --from <tag> 起始标签 -t, --to <tag> 结束标签 (默认: HEAD) -o, --output <file> 输出文件 (默认: CHANGELOG.md) --all 包含所有历史提交
update - 增量更新bashchangelog-generate update [options] Options: -f, --from <tag> 起始标签(默认为最新标签) -o, --output <file> CHANGELOG 文件 (默认: CHANGELOG.md)
release - 发布版本bashchangelog-generate release [options] Options: -v, --version <version> 版本号 -d, --date <date> 发布日期 -o, --output <file> CHANGELOG 文件
preview - 预览 Unreleasedbashchangelog-generate preview
显示 Unreleased] 区域的内容。
使用 Conventional Commits 规范:
bash# 好的示例 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"
安装 commitlint 检查提交消息:
bashnpm install --save-dev @commitlint/cli @commitlint/config-conventional
配置 .commitlintrc.json:
json{ "extends": ["@commitlint/config-conventional"] }
使用 husky 在提交时检查:
bashnpm install --save-dev husky # .husky/commit-msg npx commitlint --edit $1
建议在以下时机更新 CHANGELOG:
bash# 1. 确保所有变更已提交 git status # 2. 更新 CHANGELOG changelog-generate update # 3. 预览内容 changelog-generate preview # 4. 发布版本 changelog-generate release # 5. 审查 CHANGELOG.md git diff CHANGELOG.md # 6. 提交和标签 git add CHANGELOG.md git commit -m "chore(release): 2.0.0" git tag v2.0.0 # 7. 推送 git push && git push --tags
bash# 使用 nvm 管理 Node.js 版本 nvm use 18 # 安装依赖 cd ~/.claude/skills/changelog-generator npm install
错误: Not a git repository
解决:
bash# 确保在 Git 仓库目录中 git status # 或初始化 Git 仓库 git init
原因: 提交消息不符合 Conventional Commits 规范
解决: 修改配置,将不符合规范的提交归类到 "Other" 类型。
检查:
bash# 查看提交历史 git log --oneline # 检查配置中的排除规则 cat .changelogrc.json | grep exclude
创建自定义模板 custom-template.hbs:
handlebars# 变更日志 {{#each versions}} ## 版本 {{version}} ({{date}}) {{#each changes}} **{{section}}** {{#each commits}} - {{subject}} {{/each}} {{/each}} {{/each}}
配置使用:
json{ "template": { "path": "./custom-template.hbs" } }
在 .changelogrc.json 中添加:
json{ "types": [ { "type": "security", "section": "Security", "emoji": "🔒", "priority": 2 } ] }
json{ "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/changelog", "@semantic-release/npm", "@semantic-release/git" ] }
.renovate.json:
json{ "automerge": true, "prCreation": "immediate", "commitMessagePrefix": "chore(deps):" }
版本: 1.0.0 作者: Peter Fei 许可: MIT
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 7,528 | 2,836 | -62% | 1 | 1 | 0% | 1,352 | 3,328 | +146% | 0 | 0 | — |
case-02 | fail→pass | 7,704 | 8,065 | +5% | 1 | 1 | 0% | 1,294 | 4,299 | +232% | 0 | 0 | — |
case-03 | fail→pass | 8,458 | 7,903 | -7% | 1 | 1 | 0% | 1,484 | 4,275 | +188% | 0 | 0 | — |
case-04 | pass→pass | 5,185 | 3,790 | -27% | 1 | 1 | 0% | 937 | 3,718 | +297% | 0 | 0 | — |
case-05 | pass→pass | 3,236 | 3,184 | -2% | 1 | 1 | 0% | 551 | 3,624 | +558% | 0 | 0 | — |
case-06 | pass→pass | 8,403 | 8,267 | -2% | 1 | 1 | 0% | 1,477 | 4,623 | +213% | 0 | 0 | — |
case-07 | fail→pass | 8,732 | 3,691 | -58% | 1 | 1 | 0% | 1,658 | 3,751 | +126% | 0 | 0 | — |
case-08 | pass→pass | 9,160 | 3,529 | -61% | 1 | 1 | 0% | 1,719 | 3,573 | +108% | 0 | 0 | — |
case-09 | fail→pass | 21,180 | 4,522 | -79% | 1 | 1 | 0% | 3,966 | 3,908 | -1% | 0 | 0 | — |
case-10 | pass→pass | 6,873 | 2,631 | -62% | 1 | 1 | 0% | 1,210 | 3,469 | +187% | 0 | 0 | — |
case-11 | fail→pass | 11,811 | 5,280 | -55% | 1 | 1 | 0% | 2,097 | 4,086 | +95% | 0 | 0 | — |
case-12 | fail→pass | 8,450 | 3,510 | -58% | 1 | 1 | 0% | 1,509 | 3,726 | +147% | 0 | 0 | — |
case-13 | pass→pass | 9,093 | 10,490 | +15% | 1 | 1 | 0% | 1,572 | 4,878 | +210% | 0 | 0 | — |
case-14 | fail→pass | 8,516 | 6,762 | -21% | 1 | 1 | 0% | 1,439 | 4,287 | +198% | 0 | 0 | — |
case-15 | fail→pass | 9,961 | 3,809 | -62% | 1 | 1 | 0% | 1,794 | 3,713 | +107% | 0 | 0 | — |
case-16 | fail→pass | 8,900 | 5,222 | -41% | 1 | 1 | 0% | 1,666 | 3,990 | +139% | 0 | 0 | — |
case-17 | pass→pass | 7,323 | 3,993 | -45% | 1 | 1 | 0% | 1,373 | 3,856 | +181% | 0 | 0 | — |
case-18 | fail→pass | 11,733 | 6,267 | -47% | 1 | 1 | 0% | 2,147 | 4,184 | +95% | 0 | 0 | — |
case-19 | pass→pass | 8,770 | 8,020 | -9% | 1 | 1 | 0% | 1,523 | 4,402 | +189% | 0 | 0 | — |
case-20 | pass→pass | 9,346 | 8,274 | -11% | 1 | 1 | 0% | 1,653 | 4,528 | +174% | 0 | 0 | — |
case-21 | pass→pass | 8,240 | 8,969 | +9% | 1 | 1 | 0% | 1,489 | 4,750 | +219% | 0 | 0 | — |
case-22 | pass→pass | 10,889 | 12,378 | +14% | 1 | 1 | 0% | 1,986 | 5,505 | +177% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +45 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.