Add claude-code-spring module: CLAUDE.md, a path-scoped rule, two skills, four hooks run against real hook JSON, project .mcp.json from the claude mcp CLI, and tests that lint the setup on Spring Boot 4.2.0
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b86yyhhudsSLnwNUFY
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
a620d91d0a
commit
3aa20a1dce
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
# PreToolUse hook for the Bash tool. Reads the hook JSON on stdin (needs jq).
|
||||
# Denies a few commands by returning a permissionDecision, which Claude sees as the reason.
|
||||
COMMAND=$(jq -r '.tool_input.command // empty')
|
||||
|
||||
deny() {
|
||||
jq -n --arg reason "$1" '{
|
||||
hookSpecificOutput: {
|
||||
hookEventName: "PreToolUse",
|
||||
permissionDecision: "deny",
|
||||
permissionDecisionReason: $reason
|
||||
}
|
||||
}'
|
||||
exit 0
|
||||
}
|
||||
|
||||
case "$COMMAND" in
|
||||
*"mvn deploy"*|*"mvn release:"*) deny "Publishing artifacts is a human decision. Run mvn verify instead." ;;
|
||||
*"git push --force"*|*"git push -f"*) deny "Force-pushing is blocked in this project." ;;
|
||||
*"rm -rf"*) deny "rm -rf is blocked. Delete specific files instead." ;;
|
||||
*"| sh"*|*"| bash"*) deny "Piping downloaded text into a shell is blocked." ;;
|
||||
esac
|
||||
exit 0
|
||||
Reference in New Issue
Block a user