a-pavithraa/springboot-skills-marketplace / plugins/springboot-architecture/skills/creating-springboot-projects
creating-springboot-projects
VerifiedUse when starting a new Spring Boot project or service: scaffolding or bootstrapping a backend, REST API, microservice or modular monolith; choosing how to structure it (layered, package-by-module, modular monolith, tomato, DDD-hexagonal); selecting Spring Boot 4 features; generating the base project with progen or Spring Initializr; or applying the bundled templates and references in this skill. Not for migrating existing projects or for isolated JPA/repository work without broader project-creation context.
assets/exception-handler.java
View on GitHubpackage {{PACKAGE}}.config;
import {{PACKAGE}}.shared.DomainException;
import {{PACKAGE}}.shared.ResourceNotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.*;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
import java.util.List;
/**
* Global Exception Handler with ProblemDetail (RFC 7807).
*/
@RestControllerAdvice
class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
private static final Logger LOG = LoggerFactory.getLogger(GlobalExceptionHandler.class);
@Override
protected ResponseEntity<Object> handleMethodArgumentNotValid(
MethodArgumentNotValidException ex,
HttpHeaders headers,
HttpStatusCode status,
WebRequest request) {
LOG.error("Validation error", ex);
var errors = ex.getAllErrors().stream()
.map(e -> e.getDefaultMessage())
.toList();
ProblemDetail problemDetail = ProblemDetail
.forStatusAndDetail(HttpStatus.BAD_REQUEST, "Validation failed");
problemDetail.setTitle("Validation Error");
problemDetail.setProperty("errors", errors);
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(problemDetail);
}
@ExceptionHandler(DomainException.class)
public ProblemDetail handleDomainException(DomainException e) {
LOG.info("Domain exception: {}", e.getMessage());
ProblemDetail problemDetail = ProblemDetail
.forStatusAndDetail(HttpStatus.UNPROCESSABLE_ENTITY, e.getMessage());
problemDetail.setTitle("Bad Request");
problemDetail.setProperty("errors", List.of(e.getMessage()));
return problemDetail;
}
@ExceptionHandler(ResourceNotFoundException.class)
public ProblemDetail handleNotFound(ResourceNotFoundException e) {
LOG.info("Resource not found: {}", e.getMessage());
ProblemDetail problemDetail = ProblemDetail
.forStatusAndDetail(HttpStatus.NOT_FOUND, e.getMessage());
problemDetail.setTitle("Resource Not Found");
return problemDetail;
}
@ExceptionHandler(Exception.class)
public ProblemDetail handleUnexpected(Exception e) {
LOG.error("Unexpected exception", e);
ProblemDetail problemDetail = ProblemDetail
.forStatusAndDetail(HttpStatus.INTERNAL_SERVER_ERROR, "An unexpected error occurred");
return problemDetail;
}
}
// ============================================================
// SHARED EXCEPTIONS
// ============================================================
// package {{PACKAGE}}.shared;
//
// public class DomainException extends RuntimeException {
// public DomainException(String message) {
// super(message);
// }
// }
// package {{PACKAGE}}.shared;
//
// public class ResourceNotFoundException extends RuntimeException {
// public ResourceNotFoundException(String message) {
// super(message);
// }
// }
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |