/from-hook
Convert Python SDK hooks to declarative rules
$ npx -y skills add athola/claude-night-market --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/from-hook
Context preview
What this command does when you run it.
Convert Python SDK hooks to declarative rules
Command definition
from-hook.mdname: from-hook description: Convert Python SDK hooks to declarative rules
/hookify:from-hook
Convert Python SDK hooks to declarative hookify rules.
Usage
/hookify:from-hook <hook_file.py> # Convert single hook /hookify:from-hook --scan <hooks_dir> # Scan directory /hookify:from-hook <hook.py> -o rules.md # Output to file
What It Does
1. Parses Python hook AST 2. Extracts regex patterns, string checks, startswith/endswith 3. Generates equivalent hookify rule YAML 4. Reports unconvertible hooks (network, file I/O, complex logic)
Example
Input hook:
import re
def hook(context):
if re.search(r"rm -rf /", context["command"]):
return {"action": "block", "message": "Dangerous!"}Output rule:
--- name: block-rm-rf event: bash pattern: 'rm -rf /' action: block --- Dangerous command blocked.
Limitations
Cannot convert hooks with:
- Network calls (API requests)
- File I/O operations
- Complex conditional logic
- External dependencies
See Also
- `hookify:browse` - Browse available rules
- `hookify:install` - Install rules
A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Other commands on claude-night-market.
- /aggregate-logs
Generate LEARNINGS.md from skill execution logs.
Open command - /analyze-skill
Analyze skill file complexity metrics and generate modularization recommendations for splitting or progressive loading.
Open command - /bulletproof-skill
Harden skills against rationalization and bypass behaviors
Open command - /context-report
Generate context optimization report for skill directories
Open command - /create-command
Create slash commands with brainstorming and best practices
Open command - /create-hook
Create hooks with brainstorming and security-first design
Open command

