Java
ericrisco/rsc-harness
A skill your agent uses when writing, reviewing or refactoring modern Java (21+, 25 LTS) — records and sealed interfaces as algebraic data types, exhaustive pattern-matching switch over instanceof…
Guide for writing modern Java 21 in a Grails and Groovy codebase: records, sealed classes, pattern matching, text blocks and how Java works alongside Groovy.
$ npx skills add apache/grails-core --skill java-developer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install apache/grails-core java-developer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/apache/grails-core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/java-developer .claude/skills/java-developer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "java-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/java-developer into .claude/skills/java-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "java-developer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/java-developerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add apache/grails-core --skill java-developer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install apache/grails-core java-developer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/apache/grails-core.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/java-developer .agents/skills/java-developer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "java-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/java-developer into .agents/skills/java-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "java-developer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add apache/grails-core --skill java-developer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install apache/grails-core java-developer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/apache/grails-core.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/java-developer .cursor/skills/java-developer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "java-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/java-developer into .cursor/skills/java-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "java-developer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/apache/grails-core.git --path .agents/skills/java-developer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add apache/grails-core --skill java-developer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install apache/grails-core java-developer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/apache/grails-core.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/java-developer .gemini/skills/java-developer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "java-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/java-developer into .gemini/skills/java-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "java-developer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install apache/grails-core java-developerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add apache/grails-core --skill java-developer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/apache/grails-core.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/java-developer .github/skills/java-developer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "java-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/java-developer into .github/skills/java-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "java-developer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add apache/grails-core --skill java-developer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install apache/grails-core java-developer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/apache/grails-core.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/java-developer .opencode/skills/java-developer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "java-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/java-developer into .opencode/skills/java-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "java-developer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
java-developerGuide for writing modern Java 21 in a Grails and Groovy codebase: records, sealed classes, pattern matching, text blocks and how Java works alongside Groovy.
The skill helps with Java code that lives alongside Groovy in the Grails repository. It covers generating, refactoring and debugging code with Java 21 features, with examples for records, sealed classes, pattern matching for instanceof, text blocks, switch expressions, helpful NullPointerException messages and newer stream and collection APIs, each tied to its JEP number.
It also advises on moving older Java (8, 11 or 17 code) to Java 21 idioms, writing Java that Groovy can call and use, performance optimization, security hardening and module system questions, and tooling such as Gradle builds, JDK setup, JUnit 5 or Spock testing and profiling. A closing section deals with calling Java from Groovy.
Read from SKILL.md and the folder at commit 3d6db18. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are java, groovy and bash).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
docs.oracle.comopenjdk.orgFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Java 21 Developer Guide for Grails loads about 1.9k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 381 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from apache/grails-core at commit 3d6db18, republished under its Apache-2.0 licence (© apache). 381 words, ~1,851 tokens.
.claude/skills/java-developer/SKILL.md (or your agent's skills folder).<!--
SPDX-License-Identifier: Apache-2.0
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0.
-->
Use this skill when working on Java code within this repository, especially for:
Immutable data carriers with auto-generated constructors, accessors, equals, hashCode, and toString:
public record Book(String title, String author, int year) {
// Compact constructor for validation
public Book {
if (title == null || title.isBlank()) {
throw new IllegalArgumentException("Title cannot be blank");
}
}
}Restrict which classes can extend or implement a type:
public sealed interface Shape permits Circle, Rectangle, Triangle {
double area();
}
public final class Circle implements Shape {
private final double radius;
public Circle(double radius) { this.radius = radius; }
public double area() { return Math.PI * radius * radius; }
}
public non-sealed class Rectangle implements Shape {
// Can be further extended
}Eliminate redundant casts:
// Before pattern matching
if (obj instanceof String) {
String s = (String) obj;
System.out.println(s.length());
}
// Modern Java
if (obj instanceof String s) {
System.out.println(s.length());
}Multi-line string literals with proper formatting:
String json = """
{
"name": "Grails",
"version": "7.0"
}
""";
String sql = """
SELECT id, name, created_at
FROM users
WHERE status = 'ACTIVE'
ORDER BY created_at DESC
""";Use switch as an expression with arrow syntax:
String result = switch (day) {
case MONDAY, FRIDAY, SUNDAY -> "Relaxed";
case TUESDAY -> "Productive";
case THURSDAY, SATURDAY -> "Moderate";
case WEDNESDAY -> {
var temp = calculateWorkload();
yield temp > 5 ? "Busy" : "Normal";
}
};Detailed NPE messages showing exactly which variable was null:
Cannot invoke "String.length()" because "user.getAddress().getCity()" is null// Stream.toList() - unmodifiable list
List<String> names = users.stream()
.map(User::getName)
.toList();
// Collectors improvements
Map<Status, List<User>> byStatus = users.stream()
.collect(Collectors.groupingBy(User::getStatus));Groovy seamlessly calls Java code:
// Java record used in Groovy
def book = new Book("Grails Guide", "Author", 2024)
println book.title() // Groovy can use property syntax too
println book.title // Also works// Groovy classes are just Java classes
GroovyService service = new GroovyService();
service.process(data);
// Working with Groovy closures in Java
Closure<String> closure = ...;
String result = closure.call("input");@CompileStatic equivalent behavior.java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs += ['-parameters'] // Preserve parameter names
}@Test
@DisplayName("Book record should validate title")
void bookShouldValidateTitle() {
assertThrows(IllegalArgumentException.class, () ->
new Book("", "Author", 2024)
);
}
@ParameterizedTest
@ValueSource(strings = {"", " ", " "})
void blankTitlesShouldBeRejected(String title) {
assertThrows(IllegalArgumentException.class, () ->
new Book(title, "Author", 2024)
);
}def "Java record should work in Spock tests"() {
when:
def book = new Book("Test", "Author", 2024)
then:
book.title() == "Test"
book.author() == "Author"
}# Recommended GC for most workloads
-XX:+UseG1GC
# For low-latency requirements
-XX:+UseZGC
# Memory settings
-Xms512m -Xmx2g
# Enable JFR for profiling
-XX:StartFlightRecording=duration=60s,filename=recording.jfrpublic Optional<User> findById(Long id) {
return Optional.ofNullable(repository.get(id));
}
// Usage
String name = findById(id)
.map(User::getName)
.orElse("Unknown");try (var reader = new BufferedReader(new FileReader(path));
var writer = new BufferedWriter(new FileWriter(output))) {
reader.lines()
.map(String::toUpperCase)
.forEach(line -> writer.write(line + "\n"));
}// Create immutable collections
List<String> list = List.of("a", "b", "c");
Set<String> set = Set.of("x", "y", "z");
Map<String, Integer> map = Map.of("one", 1, "two", 2);
// Copy to immutable
List<String> copy = List.copyOf(mutableList);var for local variables when the type is obvious from context.@Override annotation when overriding methods.-parameters flag).© apache, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/java-developer of apache/grails-core.
Open the folder on GitHubat commit 3d6db18
Java 21 Developer Guide for Grails next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Java 21 Developer Guide for Grails this skillapache/grails-core | 2.9k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Javaericrisco/rsc-harness | 156 | — | ~4.6k | Automated safety check: Pass | MIT | |
| Cobol ModernizationOpenHands/extensions | 157 | — | ~820 | Automated safety check: Pass | MIT | |
| Java Idiomsirahardianto/awesome-agv | 157 | — | ~1.5k | Automated safety check: Pass | MIT | |
| Codingmicronaut-projects/micronaut-openapi | 114 | — | ~2.6k | Automated safety check: Pass | Apache-2.0 | |
| Neo4j Driver Java Skillneo4j-contrib/neo4j-skills | 114 | — | ~4.2k | Automated safety check: Notes | MIT |
ericrisco/rsc-harness
A skill your agent uses when writing, reviewing or refactoring modern Java (21+, 25 LTS) — records and sealed interfaces as algebraic data types, exhaustive pattern-matching switch over instanceof…
OpenHands/extensions
End-to-end COBOL to Java migration workflow. An agent skill from OpenHands/extensions.
irahardianto/awesome-agv
Modern Java (17/21+ LTS) idioms: records, sealed classes, pattern matching switch, Optional hygiene, streams, and JUnit 5 testing.
micronaut-projects/micronaut-openapi
Implement and review Java code changes for Micronaut framework repositories using maintainer standards, including JSpecify null-safety conventions.
neo4j-contrib/neo4j-skills
Neo4j Java Driver v6 — driver lifecycle, Maven/Gradle setup, executableQuery, executeRead/Write managed transactions, explicit transactions, async/reactive patterns, error handling, data type…
softspark/ai-toolkit
Java coding rules: style, patterns, security, testing. An agent skill from softspark/ai-toolkit.
apache/grails-core
Guides building Grails web applications and REST APIs with GORM, controllers, services, views, plugins and Spock and Geb testing.
apache/grails-core
Guidance for Groovy 5 work in Grails projects: syntax, closures, traits, DSLs, metaprogramming, Spock tests, static compilation and Java 21 integration.
apache/grails-core
Guides changes to the grails-data-hibernate7 module, covering domain binding, Hibernate 5 to 7 migration work, generators and integration specs.
apache/grails-core
Guides running, reviewing and fixing test failures across grails-core modules with Gradle, including targeted runs and the aggregate HTML and Markdown reports.
apache/grails-core
Guide to running, reading and fixing code style and analysis violations in grails-core with CodeNarc, Checkstyle, PMD, SpotBugs, Spotless and JaCoCo through Gradle.
apache/grails-core
Guides Gradle 9 build changes in apache/grails-core on the 8.0.x line, favoring the repo's convention plugins, BOM platforms and patterns over generic Gradle advice.
Categories
Guide for writing modern Java 21 in a Grails and Groovy codebase: records, sealed classes, pattern matching, text blocks and how Java works alongside Groovy. The skill helps with Java code that lives alongside Groovy in the Grails repository. It covers generating, refactoring and debugging code with Java 21 features, with examples for records, sealed classes, pattern matching for instanceof, text blocks, switch expressions, helpful NullPointerException messages and newer stream and collection APIs, each tied to its JEP number.
Java 21 Developer Guide for Grails fits situations like: writing Java classes that will be used alongside Groovy code; replacing older Java patterns with records, sealed types or pattern matching; migrating Java 8, 11 or 17 code to Java 21 idioms; questions about the module system, performance or security hardening in Java.
Run `npx skills add apache/grails-core --skill java-developer -a claude-code`. Or copy the skill folder (.agents/skills/java-developer in apache/grails-core) into .claude/skills/java-developer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add apache/grails-core --skill java-developer -a codex`. Or copy the skill folder (.agents/skills/java-developer in apache/grails-core) into .agents/skills/java-developer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add apache/grails-core --skill java-developer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/java-developer, .gemini/skills/java-developer, .github/skills/java-developer and .opencode/skills/java-developer in your project.
SKILL.md names no scripts, command-line tools or credentials: Java 21 Developer Guide for Grails is instructions for the agent only. Our summary lists: A Java 21 JDK.
SKILL.md names 2 domains. As links in the text: docs.oracle.com and openjdk.org. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Java 21 Developer Guide for Grails is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Java 21 Developer Guide for Grails: Java (ericrisco/rsc-harness, 156 stars), Cobol Modernization (OpenHands/extensions, 157 stars), Java Idioms (irahardianto/awesome-agv, 157 stars) and Coding (micronaut-projects/micronaut-openapi, 114 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
apache (a GitHub organization) maintains it in apache/grails-core, which has 2,934 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 7, 2026.
Source: apache/grails-core on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.