changelog-composer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Changelog Composer

变更日志生成器

Transforms raw git history and PR descriptions into polished, audience-appropriate changelogs. Parses conventional commits, classifies changes by impact category, filters internal-only modifications, and produces structured release notes with PR links — following Keep a Changelog conventions.
将原始git历史和PR描述转换为打磨完善、适配目标受众的变更日志,支持解析conventional commits、按影响类别对变更分类、过滤仅内部改动,并生成带PR链接的结构化发布说明,符合Keep a Changelog规范。

Reference Files

参考文件

FileContentsLoad When
references/conventional-commits.md
Commit type parsing, scope extraction, breaking change indicatorsRepository uses conventional commits
references/categorization-rules.md
Change classification logic, audience filtering, severity orderingAlways
references/audience-filter.md
User-facing vs internal change detection, exclusion patternsAlways
references/changelog-formats.md
Keep a Changelog, GitHub Releases, announcement copy templatesFormat selection needed
文件内容加载时机
references/conventional-commits.md
提交类型解析、范围提取、破坏性变更标识仓库使用conventional commits时
references/categorization-rules.md
变更分类逻辑、受众过滤、优先级排序始终加载
references/audience-filter.md
用户可见/内部变更检测、排除规则始终加载
references/changelog-formats.md
Keep a Changelog、GitHub Releases、公告文案模板需要选择输出格式时

Prerequisites

前置要求

  • git — access to the repository history
  • gh (optional) — GitHub CLI for PR description extraction
  • A tagging strategy (semver tags) for identifying release boundaries
  • git — 可访问仓库历史
  • gh(可选)— 用于提取PR描述的GitHub CLI
  • 用于识别版本边界的标签策略(semver标签)

Workflow

工作流程

Phase 1: Gather Raw Changes

阶段1:收集原始变更

Collect all changes between the previous release and the current state:
  1. Identify boundaries — Find the last release tag:
    git describe --tags --abbrev=0
    . If no tags exist, use the initial commit or a user-specified starting point.
  2. Extract commits
    git log <last-tag>..HEAD --oneline --no-merges
  3. Extract PR titles
    gh pr list --state merged --base main --search "merged:>YYYY-MM-DD"
    or parse merge commit messages.
  4. Parse conventional commits — If the repository follows conventional commits (
    feat:
    ,
    fix:
    ,
    docs:
    , etc.), extract type, scope, and description. See
    references/conventional-commits.md
    .
  5. Collect breaking change indicators — Look for
    BREAKING CHANGE:
    in commit bodies,
    !
    after type (
    feat!:
    ), or explicit annotations in PR descriptions.
收集上一次发布到当前状态之间的所有变更:
  1. 确定版本边界 — 查找最新的发布标签:
    git describe --tags --abbrev=0
    。如果不存在标签,使用初始提交或用户指定的起始点。
  2. 提取提交记录
    git log <last-tag>..HEAD --oneline --no-merges
  3. 提取PR标题
    gh pr list --state merged --base main --search "merged:>YYYY-MM-DD"
    ,或解析合并提交信息。
  4. 解析conventional commits — 如果仓库遵循conventional commits规范(
    feat:
    fix:
    docs:
    等),提取类型、范围和描述,详见
    references/conventional-commits.md
  5. 收集破坏性变更标识 — 查找提交正文里的
    BREAKING CHANGE:
    、类型后的
    !
    feat!:
    ),或PR描述里的明确标注。

Phase 2: Classify Changes

阶段2:变更分类

