Communitygithub.com

hookify-규칙

이 스킬은 사용자가 hookify 규칙을 생성하거나, hook 규칙을 작성하거나, hookify를 구성하거나, hookify 규칙을 추가하거나, hookify 규칙 문법 및 패턴에 대한 안내가 필요할 때 사용합니다.

hookify-규칙란 무엇인가요?

Hookify 규칙(Hookify Rules)은 YAML 프론트매터가 포함된 마크다운 파일로, 특정 패턴을 감시하고 패턴이 일치할 때 메시지를 표시하는 데 사용됩니다. 이 스킬은 Claude Code 또는 유사한 AI 에이전트에서 작동하며, 개발자가 Bash 명령, 파일 편집, 정지 이벤트, 사용자 프롬프트 등 다양한 후크 이벤트에 대한 사용자 정의 규칙을 작성할 수 있도록 지원합니다. 정규 표현식을 기반으로 패턴 일치를 수행하며, `warn`(경고) 또는 `block`(차단) 동작을 설정할 수 있습니다. 또한 여러 조건을 결합한 고급 규칙을 작성할 수 있어, 보안 위험 방지, 디버그 코드 경고, 작업 흐름 강제 등 다양한 용도로 활용 가능합니다. 규칙 파일은 프로젝트 루트의 `.claude/` 디렉토리에 저장되며, `/hookify` 명령어를 통해 대화 분석을 기반으로 자동 생성하거나 `/hookify-list`, `/hookify-configure` 명령어로 관리할 수 있습니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/hookify-rules

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Hookify 규칙 작성하기

개요

Hookify 규칙은 YAML 프론트매터가 포함된 마크다운 파일로, 감시할 패턴과 해당 패턴이 일치할 때 표시할 메시지를 정의합니다. 규칙은 .claude/hookify.{규칙-이름}.local.md 파일에 저장됩니다.

규칙 파일 형식

기본 구조

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

이 규칙이 트리거될 때 Claude에게 표시할 메시지.
마크다운 서식, 경고, 제안 등을 포함할 수 있습니다.

프론트매터 필드

필드필수값설명
name예케밥-케이스 문자열고유 식별자 (동사-우선: warn-, block-, require-*)
enabled예true/false삭제 없이 토글
event예bash/file/stop/prompt/all트리거할 후크 이벤트
action아니요warn/blockwarn (기본값)은 메시지를 표시하고, block은 작업을 차단합니다
pattern예*정규식 문자열일치시킬 패턴 (*또는 복잡한 규칙에는 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
---

.env 파일에 API 키를 추가하고 있습니다. 이 파일이 .gitignore에 있는지 확인하세요!

이벤트별 조건 필드:

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

연산자: regex_match, contains, equals, not_contains, starts_with, ends_with

규칙이 트리거되려면 모든 조건이 일치해야 합니다.

이벤트 유형 가이드

bash 이벤트

Bash 명령 패턴 일치:

  • 위험한 명령: rm\s+-rf, dd\s+if=, mkfs
  • 권한 상승: sudo\s+, su\s+
  • 권한 문제: chmod\s+777

file 이벤트

편집/쓰기/다중 편집 작업 일치:

  • 디버그 코드: console\.log\(, debugger
  • 보안 위험: eval\(, innerHTML\s*=
  • 민감한 파일: \.env$, credentials, \.pem$

stop 이벤트

완료 확인 및 알림. 패턴 .*은 항상 일치합니다.

prompt 이벤트

워크플로 강제 적용을 위해 사용자 프롬프트 내용을 일치시킵니다.

패턴 작성 팁

정규식 기본

  • 특수 문자 이스케이프: . -> \., ( -> \(
  • \s 공백, \d 숫자, \w 단어 문자
  • + 하나 이상, * 0개 이상, ? 선택적
  • | OR 연산자

일반적인 함정

  • 너무 광범위함: log는 "login", "dialog"와 일치함 — console\.log\( 사용
  • 너무 구체적임: rm -rf /tmp — rm\s+-rf 사용
  • YAML 이스케이프: 따옴표 없는 패턴 사용; 따옴표로 묶인 문자열은 \\s 필요

테스트

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

파일 구성

  • 위치: 프로젝트 루트의 .claude/ 디렉토리
  • 이름: .claude/hookify.{설명적-이름}.local.md
  • Gitignore: .gitignore에 .claude/*.local.md 추가

명령어

  • /hookify [설명] - 새 규칙 생성 (인수가 없으면 대화를 자동 분석)
  • /hookify-list - 모든 규칙을 테이블 형식으로 보기
  • /hookify-configure - 대화식으로 규칙 켜기/끄기 전환
  • /hookify-help - 전체 문서

빠른 참조

최소 실행 가능 규칙:

---
name: my-rule
enabled: true
event: bash
pattern: dangerous_command
---
경고 메시지

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

관련 스킬