Skip to content
Merged
20 changes: 20 additions & 0 deletions .claude/hookify.block-packages.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: block-packages
enabled: true
event: file
action: block
conditions:
- field: file_path
operator: regex_match
pattern: node_modules/|vendor/|\.venv/|venv/|__pycache__/|\.git/
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated
---

🛑 **Dependency folder edit blocked**

이 폴더의 파일은 직접 편집할 수 없습니다:

- `node_modules/`, `vendor/` - 패키지 매니저 관리 폴더
- `.venv/`, `venv/`, `__pycache__/` - Python 환경/캐시
- `.git/` - Git 내부 데이터

변경사항은 패키지 재설치 시 손실되며, 버전 관리에 포함되지 않습니다.
24 changes: 24 additions & 0 deletions .claude/hookify.require-tests.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: require-tests
enabled: false
event: stop
action: block
conditions:
- field: transcript
operator: not_contains
pattern: npm test|yarn test|pnpm test|pytest|phpunit|pest|cargo test|go test
Comment thread
kimchanhyung98 marked this conversation as resolved.
---

# TODO : make test, make check 등으로 변경해서 사용

⚠️ **Tests not detected in transcript**

작업 완료 전 테스트 실행이 감지되지 않았습니다.

변경사항이 정상 동작하는지 확인하기 위해, 프로젝트에 맞는 테스트 명령어 중 **하나를 실행**하세요:

- JavaScript/TypeScript: `npm test`, `yarn test`, `pnpm test`
- PHP: `phpunit`, `pest`
- Python: `pytest`
- Go: `go test`
- Rust: `cargo test`
22 changes: 22 additions & 0 deletions .claude/hookify.sync-docs.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: sync-docs
enabled: true
event: file
action: warn
conditions:
- field: file_path
operator: regex_match
pattern: \.(php|ts|js|py|svelte|cs|rs)$
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated
---

📝 **Documentation sync required**

코드가 변경되었습니다. `app/Domains/{domain}/docs/`의 관련 문서를 **추가하거나 갱신**해야 하는지 확인하세요:
Comment thread
kimchanhyung98 marked this conversation as resolved.

- 새 기능 추가 시 → 문서 **생성** 필요
- 기존 기능 수정/삭제 시 → 문서 **갱신** 필요

[ ] `adr/*.md` - 아키텍처 결정사항 변경 시
[ ] `bpmn.md` - 비즈니스 프로세스 흐름 변경 시
[ ] `planning.md` - 기능 계획/요구사항 변경 시
[ ] `tech-spec.md` - 기술 명세/API 스펙 변경 시
19 changes: 19 additions & 0 deletions .claude/hookify.warn-security.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: warn-security
enabled: true
event: file
action: warn
conditions:
- field: new_text
operator: regex_match
pattern: console\.log\(|debugger;|var_dump\(|dd\(|print_r\(|(api[_-]?key|secret[_-]?key|password|token|auth[_-]?token)\s*[=:]\s*["'][^"']{8,}["']
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated
---

⚠️ **Debug code or hardcoded secret detected**

커밋 전 확인이 필요한 패턴이 감지되었습니다:

- 디버그 코드: `console.log`, `debugger`, `var_dump`, `dd`, `print_r`
- 하드코딩된 시크릿: `api_key`, `password`, `token` 등

감지된 파일 경로와 라인 번호를 사용자에게 알려주세요. 의도된 코드일 수 있으므로 직접 제거하지 마세요.
85 changes: 85 additions & 0 deletions .claude/hooks/notify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash
# Claude Code task completion notification
# Enhanced version with prompt preview from history

set -euo pipefail

# Read stdin JSON input
INPUT=$(cat)

# Configuration
NOTIFY_SOUND="${CLAUDE_NOTIFY_SOUND:-Glass}"
NOTIFY_TITLE="${CLAUDE_NOTIFY_TITLE:-Claude Code}"
HISTORY_FILE="${HOME}/.claude/history.jsonl"
PROMPT_LENGTH=30

# Extract session_id from hook input
SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // empty' 2>/dev/null)

# Get last prompt for this session from history.jsonl
get_prompt_preview() {
if [[ -z "$SESSION_ID" ]] || [[ ! -f "$HISTORY_FILE" ]]; then
echo ""
return
fi

# Find the last entry for this session and get display field
local prompt
prompt=$(grep "\"sessionId\":\"$SESSION_ID\"" "$HISTORY_FILE" 2>/dev/null | tail -1 | jq -r '.display // empty' 2>/dev/null)
Comment thread
kimchanhyung98 marked this conversation as resolved.
Comment thread
kimchanhyung98 marked this conversation as resolved.
Comment thread
kimchanhyung98 marked this conversation as resolved.

if [[ -n "$prompt" ]]; then
# Remove newlines and truncate
local cleaned
cleaned=$(echo "$prompt" | tr '\n' ' ' | sed 's/ */ /g')
if [[ ${#cleaned} -gt $PROMPT_LENGTH ]]; then
echo "${cleaned:0:$PROMPT_LENGTH}..."
else
echo "$cleaned"
fi
else
echo ""
fi
}

# Determine status based on stop reason
get_status() {
local reason
reason=$(echo "$INPUT" | jq -r '.stop_reason // empty' 2>/dev/null)
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated

case "$reason" in
end_turn) echo "✓" ;;
max_tokens) echo "⚠" ;;
stop_sequence) echo "■" ;;
tool_use) echo "⚙" ;;
*) echo "●" ;;
esac
}

# Get sound based on context
get_sound() {
local reason
reason=$(echo "$INPUT" | jq -r '.stop_reason // empty' 2>/dev/null)

case "$reason" in
end_turn) echo "Glass" ;;
max_tokens) echo "Basso" ;;
*) echo "$NOTIFY_SOUND" ;;
esac
}

# Main
STATUS=$(get_status)
PROMPT=$(get_prompt_preview)
SOUND=$(get_sound)

# Build message
if [[ -n "$PROMPT" ]]; then
MESSAGE="${STATUS} ${PROMPT}"
else
MESSAGE="${STATUS} Task completed"
fi

# Send notification
osascript -e "display notification \"${MESSAGE}\" with title \"${NOTIFY_TITLE}\" sound name \"${SOUND}\""
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated
Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated

Comment thread
kimchanhyung98 marked this conversation as resolved.
Outdated
exit 0
4 changes: 2 additions & 2 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification \"Task completed\" with title \"Claude Code\" sound name \"Glass\"'"
"command": ".claude/hooks/notify.sh"
}
]
}
Expand Down Expand Up @@ -53,7 +53,7 @@
"gitlab@claude-plugins-official": false,
"gopls-lsp@claude-plugins-official": false,
"greptile@claude-plugins-official": false,
"hookify@claude-plugins-official": false,
"hookify@claude-plugins-official": true,
"huggingface-skills@claude-plugins-official": false,
"jdtls-lsp@claude-plugins-official": false,
"kotlin-lsp@claude-plugins-official": false,
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ Icon?
.windsurf/*

# Claude
.claude/*.local.*
.claude/memory
.claude/settings.local.json

# GitHub
.github/agents/*
Expand Down