npx claudepluginhub jwplatta/prompt-library --plugin rubyistDefined 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"
}
]
}"PreToolUse hook runs pre-commit-reminder.sh before git commit/push bash commands. PostToolUse on Write/Edit executes quality-gate.sh and draft-status.sh bash scripts, touching files."