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,33 @@
|
||||
# Orders service (Spring Boot 4.2, Java 25, Maven)
|
||||
|
||||
REST service for orders. Package root: `com.ankurm.claudecode.orders`.
|
||||
|
||||
## Commands
|
||||
- Run all tests: `mvn -B -q test`
|
||||
- Run one test class: `mvn -B -q test -Dtest=OrderServiceTest -Dsurefire.failIfNoSpecifiedTests=false`
|
||||
- Start the app: `mvn -B spring-boot:run`
|
||||
- Never run `mvn deploy`, `mvn release:*` or `git push --force`. A hook blocks them.
|
||||
|
||||
## Spring Boot 4 rules (older habits and examples still use the Boot 3 names, so these matter)
|
||||
- Jackson 3: import `tools.jackson.databind.*`. Do not import `com.fasterxml.jackson.databind.*`.
|
||||
- MockMvc tests: `@AutoConfigureMockMvc` lives in `org.springframework.boot.webmvc.test.autoconfigure`.
|
||||
The old `org.springframework.boot.test.autoconfigure.web.servlet` package does not exist in Boot 4.
|
||||
- Web starter is `spring-boot-starter-webmvc`, test starter is `spring-boot-starter-webmvc-test`.
|
||||
- Constructor injection only. No field `@Autowired` in `src/main`.
|
||||
|
||||
## Code conventions
|
||||
- Money is `BigDecimal` with an explicit `RoundingMode`. Never `double`.
|
||||
- DTOs are records. Entities are not returned from controllers.
|
||||
- Errors: throw `IllegalArgumentException` for bad input; the controller maps it to 400.
|
||||
|
||||
## Database
|
||||
- Flyway migrations live in `src/main/resources/db/migration`. An applied migration is immutable:
|
||||
add `V<next>__description.sql`, never edit an existing file. A hook blocks edits to them.
|
||||
- `application-prod.properties` is off limits. Ask the user.
|
||||
|
||||
## Definition of done
|
||||
1. `mvn -B -q test` is green.
|
||||
2. New behaviour has a test in the matching `*Test` class.
|
||||
3. Summarise what changed in three lines or fewer.
|
||||
|
||||
See @README.md for how to run the app and the sample requests.
|
||||
Reference in New Issue
Block a user