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.

chore: unify agent skills under .agents and add dist drift guards

Tw936790f7410e25
diff --git a/.agents/skills/release/SKILL.md b/.agents/skills/release/SKILL.md
index 2dc7b6de..4c41a766 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.1.0
+version: 1.2.0
allowed-tools:
- Bash
- Read
@@ -51,11 +51,12 @@ Tag format: uppercase `V` prefix (e.g. `V3.11.0`), not `v3.11.0`.
1. [ ] Confirm CI triggered: `gh run list --workflow=release.yml`
2. [ ] Watch CI status: `gh run watch`
3. [ ] Verify GitHub Release was created: `gh release view VX.X.X --json tagName,url,assets`
-4. [ ] Confirm npm workflow exists and is active: `gh workflow list --all | grep "Publish npm Package"`
-5. [ ] Confirm npm Trusted Publishing triggered: `gh run list --workflow=npm-publish.yml`
-6. [ ] Verify npm published the exact package: `npm view [email protected] version gitHead dist.tarball --json`
-7. [ ] Verify latest now resolves to the release: `npm view pake-cli version`
-8. [ ] Record Quality & Testing status separately: `gh run list --workflow=quality-and-test.yml --limit 3`
+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`
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.
@@ -68,6 +69,40 @@ Keep release surfaces separate in the final status:
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.
+## GitHub Release Notes
+
+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. Two failure modes to avoid: a bare version title with no codename, and a body missing the logo header / star line / repo footer (see `V3.11.10` and `V3.12.0`, both fixed after the fact).
+
+### Title format
+
+`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
+
+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:
+
+```markdown
+<div align="center">
+<img src="https://gw.alipayobjects.com/zos/k/fa/logo-modified.png" alt="Pake Logo" width="120" height="120" style="border-radius:50%" />
+<h1 style="margin: 12px 0 6px;">Pake VX.Y.Z</h1>
+<p><em>Turn any webpage into a desktop app with one command.</em></p>
+</div>
+
+### Changelog
+
+1. ...
+
+### 更新日志
+
+1. ...
+
+Special thanks to @user for the reports and PRs behind this release. If Pake helps you, please consider giving it a star and recommending it to your friends.
+
+> 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.
diff --git a/.claude/settings.json b/.claude/settings.json
new file mode 100644
index 00000000..fb7b0045
--- /dev/null
+++ b/.claude/settings.json
@@ -0,0 +1,16 @@
+{
+ "hooks": {
+ "PostToolUse": [
+ {
+ "matcher": "Edit|Write",
+ "hooks": [
+ {
+ "type": "command",
+ "command": "f=$(jq -r \".tool_input.file_path // empty\" 2>/dev/null || true); case \"$f\" in \"${CLAUDE_PROJECT_DIR:-$PWD}/bin/\"*) printf \"{\\\"hookSpecificOutput\\\":{\\\"hookEventName\\\":\\\"PostToolUse\\\",\\\"additionalContext\\\":\\\"bin/ changed: dist/cli.js is a tracked build artifact. Run pnpm run cli:build and commit the regenerated dist/cli.js together with this change.\\\"}}\" ;; esac",
+ "timeout": 10
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/.claude/skills/code-review b/.claude/skills/code-review
new file mode 120000
index 00000000..2d88efdf
--- /dev/null
+++ b/.claude/skills/code-review
@@ -0,0 +1 @@
+../../.agents/skills/code-review
\ No newline at end of file
diff --git a/.claude/skills/github-ops b/.claude/skills/github-ops
new file mode 120000
index 00000000..d1a89b48
--- /dev/null
+++ b/.claude/skills/github-ops
@@ -0,0 +1 @@
+../../.agents/skills/github-ops
\ No newline at end of file
diff --git a/.claude/skills/release b/.claude/skills/release
new file mode 120000
index 00000000..14f8a38a
--- /dev/null
+++ b/.claude/skills/release
@@ -0,0 +1 @@
+../../.agents/skills/release
\ No newline at end of file
diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md
deleted file mode 100644
index 02f9ad3b..00000000
--- a/.claude/skills/release/SKILL.md
+++ /dev/null
@@ -1,131 +0,0 @@
----
-name: release
-description: Prepare, validate, and publish a Pake release. Not for version bumps without release intent.
-version: 1.1.0
-allowed-tools:
- - Bash
- - Read
- - Grep
- - Glob
-disable-model-invocation: true
----
-
-# Release Skill
-
-Use this skill when preparing or executing a Pake release.
-
-## Version Files
-
-Four files must be updated in sync — never update one without the others:
-
-- `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. [ ] Confirm the new version number (check current: `cat package.json | jq .version`)
-2. [ ] Confirm the version is not already on npm: `npm view [email protected] version` should return 404 before publishing
-3. [ ] Update all four version files above
-4. [ ] Run `pnpm run format` — must pass cleanly
-5. [ ] Run `pnpm test` — must pass cleanly. If the release workflow step fails with `pnpm install ... exit code 1` against the CN mirror, re-run once; a single transient flake is acceptable, two consecutive failures is not.
-6. [ ] Run `pnpm run cli:build` — Rollup + TS must pass (catches type errors that `format` misses).
-7. [ ] Run `pnpm run release:check` — verifies version sync, package contents, and npm dry-run
-8. [ ] No uncommitted changes: `git status`
-9. [ ] Commit version bump with message: `chore: bump version to VX.X.X`
-
-### Tagging (triggers CI)
-
-```bash
-git tag -a VX.X.X -m "Release VX.X.X"
-git push origin VX.X.X
-```
-
-Tag format: uppercase `V` prefix (e.g. `V3.11.0`), not `v3.11.0`.
-
-### Post-Tag Verification
-
-1. [ ] Confirm CI triggered: `gh run list --workflow=release.yml`
-2. [ ] Watch CI status: `gh run watch`
-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`
-
-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.
-
-## GitHub Release Notes
-
-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. Two failure modes to avoid: a bare version title with no codename, and a body missing the logo header / star line / repo footer (see `V3.11.10` and `V3.12.0`, both fixed after the fact).
-
-### Title format
-
-`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
-
-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:
-
-```markdown
-<div align="center">
-<img src="https://gw.alipayobjects.com/zos/k/fa/logo-modified.png" alt="Pake Logo" width="120" height="120" style="border-radius:50%" />
-<h1 style="margin: 12px 0 6px;">Pake VX.Y.Z</h1>
-<p><em>Turn any webpage into a desktop app with one command.</em></p>
-</div>
-
-### Changelog
-
-1. ...
-
-### 更新日志
-
-1. ...
-
-Special thanks to @user for the reports and PRs behind this release. If Pake helps you, please consider giving it a star and recommending it to your friends.
-
-> 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.
-- A `workflow_dispatch` run may execute on `main`; do not treat `headBranch`, run title, or compare UI as the release tag. Check the pushed tag and published package `gitHead`.
-- 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
diff --git a/.claude/skills/use-pake b/.claude/skills/use-pake
new file mode 120000
index 00000000..aebe89d0
--- /dev/null
+++ b/.claude/skills/use-pake
@@ -0,0 +1 @@
+../../.agents/skills/use-pake
\ No newline at end of file
diff --git a/.github/workflows/quality-and-test.yml b/.github/workflows/quality-and-test.yml
index b537e4d0..7df7c0bc 100644
--- a/.github/workflows/quality-and-test.yml
+++ b/.github/workflows/quality-and-test.yml
@@ -112,6 +112,18 @@ jobs:
- name: Build CLI
run: pnpm run cli:build
+ # dist/cli.js is a tracked build artifact; a bin/ change without the
+ # regenerated dist/cli.js ships stale CLI behavior. Linux only to avoid
+ # cross-OS line-ending noise.
+ - name: Verify committed dist/cli.js matches bin/ sources
+ if: runner.os == 'Linux'
+ shell: bash
+ run: |
+ if ! git diff --exit-code -- dist/; then
+ echo "::error::dist/cli.js is out of sync with bin/. Run 'pnpm run cli:build' and commit the regenerated dist/cli.js."
+ exit 1
+ fi
+
- name: Run Fast Test Suite
shell: bash
run: PAKE_CREATE_APP=1 node tests/index.js --no-build