backend¶
The Java backend stack: Java, Spring Boot, Gradle. For now it holds the formatting hook and the Gradle permissions fragment; SPEC.md §4.5 lists what follows. The stack itself — versions, build, formatting, tests, CI — is described on its Tech-Stack page, docs/stacks/java-spring.md.
Skills¶
None yet.
Hooks¶
hooks/format-java.sh (plugins/backend/hooks/format-java.sh) keeps Java code formatted with Spotless:
| Event | When | Does |
|---|---|---|
PostToolUse |
after an Edit, Write or MultiEdit of a .java file |
runs ./gradlew spotlessApply |
PreToolUse |
before every git commit run through Bash |
runs ./gradlew spotlessCheck and blocks the commit when the formatting is off |
It never reformats before a commit, because the index is already built. It does nothing in a
repository without ./gradlew or without Spotless in its build files, and it blocks a commit when
no JVM is found, since the check could not run.
Configuration¶
Gradle permissions. A plugin cannot set a repository's permissions, so add these to the
repository's .claude/settings.json yourself. They pre-allow the Gradle tasks the hook and the
gate run, and keep build output out of reads. The snippet is
fragments/gradle-permissions.json (plugins/backend/fragments/gradle-permissions.json); merge its permissions
into the repository's own.
Installation¶
claude plugin install backend@<owner>
The hook needs bash (Git Bash on Windows). The marketplace and how updates reach a machine: docs/setup/marketplace.md.
Limits and gotchas¶
- Only Spotless: the other checks of the stack (linting, architecture rules, tests) run in the repository's own build and CI (java-spring.md).
- The formatting stays the repository's: the hook runs the Spotless configuration in its build files and brings none of its own.