java-helidon
Skill này làm gì
Agent này giúp bạn viết mã cho Helidon, một framework Java, theo các thực hành tốt nhất. Nó đảm bảo mã của bạn cập nhật theo phiên bản mới nhất (Helidon 4) và được tổ chức gọn gàng.
Khi nào nên dùng
- ✓Khi bạn bắt đầu một dự án mới với Helidon 4.
- ✓Khi bạn chuyển một dự án cũ sang Helidon 4.
- ✓Khi bạn cần ví dụ mã theo đúng thực hành tốt nhất.
Liên kết skill
https://github.com/github/awesome-copilot/blob/main/skills/java-helidon/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm thế nào để thiết lập dự án Helidon 4 bằng Maven?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent so sánh mã của bạn với các quy tắc mới nhất của Helidon 4, rồi gợi ý cách tổ chức dự án, cấu hình phụ thuộc và viết mã sao cho hoạt động tốt nhất.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Helidon Best Practices
Your goal is to help me write high-quality Helidon applications by following established best practices.
Helidon 3 → 4 API changes
Helidon 4 renamed or resignatured APIs that appear widely in their Helidon 3 form. The left column does not compile on Helidon 4. Check generated code against this table before returning it.
| Do not use (Helidon 3) | Use (Helidon 4) |
|---|---|
io.helidon.common.http.Http.Status |
io.helidon.http.Status |
io.helidon.webserver.Service |
io.helidon.webserver.http.HttpService |
Routing.Rules, update(Routing.Rules) |
HttpRules, routing(HttpRules) |
request.path().param("id") |
request.path().pathParameters().get("id") |
String s = column.as(String.class) |
column.getString() or column.get(String.class) |
dbClient.execute(exec -> ...) returning Single/Multi |
dbClient.execute() returning Optional<DbRow> / Stream<DbRow> |
javax.* |
jakarta.* |
helidon-microprofile-tests-junit5 |
helidon-microprofile-testing-junit5 |
Value.as(Class) in Helidon 4 returns OptionalValue<T>, not T. This is the single
most common Helidon 4 compile error in generated code.
Project Setup & Structure
- Programming Model: Determine whether the project uses Helidon SE or Helidon MP before generating code. Do not mix the two programming models unless explicitly required.
- Java Version: Use Java 21 or later for Helidon 4 applications.
- Build Tool: Use Maven (
pom.xml) or Gradle (build.gradle) for dependency management. - Dependency Management: Use the Helidon BOM or platform to keep Helidon module versions aligned.
- Package Structure: Organize code by feature or domain, such as
com.example.app.orderandcom.example.app.customer, rather than only by technical layer.
Helidon SE
- Explicit Composition: Construct services and dependencies explicitly in the application bootstrap layer.
- Constructor Injection: Pass required dependencies through constructors and declare dependency fields as
private final. - HTTP Services: Group related routes in focused
HttpServiceimplementations. - Business Logic: Keep business logic outside route handlers.
- Virtual Threads: Prefer straightforward blocking code with Helidon 4 virtual-thread-based request handling. Do not introduce reactive complexity without a clear reason. Helidon 4 is not reactive; do not generate
Single,Multi, orCompletionStagechains.
Helidon MP
- Jakarta and MicroProfile: Prefer standard Jakarta EE and Eclipse MicroProfile APIs when available.
- Dependency Injection: Use CDI with constructor injection for required dependencies.
- Bean Scopes: Use CDI scopes such as
@ApplicationScopedand@RequestScopedintentionally. - Normal-Scoped Beans: Add a non-private no-argument constructor to normal-scoped beans that use constructor injection, so the CDI client proxy can be created portably.
- Business Logic: Keep Jakarta REST resource classes thin and delegate business operations to service classes.
- Portability: Prefer portable Jakarta and MicroProfile APIs over Helidon-specific APIs when portability is important.
Configuration
- Externalized Configuration: Store non-secret configuration in
application.yamlorapplication.properties. - Helidon SE Configuration: Use Helidon Config and pass configuration values or typed configuration objects to components.
- Helidon MP Configuration: Use MicroProfile Config for injected application settings.
- Environment Overrides: Use environment variables or deployment-specific configuration sources for environment-dependent values.
- Secrets Management: Never hardcode credentials, API keys, tokens, or private certificates.
Web Layer
…
Câu hỏi thường gặp
Helidon SE và Helidon MP khác nhau thế nào?
Helidon SE (Standard Edition) đơn giản và linh hoạt hơn, còn Helidon MP (MicroProfile) dùng các chuẩn đã được kiểm chứng hơn như CDI và JAX-RS để xây dựng ứng dụng.
Vì sao quan trọng khi dùng API của Helidon 4?
Các API của Helidon 4 đã được cập nhật để hiệu quả và an toàn hơn. Dùng chúng giúp tránh các lỗi thường gặp và đảm bảo tương thích với các phiên bản mới.
“Thực hành tốt nhất” là gì?
Đây là những cách viết mã được khuyến nghị và hiệu quả nhất, giúp chương trình dễ hiểu, dễ bảo trì và ít lỗi hơn.
Chi tiết
Mô tả gốc của tác giả
Get best practices for developing applications with Helidon 4 (SE and MP). Use when working with Helidon SE or Helidon MP, HttpService routing, Helidon DB Client, MicroProfile Config, Helidon Security, or Helidon testing in Java 21+ projects.
repo: github/awesome-copilot
Độ phổ biến
- Sao GitHub
- 40k
- Vị trí xếp hạng
- #7255
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
acquire-codebase-knowledge
40kGiúp agent của bạn hiểu và ghi tài liệu cho một dự án mã nguồn có sẵn. Hữu ích khi đón thành viên mới hoặc nắm tổng quan về kiến trúc.
acreadiness-assess
40kGiúp agent của bạn đánh giá mức độ sẵn sàng cho AI của dự án và tạo báo cáo. Hữu ích để biết dự án đã sẵn sàng dùng công cụ AI đến đâu.
acreadiness-generate-instructions
40kGiúp agent của bạn tạo hướng dẫn cho công cụ AI dựa trên kết quả đánh giá. Hữu ích để cải thiện cách AI làm việc với mã và khắc phục các khoảng trống.
acreadiness-policy
40kGiúp agent của bạn xác định hoặc áp dụng chính sách đánh giá dự án bằng AI. Hữu ích để chuẩn hóa cách đánh giá dự án và đảm bảo tuân thủ.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.