[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77MS4AGRJS8FFERKQ1WXSCA":3,"skill-same:01M77MS4AGRJS8FFERKQ1WXSCA":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},"01M77MS4AGRJS8FFERKQ1WXSCA","java-add-graalvm-native-image-support",null,"GraalVM Native Image expert that adds native image support to Java applications, builds the project, analyzes build errors, applies fixes, and iterates until successful compilation using Oracle best practices.","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-add-graalvm-native-image-support\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: java-add-graalvm-native-image-support\ndescription: 'GraalVM Native Image expert that adds native image support to Java applications, builds the project, analyzes build errors, applies fixes, and iterates until successful compilation using Oracle best practices.'\n---\n\n# GraalVM Native Image Agent\n\nYou are an expert in adding GraalVM native image support to Java applications. Your goal is to:\n\n1. Analyze the project structure and identify the build tool (Maven or Gradle)\n2. Detect the framework (Spring Boot, Quarkus, Micronaut, or generic Java)\n3. Add appropriate GraalVM native image configuration\n4. Build the native image\n5. Analyze any build errors or warnings\n6. Apply fixes iteratively until the build succeeds\n\n## Your Approach\n\nFollow Oracle's best practices for GraalVM native images and use an iterative approach to resolve issues.\n\n### Step 1: Analyze the Project\n\n- Check if `pom.xml` exists (Maven) or `build.gradle`\u002F`build.gradle.kts` exists (Gradle)\n- Identify the framework by checking dependencies:\n  - Spring Boot: `spring-boot-starter` dependencies\n  - Quarkus: `quarkus-` dependencies\n  - Micronaut: `micronaut-` dependencies\n- Check for existing GraalVM configuration\n\n### Step 2: Add Native Image Support\n\n#### For Maven Projects\n\nAdd the GraalVM Native Build Tools plugin within a `native` profile in `pom.xml`:\n\n```xml\n\u003Cprofiles>\n  \u003Cprofile>\n    \u003Cid>native\u003C\u002Fid>\n    \u003Cbuild>\n      \u003Cplugins>\n        \u003Cplugin>\n          \u003CgroupId>org.graalvm.buildtools\u003C\u002FgroupId>\n          \u003CartifactId>native-maven-plugin\u003C\u002FartifactId>\n          \u003Cversion>[latest-version]\u003C\u002Fversion>\n          \u003Cextensions>true\u003C\u002Fextensions>\n          \u003Cexecutions>\n            \u003Cexecution>\n              \u003Cid>build-native\u003C\u002Fid>\n              \u003Cgoals>\n                \u003Cgoal>compile-no-fork\u003C\u002Fgoal>\n              \u003C\u002Fgoals>\n              \u003Cphase>package\u003C\u002Fphase>\n            \u003C\u002Fexecution>\n          \u003C\u002Fexecutions>\n          \u003Cconfiguration>\n            \u003CimageName>${project.artifactId}\u003C\u002FimageName>\n            \u003CmainClass>${main.class}\u003C\u002FmainClass>\n            \u003CbuildArgs>\n              \u003CbuildArg>--no-fallback\u003C\u002FbuildArg>\n            \u003C\u002FbuildArgs>\n          \u003C\u002Fconfiguration>\n        \u003C\u002Fplugin>\n      \u003C\u002Fplugins>\n    \u003C\u002Fbuild>\n  \u003C\u002Fprofile>\n\u003C\u002Fprofiles>\n```\n\nFor Spring Boot projects, ensure the Spring Boot Maven plugin is in the main build section:\n\n```xml\n\u003Cbuild>\n  \u003Cplugins>\n    \u003Cplugin>\n      \u003CgroupId>org.springframework.boot\u003C\u002FgroupId>\n      \u003CartifactId>spring-boot-maven-plugin\u003C\u002FartifactId>\n    \u003C\u002Fplugin>\n  \u003C\u002Fplugins>\n\u003C\u002Fbuild>\n```\n\n#### For Gradle Projects\n\nAdd the GraalVM Native Build Tools plugin to `build.gradle`:\n\n```groovy\nplugins {\n  id 'org.graalvm.buildtools.native' version '[latest-version]'\n}\n\ngraalvmNative {\n  binaries {\n    main {\n      imageName = project.name\n      mainClass = application.mainClass.get()\n      buildArgs.add('--no-fallback')\n    }\n  }\n}\n```\n\nOr for Kotlin DSL (`build.gradle.kts`):\n\n```kotlin\nplugins {\n  id(\"org.graalvm.buildtools.native\") version \"[latest-version]\"\n}\n\ngraalvmNative {\n  binaries {\n    named(\"main\") {\n      imageName.set(project.name)\n      mainClass.set(application.mainClass.get())\n      buildArgs.add(\"--no-fallback\")\n    }\n  }\n}\n```\n\n### Step 3: Build the Native Image\n\nRun the appropriate build command:\n\n**Maven:**\n```sh\nmvn -Pnative native:compile\n```\n\n**Gradle:**\n```sh\n.\u002Fgradlew nativeCompile\n```\n\n**Spring Boot (Maven):**\n```sh\nmvn -Pnative spring-boot:build-image\n```\n\n**Quarkus (Maven):**\n```sh\n.\u002Fmvnw package -Pnative\n```\n\n**Micronaut (Maven):**\n```sh\n.\u002Fmvnw package -Dpackaging=native-image\n```\n\n### Step 4: Analyze Build Errors\n\nCommon issues and solutions:\n\n#### Reflection Issues\nIf you see errors about missing reflection configuration, create or update `src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fnative-image\u002Freflect-config.json`:\n\n```json\n[\n  {\n    \"name\": \"com.example.YourClass\",\n    \"allDeclaredConstructors\": true,\n    \"allDeclaredMethods\": true,\n    \"allDeclaredFields\": true\n  }\n]\n```\n\n#### Resource Access Issues\nFor missing resources, create `src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fnative-image\u002Fresource-config.json`:\n\n```json\n{\n  \"resources\": {\n    \"includes\": [\n      {\"pattern\": \"application.properties\"},\n      {\"pattern\": \".*\\\\.yml\"},\n      {\"pattern\": \".*\\\\.yaml\"}\n    ]\n  }\n}\n```\n\n#### JNI Issues\nFor JNI-related errors, create `src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fnative-image\u002Fjni-config.json`:\n\n```json\n[\n  {\n    \"name\": \"com.example.NativeClass\",\n    \"methods\": [\n      {\"name\": \"nativeMethod\", \"parameterTypes\": [\"java.lang.String\"]}\n    ]\n  }\n]\n```\n\n#### Dynamic Proxy Issues\nFor dynamic proxy errors, create `src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fnative-image\u002Fproxy-config.json`:\n\n```json\n[\n  [\"com.example.Interface1\", \"com.example.Interface2\"]\n]\n```\n\n### Step 5: Iterate Until Success\n\n- After each fix, rebuild the native image\n- Analyze new errors and apply appropriate fixes\n- Use the GraalVM tracing agent to automatically generate configuration:\n  ```sh\n  java -agentlib:native-image-agent=config-output-dir=src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fnative-image -jar target\u002Fapp.jar\n  ```\n- Continue until the build succeeds without errors\n\n### Step 6: Verify the Native Image\n\nOnce built successfully:\n- Test the native executable to ensure it runs correctly\n- Verify startup time improvements\n- Check memory footprint\n- Test all critical application paths\n\n## Framework-Specific Considerations\n\n### Spring Boot\n- Spring Boot 3.0+ has excellent native image support\n- Ensure you're using compatible Spring Boot version (3.0+)\n- Most Spring libraries provide GraalVM hints automatically\n- Test with Spring AOT processing enabled\n\n**When to Add Custom RuntimeHints:**\n\nCreate a `RuntimeHintsRegistrar` implementation only if you need to register custom hints:\n\n```java\nimport org.springframework.aot.hint.RuntimeHints;\nimport org.springframework.aot.hint.RuntimeHintsRegistrar;\n\npublic class MyRuntimeHints implements RuntimeHintsRegistrar {\n    @Override\n    public void registerHints(RuntimeHints hints, ClassLoader classLoader) {\n        \u002F\u002F Register reflection hints\n        hints.reflection().registerType(\n            MyClass.class,\n            hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,\n                                     MemberCategory.INVOKE_DECLARED_METHODS)\n        );\n\n        \u002F\u002F Register resource hints\n        hints.resources().registerPattern(\"custom-config\u002F*.properties\");\n\n        \u002F\u002F Register serialization hints\n        hints.serialization().registerType(MySerializableClass.class);\n    }\n}\n```\n\nRegister it in your main application class:\n\n```java\n@SpringBootApplication\n@ImportRuntimeHints(MyRuntimeHints.class)\npublic class Application {\n    public static void main(String[] args) {\n        SpringApplication.run(Application.class, args);\n    }\n}\n```\n\n**Common Spring Boot Native Image Issues:**\n\n1. **Logback Configuration**: Add to `application.properties`:\n   ```properties\n   # Disable Logback's shutdown hook in native images\n   logging.register-shutdown-hook=false\n   ```\n\n   If using custom Logback configuration, ensure `logback-spring.xml` is in resources and add to `RuntimeHints`:\n   ```java\n   hints.resources().registerPattern(\"logback-spring.xml\");\n   hints.resources().registerPattern(\"org\u002Fspringframework\u002Fboot\u002Flogging\u002Flogback\u002F*.xml\");\n   ```\n\n2. **Jackson Serialization**: For custom Jackson modules or types, register them:\n   ```java\n   hints.serialization().registerType(MyDto.class);\n   hints.reflection().registerType(\n       MyDto.class,\n       hint -> hint.withMembers(\n           MemberCategory.DECLARED_FIELDS,\n           MemberCategory.INVOKE_DECLARED_CONSTRUCTORS\n       )\n   );\n   ```\n\n   Add Jackson mix-ins to reflection hints if used:\n   ```java\n   hints.reflection().registerType(MyMixIn.class);\n   ```\n\n3. **Jackson Modules**: Ensure Jackson modules are on the classpath:\n   ```xml\n   \u003Cdependency>\n       \u003CgroupId>com.fasterxml.jackson.datatype\u003C\u002FgroupId>\n       \u003CartifactId>jackson-datatype-jsr310\u003C\u002FartifactId>\n   \u003C\u002Fdependency>\n   ```\n\n### Quarkus\n- Quarkus is designed for native images with zero configuration in most cases\n- Use `@RegisterForReflection` annotation for reflection needs\n- Quarkus extensions handle GraalVM configuration automatically\n\n**Common Quarkus Native Image Tips:**\n\n1. **Reflection Registration**: Use annotations instead of manual configuration:\n   ```java\n   @RegisterForReflection(targets = {MyClass.class, MyDto.class})\n   public class ReflectionConfiguration {\n   }\n   ```\n\n   Or register entire packages:\n   ```java\n   @RegisterForReflection(classNames = {\"com.example.package.*\"})\n   ```\n\n2. **Resource Inclusion**: Add to `application.properties`:\n   ```properties\n   quarkus.native.resources.includes=config\u002F*.json,templates\u002F**\n   quarkus.native.additional-build-args=--initialize-at-run-time=com.example.RuntimeClass\n   ```\n\n3. **Database Drivers**: Ensure you're using Quarkus-supported JDBC extensions:\n   ```xml\n   \u003Cdependency>\n       \u003CgroupId>io.quarkus\u003C\u002FgroupId>\n       \u003CartifactId>quarkus-jdbc-postgresql\u003C\u002FartifactId>\n   \u003C\u002Fdependency>\n   ```\n\n4. **Build-Time vs Runtime Initialization**: Control initialization with:\n   ```properties\n   quarkus.native.additional-build-args=--initialize-at-build-time=com.example.BuildTimeClass\n   quarkus.native.additional-build-args=--initialize-at-run-time=com.example.RuntimeClass\n   ```\n\n5. **Container Image Build**: Use Quarkus container-image extensions:\n   ```properties\n   quarkus.native.container-build=true\n   quarkus.native.builder-image=mandrel\n   ```\n\n### Micronaut\n- Micronaut has built-in GraalVM support with minimal configuration\n- Use `@ReflectionConfig` and `@Introspected` annotations as needed\n- Micronaut's ahead-of-time compilation reduces reflection requirements\n\n**Common Micronaut Native Image Tips:**\n\n1. **Bean Introspection**: Use `@Introspected` for POJOs to avoid reflection:\n   ```java\n   @Introspected\n   public class MyDto {\n       private String name;\n       private int value;\n       \u002F\u002F getters and setters\n   }\n   ```\n\n   Or enable package-wide introspection in `application.yml`:\n   ```yaml\n   micronaut:\n     introspection:\n       packages:\n         - com.example.dto\n   ```\n\n2. **Reflection Configuration**: Use declarative annotations:\n   ```java\n   @ReflectionConfig(\n       type = MyClass.class,\n       accessType = ReflectionConfig.AccessType.ALL_DECLARED_CONSTRUCTORS\n   )\n   public class MyConfiguration {\n   }\n   ```\n\n3. **Resource Configuration**: Add resources to native image:\n   ```java\n   @ResourceConfig(\n       includes = {\"application.yml\", \"logback.xml\"}\n   )\n   public class ResourceConfiguration {\n   }\n   ```\n\n4. **Native Image Configuration**: In `build.gradle`:\n   ```groovy\n   graalvmNative {\n       binaries {\n           main {\n               buildArgs.add(\"--initialize-at-build-time=io.micronaut\")\n               buildArgs.add(\"--initialize-at-run-time=io.netty\")\n               buildArgs.add(\"--report-unsupported-elements-at-runtime\")\n           }\n       }\n   }\n   ```\n\n5. **HTTP Client Configuration**: For Micronaut HTTP clients, ensure netty is properly configured:\n   ```yaml\n   micronaut:\n     http:\n       client:\n         read-timeout: 30s\n   netty:\n     default:\n       allocator:\n         max-order: 3\n   ```\n\n## Best Practices\n\n- **Start Simple**: Build with `--no-fallback` to catch all native image issues\n- **Use Tracing Agent**: Run your application with the GraalVM tracing agent to automatically discover reflection, resources, and JNI requirements\n- **Test Thoroughly**: Native images behave differently than JVM applications\n- **Minimize Reflection**: Prefer compile-time code generation over runtime reflection\n- **Profile Memory**: Native images have different memory characteristics\n- **CI\u002FCD Integration**: Add native image builds to your CI\u002FCD pipeline\n- **Keep Dependencies Updated**: Use latest versions for better GraalVM compatibility\n\n## Troubleshooting Tips\n\n1. **Build Fails with Reflection Errors**: Use the tracing agent or add manual reflection configuration\n2. **Missing Resources**: Ensure resource patterns are correctly specified in `resource-config.json`\n3. **ClassNotFoundException at Runtime**: Add the class to reflection configuration\n4. **Slow Build Times**: Consider using build caching and incremental builds\n5. **Large Image Size**: Use `--gc=serial` (default) or `--gc=epsilon` (no-op GC for testing) and analyze dependencies\n\n## References\n\n- [GraalVM Native Image Documentation](https:\u002F\u002Fwww.graalvm.org\u002Flatest\u002Freference-manual\u002Fnative-image\u002F)\n- [Spring Boot Native Image Guide](https:\u002F\u002Fdocs.spring.io\u002Fspring-boot\u002Fdocs\u002Fcurrent\u002Freference\u002Fhtml\u002Fnative-image.html)\n- [Quarkus Building Native Images](https:\u002F\u002Fquarkus.io\u002Fguides\u002Fbuilding-native-image)\n- [Micronaut GraalVM Support](https:\u002F\u002Fdocs.micronaut.io\u002Flatest\u002Fguide\u002Findex.html#graal)\n- [GraalVM Reachability Metadata](https:\u002F\u002Fgithub.com\u002Foracle\u002Fgraalvm-reachability-metadata)\n- [Native Build Tools](https:\u002F\u002Fgraalvm.github.io\u002Fnative-build-tools\u002Flatest\u002Findex.html)\n","# GraalVM Native Image Agent\n\nYou are an expert in adding GraalVM native image support to Java applications. Your goal is to:\n\n1. Analyze the project structure and identify the build tool (Maven or Gradle)\n2. Detect the framework (Spring Boot, Quarkus, Micronaut, or generic Java)\n3. Add appropriate GraalVM native image configuration\n4. Build the native image\n5. Analyze any build errors or warnings\n6. Apply fixes iteratively until the build succeeds\n\n## Your Approach\n\nFollow Oracle's best practices for GraalVM native images and use an iterative approach to resolve issues.\n\n### Step 1: Analyze the Project\n\n- Check if `pom.xml` exists (Maven) or `build.gradle`\u002F`build.gradle.kts` exists (Gradle)\n- Identify the framework by checking dependencies:\n  - Spring Boot: `spring-boot-starter` dependencies\n  - Quarkus: `quarkus-` dependencies\n  - Micronaut: `micronaut-` dependencies\n- Check for existing GraalVM configuration\n\n### Step 2: Add Native Image Support\n\n#### For Maven Projects\n\nAdd the GraalVM Native Build Tools plugin within a `native` profile in `pom.xml`:\n\n```xml\n\u003Cprofiles>\n  \u003Cprofile>\n    \u003Cid>native\u003C\u002Fid>\n    \u003Cbuild>\n      \u003Cplugins>\n        \u003Cplugin>\n          \u003CgroupId>org.graalvm.buildtools\u003C\u002FgroupId>\n          \u003CartifactId>native-maven-plugin\u003C\u002FartifactId>\n          \u003Cversion>[latest-version]\u003C\u002Fversion>\n          \u003Cextensions>true\u003C\u002Fextensions>\n          \u003Cexecutions>\n            \u003Cexecution>\n              \u003Cid>build-native\u003C\u002Fid>\n              \u003Cgoals>\n                \u003Cgoal>compile-no-fork\u003C\u002Fgoal>\n              \u003C\u002Fgoals>\n              \u003Cphase>package\u003C\u002Fphase>\n            \u003C\u002Fexecution>\n          \u003C\u002Fexecutions>\n          \u003Cconfiguration>\n            \u003CimageName>${project.artifactId}\u003C\u002FimageName>\n            \u003CmainClass>${main.class}\u003C\u002FmainClass>\n            \u003CbuildArgs>\n              \u003CbuildArg>--no-fallback\u003C\u002FbuildArg>\n            \u003C\u002FbuildArgs>\n          \u003C\u002Fconfiguration>\n        \u003C\u002Fplugin>\n      \u003C\u002Fplugins>\n    \u003C\u002Fbuild>\n  \u003C\u002Fprofile>\n\u003C\u002Fprofiles>\n```\n\nFor Spring Boot projects, ensure the Spring Boot Maven plugin is in the main build section:\n\n```xml\n\u003Cbuild>\n  \u003Cplugins>\n    \u003Cplugin>\n      \u003CgroupId>org.springframework.boot\u003C\u002FgroupId>\n      \u003CartifactId>spring-boot-maven-plugin\u003C\u002FartifactId>\n    \u003C\u002Fplugin>\n  \u003C\u002Fplugins>\n\u003C\u002Fbuild>\n```\n\n#### For Gradle Projects\n\nAdd the GraalVM Native Build Tools plugin to `build.gradle`:\n\n```groovy\nplugins {\n  id 'org.graalvm.buildtools.native' version '[latest-version]'\n}\n\ngraalvmNative {\n  binaries {\n    main {\n      imageName = project.name\n      mainClass = application.mainClass.get()\n      buildArgs.add('--no-fallback')\n    }\n  }\n}\n```\n\nOr for Kotlin DSL (`build.gradle.kts`):\n\n```kotlin\nplugins {\n  id(\"org.graalvm.buildtools.native\") version \"[latest-version]\"\n}\n\ngraalvmNative {\n  binaries {\n    named(\"main\") {\n      imageName.set(project.name)\n      mainClass.set(application.mainClass.get())\n      buildArgs.add(\"--no-fallback\")\n    }\n  }\n}\n```\n\n### Step 3: Build the Native Image\n\nRun the appropriate build command:\n\n**Maven:**\n```sh\nmvn -Pnative native:compile\n```\n\n**Gradle:**\n```sh\n.\u002Fgradlew nativeCompile\n```\n\n**Spring Boot (Maven):**\n```sh\nmvn -Pnative spring-boot:build-image\n```\n\n**Quarkus (Maven):**\n```sh\n.\u002Fmvnw package -Pnative\n```\n\n**Micronaut (Maven):**\n```sh\n.\u002Fmvnw package -Dpackaging=native-image\n```\n\n### Step 4: Analyze Build Errors\n\nCommon issues and solutions:\n\n#### Reflection Issues\nIf you see errors about missing reflection configuration, create or update `src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fnative-image\u002Freflect-config.json`:\n\n```json\n[\n  {\n    \"name\": \"com.example.YourClass\",\n    \"allDeclaredConstructors\": true,\n    \"allDeclaredMethods\": true,\n    \"allDeclaredFields\": true\n  }\n]\n```\n\n#### Resource Access Issues\nFor missing resources, create `src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fnative-image\u002Fresource-config.json`:\n\n```json\n{\n  \"resources\": {\n    \"includes\": [\n      {\"pattern\": \"application.properties\"},\n      {\"pattern\": \".*\\\\.yml\"},\n      {\"pattern\": \".*\\\\.yaml\"}\n    ]\n  }\n}\n```\n\n#### JNI Issues\nFor JNI-related errors, create `src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fnative-image\u002Fjni-config.json`:\n\n```json\n[\n  {\n    \"name\": \"com.example.NativeClass\",\n    \"methods\": [\n      {\"name\": \"nativeMethod\", \"parameterTypes\": [\"java.lang.String\"]}\n    ]\n  }\n]\n```\n\n#### Dynamic Proxy Issues\nFor dynamic proxy errors, create `src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fnative-image\u002Fproxy-config.json`:\n\n```json\n[\n  [\"com.example.Interface1\", \"com.example.Interface2\"]\n]\n```\n\n### Step 5: Iterate Until Success\n\n- After each fix, rebuild the native image\n- Analyze new errors and apply appropriate fixes\n- Use the GraalVM tracing agent to automatically generate configuration:\n  ```sh\n  java -agentlib:native-image-agent=config-output-dir=src\u002Fmain\u002Fresources\u002FMETA-INF\u002Fnative-image -jar target\u002Fapp.jar\n  ```\n- Continue until the build succeeds without errors\n\n### Step 6: Verify the Native Image\n\nOnce built successfully:\n- Test the native executable to ensure it runs correctly\n- Verify startup time improvements\n- Check memory footprint\n- Test all critical application paths\n\n## Framework-Specific Considerations\n\n### Spring Boot\n- Spring Boot 3.0+ has excellent native image support\n- Ensure you're using compatible Spring Boot version (3.0+)\n- Most Spring libraries provide GraalVM hints automatically\n- Test with Spring AOT processing enabled\n\n**When to Add Custom RuntimeHints:**\n\nCreate a `RuntimeHintsRegistrar` implementation only if you need to register custom hints:\n\n```java\nimport org.springframework.aot.hint.RuntimeHints;\nimport org.springframework.aot.hint.RuntimeHintsRegistrar;\n\npublic class MyRuntimeHints implements RuntimeHintsRegistrar {\n    @Override\n    public void registerHints(RuntimeHints hints, ClassLoader classLoader) {\n        \u002F\u002F Register reflection hints\n        hints.reflection().registerType(\n            MyClass.class,\n            hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,\n                                     MemberCategory.INVOKE_DECLARED_METHODS)\n        );\n\n        \u002F\u002F Register resource hints\n        hints.resources().registerPattern(\"custom-config\u002F*.properties\");\n\n        \u002F\u002F Register serialization hints\n        hints.serialization().registerType(MySerializableClass.class);\n    }\n}\n```\n\nRegister it in your main application class:\n\n```java\n@SpringBootApplication\n@ImportRuntimeHints(MyRuntimeHints.class)\npublic class Application {\n    public static void main(String[] args) {\n        SpringApplication.run(Application.class, args);\n    }\n}\n```\n\n**Common Spring Boot Native Image Issues:**\n\n1. **Logback Configuration**: Add to `application.properties`:\n   ```properties\n   # Disable Logback's shutdown hook in native images\n   logging.register-shutdown-hook=false\n   ```\n\n   If using custom Logback configuration, ensure `logback-spring.xml` is in resources and add to `RuntimeHints`:\n   ```java\n   hints.resources().registerPattern(\"logback-spring.xml\");\n   hints.resources().registerPattern(\"org\u002Fspringframework\u002Fboot\u002Flogging\u002Flogback\u002F*.xml\");\n   ```\n\n2. **Jackson Serialization**: For custom Jackson modules or types, register them:\n   ```java\n   hints.serialization().registerType(MyDto.class);\n   hints.reflection().registerType(\n       MyDto.class,\n       hint -> hint.withMembers(\n           MemberCategory.DECLARED_FIELDS,\n           MemberCategory.INVOKE_DECLARED_CONSTRUCTORS\n       )\n   );\n   ```\n\n   Add Jackson mix-ins to reflection hints if used:\n   ```java\n   hints.reflection().registerType(MyMixIn.class);\n   ```\n\n3. **Jackson Modules**: Ensure Jackson modules are on the classpath:\n   ```xml\n   \u003Cdependency>\n       \u003CgroupId>com.fasterxml.jackson.datatype\u003C\u002FgroupId>\n       \u003CartifactId>jackson-datatype-jsr310\u003C\u002FartifactId>\n   \u003C\u002Fdependency>\n   ```\n\n### Quarkus\n- Quarkus is designed for native images with zero configuration in most cases\n- Use `@RegisterForReflection` annotation for reflection needs\n- Quarkus extensions handle GraalVM configuration automatically\n\n**Common Quarkus Native Image Tips:**\n\n1. **Reflection Registration**: Use annotations instead of manual configuration:\n   ```java\n   @RegisterForReflection(targets = {MyClass.class, MyDto.class})\n   public class ReflectionConfiguration {\n   }\n   ```\n\n   Or register entire packages:\n   ```java\n   @RegisterForReflection(classNames = {\"com.example.package.*\"})\n   ```\n\n2. **Resource Inclusion**: Add to `application.properties`:\n   ```properties\n   quarkus.native.resources.includes=config\u002F*.json,templates\u002F**\n   quarkus.native.additional-build-args=--initialize-at-run-time=com.example.RuntimeClass\n   ```\n\n3. **Database Drivers**: Ensure you're using Quarkus-supported JDBC extensions:\n   ```xml\n   \u003Cdependency>\n       \u003CgroupId>io.quarkus\u003C\u002FgroupId>\n       \u003CartifactId>quarkus-jdbc-postgresql\u003C\u002FartifactId>\n   \u003C\u002Fdependency>\n   ```\n\n4. **Build-Time vs Runtime Initialization**: Control initialization with:\n   ```properties\n   quarkus.native.additional-build-args=--initialize-at-build-time=com.example.BuildTimeClass\n   quarkus.native.additional-build-args=--initialize-at-run-time=com.example.RuntimeClass\n   ```\n\n5. **Container Image Build**: Use Quarkus container-image extensions:\n   ```properties\n   quarkus.native.container-build=true\n   quarkus.native.builder-image=mandrel\n   ```\n\n### Micronaut\n- Micronaut has built-in GraalVM support with minimal configuration\n- Use `@ReflectionConfig` and `@Introspected` annotations as needed\n- Micronaut's ahead-of-time compilation reduces reflection requirements\n\n**Common Micronaut Native Image Tips:**\n\n1. **Bean Introspection**: Use `@Introspected` for POJOs to avoid reflection:\n   ```java\n   @Introspected\n   public class MyDto {\n       private String name;\n       private int value;\n       \u002F\u002F getters and setters\n   }\n   ```\n\n   Or enable package-wide introspection in `application.yml`:\n   ```yaml\n   micronaut:\n     introspection:\n       packages:\n         - com.example.dto\n   ```\n\n2. **Reflection Configuration**: Use declarative annotations:\n   ```java\n   @ReflectionConfig(\n       type = MyClass.class,\n       accessType = ReflectionConfig.AccessType.ALL_DECLARED_CONSTRUCTORS\n   )\n   public class MyConfiguration {\n   }\n   ```\n\n3. **Resource Configuration**: Add resources to native image:\n   ```java\n   @ResourceConfig(\n       includes = {\"application.yml\", \"logback.xml\"}\n   )\n   public class ResourceConfiguration {\n   }\n   ```\n\n4. **Native Image Configuration**: In `build.gradle`:\n   ```groovy\n   graalvmNative {\n       binaries {\n           main {\n               buildArgs.add(\"--initialize-at-build-time=io.micronaut\")\n               buildArgs.add(\"--initialize-at-run-time=io.netty\")\n               buildArgs.add(\"--report-unsupported-elements-at-runtime\")\n           }\n       }\n   }\n   ```\n\n5. **HTTP Client Configuration**: For Micronaut HTTP clients, ensure netty is properly configured:\n   ```yaml\n   micronaut:\n     http:\n       client:\n         read-timeout: 30s\n   netty:\n     default:\n       allocator:\n         max-order: 3\n   ```\n\n## Best Practices\n\n- **Start Simple**: Build with `--no-fallback` to catch all native image issues\n- **Use Tracing Agent**: Run your application with the GraalVM tracing agent to automatically discover reflection, resources, and JNI requirements\n- **Test Thoroughly**: Native images behave differently than JVM applications\n- **Minimize Reflection**: Prefer compile-time code generation over runtime reflection\n- **Profile Memory**: Native images have different memory characteristics\n- **CI\u002FCD Integration**: Add native image builds to your CI\u002FCD pipeline\n- **Keep Dependencies Updated**: Use latest versions for better GraalVM compatibility\n\n## Troubleshooting Tips\n\n1. **Build Fails with Reflection Errors**: Use the tracing agent or add manual reflection configuration\n2. **Missing Resources**: Ensure resource patterns are correctly specified in `resource-config.json`\n3. **ClassNotFoundException at Runtime**: Add the class to reflection configuration\n4. **Slow Build Times**: Consider using build caching and incremental builds\n5. **Large Image Size**: Use `--gc=serial` (default) or `--gc=epsilon` (no-op GC for testing) and analyze dependencies\n\n## References\n\n- [GraalVM Native Image Documentation](https:\u002F\u002Fwww.graalvm.org\u002Flatest\u002Freference-manual\u002Fnative-image\u002F)\n- [Spring Boot Native Image Guide](https:\u002F\u002Fdocs.spring.io\u002Fspring-boot\u002Fdocs\u002Fcurrent\u002Freference\u002Fhtml\u002Fnative-image.html)\n- [Quarkus Building Native Images](https:\u002F\u002Fquarkus.io\u002Fguides\u002Fbuilding-native-image)\n- [Micronaut GraalVM Support](https:\u002F\u002Fdocs.micronaut.io\u002Flatest\u002Fguide\u002Findex.html#graal)\n- [GraalVM Reachability Metadata](https:\u002F\u002Fgithub.com\u002Foracle\u002Fgraalvm-reachability-metadata)\n- [Native Build Tools](https:\u002F\u002Fgraalvm.github.io\u002Fnative-build-tools\u002Flatest\u002Findex.html)\n",{"name":5,"description":7},"main","58843b159d7a4050d6b785a98b908cce505c0b92",".agents\u002Fskills\u002Fjava-add-graalvm-native-image-support",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-add-graalvm-native-image-support",{"tool":38,"command":39},"bunx","bunx skills add Reihantt6\u002Fsns-myagent --skill java-add-graalvm-native-image-support",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Reihantt6\u002Fsns-myagent --skill java-add-graalvm-native-image-support","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fjava-add-graalvm-native-image-support\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",[],[]]