Quarkus Application Development

Quarkus Application Development

Guides an AI coding agent in writing Quarkus application code: REST, CDI, Panache persistence, Kafka messaging, OIDC security and observability, using the project's existing setup.

Skill files7 files

references/

SKILL.md44 lines
1
---
2
name: quarkus-application-development
3
description: 'Write Quarkus application code: REST with Quarkus REST, validation, exception mappers, OpenAPI, configuration, CDI (ArC), Hibernate ORM with Panache, Mutiny and virtual threads, Reactive Messaging with Kafka, OIDC security, health, metrics, OpenTelemetry, fault tolerance, REST Client, scheduler and cache. Use when implementing or changing features in an existing Quarkus project.'
4
---
5
6
# Quarkus Application Development
7
8
Scope: application code inside an existing Quarkus project. Project creation is `create-quarkus-project`; Dev Services and tests are `quarkus-dev-services-and-testing`; native and container images are `quarkus-native-and-container`; core JPA mapping and query design can use the optional `java-hibernate-jpa` skill if installed (otherwise see the Hibernate ORM guide, <https://quarkus.io/guides/hibernate-orm>, and the Jakarta Persistence docs).
9
10
## Agent rules
11
12
1. Detect first: read `pom.xml`/`build.gradle` for `quarkus.platform.version`, the Java release, and the extensions already present. Keep the version; use what the project already uses (for example `quarkus-resteasy*` stays if present).
13
2. Add extensions with `quarkus extension add <name>` or `./mvnw quarkus:add-extension -Dextensions=<name>`; never guess artifact ids or versions by hand (the platform BOM manages them). List candidates with `quarkus extension list --installable --search=<text>`.
14
3. Ask the user before adding Kafka, OIDC/Keycloak or any new infrastructure dependency (they start containers in dev/test and change deployment needs).
15
4. Never use the Spring compatibility extensions (`quarkus-spring-*`) unless the project already does.
16
5. Verify with dev mode (`./mvnw quarkus:dev`, then `/q/dev-ui`) and `./mvnw verify`; write a `@QuarkusTest` per feature. Do not claim something works without running it.
17
6. Use `jakarta.*` imports, records for DTOs, thin resources delegating to services.
18
7. Never hard-code secrets or add credentials to `application.properties`; see `references/config-cdi.md`.
19
20
## Quick decisions
21
22
| Need | Use | Details |
23
|---|---|---|
24
| JSON REST API | `quarkus-rest-jackson`, `quarkus-hibernate-validator`, `quarkus-smallrye-openapi` | `references/rest.md` |
25
| Typed config | `@ConfigMapping`; `@ConfigProperty` for single values | `references/config-cdi.md` |
26
| Beans | `@ApplicationScoped` (default), `@Singleton` only for plain stateless holders | `references/config-cdi.md` |
27
| Database | `quarkus-hibernate-orm-panache` + JDBC driver, repository pattern | `references/persistence.md` |
28
| Async / blocking | Imperative by default; `@RunOnVirtualThread` or `Uni` when needed | `references/reactive-messaging.md` |
29
| Messaging | `quarkus-messaging-kafka` (SmallRye Reactive Messaging) | `references/reactive-messaging.md` |
30
| AuthN/AuthZ | `quarkus-oidc`, `@RolesAllowed` | `references/security-oidc.md` |
31
| Ops | `quarkus-smallrye-health`, `quarkus-micrometer-registry-prometheus`, `quarkus-opentelemetry`, `quarkus-smallrye-fault-tolerance` | `references/observability-resilience.md` |
32
| Outbound HTTP, scheduling, caching | `quarkus-rest-client-jackson`, `quarkus-scheduler`, `quarkus-cache` | `references/observability-resilience.md` |
33
34
## Pitfalls that cost time
35
36
- Quarkus resolves CDI at build time: an unused bean may be removed. Beans only looked up programmatically need `@Unremovable`.
37
- Do not read or write public fields of a normal-scoped bean (`@ApplicationScoped`) from another bean or test: you hit the client proxy, not the instance (verified: a counter field read through the proxy returned 0). Use methods.
38
- Do not block on the event loop (`@NonBlocking` methods, `Uni`/`Multi` return types running on I/O threads). Remove any existing `@NonBlocking` from the method (combining it with `@Blocking` or `@RunOnVirtualThread` fails the build), then add `@Blocking` or `@RunOnVirtualThread` (see `references/reactive-messaging.md`).
39
- Changes to build-time properties need a rebuild; run-time properties can be overridden by env vars (`QUARKUS_DATASOURCE_JDBC_URL`).
40
- Do not configure URLs for databases/brokers/Keycloak in `%dev`/`%test`: that disables Dev Services.
41
- `drop-and-create` schema management is for dev/test only; use Flyway or Liquibase for production.
42
43
Verified on Quarkus 3.40.1 and 3.27.6 (Java 21 target, Maven) with a scaffolded app and `mvn verify` (15 tests: REST+validation+mapper, OpenAPI, config mapping, Panache on PostgreSQL Dev Services, Kafka Dev Service round trip, Keycloak Dev Service tokens, health, metrics, fault tolerance, cache, scheduler). Re-check names against the project's version.
44

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 11,967 prompts

More by @OpenSourceBuffGuy

See all
Acid Lime 3D Streetwear Type Poster Style prompt image

Acid Lime 3D Streetwear Type Poster Style

Defines a JSON style for glossy 3D streetwear campaign posters with black block type, acid-lime marker strokes, stickers and fashion props, with fill-in variables.

image-prompt, json-prompt, template, placeholders, 3d-render, fashion, toys, poster, vibrant-colors, studio-lighting, low-angle, sticker, typography, text-rendering, structured-output, style-reference, negative-prompt, for-designers, for-marketers, long-form, advanced

Azure Static Web Apps prompt image

Azure Static Web Apps

Helps an agent create, configure and deploy Azure Static Web Apps with the SWA CLI, including local emulation, Functions APIs and CI/CD.

agent-skill, azure, deployment, github-actions, ci-cd, serverless, command-line, frontend, step-by-step-guide, for-developers, best-practices, authentication, web-development, scaffolding, cloud, api, nodejs

Workflow Automation Specialist prompt image

Workflow Automation Specialist

Finds repetitive tasks to automate, estimates time savings and ROI, and designs no-code workflows with Zapier, Make or native tools within your budget.

system-prompt, expert-advice, workflow-automation, no-code, productivity, zapier, make-com, for-non-coders, for-small-business-owners, beginner-friendly, xml-tags, estimation, planner, guardrails, structured-output, process-improvement, step-by-step-guide, consulting, time-management, office-administration

Reviews

Loading reviews…

Discussion

Loading comments…