[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77MS8ZMYESSHDDRHZHZ0R3T":3,"skill-same:01M77MS8ZMYESSHDDRHZHZ0R3T":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M77MS8ZMYESSHDDRHZHZ0R3T","java-helidon",null,"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.","Reihantt6\u002Fsns-myagent","Reihantt6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F219822095?v=4","01M77KK94PV8B7C2D9XWXNS8DJ","Mohamad Reihan tegar prasetya","01M77KK958QFMTHYXGXFV7KZ79",2,"MIT","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fjava-helidon\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: java-helidon\ndescription: '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.'\n---\n\n# Helidon Best Practices\n\nYour goal is to help me write high-quality Helidon applications by following established best practices.\n\n## Helidon 3 → 4 API changes\n\nHelidon 4 renamed or resignatured APIs that appear widely in their Helidon 3 form.\nThe left column does not compile on Helidon 4. Check generated code against this table\nbefore returning it.\n\n| Do not use (Helidon 3)                                     | Use (Helidon 4)                                                    |\n| ---------------------------------------------------------- | ------------------------------------------------------------------ |\n| `io.helidon.common.http.Http.Status`                       | `io.helidon.http.Status`                                           |\n| `io.helidon.webserver.Service`                             | `io.helidon.webserver.http.HttpService`                            |\n| `Routing.Rules`, `update(Routing.Rules)`                   | `HttpRules`, `routing(HttpRules)`                                  |\n| `request.path().param(\"id\")`                               | `request.path().pathParameters().get(\"id\")`                        |\n| `String s = column.as(String.class)`                       | `column.getString()` or `column.get(String.class)`                 |\n| `dbClient.execute(exec -> ...)` returning `Single`\u002F`Multi` | `dbClient.execute()` returning `Optional\u003CDbRow>` \u002F `Stream\u003CDbRow>` |\n| `javax.*`                                                  | `jakarta.*`                                                        |\n| `helidon-microprofile-tests-junit5`                        | `helidon-microprofile-testing-junit5`                              |\n\n`Value.as(Class)` in Helidon 4 returns `OptionalValue\u003CT>`, not `T`. This is the single\nmost common Helidon 4 compile error in generated code.\n\n## Project Setup & Structure\n\n- **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.\n- **Java Version:** Use Java 21 or later for Helidon 4 applications.\n- **Build Tool:** Use Maven (`pom.xml`) or Gradle (`build.gradle`) for dependency management.\n- **Dependency Management:** Use the Helidon BOM or platform to keep Helidon module versions aligned.\n- **Package Structure:** Organize code by feature or domain, such as `com.example.app.order` and `com.example.app.customer`, rather than only by technical layer.\n\n## Helidon SE\n\n- **Explicit Composition:** Construct services and dependencies explicitly in the application bootstrap layer.\n- **Constructor Injection:** Pass required dependencies through constructors and declare dependency fields as `private final`.\n- **HTTP Services:** Group related routes in focused `HttpService` implementations.\n- **Business Logic:** Keep business logic outside route handlers.\n- **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`, or `CompletionStage` chains.\n\n## Helidon MP\n\n- **Jakarta and MicroProfile:** Prefer standard Jakarta EE and Eclipse MicroProfile APIs when available.\n- **Dependency Injection:** Use CDI with constructor injection for required dependencies.\n- **Bean Scopes:** Use CDI scopes such as `@ApplicationScoped` and `@RequestScoped` intentionally.\n- **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.\n- **Business Logic:** Keep Jakarta REST resource classes thin and delegate business operations to service classes.\n- **Portability:** Prefer portable Jakarta and MicroProfile APIs over Helidon-specific APIs when portability is important.\n\n## Configuration\n\n- **Externalized Configuration:** Store non-secret configuration in `application.yaml` or `application.properties`.\n- **Helidon SE Configuration:** Use Helidon Config and pass configuration values or typed configuration objects to components.\n- **Helidon MP Configuration:** Use MicroProfile Config for injected application settings.\n- **Environment Overrides:** Use environment variables or deployment-specific configuration sources for environment-dependent values.\n- **Secrets Management:** Never hardcode credentials, API keys, tokens, or private certificates.\n\n## Web Layer\n\n- **DTOs:** Use dedicated request and response models. Do not expose persistence entities directly through APIs.\n- **Validation:** Validate path parameters, query parameters, headers, and request bodies before invoking business logic.\n- **Status Codes:** Return appropriate HTTP status codes for successful, invalid, unauthorized, forbidden, missing, and failed requests. On `PUT` and `DELETE`, return 404 when the target does not exist rather than succeeding unconditionally.\n- **Error Handling:** Use centralized error handling in Helidon SE and Jakarta REST `ExceptionMapper` implementations in Helidon MP.\n- **Sensitive Information:** Do not expose stack traces, database details, filesystem paths, or internal exception messages to clients.\n\n### Helidon SE Example\n\nUse an `HttpService` to register routes programmatically. Keep request handlers small and delegate business logic to a service.\n\n```java\nimport io.helidon.http.Status;\nimport io.helidon.webserver.http.HttpRules;\nimport io.helidon.webserver.http.HttpService;\nimport io.helidon.webserver.http.ServerRequest;\nimport io.helidon.webserver.http.ServerResponse;\n\npublic final class CustomerHttpService implements HttpService {\n\n    private final CustomerService customerService;\n\n    public CustomerHttpService(CustomerService customerService) {\n        this.customerService = customerService;\n    }\n\n    @Override\n    public void routing(HttpRules rules) {\n        rules.get(\"\u002F{id}\", this::findById);\n    }\n\n    private void findById(ServerRequest request, ServerResponse response) {\n        var id = request.path().pathParameters().get(\"id\");\n\n        customerService.findById(id)\n                .ifPresentOrElse(\n                        response::send,\n                        () -> response.status(Status.NOT_FOUND_404).send()\n                );\n    }\n}\n```\n\nRegister the HTTP service when constructing the server:\n\n```java\nimport io.helidon.webserver.WebServer;\n\nWebServer server = WebServer.builder()\n        .routing(routing -> routing.register(\"\u002Fcustomers\", customerHttpService))\n        .build()\n        .start();\n```\n\n### Helidon MP Example\n\nUse Jakarta REST annotations for endpoints and CDI for dependency injection.\n\n```java\nimport jakarta.enterprise.context.RequestScoped;\nimport jakarta.inject.Inject;\nimport jakarta.ws.rs.GET;\nimport jakarta.ws.rs.Path;\nimport jakarta.ws.rs.PathParam;\nimport jakarta.ws.rs.Produces;\nimport jakarta.ws.rs.core.MediaType;\nimport jakarta.ws.rs.core.Response;\n\n@Path(\"\u002Fcustomers\")\n@RequestScoped\n@Produces(MediaType.APPLICATION_JSON)\npublic class CustomerResource {\n\n    private final CustomerService customerService;\n\n    protected CustomerResource() {\n        this.customerService = null;\n    }\n\n    @Inject\n    public CustomerResource(CustomerService customerService) {\n        this.customerService = customerService;\n    }\n\n    @GET\n    @Path(\"\u002F{id}\")\n    public Response findById(@PathParam(\"id\") String id) {\n        return customerService.findById(id)\n                .map(customer -> Response.ok(customer).build())\n                .orElseGet(() -> Response.status(Response.Status.NOT_FOUND).build());\n    }\n}\n```\n\n## Service Layer\n\n- **Transactions:** Define transaction boundaries around complete business operations.\n- **Entity Mapping:** Map persistence entities to API models at the service boundary so that service method signatures expose only API models. A service returning `Optional\u003CCustomerEntity>` where the caller expects `Optional\u003CCustomer>` is a common generated-code compile error.\n- **Concurrency:** Avoid mutable shared state in application-scoped components unless access is properly coordinated.\n\n### Helidon SE Example\n\nHelidon SE services are normally plain Java classes with explicitly supplied dependencies.\n\n```java\npublic final class CustomerService {\n\n    private final CustomerRepository customerRepository;\n\n    public CustomerService(CustomerRepository customerRepository) {\n        this.customerRepository = customerRepository;\n    }\n\n    public Optional\u003CCustomer> findById(String id) {\n        if (id == null || id.isBlank()) {\n            throw new IllegalArgumentException(\"Customer ID is required\");\n        }\n\n        return customerRepository.findById(id);\n    }\n\n    public Customer create(CreateCustomerRequest request) {\n        if (request.name() == null || request.name().isBlank()) {\n            throw new IllegalArgumentException(\"Customer name is required\");\n        }\n\n        var customer = new Customer(request.id(), request.name().trim());\n\n        customerRepository.save(customer);\n        return customer;\n    }\n}\n```\n\nConstruct the dependency graph explicitly:\n\n```java\nvar repository = new DbCustomerRepository(dbClient);\nvar service = new CustomerService(repository);\nvar httpService = new CustomerHttpService(service);\n```\n\n### Helidon MP Example\n\nUse CDI scopes and constructor injection. Apply transactions at the service layer when a business operation changes persistent state. Map the persistence entity to the API model here, so the service never leaks `CustomerEntity` to callers.\n\n```java\nimport jakarta.enterprise.context.ApplicationScoped;\nimport jakarta.inject.Inject;\nimport jakarta.transaction.Transactional;\n\n@ApplicationScoped\npublic class CustomerService {\n\n    private final JpaCustomerRepository customerRepository;\n\n    protected CustomerService() {\n        this.customerRepository = null;\n    }\n\n    @Inject\n    public CustomerService(JpaCustomerRepository customerRepository) {\n        this.customerRepository = customerRepository;\n    }\n\n    public Optional\u003CCustomer> findById(String id) {\n        if (id == null || id.isBlank()) {\n            throw new IllegalArgumentException(\"Customer ID is required\");\n        }\n\n        return customerRepository.findById(id)\n                .map(Customer::fromEntity);\n    }\n\n    @Transactional\n    public Customer create(CreateCustomerRequest request) {\n        if (request.name() == null || request.name().isBlank()) {\n            throw new IllegalArgumentException(\"Customer name is required\");\n        }\n\n        var entity = new CustomerEntity(request.id(), request.name().trim());\n\n        customerRepository.save(entity);\n        return Customer.fromEntity(entity);\n    }\n}\n```\n\n## Data Layer\n\n- **Database Access:** Use Helidon DB Client, Jakarta Persistence, or another persistence mechanism already established by the project.\n- **Parameterized Queries:** Always use parameter binding or prepared statements. Never concatenate untrusted input into SQL.\n- **Column Accessors:** Read a typed column value with `column(\"name\").getString()` (or `getInt()`, `getLong()`, and so on) or with `column(\"name\").get(String.class)`. `DbColumn.as(String.class)` returns an `OptionalValue\u003CString>` in Helidon 4, not a `String`.\n- **Nullable Columns:** Read nullable columns through `asOptional()` or another optional-aware accessor. Direct `getString()` and similar accessors throw when the column value is null.\n- **Row Mapping:** For whole-row mapping, `DbRow.as(Customer.class)` returns the mapped instance directly, but requires a `DbMapper` registered through a `DbMapperProvider` service-loader entry. Prefer explicit column reads for a small number of simple repositories, and introduce a `DbMapper` when the same row shape is mapped in several places.\n- **Migrations:** Use a database migration tool for schema changes rather than automatic destructive schema updates.\n- **Entity Separation:** Do not expose database entities directly as API contracts.\n\n### Helidon SE Example\n\nUse Helidon DB Client with parameterized statements. Map database rows into application models inside the repository.\n\n```java\nimport io.helidon.dbclient.DbClient;\n\npublic final class DbCustomerRepository implements CustomerRepository {\n\n    private static final String FIND_BY_ID =\n            \"SELECT id, name FROM customers WHERE id = :id\";\n\n    private static final String INSERT =\n            \"INSERT INTO customers (id, name) VALUES (:id, :name)\";\n\n    private final DbClient dbClient;\n\n    public DbCustomerRepository(DbClient dbClient) {\n        this.dbClient = dbClient;\n    }\n\n    @Override\n    public Optional\u003CCustomer> findById(String id) {\n        return dbClient.execute()\n                .createGet(FIND_BY_ID)\n                .addParam(\"id\", id)\n                .execute()\n                .map(row -> new Customer(\n                        row.column(\"id\").getString(),\n                        row.column(\"name\").getString()\n                ));\n    }\n\n    @Override\n    public void save(Customer customer) {\n        dbClient.execute()\n                .createInsert(INSERT)\n                .addParam(\"id\", customer.id())\n                .addParam(\"name\", customer.name())\n                .execute();\n    }\n}\n```\n\nNamed statements can also be stored in configuration instead of embedding SQL in Java:\n\n```yaml\ndb:\n  source: \"jdbc\"\n  connection:\n    url: \"jdbc:postgresql:\u002F\u002Flocalhost:5432\u002Fcustomers\"\n    username: ${DB_USERNAME}\n    password: ${DB_PASSWORD}\n  statements:\n    find-customer-by-id: >\n      SELECT id, name\n      FROM customers\n      WHERE id = :id\n```\n\nReference the named statement by name instead of passing SQL text:\n\n```java\nreturn dbClient.execute()\n        .createNamedGet(\"find-customer-by-id\")\n        .addParam(\"id\", id)\n        .execute()\n        .map(row -> new Customer(\n                row.column(\"id\").getString(),\n                row.column(\"name\").getString()\n        ));\n```\n\n### Helidon MP Example\n\nUse Jakarta Persistence in a CDI-managed repository. Keep transaction boundaries in the service layer. The repository works in entities; the service maps them to API models.\n\n```java\nimport jakarta.enterprise.context.ApplicationScoped;\nimport jakarta.persistence.EntityManager;\nimport jakarta.persistence.PersistenceContext;\n\n@ApplicationScoped\npublic class JpaCustomerRepository {\n\n    @PersistenceContext\n    private EntityManager entityManager;\n\n    public Optional\u003CCustomerEntity> findById(String id) {\n        return Optional.ofNullable(entityManager.find(CustomerEntity.class, id));\n    }\n\n    public void save(CustomerEntity customer) {\n        entityManager.persist(customer);\n    }\n}\n```\n\nDefine the persistence entity separately from the public API model:\n\n```java\nimport jakarta.persistence.Column;\nimport jakarta.persistence.Entity;\nimport jakarta.persistence.Id;\nimport jakarta.persistence.Table;\n\n@Entity\n@Table(name = \"customers\")\npublic class CustomerEntity {\n\n    @Id\n    private String id;\n\n    @Column(nullable = false)\n    private String name;\n\n    protected CustomerEntity() {\n    }\n\n    public CustomerEntity(String id, String name) {\n        this.id = id;\n        this.name = name;\n    }\n\n    public String id() {\n        return id;\n    }\n\n    public String name() {\n        return name;\n    }\n}\n```\n\nThe API model stays free of persistence annotations and owns the mapping:\n\n```java\npublic record Customer(String id, String name) {\n\n    public static Customer fromEntity(CustomerEntity entity) {\n        return new Customer(entity.id(), entity.name());\n    }\n}\n```\n\n## Observability\n\n- **Health:** Use Helidon Health in SE or MicroProfile Health in MP for liveness and readiness checks.\n- **Metrics:** Use Helidon Metrics or MicroProfile Metrics for operational and business measurements.\n- **Tracing:** Propagate tracing context across inbound and outbound service calls.\n- **Cardinality:** Avoid user IDs, request IDs, email addresses, and raw URLs as metric tags.\n\n## Logging\n\n- **Logging API:** Use the logging API and implementation configured by the project.\n- **Sensitive Information:** Never log passwords, access tokens, authorization headers, cookies, or complete sensitive request bodies. Do not place secrets or personal information in metrics or trace attributes either.\n\n## Testing\n\n- **Unit Tests:** Write unit tests for business services using JUnit 5.\n- **Helidon SE Tests:** Use `helidon-webserver-testing-junit5` with `@ServerTest` for full server tests and `@RoutingTest` for routing-only tests. These start the server on a dynamically selected port and inject a `Http1Client` bound to it. Never hardcode a port.\n- **Helidon MP Tests:** Use `helidon-microprofile-testing-junit5` with `@HelidonTest`, which starts the CDI container and server for the test class. Confirm the artifact coordinates against the Helidon version in use, since this module was renamed across 4.x releases.\n- **Testcontainers:** Consider Testcontainers for integration tests using real databases, message brokers, or other infrastructure.\n- **Failure Paths:** Test validation failures, missing resources, external-service failures, and authorization failures.\n\n## Security\n\n- **Helidon Security:** Use Helidon Security or supported Jakarta and MicroProfile security APIs for authentication and authorization.\n- **Authorization:** Enforce permissions at a clear application boundary and deny protected operations by default.\n- **JWT and OIDC:** Validate token signatures, issuers, audiences, and expiration times.\n- **TLS:** Use TLS for production traffic and verify certificates for outbound connections.\n- **CORS:** Configure allowed origins explicitly. Do not combine wildcard origins with credentials.\n- **Secrets:** Store secrets in protected environment configuration or a dedicated secret-management system.\n- **Outbound Requests:** Validate outbound destinations to reduce server-side request forgery risks.\n","# Helidon Best Practices\n\nYour goal is to help me write high-quality Helidon applications by following established best practices.\n\n## Helidon 3 → 4 API changes\n\nHelidon 4 renamed or resignatured APIs that appear widely in their Helidon 3 form.\nThe left column does not compile on Helidon 4. Check generated code against this table\nbefore returning it.\n\n| Do not use (Helidon 3)                                     | Use (Helidon 4)                                                    |\n| ---------------------------------------------------------- | ------------------------------------------------------------------ |\n| `io.helidon.common.http.Http.Status`                       | `io.helidon.http.Status`                                           |\n| `io.helidon.webserver.Service`                             | `io.helidon.webserver.http.HttpService`                            |\n| `Routing.Rules`, `update(Routing.Rules)`                   | `HttpRules`, `routing(HttpRules)`                                  |\n| `request.path().param(\"id\")`                               | `request.path().pathParameters().get(\"id\")`                        |\n| `String s = column.as(String.class)`                       | `column.getString()` or `column.get(String.class)`                 |\n| `dbClient.execute(exec -> ...)` returning `Single`\u002F`Multi` | `dbClient.execute()` returning `Optional\u003CDbRow>` \u002F `Stream\u003CDbRow>` |\n| `javax.*`                                                  | `jakarta.*`                                                        |\n| `helidon-microprofile-tests-junit5`                        | `helidon-microprofile-testing-junit5`                              |\n\n`Value.as(Class)` in Helidon 4 returns `OptionalValue\u003CT>`, not `T`. This is the single\nmost common Helidon 4 compile error in generated code.\n\n## Project Setup & Structure\n\n- **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.\n- **Java Version:** Use Java 21 or later for Helidon 4 applications.\n- **Build Tool:** Use Maven (`pom.xml`) or Gradle (`build.gradle`) for dependency management.\n- **Dependency Management:** Use the Helidon BOM or platform to keep Helidon module versions aligned.\n- **Package Structure:** Organize code by feature or domain, such as `com.example.app.order` and `com.example.app.customer`, rather than only by technical layer.\n\n## Helidon SE\n\n- **Explicit Composition:** Construct services and dependencies explicitly in the application bootstrap layer.\n- **Constructor Injection:** Pass required dependencies through constructors and declare dependency fields as `private final`.\n- **HTTP Services:** Group related routes in focused `HttpService` implementations.\n- **Business Logic:** Keep business logic outside route handlers.\n- **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`, or `CompletionStage` chains.\n\n## Helidon MP\n\n- **Jakarta and MicroProfile:** Prefer standard Jakarta EE and Eclipse MicroProfile APIs when available.\n- **Dependency Injection:** Use CDI with constructor injection for required dependencies.\n- **Bean Scopes:** Use CDI scopes such as `@ApplicationScoped` and `@RequestScoped` intentionally.\n- **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.\n- **Business Logic:** Keep Jakarta REST resource classes thin and delegate business operations to service classes.\n- **Portability:** Prefer portable Jakarta and MicroProfile APIs over Helidon-specific APIs when portability is important.\n\n## Configuration\n\n- **Externalized Configuration:** Store non-secret configuration in `application.yaml` or `application.properties`.\n- **Helidon SE Configuration:** Use Helidon Config and pass configuration values or typed configuration objects to components.\n- **Helidon MP Configuration:** Use MicroProfile Config for injected application settings.\n- **Environment Overrides:** Use environment variables or deployment-specific configuration sources for environment-dependent values.\n- **Secrets Management:** Never hardcode credentials, API keys, tokens, or private certificates.\n\n## Web Layer\n\n- **DTOs:** Use dedicated request and response models. Do not expose persistence entities directly through APIs.\n- **Validation:** Validate path parameters, query parameters, headers, and request bodies before invoking business logic.\n- **Status Codes:** Return appropriate HTTP status codes for successful, invalid, unauthorized, forbidden, missing, and failed requests. On `PUT` and `DELETE`, return 404 when the target does not exist rather than succeeding unconditionally.\n- **Error Handling:** Use centralized error handling in Helidon SE and Jakarta REST `ExceptionMapper` implementations in Helidon MP.\n- **Sensitive Information:** Do not expose stack traces, database details, filesystem paths, or internal exception messages to clients.\n\n### Helidon SE Example\n\nUse an `HttpService` to register routes programmatically. Keep request handlers small and delegate business logic to a service.\n\n```java\nimport io.helidon.http.Status;\nimport io.helidon.webserver.http.HttpRules;\nimport io.helidon.webserver.http.HttpService;\nimport io.helidon.webserver.http.ServerRequest;\nimport io.helidon.webserver.http.ServerResponse;\n\npublic final class CustomerHttpService implements HttpService {\n\n    private final CustomerService customerService;\n\n    public CustomerHttpService(CustomerService customerService) {\n        this.customerService = customerService;\n    }\n\n    @Override\n    public void routing(HttpRules rules) {\n        rules.get(\"\u002F{id}\", this::findById);\n    }\n\n    private void findById(ServerRequest request, ServerResponse response) {\n        var id = request.path().pathParameters().get(\"id\");\n\n        customerService.findById(id)\n                .ifPresentOrElse(\n                        response::send,\n                        () -> response.status(Status.NOT_FOUND_404).send()\n                );\n    }\n}\n```\n\nRegister the HTTP service when constructing the server:\n\n```java\nimport io.helidon.webserver.WebServer;\n\nWebServer server = WebServer.builder()\n        .routing(routing -> routing.register(\"\u002Fcustomers\", customerHttpService))\n        .build()\n        .start();\n```\n\n### Helidon MP Example\n\nUse Jakarta REST annotations for endpoints and CDI for dependency injection.\n\n```java\nimport jakarta.enterprise.context.RequestScoped;\nimport jakarta.inject.Inject;\nimport jakarta.ws.rs.GET;\nimport jakarta.ws.rs.Path;\nimport jakarta.ws.rs.PathParam;\nimport jakarta.ws.rs.Produces;\nimport jakarta.ws.rs.core.MediaType;\nimport jakarta.ws.rs.core.Response;\n\n@Path(\"\u002Fcustomers\")\n@RequestScoped\n@Produces(MediaType.APPLICATION_JSON)\npublic class CustomerResource {\n\n    private final CustomerService customerService;\n\n    protected CustomerResource() {\n        this.customerService = null;\n    }\n\n    @Inject\n    public CustomerResource(CustomerService customerService) {\n        this.customerService = customerService;\n    }\n\n    @GET\n    @Path(\"\u002F{id}\")\n    public Response findById(@PathParam(\"id\") String id) {\n        return customerService.findById(id)\n                .map(customer -> Response.ok(customer).build())\n                .orElseGet(() -> Response.status(Response.Status.NOT_FOUND).build());\n    }\n}\n```\n\n## Service Layer\n\n- **Transactions:** Define transaction boundaries around complete business operations.\n- **Entity Mapping:** Map persistence entities to API models at the service boundary so that service method signatures expose only API models. A service returning `Optional\u003CCustomerEntity>` where the caller expects `Optional\u003CCustomer>` is a common generated-code compile error.\n- **Concurrency:** Avoid mutable shared state in application-scoped components unless access is properly coordinated.\n\n### Helidon SE Example\n\nHelidon SE services are normally plain Java classes with explicitly supplied dependencies.\n\n```java\npublic final class CustomerService {\n\n    private final CustomerRepository customerRepository;\n\n    public CustomerService(CustomerRepository customerRepository) {\n        this.customerRepository = customerRepository;\n    }\n\n    public Optional\u003CCustomer> findById(String id) {\n        if (id == null || id.isBlank()) {\n            throw new IllegalArgumentException(\"Customer ID is required\");\n        }\n\n        return customerRepository.findById(id);\n    }\n\n    public Customer create(CreateCustomerRequest request) {\n        if (request.name() == null || request.name().isBlank()) {\n            throw new IllegalArgumentException(\"Customer name is required\");\n        }\n\n        var customer = new Customer(request.id(), request.name().trim());\n\n        customerRepository.save(customer);\n        return customer;\n    }\n}\n```\n\nConstruct the dependency graph explicitly:\n\n```java\nvar repository = new DbCustomerRepository(dbClient);\nvar service = new CustomerService(repository);\nvar httpService = new CustomerHttpService(service);\n```\n\n### Helidon MP Example\n\nUse CDI scopes and constructor injection. Apply transactions at the service layer when a business operation changes persistent state. Map the persistence entity to the API model here, so the service never leaks `CustomerEntity` to callers.\n\n```java\nimport jakarta.enterprise.context.ApplicationScoped;\nimport jakarta.inject.Inject;\nimport jakarta.transaction.Transactional;\n\n@ApplicationScoped\npublic class CustomerService {\n\n    private final JpaCustomerRepository customerRepository;\n\n    protected CustomerService() {\n        this.customerRepository = null;\n    }\n\n    @Inject\n    public CustomerService(JpaCustomerRepository customerRepository) {\n        this.customerRepository = customerRepository;\n    }\n\n    public Optional\u003CCustomer> findById(String id) {\n        if (id == null || id.isBlank()) {\n            throw new IllegalArgumentException(\"Customer ID is required\");\n        }\n\n        return customerRepository.findById(id)\n                .map(Customer::fromEntity);\n    }\n\n    @Transactional\n    public Customer create(CreateCustomerRequest request) {\n        if (request.name() == null || request.name().isBlank()) {\n            throw new IllegalArgumentException(\"Customer name is required\");\n        }\n\n        var entity = new CustomerEntity(request.id(), request.name().trim());\n\n        customerRepository.save(entity);\n        return Customer.fromEntity(entity);\n    }\n}\n```\n\n## Data Layer\n\n- **Database Access:** Use Helidon DB Client, Jakarta Persistence, or another persistence mechanism already established by the project.\n- **Parameterized Queries:** Always use parameter binding or prepared statements. Never concatenate untrusted input into SQL.\n- **Column Accessors:** Read a typed column value with `column(\"name\").getString()` (or `getInt()`, `getLong()`, and so on) or with `column(\"name\").get(String.class)`. `DbColumn.as(String.class)` returns an `OptionalValue\u003CString>` in Helidon 4, not a `String`.\n- **Nullable Columns:** Read nullable columns through `asOptional()` or another optional-aware accessor. Direct `getString()` and similar accessors throw when the column value is null.\n- **Row Mapping:** For whole-row mapping, `DbRow.as(Customer.class)` returns the mapped instance directly, but requires a `DbMapper` registered through a `DbMapperProvider` service-loader entry. Prefer explicit column reads for a small number of simple repositories, and introduce a `DbMapper` when the same row shape is mapped in several places.\n- **Migrations:** Use a database migration tool for schema changes rather than automatic destructive schema updates.\n- **Entity Separation:** Do not expose database entities directly as API contracts.\n\n### Helidon SE Example\n\nUse Helidon DB Client with parameterized statements. Map database rows into application models inside the repository.\n\n```java\nimport io.helidon.dbclient.DbClient;\n\npublic final class DbCustomerRepository implements CustomerRepository {\n\n    private static final String FIND_BY_ID =\n            \"SELECT id, name FROM customers WHERE id = :id\";\n\n    private static final String INSERT =\n            \"INSERT INTO customers (id, name) VALUES (:id, :name)\";\n\n    private final DbClient dbClient;\n\n    public DbCustomerRepository(DbClient dbClient) {\n        this.dbClient = dbClient;\n    }\n\n    @Override\n    public Optional\u003CCustomer> findById(String id) {\n        return dbClient.execute()\n                .createGet(FIND_BY_ID)\n                .addParam(\"id\", id)\n                .execute()\n                .map(row -> new Customer(\n                        row.column(\"id\").getString(),\n                        row.column(\"name\").getString()\n                ));\n    }\n\n    @Override\n    public void save(Customer customer) {\n        dbClient.execute()\n                .createInsert(INSERT)\n                .addParam(\"id\", customer.id())\n                .addParam(\"name\", customer.name())\n                .execute();\n    }\n}\n```\n\nNamed statements can also be stored in configuration instead of embedding SQL in Java:\n\n```yaml\ndb:\n  source: \"jdbc\"\n  connection:\n    url: \"jdbc:postgresql:\u002F\u002Flocalhost:5432\u002Fcustomers\"\n    username: ${DB_USERNAME}\n    password: ${DB_PASSWORD}\n  statements:\n    find-customer-by-id: >\n      SELECT id, name\n      FROM customers\n      WHERE id = :id\n```\n\nReference the named statement by name instead of passing SQL text:\n\n```java\nreturn dbClient.execute()\n        .createNamedGet(\"find-customer-by-id\")\n        .addParam(\"id\", id)\n        .execute()\n        .map(row -> new Customer(\n                row.column(\"id\").getString(),\n                row.column(\"name\").getString()\n        ));\n```\n\n### Helidon MP Example\n\nUse Jakarta Persistence in a CDI-managed repository. Keep transaction boundaries in the service layer. The repository works in entities; the service maps them to API models.\n\n```java\nimport jakarta.enterprise.context.ApplicationScoped;\nimport jakarta.persistence.EntityManager;\nimport jakarta.persistence.PersistenceContext;\n\n@ApplicationScoped\npublic class JpaCustomerRepository {\n\n    @PersistenceContext\n    private EntityManager entityManager;\n\n    public Optional\u003CCustomerEntity> findById(String id) {\n        return Optional.ofNullable(entityManager.find(CustomerEntity.class, id));\n    }\n\n    public void save(CustomerEntity customer) {\n        entityManager.persist(customer);\n    }\n}\n```\n\nDefine the persistence entity separately from the public API model:\n\n```java\nimport jakarta.persistence.Column;\nimport jakarta.persistence.Entity;\nimport jakarta.persistence.Id;\nimport jakarta.persistence.Table;\n\n@Entity\n@Table(name = \"customers\")\npublic class CustomerEntity {\n\n    @Id\n    private String id;\n\n    @Column(nullable = false)\n    private String name;\n\n    protected CustomerEntity() {\n    }\n\n    public CustomerEntity(String id, String name) {\n        this.id = id;\n        this.name = name;\n    }\n\n    public String id() {\n        return id;\n    }\n\n    public String name() {\n        return name;\n    }\n}\n```\n\nThe API model stays free of persistence annotations and owns the mapping:\n\n```java\npublic record Customer(String id, String name) {\n\n    public static Customer fromEntity(CustomerEntity entity) {\n        return new Customer(entity.id(), entity.name());\n    }\n}\n```\n\n## Observability\n\n- **Health:** Use Helidon Health in SE or MicroProfile Health in MP for liveness and readiness checks.\n- **Metrics:** Use Helidon Metrics or MicroProfile Metrics for operational and business measurements.\n- **Tracing:** Propagate tracing context across inbound and outbound service calls.\n- **Cardinality:** Avoid user IDs, request IDs, email addresses, and raw URLs as metric tags.\n\n## Logging\n\n- **Logging API:** Use the logging API and implementation configured by the project.\n- **Sensitive Information:** Never log passwords, access tokens, authorization headers, cookies, or complete sensitive request bodies. Do not place secrets or personal information in metrics or trace attributes either.\n\n## Testing\n\n- **Unit Tests:** Write unit tests for business services using JUnit 5.\n- **Helidon SE Tests:** Use `helidon-webserver-testing-junit5` with `@ServerTest` for full server tests and `@RoutingTest` for routing-only tests. These start the server on a dynamically selected port and inject a `Http1Client` bound to it. Never hardcode a port.\n- **Helidon MP Tests:** Use `helidon-microprofile-testing-junit5` with `@HelidonTest`, which starts the CDI container and server for the test class. Confirm the artifact coordinates against the Helidon version in use, since this module was renamed across 4.x releases.\n- **Testcontainers:** Consider Testcontainers for integration tests using real databases, message brokers, or other infrastructure.\n- **Failure Paths:** Test validation failures, missing resources, external-service failures, and authorization failures.\n\n## Security\n\n- **Helidon Security:** Use Helidon Security or supported Jakarta and MicroProfile security APIs for authentication and authorization.\n- **Authorization:** Enforce permissions at a clear application boundary and deny protected operations by default.\n- **JWT and OIDC:** Validate token signatures, issuers, audiences, and expiration times.\n- **TLS:** Use TLS for production traffic and verify certificates for outbound connections.\n- **CORS:** Configure allowed origins explicitly. Do not combine wildcard origins with credentials.\n- **Secrets:** Store secrets in protected environment configuration or a dedicated secret-management system.\n- **Outbound Requests:** Validate outbound destinations to reduce server-side request forgery risks.\n",{"name":5,"description":7},"main","58843b159d7a4050d6b785a98b908cce505c0b92",".agents\u002Fskills\u002Fjava-helidon",0,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent","https:\u002F\u002Fgithub.com\u002FReihantt6","reihsns.web.id","2026-08-19 20:08:18",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Reihantt6\u002Fsns-myagent --skill java-helidon",{"tool":38,"command":39},"bunx","bunx skills add Reihantt6\u002Fsns-myagent --skill java-helidon",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Reihantt6\u002Fsns-myagent --skill java-helidon","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fjava-helidon\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M77XDCYZ407XYMF2T4P6F7VT","youtube-transcript","Extract transcripts from YouTube videos. Use when the user asks for a transcript, subtitles, or captions of a YouTube video and provides a YouTube URL (youtube.com\u002Fwatch?v=, youtu.be\u002F, or similar). Supports output with or without timestamps.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-transcript\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M77XD7PBC98J6MXGJJ2TJ8DX","youtube-thumbnail-design","YouTube thumbnail design with specific dimensions, contrast rules, and mobile preview optimization. Covers safe zones, text placement, face expression psychology, and A\u002FB testing. Use for: YouTube thumbnails, video cover images, click-through optimization. Triggers: youtube thumbnail, thumbnail design, video thumbnail, click through rate, ctr optimization, youtube cover, video cover image, thumbnail maker, thumbnail tips, youtube design, video preview image","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-thumbnail-design\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M77XD2541C8HXJ6RHYZP4NGJ","youtube-short-maker","Make YouTube Shorts that hold attention with Pexo — vertical 9:16, fast-paced, hook in the first 3 seconds. Describe your topic and Pexo writes the script, generates the shots, picks the models, and assembles a finished Short with music and captions. Use for YouTube Shorts: \"youtube short\", \"make a youtube short\", \"shorts video\", \"short-form video\". NOT for long-form or landscape video.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-short-maker\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M77XCXKVSYK7KTZ3PQBVVGFD","xcode-project-setup","Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fxcode-project-setup\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M77XCR1DV8ZQK2NHWKVY4EWX","x402","Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — \"just use it\" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing touches your codebase) or \"build it in\" (install the SDK and write the key + code into your project). Walks through wallet setup, funding, .env, and a ~$1 test run. Use when the user asks about x402, pay-per-use, USDC payments, or wants Browser Use Cloud without an API key. For the free-tier signup (reverse-CAPTCHA → API key), use `browser-use cloud signup` or the `cloud` skill instead.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fx402\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M77XCMD3R3ZBZQQSW6E0793B","x-twitter-scraper","Build GitHub Copilot workflows with Xquik X API SDKs, REST endpoints, hosted Apify Actor runs, MCP tools, TweetClaw OpenClaw plugin installs, signed webhooks, tweet search, user lookup, follower exports, media actions, and agent automation.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fx-twitter-scraper\u002FSKILL.md",[],[]]