選項

根據自上次發行以來的提交記錄,生成變更日誌條目。當使用者想要更新 CHANGELOG.md、新增變更日誌條目或記錄變更時,可使用此功能。

...展開全部
54
更新時間 2026-06-29

關於changelog

changelog 技能可自動化從上次發布以來的 Git 提交中生成changelog 條目的流程。此技能旨在協助開發團隊維持專案變更記錄的一致性,並以使用者為中心。 透過分析提交訊息並區分面向使用者與內部變更,此技能可確保CHANGELOG.md 反映出對終端使用者具有實質意義的更新內容。這不僅能減少手動作業的負擔、避免遺漏變更,更能確保發行文件始終保持準確且最新。

此技能提供了一套結構化的工作流程,用於擷取提交資訊、分類變更,並以標準化格式整理條目。主要功能包括識別面向用戶的變更(例如新功能、錯誤修復、效能提升、已棄用項目及安全性更新),同時排除純粹的內部變更(例如重構、測試或 CI/CD 修改)。 它會自動從提交訊息中提取問題參考,並將條目歸類至預定義的分類(新增、變更、修復、移除、已廢棄、安全性)。 此外,它會根據當前分支判定changelog 的適當區塊,同時支援版本化發佈及「未發佈」區塊。此技能運用 Bash 指令與 Edit 工具,能無縫讀取並更新changelog 。

此技能非常適合開發人員、發行版管理員,以及維護開源或內部軟體專案的團隊,協助他們簡化changelog 的維護工作。對於提交頻率高或有多名貢獻者的專案而言,此技能尤為實用,因為它能確保所有與使用者相關的變更皆能一致地記錄在案。 使用者不僅能節省時間、減少錯誤,更能獲得一份專業且結構完善的《changelog 》,該文件能清晰地向終端使用者、利害關係人及貢獻者傳達更新內容。

常見問題

如何使用changelog 技能?

首先在您的專案儲存庫中執行此功能。它將自動偵測自上次發布以來的提交記錄,將面向使用者的變更進行分類,擷取問題參考資訊,並在CHANGELOG.md 檔案的相應區段(未發布或已版本化的發布)中進行更新。

changelog 包含哪些類型的變更?

此技能會納入使用者可見的變更,例如新功能、錯誤修正、效能提升、破壞性變更、已廢棄功能以及安全性修正。內部變更(如重構、測試、CI/CD 或程式碼風格更新)則不包含在內,除非這些變更會影響使用者可見的行為。

它能否處理沒有先前發行標籤的儲存庫?

是的,若不存在先前發行標籤,此功能會分析最近的提交記錄(最多 50 筆)來產生「changelog 」條目,並將其放置於「未發行」區段中。

它會自動將新條目與現有的changelog 內容合併嗎?

是的,此技能會讀取當前的CHANGELOG.md 檔案,若目標區段不存在則會建立,並在合併新條目時避免重複。

提交訊息中是否必須包含問題參考編號?

不需要,問題參考編號屬可選項目。若包含問題參考編號,系統會以「(#123)」格式將其納入條目中。多個參考編號則會合併為「(#123, #124)」的格式。

在 GitHub 上查看

Changelog Generation Skill

Analyzes commits since the last release and adds user-facing changes to CHANGELOG.md.

Instructions

IMPORTANT: When using this skill, announce to the user: "Using changelog skill to generate changelog entries."

1. Get Last Release Tag

# Get the most recent release tagLAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")if [ -z "$LAST_TAG" ]; then  echo "No previous release tag found. Will analyze all commits."fi

2. Get Commits Since Last Release

# If tag existsgit log --format="%H %s" "$LAST_TAG"..HEAD# If no tag, get recent commitsgit log --format="%H %s" -50

3. Analyze Each Commit

For each commit, determine if it has user-facing impact:

Include (user-facing):

  • New features (:sparkles:)
  • Bug fixes (:bug:)
  • Performance improvements (:zap:)
  • Breaking changes (:boom:)
  • Deprecations
  • Security fixes (:lock:)

Exclude (internal):

  • Refactoring (:recycle:) - unless it changes behavior
  • Tests (:white_check_mark:)
  • CI/CD changes (:construction_worker:)
  • Documentation (:memo:) - unless user-facing docs
  • Code style (:art:)
  • Merge commits

4. Extract Issue References

Look for issue references in commit messages:

  • #123
  • Fixes #123
  • Closes #123
  • Related to #123

5. Categorize Changes

Group entries by category:

### Added- New features### Changed- Changes to existing functionality### Fixed- Bug fixes### Removed- Removed features### Deprecated- Soon-to-be removed features### Security- Security fixes

6. Format Entries

Each entry should:

  • Start with imperative verb (Add, Fix, Change, Remove)
  • Be concise (one line)
  • Include issue reference at end if available

Examples:

- Add list formatting support (#42)- Fix memory leak in data provider (#88)- Change default locale to en-US

7. Determine Target Section

# Get current branchBRANCH=$(git branch --show-current)# Determine target sectionif [[ "$BRANCH" =~ ^release-v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then  # On release branch → target is that version  TARGET_SECTION="[${BASH_REMATCH[1]}]"else  # Not on release branch → target is Unreleased  TARGET_SECTION="[Unreleased]"fi

8. Update CHANGELOG.md

  1. If target section doesn't exist, create it
  2. Add/merge entries under the target section

Creating new section if needed:

  • For [Unreleased]: Add after the header, before first version section
  • For version [X.Y.Z]: Add after [Unreleased], before previous versions

Example structure:

## [Unreleased]## [0.7.0] - 2024-01-15### Added- New feature description (#123)## [0.6.0] - 2024-01-01...

Use the Edit tool to update CHANGELOG.md.

Workflow

  1. Get last release tag
  2. List commits since that tag
  3. For each commit:
    • Read commit message
    • Determine if user-facing
    • Extract issue references
    • Categorize (Added/Changed/Fixed/etc.)
  4. Determine target section:
    • On release-vX.Y.Z branch → [X.Y.Z]
    • Otherwise → [Unreleased]
  5. Read current CHANGELOG.md
  6. Create target section if it doesn't exist
  7. Merge new entries with existing content in target section
  8. Update CHANGELOG.md using Edit tool

Guidelines

Entry Writing

  • Use imperative mood: "Add" not "Added" or "Adds"
  • Be specific but concise
  • Focus on user impact, not implementation details
  • One logical change per entry

Issue References

  • Always include if available
  • Format: (#123) at end of line
  • Multiple issues: (#123, #124)

Avoiding Duplicates

  • Check existing [Unreleased] entries before adding
  • Merge or update if similar entry exists

Example Output

## [Unreleased]### Added- Implement DecimalFormatter for number formatting (#42)- Add locale fallback support### Changed- Update default collation strength to tertiary### Fixed- Fix crash when parsing invalid locale string (#55)- Resolve memory leak in DataProvider (#58)

Arguments

This skill takes no arguments. It always analyzes commits from the last release tag to HEAD.

所有檔案

1 個檔案

安裝 changelog

請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。

下載 ZIP

複製儲存庫並將技能檔案複製到您的專案中。

git clone https://github.com/sakuro/dotfiles/blob/main/.config/claude/skills/changelog/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

複製 複製
快速設定: 將技能資料夾複製到 .claude/skills/,Claude 會自動偵測並使用該技能
儲存庫 sakuro/dotfiles

相關技能

code-simplify
更新時間 2026-07-02
requesting-code-review
更新時間 2026-06-29
commit-standards
更新時間 2026-06-29
Git Commit Helper
更新時間 2026-06-29
OR