diff --git a/.agents/skills/release/SKILL.md b/.agents/skills/release/SKILL.md deleted file mode 100644 index a11d5ca3e..000000000 --- a/.agents/skills/release/SKILL.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: release -description: Prepare the next npm release of plotkeeper as a Release PR, from what merged since the last tag. Runs only when Daniel types it. -disable-model-invocation: true ---- - -Daniel typed this, so he wants the next release prepared (spec #512; `docs/studio/development.md`, "Cutting a release"). You end at an open Release PR. Daniel merges it (through `/ship`) and starts the publish himself; you never publish, tag, or dispatch a workflow. - -## Steps - -1. **Since the tag.** `git fetch origin --tags`. The last release is the newest `v*` tag by version (`git tag --list 'v*' --sort=-v:refname | head -1`). When it prints nothing, no release is tagged: say "no `v*` tag on origin, so there is no release to start from (the tags are backfilled by #516)", and stop. List every commit since it: `git log --first-parent --format='%h %s' ..origin/main`. PRs are squash-merged, so a subject ending in `(#N)` is PR N: read each one's title and body (`gh pr view N --json title,body,files`). A commit with no PR number is read from its own diff. Done when every commit in the list has a verdict: a draft note line, or "none" with its reason. -2. **Notes**, by the notes rule below. When no line remains, say "nothing to release since ``" with the verdicts, and stop. -3. **Level**, by the level rule below: `patch` or `minor`, with the reason (the line that decides it). -4. **Propose** the level, the version it makes, and the draft section in chat, and wait. Daniel may revise either; carry on only when he agrees, with what he agreed to. -5. **Worktree.** Create a worktree under `.claude/worktrees/` on a new branch `release-vX.Y.Z`, the agreed version, from `origin/main` (`git worktree add -b release-vX.Y.Z .claude/worktrees/release-vX.Y.Z origin/main`), and do the rest there. -6. **Bump.** `node scripts/npm/release.mjs bump `. It rewrites `npm/package.json`, `server/Cargo.toml` and `Cargo.lock` and prints the new version, which must be the agreed one. The script owns the version: leave those three files as it wrote them. -7. **Changelog.** Insert the agreed section into `CHANGELOG.md` as `## X.Y.Z`, above the newest version's section and below the intro. -8. **README and site.** Read the root `README.md` and the landing page's copy in `site/index.html` against the release's changes, and for each list each sentence a change made wrong, quoted, with the PR that made it wrong, or one line "README: no sentence contradicted" (and "Site: no sentence contradicted"). This goes into the PR body; leave both unedited, since their wording is Daniel's. The site deploys on its own when a fix to `site/` merges (`.github/workflows/site.yml`), not with the release. -9. **Check.** `npm ci`, then `npm run check` from the worktree root, until green. Its node test fails when `CHANGELOG.md` lacks the new version's section. -10. **PR.** Commit as `Release vX.Y.Z`, push, and run the outside review as `AGENTS.md` says; a Release PR's diff gets `skipped: no risk match`, which is the PR's "Outside review" line. No correctness pass is needed: the diff has no Rust or TypeScript. Open the PR titled `Release vX.Y.Z` against `main`, its body written with `$pr`, holding the notes and the README and site lists. -11. **Hand-off.** Your last message gives the PR link and, for after Daniel has merged it: - - gh workflow run release.yml --ref main -f publish=true - - The publish must run on the Release PR's own commit: when anything merges to `main` after it, the release commit guard fails the run ("main moved past the Release PR, run /release again"). - - It then names the tickets the publish unblocks: read each open `parked` issue (`gh issue list --label parked --state open`) and list those whose start condition is an npm release, each with its condition's check (such as #907's `npm view plotkeeper readme`), as "After the publish, unpark: …", or one line "No parked ticket waits on a release". Leave the labels alone: the publish has not run yet. - -## Notes rule - -- A change gets a line only when a user of the npm package would notice it: the page, the `plotkeeper` CLI and its flags, `plotkeeper install`'s output and what it wires, the data folder, the package itself (its README and LICENSE on npm count). Agent docs, skills, CI and workflows, tests, snap fixtures, refactors, the system map and the development docs get none. -- Group lines under Keep a Changelog headings, in this order and only those used: `Breaking`, `Added`, `Changed`, `Fixed`. -- Each line is one sentence, in the user's words, saying what changed and why it matters to them, ending with `(#N)`, the PR number. PRs that make one change share one line, ending with all their numbers (`(#468, #470)`). -- Match the tone of the sections already in `CHANGELOG.md`. - -## Level rule - -- `minor` when any line is a new user-visible feature or a breaking change: a CLI flag removed or changed, `plotkeeper install`'s output changed, the data folder's format changed. A breaking change also gets its line under `Breaking`. -- `patch` when every line is a fix or polish. -- The bump is always `patch` or `minor`, so the version stays below 1.0; `major` and 1.0.0 are Daniel's decision, and the script refuses `major`. diff --git a/.agents/skills/ship/SKILL.md b/.agents/skills/ship/SKILL.md deleted file mode 100644 index cc34a1a35..000000000 --- a/.agents/skills/ship/SKILL.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: ship -description: Merge a PR. Runs only when Daniel explicitly asks to merge; takes the PR number. -disable-model-invocation: true ---- - -Merge PR $ARGUMENTS by the "Merge procedure" section of `docs/agents/issue-tracker.md`. Run it only because Daniel explicitly asked. diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md deleted file mode 100644 index a11d5ca3e..000000000 --- a/.claude/skills/release/SKILL.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: release -description: Prepare the next npm release of plotkeeper as a Release PR, from what merged since the last tag. Runs only when Daniel types it. -disable-model-invocation: true ---- - -Daniel typed this, so he wants the next release prepared (spec #512; `docs/studio/development.md`, "Cutting a release"). You end at an open Release PR. Daniel merges it (through `/ship`) and starts the publish himself; you never publish, tag, or dispatch a workflow. - -## Steps - -1. **Since the tag.** `git fetch origin --tags`. The last release is the newest `v*` tag by version (`git tag --list 'v*' --sort=-v:refname | head -1`). When it prints nothing, no release is tagged: say "no `v*` tag on origin, so there is no release to start from (the tags are backfilled by #516)", and stop. List every commit since it: `git log --first-parent --format='%h %s' ..origin/main`. PRs are squash-merged, so a subject ending in `(#N)` is PR N: read each one's title and body (`gh pr view N --json title,body,files`). A commit with no PR number is read from its own diff. Done when every commit in the list has a verdict: a draft note line, or "none" with its reason. -2. **Notes**, by the notes rule below. When no line remains, say "nothing to release since ``" with the verdicts, and stop. -3. **Level**, by the level rule below: `patch` or `minor`, with the reason (the line that decides it). -4. **Propose** the level, the version it makes, and the draft section in chat, and wait. Daniel may revise either; carry on only when he agrees, with what he agreed to. -5. **Worktree.** Create a worktree under `.claude/worktrees/` on a new branch `release-vX.Y.Z`, the agreed version, from `origin/main` (`git worktree add -b release-vX.Y.Z .claude/worktrees/release-vX.Y.Z origin/main`), and do the rest there. -6. **Bump.** `node scripts/npm/release.mjs bump `. It rewrites `npm/package.json`, `server/Cargo.toml` and `Cargo.lock` and prints the new version, which must be the agreed one. The script owns the version: leave those three files as it wrote them. -7. **Changelog.** Insert the agreed section into `CHANGELOG.md` as `## X.Y.Z`, above the newest version's section and below the intro. -8. **README and site.** Read the root `README.md` and the landing page's copy in `site/index.html` against the release's changes, and for each list each sentence a change made wrong, quoted, with the PR that made it wrong, or one line "README: no sentence contradicted" (and "Site: no sentence contradicted"). This goes into the PR body; leave both unedited, since their wording is Daniel's. The site deploys on its own when a fix to `site/` merges (`.github/workflows/site.yml`), not with the release. -9. **Check.** `npm ci`, then `npm run check` from the worktree root, until green. Its node test fails when `CHANGELOG.md` lacks the new version's section. -10. **PR.** Commit as `Release vX.Y.Z`, push, and run the outside review as `AGENTS.md` says; a Release PR's diff gets `skipped: no risk match`, which is the PR's "Outside review" line. No correctness pass is needed: the diff has no Rust or TypeScript. Open the PR titled `Release vX.Y.Z` against `main`, its body written with `$pr`, holding the notes and the README and site lists. -11. **Hand-off.** Your last message gives the PR link and, for after Daniel has merged it: - - gh workflow run release.yml --ref main -f publish=true - - The publish must run on the Release PR's own commit: when anything merges to `main` after it, the release commit guard fails the run ("main moved past the Release PR, run /release again"). - - It then names the tickets the publish unblocks: read each open `parked` issue (`gh issue list --label parked --state open`) and list those whose start condition is an npm release, each with its condition's check (such as #907's `npm view plotkeeper readme`), as "After the publish, unpark: …", or one line "No parked ticket waits on a release". Leave the labels alone: the publish has not run yet. - -## Notes rule - -- A change gets a line only when a user of the npm package would notice it: the page, the `plotkeeper` CLI and its flags, `plotkeeper install`'s output and what it wires, the data folder, the package itself (its README and LICENSE on npm count). Agent docs, skills, CI and workflows, tests, snap fixtures, refactors, the system map and the development docs get none. -- Group lines under Keep a Changelog headings, in this order and only those used: `Breaking`, `Added`, `Changed`, `Fixed`. -- Each line is one sentence, in the user's words, saying what changed and why it matters to them, ending with `(#N)`, the PR number. PRs that make one change share one line, ending with all their numbers (`(#468, #470)`). -- Match the tone of the sections already in `CHANGELOG.md`. - -## Level rule - -- `minor` when any line is a new user-visible feature or a breaking change: a CLI flag removed or changed, `plotkeeper install`'s output changed, the data folder's format changed. A breaking change also gets its line under `Breaking`. -- `patch` when every line is a fix or polish. -- The bump is always `patch` or `minor`, so the version stays below 1.0; `major` and 1.0.0 are Daniel's decision, and the script refuses `major`. diff --git a/.claude/skills/ship b/.claude/skills/ship deleted file mode 120000 index 084c1ffef..000000000 --- a/.claude/skills/ship +++ /dev/null @@ -1 +0,0 @@ -../../.agents/skills/ship \ No newline at end of file diff --git a/docs/agents/release.md b/docs/agents/release.md index 01f3875af..0a71c3729 100644 --- a/docs/agents/release.md +++ b/docs/agents/release.md @@ -1,6 +1,6 @@ # Release -Read by the `release` skill from dsh (`release-next` while in trial). The full procedure and its reasons are in [development.md, "Cutting a release"](../studio/development.md#cutting-a-release). +Read by the `release` skill from dsh. The full procedure and its reasons are in [development.md, "Cutting a release"](../studio/development.md#cutting-a-release). - **Tag:** `v*`. A repo without one has no release to start from (the tags were backfilled by #516). - **Who notices:** a user of the npm package: the page, the `plotkeeper` CLI and its flags, `plotkeeper install`'s output and what it wires, the data folder, and the package itself (its README and LICENSE on npm). Agent docs, skills, CI and workflows, tests, snap fixtures, refactors, the system map and the development docs get no note. diff --git a/docs/agents/ship.md b/docs/agents/ship.md index 5c79e3204..232688247 100644 --- a/docs/agents/ship.md +++ b/docs/agents/ship.md @@ -1,6 +1,6 @@ # Ship -Read by the `ship` skill from dsh (`ship-next` while in trial). plotkeeper's merge procedure is "Merge procedure" in [issue-tracker.md](issue-tracker.md#merge-procedure); follow it in full. It covers: +Read by the `ship` skill from dsh. plotkeeper's merge procedure is "Merge procedure" in [issue-tracker.md](issue-tracker.md#merge-procedure); follow it in full. It covers: - **Checks:** the PR's own CI, and the `snap` rerun rule in `AGENTS.md`, "Checks". - **Merge method:** squash, keeping the remote branch until the end. diff --git a/docs/studio/development.md b/docs/studio/development.md index 5390333ba..8e425fa4b 100644 --- a/docs/studio/development.md +++ b/docs/studio/development.md @@ -80,7 +80,7 @@ At most two `npm run check` run on a machine at once, across every worktree and A release is a Release PR that Daniel approves by merging, then a publish he starts (spec #512, [#509's resolution](https://github.com/danielrispler/plotkeeper/issues/509#issuecomment-7157474516)). The versions and notes are never edited by hand. -1. **`/release`.** Daniel types it. The skill (`.claude/skills/release/`, mirrored in `.agents/skills/release/`) reads the commits and PRs merged since the newest `v*` tag, recommends `patch` or `minor` (`minor` for a new user-visible feature or a breaking change, `patch` for fixes and polish, never `major` or 1.0.0) and drafts user-facing notes in chat; with nothing user-facing since the tag it says "nothing to release" and stops. On Daniel's agreement it runs `node scripts/npm/release.mjs bump `, which writes the version into `npm/package.json` (its own and the three platform packages' it asks for), `server/Cargo.toml` and `studio-server`'s entry in `Cargo.lock` and nothing else (`plotkeeper --version` prints the crate's; `server/tests/plotkeeper_bin.rs` fails when they differ), prepends the version's section to `CHANGELOG.md`, and opens `Release vX.Y.Z`. Its body holds the notes and lists the sentences of the README and of the site's `site/index.html` that the release made wrong, or says none; both are left to Daniel, and the site deploys when his fix merges, not with the release. The skill's last message also lists the open `parked` tickets that wait on an npm release, to unpark after the publish. +1. **`/release`.** Daniel types it. The skill (dsh's general `release` skill, installed globally by `scripts/link-skills.sh` in `danielrispler/dsh`, with plotkeeper's settings in [`docs/agents/release.md`](../agents/release.md)) reads the commits and PRs merged since the newest `v*` tag, recommends `patch` or `minor` (`minor` for a new user-visible feature or a breaking change, `patch` for fixes and polish, never `major` or 1.0.0) and drafts user-facing notes in chat; with nothing user-facing since the tag it says "nothing to release" and stops. On Daniel's agreement it runs `node scripts/npm/release.mjs bump `, which writes the version into `npm/package.json` (its own and the three platform packages' it asks for), `server/Cargo.toml` and `studio-server`'s entry in `Cargo.lock` and nothing else (`plotkeeper --version` prints the crate's; `server/tests/plotkeeper_bin.rs` fails when they differ), prepends the version's section to `CHANGELOG.md`, and opens `Release vX.Y.Z`. Its body holds the notes and lists the sentences of the README and of the site's `site/index.html` that the release made wrong, or says none; both are left to Daniel, and the site deploys when his fix merges, not with the release. The skill's last message also lists the open `parked` tickets that wait on an npm release, to unpark after the publish. 2. **The Release PR's CI** runs `npm run check`, whose node test fails when `CHANGELOG.md` has no section for the package's version, and this workflow's pack and smoke jobs, since the PR touches `npm/` and a `Cargo.toml`. Merging it, through `/ship` when Daniel asks, is the approval. 3. **The publish.** Daniel alone starts it, from `main` with "publish" ticked: `gh workflow run release.yml --ref main -f publish=true`, or "npm package" in the Actions tab. The release commit guard (`release.mjs guard`) first fails the run unless HEAD is the commit that changed `npm/package.json`'s version, so a PR merged after the Release PR cannot ship under its notes; then run `/release` again. The workflow packs and smokes the four packages as above. The publish job upgrades npm to 11.5.1 or later (Node 22's npm is 10, too old for trusted publishing) and publishes the tarballs its own smoke jobs tested, with provenance: the three platform packages first, then the launcher, so the launcher is never on npm before a package it asks for, and it skips a package npm already has at this version, so a publish that failed partway is finished by "Re-run failed jobs". It holds no token: npm trusted publishing authenticates it through the job's `id-token: write`. Without "publish", or from another branch, the workflow only builds and tests. 4. **The `release` job**, after npm accepts the version, tags `vX.Y.Z` at the run's commit and creates the GitHub Release from the version's `CHANGELOG.md` section (`release.mjs tag`). It is idempotent: a tag already at that commit is kept, one at another commit fails, and an existing Release is left as it is. When it fails, retry it with "Re-run failed jobs" (`gh run rerun --failed`), which reruns only it.