stack-quarkus
Skill0 starsChanged 5 months agoApache-2.0View on GitHub
Quarkus framework patterns for agents working in projects whose docs/TECH_STACK.md lists quarkus. Layers on top of stack-java. Load when implementing, testing, or reviewing Quarkus code.
In this repository17 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- flow-adoptionSkill
- flow-legacy-migrationSkill
- stack-awsSkill
- stack-azureSkill
- stack-design-systemSkill
- stack-gcpSkill
- stack-javaSkill
- stack-kafkaSkill
- stack-mongodbSkill
- stack-natsSkill
- stack-nestjsSkill
- stack-nextjs-reactSkill
- stack-nxSkill
- stack-playwrightSkill
- stack-postgresqlSkill
- stack-react-nativeSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 53
Prefer the repository pattern (PanacheRepository<E>) over active-record Panache entities — it keeps persistence in infrastructure/ and out …
- Very specific: line 58
Read docs/ARCHITECTURE.md: a project is imperative (blocking, RESTEasy Reactive with @Blocking or classic) OR reactive (Mutiny Uni/Multi …
- Very specific: line 71
If the project ships a native binary, a feature isn't "done" until it builds and its @QuarkusIntegrationTest passes against the native …
- Very specific: line 110
All rows must pass before commit per .claude/rules/LIVE_VALIDATION.md.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stack: Quarkus
Layers on .claude/skills/stack-java/SKILL.md — the JVM language/build/test core. This overlay covers the framework: CDI, Jakarta REST, persistence, config, messaging, and the build-time/native-image constraints that make Quarkus different from a reflection-heavy runtime. Read the host's docs/ARCHITECTURE.md for the imperative-vs-reactive choice and persistence engine before assuming APIs.
When this applies
Detection markers (any of):
docs/TECH_STACK.md## Detected stackslistsquarkus- Dependencies:
io.quarkus:quarkus-*inpom.xml/build.gradle*, thequarkus-maven-plugin/io.quarkusGradle plugin - Config:
src/main/resources/application.properties/application.yamlwithquarkus.*keys; profile-prefixed keys (%dev.,%test.,%prod.) - Code:
@QuarkusMain,@Pathresources,@QuarkusTesttests,@ConfigMappinginterfaces
Implementation patterns
These are the patterns this stack commonly uses for a hexagonal Quarkus service. Where the host's docs/ARCHITECTURE.md declares different conventions, the host docs win.
Hexagonal mapping onto CDI
src/main/java/<base>/<context>/
├── domain/ # records, sealed types, rules — PURE, ZERO Quarkus/Jakarta annotations
├── application/ # use-case services + PORT interfaces (incl. messaging port) — PURE
├── infrastructure/ # CDI bean adapters: @ApplicationScoped implementing the ports
└── presentation/ # JAX-RS resources, ExceptionMappers, Bean Validation at the edge- The port is a plain Java interface in
application/; the adapter is an@ApplicationScopedbean ininfrastructure/implementing it. CDI resolves the single implementation by type — no string tokens (R-ARCH-01 ports & adapters, R-ARCH-02 layering). - Domain layer carries NO framework annotations — no
@Inject, no@Entity, no Jakarta imports. If you are typingjakarta.*orio.quarkus.*indomain/, the arrow is inverted (R-ARCH-07). - Constructor injection only — final fields, injected via constructor. Field/
@Inject-on-field injection defeats testability and hides the dependency graph. Avoid@Injectin domain entirely.
Presentation — JAX-RS thin, validate at the edge
@Path("/transfers")
public class TransferResource {
private final TransferService service; // constructor-injected
public TransferResource(TransferService service) { this.service = service; }
@POST @Transactional // tx boundary at the use-case entry, NOT in the domain
public Response create(@Valid TransferRequest req) { // Bean Validation runs at the boundary
return Response.status(CREATED).entity(service.transfer(req.toCommand())).build();
}
}- Resources are transport adapters: map DTO→command, call the service, map result→response. No business logic, no I/O orchestration in the resource.
- Bean Validation (
@Valid+ constraints) at the edge only; inside the boundary, types are trusted (mirrors the Zod-at-edges discipline of the Node stacks). All external input validated before it reachesapplication/. - Map domain errors to HTTP with an
ExceptionMapper<DomainException>at the boundary — the domain throws typed unchecked exceptions (per stack-java), the mapper owns the status code. Domain never referencesResponse/status.
Persistence — Quarkus's first-party extension, not a hand-wired driver (R-PAT-03)
- The adapter is built on Quarkus's own persistence extension for the store, never a hand-managed driver/
DataSource: relational → Hibernate ORM with Panache (quarkus-hibernate-orm-panache); MongoDB →quarkus-mongodb-panache; reactive variants (*-reactive) where the project is reactive. These extensions own connection lifecycle, pooling, transaction binding, Dev Services, and build-time wiring — reaching past them to a raw JDBC/driver client re-implements that surface and breaks native-image assumptions. Bare driver only when no Quarkus extension exists for the store, isolated inside the adapter behind the port. - Prefer the repository pattern (
PanacheRepository<E>) over active-record Panache entities — it keeps persistence ininfrastructure/and out of the domain. Panache@Entityclasses live ininfrastructure/; map them to/from pure domain objects at the adapter (R-ARCH-07: translate at the boundary). @Transactionalat the application-service method (the use-case boundary), never on the resource and never spanning user think-time. One transaction per use-case.- Each module owns its tables — no cross-module table writes (R-ARCH-06). Map driver errors to typed domain errors in the adapter (unique violation →
IdempotencyReplay, etc.); domain never inspects SQLState.
Imperative vs reactive
- Read
docs/ARCHITECTURE.md: a project is imperative (blocking, RESTEasy Reactive with@Blockingor classic) OR reactive (MutinyUni/Multiend-to-end). Do not mix per-endpoint without intent. - On the reactive path, never block the event loop — no JDBC, no
.await(), no blocking I/O on an I/O thread; offload with@Blockingor a worker pool. A blocked event-loop thread stalls every in-flight request.
Config — typed, validated, profiled
@ConfigMapping(prefix = "...")interfaces, validated at boot — fail-fast on missing/invalid config. Never rawConfigProvider/@ConfigPropertystring reads scattered in domain code.- Profiles (
%dev,%test,%prod) carry environment differences; secrets come from the platform, never committedapplication.properties.
Messaging & events
- SmallRye Reactive Messaging (
@Incoming/@Outgoing) lives behind the module's messaging port — the channel binding is aninfrastructure/adapter, theapplication/layer depends on the port (R-ARCH-07). - Consumers idempotent without exception (R-ARCH-11); event semantics per R-ARCH-09; use the transactional outbox for publish-after-commit rather than emitting inside the write path.
Native-image & build-time discipline
- Quarkus does its DI/wiring at build time — runtime reflection, dynamic classloading, and build-time-unknown proxies break native compilation. Annotate reflectively-accessed types with
@RegisterForReflection; prefer build-time mechanisms over runtime scanning. - If the project ships a native binary, a feature isn't "done" until it builds and its
@QuarkusIntegrationTestpasses against the native artifact — JVM-mode green is necessary, not sufficient.
Observability
- SmallRye Health (
/q/health,/q/health/ready), Micrometer metrics, OpenTelemetry tracing with correlation/trace IDs propagated across async and messaging boundaries (mind theThreadLocal/MDC propagation caveat in stack-java).
Testing on this stack
@QuarkusTest— boots the real CDI container + a test HTTP endpoint; the integration workhorse. Assert HTTP with RestAssured. This is real wiring, not mocked framework (R-TESTI-01).- Dev Services auto-provision the DB/broker via Testcontainers in
@QuarkusTest— no hand-managed containers for the common case; pin/override via%testconfig when you need determinism. @TestProfileto vary config per test class (feature flags, alternative beans);@QuarkusComponentTestfor a narrow CDI bean in isolation without the full app boot.@QuarkusIntegrationTestruns the suite against the packaged (JVM jar or native) artifact — the only test that proves the native build behaves. Required when the project ships native.- Pure domain logic (records, rules, sealed-result switches) is tested as plain JUnit per stack-java — fast, no
@QuarkusTestboot. Don't pay the container-boot cost for logic that has no framework dependency.
Spec validation checks
Stack-specific checks the spec validators (spec-validate-lead-engineer, on SPEC_<FEATURE>.md §4 API & Domain, §5 Business Rules, §6 Flows) delegate here:
| Check | Severity |
| Domain/application layers free of Quarkus/Jakarta annotations; ports are plain interfaces, adapters are CDI beans (dependencies point inward) | BLOCKER |
| Transaction boundary at the application-service/use-case method, never on the resource or spanning the broker call | BLOCKER |
| External input validated at the JAX-RS edge (Bean Validation); domain errors mapped to HTTP via ExceptionMapper, not thrown raw | BLOCKER |
| Messaging consumers idempotent; channel binding behind a port (R-ARCH-07, R-ARCH-11) | BLOCKER |
Reactive endpoints never block the event loop (@Blocking/worker offload specified for blocking I/O) | BLOCKER |
Typed @ConfigMapping for configuration; no raw config reads in domain | WARNING |
| Native-image constraints honored (reflection registered) if the project ships native | WARNING |
| Idempotency + concurrency behavior specified for write endpoints (who wins on conflict) | WARNING |
Live validation commands
R-VAL-01 matrix (Quarkus backend changes) — exact invocations live in docs/DEV_SETUP.md; obligations (these layer on the stack-java rows, not replace them):
| Check | Typical shape |
| Build + run unit/integration tests (Dev Services up) | ./mvnw verify / ./gradlew test — the load-bearing row |
| Boot in dev mode and hit health/smoke | ./mvnw quarkus:dev + curl /q/health/ready and the feature endpoint per DEV_SETUP |
| Package the runnable artifact | ./mvnw package (-Dquarkus.package.type=... per project) |
| If the project ships native: native integration test | ./mvnw verify -Dnative + @QuarkusIntegrationTest per DEV_SETUP |
All rows must pass before commit per .claude/rules/LIVE_VALIDATION.md. JVM-mode green does not substitute for the native row when the project ships native. Do not weaken validation or @Disabled a test to pass — fix the cause.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

