bobo-ai-cli 3.0.4 → 3.0.5
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/LICENSE +21 -21
- package/README.md +259 -259
- package/bundled-skills/CORE_SKILLS.txt +18 -18
- package/bundled-skills/backend-expert/SKILL.md +97 -97
- package/bundled-skills/code-review/SKILL.md +280 -280
- package/bundled-skills/code-review-expert/SKILL.md +85 -85
- package/bundled-skills/context-budget-analyzer/SKILL.md +76 -76
- package/bundled-skills/context-compressor/SKILL.md +75 -75
- package/bundled-skills/context-optimization-suite/SKILL.md +162 -162
- package/bundled-skills/frontend-expert/SKILL.md +93 -93
- package/bundled-skills/github/SKILL.md +12 -12
- package/bundled-skills/high-agency/SKILL.md +473 -473
- package/bundled-skills/high-agency/references/builder-patterns.md +126 -126
- package/bundled-skills/high-agency/references/recovery-playbook.md +298 -298
- package/bundled-skills/memory-manager/SKILL.md +214 -214
- package/bundled-skills/memory-manager/references/advanced-config.md +65 -65
- package/bundled-skills/orchestrator/SKILL.md +681 -681
- package/bundled-skills/planning-with-files/SKILL.md +193 -193
- package/bundled-skills/skill-creator/SKILL.md +220 -220
- package/bundled-skills/testing-expert/SKILL.md +99 -99
- package/bundled-skills/verify/SKILL.md +15 -15
- package/dist/agent.d.ts +5 -0
- package/dist/agent.js +11 -1
- package/dist/agent.js.map +1 -1
- package/dist/agents/catalog.d.ts +47 -0
- package/dist/agents/catalog.js +63 -5
- package/dist/agents/catalog.js.map +1 -1
- package/dist/agents/router.d.ts +12 -1
- package/dist/agents/router.js +43 -3
- package/dist/agents/router.js.map +1 -1
- package/dist/agents/spawn.js +36 -18
- package/dist/agents/spawn.js.map +1 -1
- package/dist/autonomous.js +5 -5
- package/dist/cli.js +23 -21
- package/dist/cli.js.map +1 -1
- package/dist/compactor.js +39 -39
- package/dist/dream.js +29 -29
- package/dist/image-input.d.ts +44 -0
- package/dist/image-input.js +161 -0
- package/dist/image-input.js.map +1 -0
- package/dist/memory.js +13 -13
- package/dist/project.js +15 -15
- package/dist/repl.js +88 -0
- package/dist/repl.js.map +1 -1
- package/dist/skills.js +54 -54
- package/dist/sub-agents.js +65 -65
- package/dist/tools/browser.js +21 -21
- package/dist/tools/claude-code.js +10 -10
- package/dist/web.js +7 -7
- package/dist/wiki-commands.d.ts +2 -0
- package/dist/wiki-commands.js +249 -0
- package/dist/wiki-commands.js.map +1 -0
- package/dist/wiki.d.ts +90 -0
- package/dist/wiki.js +614 -0
- package/dist/wiki.js.map +1 -0
- package/knowledge/advanced-patterns.md +70 -70
- package/knowledge/agent-directives.md +74 -74
- package/knowledge/api-integration-patterns.md +102 -0
- package/knowledge/code-review-protocol.md +69 -0
- package/knowledge/dream.md +36 -36
- package/knowledge/engineering.md +52 -46
- package/knowledge/error-catalog.md +38 -33
- package/knowledge/event-driven-architecture.md +43 -0
- package/knowledge/external-alignment.md +47 -0
- package/knowledge/high-agency.md +73 -0
- package/knowledge/image-generation.md +48 -0
- package/knowledge/index.json +194 -169
- package/knowledge/llm-wiki-pattern.md +71 -0
- package/knowledge/long-task-management.md +79 -0
- package/knowledge/memory/cache-optimization-and-skill-integration.md +102 -102
- package/knowledge/memory/engineering-patterns.md +134 -134
- package/knowledge/memory/feedback_root_structure.md +15 -15
- package/knowledge/memory/project-contexts.md +69 -69
- package/knowledge/memory/tools-and-services.md +85 -85
- package/knowledge/memory-management.md +72 -0
- package/knowledge/rules/advisor-strategy.md +204 -0
- package/knowledge/rules/agents.md +62 -62
- package/knowledge/rules/blocking-rules.md +323 -323
- package/knowledge/rules/cache-management.md +379 -379
- package/knowledge/rules/capability-evolution.md +132 -132
- package/knowledge/rules/coding.md +126 -126
- package/knowledge/rules/engineering-workflows.md +225 -225
- package/knowledge/rules/evomap-content-guidelines.md +354 -354
- package/knowledge/rules/evomap-guide.md +224 -224
- package/knowledge/rules/external-alignment.md +22 -0
- package/knowledge/rules/git.md +31 -31
- package/knowledge/rules/hooks.md +106 -106
- package/knowledge/rules/performance.md +101 -101
- package/knowledge/rules/remotion-auto-production.md +1120 -1120
- package/knowledge/rules/security.md +46 -46
- package/knowledge/rules/testing.md +32 -32
- package/knowledge/rules/work-mode.md +208 -208
- package/knowledge/rules.md +62 -62
- package/knowledge/self-evolution.md +78 -0
- package/knowledge/self-rationalization-guard.md +52 -0
- package/knowledge/skills/Skill_Seekers.md +1722 -1722
- package/knowledge/skills/ab-test-setup.md +557 -557
- package/knowledge/skills/agent-sdk-dev.md +238 -238
- package/knowledge/skills/agent-tools.md +136 -136
- package/knowledge/skills/analytics-tracking.md +597 -597
- package/knowledge/skills/artifacts-builder.md +89 -89
- package/knowledge/skills/asana.md +12 -12
- package/knowledge/skills/backend-expert.md +97 -97
- package/knowledge/skills/brand-voice.md +481 -481
- package/knowledge/skills/browser-use.md +419 -419
- package/knowledge/skills/cache-optimization-skill.md +179 -179
- package/knowledge/skills/canvas-design.md +147 -147
- package/knowledge/skills/citation-validator.md +203 -203
- package/knowledge/skills/clangd-lsp.md +52 -52
- package/knowledge/skills/code-review-expert.md +85 -85
- package/knowledge/skills/code-review.md +280 -280
- package/knowledge/skills/code-simplifier.md +12 -12
- package/knowledge/skills/commit-commands.md +258 -258
- package/knowledge/skills/competitor-alternatives.md +795 -795
- package/knowledge/skills/content-atomizer.md +910 -910
- package/knowledge/skills/content-research-writer.md +605 -605
- package/knowledge/skills/context-optimization-suite.md +162 -162
- package/knowledge/skills/context7.md +12 -12
- package/knowledge/skills/copy-editing.md +494 -494
- package/knowledge/skills/copywriting.md +510 -510
- package/knowledge/skills/csharp-lsp.md +40 -40
- package/knowledge/skills/decision-making-framework.md +154 -154
- package/knowledge/skills/developer-growth-analysis.md +335 -335
- package/knowledge/skills/direct-response-copy.md +2336 -2336
- package/knowledge/skills/docker-expert.md +229 -229
- package/knowledge/skills/document-skills.md +12 -12
- package/knowledge/skills/documentation-expert.md +126 -126
- package/knowledge/skills/email-sequence.md +1061 -1061
- package/knowledge/skills/email-sequences.md +910 -910
- package/knowledge/skills/example-plugin.md +72 -72
- package/knowledge/skills/explanatory-output-style.md +82 -82
- package/knowledge/skills/feature-dev.md +458 -458
- package/knowledge/skills/file-organizer.md +466 -466
- package/knowledge/skills/firebase.disabled.md +12 -12
- package/knowledge/skills/form-cro.md +488 -488
- package/knowledge/skills/free-tool-strategy.md +636 -636
- package/knowledge/skills/frontend-design-offical.md +55 -55
- package/knowledge/skills/frontend-design.md +41 -41
- package/knowledge/skills/frontend-expert.md +93 -93
- package/knowledge/skills/github.md +12 -12
- package/knowledge/skills/gitlab.md +12 -12
- package/knowledge/skills/gopls-lsp.md +32 -32
- package/knowledge/skills/got-controller.md +218 -218
- package/knowledge/skills/greptile.md +72 -72
- package/knowledge/skills/hookify.md +376 -376
- package/knowledge/skills/image-editor.md +189 -189
- package/knowledge/skills/image-enhancer.md +109 -109
- package/knowledge/skills/jdtls-lsp.md +49 -49
- package/knowledge/skills/json-canvas.md +654 -654
- package/knowledge/skills/keyword-research.md +559 -559
- package/knowledge/skills/kotlin-lsp.md +28 -28
- package/knowledge/skills/laravel-boost.md +12 -12
- package/knowledge/skills/launch-strategy.md +394 -394
- package/knowledge/skills/lead-magnet.md +393 -393
- package/knowledge/skills/learning-output-style.md +106 -106
- package/knowledge/skills/linear.md +12 -12
- package/knowledge/skills/lua-lsp.md +47 -47
- package/knowledge/skills/marketing-ideas.md +720 -720
- package/knowledge/skills/marketing-psychology.md +534 -534
- package/knowledge/skills/mcp-builder.md +369 -369
- package/knowledge/skills/meeting-insights-analyzer.md +347 -347
- package/knowledge/skills/memory-evolution-system.md +172 -172
- package/knowledge/skills/multi-lens-thinking.md +407 -407
- package/knowledge/skills/nano-banana-pro.md +116 -116
- package/knowledge/skills/newsletter.md +736 -736
- package/knowledge/skills/notebooklm.md +296 -296
- package/knowledge/skills/obsidian-bases.md +634 -634
- package/knowledge/skills/obsidian-markdown.md +651 -651
- package/knowledge/skills/onboarding-cro.md +494 -494
- package/knowledge/skills/orchestrator.md +681 -681
- package/knowledge/skills/page-cro.md +379 -379
- package/knowledge/skills/paid-ads.md +624 -624
- package/knowledge/skills/paywall-upgrade-cro.md +651 -651
- package/knowledge/skills/php-lsp.md +36 -36
- package/knowledge/skills/planning-with-files.md +193 -193
- package/knowledge/skills/playwright.md +12 -12
- package/knowledge/skills/plugin-dev.md +434 -434
- package/knowledge/skills/popup-cro.md +520 -520
- package/knowledge/skills/positioning-angles.md +330 -330
- package/knowledge/skills/pr-review-toolkit.md +359 -359
- package/knowledge/skills/pricing-strategy.md +777 -777
- package/knowledge/skills/programmatic-seo.md +714 -714
- package/knowledge/skills/pyright-lsp.md +43 -43
- package/knowledge/skills/quality-assurance-framework.md +168 -168
- package/knowledge/skills/question-refiner.md +160 -160
- package/knowledge/skills/ralph-loop.md +205 -205
- package/knowledge/skills/refactoring-expert.md +103 -103
- package/knowledge/skills/referral-program.md +668 -668
- package/knowledge/skills/research-executor.md +164 -164
- package/knowledge/skills/review-with-security.md +12 -12
- package/knowledge/skills/rust-analyzer-lsp.md +50 -50
- package/knowledge/skills/schema-markup.md +647 -647
- package/knowledge/skills/security-audit-expert.md +124 -124
- package/knowledge/skills/security-expert.md +140 -140
- package/knowledge/skills/security-guidance.md +12 -12
- package/knowledge/skills/seedance-prompt.md +139 -139
- package/knowledge/skills/self-evolution.md +1160 -1160
- package/knowledge/skills/seo-audit.md +432 -432
- package/knowledge/skills/seo-content.md +787 -787
- package/knowledge/skills/serena.md +12 -12
- package/knowledge/skills/signup-flow-cro.md +409 -409
- package/knowledge/skills/skill-creator.md +220 -220
- package/knowledge/skills/skill-manager.md +226 -226
- package/knowledge/skills/skill-share.md +98 -98
- package/knowledge/skills/slack.md +12 -12
- package/knowledge/skills/social-content.md +878 -878
- package/knowledge/skills/spec-flow-skill.md +124 -124
- package/knowledge/skills/stripe.md +12 -12
- package/knowledge/skills/supabase.md +12 -12
- package/knowledge/skills/swift-lsp.md +40 -40
- package/knowledge/skills/synthesizer.md +236 -236
- package/knowledge/skills/template-skill.md +16 -16
- package/knowledge/skills/testing-expert.md +99 -99
- package/knowledge/skills/theme-factory.md +72 -72
- package/knowledge/skills/tiktok-research.md +208 -208
- package/knowledge/skills/typescript-lsp.md +36 -36
- package/knowledge/skills/ui-ux-pro-max.md +247 -247
- package/knowledge/skills/verify.md +15 -15
- package/knowledge/skills/visual-prompt-engineer.md +102 -102
- package/knowledge/skills/webapp-testing.md +111 -111
- package/knowledge/skills/wide-research.md +191 -191
- package/knowledge/system.md +93 -93
- package/knowledge/task-router.md +46 -37
- package/knowledge/verification.md +38 -38
- package/knowledge/worker-prompt-craft.md +66 -0
- package/knowledge/workflows/3d-viz.md +47 -47
- package/knowledge/workflows/data-pipeline.md +47 -47
- package/knowledge/workflows/db-migration.md +51 -51
- package/knowledge/workflows/feature-dev.md +41 -41
- package/knowledge/workflows/tdd-flow.md +52 -52
- package/knowledge/workflows/ui-verify.md +51 -51
- package/package.json +74 -74
- package/dist/claude-bridge.d.ts +0 -18
- package/dist/claude-bridge.js +0 -91
- package/dist/claude-bridge.js.map +0 -1
- package/dist/tools/claude-bridge-tool.d.ts +0 -4
- package/dist/tools/claude-bridge-tool.js +0 -44
- package/dist/tools/claude-bridge-tool.js.map +0 -1
|
@@ -1,376 +1,376 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: "hookify"
|
|
3
|
-
title: "Hookify Plugin"
|
|
4
|
-
category: "dev-tools"
|
|
5
|
-
tags: ["hookify plugin", "overview", "quick start", "usage", "rule configuration format", "event types", "pattern syntax", "examples", "advanced usage", "management"]
|
|
6
|
-
triggers: []
|
|
7
|
-
dependencies: []
|
|
8
|
-
source: "E:/Bobo's Coding cache/.claude/skills/hookify"
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Hookify Plugin
|
|
12
|
-
|
|
13
|
-
Easily create custom hooks to prevent unwanted behaviors by analyzing conversation patterns or from explicit instructions.
|
|
14
|
-
|
|
15
|
-
## Overview
|
|
16
|
-
|
|
17
|
-
The hookify plugin makes it simple to create hooks without editing complex `hooks.json` files. Instead, you create lightweight markdown configuration files that define patterns to watch for and messages to show when those patterns match.
|
|
18
|
-
|
|
19
|
-
**Key features:**
|
|
20
|
-
|
|
21
|
-
- 🎯 Analyze conversations to find unwanted behaviors automatically
|
|
22
|
-
- 📝 Simple markdown configuration files with YAML frontmatter
|
|
23
|
-
- 🔍 Regex pattern matching for powerful rules
|
|
24
|
-
- 🚀 No coding required - just describe the behavior
|
|
25
|
-
- 🔄 Easy enable/disable without restarting
|
|
26
|
-
|
|
27
|
-
## Quick Start
|
|
28
|
-
|
|
29
|
-
### 1. Create Your First Rule
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
/hookify Warn me when I use rm -rf commands
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
This analyzes your request and creates `.claude/hookify.warn-rm.local.md`.
|
|
36
|
-
|
|
37
|
-
### 2. Test It Immediately
|
|
38
|
-
|
|
39
|
-
**No restart needed!** Rules take effect on the very next tool use.
|
|
40
|
-
|
|
41
|
-
Ask Claude to run a command that should trigger the rule:
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
Run rm -rf /tmp/test
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
You should see the warning message immediately!
|
|
48
|
-
|
|
49
|
-
## Usage
|
|
50
|
-
|
|
51
|
-
### Main Command: /hookify
|
|
52
|
-
|
|
53
|
-
**With arguments:**
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
/hookify Don't use console.log in TypeScript files
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Creates a rule from your explicit instructions.
|
|
60
|
-
|
|
61
|
-
**Without arguments:**
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
/hookify
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Analyzes recent conversation to find behaviors you've corrected or been frustrated by.
|
|
68
|
-
|
|
69
|
-
### Helper Commands
|
|
70
|
-
|
|
71
|
-
**List all rules:**
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
/hookify:list
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
**Configure rules interactively:**
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
/hookify:configure
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Enable/disable existing rules through an interactive interface.
|
|
84
|
-
|
|
85
|
-
**Get help:**
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
/hookify:help
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Rule Configuration Format
|
|
92
|
-
|
|
93
|
-
### Simple Rule (Single Pattern)
|
|
94
|
-
|
|
95
|
-
`.claude/hookify.dangerous-rm.local.md`:
|
|
96
|
-
|
|
97
|
-
```markdown
|
|
98
|
-
---
|
|
99
|
-
name: block-dangerous-rm
|
|
100
|
-
enabled: true
|
|
101
|
-
event: bash
|
|
102
|
-
pattern: rm\s+-rf
|
|
103
|
-
action: block
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
⚠️ **Dangerous rm command detected!**
|
|
107
|
-
|
|
108
|
-
This command could delete important files. Please:
|
|
109
|
-
|
|
110
|
-
- Verify the path is correct
|
|
111
|
-
- Consider using a safer approach
|
|
112
|
-
- Make sure you have backups
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**Action field:**
|
|
116
|
-
|
|
117
|
-
- `warn`: Shows warning but allows operation (default)
|
|
118
|
-
- `block`: Prevents operation from executing (PreToolUse) or stops session (Stop events)
|
|
119
|
-
|
|
120
|
-
### Advanced Rule (Multiple Conditions)
|
|
121
|
-
|
|
122
|
-
`.claude/hookify.sensitive-files.local.md`:
|
|
123
|
-
|
|
124
|
-
```markdown
|
|
125
|
-
---
|
|
126
|
-
name: warn-sensitive-files
|
|
127
|
-
enabled: true
|
|
128
|
-
event: file
|
|
129
|
-
action: warn
|
|
130
|
-
conditions:
|
|
131
|
-
- field: file_path
|
|
132
|
-
operator: regex_match
|
|
133
|
-
pattern: \.env$|credentials|secrets
|
|
134
|
-
- field: new_text
|
|
135
|
-
operator: contains
|
|
136
|
-
pattern: KEY
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
🔐 **Sensitive file edit detected!**
|
|
140
|
-
|
|
141
|
-
Ensure credentials are not hardcoded and file is in .gitignore.
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
**All conditions must match** for the rule to trigger.
|
|
145
|
-
|
|
146
|
-
## Event Types
|
|
147
|
-
|
|
148
|
-
- **`bash`**: Triggers on Bash tool commands
|
|
149
|
-
- **`file`**: Triggers on Edit, Write, MultiEdit tools
|
|
150
|
-
- **`stop`**: Triggers when Claude wants to stop (for completion checks)
|
|
151
|
-
- **`prompt`**: Triggers on user prompt submission
|
|
152
|
-
- **`all`**: Triggers on all events
|
|
153
|
-
|
|
154
|
-
## Pattern Syntax
|
|
155
|
-
|
|
156
|
-
Use Python regex syntax:
|
|
157
|
-
|
|
158
|
-
| Pattern | Matches | Example |
|
|
159
|
-
| ---------------- | -------------------- | ------------------- |
|
|
160
|
-
| `rm\s+-rf` | rm -rf | rm -rf /tmp |
|
|
161
|
-
| `console\.log\(` | console.log( | console.log("test") |
|
|
162
|
-
| `(eval\|exec)\(` | eval( or exec( | eval("code") |
|
|
163
|
-
| `\.env$` | files ending in .env | .env, .env.local |
|
|
164
|
-
| `chmod\s+777` | chmod 777 | chmod 777 file.txt |
|
|
165
|
-
|
|
166
|
-
**Tips:**
|
|
167
|
-
|
|
168
|
-
- Use `\s` for whitespace
|
|
169
|
-
- Escape special chars: `\.` for literal dot
|
|
170
|
-
- Use `|` for OR: `(foo|bar)`
|
|
171
|
-
- Use `.*` to match anything
|
|
172
|
-
- Set `action: block` for dangerous operations
|
|
173
|
-
- Set `action: warn` (or omit) for informational warnings
|
|
174
|
-
|
|
175
|
-
## Examples
|
|
176
|
-
|
|
177
|
-
### Example 1: Block Dangerous Commands
|
|
178
|
-
|
|
179
|
-
```markdown
|
|
180
|
-
---
|
|
181
|
-
name: block-destructive-ops
|
|
182
|
-
enabled: true
|
|
183
|
-
event: bash
|
|
184
|
-
pattern: rm\s+-rf|dd\s+if=|mkfs|format
|
|
185
|
-
action: block
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
🛑 **Destructive operation detected!**
|
|
189
|
-
|
|
190
|
-
This command can cause data loss. Operation blocked for safety.
|
|
191
|
-
Please verify the exact path and use a safer approach.
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
**This rule blocks the operation** - Claude will not be allowed to execute these commands.
|
|
195
|
-
|
|
196
|
-
### Example 2: Warn About Debug Code
|
|
197
|
-
|
|
198
|
-
```markdown
|
|
199
|
-
---
|
|
200
|
-
name: warn-debug-code
|
|
201
|
-
enabled: true
|
|
202
|
-
event: file
|
|
203
|
-
pattern: console\.log\(|debugger;|print\(
|
|
204
|
-
action: warn
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
🐛 **Debug code detected**
|
|
208
|
-
|
|
209
|
-
Remember to remove debugging statements before committing.
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
**This rule warns but allows** - Claude sees the message but can still proceed.
|
|
213
|
-
|
|
214
|
-
### Example 3: Require Tests Before Stopping
|
|
215
|
-
|
|
216
|
-
```markdown
|
|
217
|
-
---
|
|
218
|
-
name: require-tests-run
|
|
219
|
-
enabled: false
|
|
220
|
-
event: stop
|
|
221
|
-
action: block
|
|
222
|
-
conditions:
|
|
223
|
-
- field: transcript
|
|
224
|
-
operator: not_contains
|
|
225
|
-
pattern: npm test|pytest|cargo test
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
**Tests not detected in transcript!**
|
|
229
|
-
|
|
230
|
-
Before stopping, please run tests to verify your changes work correctly.
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
**This blocks Claude from stopping** if no test commands appear in the session transcript. Enable only when you want strict enforcement.
|
|
234
|
-
|
|
235
|
-
## Advanced Usage
|
|
236
|
-
|
|
237
|
-
### Multiple Conditions
|
|
238
|
-
|
|
239
|
-
Check multiple fields simultaneously:
|
|
240
|
-
|
|
241
|
-
```markdown
|
|
242
|
-
---
|
|
243
|
-
name: api-key-in-typescript
|
|
244
|
-
enabled: true
|
|
245
|
-
event: file
|
|
246
|
-
conditions:
|
|
247
|
-
- field: file_path
|
|
248
|
-
operator: regex_match
|
|
249
|
-
pattern: \.tsx?$
|
|
250
|
-
- field: new_text
|
|
251
|
-
operator: regex_match
|
|
252
|
-
pattern: (API_KEY|SECRET|TOKEN)\s*=\s*["']
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
🔐 **Hardcoded credential in TypeScript!**
|
|
256
|
-
|
|
257
|
-
Use environment variables instead of hardcoded values.
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
### Operators Reference
|
|
261
|
-
|
|
262
|
-
- `regex_match`: Pattern must match (most common)
|
|
263
|
-
- `contains`: String must contain pattern
|
|
264
|
-
- `equals`: Exact string match
|
|
265
|
-
- `not_contains`: String must NOT contain pattern
|
|
266
|
-
- `starts_with`: String starts with pattern
|
|
267
|
-
- `ends_with`: String ends with pattern
|
|
268
|
-
|
|
269
|
-
### Field Reference
|
|
270
|
-
|
|
271
|
-
**For bash events:**
|
|
272
|
-
|
|
273
|
-
- `command`: The bash command string
|
|
274
|
-
|
|
275
|
-
**For file events:**
|
|
276
|
-
|
|
277
|
-
- `file_path`: Path to file being edited
|
|
278
|
-
- `new_text`: New content being added (Edit, Write)
|
|
279
|
-
- `old_text`: Old content being replaced (Edit only)
|
|
280
|
-
- `content`: File content (Write only)
|
|
281
|
-
|
|
282
|
-
**For prompt events:**
|
|
283
|
-
|
|
284
|
-
- `user_prompt`: The user's submitted prompt text
|
|
285
|
-
|
|
286
|
-
**For stop events:**
|
|
287
|
-
|
|
288
|
-
- Use general matching on session state
|
|
289
|
-
|
|
290
|
-
## Management
|
|
291
|
-
|
|
292
|
-
### Enable/Disable Rules
|
|
293
|
-
|
|
294
|
-
**Temporarily disable:**
|
|
295
|
-
Edit the `.local.md` file and set `enabled: false`
|
|
296
|
-
|
|
297
|
-
**Re-enable:**
|
|
298
|
-
Set `enabled: true`
|
|
299
|
-
|
|
300
|
-
**Or use interactive tool:**
|
|
301
|
-
|
|
302
|
-
```
|
|
303
|
-
/hookify:configure
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### Delete Rules
|
|
307
|
-
|
|
308
|
-
Simply delete the `.local.md` file:
|
|
309
|
-
|
|
310
|
-
```bash
|
|
311
|
-
rm .claude/hookify.my-rule.local.md
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
### View All Rules
|
|
315
|
-
|
|
316
|
-
```
|
|
317
|
-
/hookify:list
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
## Installation
|
|
321
|
-
|
|
322
|
-
This plugin is part of the Claude Code Marketplace. It should be auto-discovered when the marketplace is installed.
|
|
323
|
-
|
|
324
|
-
**Manual testing:**
|
|
325
|
-
|
|
326
|
-
```bash
|
|
327
|
-
cc --plugin-dir /path/to/hookify
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
## Requirements
|
|
331
|
-
|
|
332
|
-
- Python 3.7+
|
|
333
|
-
- No external dependencies (uses stdlib only)
|
|
334
|
-
|
|
335
|
-
## Troubleshooting
|
|
336
|
-
|
|
337
|
-
**Rule not triggering:**
|
|
338
|
-
|
|
339
|
-
1. Check rule file exists in `.claude/` directory (in project root, not plugin directory)
|
|
340
|
-
2. Verify `enabled: true` in frontmatter
|
|
341
|
-
3. Test regex pattern separately
|
|
342
|
-
4. Rules should work immediately - no restart needed
|
|
343
|
-
5. Try `/hookify:list` to see if rule is loaded
|
|
344
|
-
|
|
345
|
-
**Import errors:**
|
|
346
|
-
|
|
347
|
-
- Ensure Python 3 is available: `python3 --version`
|
|
348
|
-
- Check hookify plugin is installed
|
|
349
|
-
|
|
350
|
-
**Pattern not matching:**
|
|
351
|
-
|
|
352
|
-
- Test regex: `python3 -c "import re; print(re.search(r'pattern', 'text'))"`
|
|
353
|
-
- Use unquoted patterns in YAML to avoid escaping issues
|
|
354
|
-
- Start simple, then add complexity
|
|
355
|
-
|
|
356
|
-
**Hook seems slow:**
|
|
357
|
-
|
|
358
|
-
- Keep patterns simple (avoid complex regex)
|
|
359
|
-
- Use specific event types (bash, file) instead of "all"
|
|
360
|
-
- Limit number of active rules
|
|
361
|
-
|
|
362
|
-
## Contributing
|
|
363
|
-
|
|
364
|
-
Found a useful rule pattern? Consider sharing example files via PR!
|
|
365
|
-
|
|
366
|
-
## Future Enhancements
|
|
367
|
-
|
|
368
|
-
- Severity levels (error/warning/info distinctions)
|
|
369
|
-
- Rule templates library
|
|
370
|
-
- Interactive pattern builder
|
|
371
|
-
- Hook testing utilities
|
|
372
|
-
- JSON format support (in addition to markdown)
|
|
373
|
-
|
|
374
|
-
## License
|
|
375
|
-
|
|
376
|
-
MIT License
|
|
1
|
+
---
|
|
2
|
+
id: "hookify"
|
|
3
|
+
title: "Hookify Plugin"
|
|
4
|
+
category: "dev-tools"
|
|
5
|
+
tags: ["hookify plugin", "overview", "quick start", "usage", "rule configuration format", "event types", "pattern syntax", "examples", "advanced usage", "management"]
|
|
6
|
+
triggers: []
|
|
7
|
+
dependencies: []
|
|
8
|
+
source: "E:/Bobo's Coding cache/.claude/skills/hookify"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Hookify Plugin
|
|
12
|
+
|
|
13
|
+
Easily create custom hooks to prevent unwanted behaviors by analyzing conversation patterns or from explicit instructions.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
The hookify plugin makes it simple to create hooks without editing complex `hooks.json` files. Instead, you create lightweight markdown configuration files that define patterns to watch for and messages to show when those patterns match.
|
|
18
|
+
|
|
19
|
+
**Key features:**
|
|
20
|
+
|
|
21
|
+
- 🎯 Analyze conversations to find unwanted behaviors automatically
|
|
22
|
+
- 📝 Simple markdown configuration files with YAML frontmatter
|
|
23
|
+
- 🔍 Regex pattern matching for powerful rules
|
|
24
|
+
- 🚀 No coding required - just describe the behavior
|
|
25
|
+
- 🔄 Easy enable/disable without restarting
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
### 1. Create Your First Rule
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
/hookify Warn me when I use rm -rf commands
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This analyzes your request and creates `.claude/hookify.warn-rm.local.md`.
|
|
36
|
+
|
|
37
|
+
### 2. Test It Immediately
|
|
38
|
+
|
|
39
|
+
**No restart needed!** Rules take effect on the very next tool use.
|
|
40
|
+
|
|
41
|
+
Ask Claude to run a command that should trigger the rule:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
Run rm -rf /tmp/test
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You should see the warning message immediately!
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
### Main Command: /hookify
|
|
52
|
+
|
|
53
|
+
**With arguments:**
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
/hookify Don't use console.log in TypeScript files
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Creates a rule from your explicit instructions.
|
|
60
|
+
|
|
61
|
+
**Without arguments:**
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
/hookify
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Analyzes recent conversation to find behaviors you've corrected or been frustrated by.
|
|
68
|
+
|
|
69
|
+
### Helper Commands
|
|
70
|
+
|
|
71
|
+
**List all rules:**
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
/hookify:list
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Configure rules interactively:**
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
/hookify:configure
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Enable/disable existing rules through an interactive interface.
|
|
84
|
+
|
|
85
|
+
**Get help:**
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
/hookify:help
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Rule Configuration Format
|
|
92
|
+
|
|
93
|
+
### Simple Rule (Single Pattern)
|
|
94
|
+
|
|
95
|
+
`.claude/hookify.dangerous-rm.local.md`:
|
|
96
|
+
|
|
97
|
+
```markdown
|
|
98
|
+
---
|
|
99
|
+
name: block-dangerous-rm
|
|
100
|
+
enabled: true
|
|
101
|
+
event: bash
|
|
102
|
+
pattern: rm\s+-rf
|
|
103
|
+
action: block
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
⚠️ **Dangerous rm command detected!**
|
|
107
|
+
|
|
108
|
+
This command could delete important files. Please:
|
|
109
|
+
|
|
110
|
+
- Verify the path is correct
|
|
111
|
+
- Consider using a safer approach
|
|
112
|
+
- Make sure you have backups
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Action field:**
|
|
116
|
+
|
|
117
|
+
- `warn`: Shows warning but allows operation (default)
|
|
118
|
+
- `block`: Prevents operation from executing (PreToolUse) or stops session (Stop events)
|
|
119
|
+
|
|
120
|
+
### Advanced Rule (Multiple Conditions)
|
|
121
|
+
|
|
122
|
+
`.claude/hookify.sensitive-files.local.md`:
|
|
123
|
+
|
|
124
|
+
```markdown
|
|
125
|
+
---
|
|
126
|
+
name: warn-sensitive-files
|
|
127
|
+
enabled: true
|
|
128
|
+
event: file
|
|
129
|
+
action: warn
|
|
130
|
+
conditions:
|
|
131
|
+
- field: file_path
|
|
132
|
+
operator: regex_match
|
|
133
|
+
pattern: \.env$|credentials|secrets
|
|
134
|
+
- field: new_text
|
|
135
|
+
operator: contains
|
|
136
|
+
pattern: KEY
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
🔐 **Sensitive file edit detected!**
|
|
140
|
+
|
|
141
|
+
Ensure credentials are not hardcoded and file is in .gitignore.
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**All conditions must match** for the rule to trigger.
|
|
145
|
+
|
|
146
|
+
## Event Types
|
|
147
|
+
|
|
148
|
+
- **`bash`**: Triggers on Bash tool commands
|
|
149
|
+
- **`file`**: Triggers on Edit, Write, MultiEdit tools
|
|
150
|
+
- **`stop`**: Triggers when Claude wants to stop (for completion checks)
|
|
151
|
+
- **`prompt`**: Triggers on user prompt submission
|
|
152
|
+
- **`all`**: Triggers on all events
|
|
153
|
+
|
|
154
|
+
## Pattern Syntax
|
|
155
|
+
|
|
156
|
+
Use Python regex syntax:
|
|
157
|
+
|
|
158
|
+
| Pattern | Matches | Example |
|
|
159
|
+
| ---------------- | -------------------- | ------------------- |
|
|
160
|
+
| `rm\s+-rf` | rm -rf | rm -rf /tmp |
|
|
161
|
+
| `console\.log\(` | console.log( | console.log("test") |
|
|
162
|
+
| `(eval\|exec)\(` | eval( or exec( | eval("code") |
|
|
163
|
+
| `\.env$` | files ending in .env | .env, .env.local |
|
|
164
|
+
| `chmod\s+777` | chmod 777 | chmod 777 file.txt |
|
|
165
|
+
|
|
166
|
+
**Tips:**
|
|
167
|
+
|
|
168
|
+
- Use `\s` for whitespace
|
|
169
|
+
- Escape special chars: `\.` for literal dot
|
|
170
|
+
- Use `|` for OR: `(foo|bar)`
|
|
171
|
+
- Use `.*` to match anything
|
|
172
|
+
- Set `action: block` for dangerous operations
|
|
173
|
+
- Set `action: warn` (or omit) for informational warnings
|
|
174
|
+
|
|
175
|
+
## Examples
|
|
176
|
+
|
|
177
|
+
### Example 1: Block Dangerous Commands
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
---
|
|
181
|
+
name: block-destructive-ops
|
|
182
|
+
enabled: true
|
|
183
|
+
event: bash
|
|
184
|
+
pattern: rm\s+-rf|dd\s+if=|mkfs|format
|
|
185
|
+
action: block
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
🛑 **Destructive operation detected!**
|
|
189
|
+
|
|
190
|
+
This command can cause data loss. Operation blocked for safety.
|
|
191
|
+
Please verify the exact path and use a safer approach.
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**This rule blocks the operation** - Claude will not be allowed to execute these commands.
|
|
195
|
+
|
|
196
|
+
### Example 2: Warn About Debug Code
|
|
197
|
+
|
|
198
|
+
```markdown
|
|
199
|
+
---
|
|
200
|
+
name: warn-debug-code
|
|
201
|
+
enabled: true
|
|
202
|
+
event: file
|
|
203
|
+
pattern: console\.log\(|debugger;|print\(
|
|
204
|
+
action: warn
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
🐛 **Debug code detected**
|
|
208
|
+
|
|
209
|
+
Remember to remove debugging statements before committing.
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**This rule warns but allows** - Claude sees the message but can still proceed.
|
|
213
|
+
|
|
214
|
+
### Example 3: Require Tests Before Stopping
|
|
215
|
+
|
|
216
|
+
```markdown
|
|
217
|
+
---
|
|
218
|
+
name: require-tests-run
|
|
219
|
+
enabled: false
|
|
220
|
+
event: stop
|
|
221
|
+
action: block
|
|
222
|
+
conditions:
|
|
223
|
+
- field: transcript
|
|
224
|
+
operator: not_contains
|
|
225
|
+
pattern: npm test|pytest|cargo test
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
**Tests not detected in transcript!**
|
|
229
|
+
|
|
230
|
+
Before stopping, please run tests to verify your changes work correctly.
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**This blocks Claude from stopping** if no test commands appear in the session transcript. Enable only when you want strict enforcement.
|
|
234
|
+
|
|
235
|
+
## Advanced Usage
|
|
236
|
+
|
|
237
|
+
### Multiple Conditions
|
|
238
|
+
|
|
239
|
+
Check multiple fields simultaneously:
|
|
240
|
+
|
|
241
|
+
```markdown
|
|
242
|
+
---
|
|
243
|
+
name: api-key-in-typescript
|
|
244
|
+
enabled: true
|
|
245
|
+
event: file
|
|
246
|
+
conditions:
|
|
247
|
+
- field: file_path
|
|
248
|
+
operator: regex_match
|
|
249
|
+
pattern: \.tsx?$
|
|
250
|
+
- field: new_text
|
|
251
|
+
operator: regex_match
|
|
252
|
+
pattern: (API_KEY|SECRET|TOKEN)\s*=\s*["']
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
🔐 **Hardcoded credential in TypeScript!**
|
|
256
|
+
|
|
257
|
+
Use environment variables instead of hardcoded values.
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Operators Reference
|
|
261
|
+
|
|
262
|
+
- `regex_match`: Pattern must match (most common)
|
|
263
|
+
- `contains`: String must contain pattern
|
|
264
|
+
- `equals`: Exact string match
|
|
265
|
+
- `not_contains`: String must NOT contain pattern
|
|
266
|
+
- `starts_with`: String starts with pattern
|
|
267
|
+
- `ends_with`: String ends with pattern
|
|
268
|
+
|
|
269
|
+
### Field Reference
|
|
270
|
+
|
|
271
|
+
**For bash events:**
|
|
272
|
+
|
|
273
|
+
- `command`: The bash command string
|
|
274
|
+
|
|
275
|
+
**For file events:**
|
|
276
|
+
|
|
277
|
+
- `file_path`: Path to file being edited
|
|
278
|
+
- `new_text`: New content being added (Edit, Write)
|
|
279
|
+
- `old_text`: Old content being replaced (Edit only)
|
|
280
|
+
- `content`: File content (Write only)
|
|
281
|
+
|
|
282
|
+
**For prompt events:**
|
|
283
|
+
|
|
284
|
+
- `user_prompt`: The user's submitted prompt text
|
|
285
|
+
|
|
286
|
+
**For stop events:**
|
|
287
|
+
|
|
288
|
+
- Use general matching on session state
|
|
289
|
+
|
|
290
|
+
## Management
|
|
291
|
+
|
|
292
|
+
### Enable/Disable Rules
|
|
293
|
+
|
|
294
|
+
**Temporarily disable:**
|
|
295
|
+
Edit the `.local.md` file and set `enabled: false`
|
|
296
|
+
|
|
297
|
+
**Re-enable:**
|
|
298
|
+
Set `enabled: true`
|
|
299
|
+
|
|
300
|
+
**Or use interactive tool:**
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
/hookify:configure
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Delete Rules
|
|
307
|
+
|
|
308
|
+
Simply delete the `.local.md` file:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
rm .claude/hookify.my-rule.local.md
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### View All Rules
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
/hookify:list
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## Installation
|
|
321
|
+
|
|
322
|
+
This plugin is part of the Claude Code Marketplace. It should be auto-discovered when the marketplace is installed.
|
|
323
|
+
|
|
324
|
+
**Manual testing:**
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
cc --plugin-dir /path/to/hookify
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
## Requirements
|
|
331
|
+
|
|
332
|
+
- Python 3.7+
|
|
333
|
+
- No external dependencies (uses stdlib only)
|
|
334
|
+
|
|
335
|
+
## Troubleshooting
|
|
336
|
+
|
|
337
|
+
**Rule not triggering:**
|
|
338
|
+
|
|
339
|
+
1. Check rule file exists in `.claude/` directory (in project root, not plugin directory)
|
|
340
|
+
2. Verify `enabled: true` in frontmatter
|
|
341
|
+
3. Test regex pattern separately
|
|
342
|
+
4. Rules should work immediately - no restart needed
|
|
343
|
+
5. Try `/hookify:list` to see if rule is loaded
|
|
344
|
+
|
|
345
|
+
**Import errors:**
|
|
346
|
+
|
|
347
|
+
- Ensure Python 3 is available: `python3 --version`
|
|
348
|
+
- Check hookify plugin is installed
|
|
349
|
+
|
|
350
|
+
**Pattern not matching:**
|
|
351
|
+
|
|
352
|
+
- Test regex: `python3 -c "import re; print(re.search(r'pattern', 'text'))"`
|
|
353
|
+
- Use unquoted patterns in YAML to avoid escaping issues
|
|
354
|
+
- Start simple, then add complexity
|
|
355
|
+
|
|
356
|
+
**Hook seems slow:**
|
|
357
|
+
|
|
358
|
+
- Keep patterns simple (avoid complex regex)
|
|
359
|
+
- Use specific event types (bash, file) instead of "all"
|
|
360
|
+
- Limit number of active rules
|
|
361
|
+
|
|
362
|
+
## Contributing
|
|
363
|
+
|
|
364
|
+
Found a useful rule pattern? Consider sharing example files via PR!
|
|
365
|
+
|
|
366
|
+
## Future Enhancements
|
|
367
|
+
|
|
368
|
+
- Severity levels (error/warning/info distinctions)
|
|
369
|
+
- Rule templates library
|
|
370
|
+
- Interactive pattern builder
|
|
371
|
+
- Hook testing utilities
|
|
372
|
+
- JSON format support (in addition to markdown)
|
|
373
|
+
|
|
374
|
+
## License
|
|
375
|
+
|
|
376
|
+
MIT License
|