Install and update from release tags so people never get unfinished work from main

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-17 18:07:58 -08:00
1 parent 347831475d
commit c07e679105
12 files changed
+2400 -519

No files matched your search

+7 -3
View File
@@ -97,10 +97,14 @@ Read the current `CHANGELOG.md` on the branch. Look for:
### Step 5 — Draft or fix the CHANGELOG entry
**If no entry exists**, draft a new one based on the commits and changed files. Match this repo's house format exactly — a bare `## vX.Y.Z` heading with **no date**, emoji `###` headings from the Step 2 table, and a blank line between bullets:
**If no entry exists**, draft a new one based on the commits and changed files. Match this repo's house format exactly: a `## vX.Y.Z (YYYY-MM-DD)` heading with the release date (take it from `version.json`'s `releaseDate`, or today's date for an entry not yet released; older headings have no date and stay as they are), emoji `###` headings from the Step 2 table in the order Added, Changed, Fixed, and a blank line between bullets. The format going forward:
- A minor release opens with a `### Highlights` block of exactly three plain-language bullets, before Added.
- Game changes sit under one `Activities` line.
- Tooling and test lines go under a `**For contributors**` bullet group at the end of the section.
```markdown
## {computed-version-with-v-prefix}
## {computed-version-with-v-prefix} ({release-date})
### ✨ Added
@@ -142,7 +146,7 @@ This keeps `package.json`, `version.json`, and `CHANGELOG.md` in lockstep so `np
- Never create a version entry without checking main first — the whole point is to derive the version from main's current state
- Always present changes before writing — the user should see and approve the CHANGELOG entry
- Match the existing file's format — `## vX.Y.Z` with no date, emoji `###` headings. Do not introduce Keep a Changelog's `## [x.y.z] - date` style
- Match the file's format: `## vX.Y.Z (YYYY-MM-DD)` (older headings carry no date; do not backfill them), emoji `###` headings. Do not introduce Keep a Changelog's `## [x.y.z] - date` style
- Write for someone reading the release notes, not for someone reading the diff — say what the change lets them do
- If multiple change types exist (Added + Changed), use multiple headings under the same version
- `version.json`'s `releaseDate` is today's date, i.e. when the release is being prepared, not when the work started
@@ -21,7 +21,7 @@ Run from the repo root (the folder holding `install.js` and `src/launcher/`). Ru
### Step 2 — Read the current files
Read `src/launcher/models.json`. It has five keys: `_note` (a string), `claude`, `devin` and `codex` (each an array of `{ "id", "label" }`) and `strengths` (an object, see Step 4c). Keep the `_note` text exactly as read — Step 9 writes it back verbatim and the Validation rules check it.
Read `src/launcher/models.json`. It has five keys: `_note` (a string), `claude`, `devin` and `codex` (each an array of `{ "id", "label" }`) and `strengths` (an object, see Step 4c). A `label` is the description only, never the id or a name ahead of a gloss: `{ "id": "sonnet", "label": "latest Sonnet" }`, not `"Sonnet, latest Sonnet"` or `"sonnet (latest Sonnet)"`. The launcher's model menu prints the id in a padded column with the label beside it, and the console and the desktop app show the id next to it too, so a label that repeats the name shows it twice. Devin's and Codex's labels are the display name the vendor uses (`Claude Opus 5.5 Low`), which is their description. Keep the `_note` text exactly as read — Step 9 writes it back verbatim and the Validation rules check it.
Read `src/launcher/agents.json`. It has `schema` (currently `1`) and `agents`, a list of entries. Each entry carries `id`, `name`, `kind` (`builtin` or `template`), `command`, `prompt`, `args`, `bypassArgs`, `modelArgs`, and optional `note`. A `builtin` entry also carries `installUrl`, `install` (lists under `win`, `mac` and `linux`, each `{ label, run, note? }`) and `installDirs` (the same OS keys). Keep the file's shape and order exactly as read.
@@ -80,7 +80,7 @@ For `models.json`, compare the discovered list with the current one by `id` and
- **added:** offered by the CLI, not in the file.
- **gone:** in the file, no longer offered.
- **relabeled:** same `id`, a better or changed label. Propose a label in the file's existing style.
- **relabeled:** same `id`, a better or changed label. Propose a label in the file's existing style: the description only (see Step 2), never repeating the id.
For `agents.json`, show one table with one row per changed field:
@@ -137,7 +137,7 @@ Check every rule before `npm test` (Step 10). They mirror the shipped-file tests
- `_note` is present and unchanged from what Step 2 read.
- `claude` and `devin` are both non-empty arrays; `codex` is an array (empty is allowed).
- `devin` has at most 30 entries.
- Every entry in `claude`, `devin` and `codex` has a non-empty string `id` and a non-empty string `label`.
- Every entry in `claude`, `devin` and `codex` has a non-empty string `id` and a non-empty string `label`, and no label is a name followed by a gloss (`Sonnet, latest Sonnet`); `scripts/test-launcher.mjs` checks this too.
- Ids are unique within each list, and labels are unique within each list.
- No Devin id ends in `xhigh`, `max`, `fast` or `priority`.
- Every `strengths` row names a `model` that is in that agent's list in the same file, uses only the words `thrifty`, `balanced` and `best`, and no agent other than the ones already under `strengths` gains a mapping.
+26 -3
View File
@@ -30,7 +30,7 @@ git pull origin main
Read all three files at the repo root and extract each version:
- `CHANGELOG.md` — parse the first `## vX.Y.Z` heading. Strip the leading `v` → `$CHANGELOG_VERSION`. Note: plan2code CHANGELOG headings are `## vX.Y.Z` (v-prefixed, **no** date and **no** brackets) — different from a `## [x.y.z] - YYYY-MM-DD` format.
- `CHANGELOG.md` — parse the first `## vX.Y.Z` heading. Strip the leading `v` → `$CHANGELOG_VERSION`. Note: plan2code CHANGELOG headings are `## vX.Y.Z`, optionally followed by ` (YYYY-MM-DD)` (v-prefixed, **no** brackets; older headings have no date), different from a `## [x.y.z] - YYYY-MM-DD` format. The date is not part of the version.
- `version.json` — the `version` field → `$VERSION_JSON`. Also read its `releaseDate` field → `$RELEASE_DATE` (informational only — shown at the confirm step, never part of the sync gate; use `(none)` if absent).
- `package.json` (root) → the `version` field → `$PACKAGE_JSON`.
@@ -80,7 +80,30 @@ If `$CHANGELOG_VERSION` > `$RELEASE_VERSION`, compute:
- `tag = "v$CHANGELOG_VERSION"`
- `title = "v$CHANGELOG_VERSION"` (plan2code keeps the `v` prefix in release titles)
- `notes` = the header line `# What's New 🎉`, then one blank line, then `$SECTION` verbatim (`$SECTION` already starts with the `## vX.Y.Z` heading). Build this as a real multi-line string with **actual newlines** — the `\n\n` shorthand shown elsewhere means "a blank line," never the literal two-character sequence `\` + `n`. Getting this wrong would run the header and the first CHANGELOG heading together with a stray `\n\n` in the published body.
- `notes` = the header line `# What's New 🎉`, one blank line, the **fixed header** below (with `$CHANGELOG_VERSION` filled in), one blank line, then the **highlights**, one blank line, then `$SECTION` verbatim (`$SECTION` already starts with the `## vX.Y.Z` heading). Build this as a real multi-line string with **actual newlines** — the `\n\n` shorthand shown elsewhere means "a blank line," never the literal two-character sequence `\` + `n`. Getting this wrong would run the header and the first CHANGELOG heading together with a stray `\n\n` in the published body.
**The fixed header** (the same on every release, so a visitor to the release page finds the install and update commands and the right file without reading the changelog):
````markdown
**Install:** `npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git#release`
**Update:** `plan2code update`
The installer downloads the right app for your system and puts it in place for you, so you only need the files below for a manual download.
| Your system | File |
| --- | --- |
| Windows (64-bit Intel or AMD) | `plan2code-app-$CHANGELOG_VERSION-windows-x64.exe` |
| macOS (Apple silicon) | `plan2code-app-$CHANGELOG_VERSION-macos-arm64` |
| macOS (Intel) | `plan2code-app-$CHANGELOG_VERSION-macos-x64` |
| Linux (64-bit Intel or AMD) | `plan2code-app-$CHANGELOG_VERSION-linux-x64` |
| Any system: check a download | `plan2code-app-$CHANGELOG_VERSION-SHA256SUMS.txt` |
The app files are not code-signed. See [the desktop app guide](https://github.com/jparkerweb/plan2code/blob/main/docs/desktop-app.md#the-app-is-not-code-signed) for what your system may ask and how to answer.
````
Check the install command against the README's "See it" line before publishing; if it has changed, the README wins.
**The highlights** (written fresh for each release, from `$SECTION`): a `### Highlights` heading and exactly three bullets, each one plain sentence about what a person can now do or no longer trips over (no file names, no internal terms). The full list follows below them. When `$SECTION` already opens with its own `### Highlights` block (the changelog format from 3.1.0 on), reuse those bullets as they are: add no second Highlights block.
Present all three to the user and wait for an explicit answer before any write. Offer the optional decorative title suffix — a plain `vX.Y.Z` title is the default, but a release may append one (e.g. `v1.14.0 - 🔍 Review workflow`):
@@ -105,7 +128,7 @@ If the user supplies a suffix, set `title = "v$CHANGELOG_VERSION " + <suffix>` (
### Step 9 - Publish (on approval)
The release is created by the `release-app` workflow, **last**, not by this skill. The workflow builds the app on four systems, attaches every file to a draft release, and only then publishes it, so the `vX.Y.Z` tag (which the app's update check watches) never exists before its binaries do. Creating the release here with `gh release create` would put the tag up first and leave users offered an upgrade with nothing to download. Do not do that.
The release is created by the `release-app` workflow, **last**, not by this skill. The workflow builds the app on four systems, attaches every file to a draft release, and only then publishes it, so the `vX.Y.Z` tag (which the app's update check watches) never exists before its binaries do; its last step then fast-forwards the `release` branch (what the README installs from) to the new tag, and fails loudly if the tag is not ahead of the branch. Creating the release here with `gh release create` would put the tag up first and leave users offered an upgrade with nothing to download. Do not do that.
On approval, write `$notes` to a temp file, never inline (multiline text on the command line is a quoting bug). `$notes` must already hold **real newlines** (per Step 8) because `printf '%s'` / `WriteAllText` write it byte-for-byte, and the file MUST be **UTF-8** because the notes contain emoji. Then start the workflow on `main`, passing the file as the `notes` input (`-F key=@file` reads the file's contents):