Auto-generate a changelog from git commits and sprint data. Internal and player-facing versions.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-changelog-87eaadbacdfa ,按照其中的说明把「changelog」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
!bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" resolve_config --keys automation
Automation mode: Resolve modes.automation (project.local.yaml →
project.yaml → default collaborative). Every AskUserQuestion call and
every file write follows .claude/docs/automation-modes.md
(collaborative asks always · guided major-only · autonomous logs and proceeds;
automation_always_ask categories always prompt).
Recent commits:
!git log --oneline -30 2>/dev/null || true
Recent tags (newest first):
!git tag --list --sort=-v:refname 2>/dev/null | head -5
The commits above may not belong to this game. This skill's history blocks are auto-resolved before the body runs, so the read has already happened — what this check governs is whether that output is usable, not whether it is fetched.
Filter per commit; a repo containing maintenance work is not a wrong repo. Every project on this framework accumulates commits touching hooks, CI and skills — the game repo is the framework repo. Listing those as a hard STOP fires on virtually every real project and contradicts step 2 whenever the history is mostly the game's. The harm is those commits becoming release copy, and excluding them prevents that precisely.
This rule is kept identical to
/patch-notes' on purpose — the two read the same history for different audiences, and they must not disagree about whose history it is. Change both together.
The genuine wrong-history signal is different: Game commits naming a product that
design/ and src/ never mention. If you see that, stop.
If no commit in the range is this game's, say so and stop:
"The git history in this repo does not appear to belong to [game]. The recent commits describe [what they actually describe]. I cannot generate a changelog from it — point me at the right history, or supply the change list directly."
Why this is a hard stop, not a warning. This exact failure is real, not hypothetical: a batch of framework-internal commits produced player-facing copy reading "Fixed an issue where progress from your last session could be lost on launch" — a session-hook timeout rendered as a gameplay fix for a game with no save system. It was fluent, plausible, and entirely false. A reader cannot tell the difference; only this check can.
Do not treat the preamble's existence as evidence. Injected output means the command ran, never that its subject is your game.
Both blocks are resolved before this skill runs. Use them as the starting point for Phase 2 rather than re-running the same commands.
Read the argument for the target version or sprint number. If a version is given, use the corresponding git tag. If a sprint number is given, use the sprint date range.
Verify the repository is initialized: run git rev-parse --is-inside-work-tree to confirm git is available. If not a git repo, inform the user and abort gracefully.
Read the git log since the last tag or release:
git log --oneline [last-tag]..HEAD
If no tags exist, bound the range explicitly — git log --oneline -n 100. Do not
fall back to the full log: on an established repo that is thousands of lines for
a changelog covering one release, and the oldest of them are the least relevant.
If 100 commits does not reach far enough back, say so and ask for a start ref
rather than widening blindly.
Read sprint reports from production/sprints/ for the relevant period to understand planned work and context behind changes.
Read completed design documents from design/gdd/ for any new features implemented during this period.
Categorize every change into one of these categories:
For each commit, check whether the message contains a task ID or story reference
(e.g. [STORY-123], TR-, #NNN, or similar). Count commits that lack any task reference
and include this count in the Phase 4 Metrics section as: Commits without task reference: [N].
# Internal Changelog: [Version]
Date: [Date]
Sprint(s): [Sprint numbers covered]
Commits: [Count] ([first-hash]..[last-hash])
## New Features
- [Feature Name] -- [Technical description, affected systems]
- Commits: [hash1], [hash2]
- Owner: [who implemented it]
- Design doc: [link if applicable]
## Improvements
- [Improvement] -- [What changed technically and why]
- Commits: [hashes]
- Owner: [who]
## Bug Fixes
- [BUG-ID] [Description of bug and root cause]
- Fix: [What was changed]
- Commits: [hashes]
- Owner: [who]
## Balance Changes
- [What was tuned] -- [Old value -> New value] -- [Design intent]
- Owner: [who]
## Technical Debt / Refactoring
- [What was cleaned up and why]
- Commits: [hashes]
## Miscellaneous
- [Change that didn't fit other categories, or vague commit message]
- Commits: [hashes]
## Known Issues
- [Issue description] -- [Severity] -- [ETA for fix if known]
## Metrics
- Total commits: [N]
- Files changed: [N]
- Lines added: [N]
- Lines removed: [N]
- Commits without task reference: [N]
# What is New in [Version]
## New Features
- **[Feature Name]**: [Player-friendly description of what they can now do
and why it is exciting. Focus on the experience, not the implementation.]
## Improvements
- **[What improved]**: [How this makes the game better for the player.
Be specific but avoid jargon.]
## Bug Fixes
- Fixed an issue where [describe what the player experienced, not what was
wrong in the code]
- Fixed [player-visible symptom]
## Balance Changes
- [What changed in player-understandable terms and the design intent.
Example: "Healing potions now restore 50 HP (up from 30) -- we felt
players needed more recovery options in late-game encounters."]
## Known Issues
- We are aware of [issue description in player terms] and are working on a
fix. [Workaround if one exists.]
---
Thank you for playing! Your feedback helps us make the game better.
Report issues at [link].
Output both changelogs to the user. The internal changelog is the primary working document. The player-facing changelog is ready for community posting after review.
After presenting the changelogs, ask the user:
"May I write this changelog to
docs/CHANGELOG.md? [A] Yes, append this entry (recommended if the file already exists) [B] Yes, overwrite the file entirely [C] No — I'll copy it manually"
docs/CHANGELOG.md exists before asking. If it does, default the
recommendation to [A] append.After a successful write: Verdict: CHANGELOG WRITTEN — changelog saved to docs/CHANGELOG.md.
If the user declines: Verdict: COMPLETE — changelog generated.
/patch-notes [version] to generate a styled, saved version for public release./release-checklist before publishing the changelog externally.