majiang213/openclaw-mas/cmd-hookify
Claude Code and agent skill by majiang213/openclaw-mas
- community
Checking that the SKILL.md file is still in the repository.
Create OpenClaw hook rules to prevent unwanted agent behaviors
Install
npx vskill@latest install majiang213/openclaw-mas/cmd-hookifySKILL.md
The same SKILL.md was published earlier as majiang213/openclaw-mas/cmd-hookify.
Project Path
The first argument is the project path. Before doing anything else:
- Extract the project path from the first argument
- Verify the path exists
- Work within that directory for all file operations and shell commands
Hookify
Create OpenClaw hooks to prevent unwanted agent behaviors by analyzing conversation patterns or explicit user instructions.
Usage
/skill cmd_hookify <project-path> [description of behavior to prevent]
If no description is provided, use the conversation-analyzer agent to find behaviors worth preventing from the current conversation.
Workflow
Step 1: Gather Behavior Info
- With description: parse the user's description of the unwanted behavior
- Without description: delegate to
conversation-analyzeragent to identify: - Explicit corrections the user made
- Frustrated reactions to repeated mistakes
- Reverted changes
- Repeated similar issues
Step 2: Design the Hook
For each behavior to prevent, determine:
- Event: which OpenClaw event to listen on (see event types below)
- Pattern: what to match (regex against message content, command source, etc.)
- Name: a descriptive kebab-case name
Note: Internal hooks can only warn (push messages to the user). They cannot block actions. Errors in handlers are caught and logged but don't prevent other handlers from running.
Step 3: Generate Hook Files
Create a hook directory at <project-path>/.openclaw/hooks/<hook-name>/:
HOOK.md:
handler.ts:
Event Types & Context Fields
| Event | type | action | Useful context fields | |
|---|---|---|---|---|
command:new | command | new | commandSource, workspaceDir, sessionEntry, cfg | |
command:reset | command | reset | sessionEntry | |
command:stop | command | stop | sessionEntry | |
message:received | message | received | from, content, channelId, conversationId, metadata | |
message:sent | message | sent | to, content, success, channelId, groupId | |
message:transcribed | message | transcribed | content, transcript, from, channelId | |
message:preprocessed | message | preprocessed | body, bodyForAgent, transcript, isGroup, groupId | |
session:patch | session | patch | sessionEntry, patch, cfg | |
agent:bootstrap | agent | bootstrap | workspaceDir, bootstrapFiles, agentId, sessionKey | |
gateway:startup | gateway | startup | cfg, workspaceDir |
Step 4: Register the Hook
Or add to openclaw.json:
Step 5: Confirm
Report created hook files and remind the user to run openclaw hooks list to verify.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cmd_hookify/SKILL.md
Popularity
- Repository stars
- 5
- Repository forks
- 1
- 7-day trend score
- 9
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/majiang213/openclaw-mas/cmd-hookify)