java — Claude Code skill: Spring Boot and enterprise Java
A skill that tells the agent how to write Java: layered structure, Spring Boot 3.x, JUnit and Mockito tests. Useful when a Java codebase needs one consistent style.
npx skills add Mindrally/skills --skill java -a claude-codeWhat java does
The skill is a rule set for the agent when it writes Java. It covers clean code, Java 17+ features, SOLID with high cohesion and low coupling, and naming conventions (PascalCase for classes, camelCase for methods).
Spring Boot 3.x gets its own section: constructor injection instead of field injection, exception handling through @ControllerAdvice and @ExceptionHandler, Spring Data JPA for database work, Spring Security for auth. Code is organised in layers — controller, service, repository — with DTOs and Bean Validation. There is an alternative track too: Quarkus with Dev Mode, GraalVM native builds, CDI annotations and MicroProfile APIs.
Testing means JUnit and Mockito plus integration tests. Performance advice is connection pooling, caching and query profiling. One thing to know: the rules assume Java 17+ and Spring Boot 3.x, so on an older stack the agent will have to skip part of them.
What it helps with
- split code into controller, service and repository layers
- move dependency injection from fields to constructors
- set up global exception handling with
@ControllerAdvice - add Bean Validation to request DTOs
- pick between Spring Boot and Quarkus for a new service
Example prompts for the agent
- add a new REST controller for orders following the java skill
- rewrite this service to use constructor injection
- write an integration test with JUnit and Mockito for the repository
How to install java
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill java -a claude-code2Manually: put the files in place
~/.claude/skills/java/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/java/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill java -a codex2Manually: put the files in place
.agents/skills/java/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill java -a cursor2Manually: put the files in place
.cursor/skills/java/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills java2Manually: put the files in place
.github/skills/java/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill java -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path javaManually: put the files in place
.devin/skills/java/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill java -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about java
How do I install the java skill in Claude?
Run npx skills add Mindrally/skills --skill java -a claude-code. The skill file lands at ~/.claude/skills/java/SKILL.md.
What does the java skill do?
It gives the agent rules for Java work: Spring Boot 3.x, layered structure, DTOs, validation, JUnit and Mockito tests. The agent follows them while writing or editing code.
Do I need Spring Boot to use it?
Most rules target Spring Boot 3.x, but there is a Quarkus section with CDI, MicroProfile and GraalVM builds. A Quarkus project can use the skill as well.
Source text
SKILL.md · Apache-2.0
--- name: java description: Expert in Java development with Spring Boot and enterprise patterns metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Java You are an expert in Java development with deep knowledge of Spring Boot, enterprise patterns, and modern Java features. ## Core Principles - Write clean, efficient, and well-documented Java code - Follow Java 17+ features and best practices - Apply SOLID principles with high cohesion and low coupling - Use proper naming conventions (PascalCase for classes, camelCase for methods) ## Spring Boot - Follow Spring Boot 3.x best practices - Use constructor injection over field injection - Implement proper exception handling via `@ControllerAdvice` and `@ExceptionHandler` - Leverage Spring Data JPA for database operations - Use Spring Security for authentication and authorization ## Code Structure - Organize code in layers (controller, service, repository) - Use DTOs for data transfer - Implement proper validation with Bean Validation - Follow RESTful API design principles ## Quarkus (Alternative) - Utilize Quarkus Dev Mode for faster development cycles - Optimize for GraalVM native builds - Use CDI annotations (@Inject, @Named, @Singleton) - Implement MicroProfile APIs for enterprise applications - Focus on reactive patterns with Vert.x or Mutiny ## Testing - Write unit tests with JUnit - Use Mockito for mocking dependencies - Implement integration tests - Follow test-driven development practices ## Performance - Use connection pooling - Implement caching strategies - Optimize database queries - Profile and monitor applications ## Error Handling - Use proper exception hierarchy - Implement global exception handling - Return meaningful error responses - Log errors appropriately ## Dependencies - Spring Boot, Spring Framework - Maven or Gradle - JUnit, Mockito - Quarkus, Jakarta EE, MicroProfile (alternative stack)
© Mindrally · Apache-2.0 · Mindrally/skills