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:
Ankur Mhatre
2026-11-22 02:05:35 +05:30
co-authored by Claude Sonnet 5.5
parent a620d91d0a
commit 3aa20a1dce
40 changed files with 1175 additions and 0 deletions
+23
View File
@@ -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