Skip to content

Commit 8a46725

Browse files
claude[bot]claude
andcommitted
fix: move prepare lifecycle hook to explicit setup-hooks script
npm's prepare hook runs on every `npm install` in any environment, causing the package to silently install git hooks into any consumer's repository without their explicit consent. This is unexpected behavior for a plugin package consumed by end users. Rename prepare to setup-hooks so contributors can opt in explicitly by running `npm run setup-hooks` after cloning, as now documented in CONTRIBUTING.md. Co-Authored-By: Claude Code <noreply@anthropic.com>
1 parent 16c5c8b commit 8a46725

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ PRs may receive AI-assisted reviews (Copilot, Claude, Gemini, Codex) at the owne
3131

3232
## Before You Start
3333

34+
### First-Time Setup
35+
36+
After cloning the repo, install git hooks manually:
37+
38+
```bash
39+
npm install
40+
npm run setup-hooks
41+
```
42+
43+
The `setup-hooks` script installs pre-commit and pre-push hooks into your local `.git/hooks/`. It does **not** run automatically on `npm install` — you must opt in.
44+
3445
### Multi-File Changes
3546

3647
For changes touching multiple files, **read the relevant checklist first**:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"detect": "node bin/dev-cli.js detect",
3939
"verify": "node bin/dev-cli.js verify",
4040
"version": "node scripts/stamp-version.js && git add -A",
41-
"prepare": "node bin/dev-cli.js setup-hooks"
41+
"setup-hooks": "node bin/dev-cli.js setup-hooks"
4242
},
4343
"repository": {
4444
"type": "git",

0 commit comments

Comments
 (0)