Loading...
Loading...
Create markdown-based behavioral rules preventing unwanted actions. create hookify rule, behavioral rule, prevent behavior, block command Use when: preventing dangerous commands, blocking debug commits, enforcing conventions DO NOT use when: hook scope (abstract:hook-scope-guide), SDK hooks (abstract:hook-authoring), evaluating hooks (abstract:hooks-eval).
npx skill4agent add athola/claude-night-market writing-rules.claude/hookify.{rule-name}.local.md.claude/hookify.dangerous-rm.local.md---
name: dangerous-rm
enabled: true
event: bash
pattern: rm\s+-rf
action: block
---
🛑 **Dangerous rm command detected!**
This command could delete important files.--helptruefalsebashfilestoppromptallwarnblock---
name: warn-env-edits
enabled: true
event: file
action: warn
conditions:
- field: file_path
operator: regex_match
pattern: \.env$
- field: new_text
operator: contains
pattern: API_KEY
---
🔐 **API key in .env file!**
Ensure file is in .gitignore.regex_matchcontainsequalsnot_containsstarts_withends_withcommandfile_pathnew_textold_textcontentuser_prompttranscript\s\d\w.\.+*|rm\s+-rf → rm -rf
console\.log\( → console.log(
chmod\s+777 → chmod 777python3 -c "import re; print(re.search(r'pattern', 'text'))"---
name: block-destructive
enabled: true
event: bash
pattern: rm\s+-rf|dd\s+if=|mkfs
action: block
---
🛑 **Destructive operation blocked!**
Can cause data loss.---
name: warn-debug
enabled: true
event: file
pattern: console\.log\(|debugger;
action: warn
---
🐛 **Debug code detected!**
Remove before committing.---
name: require-tests
enabled: true
event: stop
action: warn
conditions:
- field: transcript
operator: not_contains
pattern: pytest|npm test
---
⚠️ **Tests not run!**
Please verify changes.---
name: protect-prod
enabled: true
event: file
action: block
conditions:
- field: file_path
operator: regex_match
pattern: /production/|\.prod\.
---
🚨 **Production file!**
Requires review..local.mdenabled: falserm .claude/hookify.my-rule.local.md/hookify:listeventbashpattern.claude/