Xpersona
W

writing-rules

CLAWHUB · Unverified

Creates behavioral rules in markdown to block dangerous commands or restrict AI behavior Skill: writing-rules Owner: athola Summary: Creates behavioral rules in markdown to block dangerous commands or restrict AI behavior Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:12:05.073Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:33:51.576Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:50:35.553Z | user Release v1.9.16 v1.9.14 | 2026-06-30T17:59:44.810Z | user Release v1.9.14 v1.9.13 | 2026-06-

62
Rank
84
Safety
1.6k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-hookify-writing-rules
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-hookify-writing-rules/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

78,300 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: writing-rules
description: |
  Creates behavioral rules in markdown to block dangerous commands or restrict AI behavior
version: 1.9.8
triggers:
  - hookify
  - rules
  - patterns
  - validation
  - safety
  - adding safety guardrails or preventing specific commands
metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/hookify", "emoji": "\ud83e\udd9e"}}
source: claude-night-market
source_plugin: hookify
---

> **Night Market Skill** — ported from [claude-night-market/hookify](https://github.com/athola/claude-night-market/tree/master/plugins/hookify). For the full experience with agents, hooks, and commands, install the Claude Code plugin.


## Table of Contents

- [Overview](#overview)
- [Quick Start](#quick-start)
- [Rule File Format](#rule-file-format)
- [Frontmatter Fields](#frontmatter-fields)
- [Event Types](#event-types)
- [Advanced Conditions](#advanced-conditions)
- [Operators](#operators)
- [Field Reference](#field-reference)
- [Pattern Writing](#pattern-writing)
- [Regex Basics](#regex-basics)
- [Examples](#examples)
- [Test Patterns](#test-patterns)
- [Example Rules](#example-rules)
- [Block Destructive Commands](#block-destructive-commands)
- [Warn About Debug Code](#warn-about-debug-code)
- [Require Tests](#require-tests)
- [Protect Production Files](#protect-production-files)
- [Management](#management)
- [Related Skills](#related-skills)
- [Best Practices](#best-practices)


# Hookify Rule Writing Guide


## When To Use

- Creating behavioral rules to prevent unwanted actions
- Defining persistent guardrails for Claude Code sessions

## When NOT To Use

- Complex multi-step workflows - use agents instead
- One-time operations that do not need persistent behavioral rules

## Overview

Hookify rules are markdown files with YAML frontmatter that define patterns to watch for and messages to show when those patterns match. Rules are stored in `.claude/hookify.{rule-name}.local.md` files.

## Quick Start

Create `.claude/hookify.dangerous-rm.local.md`:

```yaml
---
name: dangerous-rm
enabled: true
event: bash
pattern: rm\s+-rf
action: block
---

🛑 **Dangerous rm command detected!**

This command could delete important files.
```
**Verification:** Run the command with `--help` flag to verify availability.

The rule activates immediately - no restart needed!

## Rule File Format

### Frontmatter Fields

**name** (required): Unique identifier (kebab-case)
**enabled** (required): `true` or `false`
**event** (required): `bash`, `file`, `stop`, `prompt`, or `all`
**action** (optional): `warn` (default) or `block`
**pattern** (simple): Regex pattern to match

### Event Types

- **bash**: Bash tool commands
- **file**: Edit, Write, MultiEdit tools
- **stop**: When agent wants to stop
- **prompt**: User prompt submission
- **all**: All events

### Advanced Conditions

For multiple field checks:

```yaml
---
name: warn-env-edits
enabled: true
event: file
action: warn
conditions:
  - fiel

_meta.json

{
  "ownerId": "kn7d107jg9jv602h9ytsegydq184a42s",
  "slug": "nm-hookify-writing-rules",
  "version": "1.9.19",
  "publishedAt": 1787749925073
}

skill-card.md

## Description:

Creates behavioral rules in markdown to block dangerous commands or restrict AI behavior.

This skill is ready for commercial/non-commercial use.

## Publisher:

[athola](https://clawhub.ai/user/athola)

### License/Terms of Use:

MIT-0

## Use Case:

Developers use this skill to create persistent Hookify guardrail rules that warn about or block dangerous commands and restrict unwanted agent behavior in Claude Code workflows.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Persistent Hookify rules can warn on or block future Claude Code actions more broadly than intended.

Mitigation: Review generated .claude/hookify.*.local.md files and keep broad blocking rules disabled or warning-only until tested.

Risk: Regex patterns may miss risky actions or match benign commands and file edits.

Mitigation: Test patterns against representative examples before relying on them and use clear messages that explain the intended guardrail.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-hookify-writing-rules)
- [Hookify plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/hookify)

## Skill Output:

**Output Type(s):** [Markdown, Configuration, Shell commands, Guidance]

**Output Format:** [Markdown with YAML frontmatter examples and inline shell commands]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Produces local Hookify rule guidance for .claude/hookify.*.local.md files.]

## Skill Version(s):

1.9.19 (source: server release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to writing-rules and adjacent AI workflows.