From a334e05b75039289e25e90d27b4ce7c2c94640cd Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Fri, 11 Sep 2026 13:29:56 -0400 Subject: [PATCH 1/4] chore: add release-notes skill for drafting alpha/beta notes Derives the house format from the last ten alpha.1/beta.1 prereleases: the last stable tag as the compare base, the fixed section order, the autogenerated bullet lines kept verbatim, and the alpha-versus-beta placement of the API and env var tables. Ships a skeleton in template.md and registers the skill in CLAUDE.md. Co-Authored-By: Claude Opus 5 (1M context) --- .claude/skills/release-notes/SKILL.md | 151 +++++++++++++++++++++++ .claude/skills/release-notes/template.md | 75 +++++++++++ CLAUDE.md | 1 + 3 files changed, 227 insertions(+) create mode 100644 .claude/skills/release-notes/SKILL.md create mode 100644 .claude/skills/release-notes/template.md diff --git a/.claude/skills/release-notes/SKILL.md b/.claude/skills/release-notes/SKILL.md new file mode 100644 index 000000000..7de901107 --- /dev/null +++ b/.claude/skills/release-notes/SKILL.md @@ -0,0 +1,151 @@ +--- +name: release-notes +description: Draft the GitHub release notes for a RomM alpha.1 or beta.1 prerelease from the diff since the last stable tag. Use when asked to "write the release notes", "draft the 5.3.0-alpha.1 notes", "what goes in the beta notes", or to refresh a draft after more PRs land. Produces the house format (callouts, Highlights, Minor changes, Fixes, Other changes, API changes, New Contributors) and never publishes. +argument-hint: "[tag to draft, e.g. 5.2.0-alpha.1 | nothing to infer it]" +--- + +# Drafting alpha/beta release notes + +Turn a tag range into the notes RomM actually publishes. The GitHub autogenerated +list is raw material, not the deliverable: the published notes reorganize it into +sections, lift the few changes that matter into prose Highlights, and add the +callouts an upgrader needs before they pull the image. + +Output a markdown file and print it. **Never** run `gh release create` or +`gh release edit`. Publishing is the maintainer's call. + +--- + +## 1. Resolve the range + +`$ARGUMENTS` is the tag being drafted. If it is empty, infer it: take the last +stable tag, bump minor for a range containing `feat:` work or patch otherwise, +and say which you picked so it can be corrected. + +The base is always **the last stable tag**, never the preceding prerelease. A +`5.1.0-beta.1` is drafted against `5.0.0`, the same base its own alpha used, so +the beta is a superset of the alpha rather than a delta on top of it. + +```bash +TAG=5.3.0-alpha.1 # what you are drafting +git fetch origin master --tags +# last stable tag: numeric tags only (the legacy v-prefixed ones sort wrong), +# no -alpha/-beta suffix, highest version +BASE=$(git tag --list '[0-9]*' | grep -vE -- '-(alpha|beta|rc)' | sort -V | tail -1) +RANGE="$BASE..origin/master" +git rev-list --count $RANGE +git diff --stat $RANGE | tail -20 +``` + +## 2. Pull the raw material + +The autogenerated list is the spine. Its **order is merge order, keep it** when +you partition lines into sections, and keep each line's `by @user in ` tail +byte for byte so attribution and first-time-contributor detection stay correct. + +```bash +gh api repos/rommapp/romm/releases/generate-notes \ + -f tag_name="$TAG" -f previous_tag_name="$BASE" --jq '.body' > /tmp/raw-notes.md +``` + +Then run the sweeps that find what the PR titles do not say: + +```bash +# new or changed env vars +git diff $RANGE -- backend/config/__init__.py | grep -E '^[+-].*_get_env' +# new, moved or removed routes +git diff $RANGE -- backend/endpoints/ | grep -E '^[+-].*@(protected_route|router\.)' +# response-schema changes the frontend types are generated from +git diff --stat $RANGE -- backend/endpoints/responses/ backend/handler/scan_handler.py +# migrations, which imply an irreversible upgrade step +git diff --name-status $RANGE -- backend/alembic/versions/ +# config.yml surface +git diff $RANGE -- backend/config/config_manager.py | grep -E '^[+-].*(class |: )' | head -40 +``` + +For each candidate Highlight, read the PR itself rather than paraphrasing its +title: `gh pr view --json title,body,author`. The prose in the notes is +usually a compression of the PR description. + +## 3. Assemble the document + +Follow `template.md` in this skill directory for the exact skeleton. Sections in +this order, all optional except the last two: + +| Section | Contents | +| --------------------- | -------------------------------------------------------------------- | +| Callouts | `> [!WARNING]` upgrade actions, `> [!NOTE]` env vars and API changes | +| `## Highlights` | `### Title` + prose per headline feature | +| `## Minor changes` | every `feat:` PR not already a Highlight | +| `## Fixes` | every `fix:` PR | +| `## Other changes` | `perf:`, `chore:`, `docs:`, `refactor:`, `revert:`, `build(deps):` | +| API changes | table, inline for an alpha, in `
` once it gets long | +| `## New Contributors` | verbatim from the autogenerated body | +| `**Full Changelog**` | verbatim from the autogenerated body | + +**Small patch prereleases skip all of it.** Under roughly eight PRs with no +`feat:`, publish a single flat `## What's Changed` list plus the changelog link, +the way `4.9.1-beta.1` did. Do not manufacture Highlights for a bugfix release. + +## 4. Section rules + +**Highlights.** Three to eight for a minor line, zero for a patch line. A change +earns one only if it changes what a user can do or how they run RomM: a new +subsystem, a new metadata source, a new UI surface, a new export format. Format: + +- `### Sentence case name of the thing`, no trailing punctuation. +- One or two short paragraphs, second person, present tense. Say what it does, + then the one thing the reader has to know to use it (the config key, the + setting, the caveat). Name real keys and paths in backticks. +- End the first paragraph with the bare PR reference: ` #3211`. Bare `#NNNN` in + prose, full URLs only in the bullet lists. +- Add a fenced `yaml` block when a config key drives the feature. +- Leave a `` placeholder for anything visual. Do not + invent `user-images.githubusercontent.com` URLs; the maintainer pastes real + ones. + +**Bullet sections.** One line per PR, copied from the autogenerated body. Fix up +only the title, in place: give it a conventional-commit prefix and scope if it +lacks one (`Skip DMCA-locked grids when scraping SteamGridDB` becomes +`fix: Skip DMCA-locked grids when scraping SteamGridDB`), and lowercase a shouty +one. Never drop a PR, never merge two into one line, never reorder across +sections. A PR that is both a highlight and a `feat:` appears in both. + +`build(deps):` and `dependabot[bot]` lines always land in Other changes, never +in Fixes, even when the bump closes a CVE. Call the CVE out in a callout instead +if it matters. + +**Callouts.** A `> [!WARNING]` is for something the upgrader must do, and it goes +at the very top, above Highlights: a renamed `config.yml` key, a DB privilege +the migration needs, a proxy cache to purge. Write the migration action, not the +rationale. A `> [!NOTE]` carries the env var table and the API change table. A +`> [!IMPORTANT]` marks a feature shipping ahead of its documentation. + +Env vars go in a table with `variable | default | description`; API changes in a +table with `Change | Description` for edits, and `Method | Path | Description` +for a new endpoint group. Prefix a breaking entry with `⚠️`. + +## 5. alpha.1 versus beta.1 + +- **alpha.1** opens the line. Put the env var and API tables in one `> [!NOTE]` + block at the top, where the third-party app developers reading the alpha will + see them first. +- **beta.1** regenerates over the same base, so it is the alpha's notes plus + everything merged since. Carry the alpha's Highlights across verbatim unless + the feature changed, add the new ones, and fold in any warning that alpha + feedback produced. Once the API table runs past roughly fifteen rows, move it + to the bottom inside `

