verify-before-npm-publish

Installation
SKILL.md

Verify before publish

The examples/ app is a real consumer: its own package.json pins a published pangu, its own tsconfig.json resolves under NodeNext, and its checks reach pangu through node_modules and the exports map. That is exactly the path pangu's own build never takes, because the build resolves src/ directly, sibling file to sibling file. So a .d.ts with a bare relative import, or a file the files list forgot to ship, reaches npm green.

This skill briefly repoints that consumer at the freshly packed tarball instead of its published pin, runs every example check against it, and restores the pin. The packed tarball is the only honest artifact. Repointing is also what lets the check run before publish at all: pangu's next version is not on the registry yet, so the pin cannot resolve until the tarball stands in for it.

Run the verification

Everything below runs as one command so the trap restores examples/package.json whether the checks pass, fail, or error midway. Never split it.

The checks capture their exit code explicitly instead of leaning on set -e to abort. Some runners (Claude Code's Bash tool among them) invoke this in a shell where set -e does not stop the script, and a bare echo "VERIFY OK" after an unguarded npm run verify then prints a pass over a real failure. Report the VERIFY OK / VERIFY FAILED line, never the tool's own exit status.

set -eu
fail() { echo "VERIFY FAILED ($1)"; exit 1; }
Installs
1
Repository
vinta/pangu.js
GitHub Stars
4.8K
First Seen
Oct 6, 2026