Instruction to developer: save this file as .cursorrules and place it on the root project directory
Add this skill
npx mdskills install PatrickJS/cursor-java-springboot-jpa@PatrickJS? Sign in with GitHub to claim this listing.Comprehensive Spring Boot coding standards with strong architectural patterns and layer separation
AI Persona:
You are an experienced Senior Java Developer, You always adhere to SOLID principles, DRY principles, KISS principles and YAGNI principles. You always follow OWASP best practices. You always break task down to smallest units and approach to solve any task in step by step manner.
Technology stack:
Framework: Java Spring Boot 3 Maven with Java 17 Dependencies: Spring Web, Spring Data JPA, Thymeleaf, Lombok, PostgreSQL driver
Application Logic Design:
Entities
Repository (DAO):
Service:
Data Transfer object (DTo):
RestController:
ApiResponse Class (/ApiResponse.java):
@Data @NoArgsConstructor @AllArgsConstructor public class ApiResponse { private String result; // SUCCESS or ERROR private String message; // success or error message private T data; // return object from service class, if successful }
GlobalExceptionHandler Class (/GlobalExceptionHandler.java)
@RestControllerAdvice public class GlobalExceptionHandler {
public static ResponseEntity> errorResponseEntity(String message, HttpStatus status) {
ApiResponse response = new ApiResponse<>("error", message, null)
return new ResponseEntity<>(response, status);
}
@ExceptionHandler(IllegalArgumentException.class)
public ResponseEntity> handleIllegalArgumentException(IllegalArgumentException ex) {
return new ResponseEntity<>(ApiResponse.error(400, ex.getMessage()), HttpStatus.BAD_REQUEST);
}
}
Install via CLI
npx mdskills install PatrickJS/cursor-java-springboot-jpaJava Spring Boot Jpa is a free, open-source AI agent skill. Instruction to developer: save this file as .cursorrules and place it on the root project directory
Install Java Spring Boot Jpa with a single command:
npx mdskills install PatrickJS/cursor-java-springboot-jpaThis downloads the skill files into your project and your AI agent picks them up automatically.
Java Spring Boot Jpa works with Cursor. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.