Communitygithub.com

hookify-규칙

이 스킬은 사용자가 hookify 규칙 생성, 후크 규칙 작성, hookify 구성, hookify 규칙 추가 또는 hookify 규칙 문법 및 패턴에 대한 안내를 요청할 때 사용됩니다.

hookify-규칙란 무엇인가요?

Hookify 규칙은 YAML 머리말이 포함된 마크다운 파일로, 특정 패턴을 감시하고 해당 패턴이 일치할 때 메시지를 표시합니다. 이 스킬은 Claude Code, Cursor, Codex와 같은 AI 에이전트 플랫폼에서 작동하며, 개발자가 bash 명령어, 파일 변경, 작업 중지, 사용자 프롬프트 등 다양한 이벤트에 대한 규칙을 정의할 수 있도록 합니다. 규칙은 프로젝트 루트의 `.claude/hookify.{규칙-이름}.local.md` 파일에 저장되며, 정규 표현식 패턴과 여러 조건(conditions)을 지원하여 세밀한 매칭이 가능합니다. 또한 warn(경고) 또는 block(차단) 동작을 지정할 수 있어 보안 위험, 디버그 코드, 민감한 파일 접근 등을 효과적으로 관리할 수 있습니다. `/hookify`, `/hookify-list`, `/hookify-configure` 등의 명령어를 통해 규칙을 생성, 조회, 토글할 수 있어 개발 워크플로우를 강화합니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/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예kebab-case 문자열고유 식별자 (동사 우선: 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/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

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.

관련 스킬