Writing Hookify Rules

Create Hookify rule files with YAML frontmatter and markdown bodies.

1|Updated May 4, 2026
One-click install
npx skills add https://github.com/open-session/os_design_system --skill writing-hookify-rules-open-session
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Hookify Rules
Source: https://github.com/open-session/os_design_system/tree/main/.claude/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/open-session/os_design_system --skill writing-hookify-rules-open-session

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you define Hookify rules without guessing the syntax, so you can reliably warn, block, or check for patterns across Claude workflows.

Core Features & Use Cases

  • Rule Authoring: Write markdown-based Hookify rules with YAML frontmatter for names, enabled state, events, patterns, and conditions.
  • Workflow Guardrails: Catch risky bash commands, sensitive file edits, prompt phrases, or stop-time checks before they become problems.
  • Practical Uses: Create rules that warn on dangerous commands, protect environment files, or remind the agent to verify tests before ending a session.

Quick Start

Ask the assistant to write a Hookify rule that warns whenever a bash command matches a dangerous pattern such as rm -rf.

Frequently Asked Questions about Writing Hookify Rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create rules to block dangerous bash commands in Claude workflows?

To block dangerous bash commands in Claude, you create Hookify rules using local markdown files with valid YAML frontmatter. These files define regex patterns to match risky commands and trigger warnings or blocks before execution.

What are Hookify rules and how do they work with Claude?

Hookify rules are markdown files with YAML frontmatter that detect user-defined patterns in Claude workflows. They apply regex or condition-based matching to bash commands, file edits, prompt phrases, and stop events to trigger warnings, blocks, or completion checks.

Can I use regex to warn against sensitive file edits in Claude?

Yes, you can use regex in Hookify rules to warn against sensitive file edits in Claude. By defining the appropriate regex patterns in the YAML frontmatter, the rule matches file edit operations and displays a markdown warning message.

How do I configure a completion check for stop events in Claude?

You configure a completion check for stop events by creating a Hookify rule with YAML frontmatter targeting the stop event. Use condition-based matching to verify tasks like running tests, storing the rule as a local markdown file to remind the agent before ending.

Do I need YAML to write workflow guardrails for prompt-triggered conditions?

Yes, valid YAML frontmatter is required to write workflow guardrails for prompt-triggered conditions. The YAML section defines the rule's enabled state, target events, and matching conditions, while the markdown body holds the warning message.