writing-hookify-rules

Define and validate frontmatter-based hookify rules for agent behavior.

231|217|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/fazxes/Claude-code --skill writing-hookify-rules-fazxes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hookify-rules
Source: https://github.com/fazxes/Claude-code/tree/main/stubs/downloads/official-plugins/marketplaces/claude-plugins-official/plugins/hookify/skills/writing-rules
Command: npx skills add https://github.com/fazxes/Claude-code --skill writing-hookify-rules-fazxes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hookify rule writing and validation to enforce guardrails in Claude-like agent interactions.

Core Features & Use Cases

  • Define and document rule structures with frontmatter-based metadata.
  • Validate rule syntax, conditions, and messages before deployment.
  • Apply rules to monitor agent behavior during prompts and tool use.

Quick Start

Create a new hookify rule file at .claude/hookify.{name}.local.md with frontmatter fields name, enabled, event, and pattern, and include a Markdown message body.

Frequently Asked Questions about writing-hookify-rules

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

FAQPage Schema
How do I write guardrail rules for Claude-like agents using markdown frontmatter?

To write agent guardrails, create a markdown file with frontmatter containing fields like name, enabled, event, and pattern, plus a message body to enforce specific behaviors during tool use and prompts. Validation ensures correct syntax before deployment.

What are hookify rules and how do they govern agent behavior?

Hookify rules are frontmatter-based definitions that monitor and enforce guardrails on agent behavior by matching patterns and events, triggering markdown message bodies during tool use or prompt interactions. Optional conditions can further refine when rules apply.

How do I validate hookify rule syntax and structure before deployment?

Validate hookify rules by checking the frontmatter schema for required fields like name, enabled, event, pattern, and messages, ensuring optional conditions are properly formatted and the markdown body is present. This prevents syntax errors during agent execution.

Can I use optional conditions in frontmatter rules to control when guardrails apply?

Yes, hookify rules support optional conditions within the frontmatter schema, allowing you to specify contextual criteria that must be met before a pattern triggers a message during agent tool use. This enables fine-grained control over guardrail enforcement.

What is the best way to structure a markdown file for agent guardrail patterns?

The best way to structure a guardrail markdown file is placing frontmatter with name, enabled, event, and pattern fields at the top, followed by a markdown message body that defines the rule's enforcement output. Save it in the .claude/hookify directory.