Agent skill

writing-rules

Guide for creating hookify rules to prevent unwanted AI behaviors. Use when user asks to create, write, or configure hookify rules.

Stars 4
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/ANcpLua/ancplua-claude-plugins/tree/main/plugins/hookify/skills/writing-rules

SKILL.md

Writing Hookify Rules

When to Use

  • User asks to create, write, or configure hookify rules
  • User wants to prevent specific behaviors in Claude Code

Process

  1. Identify the behavior to prevent
  2. Choose the event type (bash, file, stop, prompt, all)
  3. Write the pattern (regex or conditions)
  4. Create the rule file in .claude/hookify.{name}.local.md
  5. Test immediately — rules take effect on next tool use

Rule File Format

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

Message shown to Claude when rule triggers.

Event Types

Event Matches Against Use For
bash Command text Dangerous commands, privilege escalation
file File path + content Debug code, sensitive files, security risks
stop Always (use .*) Completion checklists, required steps
stopfailure error_type, error_message API error alerts, rate limit handling
prompt User prompt text Deployment gates, process enforcement
all All events Cross-cutting concerns

Actions

  • warn (default): Show message, allow operation
  • block: Prevent operation entirely

Advanced: Multiple Conditions

yaml
conditions:
  - field: file_path
    operator: regex_match
    pattern: \.env$
  - field: new_text
    operator: contains
    pattern: API_KEY

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

Fields: bash → command | file → file_path, new_text, old_text, content | prompt → user_prompt

All conditions must match for the rule to trigger.

File Organization

  • Location: .claude/hookify.{descriptive-name}.local.md
  • Gitignore: Add .claude/*.local.md to .gitignore
  • Naming: Start with verb: warn-dangerous-rm, block-console-log, require-tests

See references/ for regex patterns, examples, and common pitfalls.

If Connectors Available

  • github Commit generated rule files and open a PR for team review
  • slack Notify the team when a new blocking rule is added to the project
  • linear Track rule creation as a task linked to the behavior it guards against

Expand your agent's capabilities with these related and highly-rated skills.

ANcpLua/ancplua-claude-plugins

example-skill

Brief description of what this skill does. Use when [specific trigger situations].

4 0
Explore
ANcpLua/ancplua-claude-plugins

elegance-pipeline

Run a persistent multi-agent code-elegance workflow with 4 scouts, 2 judges, 1 planner, 1 verifier, and 1 gated implementer. Use when evaluating source-file elegance across a repository and optionally converting weaknesses into refactor work.

4 0
Explore
ANcpLua/ancplua-claude-plugins

carlini-jr

Leaderless multi-agent swarm with Playwright oracle. Spawns N workers in isolated worktrees with pre-partitioned DOD items. Workers implement and verify via screenshots. No orchestrator, no shared state.

4 0
Explore
ANcpLua/ancplua-claude-plugins

otel-expert

Use this when working with OpenTelemetry, telemetry, observability, traces, spans, metrics, logs, OTLP, semantic conventions, or instrumentation. Triggers on questions like "what attributes should I use", "how do I configure the collector", "what's the semconv for X".

4 0
Explore
ANcpLua/ancplua-claude-plugins

design-studio

Design intelligence studio. Creative direction + data-driven recommendations for distinctive frontend interfaces. 50 styles, 97 palettes, 57 font pairings, 99 UX guidelines, 25 chart types, 13 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, Astro, Nuxt, Jetpack Compose). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.

4 0
Explore
ANcpLua/ancplua-claude-plugins

hades

IF cleanup/elimination needed THEN use this. IF zero suppressions THEN this. IF dead code THEN this. IF duplication THEN this. IF frontend design quality audit THEN use this with --goggles. Smart-Hades: every session gets a Smart ID, deletion permit, and audit ledger. Team lead skill — spawns 4 debate teammates per phase (+3 goggles teammates when equipped). Ignores public API, semver, changelog. Pure functional destruction. Idempotent: same input, same output. Requires CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1.

4 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results