Skip to content

Commit 6926fe1

Browse files
authored
fix: stabilize release changelog generation (anomalyco#19987)
1 parent ee018d5 commit 6926fe1

File tree

4 files changed

+212
-234
lines changed

4 files changed

+212
-234
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ target
2525

2626
# Local dev files
2727
opencode-dev
28+
UPCOMING_CHANGELOG.md
2829
logs/
2930
*.bun-build
3031
tsconfig.tsbuildinfo

.opencode/command/changelog.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,43 @@
22
model: opencode/kimi-k2.5
33
---
44

5-
create UPCOMING_CHANGELOG.md
6-
7-
it should have sections
8-
9-
```
10-
## TUI
11-
12-
## Desktop
13-
14-
## Core
15-
16-
## Misc
17-
```
18-
19-
fetch the latest github release for this repository to determine the last release version.
20-
21-
find each PR that was merged since the last release
22-
23-
for each PR spawn a subagent to summarize what the PR was about. focus on user facing changes. if it was entirely internal or code related you can ignore it. also skip docs updates. each subagent should append its summary to UPCOMING_CHANGELOG.md into the appropriate section.
5+
Create `UPCOMING_CHANGELOG.md` from the structured changelog input below.
6+
If `UPCOMING_CHANGELOG.md` already exists, ignore its current contents completely.
7+
Do not preserve, merge, or reuse text from the existing file.
8+
9+
Any command arguments are passed directly to `bun script/changelog.ts`.
10+
Use `--from` / `-f` and `--to` / `-t` to preview a specific release range.
11+
12+
The input already contains the exact commit range since the last non-draft release.
13+
The commits are already filtered to the release-relevant packages and grouped into
14+
the release sections. Do not fetch GitHub releases, PRs, or build your own commit list.
15+
The input may also include a `## Community Contributors Input` section.
16+
17+
Before writing any entry you keep, inspect the real diff with
18+
`git show --stat --format='' <hash>` or `git show --format='' <hash>` so the
19+
summary reflects the actual user-facing change and not just the commit message.
20+
Do not use `git log` or author metadata when deciding attribution.
21+
22+
Rules:
23+
24+
- Write the final file with sections in this order:
25+
`## Core`, `## TUI`, `## Desktop`, `## SDK`, `## Extensions`
26+
- Only include sections that have at least one notable entry
27+
- Keep one bullet per commit you keep
28+
- Skip commits that are entirely internal, CI, tests, refactors, or otherwise not user-facing
29+
- Start each bullet with a capital letter
30+
- Prefer what changed for users over what code changed internally
31+
- Do not copy raw commit prefixes like `fix:` or `feat:` or trailing PR numbers like `(#123)`
32+
- Community attribution is deterministic: only preserve an existing `(@username)` suffix from the changelog input
33+
- If an input bullet has no `(@username)` suffix, do not add one
34+
- Never add a new `(@username)` suffix from `git show`, commit authors, names, or email addresses
35+
- If no notable entries remain and there is no contributor block, write exactly `No notable changes.`
36+
- If no notable entries remain but there is a contributor block, omit all release sections and return only the contributor block
37+
- If the input contains `## Community Contributors Input`, append the block below that heading to the end of the final file verbatim
38+
- Do not add, remove, rewrite, or reorder contributor names or commit titles in that block
39+
- Do not derive the thank-you section from the main summary bullets
40+
- Do not include the heading `## Community Contributors Input` in the final file
41+
42+
## Changelog Input
43+
44+
!`bun script/changelog.ts $ARGUMENTS`

0 commit comments

Comments
 (0)