changelog-from-tags
Goal
Given a package directory inside a git repo, find the previous released
version tag, compute what changed since that tag (preferably scoped to the
package directory), then update the package's CHANGELOG.md latest entry
with accurate release notes.
Assumptions
- The package is a folder in a git repo and has:
pubspec.yaml
CHANGELOG.md
- Tags in the repo follow SemVer-ish names (e.g.
2.1.7, 2.1.7+1,
2.1.7-dev.1).
Workflow
1) Identify the target package and its current version
- Read
<package>/pubspec.yaml.
- Record
version: as currentVersion.
2) Identify the “previous released version tag”
- List tags sorted by version descending.
- Prefer the latest stable tag (no
-dev, -alpha, -beta, -rc), unless
the user explicitly requests a pre-release comparison.
- Confirm what tag points at
HEAD (if any). If HEAD is already tagged,
your diff range should usually still be previousTag..HEAD (unless user asked
for tagA..tagB).
3) Collect changes since previous tag (package-scoped)
- Gather commit list affecting only the package directory:
git -C <package> log <previousTag>..HEAD --oneline --decorate -- .
- Gather a stat summary:
git -C <package> diff --stat <previousTag>..HEAD -- .
- If needed, inspect diffs of relevant files (e.g.
pubspec.yaml, platform code
folders, README).
Optional helper (no extra dependencies):
If you want a single command to print the scoped commits and diffstat, run:
.agents\skills\changelog-from-tags\scripts\collect_changes.cmd <path-to-package>
4) Update CHANGELOG.md
- Read
<package>/CHANGELOG.md and identify the topmost version header.
- Decide the target section to update:
- If the topmost section matches
currentVersion, update that section.
- Otherwise, add a new top section
## <currentVersion> (or ## Unreleased
if the repo uses that convention) and place notes there.
- Write release notes based on actual changes between tags:
- Prefer user-facing impact.
- Keep bullets concise.
- Include PR/issue links when present in commit messages or known references.
- Avoid guessing. If the diff only changes dependency constraints/lockfiles,
say so.
5) Sanity checks
- Ensure
CHANGELOG.md remains valid Markdown.
- Show
git diff -- <package>/CHANGELOG.md for review.
Output expectations
When done, report:
- Previous tag used (e.g.
2.1.7)
- Diff range (e.g.
2.1.7..HEAD)
- A short bullet list of what was added to the changelog
- The updated file path
Edge cases & guidance
- Monorepo tags: If tags are global but package changes are scoped, always
scope logs/diffs to the package directory (
-- .) to avoid unrelated changes.
- No tags: If no tags exist, treat all history as changes and create an
initial changelog entry.
- Mismatch between tag and pubspec version: If
pubspec.yaml version is not
newer than the latest stable tag, ask the user whether to update the existing
top section or create a new one.
Source: aaassseee/screen_brightness — distributed by TomeVault.
1---2name: aaassseee-screen-brightness-screen-brightness3description: changelog-from-tags4---56# changelog-from-tags78## Goal910Given a **package directory** inside a git repo, find the **previous released11version tag**, compute **what changed since that tag** (preferably scoped to the12package directory), then **update the package's `CHANGELOG.md` latest entry**13with accurate release notes.1415## Assumptions1617- The package is a folder in a git repo and has:18 - `pubspec.yaml`19 - `CHANGELOG.md`20- Tags in the repo follow SemVer-ish names (e.g. `2.1.7`, `2.1.7+1`,21 `2.1.7-dev.1`).2223## Workflow2425### 1) Identify the target package and its current version26271. Read `<package>/pubspec.yaml`.282. Record `version:` as `currentVersion`.2930### 2) Identify the “previous released version tag”31321. List tags sorted by version descending.33 - Example:34 ```sh35 git -C <package> tag --list --sort=-v:refname36 ```372. Prefer the latest **stable** tag (no `-dev`, `-alpha`, `-beta`, `-rc`), unless38 the user explicitly requests a pre-release comparison.393. Confirm what tag points at `HEAD` (if any). If `HEAD` is already tagged,40 your diff range should usually still be `previousTag..HEAD` (unless user asked41 for `tagA..tagB`).4243### 3) Collect changes since previous tag (package-scoped)44451. Gather commit list affecting only the package directory:46 ```sh47 git -C <package> log <previousTag>..HEAD --oneline --decorate -- .48 ```492. Gather a stat summary:50 ```sh51 git -C <package> diff --stat <previousTag>..HEAD -- .52 ```533. If needed, inspect diffs of relevant files (e.g. `pubspec.yaml`, platform code54 folders, README).5556**Optional helper (no extra dependencies):**5758If you want a single command to print the scoped commits and diffstat, run:5960```bat61.agents\skills\changelog-from-tags\scripts\collect_changes.cmd <path-to-package>62```6364### 4) Update `CHANGELOG.md`65661. Read `<package>/CHANGELOG.md` and identify the topmost version header.672. Decide the target section to update:68 - If the topmost section matches `currentVersion`, update that section.69 - Otherwise, add a new top section `## <currentVersion>` (or `## Unreleased`70 if the repo uses that convention) and place notes there.713. Write release notes based on actual changes between tags:72 - Prefer user-facing impact.73 - Keep bullets concise.74 - Include PR/issue links when present in commit messages or known references.75 - Avoid guessing. If the diff only changes dependency constraints/lockfiles,76 say so.7778### 5) Sanity checks7980- Ensure `CHANGELOG.md` remains valid Markdown.81- Show `git diff -- <package>/CHANGELOG.md` for review.8283## Output expectations8485When done, report:8687- Previous tag used (e.g. `2.1.7`)88- Diff range (e.g. `2.1.7..HEAD`)89- A short bullet list of what was added to the changelog90- The updated file path9192## Edge cases & guidance9394- **Monorepo tags:** If tags are global but package changes are scoped, always95 scope logs/diffs to the package directory (`-- .`) to avoid unrelated changes.96- **No tags:** If no tags exist, treat all history as changes and create an97 initial changelog entry.98- **Mismatch between tag and pubspec version:** If `pubspec.yaml` version is not99 newer than the latest stable tag, ask the user whether to update the existing100 top section or create a new one.101102---103> Source: [aaassseee/screen_brightness](https://github.com/aaassseee/screen_brightness) — distributed by [TomeVault](https://tomevault.io).104<!-- tomevault:4.0:skill_md:2026-06-29 -->