From f627118b2c1a90ab5f68f66a939b2bb8d11337df Mon Sep 17 00:00:00 2001 From: moh Date: Sun, 20 Sep 2026 18:54:55 +0200 Subject: [PATCH] CONFIGURED - Auto-activate git hooks via npm prepare script Add a prepare script that runs 'git config core.hooksPath .githooks' on every npm install, so the commit-msg style gate and pre-push test gate turn on automatically per clone with nothing to remember. Guarded with '|| true' so installs never fail where git is absent (e.g. tarball deploys). Document that the deploy server never needs it since it only pulls. --- CLAUDE.md | 7 +++++-- package.json | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 167d351..7076cca 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -150,5 +150,8 @@ Do **not** add any `Co-Authored-By` / "Generated with Claude Code" attribution lines to commits in this repo. Write the body (when useful) as wrapped prose or bullet points explaining the *why*, matching the existing history. -The hook and the test gate are activated per clone with: -`git config core.hooksPath .githooks` (emergency skip: `git commit --no-verify`). \ No newline at end of file +The hook (and the `pre-push` test gate) live in `.githooks/` and are activated +per clone via `core.hooksPath`. You don't need to remember this: the `prepare` +npm script runs `git config core.hooksPath .githooks` automatically on every +`npm install`. The deploy server does not need it — it only pulls, never commits +or pushes, so no hook ever fires there. Emergency skip: `git commit --no-verify`. \ No newline at end of file diff --git a/package.json b/package.json index e7996e3..ed27761 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { + "prepare": "git config core.hooksPath .githooks || true", "dev": "next dev -p 3014", "build": "next build --webpack", "start": "next start",