Commit 22a15fd7 authored by devjiwonchoi's avatar devjiwonchoi

Replace generate-release-log script with agent skill

Replace the old GitHub API-based script with a git-based agent skill
that captures every commit between canary tags. Includes eval snapshots
for 3 tag ranges to validate categorization consistency.
parent 78937ee5
---
name: generate-release-log
description: >
Generate a release changelog from git log between two tags. Use when the user
asks to generate release notes, changelog, or release log for a Next.js version.
user-invocable: true
argument-hint: 'git tag or from-to range, e.g. "v16.2.0-canary.0" or "from 16.1.0 to 16.2.0"'
allowed-tools: [Bash, Grep, Read, Write]
---
# Generate Release Log
Generate a changelog from git history between two canary tags.
## Usage
- `/generate-release-log` — ask the user for from-tag and to-tag
- `/generate-release-log v16.2.1-canary.0` — generate log for this tag (auto-finds previous tag)
- `/generate-release-log v16.2.0-canary.0 v16.2.0-canary.103` — explicit range
## Determine range
Ensure full history and tags:
```bash
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then git fetch --unshallow; fi
git fetch --tags
git fetch origin canary
```
**No args:** Ask the user for the from-tag and to-tag before proceeding.
Normalize all tag args: prepend `v` if missing (e.g., `16.2.0-canary.10` → `v16.2.0-canary.10`).
**1 arg (to-tag):** Auto-detect from-tag, then **ask the user to confirm** before proceeding.
- **Prerelease to-tag** (contains `-`): find the previous tag (any) on canary:
```bash
prev=$(git describe --tags --abbrev=0 <to-tag>^)
while ! git merge-base --is-ancestor "$prev" origin/canary 2>/dev/null; do
prev=$(git describe --tags --abbrev=0 "$prev^")
done
```
- **Stable to-tag** (no `-`): find the previous **stable** tag on canary (skip canary/prerelease tags):
```bash
prev=$(git describe --tags --abbrev=0 <to-tag>^)
while echo "$prev" | grep -q '-' || ! git merge-base --is-ancestor "$prev" origin/canary 2>/dev/null; do
prev=$(git describe --tags --abbrev=0 "$prev^")
done
```
After detecting, ask: "Detected range: `<from-tag>` → `<to-tag>`. Proceed?" Wait for user confirmation before generating. If the user says no, ask them for the explicit from-tag and to-tag again.
**2 args:** Use as-is.
Validate both tags exist with `git tag -l <tag>`. Stop if missing.
## Collect and parse commits
```bash
git log --first-parent --reverse --format='%s|||%aE' <from>..<to>
```
Filter out version bump commits matching `^v\d+\.\d+\.\d+(-[a-z]+\.\d+)?$` (prerelease e.g. canary, rc, etc.). If zero commits remain, report empty range and stop.
Extract from each line: **title** (strip `(#NNNNN)` suffix), **PR number** from that suffix.
## Categorize (first-match-wins)
| Category | Rules |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Documentation** | Starts with `docs:`, `docs(`, `doc:`, `Docs:`, `Docs `, `[Docs]`, `[docs]`, `Guide:`, `CC Guide`; or subject is primarily documentation |
| **Examples** | Starts with `fix(examples)`, `chore(examples)`, `example:`, `examples:`; or subject involves example apps |
| **Core** | Clearly changes Next.js or Turbopack functionality: bug fixes, new APIs/features, config, server/build/rendering/routing/caching, security fixes, Turbopack bundler changes. `Turbopack:` and `[turbopack]` prefixes go here unless they matched Docs/Examples first. |
| **Misc** | Everything else (default). Includes `ci:`, `test:`, `chore:`, `bench:`, `perf(` prefixes; `Upgrade React`, `[react-sync]`, `Deflake`/`Unflake`, `Update Rspack`, `Update font data`, `chore(deps):`, `AGENTS.md`; and any commit whose category is uncertain. |
## Resolve credits
Extract GitHub usernames from author emails:
1. **Noreply:** `ID+username@users.noreply.github.com` or `username@users.noreply.github.com` → extract `username`
2. **Non-noreply:** One `gh api repos/vercel/next.js/pulls/NNNNN --jq '.user.login'` call per unique email, using any PR from that author.
Deduplicate by resolved GitHub username.
## Format and write
Sections in order, chronological within each (oldest first). Omit empty sections. Write to `release-<version>.txt` in repo root (e.g., `release-16.2.0.txt`).
```
### Core Changes
- Title: #NNNNN
...
### Documentation Changes
- Title: #NNNNN
...
### Example Changes
- Title: #NNNNN
...
### Misc Changes
- Title: #NNNNN
...
### Credits
Huge thanks to @user1, @user2, ..., and @userN for helping!
```
## Eval tests
See [`evals/README.md`](evals/README.md) for how to run eval tests for this skill.
# Eval Tests
Each subdirectory contains a test case with:
- `PROMPT.md` — the prompt to invoke the skill
- `EVAL.md` — the expected output
## Running
Create a team of agents to run all test cases in parallel — one agent per subdirectory. Each agent should:
1. Execute the skill workflow for the prompt in `PROMPT.md`
2. Diff the generated `release-*.txt` against `EVAL.md` — they should match
### Core Changes
- fix: preserve cache behavior for PPR fallback shells with root params: #88556
- Turbopack: Use a real file entrypoint for Workers (and SharedWorkers): #88602
- Turbopack: Various cleanup for turbo-tasks-fs, mostly retry logic and string formatting: #88668
- Turbopack: Tweak retry loop for link creation to try to fix os error 80 on Windows: #88669
- feat: Replace InnerStorage with the generated TaskStorage struct: #88355
- Turbopack: Use webpki-root-certs in addition to rustls-platform-verifier on Linux for bare-bones Linux images without root CA stores: #88869
- refactor: migrate to typed accessors and remove CachedDataItem adapter: #88397
- stabilize browser log forward options: #88857
- [devtools] Wrap long file names of stack frames in the error overlay: #88886
- [devtools] Fix notch coloring of error overlay in forced colors mode: #88892
- Turbopack: query conditions in rules follow-ups: #88801
- Create-next-app update message: #88706
- Turbopack: Fix next/font preloading for page.mdx: #88848
- Remove `deploymentId` from App Router `RenderOptsPartial`: #88866
- feat: implement LRU cache with invocation ID scoping for minimal mode response cache: #88509
- [prebuilt-skew-protection] feat: adding in automatic deploymentId: #88496
- [devtool] Add hydration diff indicator for diff lines: #88919
- Turbopack: refactor data storage to avoid reverse task cache: #88492
- Turbopack: change invalidator and immutable to data category: #88889
- Turbopack: reduce cache size: #88929
- Turbopack: improve module type error message: #88815
- Turbopack: improve selective read support to allow `Equivalent` keys: #88760
- Turbopack: add indirection layer for better caching during resolving: #80062
- Revert "[prebuilt-skew-protection] feat: adding in automatic deploymentId": #88942
- Turbopack: add `?dpl=` to all asset urls returned by Turbopack: #88828
- feat(next-codemod): add agents-md command for AI coding agents: #88961
- [Reapply] Add `useEffectEvent` to disallowed React APIs in Server Components: #88985
- Apply fixes for onBuildComplete and route module: #88831
- Rename `renderOpts.nextExport` to `isBuildTimePrerendering`: #88951
- Turbopack: remove Asset supertrait from Module trait. Modules don't have content: #86416
- Fix react-loadable-manifest chunk hash mismatch by preserving async loader mapping: #88775
- refactor: consume global-error from loader tree: #88437
- Fix chunk loading when using `__turbopack_load_by_url__` with query: #88899
- [mcp] change the mcp endpoint response to JSON: #88911
- Reapply "[turbopack] Add bundling support for worker_threads" (#88725): #88967
- fix: ensure LRU cache items have minimum size of 1 to prevent unbounded growth: #89040
- Use null-prototype objects in server actions manifests: #89069
- Re-enable types-and-precompiled: #89070
### Documentation Changes
- docs: add skill for updating Next.js documentation: #88656
- Docs: Add Next.js Glossary: #88811
- docs: Server functions rename: #86827
- docs: Update Partytown URLs and package reference: #88928
- docs: improve clarity in cache components and server/client docs: #88946
- docs: revalidatePath w/ rewrites and trailing slash: #88956
- docs: fix typos in `README.md`s: #89022
- Cache Component Guide: Building public, _mostly_ static pages: #87248
### Misc Changes
- Turbopack: Add file write invalidation tracking to filesystem watcher fuzzing: #88665
- Turbopack: Move fuzzer for fs watcher into a separate file/module: #88666
- Upgrade React from `d2908752-20260119` to `b546603b-20260121`: #88860
- Turbopack: Add a stress test / fuzzer that tries creating many symlinks in a tight loop: #88667
- Turbopack: Make the priority_runner testcase deterministic: #88651
- Turbopack: [chore] Fix Rust check warnings: #88871
- Update Rspack production test manifest: #88882
- [test] Skip failing deploy test in `searchparams-reuse-loading.test.ts`: #88821
- [test] Skip flaky `prefetch-runtime` tests for deploy tests: #88826
- remove gt workflow from agents.md: #88918
- fix typo: #88934
- Add Graphite workflow Cursor command: #88939
- [turbopack] add task type infromation to the print_cache_item_size feature: #88925
- Upgrade React from `b546603b-20260121` to `24d8716e-20260123`: #88963
- Update Rspack production test manifest: #88930
- Update Rspack development test manifest: #88931
- Improve performance and token usage of `/ci-failures` command: #88960
- Update font data: #88975
- Improve agents-md prompt to force doc retrieval: #88997
- [Turbopack] Use a presized scratch buffer for task encoding: #88924
- Update Rspack development test manifest: #89004
- Update Rspack production test manifest: #89003
- [test] Improve deployment skew test for Pages Router data routes: #89038
- Upgrade React from `24d8716e-20260123` to `8c34556c-20260126`: #89066
- Fix reset deploy project script: #89001
### Credits
Huge thanks to @bgw, @brookemosby, @dango0812, @delbaoliveira, @eps1lon, @gaojude, @hanzala-sohrab, @huozhi, @icyJoseph, @ijjk, @lukesandberg, @mischnic, @mmastrac, @msmx-mnakagawa, @sokra, @timneutkens, @unstubbable, @wyattjoh, and @ztanner for helping!
/generate-release-log from 16.2.0-canary.0 to 16.2.0-canary.10
This diff is collapsed.
### Core Changes
- Update vendored lodash to 4.17.23 to fix CVE-2025-13465: #91558
- Fix invalid HTML response for route-level RSC requests in deployment adapter: #91541
- Normalize encoded dynamic placeholders in app routes: #91603
### Credits
Huge thanks to @denesbeck, @ijjk, and @ztanner for helping!
### Core Changes
- Add eval and docs for unstable_instant: #91334
- Turboopack: put import attributes behind a pointer, 23% faster analyze: #91347
- Turbopack: `require(/* turbopackChunkingType: parallel */`: #91278
- Simplify scroll restoration with shared ScrollRef on CacheNode: #91348
- Turbopack: use keyed cell access for AsyncModulesInfo: #91305
- Enable thin LTO for release builds: #91343
- [turbopack] const-ify most of the registration code: #90868
### Misc Changes
- disable sub shell generation test outside of adapter: #91353
### Credits
Huge thanks to @acdlite, @gaojude, @mischnic, @mmastrac, @sokra, and @ztanner for helping!
Generate the release log for Next.js 16.2.0-canary.99
// @ts-check
import fetch from 'node-fetch'
export async function main() {
const releasesArray = await fetch(
'https://api.github.com/repos/vercel/next.js/releases?per_page=100'
).then((r) => r.json())
const allReleases = releasesArray
.map(({ id, tag_name, created_at, body }) => ({
id,
tag_name,
created_at,
body: body
.replace(/\r\n/g, '\n')
.split('\n')
.map((e) => e.trim()),
}))
.sort((a, b) => a.created_at.localeCompare(b.created_at))
// targetVersion format is `13.4.15-`, generating changes for all 13.4.15-* canary releases
const targetVersion = /v(.*?-)/
.exec(allReleases.filter((e) => /v.*?-/.exec(e.tag_name)).pop().tag_name)
.pop()
const releases = allReleases.filter((v) => v.tag_name.includes(targetVersion))
const lineItems = {
'### Core Changes': [],
'### Minor Changes': [],
'### Documentation Changes': [],
'### Example Changes': [],
'### Misc Changes': [],
'### Patches': [],
'### Credits': [],
}
Object.keys(lineItems).forEach((header) => {
releases.forEach((release) => {
const headerIndex = release.body.indexOf(header)
if (!~headerIndex) return
let headerLastIndex = release.body
.slice(headerIndex + 1)
.findIndex((v) => v.startsWith('###'))
if (~headerLastIndex) {
headerLastIndex = headerLastIndex + headerIndex
} else {
headerLastIndex = release.body.length - 1
}
if (header === '### Credits') {
release.body.slice(headerIndex, headerLastIndex + 1).forEach((e) => {
const re = /@[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}/gi
let m
do {
m = re.exec(e)
if (m) {
lineItems[header].push(m.pop())
}
} while (m)
})
} else {
release.body.slice(headerIndex, headerLastIndex + 1).forEach((e) => {
if (!e.startsWith('-')) {
return
}
lineItems[header].push(e)
})
}
})
})
let finalMessage = []
Object.keys(lineItems).forEach((header) => {
let items = lineItems[header]
if (!items.length) {
return
}
finalMessage.push(header)
finalMessage.push('')
if (header === '### Credits') {
items = [...new Set(items)]
let creditsMessage = `Huge thanks to `
if (items.length > 1) {
creditsMessage += items.slice(0, items.length - 1).join(`, `)
creditsMessage += `, and `
}
creditsMessage += items[items.length - 1]
creditsMessage += ` for helping!`
finalMessage.push(creditsMessage)
} else {
items.forEach((e) => finalMessage.push(e))
}
finalMessage.push('')
})
return {
version: targetVersion.slice(0, -1),
firstVersion: releases[0].tag_name,
lastVersion: releases[releases.length - 1].tag_name,
content: finalMessage.join('\n'),
}
}
main().then((result) => {
console.log(result.content)
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment