Refresh Changelog Entries
Bring the changelog entries this branch introduced back in sync
with what the branch currently does. With --commit, the correction
lands as a new commit stacked on top; otherwise the edit is left
uncommitted for the user to commit, like /changelog. History is
never rewritten — for that, use /changelog:rewrite-aggressively.
Hard scope rule: this command only ever edits changelog content the
branch itself added. Entries that came from the base branch — earlier
releases, or unreleased entries from other work — are read-only. If a
correction would require touching a line the branch didn't add, stop
and ask.
Additional context from user: $ARGUMENTS
Phase 1: Establish scope
Detect the base. If the branch has a PR
(gh pr view --json baseRefName), the base is its baseRefName —
stack-aware. Otherwise detect trunk via
git symbolic-ref refs/remotes/origin/HEAD (fall back to master).
If currently on the base/trunk itself, report and stop.
Find the changelog file the same way /changelog does (scan for
CHANGES, CHANGES.md, CHANGELOG.md, HISTORY.md, NEWS.md,
…). No changelog changes on this branch and no changelog file →
suggest /changelog instead and stop.
Extract the branch's changelog footprint:
git diff origin/<base>...HEAD -- <changelog-file>
The added lines are the branch-owned entries — the only region this
command may edit. Also list the branch commits touching the file:
git log origin/<base>..HEAD --oneline -- <changelog-file>
If the branch has no changelog commits yet, say so and offer to
generate entries via the /changelog procedure instead.
Phase 2: Recompute what the entries should say
Read the sibling command file
../changelog/SKILL.md and apply its rules
verbatim — the Core Constraint (a branch is not a release), Phase 1
convention detection, Phase 2 commit categorization, and Phase 3 entry
generation and voice. Generate, from the branch's current net
change (git log / git diff against origin/<base>), the entries
the branch should have.
Phase 3: Diff documented vs. actual
Compare the branch-owned entries (Phase 1) against the recomputed
entries (Phase 2):
- Accurate — leave byte-for-byte untouched, including phrasing
you'd have written differently. Refresh fixes drift, not style.
- Stale — the entry describes something the branch no longer does,
or misstates scope. Rewrite it in place, matching the file's style.
- Missing — a user-visible change with no entry. Insert it in the
correct section of the unreleased block, following the sibling
command's section-order and homogeneity rules.
- Orphaned — an entry whose change was removed from the branch
entirely. Remove the entry.
- Out of reach — the fix would touch content the branch didn't add
(e.g., the branch's entry was merged into a pre-existing bullet, or
a section heading shared with base-branch entries must change). Ask
via
AskUserQuestion before touching anything outside the branch's
footprint; if declined, leave it and note the limitation.
Phase 4: Present, edit, commit
Mandatory gate — never edit or commit without explicit approval.
- Present a summary line
(
Branch: <name> | Base: <base> | Changelog commits: <shas>),
then the proposed edit as old → new markdown for each touched
entry, and the statement that everything else in the file is
untouched. Include the Target: unreleased section line from the
sibling command's Phase 4 — refresh never touches version headings
or version files.
- On approval, apply with the Edit tool, confined to the branch's
footprint plus approved insertions in the unreleased block.
- Show the modified region for verification, then verify the scope
guard mechanically:
git diff -- <changelog-file> combined with the
branch footprint must show no modifications to base-branch lines.
- Commit only with
--commit. When $ARGUMENTS contains
--commit, commit the edit as a new commit on top of the branch,
following the commit message rules in the sibling command's Commit
message conventions for CHANGES edits — project convention first,
fallback docs(CHANGES) <what the update covers>, never a version,
never a #N in the message. Stage the changelog file explicitly by
path — never git add -A. Without --commit (the default), leave
the edit uncommitted and show a ready-to-use commit message built
from the same rules — committing is the user's decision, as with
/changelog.
Rules
- Branch-scoped, always: never modify changelog content the branch
didn't introduce; when a fix requires it, ask first.
- Never rewrites: no rebase, no amend, no force-push. With
--commit it stacks a single new commit; otherwise it commits
nothing. Rewriting the branch's changelog history is
/changelog:rewrite-aggressively.
- A branch is not a release: all Core Constraint rules from
/changelog apply — no version headings, no version predictions, no
version-file edits.
- Whole-branch perspective: entries document the net result
against the base, not the branch's internal history.
- Ask on ambiguity; the cost of a question is smaller than a
changelog that lies.
1---2name: refresh-23description: Update the branch's own changelog entries to match its current net change; commits only with --commit4---567# Refresh Changelog Entries89Bring the changelog entries **this branch introduced** back in sync10with what the branch currently does. With `--commit`, the correction11lands as a **new commit stacked on top**; otherwise the edit is left12uncommitted for the user to commit, like `/changelog`. History is13never rewritten — for that, use `/changelog:rewrite-aggressively`.1415Hard scope rule: this command only ever edits changelog content the16branch itself added. Entries that came from the base branch — earlier17releases, or unreleased entries from other work — are read-only. If a18correction would require touching a line the branch didn't add, stop19and ask.2021Additional context from user: $ARGUMENTS2223---2425## Phase 1: Establish scope26271. **Detect the base.** If the branch has a PR28 (`gh pr view --json baseRefName`), the base is its `baseRefName` —29 stack-aware. Otherwise detect trunk via30 `git symbolic-ref refs/remotes/origin/HEAD` (fall back to `master`).31 If currently on the base/trunk itself, report and stop.32332. **Find the changelog file** the same way `/changelog` does (scan for34 `CHANGES`, `CHANGES.md`, `CHANGELOG.md`, `HISTORY.md`, `NEWS.md`,35 …). No changelog changes on this branch and no changelog file →36 suggest `/changelog` instead and stop.37383. **Extract the branch's changelog footprint**:39 ```40 git diff origin/<base>...HEAD -- <changelog-file>41 ```42 The added lines are the branch-owned entries — the only region this43 command may edit. Also list the branch commits touching the file:44 ```45 git log origin/<base>..HEAD --oneline -- <changelog-file>46 ```47 If the branch has no changelog commits yet, say so and offer to48 generate entries via the `/changelog` procedure instead.4950## Phase 2: Recompute what the entries should say5152Read the sibling command file53`../changelog/SKILL.md` and apply its rules54verbatim — the *Core Constraint* (a branch is not a release), Phase 155convention detection, Phase 2 commit categorization, and Phase 3 entry56generation and voice. Generate, from the branch's **current net57change** (`git log` / `git diff` against `origin/<base>`), the entries58the branch *should* have.5960## Phase 3: Diff documented vs. actual6162Compare the branch-owned entries (Phase 1) against the recomputed63entries (Phase 2):6465- **Accurate** — leave byte-for-byte untouched, including phrasing66 you'd have written differently. Refresh fixes drift, not style.67- **Stale** — the entry describes something the branch no longer does,68 or misstates scope. Rewrite it in place, matching the file's style.69- **Missing** — a user-visible change with no entry. Insert it in the70 correct section of the unreleased block, following the sibling71 command's section-order and homogeneity rules.72- **Orphaned** — an entry whose change was removed from the branch73 entirely. Remove the entry.74- **Out of reach** — the fix would touch content the branch didn't add75 (e.g., the branch's entry was merged into a pre-existing bullet, or76 a section heading shared with base-branch entries must change). Ask77 via `AskUserQuestion` before touching anything outside the branch's78 footprint; if declined, leave it and note the limitation.7980## Phase 4: Present, edit, commit8182**Mandatory gate — never edit or commit without explicit approval.**83841. Present a summary line85 (`Branch: <name> | Base: <base> | Changelog commits: <shas>`),86 then the proposed edit as old → new markdown for each touched87 entry, and the statement that everything else in the file is88 untouched. Include the `Target: unreleased section` line from the89 sibling command's Phase 4 — refresh never touches version headings90 or version files.912. On approval, apply with the Edit tool, confined to the branch's92 footprint plus approved insertions in the unreleased block.933. Show the modified region for verification, then verify the scope94 guard mechanically: `git diff -- <changelog-file>` combined with the95 branch footprint must show no modifications to base-branch lines.964. **Commit only with `--commit`.** When `$ARGUMENTS` contains97 `--commit`, commit the edit as a new commit on top of the branch,98 following the commit message rules in the sibling command's *Commit99 message conventions for CHANGES edits* — project convention first,100 fallback `docs(CHANGES) <what the update covers>`, never a version,101 never a `#N` in the message. Stage the changelog file explicitly by102 path — never `git add -A`. Without `--commit` (the default), leave103 the edit uncommitted and show a ready-to-use commit message built104 from the same rules — committing is the user's decision, as with105 `/changelog`.106107---108109## Rules110111- **Branch-scoped, always**: never modify changelog content the branch112 didn't introduce; when a fix requires it, ask first.113- **Never rewrites**: no rebase, no amend, no force-push. With114 `--commit` it stacks a single new commit; otherwise it commits115 nothing. Rewriting the branch's changelog history is116 `/changelog:rewrite-aggressively`.117- **A branch is not a release**: all Core Constraint rules from118 `/changelog` apply — no version headings, no version predictions, no119 version-file edits.120- **Whole-branch perspective**: entries document the net result121 against the base, not the branch's internal history.122- **Ask on ambiguity**; the cost of a question is smaller than a123 changelog that lies.