Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

refactor: fold review and bug skills into AGENTS.md and trim release

youxi798c293c49aff60
diff --git a/.agents/skills/bugs/SKILL.md b/.agents/skills/bugs/SKILL.md
deleted file mode 100644
index 2201c69c..00000000
--- a/.agents/skills/bugs/SKILL.md
+++ /dev/null
@@ -1,131 +0,0 @@
----
-name: bugs
-version: 1.0.0
-description: Proactively sweep a Pake area for latent UX and runtime defects before users report them, using this repo's own fix history and boundary archetypes, and confirm every finding with a probe run this turn. Use for 找找有没有bug, 主动找bug, 有没有隐患, 排查隐患, 举一反三, 上线前扫一遍, 这块可靠吗, latent bug scan, sibling sweep after a fix. Not for an already-reported symptom (that is /hunt) and not for reviewing a diff (that is /check). Named bugs, not bug: /bug is a Claude Code built-in.
----
-
-# Bugs: Find It Before the User Does
-
-`/hunt` needs a symptom. `/check` needs a diff. This one needs neither: it goes looking.
-
-## The Question
-
-Across Pake's fix history the dominant defect is not a crash. It is a wrong-but-plausible behavior: a SPA route treated as a download, a menu command aimed at the wrong window, a blank shell shown before the page is ready, or a flag that is a no-op on one platform. Nothing panics; the user just gets a worse desktop app than the browser.
-
-So the question that finds bugs here is never "can this crash?" It is:
-
-> What does this code do when the page is an **SPA route**, the window is **not the main label**, the document is an **error/blank shell**, the click has a **modifier key**, or the platform **ignores the Chromium flag**?
-
-Aim it at a boundary, not at a file.
-
-## 1. Pick the surface
-
-Name the area and the depth. A whole-repo sweep with no budget produces speculation; pick one hotspot and go deep. Start from the Hotspot Map in `AGENTS.md` (Current Risk Areas + table below) rather than inventing a scope.
-
-| Hotspot | Primary paths | Locked tests (examples) |
-| -------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
-| Link / download heuristics | `src-tauri/src/inject/event.js`, `link_policy.js`, `frame_links.js` | `event-link-guard.test.js`, `download-http-status.test.ts`, `frame-links.test.js` |
-| Download success semantics | `src-tauri/src/app/invoke.rs`, `window.rs` `on_download` | `download-http-status.test.ts` |
-| Menu / focused window | `src-tauri/src/app/menu.rs` | `menu-focused-window.test.ts` |
-| Startup visibility | `src-tauri/src/lib.rs`, `setup.rs` | `startup-window-reveal.test.ts` |
-| Auth / popup | `inject/auth.js`, `inject/event.js`, `inject/frame_links.js` | `auth-sso-patterns.test.js`, `new-window-macos.test.js`, `frame-links.test.js`, `popup-routing.mjs` (Playwright, manual) |
-| Clipboard | `inject/event.js` | `event-clipboard-shortcuts.test.js` |
-| Multi-window / icon | `window.rs`, `setup.rs` | `window-icon-reapply.test.ts`, `startup-window-reveal.test.ts` |
-| Platform fake capability | `auth.rs`, proxy, WebKit flags in `lib.rs` | `macos-proxy-feature.test.ts`, `lib.rs` `linux_webkit_safe_mode_*` (`cargo test`) |
-| CLI / config contract | `bin/`, `schema/pake.schema.json` | `config-file.test.ts`, `cli-options.test.ts` |
-
-The AGENTS.md Hotspot Map third column is regression risk, not an open-bug list. Confirm against Current Risk Areas and the tests above before treating a row as a live defect.
-
-## 2. Read the area's own fix history first
-
-```bash
-git log --oneline --grep='^fix' -i -- <path>
-git log --pretty=format:'%h %s%n%b' --grep='^fix' -i -- <path> | head -200
-```
-
-Bugs recur by shape within a module. Two signals worth acting on:
-
-- A fix chain of three or more commits each "completing" the previous one means a fourth sibling is probably still out there. Real chains here: download path heuristics (`/releases/`, then `/assets/`, then the next SPA root), startup reveal (blank, then about:blank, then user cancel), menu target (`"pake"` hardcode, then focused window, then remaining hardcodes).
-- A commit body that says the prior fix was incomplete means that pattern's grep was under-run once already. Re-run it.
-
-## 3. Sweep the boundaries, in this order
-
-Highest historical yield first. For each, read the matching Risk Areas note in `AGENTS.md` before hypothesizing.
-
-| Boundary | What to ask | Where it lives |
-| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
-| Download / navigation heuristics | Would a SPA route under this path/extension be intercepted? Prefer extension + `download` attr + query hints over broad path roots. | `inject/event.js`, `inject/link_policy.js`, `inject/frame_links.js` |
-| Success vs transport | Is HTTP non-2xx, empty body, or missing file still toasted as success? | `invoke.rs`, `on_download` |
-| Window identity | Does this path hardcode `"pake"` when the user may be on `pake-N` or the focused window? | `menu.rs`, `invoke.rs`, `setup.rs`, `window.rs` |
-| Eval on dead pages | Does this menu/shortcut need a page JS context? Error and blank shells have none; prefer native `reload` / `navigate` / platform history. | `menu.rs` |
-| Startup vs user control | Can page-load or fallback re-show a window the user already hid? Latch every user visibility path. | `lib.rs`, `setup.rs` |
-| Auth / popup | Does macOS auth still crash, strand about:blank, or open the system browser for SSO? Apple Sign-In stays native popup. | `auth.js`, `event.js`, `frame_links.js`, `link_policy.js` |
-| Clipboard | Does keydown steal native paste (images/files)? Is fallback gated on trusted keyup + TTL? | `event.js` |
-| Platform capability | Is this flag real on WKWebView / WebView2 / WebKitGTK, or a Chromium-only no-op? | `auth.rs`, `window.rs`, `lib.rs` |
-| Config dual track | Can a config file smuggle a value the CLI flag rejects? | `bin/helpers/merge.ts`, schema |
-
-For generic shapes (fail-open guards, recovery gated on the artifact it restores, watchdog tuned only to the fast path), use `/hunt` and load its `references/failure-patterns.md` catalog. Do not re-derive that catalog here.
-
-## 4. Confirm before reporting
-
-A candidate is not a finding until it has evidence produced **this turn**.
-
-- **Confirmed**: a probe, a failing unit test on current code, or a complete source trace with a named trigger.
-- **Plausible**: the failure path is named, but nothing was run. Report separately and name the probe that would settle it.
-- **Not a finding**: anything inferred from a function name or "this looks risky". Grep the implementation or drop it.
-
-Oracles that settle cases here: unit tests under `tests/unit/`, `cargo test` for pure Rust helpers, a real packaged app cold start for blank-window claims, and the public site in a browser for "does this path navigate or download".
-
-Before flagging any risky-looking call, confirm it is production code. Unwraps in `#[test]`, string literals, and build scripts are not defects.
-
-## 5. Rank by blast radius
-
-1. Silently wrong navigation or download the user acts on (SPA route stolen, auth stranded)
-2. Stuck state with no recovery (error page, dead menu, latched hide)
-3. Multi-window / wrong-target action
-4. Wrong but visible (toast on wrong window, blank flash)
-5. Cosmetic
-
-## 6. Guard what gets fixed
-
-Anything confirmed and fixed needs a test that fails on the unfixed code, usually under `tests/unit/`. For a class of bug, guard the pattern (source introspection, parity, or pure helper), not only one URL string.
-
-Verify with:
-
-```bash
-npx vitest run
-cargo test
-cargo clippy --all-targets -- -D warnings
-```
-
-When the change touches `bin/`, also `pnpm run cli:build` and stage regenerated `dist/cli.js`.
-
-## Hard Rules
-
-- **No finding without this-turn evidence.** Speculation dressed as a finding wastes more review time than it saves.
-- **One archetype hit means sweep the whole repo for its signature.** Grep the shape, not the literal text, and report "checked N sites, M defective, K not applicable".
-- **Do not fix while sweeping.** Collect, then fix. Interleaving loses the sweep.
-- **Report clean boundaries as clean.** A boundary that was checked and holds is a result. Do not manufacture findings to justify the run.
-- **Findings outside the named area get listed, not fixed**, unless the maintainer agrees.
-
-## Output
-
-```
-Area: [what was swept, at what depth]
-Boundaries: [N walked, M applicable]
-
-Confirmed (severity order):
-1. [file:line] [the defect in one sentence]
- Evidence: [probe output / failing test / measurement]
- Blast: [what the user sees]
-
-Plausible (needs a probe):
-1. [file:line] [defect] -> [the probe that would settle it]
-
-Swept clean:
-- [boundary]: [what was checked, why it holds]
-
-Sibling sweep: [pattern signature] -> [N checked, M defective, K n/a]
-```
-
-Say whether anything was fixed or whether this was scan-only.
diff --git a/.agents/skills/code-review/SKILL.md b/.agents/skills/code-review/SKILL.md
deleted file mode 100644
index 27dd2c43..00000000
--- a/.agents/skills/code-review/SKILL.md
+++ /dev/null
@@ -1,59 +0,0 @@
----
-name: code-review
-description: Pake project adapter for Waza check/code-review. Use for TypeScript CLI, Rust/Tauri, release artifact, and CI review.
-version: 1.2.0
-allowed-tools:
- - Bash
- - Read
- - Grep
- - Glob
-disable-model-invocation: true
----
-
-# Pake Code Review Adapter
-
-Use Waza `/check` for the generic review method. This adapter adds Pake-specific commands, hard stops, and artifact rules.
-
-## Pake-Specific Hard Stops
-
-- [ ] Changes under `bin/` rebuild and commit `dist/cli.js` with `pnpm run cli:build`.
-- [ ] Any `package.json` change (Rollup inlines the whole manifest, dependency bumps included) rebuilds and commits `dist/cli.js`.
-- [ ] Release version bumps keep `package.json`, `src-tauri/Cargo.toml`, `src-tauri/Cargo.lock`, and `src-tauri/tauri.conf.json` in sync.
-- [ ] npm release workflow changes preserve Trusted Publishing: `.github/workflows/npm-publish.yml`, `id-token: write`, canonical `git+https://github.com/tw93/Pake.git`, and `scripts/check-release-version.mjs`.
-- [ ] Release/status changes keep npm registry, GitHub Release/assets, workflow run state, and issue closeout as separate truth surfaces.
-- [ ] `workflow_dispatch` release logic does not infer the release tag from `headBranch`, run title, or compare UI; use an explicit tag/ref and verify the package `gitHead`.
-- [ ] Any new user-visible CLI flag, alias, or help variant carries an explicit justification for why existing options or defaults cannot cover it (maintainer sign-off, not inferred).
-- [ ] No new `tauriConf: any` or other untyped config objects; use `PakeTauriConfig`.
-- [ ] No user-reachable `panic!` or `.unwrap()` on config, CLI, or event paths.
-- [ ] Silent `catch {}` blocks surface the real error through `logger.warn`.
-- [ ] New helper in `bin/utils/` or `bin/helpers/` has a matching `tests/unit/<basename>.test.ts`.
-- [ ] Binary parsers have a round-trip test, not only builder assertions.
-- [ ] Linux WebKit/AppImage runtime flag changes keep the default conservative, add or update tests for the decision logic, and update `docs/faq*.md` when users need a fallback command.
-- [ ] macOS `--new-window`, auth URL, or frame-link changes (`auth.js`, `event.js`, `frame_links.js`, `link_policy.js`) run `node tests/browser/popup-routing.mjs` with an installed Playwright runtime; see AGENTS.md Current Risk Areas for why classifier-only unit tests do not prove routing.
-
-## Quick Review Commands
-
-```bash
-# Get PR diff
-gh pr diff
-
-# Format check
-pnpm run format:check
-
-# Run unit tests (fast, sub-second)
-npx vitest run
-
-# Full suite without the slow real build
-pnpm test -- --no-build
-
-# Build CLI and catch TypeScript errors
-pnpm run cli:build
-
-# Popup/auth routing probe: manual only, needs a Playwright runtime
-# (tests/browser/*.mjs are outside vitest and Playwright is not a devDependency)
-node tests/browser/popup-routing.mjs
-```
-
-## Review Output Format
-
-Follow Waza `/check`: findings first, ordered by severity, with tight file/line references.
diff --git a/.agents/skills/github-ops/SKILL.md b/.agents/skills/github-ops/SKILL.md
deleted file mode 100644
index f805fb05..00000000
--- a/.agents/skills/github-ops/SKILL.md
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: github-ops
-description: GitHub issue, PR, and release operations via gh CLI. Not for code review or release builds.
-version: 2.1.0
-allowed-tools:
- - Bash
- - Read
----
-
-# GitHub Operations Skill
-
-Use this skill when working with GitHub issues, PRs, and releases for Pake. It carries the project facts and boundaries; standard `gh` usage is assumed.
-
-## Golden Rule
-
-Always use `gh` CLI and query live state before acting. Never assume state from memory or a previous turn.
-
-## Project Facts
-
-- Repo: `tw93/Pake`. Workflows: `release.yml` (`V*` tag, builds app assets), `npm-publish.yml` (npm Trusted Publishing; also `workflow_dispatch` from `main` for npm-only hotfixes), `quality-and-test.yml` (push and PR CI), `pake-cli.yaml` / `single-app.yaml` (public build surfaces external users trigger from forks).
-- Poll CI with `gh run view <run-id> --json status,conclusion`. Never pipe `gh run watch` or build output through `tail`/`head`; pipes swallow the real exit code and misreport failures as green.
-- Verify npm state with `npm view pake-cli@<version> version gitHead dist.tarball --json`; `gitHead` ties the published package to the intended commit. Check the `latest` pointer separately with `npm view pake-cli version`; it can point at a different commit than the fix under review.
-- Inline PR review comments live at `gh api repos/tw93/Pake/pulls/<n>/comments`; `gh pr view` does not show them.
-- App-release truth is `gh release view <tag> --json assets` (asset count/state), not workflow names or source state.
-
-## Safety Rules
-
-1. Prepare and review the exact reply before sending. If the user has explicitly authorized the write action or a batch containing it, complete that scope without another approval checkpoint; otherwise show the draft and ask before writing. Approval of wording alone does not authorize posting, merging, closing, or publishing.
-2. **NEVER** merge, close, or modify without explicit user request.
-3. Before replying to an issue or PR, read the body to confirm the author's language; match their language in the reply. This applies to the author, not to arbitrary thread commenters.
-4. Before replying that a CLI fix is released, verify the exact artifact with `npm view pake-cli@<version> version gitHead dist.tarball --json` and confirm `gitHead` contains the fix. Check `npm view pake-cli version` separately for the `latest` pointer. For app releases, use `gh release view <tag> --json assets`.
-5. Before closing an issue after release, confirm the target with `gh issue view <id> --json number,title,state,author,url` and include the concrete version or upgrade command in the comment.
diff --git a/.agents/skills/release/SKILL.md b/.agents/skills/release/SKILL.md
index 4c06fe9b..8683f903 100644
--- a/.agents/skills/release/SKILL.md
+++ b/.agents/skills/release/SKILL.md
@@ -1,7 +1,7 @@
---
name: release
description: Prepare, validate, and publish a Pake release. Not for version bumps without release intent.
-version: 1.6.0
+version: 1.7.0
allowed-tools:
- Bash
- Read
@@ -12,93 +12,52 @@ disable-model-invocation: true
# Release Skill
-Use this skill when preparing or executing a Pake release.
+Use this skill when preparing or executing a Pake release. Shared facts live in `AGENTS.md` and are not repeated here: the four version files and tag format (Version Management), CI jobs, Trusted Publishing, surface separation, and the contributors bot (Release Workflow), and issue closeout (Issue Closeout After a Fix).
-## Version Files
+## Pre-Release
-Four files must be updated in sync, never update one without the others:
+1. [ ] Before changing files or running any formatter/build, freeze the full baseline with `git status --short --branch -uall`, `git diff`, and `git diff --cached`. If the checkout contains unrelated or ambiguously owned changes, prepare the release in an isolated worktree.
+2. [ ] Confirm the new version (`jq .version package.json`; previous tag per AGENTS.md Version Management) and that `npm view [email protected] version` returns 404.
+3. [ ] Update all four version files.
+4. [ ] `pnpm run format`, then `pnpm test`. If `pnpm test` fails at the suite's `pnpm install pake-cli@latest` (run in `/tmp`) against a mirror, re-run once; two consecutive failures are real.
+5. [ ] `pnpm run cli:build`, then `pnpm run release:check` (version sync, format, vitest, package contents, npm dry-run).
+6. [ ] Re-read `git status --short --branch -uall`, `git diff`, and `git diff --cached`. Restore only build-churn paths that were clean in the baseline and provably generated by this run; otherwise repeat in an isolated worktree.
+7. [ ] Commit `chore: bump version to VX.Y.Z` with the rebuilt `dist/cli.js` staged via `git add -f dist/cli.js`.
-- `package.json`: `"version"`
-- `src-tauri/Cargo.toml`: `version` under `[package]`
-- `src-tauri/Cargo.lock`: `version` for package `pake`
-- `src-tauri/tauri.conf.json`: `"version"`
-
-## Release Checklist
-
-### Pre-Release
-
-1. [ ] Before changing files or running any formatter/build, freeze the full baseline with `git status --short --branch -uall`, `git diff`, and `git diff --cached`. If the checkout contains unrelated or ambiguously owned changes, prepare the release in an isolated worktree instead of letting a write-capable check touch the live checkout.
-2. [ ] Confirm the new version number (check current: `cat package.json | jq .version`; previous tag: `git tag --list 'V*' --sort=-version:refname | head -1`; a bare `git tag --sort` picks up stray non-version tags like `list` and `continuous`)
-3. [ ] Confirm the version is not already on npm: `npm view [email protected] version` should return 404 before publishing
-4. [ ] Update all four version files above
-5. [ ] Run `pnpm run format`, must pass cleanly
-6. [ ] Run `pnpm test`, must pass cleanly. If this step fails at the suite's `pnpm install pake-cli@latest` (run in `/tmp`) with exit code 1 against a mirror, re-run once; a single transient flake is acceptable, two consecutive failures is not.
-7. [ ] Run `pnpm run cli:build`, Rollup + TS must pass (catches type errors that `format` misses).
-8. [ ] Run `pnpm run release:check`, verifies version sync, package contents, and npm dry-run
-9. [ ] Re-read `git status --short --branch -uall`, `git diff`, and `git diff --cached`. Restore only known build-churn paths that were clean in the frozen baseline and whose new diff is provably generated by this run. If ownership is ambiguous, leave the live checkout untouched and repeat the release preparation in an isolated worktree; do not absorb unrelated churn into the release commit.
-10. [ ] Commit version bump with message: `chore: bump version to VX.X.X`. Include the rebuilt `dist/cli.js` (it embeds the version); stage it with `git add -f dist/cli.js` since `dist/` is gitignored.
-
-### Tagging (triggers CI)
+## Tag And Verify
```bash
-git tag -a VX.X.X -m "Release VX.X.X"
-git push origin VX.X.X
+git tag -a VX.Y.Z -m "Release VX.Y.Z"
+git push origin VX.Y.Z
```
-Tag format: uppercase `V` prefix (e.g. `V3.11.0`), not `v3.11.0`.
-
-If the bump push is rejected, the contributors bot pushed `chore: update contributors [skip ci]` in between: `git pull --rebase` onto it and push again, then tag. Do not force-push and do not tag the pre-rebase commit.
-
-### Post-Tag Verification
-
-1. [ ] Confirm CI triggered: `gh run list --workflow=release.yml`
-2. [ ] Poll CI status: `gh run view <run-id> --json status,conclusion` (never pipe `gh run watch` or build output to `tail`/`head`; pipes swallow the real exit code and misreport failures as green)
-3. [ ] Verify GitHub Release was created: `gh release view VX.X.X --json tagName,url,assets`
-4. [ ] Fill the GitHub Release title and body from the template in **GitHub Release Notes** below. CI's `create-release` step only makes a bare placeholder (title = `VX.X.X`, empty body); do not leave it bare.
-5. [ ] Confirm npm workflow exists and is active: `gh workflow list --all | grep "Publish npm Package"`
-6. [ ] Confirm npm Trusted Publishing triggered: `gh run list --workflow=npm-publish.yml`
-7. [ ] Verify npm published the exact package: `npm view [email protected] version gitHead dist.tarball --json`
-8. [ ] Verify latest now resolves to the release: `npm view pake-cli version`
-9. [ ] Record Quality & Testing status separately: `gh run list --workflow=quality-and-test.yml --limit 3`
-10. [ ] After the notes are published, add all six positive reactions to the release: resolve the release id from the tag, POST `+1`, `laugh`, `heart`, `hooray`, `rocket`, and `eyes` each to `repos/tw93/Pake/releases/<id>/reactions` via `gh api`, then re-read the reactions to confirm. Never add `-1` or `confused`.
+If the bump push is rejected, rebase onto the contributors bot commit as AGENTS.md describes, push, then tag the last real commit. Never force-push.
-npm publishes through Trusted Publishing from `.github/workflows/npm-publish.yml`. Configure npm package settings with GitHub Actions, `tw93/Pake`, workflow file `npm-publish.yml`, and no environment. Local `npm publish` is only a fallback if CI or registry state blocks the trusted path.
-
-Keep release surfaces separate in the final status:
-
-- npm registry: the authority for `pake-cli` installability and CLI/npm issue closeout.
-- GitHub Release/assets: the authority for app installers and popular-app artifact availability.
-- Quality workflow: the authority for post-push CI health, but it can continue after npm has already shipped.
-- Source/tag: the authority for what code was intended to ship.
-
-Do not collapse these into "released" without naming which surface was verified. If GitHub Release assets are visible while `gh run list` still reports the release workflow as queued or in progress, trust `gh release view` for asset state and report the workflow state separately.
+1. [ ] `gh run list --workflow=release.yml`, then poll `gh run view <run-id> --json status,conclusion`.
+2. [ ] `gh release view VX.Y.Z --json tagName,url,assets`, then fill the title and body per **GitHub Release Notes** below; CI leaves a bare placeholder.
+3. [ ] `gh run list --workflow=npm-publish.yml`, then `npm view [email protected] version gitHead dist.tarball --json` and `npm view pake-cli version` for `latest`.
+4. [ ] Record `gh run list --workflow=quality-and-test.yml --limit 3` separately.
+5. [ ] Add the six positive reactions (`+1`, `laugh`, `heart`, `hooray`, `rocket`, `eyes`) to `repos/tw93/Pake/releases/<id>/reactions` via `gh api` and read them back. Never `-1` or `confused`.
## npm-Only Hotfix (no tag)
-For CLI or Rust-template fixes that must reach npm fast without an app release. Most 3.15.x and 3.16.x point releases shipped this way; the version number is still consumed, so the next `V*` tag skips over it.
+For CLI or Rust-template fixes that must reach npm without an app release. The version number is still consumed, so the next `V*` tag skips over it.
-1. [ ] Bump all four version files, rebuild `dist/cli.js` with `pnpm run cli:build`, stage the version files, and stage the ignored artifact with `git add -f dist/cli.js`
-2. [ ] Run `pnpm run release:check`. For a Rust-template fix, also run the narrow current-platform Rust check before pushing. Do not run `npx vitest run` separately because `release:check` already includes it.
-3. [ ] Commit `chore: bump version to VX.Y.Z` and push `main`
-4. [ ] Record the exact commit selected for publishing with `git rev-parse HEAD`. Find its Quality & Testing run with `gh run list --workflow=quality-and-test.yml --commit <publish-sha> --limit 3 --json databaseId,headSha,status,conclusion`. Wait until that exact SHA is `completed` with `conclusion: success`. For Rust-template changes, confirm the `Full Tauri Build (windows-latest)` job passed before publishing.
-5. [ ] Dispatch with both gates: `gh workflow run npm-publish.yml --ref main -f expected_sha=<publish-sha> -f quality_run_id=<quality-run-id>`. If `main` moved, select the new exact head and wait for its own successful Quality run instead of publishing against stale evidence.
-6. [ ] Poll the npm workflow with `gh run view <run-id> --json headSha,status,conclusion`; its `headSha` must match `<publish-sha>`.
-7. [ ] Verify `npm view [email protected] version gitHead dist.tarball --json`; `gitHead` must match `<publish-sha>`. Check `npm view pake-cli version` separately for the `latest` pointer.
-8. [ ] Issue closeout per AGENTS.md; if the fix lives in the Rust template, tell users to rebuild their app after upgrading, because upgrading the CLI alone does not update already-built apps
-
-Skip list, do not do these for a hotfix: no `V*` tag, no GitHub Release or notes, no release reactions, no Docker. App-release surfaces stay untouched until the next `V*` release bundles the fix.
-
-## GitHub Release Notes
+1. [ ] Bump all four version files, `pnpm run cli:build`, stage the version files and `git add -f dist/cli.js`.
+2. [ ] `pnpm run release:check` (already includes vitest). For a Rust-template fix, also run the narrow current-platform Rust check.
+3. [ ] Commit `chore: bump version to VX.Y.Z`, push `main`, record `<publish-sha>` with `git rev-parse HEAD`.
+4. [ ] Wait for `gh run list --workflow=quality-and-test.yml --commit <publish-sha> --limit 3 --json databaseId,headSha,status,conclusion` to be `completed` / `success`; for Rust-template changes also `Full Tauri Build (windows-latest)`.
+5. [ ] `gh workflow run npm-publish.yml --ref main -f expected_sha=<publish-sha> -f quality_run_id=<quality-run-id>`. If `main` moved, wait for the new head's own Quality run.
+6. [ ] Poll `gh run view <run-id> --json headSha,status,conclusion`; `headSha` and the npm `gitHead` must both equal `<publish-sha>`.
+7. [ ] Issue closeout per AGENTS.md; for a Rust-template fix, tell users to rebuild their app after upgrading.
-CI only creates a bare placeholder release. Every published release must be edited to match the house format, or it looks broken next to the others. Before writing notes, run `gh release view <previous release>` and treat its structure as the hard template, title codename included. Two failure modes to avoid: a bare version title with no codename, and a body missing the logo header / star line / repo footer.
+Skip for a hotfix: no `V*` tag, no GitHub Release or notes, no reactions, no Docker.
-### Title format
+A successful publish followed by a verification timeout does not authorize republishing: npm scans new packages for 5 to 15+ minutes. Re-read the registry until the version appears. Local fallback, only when the trusted path is blocked: `npm exec --yes [email protected] -- npm publish --registry=https://registry.npmjs.org`.
-`V<X.Y.Z> <Codename>`: version, then a single English codename word, optionally with one emoji. Examples: `V3.11.8 Polish`, `V3.11.10 Bedrock`, `V3.12.0 Gateway`, `V3.11.0 Evolve 👻`. The codename is the maintainer's call; pick one that fits the release theme. Even patch releases get a codename.
-
-### Body template
+## GitHub Release Notes
-Fill in the version, the two changelog lists (English + 中文, same items in the same order, numbered), the thanks line (credit the reporters/PR authors behind the release), and keep the logo header and repo footer verbatim:
+Before writing notes, `gh release view <previous release>` and treat its structure as the hard template, codename included. Title: `V<X.Y.Z> <Codename>`, one English codename word, optionally one emoji (`V3.11.8 Polish`, `V3.11.0 Evolve 👻`); patch releases get a codename too. Source items from `git log VPREV..VX.Y.Z`, user-facing only.
```markdown
<div align="center">
@@ -120,32 +79,4 @@ Special thanks to @user for the reports and PRs behind this release. If Pake hel
> https://github.com/tw93/Pake
```
-Apply with a notes file to avoid shell escaping: `gh release edit VX.Y.Z --title "VX.Y.Z Codename" --notes-file notes.md`. Source changelog items from the real commit range (`git log VPREV..VX.Y.Z`), keep them user-facing, and drop pure CI/refactor/docs noise.
-
-## Trusted Publishing Notes
-
-- The first real Trusted Publishing test must use a new version and a new `V*` tag; do not retry an already-published version.
-- npm package settings should use the strict publishing option: require two-factor authentication and disallow tokens. Trusted Publishing still works with this setting.
-- If local fallback is unavoidable, prefer `npm exec --yes [email protected] -- npm publish --registry=https://registry.npmjs.org` so `prepublishOnly` can find the pinned pnpm version.
-- Do not reply to GitHub issues or close them as released until `npm view [email protected] version` returns the expected version. `npm view pake-cli version` alone is not enough because `latest` can point at a different commit than the fix under review.
-- npm scans newly published packages before making them installable, typically for about five minutes and sometimes over 15 minutes ([npm announcement](https://github.blog/changelog/2026-07-28-npm-publish-time-malware-scanning-and-dual-use-metadata/)). The workflow allows 20 minutes for visibility. A successful publish followed by a verification timeout does not authorize republishing: inspect the registry and install the exact version once it becomes available, then report publish and verification outcomes separately.
-- A `workflow_dispatch` run executes on a branch. For npm-only publishing, pass the exact `main` commit as `expected_sha` and a successful Quality run for that SHA as `quality_run_id`; the workflow rejects mismatches. Do not treat `headBranch`, run title, or compare UI as proof of the published source.
-- If CI creates `chore: update contributors [skip ci]` after the tag is pushed, fast-forward local `main` after the release. Do not retag just to include generated contributor art.
-
-## Build Commands (local only)
-
-```bash
-# Current platform
-pnpm build
-
-# macOS universal binary
-pnpm build:mac
-```
-
-Cross-platform builds (Windows/Linux) are handled by CI, not locally.
-
-## Safety Rules
-
-1. **NEVER** auto-commit or auto-push without explicit user request
-2. **NEVER** tag before all checks pass
-3. **ALWAYS** verify the four version files are in sync before tagging
+Apply with `gh release edit VX.Y.Z --title "VX.Y.Z Codename" --notes-file notes.md`.
diff --git a/.claude/skills/bugs b/.claude/skills/bugs
deleted file mode 120000
index 1d7399d3..00000000
--- a/.claude/skills/bugs
+++ /dev/null
@@ -1 +0,0 @@
-../../.agents/skills/bugs
\ No newline at end of file
diff --git a/.claude/skills/code-review b/.claude/skills/code-review
deleted file mode 120000
index 2d88efdf..00000000
--- a/.claude/skills/code-review
+++ /dev/null
@@ -1 +0,0 @@
-../../.agents/skills/code-review
\ No newline at end of file
diff --git a/.claude/skills/github-ops b/.claude/skills/github-ops
deleted file mode 120000
index d1a89b48..00000000
--- a/.claude/skills/github-ops
+++ /dev/null
@@ -1 +0,0 @@
-../../.agents/skills/github-ops
\ No newline at end of file
diff --git a/AGENTS.md b/AGENTS.md
index 7c030230..e4faec9d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,6 +1,6 @@
# AGENTS.md - Pake Project Knowledge Base
-> Project-specific Rust + Tauri rules: `.claude/rules/rust.md`. Skills live under `.agents/skills/` (`/release`, `/bugs`, `/github-ops`, `/code-review`; `.claude/skills/*` are symlinks into `.agents/skills/`, edit the `.agents` copy only). Exception: the `pake` skill's real source is `plugins/pake/skills/pake/SKILL.md` (shipped to users via the Claude Code and Codex plugin marketplaces, `.claude-plugin/marketplace.json` and `.agents/plugins/marketplace.json`); `.agents/skills/pake` is a symlink to it.
+> Project-specific Rust + Tauri rules: `.claude/rules/rust.md`. Skills live under `.agents/skills/` (`/release`; `.claude/skills/*` are symlinks into `.agents/skills/`, edit the `.agents` copy only). Exception: the `pake` skill's real source is `plugins/pake/skills/pake/SKILL.md` (shipped to users via the Claude Code and Codex plugin marketplaces, `.claude-plugin/marketplace.json` and `.agents/plugins/marketplace.json`); `.agents/skills/pake` is a symlink to it.
## Project Identity
@@ -24,7 +24,7 @@ Pake/
│ ├── Cargo.toml # Rust dependencies and version
│ ├── tauri.conf.json # Tauri configuration and version
│ └── .cargo/ # Cargo configuration (gitignored)
-├── .agents/skills/ # Agent skills (/release, /bugs, /github-ops, /code-review); .claude/skills/* symlinks here
+├── .agents/skills/ # Agent skills (/release); .claude/skills/* symlinks here
├── dist/ # Compiled CLI output
├── docs/ # Documentation
│ ├── cli-usage.md # CLI parameters
@@ -72,9 +72,17 @@ Goals and project facts only; trust the agent to find its own path.
- Generated areas (`dist/`, `node_modules/`, `src-tauri/target/`, `.app/`, `src-tauri/icons/`, `src-tauri/png/`) are not source. Exception: `dist/cli.js` is the shipped CLI build artifact (see `package.json` `files`); rebuild it via `pnpm run cli:build` and commit the regenerated file alongside the source change. Two things trigger a rebuild, not one: any change under `bin/`, and **any** change to `package.json`. Rollup inlines the whole manifest, so a dependency bump, a `pnpm.overrides` edit, an `engines` change, or a reworded `description` all leave `dist/cli.js` stale with no `bin/` diff to hint at it. Dependency-only PRs are the usual place this is missed.
- Release status, issue closeout, npm delivery, and GitHub assets are separate truth surfaces. Verify each one live (source commit/tag, workflow run, npm registry, GitHub Release/assets, issue state); never let one passing surface imply another.
-## Hotspot Map (for `/bugs`)
+## Review Hard Stops
-Proactive latent-bug sweeps use `.agents/skills/bugs/SKILL.md`. Pick one row and go deep; do not invent a whole-repo scope. The third column is **historical failure modes / regression risks**, not a claim that the tree is broken today. Prefer the matching Current Risk Areas invariant when judging a change.
+Beyond the rebuild, version-sync, surface, CLI-flag, WebKit, and popup-routing invariants in this file and `.claude/rules/rust.md`, a review blocks on:
+
+- npm release workflow changes that drop Trusted Publishing: `.github/workflows/npm-publish.yml`, `id-token: write`, canonical `git+https://github.com/tw93/Pake.git`, and `scripts/check-release-version.mjs` must survive.
+- A new helper in `bin/utils/` or `bin/helpers/` without a matching `tests/unit/<basename>.test.ts`.
+- A binary parser without a round-trip test.
+
+## Hotspot Map
+
+For proactive latent-bug sweeps, pick one row and go deep; do not invent a whole-repo scope. The third column is **historical failure modes / regression risks**, not a claim that the tree is broken today. Prefer the matching Current Risk Areas invariant when judging a change.
| Hotspot | Paths | Regression risk if reintroduced |
| -------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------ |
@@ -88,6 +96,8 @@ Proactive latent-bug sweeps use `.agents/skills/bugs/SKILL.md`. Pick one row and
| Platform capability | `auth.rs`, proxy, WebKit flags | Flag name present, platform no-op |
| CLI / config contract | `bin/`, `schema/` | Config smuggles out-of-range values CLI rejects |
+Oracles per row live under `tests/unit/` (for example `event-link-guard.test.js`, `download-http-status.test.ts`, `menu-focused-window.test.ts`, `startup-window-reveal.test.ts`, `window-icon-reapply.test.ts`); Linux WebKit flag decisions are covered by the `dmabuf_renderer_*` and `legacy_x11_*` `cargo test` cases in `src-tauri/src/lib.rs`.
+
## Current Risk Areas
- Injected CSS uses `src-tauri/src/inject/styles.js`: preserve DOM stylesheet order on ordinary pages; use constructable sheets only when CSP blocks the style element. `replaceSync` silently drops `@import`, so keep import-bearing CSS on its original DOM path, including escaped/case-insensitive at-keywords. Strict CSP plus imports remains unsupported. Run `node tests/browser/style-injection.mjs` with an installed Playwright runtime; mock CSSStyleSheet tests do not validate CSP or cascade behavior.