changelog
Append a terse entry to CHANGELOG.md from a source file, a branch diff, or freetext instructions
- License 许可
- MIT
- 最近更新
- 2026-10-19
- Stars
- ★ 2
- Forks
- 1
01 前言 Front Matter
- name
- changelog
- description
- Append a terse entry to CHANGELOG.md from a source file, a branch diff, or freetext instructions
- allowed-tools
- Bash(git diff*), Bash(git log*), Bash(git rev-parse*)
- argument-hint
- <path-to-source-changelog> | "branch <name>" | "<freetext instructions>"
03 SKILL.md 正文
IMMEDIATE EXIT if no argument:
- If
$ARGUMENTSempty/missing: output "❌ Error: Source required. Usage: /changelog <path> | branch <name> | <freetext>" and STOP.
Locate target file:
- Run
git rev-parse --show-toplevel(fallback:pwdif not a git repo) → this isROOT. - Target is
ROOT/CHANGELOG.md. If missing, create it with a minimal header (# Changelog\n) before inserting the first entry.
Determine mode from $ARGUMENTS:
- Single token, no spaces, resolves to an existing file → file mode.
- Starts with literal
branch→ branch mode (rest of string =<branch-name>). - Anything else (multi-line or multi-word) → freetext mode.
File mode:
- Read the file. Extract: date (file content if stated, else file mtime), branch name (if stated), one-sentence summary, ≤2 notable gotchas.
- Scan content for a version bump (e.g.
"version": "X.Y.Z",version = "X.Y.Z") — use as<VERSION>if found.
Branch mode:
- Run
git diff origin/main...<branch-name> --stat --unified=0andgit log origin/main..<branch-name> --oneline. - Derive title and bullets from the diff + log (one bullet per distinct subject: CI, docs, bug fix, etc.).
- Date = today. Branch =
<branch-name>. - Scan the diff for a version bump in
plugin.json,package.json,Cargo.toml,pyproject.toml, orVERSION(changed"version"/version =line) — use the new value as<VERSION>if found.
Freetext mode:
- Treat
$ARGUMENTSas authoring instructions/context. Compose the entry directly from it. - Use a
<VERSION>only if one is explicitly stated in the text — never invent one.
Compose entry (omit [<VERSION>] prefix when no version was found; omit "Notable gotchas" block when there are none; keep entry under ~10 lines total):
## [<VERSION>] <DATE> — <TITLE> (`<BRANCH>`)
- <change 1>
- <change 2>
- <change 3>
Notable gotchas:
- <gotcha 1>
Write:
- Prepend the new entry immediately after the header block, before the first existing
##entry (or right after# Changelogif the file is new/empty). - Never alter existing entries.
Output: "✅ Added entry to CHANGELOG.md: <title>"
04 同仓库更多 Skills
example
Brief description of what this skill does
mdupdate
Refine .md file by integrating user's inline answers
mdresearch
Research codebase state from context file
mdplan
Generate step-by-step implementation plan from research
mdimplement
Execute implementation plan with testing and verification
ruff
Format and lint-fix Python file(s) or directory via ruff format + ruff check --fix