quarkus-application-development
它能做什么
这个智能体帮助你编写 Quarkus 应用的代码。它可以添加 REST API、数据库访问、安全性以及与其他应用通信等功能,同时保持与现有项目的一致性。
适用场景
- ✓为 Quarkus 项目添加新功能时。
- ✓修改 Quarkus 应用中的现有部分时。
- ✓把新服务或新功能集成到 Quarkus 应用中时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/quarkus-application-development/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“添加一个 REST API 来管理用户,要带有数据校验和自动生成的文档。”
每周 5 个新技能,1 分钟读完。
工作原理
它会分析你的 Quarkus 项目,了解已经在使用哪些技术。然后添加必要的扩展,并按照 Quarkus 最佳实践编写代码。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Quarkus Application Development
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).
Agent rules
- Detect first: read
pom.xml/build.gradleforquarkus.platform.version, the Java release, and the extensions already present. Keep the version; use what the project already uses (for examplequarkus-resteasy*stays if present). - 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 withquarkus extension list --installable --search=<text>. - Ask the user before adding Kafka, OIDC/Keycloak or any new infrastructure dependency (they start containers in dev/test and change deployment needs).
- Never use the Spring compatibility extensions (
quarkus-spring-*) unless the project already does. - Verify with dev mode (
./mvnw quarkus:dev, then/q/dev-ui) and./mvnw verify; write a@QuarkusTestper feature. Do not claim something works without running it. - Use
jakarta.*imports, records for DTOs, thin resources delegating to services. - Never hard-code secrets or add credentials to
application.properties; seereferences/config-cdi.md.
Quick decisions
| Need | Use | Details |
|---|---|---|
| JSON REST API | quarkus-rest-jackson, quarkus-hibernate-validator, quarkus-smallrye-openapi |
references/rest.md |
| Typed config | @ConfigMapping; @ConfigProperty for single values |
references/config-cdi.md |
| Beans | @ApplicationScoped (default), @Singleton only for plain stateless holders |
references/config-cdi.md |
| Database | quarkus-hibernate-orm-panache + JDBC driver, repository pattern |
references/persistence.md |
| Async / blocking | Imperative by default; @RunOnVirtualThread or Uni when needed |
references/reactive-messaging.md |
| Messaging | quarkus-messaging-kafka (SmallRye Reactive Messaging) |
references/reactive-messaging.md |
| AuthN/AuthZ | quarkus-oidc, @RolesAllowed |
references/security-oidc.md |
| Ops | quarkus-smallrye-health, quarkus-micrometer-registry-prometheus, quarkus-opentelemetry, quarkus-smallrye-fault-tolerance |
references/observability-resilience.md |
| Outbound HTTP, scheduling, caching | quarkus-rest-client-jackson, quarkus-scheduler, quarkus-cache |
references/observability-resilience.md |
Pitfalls that cost time
- Quarkus resolves CDI at build time: an unused bean may be removed. Beans only looked up programmatically need
@Unremovable. - 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. - Do not block on the event loop (
@NonBlockingmethods,Uni/Multireturn types running on I/O threads). Remove any existing@NonBlockingfrom the method (combining it with@Blockingor@RunOnVirtualThreadfails the build), then add@Blockingor@RunOnVirtualThread(seereferences/reactive-messaging.md). - Changes to build-time properties need a rebuild; run-time properties can be overridden by env vars (
QUARKUS_DATASOURCE_JDBC_URL). - Do not configure URLs for databases/brokers/Keycloak in
%dev/%test: that disables Dev Services. drop-and-createschema management is for dev/test only; use Flyway or Liquibase for production.
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.
常见问题
什么是 Quarkus 的“扩展”(extensions)?
扩展是为 Quarkus 应用添加特定功能的软件包,比如数据库支持、Web API 或消息传递。
智能体怎么知道该用哪个 Quarkus 版本?
它会检查你项目的配置文件(pom.xml 或 build.gradle),使用项目中已经定义的同一个 Quarkus 版本。
智能体能创建新的 Quarkus 项目吗?
不能,这个智能体是用于处理现有 Quarkus 项目的。要创建新项目,你需要使用其他工具或特定命令。
详情
作者的原始描述
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.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7377
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。