oh-my-customcode 1.1.91 → 1.1.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli/index.js +118 -2
- package/dist/index.js +118 -2
- package/package.json +3 -2
- package/templates/.claude/hooks/hooks.json +46 -46
- package/templates/.claude/hooks/scripts/rule-deletion-guard.sh +1 -1
- package/templates/.claude/hooks/scripts/schema-validator.sh +5 -1
- package/templates/.claude/hooks/skill-count-reminder.sh +5 -1
- package/templates/.claude/rules/MAY-optimization.md +2 -0
- package/templates/.claude/rules/MUST-enforcement-policy.md +1 -1
- package/templates/.claude/settings.json +46 -46
- package/templates/.claude/skills/pipeline/workflows/auto-dev.yaml +56 -10
- package/templates/guides/claude-code/15-version-compatibility.md +149 -0
- package/templates/guides/hook-data-flow/README.md +4 -2
- package/templates/manifest.json +1 -1
- package/templates/workflows/auto-dev.yaml +56 -10
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"hooks": [
|
|
8
8
|
{
|
|
9
9
|
"type": "command",
|
|
10
|
-
"command": "bash
|
|
10
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/stage-blocker.sh\""
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
13
|
"description": "Block Write/Edit tools during plan/verify/compound stages — only allow in implement stage"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"hooks": [
|
|
68
68
|
{
|
|
69
69
|
"type": "command",
|
|
70
|
-
"command": "bash
|
|
70
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/content-hash-validator.sh\""
|
|
71
71
|
}
|
|
72
72
|
],
|
|
73
73
|
"description": "Validate file content hash before Edit — advisory staleness warning"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"hooks": [
|
|
78
78
|
{
|
|
79
79
|
"type": "command",
|
|
80
|
-
"command": "bash
|
|
80
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/schema-validator.sh\""
|
|
81
81
|
}
|
|
82
82
|
],
|
|
83
83
|
"description": "Schema-based tool input validation — Phase 1 advisory only"
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"hooks": [
|
|
88
88
|
{
|
|
89
89
|
"type": "command",
|
|
90
|
-
"command": "bash
|
|
90
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/rtk-intercept.sh\""
|
|
91
91
|
}
|
|
92
92
|
],
|
|
93
93
|
"description": "RTK auto-intercept — transparently rewrites CLI commands through RTK proxy when available (R013 advisory)"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"hooks": [
|
|
98
98
|
{
|
|
99
99
|
"type": "command",
|
|
100
|
-
"command": "bash
|
|
100
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/destructive-git-guard.sh\""
|
|
101
101
|
}
|
|
102
102
|
],
|
|
103
103
|
"description": "Warn before destructive git commands — advisory recovery guidance (R001/R021)"
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"hooks": [
|
|
108
108
|
{
|
|
109
109
|
"type": "command",
|
|
110
|
-
"command": "bash
|
|
110
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/rule-deletion-guard.sh\""
|
|
111
111
|
}
|
|
112
112
|
],
|
|
113
113
|
"description": "Block rule file deletion — requires individual user confirmation per rule (R001 safety)"
|
|
@@ -121,15 +121,15 @@
|
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
"type": "command",
|
|
124
|
-
"command": "bash
|
|
124
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/git-delegation-guard.sh\""
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
"type": "command",
|
|
128
|
-
"command": "bash
|
|
128
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/agent-teams-advisor.sh\""
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
"type": "command",
|
|
132
|
-
"command": "bash
|
|
132
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/model-escalation-advisor.sh\""
|
|
133
133
|
}
|
|
134
134
|
],
|
|
135
135
|
"description": "HUD statusline + R010 git delegation guard + R018 Agent Teams advisor on Agent/Task spawn"
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"hooks": [
|
|
142
142
|
{
|
|
143
143
|
"type": "command",
|
|
144
|
-
"command": "
|
|
144
|
+
"command": "\"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/omcustom-auto-update.sh\""
|
|
145
145
|
}
|
|
146
146
|
],
|
|
147
147
|
"description": "Interactive oh-my-customcode update check at session start (#752)"
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"hooks": [
|
|
152
152
|
{
|
|
153
153
|
"type": "command",
|
|
154
|
-
"command": "bash
|
|
154
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/session-env-check.sh\""
|
|
155
155
|
}
|
|
156
156
|
],
|
|
157
157
|
"description": "Check codex CLI and Agent Teams availability at session start"
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"hooks": [
|
|
162
162
|
{
|
|
163
163
|
"type": "command",
|
|
164
|
-
"command": "bash
|
|
164
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/stale-todo-scanner.sh\""
|
|
165
165
|
}
|
|
166
166
|
],
|
|
167
167
|
"description": "Scan TODO.md files for stale items at session start"
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"hooks": [
|
|
172
172
|
{
|
|
173
173
|
"type": "command",
|
|
174
|
-
"command": "bash
|
|
174
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/adaptive-harness-scan.sh\""
|
|
175
175
|
}
|
|
176
176
|
],
|
|
177
177
|
"description": "Lightweight project profile staleness check for adaptive harness (#831)"
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"hooks": [
|
|
182
182
|
{
|
|
183
183
|
"type": "command",
|
|
184
|
-
"command": "bash
|
|
184
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/session-autofix.sh\""
|
|
185
185
|
}
|
|
186
186
|
],
|
|
187
187
|
"description": "Auto-detect and fix previous session issues at start (#838)"
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"hooks": [
|
|
192
192
|
{
|
|
193
193
|
"type": "command",
|
|
194
|
-
"command": "bash
|
|
194
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/plugin-cache-check.sh\""
|
|
195
195
|
}
|
|
196
196
|
],
|
|
197
197
|
"description": "Advisory check for plugin cache directories missing node_modules (#1207)"
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
"hooks": [
|
|
202
202
|
{
|
|
203
203
|
"type": "command",
|
|
204
|
-
"command": "bash
|
|
204
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/claude-md-reinject.sh\""
|
|
205
205
|
}
|
|
206
206
|
],
|
|
207
207
|
"description": "Re-inject project CLAUDE.md into model context on compact re-entry only — CC already natively auto-loads CLAUDE.md on startup/resume/clear, so re-injecting there is pure duplication (~13.8KB/session); matcher narrowed to \"compact\" to keep the original #1617 purpose (post-compact amnesia defense) without the startup double-injection (#1626)"
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
"hooks": [
|
|
214
214
|
{
|
|
215
215
|
"type": "command",
|
|
216
|
-
"command": "bash
|
|
216
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/user-prompt-preprocessor.sh\""
|
|
217
217
|
}
|
|
218
218
|
],
|
|
219
219
|
"description": "Advisory pre-processing of user input — skill matching hints and intent analysis"
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
"hooks": [
|
|
224
224
|
{
|
|
225
225
|
"type": "command",
|
|
226
|
-
"command": "bash
|
|
226
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/r007-r008-drift-advisor.sh\""
|
|
227
227
|
}
|
|
228
228
|
],
|
|
229
229
|
"description": "Proactive R007/R008 drift advisory — checks last assistant turn for identification omission (#1229)"
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
"hooks": [
|
|
234
234
|
{
|
|
235
235
|
"type": "command",
|
|
236
|
-
"command": "bash
|
|
236
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/session-autofix-prompt.sh\""
|
|
237
237
|
}
|
|
238
238
|
],
|
|
239
239
|
"description": "Inject session auto-fix findings into first user prompt (#838)"
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
"hooks": [
|
|
244
244
|
{
|
|
245
245
|
"type": "command",
|
|
246
|
-
"command": "bash
|
|
246
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/fail-axis-cause-advisor.sh\""
|
|
247
247
|
}
|
|
248
248
|
],
|
|
249
249
|
"description": "Advisory on cause-free progress nudges when this session has logged tool failures — delivers via hookSpecificOutput.additionalContext (#1561)"
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
},
|
|
260
260
|
{
|
|
261
261
|
"type": "command",
|
|
262
|
-
"command": "bash
|
|
262
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/agent-start-recorder.sh\""
|
|
263
263
|
}
|
|
264
264
|
],
|
|
265
265
|
"description": "HUD display + agent start time recording for stall detection (R009)"
|
|
@@ -271,23 +271,23 @@
|
|
|
271
271
|
"hooks": [
|
|
272
272
|
{
|
|
273
273
|
"type": "command",
|
|
274
|
-
"command": "bash
|
|
274
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/task-outcome-recorder.sh\""
|
|
275
275
|
},
|
|
276
276
|
{
|
|
277
277
|
"type": "command",
|
|
278
|
-
"command": "bash
|
|
278
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/stall-detection-advisor.sh\""
|
|
279
279
|
},
|
|
280
280
|
{
|
|
281
281
|
"type": "command",
|
|
282
|
-
"command": "bash
|
|
282
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/auto-continue-guard.sh\""
|
|
283
283
|
},
|
|
284
284
|
{
|
|
285
285
|
"type": "command",
|
|
286
|
-
"command": "bash
|
|
286
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/r007-r008-drift-advisor.sh\""
|
|
287
287
|
},
|
|
288
288
|
{
|
|
289
289
|
"type": "command",
|
|
290
|
-
"command": "bash
|
|
290
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/subagent-failure-advisor.sh\""
|
|
291
291
|
}
|
|
292
292
|
],
|
|
293
293
|
"description": "Record agent outcomes + auto-continue workflow + R007/R008 drift advisory + failure advisory on subagent completion (autonomous-loop re-entry, #1545; #1631 replaced the self-referential prompt-type judge hook with an advisory-only command hook)"
|
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
"hooks": [
|
|
300
300
|
{
|
|
301
301
|
"type": "command",
|
|
302
|
-
"command": "bash
|
|
302
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/cwd-change-detector.sh\""
|
|
303
303
|
}
|
|
304
304
|
],
|
|
305
305
|
"description": "Auto-detect project type on working directory change (v2.1.83+)"
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
"hooks": [
|
|
312
312
|
{
|
|
313
313
|
"type": "command",
|
|
314
|
-
"command": "bash
|
|
314
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/file-change-validator.sh\""
|
|
315
315
|
}
|
|
316
316
|
],
|
|
317
317
|
"description": "Validate externally modified files — advisory staleness warning (v2.1.83+)"
|
|
@@ -371,7 +371,7 @@
|
|
|
371
371
|
"hooks": [
|
|
372
372
|
{
|
|
373
373
|
"type": "command",
|
|
374
|
-
"command": "bash
|
|
374
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/task-state-precompact.sh\""
|
|
375
375
|
}
|
|
376
376
|
],
|
|
377
377
|
"description": "Serialize active task state before compaction — pairs with PostCompact restore (#922)"
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
"hooks": [
|
|
470
470
|
{
|
|
471
471
|
"type": "command",
|
|
472
|
-
"command": "bash
|
|
472
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/context-budget-advisor.sh\"",
|
|
473
473
|
"continueOnBlock": true
|
|
474
474
|
}
|
|
475
475
|
],
|
|
@@ -480,7 +480,7 @@
|
|
|
480
480
|
"hooks": [
|
|
481
481
|
{
|
|
482
482
|
"type": "command",
|
|
483
|
-
"command": "bash
|
|
483
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/r007-r008-drift-advisor.sh\"",
|
|
484
484
|
"continueOnBlock": true
|
|
485
485
|
}
|
|
486
486
|
],
|
|
@@ -491,7 +491,7 @@
|
|
|
491
491
|
"hooks": [
|
|
492
492
|
{
|
|
493
493
|
"type": "command",
|
|
494
|
-
"command": "bash
|
|
494
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/stuck-detector.sh\"",
|
|
495
495
|
"continueOnBlock": true
|
|
496
496
|
}
|
|
497
497
|
],
|
|
@@ -502,7 +502,7 @@
|
|
|
502
502
|
"hooks": [
|
|
503
503
|
{
|
|
504
504
|
"type": "command",
|
|
505
|
-
"command": "bash
|
|
505
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/cost-cap-advisor.sh\"",
|
|
506
506
|
"continueOnBlock": true
|
|
507
507
|
}
|
|
508
508
|
],
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
"hooks": [
|
|
514
514
|
{
|
|
515
515
|
"type": "command",
|
|
516
|
-
"command": "bash
|
|
516
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/content-hash-validator.sh\""
|
|
517
517
|
}
|
|
518
518
|
],
|
|
519
519
|
"description": "Store content hashes for Read operations — enables Edit staleness detection"
|
|
@@ -523,7 +523,7 @@
|
|
|
523
523
|
"hooks": [
|
|
524
524
|
{
|
|
525
525
|
"type": "command",
|
|
526
|
-
"command": "bash
|
|
526
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/secret-filter.sh\""
|
|
527
527
|
}
|
|
528
528
|
],
|
|
529
529
|
"description": "Detect potential secrets in Bash/Read/Grep output — advisory warning only"
|
|
@@ -533,7 +533,7 @@
|
|
|
533
533
|
"hooks": [
|
|
534
534
|
{
|
|
535
535
|
"type": "command",
|
|
536
|
-
"command": "bash
|
|
536
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/audit-log.sh\""
|
|
537
537
|
}
|
|
538
538
|
],
|
|
539
539
|
"description": "Append-only audit log for state-changing tool operations"
|
|
@@ -543,7 +543,7 @@
|
|
|
543
543
|
"hooks": [
|
|
544
544
|
{
|
|
545
545
|
"type": "command",
|
|
546
|
-
"command": "bash
|
|
546
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/skill-count-reminder.sh\"",
|
|
547
547
|
"continueOnBlock": true
|
|
548
548
|
}
|
|
549
549
|
],
|
|
@@ -554,7 +554,7 @@
|
|
|
554
554
|
"hooks": [
|
|
555
555
|
{
|
|
556
556
|
"type": "command",
|
|
557
|
-
"command": "bash
|
|
557
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/playwright-compress.sh\""
|
|
558
558
|
}
|
|
559
559
|
],
|
|
560
560
|
"description": "Layer 4: Compress Playwright/Chrome MCP output via Haiku summarization"
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
"hooks": [
|
|
565
565
|
{
|
|
566
566
|
"type": "command",
|
|
567
|
-
"command": "bash
|
|
567
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/auto-dev-token-tracker.sh\""
|
|
568
568
|
}
|
|
569
569
|
],
|
|
570
570
|
"description": "auto-dev token spend tracker — records per-phase token estimates during /pipeline auto-dev (Issue #1057, advisory)"
|
|
@@ -576,7 +576,7 @@
|
|
|
576
576
|
"hooks": [
|
|
577
577
|
{
|
|
578
578
|
"type": "command",
|
|
579
|
-
"command": "bash
|
|
579
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/stop-console-audit.sh\""
|
|
580
580
|
}
|
|
581
581
|
],
|
|
582
582
|
"description": "Final console.log audit and session diagnostics before session ends"
|
|
@@ -586,7 +586,7 @@
|
|
|
586
586
|
"hooks": [
|
|
587
587
|
{
|
|
588
588
|
"type": "command",
|
|
589
|
-
"command": "bash
|
|
589
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/eval-core-batch-save.sh\""
|
|
590
590
|
}
|
|
591
591
|
],
|
|
592
592
|
"description": "Batch-save agent outcomes to eval-core DB on session end (advisory, exit 0)"
|
|
@@ -596,7 +596,7 @@
|
|
|
596
596
|
"hooks": [
|
|
597
597
|
{
|
|
598
598
|
"type": "command",
|
|
599
|
-
"command": "bash
|
|
599
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/feedback-collector.sh\""
|
|
600
600
|
}
|
|
601
601
|
],
|
|
602
602
|
"description": "Auto-extract failure patterns from session outcomes (advisory, exit 0)"
|
|
@@ -606,7 +606,7 @@
|
|
|
606
606
|
"hooks": [
|
|
607
607
|
{
|
|
608
608
|
"type": "command",
|
|
609
|
-
"command": "bash
|
|
609
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/session-reflection.sh\""
|
|
610
610
|
}
|
|
611
611
|
],
|
|
612
612
|
"description": "Transcript-based self-reflection: detect R007/R008 violations and log to .claude/outputs/reflections/ (Phase 1 MVP, advisory, exit 0)"
|
|
@@ -616,7 +616,7 @@
|
|
|
616
616
|
"hooks": [
|
|
617
617
|
{
|
|
618
618
|
"type": "command",
|
|
619
|
-
"command": "bash
|
|
619
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/skill-extractor-analyzer.sh\""
|
|
620
620
|
}
|
|
621
621
|
],
|
|
622
622
|
"description": "Detect reusable skill candidates from session task outcomes (advisory, exit 0)"
|
|
@@ -626,7 +626,7 @@
|
|
|
626
626
|
"hooks": [
|
|
627
627
|
{
|
|
628
628
|
"type": "command",
|
|
629
|
-
"command": "bash
|
|
629
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/auto-dev-token-summary.sh\""
|
|
630
630
|
}
|
|
631
631
|
],
|
|
632
632
|
"description": "Print auto-dev token spend summary on session end (Issue #1057, advisory)"
|
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
"hooks": [
|
|
639
639
|
{
|
|
640
640
|
"type": "command",
|
|
641
|
-
"command": "bash
|
|
641
|
+
"command": "bash \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/scripts/failure-ledger.sh\""
|
|
642
642
|
}
|
|
643
643
|
],
|
|
644
644
|
"description": "FAIL-axis instrumentation — append tool failures to the error ledger (JSONL). Never blocks; feeds fail-axis-cause-advisor.sh (#1561)"
|
|
@@ -13,7 +13,7 @@ if ! command -v jq &>/dev/null; then
|
|
|
13
13
|
fi
|
|
14
14
|
|
|
15
15
|
# Parse tool input
|
|
16
|
-
tool=$(printf '%s\n' "$input" | jq -r '.tool // ""' 2>/dev/null) || { printf '%s\n' "$input"; exit 0; }
|
|
16
|
+
tool=$(printf '%s\n' "$input" | jq -r '.tool_name // .tool // ""' 2>/dev/null) || { printf '%s\n' "$input"; exit 0; }
|
|
17
17
|
cmd=$(printf '%s\n' "$input" | jq -r '.tool_input.command // ""' 2>/dev/null) || { printf '%s\n' "$input"; exit 0; }
|
|
18
18
|
|
|
19
19
|
# Only check Bash tool
|
|
@@ -21,7 +21,11 @@ tool_name=$(printf '%s\n' "$input" | jq -r '.tool_name? // "unknown"')
|
|
|
21
21
|
tool_input=$(printf '%s\n' "$input" | jq -c 'if (.tool_input? | type) == "object" then .tool_input else {} end' 2>/dev/null) || tool_input='{}'
|
|
22
22
|
[ -n "$tool_input" ] || tool_input='{}'
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
# Locate the repo root ourselves (#1767): hooks run in the session cwd, which may be
|
|
25
|
+
# a subdirectory. Prefer CLAUDE_PROJECT_DIR; fall back to this script's own location
|
|
26
|
+
# (<root>/.claude/hooks/scripts/ -> three levels up).
|
|
27
|
+
ROOT="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)}"
|
|
28
|
+
SCHEMA_FILE="$ROOT/.claude/schemas/tool-inputs.json"
|
|
25
29
|
|
|
26
30
|
# Skip if schema file doesn't exist
|
|
27
31
|
if [ ! -f "$SCHEMA_FILE" ]; then
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
|
|
8
|
+
# Locate the repo root ourselves: hooks run in the session cwd, which may be a subdirectory
|
|
9
|
+
ROOT="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}"
|
|
10
|
+
|
|
8
11
|
# Read tool input from stdin
|
|
9
12
|
INPUT=$(cat)
|
|
10
13
|
|
|
@@ -14,7 +17,8 @@ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path //
|
|
|
14
17
|
# Only trigger for .claude/skills/ paths with SKILL.md
|
|
15
18
|
if [[ "$FILE_PATH" == *".claude/skills/"*"SKILL.md"* ]]; then
|
|
16
19
|
SKILL_NAME=$(echo "$FILE_PATH" | sed 's|.*\.claude/skills/||' | sed 's|/SKILL.md||')
|
|
17
|
-
|
|
20
|
+
# '|| true' keeps the advisory contract (exit 0) even if the skills directory is missing under pipefail
|
|
21
|
+
ACTUAL_COUNT=$( { find "$ROOT/.claude/skills" -name 'SKILL.md' 2>/dev/null || true; } | wc -l | tr -d ' ')
|
|
18
22
|
|
|
19
23
|
cat >&2 << EOF
|
|
20
24
|
─── [Skill Sync Reminder] New/modified skill: ${SKILL_NAME} ───
|
|
@@ -86,6 +86,8 @@ zsh는 미인용 `$var`를 단어분할하지 않습니다(#1683 #5) — 분할
|
|
|
86
86
|
|
|
87
87
|
도구 이름 ≠ 그 프로그램(#1590): 사용 전 `type <tool>`로 실체를 확인합니다 — 이 저장소 Bash의 `grep`은 `.gitignore`를 존중하는 셸 함수이므로 저장소 전수조사는 `git grep`을 표준으로 합니다.
|
|
88
88
|
|
|
89
|
+
Bash `cd`는 세션 cwd로 남습니다(#1778, #1767): 훅 명령은 `CLAUDE_PROJECT_DIR`로 고정되어 지속 `cd`에 영향받지 않지만, 상대 경로를 내부에서 읽는 스크립트·도구와 이후 명령의 상대 경로는 어긋날 수 있습니다 — 절대 경로나 서브셸 `( cd <dir> && … )`만 사용하고 지속 `cd`는 남기지 않습니다.
|
|
90
|
+
|
|
89
91
|
<!-- DETAIL: tool name vs program
|
|
90
92
|
> **도구 이름 ≠ 그 프로그램 (#1590)**: 도구를 쓰기 전에 `type <tool>`로 실체를 확인한다. Bash 도구의 `grep`은 `~/.claude/shell-snapshots/snapshot-zsh-*.sh`의 **셸 함수**이며 `ugrep --ignore-files`에 위임한다. 그 결과 `.gitignore`의 리터럴 `CLAUDE.md` 패턴을 존중해, **force-tracked 파일을 재귀 탐색에서 조용히 누락**한다(에러 없이 exit 0). 명시 경로를 준 grep은 정상 동작하므로 **traversal만 영향**을 받는다. 실측(2026-08-15): 동일 패턴·동일 대상에 대해 셸 함수 36 / `command grep` 43 / `git grep` 38 히트 — 셸 함수만 `CLAUDE.md`를 0 히트로 놓쳤다. 진단 함정: `git check-ignore`는 **index-aware**라 tracked 파일에 "not ignored"(exit 1)를 반환한다 — 원인을 보려면 `git check-ignore --no-index`를 써야 한다. 처방: 저장소 전수 조사는 `git grep`을 표준으로 한다(R017 Count Sync cross-ref). Origin: #1590.
|
|
91
93
|
-->
|
|
@@ -33,7 +33,7 @@ oh-my-customcode uses an **advisory-first enforcement model**. Most rules are en
|
|
|
33
33
|
|
|
34
34
|
| Anti-pattern | Required |
|
|
35
35
|
|--------------|----------|
|
|
36
|
-
| `hooks.json`만 편집하고 커밋 → settings.json `hooks` 블록 미재생성 | 편집 후 `hooks
|
|
36
|
+
| `hooks.json`만 편집하고 커밋 → settings.json `hooks` 블록 미재생성 | 편집 후 `bun run sync:hooks`(또는 `bun run build`) 실행 → settings.json(+local+templates) 재생성 확인 후 커밋 |
|
|
37
37
|
|
|
38
38
|
교훈: **배선 확인 ≠ 전달 확인 ≠ 발화 확인 ≠ 로드 확인** — R020 "actual outcome ≠ attempt"의 훅 도메인 재현 사례. 상세는 Read 도구로 열람.
|
|
39
39
|
|