hooks-setup
2
总安装量
2
周安装量
#72332
全站排名
安装命令
npx skills add https://github.com/ssiumha/dots --skill hooks-setup
Agent 安装分布
opencode
2
gemini-cli
2
claude-code
2
github-copilot
2
codex
2
kimi-cli
2
Skill 文档
Hooks Setup
Claude Code hooks를 ì¤ì íê³ ê´ë¦¬í©ëë¤.
Hook ê°ì
| ì´ë²¤í¸ | ìì | ì©ë |
|---|---|---|
PreToolUse |
ë구 ì¤í ì | ê²ì¦, ê²½ê³ , ìë ì¹ì¸ |
PostToolUse |
ë구 ì¤í í | í¬ë§·í , 린í¸, ì²´í¬ |
UserPromptSubmit |
í롬íí¸ ì ì¶ ì | 컨í ì¤í¸ ì¶ê°, ê²ì¦ |
Stop |
ìëµ ìë£ ì | ìµì¢ ê²ì¦, ì 리 |
SessionStart |
ì¸ì ìì ì | íê²½ ì¤ì |
Notification |
ì림 ë°ì ì | ì림 ì²ë¦¬ |
Instructions
ìí¬íë¡ì° 1: íë¡ì í¸ì hooks ì¤ì
-
íë¡ì í¸ ë¶ì
# ì¸ì´/íë ììí¬ ê°ì§ Read package.json # Node.js Read pyproject.toml # Python Read go.mod # Go -
ì í©í ë ìí¼ ì í
íë¡ì í¸ ê¶ì¥ ë ìí¼ TypeScript/JavaScript prettier, eslint, console-log-check Python ruff, mypy Go gofmt, golint -
ì¤ì íì¼ ìì±
.claude/settings.json:{ "hooks": { "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "npx prettier --write \"${file_path}\"" } ] } ] } } -
ìë£ ìë´
â Hooks ì¤ì ìë£: .claude/settings.json /hooks ëª ë ¹ì´ë¡ íì¸ ê°ë¥
ìí¬íë¡ì° 2: 기존 hooks ìì
-
íì¬ ì¤ì íì¸
Read .claude/settings.json -
Editì¼ë¡ ìì
ì¤ì íì¼ ìì¹
| ìì¹ | ê²½ë¡ | ë²ì |
|---|---|---|
| ê¸ë¡ë² | ~/.claude/settings.json |
모ë íë¡ì í¸ |
| íë¡ì í¸ | .claude/settings.json |
íì¬ íë¡ì í¸ (커ë°) |
| ë¡ì»¬ | .claude/settings.local.json |
íì¬ íë¡ì í¸ (ë¹ì»¤ë°) |
Hook ë ìí¼
prettier (TypeScript/JavaScript)
{
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [{ "type": "command", "command": "npx prettier --write \"${file_path}\"", "timeout": 30 }]
}
]
}
eslint
{
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [{ "type": "command", "command": "npx eslint --fix \"${file_path}\"", "timeout": 30 }]
}
]
}
ruff (Python)
{
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [{ "type": "command", "command": "ruff format \"${file_path}\" && ruff check --fix \"${file_path}\"" }]
}
]
}
console.log ì²´í¬ (ê²½ê³ ë§ – exit 0, ì°¨ë¨ ìí¨)
{
"Stop": [
{
"hooks": [{ "type": "command", "command": "git diff --cached --name-only | xargs grep -l 'console.log' 2>/dev/null && echo 'â ï¸ console.log detected' || true" }]
}
]
}
ì°¨ë¨íë ¤ë©´ (exit 2 ì¬ì©):
git diff --cached --name-only | xargs grep -l 'console.log' 2>/dev/null && { echo 'console.log found' >&2; exit 2; } || true
íê²½ ë³ì
| ë³ì | ì¤ëª |
|---|---|
$CLAUDE_PROJECT_DIR |
íë¡ì í¸ ë£¨í¸ ê²½ë¡ |
$CLAUDE_ENV_FILE |
íê²½ë³ì ì ì¥ íì¼ (SessionStart) |
Hook ì¶ë ¥ ì ì´
| Exit Code | ëì |
|---|---|
| 0 | ì±ê³µ (stdout â verbose 모ë íì) |
| 2 | ë¸ë¡í¹ (stderr â ìë¬, ë구 ì°¨ë¨) |
| 기í | ë¹ë¸ë¡í¹ ìë¬ |
JSON ì ì´ (PreToolUse)
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow|deny|ask",
"permissionDecisionReason": "ì´ì "
}
}
ì¤ì ìì¹
- íë¡ì í¸ë³ ì¤ì ì°ì :
.claude/settings.jsonì¬ì© - timeout ì¤ì : ì¥ìê° ëª ë ¹ì´ë timeout ëª ì
- ê²½ë¡ ì¸ì©: 공백 í¬í¨ ê²½ë¡ ëë¹ ë°ì´í ì¬ì©
Examples
TypeScript íë¡ì í¸
User: /hooks-setup â ë¶ì â prettier + eslint ì¤ì
Python íë¡ì í¸
User: /hooks-setup python â ruff ë ìí¼ ì ì©
커ì¤í hook
User: “Stop ì í ì¤í¸ ì¤í hook” â Stop hook ì¤ì
Technical Details
Matcher í¨í´
| í¨í´ | ë§¤ì¹ |
|---|---|
Edit |
Editë§ |
Edit|Write |
Edit ëë Write |
* |
모ë ë구 |
mcp__memory__.* |
MCP ë구 |
ë³ê²½ ì ì©
hooks ë³ê²½ í /hooksìì 리뷰 íì (ë³´ìì ìë 미ì ì©)