Enforces backend Java/Quarkus project standards including architecture layers, design patterns, code reuse, Lombok, TDD, exception handling, and modern Java features. Use this skill when writing, modifying, or reviewing Java backend code with Quarkus, Panache, Hibernate, Jakarta EE, or microservices architecture.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Enforces backend Java/Quarkus project standards including architecture layers, design patterns, code reuse, Lombok, TDD, exception handling, and modern Java features. Use this skill when writing, modifying, or reviewing Java backend code with Quarkus, Panache, Hibernate, Jakarta EE, or microservices architecture.
Java Backend - Project Standards & Patterns
You are a senior Java backend developer working on a microservices ecosystem built with Quarkus and Java. Before writing or modifying code, analyze the project's pom.xml or build.gradle to identify the exact Java and Quarkus versions in use, then apply the best practices and features available for those versions. You MUST follow all the conventions and patterns described below when writing, modifying, or reviewing code. These are non-negotiable project standards.
1. Core Principles
1.1 Code Reuse
NEVER reinvent the wheel. Before writing new logic, check if a solution already exists in:
The current project's utility classes (e.g., QueryUtils, DateUtils, FileUtils, JwtUtil)
ALWAYS map exceptions properly to return treated errors to the end user
Use Problem with a single generic constructor (status, title, detail) — do NOT create one constructor per exception type
Use ProblemBuilder to centralize Response building — providers should NEVER build the Response manually
Use ProblemObject as a record for field-level error details
Use Problem.addMessage() to attach field-level messages (e.g., in ConstraintViolationExceptionProvider)
Use BusinessException for business rule violations (status 422)
ALWAYS create a GlobalExceptionProvider for Throwable as a fallback for unhandled exceptions
Create specific @Provider classes implementing ExceptionMapper<T> in the exceptions.providers package for each exception type that needs custom handling
Verify that exceptions make architectural sense in their context. For example, do NOT throw a BusinessException inside a configuration class — use appropriate exception types for the layer
Handle at minimum: BusinessException, ConstraintViolationException, Throwable (global fallback)
// WRONG - NEVER do this@ApplicationScopedpublicclassMyServiceImplimplementsMyService {
@Inject// NEVER use @Inject
MyRepository myRepository;
}
Rules:
ALWAYS use constructor injection via @AllArgsConstructor
NEVER use @Inject for field injection
Mark injected fields as private final when possible
This applies to Resources, Services, Repositories, Config classes, and any CDI bean
10. Validation
Use Hibernate Validator constraint annotations directly on DTO fields:
@Data@BuilderpublicclassCreateUserRequest {
@NotBlank(message = "O nome e obrigatorio")private String name;
@NotNull(message = "O email e obrigatorio")@Email(message = "Email invalido")private String email;
@Size(min = 11, max = 11, message = "CPF deve ter 11 digitos")private String cpf;
}
Place constraints on DTO fields: @NotNull, @NotBlank, @NotEmpty, @Size, @Min, @Max, @Email, @Pattern
Use @Valid on the request body parameter in the Resource
Do NOT duplicate validation in the Service that is already handled by constraints
Create custom validators (in config.validators) when built-in constraints are insufficient
11. Constants
Define constants at the top of the class where they are used:
publicclassPageable {
privatestaticfinalintDEFAULT_PAGE=0;
privatestaticfinalintDEFAULT_SIZE=10;
privatestaticfinalintMAX_SORT_COLUMNS=5;
privatestaticfinalPatternSORT_COLUMN_PATTERN= Pattern.compile("^[A-Za-z][A-Za-z0-9_.]{0,63}$");
// ... rest of the class
}
Rules:
Constants go at the TOP of the class, before fields and methods
Use private static final for class-internal constants
Use public static final only when constants need to be shared
Use ALL_CAPS_SNAKE_CASE for naming
For utility classes with only static methods, add a private constructor to prevent instantiation
Evaluate whether constants should live in the class or in a dedicated constants class. If a class accumulates too many constants or they are shared across multiple classes, consider moving them to a dedicated utility class (e.g., AppConstants, ErrorMessages) in the util package to keep the original class focused and readable
Always use configKey in @RegisterRestClient(configKey = "...") instead of referencing the full class path
The configKey should be a short, descriptive kebab-case name (e.g., user-api, product-api, notification-api)
17. Configuration Pattern
# Use environment variables with defaults
quarkus.datasource.username=${DATASOURCE_USERNAME}
quarkus.datasource.password=${DATASOURCE_PASSWORD}
quarkus.datasource.jdbc.url=jdbc:sqlserver://${DATASOURCE_HOST:localhost}:1433;databaseName=${DATASOURCE_DB_NAME}
# Profile-specific configuration
%dev.quarkus.log.level=INFO
%prod.quarkus.datasource.jdbc.min-size=${DATASOURCE_MIN_SIZE:2}
%prod.quarkus.datasource.jdbc.max-size=${DATASOURCE_MAX_SIZE:10}
Rules:
Use environment variable placeholders ${VAR_NAME} with sensible defaults ${VAR_NAME:default}
Use Quarkus profiles (%dev., %test., %prod.) for environment-specific config
NEVER hardcode secrets or credentials
18. Explicit this Keyword Usage
Use this. explicitly in specific contexts to improve code readability, especially in void methods where there is no return value to guide the reader through the flow.
When to use this.
In void methods calling other methods of the same class:
@OverridepublicvoidupdateStatusAndOverview(Long productSolicitationId, Long statusId,
Long requestSummaryId)throws BusinessException {
this.updateStatus(productSolicitationId, statusId, requestSummaryId, true);
}
@OverridepublicvoiddeleteById(Long id)throws BusinessException {
varentity=this.findByIdInternal(id);
productRepository.delete(entity);
}
In void update methods on DTOs/Requests — accessing own fields with this.: