diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 815d3b4b02..65beaefb7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -267,9 +267,24 @@ npm run check:fast `npm ci` installs the exact dependencies and prepares the Husky hooks without building the project. Git hooks use the Node.js first on `PATH` where Git runs, which `nvm use` in one terminal does not change for IDEs, Git clients or -agents. If your default Node.js is outside `package.json#engines`, put the -pinned version first for hooks in `~/.config/husky/init.sh`, for example -`export PATH="$HOME/.nvm/versions/node/v24.22.1/bin:$PATH"`. Run `npm run build:cached` when you need the standalone +agents. If your default Node.js is outside `package.json#engines`, Husky reads +`~/.config/husky/init.sh` before every hook in every repository that uses it, +so select each repository's `.nvmrc` version there rather than one fixed +version: + +```sh +if [ -f .nvmrc ] && [ -s "${NVM_DIR:-$HOME/.nvm}/nvm.sh" ]; then + export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" + . "$NVM_DIR/nvm.sh" --no-use + nvm use --silent >/dev/null 2>&1 || true +fi +``` + +`nvm use` resolves full versions, major versions and aliases such as +`lts/*`. Repositories without an `.nvmrc`, or whose version is not installed, +keep the default Node.js. + +Run `npm run build:cached` when you need the standalone CLI or MCP server; it compiles the runtime and bundles the authored skill. `npm run build` forces those tasks to rerun. Neither command generates test catalogs, documentation projections, or managed verification evidence. Turbo