{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "jq -r '.tool_input.file_path // .tool_response.filePath' | { read -r f; if echo \"$f\" | grep -q '\\.scad$'; then cd /home/zenith/canfly && FAILS=$(openscad -o /dev/null -D 'RENDER_MODE=\"check_fit\"' openscad/canfly_drone.scad 2>&1 | grep -E 'FAIL|MISMATCH'); if [ -n \"$FAILS\" ]; then echo \"{\\\"systemMessage\\\":\\\"ASSEMBLY FIT CHECK FAILURES:\\n$FAILS\\\",\\\"hookSpecificOutput\\\":{\\\"hookEventName\\\":\\\"PostToolUse\\\",\\\"additionalContext\\\":\\\"WARNING: The .scad change broke assembly fit. Fix before continuing:\\n$FAILS\\\"}}\"; fi; fi; }",
            "timeout": 15,
            "statusMessage": "Checking assembly fit..."
          }
        ]
      }
    ]
  }
}
