{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "_comment": "devAlice 권장 hooks 베이스라인. 본인 환경에 맞춰 hooks 배열의 command와 matcher 정규식을 수정해서 사용하세요. 'jq' 명령어가 필요합니다 (brew install jq).",

  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/bin/bash -lc 'printf \"[세션 시작] %s\\n메모리 동기화: 최신 (skip)\\n\" \"$(date \"+%Y-%m-%d %H:%M:%S\")\"'"
          }
        ]
      }
    ],

    "UserPromptSubmit": [
      {
        "matcher": "^/(?:ej|euijinpro)\\b",
        "hooks": [
          {
            "type": "command",
            "command": "/bin/bash -lc 'echo \"[ej skill] 프롬프트 euijin.pro 기록 대상\" >&2'"
          }
        ]
      }
    ],

    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "/bin/bash -lc 'cmd=$(jq -r .tool_input.command); case \"$cmd\" in *\"rm -rf /\"*|*\"sudo rm\"*|*\":(){\"*) echo \"위험 명령어 차단: $cmd\" >&2; exit 2;; esac'"
          }
        ]
      },
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "/bin/bash -lc 'path=$(jq -r .tool_input.file_path); case \"$path\" in */.env|*/credentials.json|*/.aws/credentials) echo \"시크릿 파일 수정 차단: $path\" >&2; exit 2;; esac'"
          }
        ]
      }
    ],

    "PostToolUse": [
      {
        "matcher": "Edit|Write|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "/bin/bash -lc 'path=$(jq -r .tool_input.file_path); case \"$path\" in *.ts|*.tsx|*.js|*.jsx) prettier --write \"$path\" 2>/dev/null || true ;; esac'"
          }
        ]
      }
    ],

    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/bin/bash -lc 'printf \"\\n[세션 종료] %s\\n\" \"$(date \"+%Y-%m-%d %H:%M:%S\")\"'"
          }
        ]
      }
    ]
  },

  "permissions": {
    "deny": [
      "Bash(rm -rf /:*)",
      "Bash(sudo rm:*)",
      "Read(.env)",
      "Read(.env.local)",
      "Read(.aws/credentials)",
      "Read(*/credentials.json)"
    ],
    "allow": [
      "Bash(git status:*)",
      "Bash(git log:*)",
      "Bash(git diff:*)",
      "Bash(pnpm:*)",
      "Bash(npm:*)",
      "Bash(node:*)"
    ]
  }
}