Categorize each change by its impact:
CategoryConventional Commit TypeIndicators
Breaking Changes
feat!:
,
BREAKING CHANGE:
API removal, signature change, behavior change
Features
feat:
New capability, new endpoint, new command
Fixes
fix:
Bug correction, error handling improvement
Performance
perf:
Speed improvement, memory reduction
Documentation
docs:
README, API docs, guides
Internal
chore:
,
ci:
,
refactor:
,
test:
,
build:
No user-facing impact
For repositories without conventional commits, classify by reading the commit message and changed files. Code changes to public API → Feature or Fix. Test-only changes → Internal.
按影响对每个变更归类:
分类Conventional Commit类型识别特征
破坏性变更
feat!:
,
BREAKING CHANGE:
API移除、签名变更、行为逻辑变更
功能新增
feat:
新增能力、新增接口、新增命令
问题修复
fix:
Bug修正、错误处理优化
性能优化
perf:
速度提升、内存占用降低
文档更新
docs:
README、API文档、指南更新
内部变更
chore:
,
ci:
,
refactor:
,
test:
,
build:
无用户可见影响
对于不使用conventional commits的仓库,通过阅读提交信息和改动文件分类:公共API的代码改动归为功能新增或问题修复,仅测试相关改动归为内部变更。

Phase 3: Filter for Audience

阶段3:按受众过滤

  1. Exclude internal changes by default:
    • CI/CD configuration changes
    • Test additions/modifications
    • Dependency bumps (unless security-relevant)
    • Code refactoring with no behavior change
    • Build system changes
  2. Include internal changes only when:
    • They represent significant architecture shifts users should know about
    • They affect development workflow (contributing guide changes)
    • The changelog targets developers, not end-users
  3. Highlight breaking changes prominently — always at the top, always with migration guidance.
  1. 默认排除内部变更
    • CI/CD配置改动
    • 测试用例新增/修改
    • 依赖升级(安全相关除外)
    • 无行为变更的代码重构
    • 构建系统改动
  2. 仅在以下场景包含内部变更
    • 涉及用户需要知晓的重大架构调整
    • 影响开发工作流(贡献指南变更)
    • 变更日志面向开发者而非终端用户
  3. 突出展示破坏性变更 — 始终放在最前面,附带迁移指引。

Phase 4: Compose Entries

阶段4:编写条目

For each included change, write a human-readable description:
  1. Lead with the impact — "Users can now..." or "Fixed issue where..."
  2. Be specific — "Reduced memory usage by 40% for large file processing" not "Performance improvements"
  3. Include migration guidance for breaking changes — what the user must change
  4. Link to source — PR number, issue number, or commit hash
为每个保留的变更编写人类可读的描述:
  1. 以用户影响开头 — 比如"用户现在可以..."或"修复了...的问题"
  2. 内容具体 — 比如"大文件处理场景内存占用降低40%"而非笼统的"性能优化"
  3. 为破坏性变更提供迁移指引 — 说明用户需要做的调整
  4. 关联来源 — PR编号、issue编号或提交哈希

Phase 5: Output

阶段5:输出

Assemble the changelog in the requested format, ordered by severity:
  1. Breaking Changes (always first)
  2. Features
  3. Fixes
  4. Performance
  5. Documentation
按严重程度排序,组装为要求格式的变更日志:
  1. 破坏性变更(始终排在最前)
  2. 功能新增
  3. 问题修复
  4. 性能优化
  5. 文档更新

Output Format

输出格式

text
undefined
text
undefined

[{version}] - {YYYY-MM-DD}

[{version}] - {YYYY-MM-DD}

Breaking Changes

