/plugin marketplace add jwplatta/prompt-library/plugin install rubyist@jwplatta-claude-toolsDefined in hooks/hooks.json
{
"PreToolUse": [
{
"hooks": [
{
"type": "command",
"command": "git diff --cached --name-only --diff-filter=ACM | grep '\\.rb$' | xargs -r bundle exec rubocop --force-exclusion",
"description": "Run RuboCop on staged Ruby files before commit"
}
],
"matcher": "Bash",
"pattern": "git commit"
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "echo 'File written: $TOOL_INPUT' | jq -r '.file_path'",
"description": "Suggest tests for newly created Ruby files"
}
],
"matcher": "Write",
"pattern": "**/*.rb",
"excludePattern": "**/*_spec.rb"
},
{
"hooks": [
{
"type": "command",
"command": "echo 'Code smell analysis for: $TOOL_INPUT' | jq -r '.file_path'",
"description": "Log detected code smells after file writes to aid refactoring tracking"
}
],
"matcher": "Write|Edit",
"pattern": "**/*.rb"
}
]
}{
"riskFlags": {
"touchesBash": true,
"matchAllTools": false,
"touchesFileWrites": true
},
"typeStats": {
"command": 3
},
"eventStats": {
"PreToolUse": 1,
"PostToolUse": 2
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 0,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 3
}
}