majiang213/openclaw-mas/cmd-hookify

Claude Code and agent skill by majiang213/openclaw-mas

Trust tier 3
  • community
Source check pending

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-hookify

SKILL.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:

  1. Extract the project path from the first argument
  2. Verify the path exists
  3. 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-analyzer agent 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:

markdown
---
name: <hook-name>
description: "<what this hook warns about>"
events: ["<event:action>"]
enabled: true
emoji: "🛡️"
---

handler.ts:

typescript
import type { InternalHookEvent } from "openclaw/plugin-sdk/hook-runtime";
const handler = async (event: InternalHookEvent) => {
if (event.type !== "<type>" || event.action !== "<action>") {
return;
}
const ctx = event.context as Record<string, unknown>;
const content = (ctx.content ?? ctx.commandSource ?? '') as string;
const pattern = /<regex pattern>/i;
if (pattern.test(content)) {
event.messages.push('⚠️ Warning: <description of unwanted behavior detected>');
}
};
export default handler;
Event Types & Context Fields
EventtypeactionUseful context fields
command:newcommandnewcommandSource, workspaceDir, sessionEntry, cfg
command:resetcommandresetsessionEntry
command:stopcommandstopsessionEntry
message:receivedmessagereceivedfrom, content, channelId, conversationId, metadata
message:sentmessagesentto, content, success, channelId, groupId
message:transcribedmessagetranscribedcontent, transcript, from, channelId
message:preprocessedmessagepreprocessedbody, bodyForAgent, transcript, isGroup, groupId
session:patchsessionpatchsessionEntry, patch, cfg
agent:bootstrapagentbootstrapworkspaceDir, bootstrapFiles, agentId, sessionKey
gateway:startupgatewaystartupcfg, workspaceDir
Step 4: Register the Hook
bash
openclaw hooks enable <hook-name>

Or add to openclaw.json:

json
"hooks.internal.entries.<hook-name>": { "enabled": true }
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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/majiang213/openclaw-mas/cmd-hookify/badge)](https://verified-skill.com/skills/majiang213/openclaw-mas/cmd-hookify)

Something wrong with this skill or its page? Tell us.