API changes

`, since + by the beta most readers are upgraders rather than integrators. + +## 6. Before handing it over + +- Every PR in `/tmp/raw-notes.md` appears exactly once in a bullet section. +- Every `#NNNN` in the Highlights resolves to a PR in the range. +- Every new env var found in step 2 is documented, and every route change too. +- A migration in the range means you have checked whether it needs a warning. +- The `**Full Changelog**` compare link ends in the tag you are drafting. +- No em-dashes, no invented screenshot URLs, no marketing claims the diff does + not support. + +Print the draft and say what you could not determine (which screenshots are +needed, which version you inferred), rather than guessing. diff --git a/.claude/skills/release-notes/template.md b/.claude/skills/release-notes/template.md new file mode 100644 index 000000000..0b4a1b95d --- /dev/null +++ b/.claude/skills/release-notes/template.md @@ -0,0 +1,75 @@ + + +> [!WARNING] +> privilege the migration needs, proxy cache to purge. One warning per action.> + +> [!NOTE] +> +> ### Environment variables +> +> | variable | default | description | +> | ----------- | ------- | ------------------------------------------ | +> | NEW_ENV_VAR | `-` | | +> +> ### API changes +> +> | Change | Description | +> | ----------------- | ------------------------------------------------------------ | +> | `POST /api/thing` | | +> | `ThingSchema` | | + +## Highlights + +### + + #NNNN + +```yaml +scan: + some_key: true +``` + + + +## Minor changes + +- feat(scope): by @user in https://github.com/rommapp/romm/pull/NNNN + +## Fixes + +- fix(scope): <title> by @user in https://github.com/rommapp/romm/pull/NNNN + +## Other changes + +- perf(scope): <title> by @user in https://github.com/rommapp/romm/pull/NNNN +- build(deps): bump <pkg> from x to y by @dependabot[bot] in https://github.com/rommapp/romm/pull/NNNN + +<!-- beta only, once the API table outgrows the top callout --> +<details> + +<summary><h2>API changes</h2></summary> + +| Change | Description | +| ----------------- | -------------- | +| `POST /api/thing` | <what it does> | + +### <New endpoint group> + +| Method | Path | Description | +| ------ | -------- | ----------------- | +| `GET` | `/thing` | <what it returns> | + +</details> + +## New Contributors + +- @user made their first contribution in https://github.com/rommapp/romm/pull/NNNN + +**Full Changelog**: https://github.com/rommapp/romm/compare/<base stable tag>...<tag> diff --git a/CLAUDE.md b/CLAUDE.md index df973dd53..cb7c2e3ae 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -50,6 +50,7 @@ These live in `.claude/skills/` and carry the detailed rules. Invoke the one tha | `review-polish` | Before committing / opening a PR / declaring done - the self-review pass (comments, duplication, naming, test typing) plus the checks that keep CI green. | | `security-audit` | Vetting a diff (release tag range or PR) for anything malicious or a security regression - supply chain, egress, auth/injection, CI, provenance. | | `pr-ready` | Before opening a PR - the four passes in order: `security-audit`, `code-review xhigh --fix`, `simplify`, `review-polish`. Not auto-invoked. | +| `release-notes` | Drafting the GitHub release notes for an alpha.1 / beta.1 prerelease from the diff since the last stable tag. | --- From c773f380c729265a24a7e965607fcbaeb7497a0f Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi <contact@me.gantoine.com> Date: Fri, 11 Sep 2026 14:00:18 -0400 Subject: [PATCH 2/4] chore: address review feedback on the release-notes skill Resolve the range against the drafted tag: pick the stable tag immediately below the release line rather than the newest one, and point the head at an already-tagged prerelease instead of master. Treat the config and endpoint greps as an index, since a wrapped decorator or _get_env call only matches on the line that changed, and read the full hunks. State the promote-or-list rule the published notes actually follow: a PR lifted into Highlights loses its bullet, so the completeness check counts it once across both. Fix the patch-release shortcut in the template, which pointed at the wrong two sections and dropped the change list, and silence the markdownlint rules the skeleton exists to violate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --- .claude/skills/release-notes/SKILL.md | 44 +++++++++++++++++++----- .claude/skills/release-notes/template.md | 14 ++++++-- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/.claude/skills/release-notes/SKILL.md b/.claude/skills/release-notes/SKILL.md index 7de901107..577c7ecfd 100644 --- a/.claude/skills/release-notes/SKILL.md +++ b/.claude/skills/release-notes/SKILL.md @@ -27,16 +27,28 @@ The base is always **the last stable tag**, never the preceding prerelease. A the beta is a superset of the alpha rather than a delta on top of it. ```bash -TAG=5.3.0-alpha.1 # what you are drafting +TAG=5.3.0-alpha.1 # what you are drafting +LINE=${TAG%%-*} # 5.3.0, the stable version this line becomes git fetch origin master --tags -# last stable tag: numeric tags only (the legacy v-prefixed ones sort wrong), -# no -alpha/-beta suffix, highest version -BASE=$(git tag --list '[0-9]*' | grep -vE -- '-(alpha|beta|rc)' | sort -V | tail -1) -RANGE="$BASE..origin/master" + +# the stable tag immediately below $LINE. Numeric tags only, since the legacy +# v-prefixed ones sort above them, and sort -V rather than --sort=v:refname +BASE=$(git tag --list '[0-9]*' | grep -vE -- '-(alpha|beta|rc)' | grep -vFx "$LINE" \ + | { cat; echo "$LINE"; } | sort -V | grep -B1 -Fx "$LINE" | head -1) + +# an already-tagged prerelease is drafted against its tag, not against master, +# or the draft picks up everything merged since it shipped +if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then HEAD_REF="$TAG"; else HEAD_REF=origin/master; fi + +RANGE="$BASE..$HEAD_REF" git rev-list --count $RANGE git diff --stat $RANGE | tail -20 ``` +Sanity-check the pair before going further. `$BASE` should equal the tag in the +previous release's compare link, and if `$LINE` is already tagged stable while +`$TAG` is not, then `$TAG` is wrong: stop and confirm the version. + ## 2. Pull the raw material The autogenerated list is the spine. Its **order is merge order, keep it** when @@ -48,7 +60,11 @@ gh api repos/rommapp/romm/releases/generate-notes \ -f tag_name="$TAG" -f previous_tag_name="$BASE" --jq '.body' > /tmp/raw-notes.md ``` -Then run the sweeps that find what the PR titles do not say: +Then run the sweeps that find what the PR titles do not say. They are an index, +not an answer: a `@protected_route(...)` or `_get_env(...)` call wrapped across +lines matches only on the line that actually changed, so a moved path or a new +default can surface as a bare `+@protected_route(`. Read the full hunks of every +file a sweep touches before writing the tables. ```bash # new or changed env vars @@ -63,6 +79,11 @@ git diff --name-status $RANGE -- backend/alembic/versions/ git diff $RANGE -- backend/config/config_manager.py | grep -E '^[+-].*(class |: )' | head -40 ``` +```bash +# the sweeps only point at files, so read what actually changed inside them +git diff $RANGE -- backend/endpoints/ backend/config/ +``` + For each candidate Highlight, read the PR itself rather than paraphrasing its title: `gh pr view <n> --json title,body,author`. The prose in the notes is usually a compression of the PR description. @@ -97,7 +118,8 @@ subsystem, a new metadata source, a new UI surface, a new export format. Format: - One or two short paragraphs, second person, present tense. Say what it does, then the one thing the reader has to know to use it (the config key, the setting, the caveat). Name real keys and paths in backticks. -- End the first paragraph with the bare PR reference: ` #3211`. Bare `#NNNN` in +- End the first paragraph with a space and the bare PR reference, `#3211`. Bare + `#NNNN` in prose, full URLs only in the bullet lists. - Add a fenced `yaml` block when a config key drives the feature. - Leave a `<!-- screenshot: ... -->` placeholder for anything visual. Do not @@ -109,7 +131,10 @@ only the title, in place: give it a conventional-commit prefix and scope if it lacks one (`Skip DMCA-locked grids when scraping SteamGridDB` becomes `fix: Skip DMCA-locked grids when scraping SteamGridDB`), and lowercase a shouty one. Never drop a PR, never merge two into one line, never reorder across -sections. A PR that is both a highlight and a `feat:` appears in both. +sections. Promoting a PR to a Highlight **removes** its bullet: every published +release does this, so `5.1.0-beta.1` lists neither #3211 nor #3854 under Minor +changes, and #3155 left the `4.9.0-alpha.1` bullets once the beta gave it a +Highlight. Promote or list, never both. `build(deps):` and `dependabot[bot]` lines always land in Other changes, never in Fixes, even when the bump closes a CVE. Call the CVE out in a callout instead @@ -139,7 +164,8 @@ for a new endpoint group. Prefix a breaking entry with `⚠️`. ## 6. Before handing it over -- Every PR in `/tmp/raw-notes.md` appears exactly once in a bullet section. +- Every PR in `/tmp/raw-notes.md` is accounted for exactly once, either as a + Highlight or as a bullet, never both and never dropped. - Every `#NNNN` in the Highlights resolves to a PR in the range. - Every new env var found in step 2 is documented, and every route change too. - A migration in the range means you have checked whether it needs a warning. diff --git a/.claude/skills/release-notes/template.md b/.claude/skills/release-notes/template.md index 0b4a1b95d..24426daee 100644 --- a/.claude/skills/release-notes/template.md +++ b/.claude/skills/release-notes/template.md @@ -1,7 +1,17 @@ +<!-- trunk-ignore-all(markdownlint/MD041) --> +<!-- trunk-ignore-all(markdownlint/MD033) --> +<!-- trunk-ignore-all(markdownlint/MD034) --> +<!-- trunk-ignore-all(markdownlint/MD024) --> + <!-- Skeleton for a RomM alpha.1 / beta.1 release note. Drop any section that has no -content. A patch prerelease with no feat: work uses only the last two sections, -under a single `## What's Changed` heading. +content. Inline HTML and bare URLs are deliberate here: GitHub renders the notes, +and the bullet lines are copied verbatim out of the autogenerated body. + +A patch prerelease under roughly eight PRs with no feat: work replaces everything +from the callouts down to Other changes with a single flat `## What's Changed` +list carrying every autogenerated bullet, then keeps New Contributors and the +changelog link. --> > [!WARNING] From 0d05e2d1416cdeed752bc0493c7b0d60adeeef48 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi <contact@me.gantoine.com> Date: Fri, 11 Sep 2026 14:09:06 -0400 Subject: [PATCH 3/4] chore: rename the skill to prerelease-notes Claude Code ships a built-in release-notes skill, so the repo one needs a distinct name. Narrow the description to the alpha/beta prerelease case it actually covers, so the two do not compete for the same phrasing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --- .claude/skills/{release-notes => prerelease-notes}/SKILL.md | 6 +++--- .../skills/{release-notes => prerelease-notes}/template.md | 0 CLAUDE.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename .claude/skills/{release-notes => prerelease-notes}/SKILL.md (94%) rename .claude/skills/{release-notes => prerelease-notes}/template.md (100%) diff --git a/.claude/skills/release-notes/SKILL.md b/.claude/skills/prerelease-notes/SKILL.md similarity index 94% rename from .claude/skills/release-notes/SKILL.md rename to .claude/skills/prerelease-notes/SKILL.md index 577c7ecfd..4c210b5f3 100644 --- a/.claude/skills/release-notes/SKILL.md +++ b/.claude/skills/prerelease-notes/SKILL.md @@ -1,7 +1,7 @@ --- -name: release-notes -description: Draft the GitHub release notes for a RomM alpha.1 or beta.1 prerelease from the diff since the last stable tag. Use when asked to "write the release notes", "draft the 5.3.0-alpha.1 notes", "what goes in the beta notes", or to refresh a draft after more PRs land. Produces the house format (callouts, Highlights, Minor changes, Fixes, Other changes, API changes, New Contributors) and never publishes. -argument-hint: "[tag to draft, e.g. 5.2.0-alpha.1 | nothing to infer it]" +name: prerelease-notes +description: Draft the GitHub release notes for a RomM alpha.1 or beta.1 prerelease from the diff since the last stable tag, in the house format the published RomM releases use. Use when asked to "draft the 5.3.0-alpha.1 notes", "write the prerelease notes", "what goes in the beta notes", or to refresh a draft after more PRs land. Produces callouts, Highlights, Minor changes, Fixes, Other changes, API changes and New Contributors, and never publishes. +argument-hint: "[tag to draft, e.g. 5.3.0-alpha.1 | nothing to infer it]" --- # Drafting alpha/beta release notes diff --git a/.claude/skills/release-notes/template.md b/.claude/skills/prerelease-notes/template.md similarity index 100% rename from .claude/skills/release-notes/template.md rename to .claude/skills/prerelease-notes/template.md diff --git a/CLAUDE.md b/CLAUDE.md index cb7c2e3ae..ceb345917 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -50,7 +50,7 @@ These live in `.claude/skills/` and carry the detailed rules. Invoke the one tha | `review-polish` | Before committing / opening a PR / declaring done - the self-review pass (comments, duplication, naming, test typing) plus the checks that keep CI green. | | `security-audit` | Vetting a diff (release tag range or PR) for anything malicious or a security regression - supply chain, egress, auth/injection, CI, provenance. | | `pr-ready` | Before opening a PR - the four passes in order: `security-audit`, `code-review xhigh --fix`, `simplify`, `review-polish`. Not auto-invoked. | -| `release-notes` | Drafting the GitHub release notes for an alpha.1 / beta.1 prerelease from the diff since the last stable tag. | +| `prerelease-notes` | Drafting the GitHub release notes for an alpha.1 / beta.1 prerelease from the diff since the last stable tag. | --- From 5ab569a4e71f825c4e26748fc3d1b21e64db01f8 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi <contact@me.gantoine.com> Date: Fri, 11 Sep 2026 14:17:56 -0400 Subject: [PATCH 4/4] chore: rename to draft-release-notes and cover stable releases A stable release's notes are the same document as the last full prerelease on its line, regenerated over a range that grew against the same base, so the range resolution already handled a stable tag. What the skill was missing is what changes between the two. Split the shape decision out first, since the tag alone decides it: every .1 prerelease and every feature-carrying stable gets the full treatment, while later prereleases on a line and patch releases get a flat What's Changed. Record the two things a stable does differently. Highlights are re-curated rather than carried over, as 5.0.0 did against its beta. The API table belongs to the prerelease that opened the line and the stable drops it, which is why 5.2.0 kept one and 5.1.0, 5.0.0, 4.9.0 and 4.8.0 did not. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --- .../SKILL.md | 113 +++++++++++++----- .../template.md | 18 +-- CLAUDE.md | 2 +- 3 files changed, 93 insertions(+), 40 deletions(-) rename .claude/skills/{prerelease-notes => draft-release-notes}/SKILL.md (58%) rename .claude/skills/{prerelease-notes => draft-release-notes}/template.md (76%) diff --git a/.claude/skills/prerelease-notes/SKILL.md b/.claude/skills/draft-release-notes/SKILL.md similarity index 58% rename from .claude/skills/prerelease-notes/SKILL.md rename to .claude/skills/draft-release-notes/SKILL.md index 4c210b5f3..c3b5be10a 100644 --- a/.claude/skills/prerelease-notes/SKILL.md +++ b/.claude/skills/draft-release-notes/SKILL.md @@ -1,34 +1,52 @@ --- -name: prerelease-notes -description: Draft the GitHub release notes for a RomM alpha.1 or beta.1 prerelease from the diff since the last stable tag, in the house format the published RomM releases use. Use when asked to "draft the 5.3.0-alpha.1 notes", "write the prerelease notes", "what goes in the beta notes", or to refresh a draft after more PRs land. Produces callouts, Highlights, Minor changes, Fixes, Other changes, API changes and New Contributors, and never publishes. -argument-hint: "[tag to draft, e.g. 5.3.0-alpha.1 | nothing to infer it]" +name: draft-release-notes +description: Draft the GitHub release notes for a RomM release, stable or alpha/beta prerelease, from the diff since the previous stable tag, in the house format the published RomM releases use. Use when asked to "draft the 5.3.0 notes", "write the release notes for the beta", "what goes in the 5.3.0-alpha.1 notes", or to refresh a draft after more PRs land. Produces callouts, Highlights, Minor changes, Fixes, Other changes, API changes and New Contributors, and never publishes. +argument-hint: "[tag to draft, e.g. 5.3.0 or 5.3.0-alpha.1 | nothing to infer it]" --- -# Drafting alpha/beta release notes +# Drafting release notes -Turn a tag range into the notes RomM actually publishes. The GitHub autogenerated -list is raw material, not the deliverable: the published notes reorganize it into -sections, lift the few changes that matter into prose Highlights, and add the -callouts an upgrader needs before they pull the image. +Turn a tag range into the notes RomM actually publishes, for a stable release or +for an alpha/beta prerelease. The GitHub autogenerated list is raw material, not +the deliverable: the published notes reorganize it into sections, lift the few +changes that matter into prose Highlights, and add the callouts an upgrader needs +before they pull the image. Output a markdown file and print it. **Never** run `gh release create` or `gh release edit`. Publishing is the maintainer's call. --- -## 1. Resolve the range +## 1. Pick the shape + +Two documents exist, and the tag decides which one you are writing. + +| Tag | Document | +| --------------------------------------------------- | ------------------------------------- | +| `X.Y.Z`, `X.Y.Z-alpha.1`, `X.Y.Z-beta.1` | the full treatment, sections 3 onward | +| `X.Y.Z-alpha.2` and later, `X.Y.Z-beta.2` and later | flat `## What's Changed` | +| a stable patch with no `feat:` work | flat `## What's Changed` | + +This is what the history does without exception: every `.1` prerelease and every +feature-carrying stable gets Highlights and partitioned bullets, while every +later prerelease in the same line is a plain list of what landed since. The flat +shape is just the autogenerated body with `## New Contributors` and the compare +link kept, so for those tags steps 4 through 6 do not apply. + +## 2. Resolve the range `$ARGUMENTS` is the tag being drafted. If it is empty, infer it: take the last stable tag, bump minor for a range containing `feat:` work or patch otherwise, and say which you picked so it can be corrected. -The base is always **the last stable tag**, never the preceding prerelease. A -`5.1.0-beta.1` is drafted against `5.0.0`, the same base its own alpha used, so -the beta is a superset of the alpha rather than a delta on top of it. +The base is **the stable tag below the release line**, for a stable release and a +prerelease alike, so a whole line accumulates against one base. `5.1.0-alpha.1`, +`5.1.0-beta.1` and `5.1.0` all compare against `5.0.0`, which makes each document +a superset of the one before it rather than a delta on top of it. ```bash -TAG=5.3.0-alpha.1 # what you are drafting -LINE=${TAG%%-*} # 5.3.0, the stable version this line becomes +TAG=5.3.0-alpha.1 # what you are drafting, stable or prerelease +LINE=${TAG%%-*} # 5.3.0, the stable version of this line git fetch origin master --tags # the stable tag immediately below $LINE. Numeric tags only, since the legacy @@ -46,10 +64,11 @@ git diff --stat $RANGE | tail -20 ``` Sanity-check the pair before going further. `$BASE` should equal the tag in the -previous release's compare link, and if `$LINE` is already tagged stable while -`$TAG` is not, then `$TAG` is wrong: stop and confirm the version. +previous release's compare link. If `$TAG` is a prerelease and `$LINE` is already +tagged stable, the line has shipped and `$TAG` is wrong: stop and confirm the +version. -## 2. Pull the raw material +## 3. Pull the raw material The autogenerated list is the spine. Its **order is merge order, keep it** when you partition lines into sections, and keep each line's `by @user in <url>` tail @@ -88,7 +107,7 @@ For each candidate Highlight, read the PR itself rather than paraphrasing its title: `gh pr view <n> --json title,body,author`. The prose in the notes is usually a compression of the PR description. -## 3. Assemble the document +## 4. Assemble the document Follow `template.md` in this skill directory for the exact skeleton. Sections in this order, all optional except the last two: @@ -104,11 +123,15 @@ this order, all optional except the last two: | `## New Contributors` | verbatim from the autogenerated body | | `**Full Changelog**` | verbatim from the autogenerated body | -**Small patch prereleases skip all of it.** Under roughly eight PRs with no -`feat:`, publish a single flat `## What's Changed` list plus the changelog link, -the way `4.9.1-beta.1` did. Do not manufacture Highlights for a bugfix release. +Which of the two optional tables you carry depends on the line, not on whether +the tag is stable. See section 6. -## 4. Section rules +**A patch release skips all of it**, stable or prerelease. Under roughly eight +PRs with no `feat:`, publish a single flat `## What's Changed` list plus the +changelog link, the way `4.9.1-beta.1` and `4.9.1` both did. Do not manufacture +Highlights for a bugfix release. + +## 5. Section rules **Highlights.** Three to eight for a minor line, zero for a patch line. A change earns one only if it changes what a user can do or how they run RomM: a new @@ -150,26 +173,52 @@ Env vars go in a table with `variable | default | description`; API changes in a table with `Change | Description` for edits, and `Method | Path | Description` for a new endpoint group. Prefix a breaking entry with `⚠️`. -## 5. alpha.1 versus beta.1 +## 6. Prerelease versus stable + +The three documents on a line are the same document, regenerated over a range +that keeps growing against a fixed base. Each one starts as its predecessor, not +as a blank page, so open the previous one's body and edit that: + +```bash +# the release before $TAG on this line: its alpha.1, or its last full beta +gh release view 5.1.0-beta.1 --json body --jq .body +``` - **alpha.1** opens the line. Put the env var and API tables in one `> [!NOTE]` block at the top, where the third-party app developers reading the alpha will see them first. -- **beta.1** regenerates over the same base, so it is the alpha's notes plus - everything merged since. Carry the alpha's Highlights across verbatim unless - the feature changed, add the new ones, and fold in any warning that alpha - feedback produced. Once the API table runs past roughly fifteen rows, move it - to the bottom inside `<details><summary><h2>API changes</h2></summary>`, since - by the beta most readers are upgraders rather than integrators. +- **beta.1** is the alpha's notes plus everything merged since. Carry the alpha's + Highlights across verbatim unless the feature changed, add the new ones, and + fold in any warning that alpha feedback produced. Once the API table runs past + roughly fifteen rows, move it to the bottom inside + `<details><summary><h2>API changes</h2></summary>`, since by the beta most + readers are upgraders rather than integrators. +- **the stable release** is the last full-treatment prerelease's notes plus + everything merged during the beta. Two things change: -## 6. Before handing it over + **Re-curate the Highlights.** They are not carried over untouched. Going from + `5.0.0-beta.1` to `5.0.0`, four were added (CRT mode, server-side ROM patching, + the permission system, the music player), three were dropped, and three were + renamed, "A brand-new frontend" becoming "UI overhaul". Pick what the finished + release is about, not what the beta was about. + + **Drop the tables a prerelease already published.** The API table is for the + developers tracking the line, and they read it in the alpha. `5.1.0`, `5.0.0`, + `4.9.0` and `4.8.0` all dropped theirs; `5.2.0` kept one only because its line + shipped no prerelease that carried it. Keep the env var table when it grew + during the beta, as `5.1.0` did going from three variables to seven, since a + reader upgrading straight from the last stable has seen none of them. + +## 7. Before handing it over - Every PR in `/tmp/raw-notes.md` is accounted for exactly once, either as a Highlight or as a bullet, never both and never dropped. - Every `#NNNN` in the Highlights resolves to a PR in the range. -- Every new env var found in step 2 is documented, and every route change too. +- Every new env var found in step 3 is documented, and every route change too. - A migration in the range means you have checked whether it needs a warning. -- The `**Full Changelog**` compare link ends in the tag you are drafting. +- The `**Full Changelog**` compare link ends in the tag you are drafting. Editing + a prerelease's body into a stable one makes this easy to miss: `4.9.0` shipped + pointing at `4.8.1...4.9.0-beta.1`. - No em-dashes, no invented screenshot URLs, no marketing claims the diff does not support. diff --git a/.claude/skills/prerelease-notes/template.md b/.claude/skills/draft-release-notes/template.md similarity index 76% rename from .claude/skills/prerelease-notes/template.md rename to .claude/skills/draft-release-notes/template.md index 24426daee..bb898f518 100644 --- a/.claude/skills/prerelease-notes/template.md +++ b/.claude/skills/draft-release-notes/template.md @@ -4,14 +4,18 @@ <!-- trunk-ignore-all(markdownlint/MD024) --> <!-- -Skeleton for a RomM alpha.1 / beta.1 release note. Drop any section that has no -content. Inline HTML and bare URLs are deliberate here: GitHub renders the notes, -and the bullet lines are copied verbatim out of the autogenerated body. +Skeleton for a RomM release note, stable or alpha.1 / beta.1 prerelease. Drop any +section that has no content. Inline HTML and bare URLs are deliberate here: +GitHub renders the notes, and the bullet lines are copied verbatim out of the +autogenerated body. -A patch prerelease under roughly eight PRs with no feat: work replaces everything -from the callouts down to Other changes with a single flat `## What's Changed` -list carrying every autogenerated bullet, then keeps New Contributors and the -changelog link. +The API changes table belongs to the prerelease that opens the line. A stable +release drops it, unless the line shipped no prerelease carrying one. + +A release under roughly eight PRs with no feat: work, and every prerelease after +the first on its line, replaces everything from the callouts down to Other +changes with a single flat `## What's Changed` list carrying every autogenerated +bullet, then keeps New Contributors and the changelog link. --> > [!WARNING] diff --git a/CLAUDE.md b/CLAUDE.md index ceb345917..faceaf031 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -50,7 +50,7 @@ These live in `.claude/skills/` and carry the detailed rules. Invoke the one tha | `review-polish` | Before committing / opening a PR / declaring done - the self-review pass (comments, duplication, naming, test typing) plus the checks that keep CI green. | | `security-audit` | Vetting a diff (release tag range or PR) for anything malicious or a security regression - supply chain, egress, auth/injection, CI, provenance. | | `pr-ready` | Before opening a PR - the four passes in order: `security-audit`, `code-review xhigh --fix`, `simplify`, `review-polish`. Not auto-invoked. | -| `prerelease-notes` | Drafting the GitHub release notes for an alpha.1 / beta.1 prerelease from the diff since the last stable tag. | +| `draft-release-notes` | Drafting the GitHub release notes for a release, stable or alpha/beta, from the diff since the previous stable tag. | ---