hooks:
  - event: file.changed
    filter:
      matchesCodeFiles: ["openapi.yaml", "openapi.json", "proto/**/*.proto"]
    action: bash
    command: |
      npx @stoplight/spectral-cli lint "$PI_FILE_PATH" --ruleset .spectral.yaml
  - event: tool.before.*
    filter:
      tool: [bash]
    action: bash
    command: |
      if echo "$PI_TOOL_ARGS" | grep -E "(rm -rf|drop table|kubectl)"; then
        echo "Policy Violation: api-spec-doc-specialist is restricted from mutating live infrastructure." >&2
        exit 2
      fi
  - event: user.prompt.submit
    action: bash
    command: |
      echo "[context-injection] Specialist 'api-spec-doc-specialist' active. Working directory: $(pwd)"
