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
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# PreToolUse hook for Edit|Write|MultiEdit. Exit code 2 blocks the call and sends stderr to Claude.
|
||||
INPUT=$(cat)
|
||||
TOOL=$(echo "$INPUT" | jq -r '.tool_name // empty')
|
||||
FILE=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
|
||||
|
||||
# Production config is never edited by the agent.
|
||||
case "$FILE" in
|
||||
*application-prod.*|*/.env|*/.env.*)
|
||||
echo "Blocked: $FILE is production configuration. Ask the user to change it." >&2
|
||||
exit 2 ;;
|
||||
esac
|
||||
|
||||
# An applied Flyway migration is immutable. Creating a new V<n> file is fine, changing an existing one is not.
|
||||
case "$FILE" in
|
||||
*/db/migration/V*.sql)
|
||||
if [ "$TOOL" != "Write" ] || [ -e "$FILE" ]; then
|
||||
echo "Blocked: $FILE is an existing Flyway migration. Add a new V<next>__*.sql file instead." >&2
|
||||
exit 2
|
||||
fi ;;
|
||||
esac
|
||||
exit 0
|
||||
Reference in New Issue
Block a user