Skip to content

Commit 7361d29

Browse files
committed
fix(skills): add release config script validation step
Add Step 7b to the release skill that verifies all script references in .versionrc.json and package.json lifecycle hooks point to files that actually exist. Also fix .js → .ts reference in the skill docs. Prevents the class of review comments seen on #822 where broken script paths went undetected until reviewers caught them.
1 parent 381b1aa commit 7361d29

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

.claude/skills/release/SKILL.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Edit `package.json` to set `"version": "VERSION"`.
7676
Also bump `crates/codegraph-core/Cargo.toml` — set the `version` field in `[package]` to match `VERSION`. This keeps the Rust crate version in sync with the npm package.
7777

7878
**Do NOT bump:**
79-
- `optionalDependencies` versions — synced automatically by `scripts/sync-native-versions.js` during the publish workflow
79+
- `optionalDependencies` versions — synced automatically by `scripts/sync-native-versions.ts` during the publish workflow
8080

8181
Then run `npm install --package-lock-only` to update `package-lock.json`.
8282

@@ -171,6 +171,28 @@ If the count is less than 3, manually restore the missing fields:
171171

172172
Place the `libc` array after the `cpu` array in each entry.
173173

174+
## Step 7b: Validate release config scripts
175+
176+
Verify that all script references in release-related config files point to files that actually exist. Broken references cause silent failures during `npm run release` or the publish workflow.
177+
178+
Check these files for script paths:
179+
180+
```bash
181+
# .versionrc.json — check any "scripts" entries
182+
grep -oP 'node \K[^ "]+' .versionrc.json 2>/dev/null | while read script; do
183+
[ ! -f "$script" ] && echo "ERROR: .versionrc.json references '$script' but it does not exist"
184+
done
185+
186+
# package.json — check version/preversion/postversion lifecycle hooks
187+
grep -E '"(pre)?version"|"postversion"' package.json | grep -oP 'node \K[^ "&]+' | while read script; do
188+
[ ! -f "$script" ] && echo "ERROR: package.json lifecycle references '$script' but it does not exist"
189+
done
190+
```
191+
192+
If any script reference is broken, fix it before proceeding. Common causes:
193+
- `.js` extension referencing a `.ts`-only file (use `node scripts/node-ts.js scripts/<name>.ts` instead)
194+
- Redundant script entries that duplicate what npm lifecycle hooks already handle (remove them)
195+
174196
## Step 8: Create branch, commit, push, PR
175197

176198
1. Create branch: `git checkout -b release/VERSION` (if on detached HEAD from Step 0, this creates the branch at the current commit)

0 commit comments

Comments
 (0)