{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hook-guard-secrets",
  "title": "Secrets Guard",
  "description": "Block edits to .env files and credential files.",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/default/blocks/hooks/guard-secrets/scripts/guard-secrets.sh",
      "content": "#!/usr/bin/env bash\nINPUT=$(cat)\nFILE_PATH=$(echo \"$INPUT\" | python3 -c \"import sys,json; print(json.load(sys.stdin).get('tool_input',{}).get('file_path',''))\" 2>/dev/null)\nBASENAME=$(basename \"$FILE_PATH\")\n\nBLOCKED_PATTERNS=('.env' '.env.local' '.env.production' 'credentials.json' 'service-account.json' 'id_rsa' 'id_ed25519' '.pem')\n\nfor pattern in \"${BLOCKED_PATTERNS[@]}\"; do\n  if [[ \"$BASENAME\" == \"$pattern\" || \"$BASENAME\" == \"${pattern}\"* ]]; then\n    echo \"Blocked: editing sensitive file $BASENAME\" >&2\n    exit 2\n  fi\ndone\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "hooks",
    "safety"
  ],
  "type": "registry:ui"
}