Files
daniel c98ce4ec6e 🔧 Fix hook JSON structure for Claude Code compatibility
- Update all 14 hooks to use proper Claude Code array/matcher format
- Fix CLI merge logic to handle new hook structure correctly
- Add support for both old and new hook formats during migration
- Remove conflict detection for hooks (Claude Code arrays support multiple entries)
- Ensure hooks follow proper structure:
  {
    "hooks": {
      "EventName": [
        {
          "matcher": "ToolPattern",
          "hooks": [
            {"type": "command", "command": "bash-command"}
          ]
        }
      ]
    }
  }

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 07:52:08 -04:00

16 lines
1.1 KiB
JSON

{
"description": "Advanced dependency analysis and security checking. Monitors for outdated packages, security vulnerabilities, and license compatibility.",
"hooks": {
"PostToolUse": [
{
"matcher": "Edit",
"hooks": [
{
"type": "command",
"command": "if [[ \"$CLAUDE_TOOL_FILE_PATH\" == *package.json || \"$CLAUDE_TOOL_FILE_PATH\" == *requirements.txt || \"$CLAUDE_TOOL_FILE_PATH\" == *Cargo.toml || \"$CLAUDE_TOOL_FILE_PATH\" == *pom.xml || \"$CLAUDE_TOOL_FILE_PATH\" == *Gemfile ]]; then echo \"Dependency file modified: $CLAUDE_TOOL_FILE_PATH\"; if [[ \"$CLAUDE_TOOL_FILE_PATH\" == *package.json ]] && command -v npm >/dev/null 2>&1; then npm audit 2>/dev/null || true; npx npm-check-updates 2>/dev/null || true; elif [[ \"$CLAUDE_TOOL_FILE_PATH\" == *requirements.txt ]] && command -v safety >/dev/null 2>&1; then safety check -r \"$CLAUDE_TOOL_FILE_PATH\" 2>/dev/null || true; elif [[ \"$CLAUDE_TOOL_FILE_PATH\" == *Cargo.toml ]] && command -v cargo >/dev/null 2>&1; then cargo audit 2>/dev/null || true; fi; fi"
}
]
}
]
}
}