affaan-m/ECC

hookify-rules

This skill should be used when the user asks to create a hookify rule, write a hook rule, configure hookify, add a hookify rule, or needs guidance on hookify rule syntax and patterns.

82CollectingRuns scripts
See how to use itView GitHub source
npx skills add https://github.com/affaan-m/ECC --skill "skills/hookify-rules"
Automated source guide

Source checked Jul 28, 2026·Refresh due Oct 26, 2026

Reorganized from the pinned upstream SKILL.md

Turn hookify-rules's source instructions into a guide you can follow

According to the pinned SKILL.md from affaan-m/ECC: This skill should be used when the user asks to create a hookify rule, write a hook rule, configure hookify, add a hookify rule, or needs guidance on hookify rule syntax and patterns.

npx skills add https://github.com/affaan-m/ECC --skill "skills/hookify-rules"
Check the pinned source

Best fit

  • This skill should be used when the user asks to create a hookify rule, write a hook rule, configure hookify, add a hookify rule, or needs guidance on hookify rule syntax and patterns.

Bring this context

  • A concrete task that matches the documented purpose of hookify-rules.
  • The files, examples, or context the task depends on.
  • Your constraints, target environment, and definition of done.

Expected outputs

  • A result that follows the pinned hookify-rules instructions.
  • A concise record of assumptions, inputs used, and unresolved questions.
  • A final check against the source workflow and relevant permission signals.

Key source sections

Read hookify-rules through these 5 source sections

Sections are extracted automatically from the pinned SKILL.md and link back to the source.

01

Rule File Format

Condition fields by event: - bash: command - file: filepath, newtext, oldtext, content - prompt: userprompt

SKILL.md · Rule File Format
bash: commandfile: filepath, newtext, oldtext, contentprompt: userprompt
02

Basic Structure

Review the “Basic Structure” section in the pinned source before continuing.

SKILL.md · Basic Structure
Review and apply the “Basic Structure” source section.
03

Frontmatter Fields

Review the “Frontmatter Fields” section in the pinned source before continuing.

SKILL.md · Frontmatter Fields
Review and apply the “Frontmatter Fields” source section.
04

Advanced Format (Multiple Conditions)

Condition fields by event: - bash: command - file: filepath, newtext, oldtext, content - prompt: userprompt

SKILL.md · Advanced Format (Multiple Conditions)
bash: commandfile: filepath, newtext, oldtext, contentprompt: userprompt
05

Event Type Guide

Match Bash command patterns: - Dangerous commands: rm\s+-rf, dd\s+if=, mkfs - Privilege escalation: sudo\s+, su\s+ - Permission issues: chmod\s+777

SKILL.md · Event Type Guide
Dangerous commands: rm\s+-rf, dd\s+if=, mkfsPrivilege escalation: sudo\s+, su\s+Permission issues: chmod\s+777

SkillSignal prompt templates

Provide the task, context, and acceptance criteria

These prompts were written by SkillSignal from the source structure; they are not upstream text.

Task-start prompt

Confirm source fit, inputs, and outputs before acting.

Use hookify-rules to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.

Source-guided execution

Make the Agent explicitly follow the key extracted sections.

Apply the pinned hookify-rules source to [task]. Pay particular attention to these source sections: “Rule File Format”, “Basic Structure”, “Frontmatter Fields”, “Advanced Format (Multiple Conditions)”, “Event Type Guide”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].

Result-review prompt

Check omissions, permissions, and source drift before delivery.

Review the current hookify-rules result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.

Output checklist

Verify each item before delivery

The task matches the purpose documented in the SKILL.md.

The source section “Rule File Format” has been checked.

The source section “Basic Structure” has been checked.

The source section “Frontmatter Fields” has been checked.

The source section “Advanced Format (Multiple Conditions)” has been checked.

Inputs, constraints, and acceptance criteria are explicit.

Unverified facts, compatibility, and outcome claims are clearly marked.

Any file, command, network, or data action has been reviewed.

Choose a different workflow

When another Skill is the better fit

FAQ

What does hookify-rules do?

This skill should be used when the user asks to create a hookify rule, write a hook rule, configure hookify, add a hookify rule, or needs guidance on hookify rule syntax and patterns.

How do I start using hookify-rules?

The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "skills/hookify-rules". Inspect the command and pinned source before running it.

Which Agent platforms does it declare?

No dedicated Agent platform is declared in the pinned source record.

Repository stars
234,327
Repository forks
35,711
Quality
82/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

82/100
Documentation26/30
Specificity17/25
Maintenance18/20
Trust signals21/25

Compare before choosing

Related Agent Skills and source variants

These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.

View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 2 min

Writing Hookify 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.

Rule File Format

Basic Structure

---
name: rule-identifier
enabled: true
event: bash|file|stop|prompt|all
pattern: regex-pattern-here
---

Message to show Claude when this rule triggers.
Can include markdown formatting, warnings, suggestions, etc.

Frontmatter Fields

FieldRequiredValuesDescription
nameYeskebab-case stringUnique identifier (verb-first: warn-, block-, require-*)
enabledYestrue/falseToggle without deleting
eventYesbash/file/stop/prompt/allWhich hook event triggers this
actionNowarn/blockwarn (default) shows message; block prevents operation
patternYes*regex stringPattern to match (*or use conditions for complex rules)

Advanced Format (Multiple Conditions)

---
name: warn-env-api-keys
enabled: true
event: file
conditions:
  - field: file_path
    operator: regex_match
    pattern: \.env$
  - field: new_text
    operator: contains
    pattern: API_KEY
---

You're adding an API key to a .env file. Ensure this file is in .gitignore!

Condition fields by event:

  • bash: command
  • file: file_path, new_text, old_text, content
  • prompt: user_prompt

Operators: regex_match, contains, equals, not_contains, starts_with, ends_with

All conditions must match for rule to trigger.

Event Type Guide

bash Events

Match Bash command patterns:

  • Dangerous commands: rm\s+-rf, dd\s+if=, mkfs
  • Privilege escalation: sudo\s+, su\s+
  • Permission issues: chmod\s+777

file Events

Match Edit/Write/MultiEdit operations:

  • Debug code: console\.log\(, debugger
  • Security risks: eval\(, innerHTML\s*=
  • Sensitive files: \.env$, credentials, \.pem$

stop Events

Completion checks and reminders. Pattern .* matches always.

prompt Events

Match user prompt content for workflow enforcement.

Pattern Writing Tips

Regex Basics

  • Escape special chars: . to \., ( to \(
  • \s whitespace, \d digit, \w word char
  • + one or more, * zero or more, ? optional
  • | OR operator

Common Pitfalls

  • Too broad: log matches "login", "dialog" — use console\.log\(
  • Too specific: rm -rf /tmp — use rm\s+-rf
  • YAML escaping: Use unquoted patterns; quoted strings need \\s

Testing

python3 -c "import re; print(re.search(r'your_pattern', 'test text'))"

File Organization

  • Location: .claude/ directory in project root
  • Naming: .claude/hookify.{descriptive-name}.local.md
  • Gitignore: Add .claude/*.local.md to .gitignore

Commands

  • /hookify [description] - Create new rules (auto-analyzes conversation if no args)
  • /hookify-list - View all rules in table format
  • /hookify-configure - Toggle rules on/off interactively
  • /hookify-help - Full documentation

Quick Reference

Minimum viable rule:

---
name: my-rule
enabled: true
event: bash
pattern: dangerous_command
---
Warning message here
Source repo
affaan-m/ECC
Skill path
skills/hookify-rules/SKILL.md
Commit SHA
4e973d3eaf92
Repository license
MIT
Data collected