From d89ddf0c7490a2568e4fe62523feb4ae27498faa Mon Sep 17 00:00:00 2001 From: KeiSei84 <2206745@gmail.com> Date: Fri, 22 May 2026 16:53:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(install):=20normalize=20null=20hook=20match?= =?UTF-8?q?er=20=E2=86=92=20""=20on=20merge=20(Claude=20Code=20/doctor)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Users with pre-kit hooks that have no `matcher` field end up with matcher:null, which Claude Code /doctor rejects ("Expected string, but received null") and skips the whole settings file. The jq merge preserved null as-is, so every reinstall re-surfaced the error. Now map(.matcher //= "") before group_by → null/absent collapses to "" (match-all), one group per matcher. Co-Authored-By: Claude Opus 4.7 (1M context) --- install/lib-hooks.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install/lib-hooks.sh b/install/lib-hooks.sh index 518c64e..98d375b 100644 --- a/install/lib-hooks.sh +++ b/install/lib-hooks.sh @@ -60,6 +60,10 @@ _jq_merge_hooks() { | reduce ($add.hooks | keys[]) as $phase ($orig; .hooks[$phase] = ( ((.hooks[$phase] // []) + ($add.hooks[$phase] // [])) + # Normalize null/absent matcher → "" (Claude Code /doctor rejects null; + # user's pre-kit hooks often have no matcher field). Before group_by so + # null + "" collapse into one group. + | map(.matcher //= "") | group_by(.matcher) | map( .[0].matcher as $m