internal/skills/content/quarkus/SKILL.md
Quarkus framework guardrails, patterns, and best practices for AI-assisted development. Use when working with Quarkus projects, or when the user mentions Quarkus. Provides CDI, RESTEasy, Panache, GraalVM native, and reactive guidelines.
npx skillsauth add ar4mirez/samuel quarkusInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Applies to: Quarkus 3.x, Java 17+, Cloud-Native Microservices, GraalVM Native, Kubernetes
./mvnw quarkus:add-extension rather than editing pom.xml manually./mvnw quarkus:dev for live reload; never restart manually during developmentapplication.properties profile-aware: %dev., %test., %prod. prefixes@ApplicationScoped for stateless services (one instance per app)@RequestScoped only when you need per-request state@Inject fields (constructor preferred for testability)@Dependent scope unless you need a new instance per injection point@Startup for beans that must initialize eagerly at boot@RegisterForReflection only when reflection is required@Produces methods for third-party objectsquarkus-resteasy-reactive), not classic RESTEasyUni<T> or Multi<T> for non-blocking I/O; plain types for blocking is acceptable@Valid on request parameters for Bean Validation@Produces(APPLICATION_JSON) and @Consumes(APPLICATION_JSON)@Path versioning: /api/v1/resource@Operation, @APIResponse) on every endpoint@RolesAllowed, @Authenticated, or @PermitAllextends PanacheEntity): good for simple CRUD entitiesimplements PanacheRepository<T>): good for complex queries, better testabilityUni<T> return types with hibernate-reactive-panache for non-blocking DB accessfindByEmail)@WithTransaction on service methods that write, not on resourcesquarkus.hibernate-orm.database.generation=validate and manage schema via Flyway@PrePersist / @PreUpdate for audit timestampsapplication.properties with profile prefixes: %dev., %test., %prod.@ConfigProperty(name = "key", defaultValue = "fallback")@ConfigMapping interfaces${ENV_VAR:default} placeholder syntaxquarkus.devservices.enabled=trueResourceNotFoundException, DuplicateResourceException@Provider classes implementing ExceptionMapper<T>{ title, status, detail, timestamp }ConstraintViolationException to 400 with per-field error details@RegisterForReflection when unavoidable)./mvnw verify -Pnative@BuildStep extensions for build-time processingquarkus.native.container-build=true to build without local GraalVMmyproject/
├── src/main/java/com/example/
│ ├── resource/ # JAX-RS endpoints (thin controllers)
│ │ ├── UserResource.java
│ │ └── AuthResource.java
│ ├── service/ # Business logic
│ │ └── UserService.java
│ ├── repository/ # Panache repositories (optional if using active record)
│ │ └── UserRepository.java
│ ├── entity/ # JPA entities with Panache
│ │ └── User.java
│ ├── dto/ # Request/response records
│ │ ├── UserRequest.java
│ │ └── UserResponse.java
│ ├── mapper/ # MapStruct mappers (compile-time, CDI-scoped)
│ │ └── UserMapper.java
│ ├── exception/ # Domain exceptions + ExceptionMappers
│ │ ├── ResourceNotFoundException.java
│ │ ├── DuplicateResourceException.java
│ │ └── ExceptionMappers.java
│ └── health/ # MicroProfile Health checks
│ └── DatabaseHealthCheck.java
├── src/main/resources/
│ ├── application.properties # Config with profile prefixes
│ └── db/migration/ # Flyway SQL migrations
│ └── V1__create_users.sql
├── src/main/docker/
│ ├── Dockerfile.jvm
│ └── Dockerfile.native
├── src/test/java/com/example/
│ ├── resource/ # @QuarkusTest integration tests
│ │ └── UserResourceTest.java
│ └── service/ # Unit tests with @InjectMock
│ └── UserServiceTest.java
└── pom.xml
resource/ -- Thin REST endpoints; input validation and response mapping onlyservice/ -- All business logic; transactional boundaries live hererepository/ -- Data access (skip if active record pattern suffices)entity/ -- JPA entities; keep domain logic minimal, push to servicedto/ -- Java records for request/response; use Bean Validation annotationsmapper/ -- MapStruct interfaces with componentModel = "cdi"exception/ -- Domain exceptions and JAX-RS ExceptionMapper providershealth/ -- MicroProfile HealthCheck implementations@ApplicationScoped
public class UserService {
@Inject
UserRepository userRepository;
@Inject
UserMapper userMapper;
@WithTransaction
public Uni<UserResponse> createUser(UserRequest request) {
return userRepository.existsByEmail(request.email())
.flatMap(exists -> {
if (exists) {
return Uni.createFrom().failure(
new DuplicateResourceException("User", "email", request.email()));
}
User user = userMapper.toEntity(request);
return userRepository.persist(user).map(userMapper::toResponse);
});
}
public Uni<UserResponse> getUserById(Long id) {
return userRepository.findById(id)
.onItem().ifNull().failWith(
() -> new ResourceNotFoundException("User", "id", id))
.map(userMapper::toResponse);
}
}
@Path("/api/v1/users")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Tag(name = "Users", description = "User management APIs")
public class UserResource {
@Inject
UserService userService;
@POST
@Operation(summary = "Create a new user")
@APIResponse(responseCode = "201", description = "User created")
public Uni<Response> createUser(@Valid UserRequest request) {
return userService.createUser(request)
.map(user -> Response
.created(URI.create("/api/v1/users/" + user.id()))
.entity(user).build());
}
@GET
@Path("/{id}")
@RolesAllowed({"USER", "ADMIN"})
@SecurityRequirement(name = "jwt")
@Operation(summary = "Get user by ID")
public Uni<UserResponse> getUserById(@PathParam("id") Long id) {
return userService.getUserById(id);
}
}
@Entity
@Table(name = "users")
public class User extends PanacheEntity {
@Column(nullable = false, unique = true)
public String email;
@Column(nullable = false)
public String name;
@Column(name = "created_at", updatable = false)
public LocalDateTime createdAt;
@PrePersist
void onCreate() {
createdAt = LocalDateTime.now();
}
// Panache active record queries
public static Uni<User> findByEmail(String email) {
return find("email", email).firstResult();
}
public static Uni<List<User>> findActive() {
return list("active", true);
}
}
public record UserRequest(
@NotBlank(message = "Email is required")
@Email(message = "Invalid email format")
String email,
@NotBlank(message = "Password is required")
@Size(min = 8, max = 100, message = "Password must be 8-100 characters")
String password,
@NotBlank(message = "Name is required")
@Size(min = 2, max = 100)
String name
) {}
public record UserResponse(
Long id, String email, String name,
String role, boolean active, LocalDateTime createdAt
) {}
@Provider
public class ResourceNotFoundMapper
implements ExceptionMapper<ResourceNotFoundException> {
@Override
public Response toResponse(ResourceNotFoundException e) {
return Response.status(Response.Status.NOT_FOUND)
.entity(Map.of(
"title", "Resource Not Found",
"status", 404,
"detail", e.getMessage(),
"timestamp", Instant.now().toString()))
.build();
}
}
# Application
quarkus.application.name=myproject
quarkus.http.port=8080
# Reactive datasource
quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=${DB_USERNAME:postgres}
quarkus.datasource.password=${DB_PASSWORD:postgres}
quarkus.datasource.reactive.url=vertx-reactive:postgresql://localhost:5432/mydb
# JDBC (for Flyway migrations)
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/mydb
# Hibernate
quarkus.hibernate-orm.database.generation=validate
quarkus.hibernate-orm.log.sql=true
# Flyway
quarkus.flyway.migrate-at-start=true
quarkus.flyway.locations=db/migration
# Dev Services
%dev.quarkus.datasource.devservices.enabled=true
%dev.quarkus.datasource.devservices.image-name=postgres:15-alpine
# Logging
quarkus.log.level=INFO
quarkus.log.category."com.example".level=DEBUG
%prod.quarkus.log.console.json=true
# JWT
mp.jwt.verify.publickey.location=publicKey.pem
mp.jwt.verify.issuer=https://example.com
# OpenAPI / Swagger
quarkus.smallrye-openapi.path=/api-docs
quarkus.swagger-ui.always-include=true
# Health
quarkus.smallrye-health.root-path=/health
@QuarkusTest for integration tests (full CDI + HTTP stack)@InjectMock to mock CDI beans in integration tests@TestSecurity(user = "test", roles = "ADMIN") to bypass auth in tests@QuarkusTestResource with Testcontainers for DB integration tests./mvnw verify -Pnative (runs @NativeImageTest classes)@DisplayName for readable test names describing behavior@QuarkusTest
@DisplayName("UserResource")
class UserResourceTest {
@Test
@DisplayName("POST /api/v1/users - should create user")
void shouldCreateUser() {
given()
.contentType(ContentType.JSON)
.body(new UserRequest("[email protected]", "Password1!", "Test"))
.when()
.post("/api/v1/users")
.then()
.statusCode(201)
.body("id", notNullValue())
.body("email", equalTo("[email protected]"));
}
@Test
@TestSecurity(user = "admin", roles = "ADMIN")
@DisplayName("GET /api/v1/users - admin can list users")
void adminCanListUsers() {
given()
.when()
.get("/api/v1/users")
.then()
.statusCode(200);
}
}
# Create project
mvn io.quarkus.platform:quarkus-maven-plugin:3.6.0:create \
-DprojectGroupId=com.example \
-DprojectArtifactId=myproject \
-Dextensions="resteasy-reactive-jackson,hibernate-reactive-panache,reactive-pg-client"
# Dev mode (live reload + Dev Services)
./mvnw quarkus:dev
# Run tests
./mvnw test
# Build JVM jar
./mvnw package
# Build native binary
./mvnw package -Pnative
# Build native in container (no local GraalVM)
./mvnw package -Pnative -Dquarkus.native.container-build=true
# Verify native (integration tests against native binary)
./mvnw verify -Pnative
# List available extensions
./mvnw quarkus:list-extensions
# Add extension
./mvnw quarkus:add-extension -Dextensions="openapi"
# Build container image
./mvnw package -Dquarkus.container-image.build=true
# Deploy to Kubernetes
./mvnw package -Dquarkus.kubernetes.deploy=true
# Lint / format
./mvnw compile # Runs annotation processors
mvn checkstyle:check # If checkstyle configured
Uni, Multi) for I/O-bound operations@WithTransaction on service methods (not resources)@Liveness, @Readiness, @Wellness)%dev., %test., %prod.)@Blocking annotation if needed)@RegisterForReflection@ConfigProperty or @ConfigMapping)For detailed patterns and examples, see:
development
Zig language guardrails, patterns, and best practices for AI-assisted development. Use when working with Zig files (.zig), build.zig, or when the user mentions Zig. Provides comptime patterns, allocator conventions, C interop guidelines, and testing standards specific to this project's coding standards.
tools
WordPress framework guardrails, patterns, and best practices for AI-assisted development. Use when working with WordPress projects, or when the user mentions WordPress. Provides theme development, plugin architecture, REST API, blocks, and security guidelines.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs. Use when testing web apps, automating browser interactions, or debugging frontend issues.
tools
Suite of tools for creating elaborate, multi-component web applications using modern frontend technologies (React, Tailwind CSS, shadcn/ui). Use for complex projects requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX pages.