Skip to content

The swiss army knife of lossless video/audio editing

Add AGENTS.md with Changelog trailer convention and release-notes script

Claudeb83984dcc929
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 00000000..2d0d576d
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,15 @@
+# Agent instructions
+
+## Commits
+
+If a commit changes user-visible behaviour (a fix, feature, or behaviour change a user would notice), add a `Changelog:` trailer to the commit message, describing the impact for users in one line. Omit it for internal changes (refactors, tests, CI, dependency bumps).
+
+```
+Validate --settings-json with zod
+
+...
+
+Changelog: `--settings-json` is now validated; invalid input is logged and ignored instead of being written to the config
+```
+
+When preparing a release, run `yarn release-notes` to collect these since the last tag, and use them to write `versions/<version>.md` (shown in the app's What's New dialog) and the GitHub release notes.
diff --git a/package.json b/package.json
index fa735e3b..b2d09c01 100644
--- a/package.json
+++ b/package.json
@@ -31,6 +31,7 @@
"generate-icon": "mkdirp icon-build build-resources/appx && node script/generateIcon.ts",
"generate-licenses": "yarn licenses generate-disclaimer -R > licenses.txt && echo '\n\nffmpeg is licensed under GPL v2+:\n\nhttp://www.gnu.org/licenses/old-licenses/gpl-2.0.html' >> licenses.txt",
"generate-docs": "node script/generateDocs.ts",
+ "release-notes": "node script/releaseNotes.ts",
"check-licenses": "node script/checkLicenses.ts",
"upload-artifacts": "node script/uploadArtifacts.ts"
},
diff --git a/script/releaseNotes.ts b/script/releaseNotes.ts
new file mode 100644
index 00000000..ddd72f20
--- /dev/null
+++ b/script/releaseNotes.ts
@@ -0,0 +1,13 @@
+// Collects `Changelog:` commit trailers (see AGENTS.md) since the last tag, or since the ref given as argument.
+// Usage: yarn release-notes [from-ref]
+import { execFile } from 'node:child_process';
+import { promisify } from 'node:util';
+
+const git = async (...args: string[]) => (await promisify(execFile)('git', args)).stdout.trim();
+
+const from = process.argv[2] ?? await git('describe', '--tags', '--abbrev=0');
+
+const log = await git('log', '--reverse', '--format=%(trailers:key=Changelog,valueonly,unfold)', `${from}..HEAD`);
+
+console.log(`Changes since ${from}:\n`);
+log.split('\n').filter((line) => line.trim() !== '').forEach((line) => console.log(`- ${line.trim()}`));