Java Rules
softspark/ai-toolkit
Java coding rules: style, patterns, security, testing. An agent skill from softspark/ai-toolkit.
Guidance for Groovy 5 work in Grails projects: syntax, closures, traits, DSLs, metaprogramming, Spock tests, static compilation and Java 21 integration.
$ npx skills add apache/grails-core --skill groovy-developer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install apache/grails-core groovy-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/groovy-developer .claude/skills/groovy-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 "groovy-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/groovy-developer into .claude/skills/groovy-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "groovy-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/groovy-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 groovy-developer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install apache/grails-core groovy-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/groovy-developer .agents/skills/groovy-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 "groovy-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/groovy-developer into .agents/skills/groovy-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "groovy-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 groovy-developer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install apache/grails-core groovy-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/groovy-developer .cursor/skills/groovy-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 "groovy-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/groovy-developer into .cursor/skills/groovy-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "groovy-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/groovy-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 groovy-developer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install apache/grails-core groovy-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/groovy-developer .gemini/skills/groovy-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 "groovy-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/groovy-developer into .gemini/skills/groovy-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "groovy-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 groovy-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 groovy-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/groovy-developer .github/skills/groovy-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 "groovy-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/groovy-developer into .github/skills/groovy-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "groovy-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 groovy-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 groovy-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/groovy-developer .opencode/skills/groovy-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 "groovy-developer" agent skill from https://github.com/apache/grails-core/tree/8.0.x/.agents/skills/groovy-developer into .opencode/skills/groovy-developer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "groovy-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.
groovy-developerGuidance for Groovy 5 work in Grails projects: syntax, closures, traits, DSLs, metaprogramming, Spock tests, static compilation and Java 21 integration.
This guide equips the agent for Groovy 5.1 development. It covers core language features such as closures, traits, GStrings, operators and Groovy Truth, metaprogramming at runtime (categories, ExpandoMetaClass, extension modules) and at compile time through AST transformations like @Immutable, @Builder, @Delegate, @Singleton, @Log and @Memoized. It also helps with DSLs built on MarkupBuilder, JsonBuilder and configuration builders.
Other areas are Spock specifications for unit and integration tests, JSON and XML handling, Groovy SQL and collection processing, and integration with Java 21 through joint compilation, Gradle builds, Grails and Spring Boot. For speed it recommends @CompileStatic, @TypeChecked and @GrailsCompileStatic. Typical tasks include Grails domain classes, controllers, services and taglibs, build.gradle scripts, GORM criteria queries, and moving code from Groovy 2.x, 3.x or 4.x to 5.1.
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 groovy).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
groovy-lang.orggrails.apache.orgspockframework.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.
Groovy 5 Developer Guide loads about 3k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 427 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). 427 words, ~2,957 tokens.
.claude/skills/groovy-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.
-->
Activate this skill for any Groovy-related task, including:
// No semicolons required
def name = 'Grails'
// Optional parentheses for method calls
println 'Hello World'
list.each { println it }
// Optional return keyword
String greet(String name) {
"Hello, $name" // Last expression is returned (GString needs double quotes)
}def user = "Alice"
def count = 42
// Simple interpolation
println "User: $user"
// Expression interpolation
println "Items: ${count * 2}"
// Lazy GStrings (evaluated when accessed)
def lazy = "Count is ${ -> counter }"
// Multi-line strings
def sql = """
SELECT * FROM users
WHERE name = '$user'
ORDER BY created_at
"""// Basic closure
def greet = { name -> "Hello, $name" }
println greet("World")
// Implicit 'it' parameter
def twice = { it * 2 }
println [1, 2, 3].collect(twice)
// Closure with delegate (for DSLs)
def configure = {
name = "MyApp"
version = "1.0"
}
configure.delegate = new Config()
configure.resolveStrategy = Closure.DELEGATE_FIRST
configure()
// Method references
def upper = String.&toUpperCase
println ["a", "b"].collect(upper)// Safe navigation - returns null if any part is null
def city = user?.address?.city
// Elvis operator - default value if null
def name = user?.name ?: "Anonymous"
// Safe method calls
def length = text?.length() ?: 0
// Combine with collections
def firstTitle = books?.first()?.title ?: "No books"// Use ternary operators only for simple conditions.
// Split long ternary expressions into multiple lines.
// Align `?` and `:` branches for readability.
String message = condition
? "Value when true"
: "Value when false"// Spread operator for collections
def names = users*.name // Same as users.collect { it.name }
// Spread for method arguments
def args = [1, 2, 3]
someMethod(*args)
// Spread in list literals
def combined = [*list1, *list2]// List literal
def list = [1, 2, 3, 4, 5]
// Map literal
def map = [name: "Grails", version: 7]
// Range
def range = 1..10
def exclusive = 1..<10
// Powerful collection methods
list.find { it > 3 } // First match: 4
list.findAll { it > 3 } // All matches: [4, 5]
list.any { it > 3 } // true
list.every { it > 0 } // true
list.groupBy { it % 2 } // [0:[2,4], 1:[1,3,5]]
list.collectEntries { [it, it * 2] } // [1:2, 2:4, ...]
// Sorting
list.sort { a, b -> b <=> a } // Descending
list.sort { -it } // Descending (numeric)// Falsy values: null, empty string, empty collection, 0, false
if (list) { } // True if not null and not empty
if (string) { } // True if not null and not blank
if (number) { } // True if not 0
// Useful in conditionals
def items = getItems() ?: [] // Default to empty list// Immutable data class
record Point(int x, int y) {}
def p = new Point(10, 20)
println p.x() // 10
println p // Point[x=10, y=20]trait Auditable {
Date dateCreated
Date lastUpdated
def beforeInsert() {
dateCreated = new Date()
}
def beforeUpdate() {
lastUpdated = new Date()
}
}
class Book implements Auditable {
String title
}Enables static type checking and compilation for better performance:
import groovy.transform.CompileStatic
@CompileStatic
class BookService {
List<Book> findByAuthor(String author) {
Book.findAllByAuthor(author)
}
int calculateTotal(List<Integer> prices) {
prices.sum() as int
}
}Type checking without full static compilation:
import groovy.transform.TypeChecked
@TypeChecked
void process(String input) {
println input.toUppercase() // Compile error: method not found
}Grails-aware static compilation that understands dynamic finders:
import grails.compiler.GrailsCompileStatic
@GrailsCompileStatic
class BookController {
def show(Long id) {
respond Book.findByIdAndActive(id, true) // Dynamic finder works with @GrailsCompileStatic
}
}import groovy.transform.Immutable
@Immutable
class Person {
String name
int age
}
def p = new Person(name: "Alice", age: 30)
// p.name = "Bob" // Error: read-onlyimport groovy.transform.builder.Builder
@Builder
class Email {
String to
String subject
String body
}
def email = Email.builder()
.to("user@example.com")
.subject("Hello")
.body("Content here")
.build()import groovy.lang.Delegate
class EnhancedList<T> {
@Delegate List<T> list = []
T secondLast() {
list[-2]
}
}
def enhanced = new EnhancedList<String>()
enhanced.add("a") // Delegated to list
enhanced.add("b")
println enhanced.secondLast() // "a"import groovy.lang.Singleton
@Singleton
class ConfigManager {
Map settings = [:]
}
ConfigManager.instance.settings['key'] = 'value'import groovy.transform.Memoized
class Calculator {
@Memoized
BigInteger fibonacci(int n) {
if (n <= 1) return n
fibonacci(n - 1) + fibonacci(n - 2)
}
}import groovy.util.logging.Slf4j
@Slf4j
class BookService {
def save(Book book) {
log.info "Saving book: ${book.title}"
// ...
}
}import groovy.json.JsonBuilder
def builder = new JsonBuilder()
builder {
name "Grails"
version 7
features(["GORM", "GSP", "Plugins"])
metadata {
author "Grails Team"
license "Apache 2.0"
}
}
println builder.toPrettyString()import groovy.json.JsonSlurper
def json = '{"name": "Grails", "version": 7}'
def data = new JsonSlurper().parseText(json)
println data.name // Grailsimport groovy.xml.MarkupBuilder
def writer = new StringWriter()
def xml = new MarkupBuilder(writer)
xml.books {
book(id: 1) {
title "Grails Guide"
author "Team"
}
}
println writer.toString()class HtmlBuilder {
def html(@DelegatesTo(HtmlBuilder) Closure c) {
c.delegate = this
c.resolveStrategy = Closure.DELEGATE_FIRST
"<html>${c()}</html>"
}
def body(String content) {
"<body>$content</body>"
}
}
def builder = new HtmlBuilder()
def result = builder.html {
body "Hello World"
}class BookServiceSpec extends Specification {
def service = new BookService()
def "should find book by title"() {
given: "a book title"
def title = "Grails Guide"
when: "searching for the book"
def book = service.findByTitle(title)
then: "the book is found"
book != null
book.title == title
}
}@Unroll
def "max of #a and #b is #expected"() {
expect:
Math.max(a, b) == expected
where:
a | b || expected
1 | 3 || 3
7 | 4 || 7
0 | 0 || 0
}def "should call repository when saving"() {
given:
def repo = Mock(BookRepository)
def service = new BookService(repo)
def book = new Book(title: "Test")
when:
service.save(book)
then:
1 * repo.save(book)
}def "should throw exception for invalid input"() {
when:
service.process(null)
then:
thrown(IllegalArgumentException)
}import groovy.sql.Sql
def sql = Sql.newInstance(dataSource)
// Query
sql.eachRow("SELECT * FROM books WHERE author = ?", [authorName]) { row ->
println "${row.title} by ${row.author}"
}
// Insert
sql.execute("INSERT INTO books (title, author) VALUES (?, ?)",
[title, author])
// With GString (auto-parameterized)
sql.execute("INSERT INTO books (title) VALUES ($title)")@CompileStatic or @GrailsCompileStatic in production code.collect/findAll over manual loops.@Memoized for expensive computations.?.) instead of null checks.?:) for default values.def for local variables.@GrailsCompileStatic instead of @CompileStatic in Grails artefact classes if needed.== vs is: == calls equals(), use is for identity comparison (same as Java)."key$idx".toString() if needed.delegate, owner, and this in closures.© 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/groovy-developer of apache/grails-core.
Open the folder on GitHubat commit 3d6db18
Groovy 5 Developer Guide 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 |
|---|---|---|---|---|---|---|
| Groovy 5 Developer Guide this skillapache/grails-core | 2.9k | — | ~3k | Automated safety check: Pass | Apache-2.0 | |
| Java Rulessoftspark/ai-toolkit | 179 | — | ~3.1k | Automated safety check: Pass | Apache-2.0 | |
| Javaericrisco/rsc-harness | 156 | — | ~4.6k | Automated safety check: Pass | MIT | |
| Progensivaprasadreddy/sivalabs-agent-skills | 187 | — | ~2.7k | Automated safety check: Notes | MIT | |
| Starter Domain Revieweraxelixlabs/axelix | 147 | — | ~3.3k | Automated safety check: Pass | LGPL-3.0 | |
| Spring Mvc To Boot MigratorArabelaTso/Skills-4-SE | 253 | — | ~2.2k | Automated safety check: Pass | Apache-2.0 |
softspark/ai-toolkit
Java coding rules: style, patterns, security, testing. An agent skill from softspark/ai-toolkit.
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…
sivaprasadreddy/sivalabs-agent-skills
A skill your agent uses when the user wants to create/generate/scaffold a new Spring Boot project (Maven or Gradle, REST API / Web App / Spring Boot + Angular full stack).
axelixlabs/axelix
Reviews changes in sbs/starter-domain for technology-agnostic domain logic, forbidden production dependencies, and Java 11+ compatibility.
ArabelaTso/Skills-4-SE
Automatically migrate Spring MVC applications to Spring Boot.
Jeffallan/claude-skills
Builds Spring Boot 3.x services on Java 21 with domain-driven design, WebFlux, JPA tuning and Spring Security using OAuth2 and JWT, verified by Maven or Gradle builds.
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
Guides changes to the grails-data-hibernate7 module, covering domain binding, Hibernate 5 to 7 migration work, generators and integration specs.
apache/grails-core
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.
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.
Works with
Categories
Guidance for Groovy 5 work in Grails projects: syntax, closures, traits, DSLs, metaprogramming, Spock tests, static compilation and Java 21 integration. 1 development. It covers core language features such as closures, traits, GStrings, operators and Groovy Truth, metaprogramming at runtime (categories, ExpandoMetaClass, extension modules) and at compile time through AST transformations like @Immutable, @Builder, @Delegate, @Singleton, @Log and @Memoized.
Groovy 5 Developer Guide fits situations like: writing or debugging Groovy classes in a Grails application; building or fixing Gradle build scripts for a Groovy project; writing Spock specifications for unit and integration tests; migrating code from an older Groovy version to 5.1.
Run `npx skills add apache/grails-core --skill groovy-developer -a claude-code`. Or copy the skill folder (.agents/skills/groovy-developer in apache/grails-core) into .claude/skills/groovy-developer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add apache/grails-core --skill groovy-developer -a codex`. Or copy the skill folder (.agents/skills/groovy-developer in apache/grails-core) into .agents/skills/groovy-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 groovy-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/groovy-developer, .gemini/skills/groovy-developer, .github/skills/groovy-developer and .opencode/skills/groovy-developer in your project.
SKILL.md names no scripts, command-line tools or credentials: Groovy 5 Developer Guide is instructions for the agent only.
SKILL.md names 3 domains. As links in the text: groovy-lang.org, grails.apache.org and spockframework.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.
Groovy 5 Developer Guide 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 3k tokens (SKILL.md is roughly 12k 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 Groovy 5 Developer Guide: Java Rules (softspark/ai-toolkit, 179 stars), Java (ericrisco/rsc-harness, 156 stars), Progen (sivaprasadreddy/sivalabs-agent-skills, 187 stars) and Starter Domain Reviewer (axelixlabs/axelix, 147 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.