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
@@ -0,0 +1,32 @@
|
||||
# protect-files.sh: PreToolUse on Edit|Write|MultiEdit
|
||||
|
||||
## Edit an ordinary Java file
|
||||
input : {"hook_event_name":"PreToolUse","tool_name":"Edit","tool_input":{"file_path":"<project>/src/main/java/com/ankurm/claudecode/orders/OrderService.java"}}
|
||||
stdout: (empty)
|
||||
stderr: (empty)
|
||||
exit : 0
|
||||
|
||||
## Edit production config
|
||||
input : {"hook_event_name":"PreToolUse","tool_name":"Edit","tool_input":{"file_path":"<project>/src/main/resources/application-prod.properties"}}
|
||||
stdout: (empty)
|
||||
stderr: Blocked: <project>/src/main/resources/application-prod.properties is production configuration. Ask the user to change it.
|
||||
exit : 2
|
||||
|
||||
## Edit an existing migration
|
||||
input : {"hook_event_name":"PreToolUse","tool_name":"Edit","tool_input":{"file_path":"<project>/src/main/resources/db/migration/V1__create_orders.sql"}}
|
||||
stdout: (empty)
|
||||
stderr: Blocked: <project>/src/main/resources/db/migration/V1__create_orders.sql is an existing Flyway migration. Add a new V<next>__*.sql file instead.
|
||||
exit : 2
|
||||
|
||||
## Write over an existing migration
|
||||
input : {"hook_event_name":"PreToolUse","tool_name":"Write","tool_input":{"file_path":"<project>/src/main/resources/db/migration/V1__create_orders.sql"}}
|
||||
stdout: (empty)
|
||||
stderr: Blocked: <project>/src/main/resources/db/migration/V1__create_orders.sql is an existing Flyway migration. Add a new V<next>__*.sql file instead.
|
||||
exit : 2
|
||||
|
||||
## Write a new migration
|
||||
input : {"hook_event_name":"PreToolUse","tool_name":"Write","tool_input":{"file_path":"<project>/src/main/resources/db/migration/V2__add_status.sql"}}
|
||||
stdout: (empty)
|
||||
stderr: (empty)
|
||||
exit : 0
|
||||
|
||||
Reference in New Issue
Block a user