@schalkneethling/toolkit 0.6.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -43,9 +43,6 @@ updates:
|
|
|
43
43
|
interval: "daily"
|
|
44
44
|
cooldown:
|
|
45
45
|
default-days: 7
|
|
46
|
-
semver-major-days: 7
|
|
47
|
-
semver-minor-days: 3
|
|
48
|
-
semver-patch-days: 2
|
|
49
46
|
include:
|
|
50
47
|
- "*"
|
|
51
48
|
```
|
|
@@ -104,6 +101,7 @@ without repeating every field verbatim.
|
|
|
104
101
|
## Constraints
|
|
105
102
|
|
|
106
103
|
- **Never omit the `cooldown` block** from any ecosystem entry.
|
|
104
|
+
- **`semver-*` cooldown fields are only valid for package managers that use semver** (e.g. `npm`, `pip`, `cargo`). Do not include `semver-major-days`, `semver-minor-days`, or `semver-patch-days` for `github-actions` or any other non-semver ecosystem — Dependabot will reject the config.
|
|
107
105
|
- **Never change the canonical values** unless the user explicitly requests it and
|
|
108
106
|
provides a reason (e.g. a monorepo with a stricter release cadence).
|
|
109
107
|
- **Always include `github-actions`** as an ecosystem, even if the user only asked
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: npm-trusted-publishing-github-workflow
|
|
3
|
+
description: >
|
|
4
|
+
Generate, repair, or debug the GitHub Actions workflow FILE that performs an OIDC
|
|
5
|
+
trusted publish of a pnpm package — the concrete publish.yml, its test → build →
|
|
6
|
+
publish job shape, the package tarball artifact handoff, Node-version inference from
|
|
7
|
+
package.json, pnpm setup via pnpm/action-setup, the npm-CLI-version upgrade step, and
|
|
8
|
+
repository.url/Sigstore provenance matching. Use when the user wants the actual
|
|
9
|
+
workflow written or fixed, or is debugging a specific CI failure: npm publish
|
|
10
|
+
E404/E403/422, NODE_AUTH_TOKEN appearing unexpectedly, provenance or id-token errors,
|
|
11
|
+
pnpm/action-setup version resolution, or actions/setup-node node-version-file problems.
|
|
12
|
+
For the broader publishing SECURITY POSTURE — account 2FA, repository and branch
|
|
13
|
+
hardening, GitHub environments, changesets versus changelogithub, sole-maintainer risk,
|
|
14
|
+
or auditing an existing pipeline — use the npm-package-publishing skill instead.
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# NPM Trusted Publish
|
|
18
|
+
|
|
19
|
+
## Goal
|
|
20
|
+
|
|
21
|
+
Implement the same hardened npm trusted publishing pattern every time, without rediscovering the details from CI logs.
|
|
22
|
+
|
|
23
|
+
## Related skills
|
|
24
|
+
|
|
25
|
+
This skill generates and debugs the publish workflow file. For the surrounding security posture — account and repository 2FA, branch protection, GitHub publish environments, release-strategy choice, and sole-maintainer risk — use the `npm-package-publishing` skill. The two are complementary: `npm-package-publishing` decides how publishing should be set up, this skill writes and fixes the YAML that does it.
|
|
26
|
+
|
|
27
|
+
One number to keep consistent between the two: both skills use Node 24.8.0 or higher as the publish-step floor. Node 24.8.0 bundles npm 11.6.0, which already exceeds the npm CLI 11.5.1 minimum that trusted publishing requires, so on that floor no manual npm upgrade is needed. If a project must publish on an older Node, it has to upgrade npm to 11.5.1 or later first — the publish job retains a guard step for exactly that case.
|
|
28
|
+
|
|
29
|
+
## Workflow
|
|
30
|
+
|
|
31
|
+
1. Inspect `package.json`, `.npmrc`, lockfiles, and existing `.github/workflows/*.yml`.
|
|
32
|
+
2. Resolve every workflow dependency to its latest stable version at the moment the file is created, and pin each to the full-length commit SHA of that version. The SHAs in this skill's template are placeholders that will be out of date; never copy them verbatim. See "Pinning actions to current SHAs" below for the procedure.
|
|
33
|
+
3. Preserve pinned action SHAs when they already exist; annotate each with a version comment so Dependabot can bump it.
|
|
34
|
+
4. Drive the test and build jobs' Node version from the project's **existing** target, not from a number invented for this workflow. Read it from the repo's current `.nvmrc`, `.node-version`, `volta.node`, or CI config; if none exists, ask the developer rather than guessing. Use `node-version-file: .nvmrc` for these jobs (do not point them at `package.json`, which falls through to the `engines.node` range — an unbounded range like `>=20` resolves to the newest Node release, so CI silently floats away from the version developers actually run). `.nvmrc` is a development and CI file only; npm never reads it during a consumer install, so it does not constrain consumers.
|
|
35
|
+
5. Never raise the project's Node version, create a new `.nvmrc`, or overwrite an existing one to "match" the publish step. The publish step's Node 24.8.0 (step 11) is an isolated requirement of the publish action and must not propagate to `.nvmrc`, to `engines.node`, or to the test and build jobs. A project that targets Node 22 keeps testing and building on Node 22; only the final `npm publish` invocation runs on 24.8.0, and it does not rebuild the artifact. Conflating these two numbers is the most likely way this skill is misapplied — do not do it.
|
|
36
|
+
6. Ensure every job that reads the repo (including any reading `.nvmrc`) runs `actions/checkout` first.
|
|
37
|
+
7. Install pnpm with `pnpm/action-setup`, omitting the `version` input so the version is read from the `packageManager` field. Do not use Corepack: it is still marked experimental and downloads the package manager from the network on first use, which is an avoidable failure surface in a release pipeline.
|
|
38
|
+
8. `pnpm/action-setup` does not install Node.js, so always run `actions/setup-node` as a separate step.
|
|
39
|
+
9. Disable setup-node package-manager caching for release/publish workflows with `package-manager-cache: false`.
|
|
40
|
+
10. Set `persist-credentials: false` on every `actions/checkout` step unless a later step must push to git.
|
|
41
|
+
11. Target Node 24.8.0 or higher in the publish step. That floor bundles npm 11.6.0, which already exceeds the npm CLI 11.5.1 minimum trusted publishing requires, so no manual npm upgrade is needed there. Keep a guard step that upgrades npm only when the resolved Node ships an npm below 11.5.1, so the workflow stays correct if a project pins an older Node. An npm that is too old silently falls back to token auth or fails to attempt OIDC at all.
|
|
42
|
+
12. Pack into a dedicated artifact directory, usually `package/*.tgz`.
|
|
43
|
+
13. In the publish job, download the artifact to `package`, find the `.tgz`, and publish its resolved path.
|
|
44
|
+
14. Use GitHub OIDC trusted publishing, not npm tokens. Provenance is generated automatically under trusted publishing, so the `--provenance` flag is not required.
|
|
45
|
+
15. Add a `concurrency` group keyed on the release so two tag pushes cannot race into overlapping publishes.
|
|
46
|
+
|
|
47
|
+
## Package Metadata
|
|
48
|
+
|
|
49
|
+
Three different Node versions live in three different places, and keeping them separate is deliberate — conflating them is the main way this workflow goes wrong. `engines.node` in `package.json` is the _consumer_ floor: the only one that constrains people who install the package, and it should reflect what the package actually supports (npm warns, but does not hard-fail, when a consumer is outside it). The test and build jobs run on the project's _own_ target version, read from the existing `.nvmrc` (or `.node-version`/`volta.node`); this is never read during a consumer install, so it does not leak into the consumer contract. The publish step pins Node 24.8.0 or higher independently, purely because that floor bundles an npm new enough for OIDC. These three are not meant to agree: a repo can develop and test on Node 22, keep `engines.node` at its true support range, and still publish on Node 24 — all without affecting consumers, and without changing what the project builds and tests against.
|
|
50
|
+
|
|
51
|
+
The publish-step version must never be copied into the other two. Do not raise `engines.node` to 24.8.0, and do not set or bump `.nvmrc` to 24, to "make things consistent". Doing so would move the test and build jobs onto Node 24, so the package would be validated against a version above its actual target and a Node-22 incompatibility could ship uncaught. The publish job runs `npm publish` on the already-built tarball with scripts ignored, so its Node version never rebuilds or retests the code; it is inert with respect to the artifact.
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=20"
|
|
57
|
+
},
|
|
58
|
+
"packageManager": "pnpm@10.0.0",
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "git+https://github.com/OWNER/REPO.git"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The `engines.node` value above is the _consumer_ floor and should reflect what the package actually supports; `>=20` is only an example, and a bounded upper limit is sensible if the package genuinely needs one. Do not raise it to 24.8.0 to satisfy CI — the publish step pins its own Node version, and the test and build jobs read theirs from `.nvmrc`, so the trusted-publishing requirement never leaks into the consumer contract.
|
|
67
|
+
|
|
68
|
+
Because the test and build jobs read `.nvmrc`, that file must exist in the repository root with a single version line matching the project's target (for example `22`). If the repo already has one, use it as-is and do not change it. If it has none, derive the value from the project's existing Node target (`.node-version`, `volta.node`, the previous CI config, or by asking the developer) before creating it — do not default to the publish step's 24.8.0. Alternatively, point those jobs' `node-version` at the project's explicit version instead of using a file.
|
|
69
|
+
|
|
70
|
+
The `repository.url` field is not cosmetic. Provenance verification runs through Sigstore, which compares the repository in the OIDC token against `package.json`. A mismatch fails the publish with a 422 error that the user-facing npm docs do not explain. Make sure the owner/name in `repository.url` matches the repository actually running the workflow.
|
|
71
|
+
|
|
72
|
+
Do not add npm auth tokens for trusted publishing.
|
|
73
|
+
|
|
74
|
+
## Workflow Template
|
|
75
|
+
|
|
76
|
+
Use this shape for pnpm packages, adapting only names, test commands, and existing pinned action SHAs. The `@<sha>` values below are **placeholders**: before writing the file, resolve each action to its latest stable release and replace the placeholder with that release's full-length commit SHA, keeping the `# vX.Y.Z` comment accurate. Do not copy the example SHAs — see "Pinning actions to current SHAs".
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
# NOTE: every action SHA below is a PLACEHOLDER and is almost certainly out of date.
|
|
80
|
+
# Re-resolve each action to its latest stable release and pin to that SHA before use.
|
|
81
|
+
# See "Pinning actions to current SHAs".
|
|
82
|
+
name: Publish
|
|
83
|
+
|
|
84
|
+
on:
|
|
85
|
+
release:
|
|
86
|
+
types: [published]
|
|
87
|
+
|
|
88
|
+
permissions:
|
|
89
|
+
contents: read
|
|
90
|
+
|
|
91
|
+
concurrency:
|
|
92
|
+
group: publish-${{ github.event.release.tag_name }}
|
|
93
|
+
cancel-in-progress: false
|
|
94
|
+
|
|
95
|
+
jobs:
|
|
96
|
+
test:
|
|
97
|
+
name: Test
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
timeout-minutes: 60
|
|
100
|
+
permissions:
|
|
101
|
+
contents: read
|
|
102
|
+
steps:
|
|
103
|
+
- name: Checkout
|
|
104
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2 — PLACEHOLDER SHA, re-resolve before use
|
|
105
|
+
with:
|
|
106
|
+
persist-credentials: false
|
|
107
|
+
|
|
108
|
+
- name: Install pnpm
|
|
109
|
+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 — PLACEHOLDER SHA, re-resolve before use
|
|
110
|
+
# version is read from the packageManager field in package.json
|
|
111
|
+
|
|
112
|
+
- name: Setup Node.js
|
|
113
|
+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 — PLACEHOLDER SHA, re-resolve before use
|
|
114
|
+
with:
|
|
115
|
+
node-version-file: .nvmrc # exact dev/CI version; decoupled from engines.node
|
|
116
|
+
package-manager-cache: false
|
|
117
|
+
|
|
118
|
+
- name: Install dependencies
|
|
119
|
+
run: pnpm install --frozen-lockfile --ignore-scripts
|
|
120
|
+
|
|
121
|
+
- name: Check package
|
|
122
|
+
run: pnpm run package:check
|
|
123
|
+
|
|
124
|
+
- name: Run tests
|
|
125
|
+
run: pnpm test
|
|
126
|
+
|
|
127
|
+
build:
|
|
128
|
+
name: Pack package
|
|
129
|
+
needs: test
|
|
130
|
+
runs-on: ubuntu-latest
|
|
131
|
+
timeout-minutes: 10
|
|
132
|
+
permissions:
|
|
133
|
+
contents: read
|
|
134
|
+
steps:
|
|
135
|
+
- name: Checkout
|
|
136
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2 — PLACEHOLDER SHA, re-resolve before use
|
|
137
|
+
with:
|
|
138
|
+
persist-credentials: false
|
|
139
|
+
|
|
140
|
+
- name: Install pnpm
|
|
141
|
+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 — PLACEHOLDER SHA, re-resolve before use
|
|
142
|
+
|
|
143
|
+
- name: Setup Node.js
|
|
144
|
+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 — PLACEHOLDER SHA, re-resolve before use
|
|
145
|
+
with:
|
|
146
|
+
node-version-file: .nvmrc # exact dev/CI version; decoupled from engines.node
|
|
147
|
+
package-manager-cache: false
|
|
148
|
+
|
|
149
|
+
- name: Install dependencies
|
|
150
|
+
run: pnpm install --frozen-lockfile --ignore-scripts
|
|
151
|
+
|
|
152
|
+
- name: Create package directory
|
|
153
|
+
run: mkdir package
|
|
154
|
+
|
|
155
|
+
- name: Create package tarball
|
|
156
|
+
run: pnpm pack --pack-destination package
|
|
157
|
+
|
|
158
|
+
- name: Upload package tarball
|
|
159
|
+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 — PLACEHOLDER SHA, re-resolve before use
|
|
160
|
+
with:
|
|
161
|
+
name: npm-package
|
|
162
|
+
path: package/*.tgz
|
|
163
|
+
if-no-files-found: error
|
|
164
|
+
retention-days: 7
|
|
165
|
+
|
|
166
|
+
publish:
|
|
167
|
+
name: Publish to npm
|
|
168
|
+
needs: build
|
|
169
|
+
runs-on: ubuntu-latest
|
|
170
|
+
timeout-minutes: 10
|
|
171
|
+
environment: publish
|
|
172
|
+
permissions:
|
|
173
|
+
contents: read
|
|
174
|
+
id-token: write
|
|
175
|
+
steps:
|
|
176
|
+
- name: Checkout
|
|
177
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2 — PLACEHOLDER SHA, re-resolve before use
|
|
178
|
+
with:
|
|
179
|
+
persist-credentials: false
|
|
180
|
+
|
|
181
|
+
- name: Setup Node.js
|
|
182
|
+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 — PLACEHOLDER SHA, re-resolve before use
|
|
183
|
+
with:
|
|
184
|
+
# Pinned for the publish step only. 24.8.0 bundles npm 11.6.0, new enough
|
|
185
|
+
# for OIDC; this is independent of engines.node, the consumer floor.
|
|
186
|
+
node-version: 24.8.0
|
|
187
|
+
package-manager-cache: false
|
|
188
|
+
registry-url: https://registry.npmjs.org
|
|
189
|
+
|
|
190
|
+
- name: Ensure npm is new enough for trusted publishing
|
|
191
|
+
# No-op on Node >= 24.8.0; the guard only matters if Node is pinned lower.
|
|
192
|
+
run: |
|
|
193
|
+
required="11.5.1"
|
|
194
|
+
current="$(npm --version)"
|
|
195
|
+
if npx -y semver -r "<$required" --include-prerelease "$current" > /dev/null 2>&1; then
|
|
196
|
+
echo "npm $current is below $required; upgrading."
|
|
197
|
+
npm install -g npm@latest
|
|
198
|
+
fi
|
|
199
|
+
npm --version
|
|
200
|
+
|
|
201
|
+
- name: Download package tarball
|
|
202
|
+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9 — PLACEHOLDER SHA, re-resolve before use
|
|
203
|
+
with:
|
|
204
|
+
name: npm-package
|
|
205
|
+
path: package
|
|
206
|
+
|
|
207
|
+
- name: Publish to npm
|
|
208
|
+
run: |
|
|
209
|
+
tarball="$(find package -type f -name '*.tgz' -print -quit)"
|
|
210
|
+
|
|
211
|
+
if [ -z "$tarball" ]; then
|
|
212
|
+
echo "No package tarball found in downloaded artifact."
|
|
213
|
+
find package -maxdepth 3 -type f -print
|
|
214
|
+
exit 1
|
|
215
|
+
fi
|
|
216
|
+
|
|
217
|
+
npm publish "$(realpath "$tarball")" --ignore-scripts --access public
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Pinning actions to current SHAs
|
|
221
|
+
|
|
222
|
+
The template's SHAs are stale by design. Action versions and their commit SHAs change over time, so resolve them fresh whenever a `publish.yml` is created or reviewed. Pin to the full-length commit SHA, never a tag or branch, because a tag can be moved to point at malicious code after you have reviewed it.
|
|
223
|
+
|
|
224
|
+
There are two reliable ways to produce current pins.
|
|
225
|
+
|
|
226
|
+
The preferred approach is to let tooling resolve and pin for you. Write the workflow first using human-readable tags (for example `actions/checkout@v4`), then run `npx actions-up` in the repository to rewrite every `uses:` reference to the latest stable release pinned to its commit SHA, with a version comment appended. This is the same tool the `npm-package-publishing` skill recommends, and it removes the chance of a hand-typed SHA being wrong. After it runs, confirm each line carries a `@<40-hex-sha> # vX.Y.Z` form.
|
|
227
|
+
|
|
228
|
+
If resolving manually, for each action find the latest stable release tag, then read the exact commit that tag points to and pin that commit:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Latest stable release tag for an action (skips pre-releases)
|
|
232
|
+
gh release view --repo actions/checkout --json tagName --jq .tagName
|
|
233
|
+
|
|
234
|
+
# The commit SHA that the tag resolves to — pin THIS value
|
|
235
|
+
gh api repos/actions/checkout/git/refs/tags/v4.2.2 --jq .object.sha
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
For an annotated tag the first lookup may return a tag object rather than a commit; dereference it with `gh api repos/<owner>/<repo>/git/tags/<sha> --jq .object.sha` to reach the underlying commit. Pin the commit SHA, not the tag SHA.
|
|
239
|
+
|
|
240
|
+
Keep the pins current after creation by letting Dependabot manage action updates. This is why every `uses:` line carries a `# vX.Y.Z` comment: Dependabot reads the comment to know which version a SHA represents and to raise update PRs. The companion Dependabot configuration should include a `github-actions` ecosystem entry pointing at `/` so the publish workflow is covered. Periodically re-running `npx actions-up` is a reasonable backstop if Dependabot is not enabled.
|
|
241
|
+
|
|
242
|
+
## Checks
|
|
243
|
+
|
|
244
|
+
After edits:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
ruby -e 'require "yaml"; YAML.load_file(".github/workflows/publish.yml"); puts "YAML ok"'
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
If the project uses pnpm, validate packing without publishing:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
pack_dir="$(mktemp -d)"
|
|
254
|
+
pnpm pack --pack-destination "$pack_dir"
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Confirm no placeholder markers survived into the generated file, and that every action is pinned to a 40-character SHA rather than a tag:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Must print nothing
|
|
261
|
+
grep -n "PLACEHOLDER" .github/workflows/publish.yml
|
|
262
|
+
|
|
263
|
+
# Every uses: line must reference a 40-hex SHA, not a tag
|
|
264
|
+
if ! grep -qE "uses: [^@]+@" .github/workflows/publish.yml; then
|
|
265
|
+
echo "No uses lines found"
|
|
266
|
+
exit 1
|
|
267
|
+
fi
|
|
268
|
+
|
|
269
|
+
grep -nE "uses: [^@]+@[^ ]+" .github/workflows/publish.yml \
|
|
270
|
+
| grep -vE "@[0-9a-f]{40} " && echo "Unpinned action found" || echo "All actions SHA-pinned"
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Failure Clues
|
|
274
|
+
|
|
275
|
+
- `NODE_AUTH_TOKEN: ***` appears in the publish log: token auth is being used or injected. Trusted publishing should not need it.
|
|
276
|
+
- `E404 Not Found - PUT ... could not be found or you do not have permission`: often an auth/scope permission problem, especially if local manual publish works.
|
|
277
|
+
- `422 Unprocessable Entity` during publish with provenance: the repository in the OIDC token does not match `package.json`. Check `repository.url` first.
|
|
278
|
+
- npm silently publishing with a token despite trusted-publisher config: the runner's npm CLI is older than 11.5.1. This should not happen on the pinned Node 24.8.0 (which bundles npm 11.6.0); if the publish step was moved to an older Node, confirm the guard step actually upgraded npm and reported a version at or above 11.5.1.
|
|
279
|
+
- Tests or build now run on a newer Node than the project targets (for example Node 24 when the project is on 22): `.nvmrc` was created or bumped to match the publish step. Reset it to the project's actual target; the publish step's 24.8.0 must stay confined to the publish job.
|
|
280
|
+
- `package.json does not exist` from `setup-node`: the job uses `node-version-file` before checkout, or the publish job only downloaded an artifact.
|
|
281
|
+
- `pnpm/action-setup` cannot resolve a version: the `packageManager` field is missing, or the v6 bug in [pnpm/action-setup#227](https://github.com/pnpm/action-setup/issues/227) occasionally fails to read `packageManager` from `package.json` when `package_json_file` is set, causing version resolution to fail. Pin `pnpm/action-setup` to a known-good SHA and, if needed, set the `version` input explicitly as a fallback.
|
|
282
|
+
- Publishing an already-published version will fail even after the workflow is fixed.
|
|
283
|
+
|
|
284
|
+
## External Setup Reminder
|
|
285
|
+
|
|
286
|
+
Repo changes cannot create npm's trusted publisher entry. Remind the user to verify npm package settings:
|
|
287
|
+
|
|
288
|
+
- provider: GitHub Actions
|
|
289
|
+
- repository owner/name matches the repo
|
|
290
|
+
- workflow filename matches `.github/workflows/publish.yml`
|
|
291
|
+
- publish environment matches the workflow if npm is configured with one
|
|
292
|
+
- at least one allowed action is selected: configurations created after 20 May 2026 require explicitly selecting an allowed action (for example, allow `npm publish`), or the publish will be rejected
|
|
293
|
+
|
|
294
|
+
The first version of a brand-new package cannot be published via OIDC, because npm requires the package to exist before its trusted-publisher settings can be edited. Publish the initial version manually or with a token, then configure trusted publishing for subsequent releases.
|
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
# Refined Plan Mode
|
|
2
2
|
|
|
3
|
-
Use this skill when the user
|
|
3
|
+
Use this skill when the user asks to plan, review, revise, continue, checkpoint, handoff, reset, or execute work using Refined Plan Mode.
|
|
4
4
|
|
|
5
|
-
This skill is additive to the agent's current
|
|
5
|
+
This skill is additive to the agent's current planning guidance. It turns a plan into a versioned Markdown artifact that can be reviewed with line, range, and text-selection comments. The agent remains responsible for reading feedback, revising the plan, and moving only when the user has approved the plan or explicitly asks to proceed.
|
|
6
6
|
|
|
7
7
|
## Core Protocol
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
Before deciding what to do, inspect the local `.plan-review` state:
|
|
10
|
+
|
|
11
|
+
- `.plan-review/.current-version`
|
|
12
|
+
- `.plan-review/approved-plan.md`
|
|
13
|
+
- `.plan-review/plans/`
|
|
14
|
+
- `.plan-review/feedback/`
|
|
15
|
+
|
|
16
|
+
Then choose the next state transition:
|
|
17
|
+
|
|
18
|
+
1. If `.plan-review/approved-plan.md` exists, read it and execute the approved plan carefully.
|
|
19
|
+
2. If a current version exists and `.plan-review/feedback/plan-vN-feedback.json` exists for it, read the current plan and feedback, address every feedback item in a revised next plan version, update `.plan-review/.current-version`, and stop for review.
|
|
20
|
+
3. If a current version exists with no feedback and no approval, report that the plan is awaiting review and include the reviewer launch command.
|
|
21
|
+
4. If no current plan exists, clarify only what is necessary, inspect the repository enough to produce a useful plan, write `.plan-review/plans/plan-v1.md`, write `v1` to `.plan-review/.current-version`, and stop for review.
|
|
22
|
+
|
|
23
|
+
Users can ask for checkpoint, handoff, or reset in natural language:
|
|
24
|
+
|
|
25
|
+
- For a checkpoint, report the current version, latest plan path, feedback status, approval status, and recommended next action.
|
|
26
|
+
- For a handoff, summarize the goal, current plan, feedback status, approval status, important assumptions, unresolved decisions, and recommended next action.
|
|
27
|
+
- For a reset, empty only `.plan-review` while keeping the `.plan-review` directory itself. Do not remove source files or any other workspace files.
|
|
18
28
|
|
|
19
29
|
## File Convention
|
|
20
30
|
|
|
@@ -58,6 +68,24 @@ Prefer this structure unless the task clearly calls for something else:
|
|
|
58
68
|
|
|
59
69
|
Keep the plan practical. Include file paths, commands, and decision points when known. Call out assumptions explicitly instead of hiding uncertainty inside confident prose.
|
|
60
70
|
|
|
71
|
+
## Reviewer Launch Command
|
|
72
|
+
|
|
73
|
+
Whenever you write or advance to a plan version that is ready for user review, include a command the user can run from the Refined Plan Mode project root.
|
|
74
|
+
|
|
75
|
+
Prefer an absolute path to the target project's `.plan-review` directory when you know it:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
PLAN_REVIEW_DIR=/absolute/path/to/project/.plan-review vp dev --host 127.0.0.1 --port 5173
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
If only a home-relative path is known, shell expansion is acceptable:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
PLAN_REVIEW_DIR=~/dev/target-project/.plan-review vp dev --host 127.0.0.1 --port 5173
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Use the toolchain command documented by the Refined Plan Mode project. For the Vite+ project, use `vp dev` rather than invoking the package manager directly.
|
|
88
|
+
|
|
61
89
|
## Feedback Handling
|
|
62
90
|
|
|
63
91
|
When feedback exists:
|
|
@@ -78,6 +106,7 @@ In conversation, keep updates brief:
|
|
|
78
106
|
|
|
79
107
|
- Say which plan version was written.
|
|
80
108
|
- Say where feedback should be submitted.
|
|
109
|
+
- Include the reviewer launch command when a plan is ready for review.
|
|
81
110
|
- Say which feedback file was read when revising.
|
|
82
111
|
- Say when the plan is approved and execution is beginning.
|
|
83
112
|
|