Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/lexler/skill-factory --skill creating-hooks명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Find where a codebase actually costs time by mining its git history (Tornhill hotspot analysis). Produces ranked refactoring targets with evidence, change-coupling seams, and a do-not-refactor list; re-run after refactoring to verify it paid off.
Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.
Demos working software: first proves every claimed behavior by exercising the real artifact, then replays the proof as a slow, voice-narrated walkthrough. Use when the user asks for a demo or to be shown that something works.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | creating-hooks |
| description | Creates Claude Code hooks. |
STARTER_CHARACTER = 🪝
First, update the reference docs to get the latest from Anthropic:
python ~/.claude/skills/creating-hooks/scripts/update-docs.py
Shell commands that execute at lifecycle points in Claude Code. Unlike prompts, hooks are deterministic—they always run when triggered.
Hooks live in settings files:
~/.claude/settings.json - User settings (all projects).claude/settings.json - Project settings (shared via git).claude/settings.local.json - Local project settings (not committed){
"hooks": {
"EventName": [
{
"matcher": "ToolPattern",
"hooks": [
{
"type": "command",
"command": "your-command-here"
}
]
}
]
}
}
Matcher: Pattern to match tool names (case-sensitive)
WriteEdit|Write* or omitEnvironment variables:
$CLAUDE_PROJECT_DIR - Absolute path to project root$CLAUDE_ENV_FILE - File path for persisting env vars (SessionStart only)Tool events (matcher applies):
PreToolUse - Before tool executesPostToolUse - After tool completesPermissionRequest - Permission dialog shownSession events:
SessionStart - Session begins/resumes (matcher: startup/resume/clear/compact)SessionEnd - Session endsPreCompact - Before compaction (matcher: manual/auto)Other events:
UserPromptSubmit - User submits promptStop - Agent finishesSubagentStop - Subagent finishesNotification - Alerts sent (matcher: notification type)UserPromptSubmit/SessionStart, stdout added to context.For advanced control, return JSON to stdout with exit code 0:
{
"continue": false,
"stopReason": "Message shown when stopping"
}
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow",
"permissionDecisionReason": "Auto-approved",
"updatedInput": { "field": "modified value" }
}
}
Decisions: "allow" (bypass permission), "deny" (block), "ask" (prompt user)
{
"decision": "block",
"reason": "Explanation fed to Claude"
}
{
"decision": "block",
"reason": "Must fix X before stopping"
}
Hooks receive JSON via stdin:
{
"session_id": "abc123",
"transcript_path": "/path/to/transcript.jsonl",
"cwd": "/current/dir",
"permission_mode": "default",
"hook_event_name": "PreToolUse",
"tool_name": "Write",
"tool_input": { "file_path": "/path", "content": "..." }
}
Auto-format after edit:
{
"hooks": {
"PostToolUse": [{
"matcher": "Edit|Write",
"hooks": [{
"type": "command",
"command": "jq -r '.tool_input.file_path' | xargs -I{} sh -c 'echo {} | grep -q \"\\.ts$\" && npx prettier --write {}'"
}]
}]
}
}
Block dangerous commands:
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/validate-bash.py"
}]
}]
}
}
Inject context on prompt:
{
"hooks": {
"UserPromptSubmit": [{
"hooks": [{
"type": "command",
"command": "echo '[REMINDER: Follow TDD]'"
}]
}]
}
}
Desktop notification:
{
"hooks": {
"Notification": [{
"hooks": [{
"type": "command",
"command": "osascript -e 'display notification \"Claude needs input\" with title \"Claude Code\"'"
}]
}]
}
}
For complex logic, use external scripts. UV single-file format works well:
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = []
# requires-python = ">=3.11"
# ///
import json
import sys
data = json.load(sys.stdin)
tool_input = data.get("tool_input", {})
# Validation logic here
if should_block:
print("Error message", file=sys.stderr)
sys.exit(2)
sys.exit(0)