{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup|resume|clear|compact|new",
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; if [ -z \"$root\" ]; then root=\"$(git rev-parse --show-toplevel 2>/dev/null || pwd)\"; fi; if [ -x \"$root/skills/meta/agent-sops/scripts/sop-summaries.sh\" ]; then \"$root/skills/meta/agent-sops/scripts/sop-summaries.sh\"; else printf \"%s\\n\" \"Agent SOPs is available. Use agent-sops list/create/see when the user asks for SOPs.\"; fi'",
            "timeout": 10,
            "statusMessage": "Loading CSL SOP routing"
          },
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; exec node \"$root/skills/meta/agent-hooks/scripts/agent-hooks.js\" dispatch'",
            "timeout": 65,
            "statusMessage": "Running Agent Hooks session triggers"
          }
        ]
      }
    ],
    "PostCompact": [
      {
        "matcher": "manual|auto",
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; if [ -z \"$root\" ]; then root=\"$(git rev-parse --show-toplevel 2>/dev/null || pwd)\"; fi; if [ -x \"$root/skills/meta/agent-sops/scripts/sop-summaries.sh\" ]; then \"$root/skills/meta/agent-sops/scripts/sop-summaries.sh\"; else printf \"%s\\n\" \"Agent SOPs is available. Use agent-sops list/create/see when the user asks for SOPs.\"; fi'",
            "timeout": 10,
            "statusMessage": "Reloading CSL SOP routing"
          },
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; exec node \"$root/skills/meta/agent-hooks/scripts/agent-hooks.js\" dispatch'",
            "timeout": 65,
            "statusMessage": "Running Agent Hooks post-compact triggers"
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; if [ -z \"$root\" ]; then root=\"$(git rev-parse --show-toplevel 2>/dev/null || pwd)\"; fi; if [ -x \"$root/skills/meta/agent-sops/scripts/sop-candidates.js\" ]; then \"$root/skills/meta/agent-sops/scripts/sop-candidates.js\"; fi'",
            "timeout": 5,
            "statusMessage": "Checking SOP candidates"
          },
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; exec node \"$root/skills/meta/agent-hooks/scripts/agent-hooks.js\" dispatch'",
            "timeout": 65,
            "statusMessage": "Running Agent Hooks prompt triggers"
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Bash|Edit|Write|apply_patch",
        "hooks": [
          {
            "type": "command",
            "command": "printf '%s\\n' 'If a listed SOP matches this task by when_to_use or name, read the full SOP before this tool call and verify its completion criteria before final.'",
            "timeout": 5,
            "statusMessage": "Checking SOP reminder"
          }
        ]
      },
      {
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; exec node \"$root/skills/meta/agent-hooks/scripts/agent-hooks.js\" dispatch'",
            "timeout": 65,
            "statusMessage": "Running Agent Hooks before-tool triggers"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "mcp__.*figma.*(get_design_context|get_metadata|get_screenshot|get_figjam|get_variable_defs|get_libraries|search_design_system)|mcp__mastergo_magic_mcp.*(getDesignSections|getDsl|getD2c|getMeta|getDesignTexts|getDesignSvgs|extractSvg)",
        "hooks": [
          {
            "type": "command",
            "command": "printf '%s\\n' 'Figma/MasterGo design data was fetched via MCP.' 'Before implementing or summarizing the UI, use the `figma-describe` skill to produce detailed, framework-agnostic UI information.' 'The description should include layer hierarchy, layout, spacing, typography, colors, repeated components, and notable visual states from the fetched design data.' 'Do not skip this step unless the user explicitly asks to bypass `figma-describe` for this turn.'",
            "timeout": 10,
            "statusMessage": "Checking Figma design description requirement"
          }
        ]
      },
      {
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; exec node \"$root/skills/meta/agent-hooks/scripts/agent-hooks.js\" dispatch'",
            "timeout": 65,
            "statusMessage": "Running Agent Hooks after-tool triggers"
          }
        ]
      }
    ],
    "PermissionRequest": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; exec node \"$root/skills/meta/agent-hooks/scripts/agent-hooks.js\" dispatch'",
            "timeout": 65,
            "statusMessage": "Running Agent Hooks permission triggers"
          }
        ]
      }
    ],
    "PreCompact": [
      {
        "matcher": "manual|auto",
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; exec node \"$root/skills/meta/agent-hooks/scripts/agent-hooks.js\" dispatch'",
            "timeout": 65,
            "statusMessage": "Running Agent Hooks pre-compact triggers"
          }
        ]
      }
    ],
    "SubagentStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; exec node \"$root/skills/meta/agent-hooks/scripts/agent-hooks.js\" dispatch'",
            "timeout": 65,
            "statusMessage": "Running Agent Hooks subagent-start triggers"
          }
        ]
      }
    ],
    "SubagentStop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; exec node \"$root/skills/meta/agent-hooks/scripts/agent-hooks.js\" dispatch'",
            "timeout": 65,
            "statusMessage": "Running Agent Hooks subagent-stop triggers"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'root=\"${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}\"; exec node \"$root/skills/meta/agent-hooks/scripts/agent-hooks.js\" dispatch'",
            "timeout": 65,
            "statusMessage": "Running Agent Hooks stop triggers"
          }
        ]
      }
    ]
  }
}