Breaking Changes

  • function_name
    parameter renamed
    old_param
    is now
    new_param
    . Migration: find/replace
    old_param=
    with
    new_param=
    in all call sites. (#{pr})
  • function_name
    parameter renamed
    old_param
    is now
    new_param
    . Migration: find/replace
    old_param=
    with
    new_param=
    in all call sites. (#{pr})

Features

Features

  • {Feature name} — {What it enables and why it matters}. (#{pr})
  • {Feature name} — {What it enables and why it matters}. (#{pr})

Fixes

Fixes

  • Fixed {symptom} when {condition}. (#{pr})
  • Fixed {symptom} when {condition}. (#{pr})

Performance

Performance

  • {Operation} is now {X}x faster / uses {X}% less memory. (#{pr})
  • {Operation} is now {X}x faster / uses {X}% less memory. (#{pr})

Documentation

Documentation

  • Added {guide/reference} for {topic}. (#{pr})
undefined
  • Added {guide/reference} for {topic}. (#{pr})
undefined

Configuring Scope

配置范围

ModeInputOutputWhen to Use
release
Tag-to-HEADFull changelog entryPreparing a versioned release
sprint
Date range or commit rangeSummary of changesSprint review, status update
pr
Single PROne-line changelog entryPR description template
模式输入输出使用场景
release
标签到HEAD的范围完整变更日志条目准备版本化发布时
sprint
日期范围或提交范围变更汇总冲刺评审、状态同步时
pr
单个PR单行变更日志条目PR描述模板填充

Calibration Rules

校准规则

  1. User impact first. Every entry should answer "what does this mean for the user?" not "what did the developer do?"
  2. Breaking changes are non-negotiable. Never omit or bury breaking changes. They go first, with migration guidance.
  3. Specific over vague. "Fixed login timeout on slow connections" beats "Fixed bug." "Added CSV export for reports" beats "New feature."
  4. Link everything. Every entry links to its source PR or issue. Users who want details can follow the link.
  5. Exclude noise. Internal refactoring, dependency bumps, and CI changes do not belong in user-facing changelogs unless they have user-visible impact.
  1. 用户影响优先 每个条目都应该回答"这对用户意味着什么",而非"开发者做了什么"。
  2. 破坏性变更不可省略 永远不要遗漏或隐藏破坏性变更,必须放在最前并附带迁移指引。
  3. 具体优于笼统 "修复了慢网络下的登录超时问题"远好于"修复了Bug","新增报表CSV导出能力"远好于"新增功能"。
  4. 所有条目关联来源 每个条目都要关联对应的源PR或issue,需要详情的用户可以点击链接查看。
  5. 排除无效噪音 内部重构、依赖升级、CI改动如果没有用户可见影响,不应出现在面向用户的变更日志中。

Error Handling

错误处理

ProblemResolution
No tags exist in repositoryAsk for a starting commit or date. Default to the initial commit if the repository is small.
Repository doesn't use conventional commitsClassify by reading commit messages and changed files. Note reduced classification accuracy.
PR descriptions are empty or low-qualityFall back to commit messages. Flag entries that may need manual review.
Ambiguous change classificationDefault to "Features" for additions, "Fixes" for modifications. Mark uncertain entries for review.
Too many changes for a single releaseGroup by component/module. Consider whether the release should be split.
Merge commits obscure individual changesUse
--no-merges
to skip merge commits. Parse individual commits within merged PRs.
问题解决方案
仓库中不存在标签询问用户起始提交或日期,小仓库默认使用初始提交。
仓库不使用conventional commits通过阅读提交信息和改动文件分类,标注分类准确度可能降低。
PR描述为空或质量过低回退到使用提交信息,标记可能需要人工审核的条目。
变更分类不明确新增内容默认归为"功能新增",改动内容默认归为"问题修复",标记不确定的条目待审核。
单版本变更过多按组件/模块分组,考虑是否需要拆分发布。
合并提交掩盖了单个变更使用
--no-merges
跳过合并提交,解析合并PR内的单个提交。

When NOT to Compose

不适用场景

Push back if:
  • The user wants to auto-publish release notes without review — changelogs require human judgment
  • The repository has no meaningful commit history (single "initial commit" with everything)
  • The request is for marketing copy, not technical release notes — different skill
  • The changes are not yet merged — changelog is for shipped changes, not in-progress work
出现以下情况时拒绝生成:
  • 用户想要不经审核自动发布发布说明 — 变更日志需要人工判断
  • 仓库无有效提交历史(只有一个包含所有内容的"初始提交")
  • 请求是为了生成营销文案而非技术发布说明 — 属于其他技能范畴
  • 变更还未合并 — 变更日志针对已发布的改动,而非进行中的工作