Loading...
Loading...
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
npx skill4agent add aiskillstore/marketplace writing-hookify-rules.claude/hookify.{rule-name}.local.md---
name: rule-identifier
enabled: true
event: bash|file|stop|prompt|all
pattern: regex-pattern-here
---
Message to show Claude when this rule triggers.
Can include markdown formatting, warnings, suggestions, etc.warn-dangerous-rmblock-console-logtruefalsebashfilestoppromptallwarnblockwarnevent: bash
pattern: rm\s+-rf---
name: warn-env-file-edits
enabled: true
event: file
conditions:
- field: file_path
operator: regex_match
pattern: \.env$
- field: new_text
operator: contains
pattern: API_KEY
---
You're adding an API key to a .env file. Ensure this file is in .gitignore!fieldcommandfile_pathnew_textold_textcontentoperatorregex_matchcontainsequalsnot_containsstarts_withends_withpattern⚠️ **Console.log detected!**
You're adding console.log to production code.
**Why this matters:**
- Debug logs shouldn't ship to production
- Console.log can expose sensitive data
- Impacts browser performance
**Alternatives:**
- Use a proper logging library
- Remove before committing
- Use conditional debug builds---
event: bash
pattern: sudo\s+|rm\s+-rf|chmod\s+777
---
Dangerous command detected!rm\s+-rfdd\s+if=mkfssudo\s+su\s+chmod\s+777chown\s+root---
event: file
pattern: console\.log\(|eval\(|innerHTML\s*=
---
Potentially problematic code pattern detected!---
event: file
conditions:
- field: file_path
operator: regex_match
pattern: \.tsx?$
- field: new_text
operator: regex_match
pattern: console\.log\(
---
Console.log in TypeScript file!console\.log\(debuggerprint\(eval\(innerHTML\s*=dangerouslySetInnerHTML\.env$credentials\.pem$node_modules/dist/build/---
event: stop
pattern: .*
---
Before stopping, verify:
- [ ] Tests were run
- [ ] Build succeeded
- [ ] Documentation updated---
event: prompt
conditions:
- field: user_prompt
operator: contains
pattern: deploy to production
---
Production deployment checklist:
- [ ] Tests passing?
- [ ] Reviewed by team?
- [ ] Monitoring ready?rmconsole.log.\.()\(\)[]\[\]\s\d\w.+*?|rm\s+-rf Matches: rm -rf, rm -rf
console\.log\( Matches: console.log(
(eval|exec)\( Matches: eval( or exec(
chmod\s+777 Matches: chmod 777, chmod 777
API_KEY\s*= Matches: API_KEY=, API_KEY =python3 -c "import re; print(re.search(r'your_pattern', 'test text'))"pattern: log # Matches "log", "login", "dialog", "catalog"console\.log\(|logger\.pattern: rm -rf /tmp # Only matches exact pathrm\s+-rf"pattern"\\spattern: \s.claude/.claude/hookify.{descriptive-name}.local.md.claude/*.local.md.gitignorehookify.dangerous-rm.local.mdhookify.console-log.local.mdhookify.require-tests.local.mdhookify.sensitive-files.local.mdhookify.rule1.local.mdhookify.mddanger.local.md.claude/hookify.{name}.local.md.local.mdenabled: false.local.md${CLAUDE_PLUGIN_ROOT}/examples/dangerous-rm.local.mdconsole-log-warning.local.mdsensitive-files-warning.local.md---
name: my-rule
enabled: true
event: bash
pattern: dangerous_command
---
Warning message here---
name: my-rule
enabled: true
event: file
conditions:
- field: file_path
operator: regex_match
pattern: \.ts$
- field: new_text
operator: contains
pattern: any
---
Warning messagebashfilestoppromptallcommandfile_pathnew_textold_textcontentuser_promptregex_matchcontainsequalsnot_containsstarts_withends_with