Skip to content

[GR-73320] Introducing agent skills for building Native Image#13073

Open
graalvmbot wants to merge 3 commits intomasterfrom
mm/GR-73320-building-native-image-skill
Open

[GR-73320] Introducing agent skills for building Native Image#13073
graalvmbot wants to merge 3 commits intomasterfrom
mm/GR-73320-building-native-image-skill

Conversation

@graalvmbot
Copy link
Collaborator

This PR introduces agent skills for building and troubleshooting Native Image builds. An agent skill is a .md file that equips the agent with domain-specific knowledge and workflows it wouldn't otherwise have.

Skill structure:

  • Each skill lives in a directory named after the skill itself (e.g. building-native-image/)
  • Each skill directory contains aSKILL.md, which is the entry point the agent executes when the skill is triggered. It contains the core instructions, decision logic, and pointers to any reference files the agent may need to load
  • Every SKILL.md requires YAML frontmatter at the top. The description field is the primary signal the agent uses to decide whether to load the skill at all, so it should clearly describe when and why the skill should trigger
  • The references/ subdirectory holds supplementary resources that the agent loads on demand, keeping the main SKILL.md lean. This method is called progressive disclosure.

Currently, skills are available for classic Native Image build setups and Gradle Native Build Tools (Maven support is coming). Keep in mind that this work is in progress, skills will expand over time.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 3, 2026
@graalvmbot graalvmbot changed the title [WIP] [GR-73320] Introducing agent skills for building Native Image [GR-73320] Introducing agent skills for building Native Image Mar 10, 2026
@graalvmbot graalvmbot force-pushed the mm/GR-73320-building-native-image-skill branch 2 times, most recently from ba6fae2 to 087ec22 Compare March 17, 2026 16:53
@graalvmbot graalvmbot force-pushed the mm/GR-73320-building-native-image-skill branch from da48bc9 to 8a6fd57 Compare March 17, 2026 20:41
Copy link
Collaborator

@zakkak zakkak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I added a few comments for your consideration.

It's also not clear to me why the skills need to be present both under docs and substratevm.


For metadata layout and file semantics, see the [Reachability Metadata documentation](https://www.graalvm.org/latest/reference-manual/native-image/metadata/).

Minimal `reflect-config.json` example:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be instructed to use reachability-metadata.json instead?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @kimeta


**If you want best runtime performance:**
```bash
native-image -O3 <class> # or combine with --pgo
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
native-image -O3 <class> # or combine with --pgo
native-image -O3 <class> # or combine with --pgo (GraalVM EE only)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @kimeta

native-image --enable-all-security-services <class>
```

**If you need a Software Bill of Materials (SBOM):**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**If you need a Software Bill of Materials (SBOM):**
**If you need a Software Bill of Materials (SBOM) (GraalVM EE only):**

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @kimeta


**Quick diagnostic command** - run the app with warning mode to see all missing registrations without crashing:
```shell
java -XX:MissingRegistrationReportingMode=Warn -jar your-app.jar
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth pointing out that by default the stack traces reported in Warn mode are limited, and it can tune the limit. Increasing the limit will increase the context usage though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @kimeta

```shell
native-image -Duser.country=US -Duser.language=en -H:IncludeLocales=fr,de
# or include everything:
native-image -H:+IncludeAllLocales
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth clarifying that this can significantly increase the resulting binary size

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @kimeta

@graalvmbot graalvmbot force-pushed the mm/GR-73320-building-native-image-skill branch from d1c7342 to 2ce097e Compare March 19, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants