Official agent skill

Migrate Groovy To Java

by DataDog in DataDog/dd-trace-java

Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests.

OfficialApache-2.0Auto-check passedTesting & QA

Install Migrate Groovy To Java

skills CLI
$ npx skills add DataDog/dd-trace-java --skill migrate-groovy-to-java -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install DataDog/dd-trace-java migrate-groovy-to-java --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/DataDog/dd-trace-java.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/migrate-groovy-to-java .claude/skills/migrate-groovy-to-java && rm -rf skills-src

Use ~/.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/

Facts

Skill name
migrate-groovy-to-java
GitHub stars
736
Token cost
~1.3k tokens
SKILL.md length
668 words
Files
2
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests.

  • Works in 4 steps: List all Groovy files of the current… → Convert Groovy files to Java using JUnit 5 → Make sure the tests are still passing… → …
  • Asked to migrate groovy
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Convert groovy to java

What it does

Migrate Groovy To Java is an agent skill from DataDog/dd-trace-java, published by the product's own GitHub organization. Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests. Use when asked to "migrate groovy", "convert groovy to java", "g2j", or when a module has .groovy test files that need to be replaced with .java equivalents.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `QUALITY_RULES.md`).

It sits in Testing & QA. It works with Java, JUnit, Datadog and Gradle. The repository describes itself as: Datadog APM client for Java. The licence is Apache-2.0.

When your agent uses it

  • Asked to migrate groovy
  • Convert groovy to java
  • A module has .groovy test files that need to be replaced with .java equivalents

Example prompts

  • “migrate groovy”
  • “convert groovy to java”
  • “Use the migrate-groovy-to-java skill to convert Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests”
  • “/migrate-groovy-to-java”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. List all Groovy files of the current Gradle module
  2. Convert Groovy files to Java using JUnit 5
  3. Make sure the tests are still passing after migration and that the test count has not changed
  4. Remove Groovy files

What it can do on your machine

Read from SKILL.md and the folder at commit 3eed707. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Migrate Groovy To Java loads about 1.3k tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 668 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from DataDog/dd-trace-java at commit 3eed707, republished under its Apache-2.0 licence (© DataDog). 668 words, ~1,335 tokens.

Download SKILL.mdSave it as .claude/skills/migrate-groovy-to-java/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
migrate-groovy-to-java
description
Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests. Use when asked to "migrate groovy", "convert groovy to java", "g2j", or when a module has .groovy test files that need to be replaced with .java equivalents.

Migrate test Groovy files to Java using JUnit 5

  1. List all Groovy files of the current Gradle module
  2. Convert Groovy files to Java using JUnit 5
  3. Make sure the tests are still passing after migration and that the test count has not changed
  4. Remove Groovy files

When converting Groovy code to Java code, make sure that:

  • The Java code generated is compatible with JDK 8
  • When translating Spock tests, prefer @TableTest for data rows that are naturally tabular. See detailed guidance in the "TableTest usage" section.
  • @TableTest and @MethodSource may be combined on the same @ParameterizedTest when most cases are tabular but a few cases require programmatic setup.
  • In combined mode, keep table-friendly cases in @TableTest, and put only non-tabular/complex cases in @MethodSource.
  • If @TableTest is not viable for the test at all, use @MethodSource only.
  • If @TableTest was successfully used and if the @ParameterizedTest is not used to specify the test name, @ParameterizedTest can then be removed as @TableTest replace it fully.
  • For @MethodSource, name the arguments method <testMethodName>Arguments (camelCase, e.g. testMethodArguments) and return Stream<Arguments> using Stream.of(...) and arguments(...) with static import.
  • Ensure parameterized test names are human-readable (i.e. no hashcodes); instead add a description string as the first Arguments.arguments(...) value or index the test case
  • When converting tuples, create a light dedicated structure instead to keep the typing system
  • Instead of checking a state and throwing an exception, use JUnit asserts
  • Instead of using assertTrue(a.equals(b)) or assertFalse(a.equals(b)), use assertEquals(expected, actual) and assertNotEquals(unexpected, actual)
  • Import frequently used types rather than using fully-qualified names inline, to improve readability
  • Do not wrap checked exceptions and throw a Runtime exception; prefer adding a throws clause at method declaration
  • Do not mark local variables final
  • Ensure variables are human-readable; avoid single-letter names and pre-define variables that are referenced multiple times
  • When translating Spock Mock(...) usage, use libs.bundles.mockito instead of writing manual recording/stub implementations
  • Replace injectSysConfig(key, value) calls with @WithConfig when the key and value are static literals. Put it on the test method for per-test config, or on the class when every test needs it. The dd. prefix is added automatically — use the bare key (e.g. "trace.scope.strict.mode", not "dd.trace.scope.strict.mode"). For dynamic or parameterized values, keep the imperative WithConfigExtension.injectSysConfig(key, value) call.
  • Keep inline comments
  • Migrate the named Spock clauses if they exist as inline comments in the Java unit test
  • When Groovy tests navigate a JSON request body through helpers like asMap() / asLong() / asList(), check whether json-unit-assertj (libs.json.unit.assertj) is already in the module's build file. If it is, add a method that returns the raw JSON string and use assertThatJson(json).node("some.nested.field").isEqualTo(value) directly instead of the map traversal.
  • Groovy's [key: val] map literals use a LinkedHashMap. When the test doesn't care about insertion order, use singletonMap for a single entry or HashMap for two or more. If a helper method builds these maps, add a two-arg overload rather than scattering new LinkedHashMap<>() constructions through test bodies.
  • The Spock construct clean: section needs to wrap the unit test with a try...finally block to respect the behavior.
Show full SKILL.md (165 more words)Show less

TableTest usage Import: import org.tabletest.junit.TableTest;

JDK 8 rules: - No text blocks. - @TableTest must use String[] annotation array syntax: @TableTest({ "a | b", "1 | 2" })

Spock where: → @TableTest: - First row = header (column names = method parameters). - Add scenario column as first column (display name, not a method parameter). - Use | delimiter; align columns so pipes line up vertically. - Prefer single quotes for strings with special chars (e.g., 'a|b', '[]'). - Blank cell = null (object types); '' = empty string. - Collections: [a, b] = List/array, {a, b} = Set, [k: v] = Map.

Mixed eligibility: - Prefer combining @TableTest + @MethodSource on one @ParameterizedTest when only some cases are complex. - Use @MethodSource only when tabular representation is not practical for the test.

Do NOT use @TableTest when: - Majority of rows require complex objects or custom converters.

Quality rules (apply during generation)

Before writing any Java output, read .claude/skills/migrate-groovy-to-java/QUALITY_RULES.md in full. Apply all BLOCKER rules unconditionally. Apply WARNING rules unless they require creating utility classes that do not yet exist. Apply STYLE rules where they improve clarity without added complexity.

© DataDog, 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

Files

SKILL.md and 1 other file in .agents/skills/migrate-groovy-to-java of DataDog/dd-trace-java.

  • SKILL.md
  • QUALITY_RULES.md

Open the folder on GitHubat commit 3eed707

Compare with similar skills

Migrate Groovy To Java 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.

Migrate Groovy To Java compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Migrate Groovy To Java this skillDataDog/dd-trace-java736—~1.3kAutomated safety check: PassApache-2.0
Incremental Java ProgrammerArabelaTso/Skills-4-SE253—~2.8kAutomated safety check: PassApache-2.0
Java 21 Developer Guide for Grailsapache/grails-core2.9k—~1.9kAutomated safety check: PassApache-2.0
Java ArchitectJeffallan/claude-skills12k—~1.5kAutomated safety check: PassMIT
Jvm Helpershepherdjerred/monorepo112—~1.9kAutomated safety check: PassGPL-3.0
Java Rulessoftspark/ai-toolkit179—~3.1kAutomated safety check: PassApache-2.0

Similar skills

  • Incremental Java Programmer

    ArabelaTso/Skills-4-SE

    Incrementally implement new features in Java repositories from natural language descriptions.

    253 GitHub stars~2.8k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • 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.

    2.9k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Java Architect

    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.

    12k GitHub stars~1.5k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Jvm Helper

    shepherdjerred/monorepo

    Current Java, Kotlin, Gradle, Maven, JUnit, JVM diagnostics, packaging, and performance guidance.

    112 GitHub stars~1.9k tokensUpdated today
    MobileAuto-check passed
  • Java Rules

    softspark/ai-toolkit

    Java coding rules: style, patterns, security, testing. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~3.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Add Gc Test

    DataDog/jmxfetch

    Official

    Add integration tests to TestGCMetrics.java for new GC collector support added to new-gc-default-jmx-metrics.yaml.

    109 GitHub stars~1.1k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed

More from DataDog/dd-trace-java

All 9 skills in this repo
  • Apm Integrations

    DataDog/dd-trace-java

    Official

    Write a new library instrumentation end-to-end. An agent skill from DataDog/dd-trace-java.

    736 GitHub stars~3.7k tokensUpdated today
    Auto-check: notes
  • Perf Review

    DataDog/dd-trace-java

    Official

    Performance-overhead review of a code diff / branch / PR for the dd-trace-java tracer.

    736 GitHub stars~3.6k tokensUpdated today
    Auto-check: notes
  • Resolve Muzzle CI

    DataDog/dd-trace-java

    Official

    Diagnose and resolve dd-trace-java CI failures from a module's muzzle task or the runMuzzle aggregate.

    736 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Fix Continuation Leakage

    DataDog/dd-trace-java

    Official

    Diagnose and fix scope or continuation lifecycle failures in dd-trace-java instrumentation tests.

    736 GitHub stars~1.6k tokensUpdated today
    Auto-check: notes
  • Techdebt

    DataDog/dd-trace-java

    Official

    Review a code diff / branch / PR for technical debt — code duplication, unnecessary complexity / over-engineering, and redundant or dead code.

    736 GitHub stars~565 tokensUpdated today
    Auto-check: notes
  • Clarify Java Comments

    DataDog/dd-trace-java

    Official

    Clarify or review Java Javadocs, Javadoc tags, and explanatory code comments for legibility, accuracy, and source alignment.

    736 GitHub stars~2.3k tokensUpdated today
    Auto-check: notes

Categories

Questions about Migrate Groovy To Java

What does Migrate Groovy To Java do?

Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests. Migrate Groovy To Java is an agent skill from DataDog/dd-trace-java, published by the product's own GitHub organization. Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests.

When should I use Migrate Groovy To Java?

Migrate Groovy To Java fits situations like: asked to migrate groovy; convert groovy to java; A module has .groovy test files that need to be replaced with .java equivalents.

How do I install Migrate Groovy To Java in Claude Code?

Run `npx skills add DataDog/dd-trace-java --skill migrate-groovy-to-java -a claude-code`. Or copy the skill folder (.agents/skills/migrate-groovy-to-java in DataDog/dd-trace-java) into .claude/skills/migrate-groovy-to-java in your project. Claude Code loads it when a task matches its description.

How do I install Migrate Groovy To Java in Codex?

Run `npx skills add DataDog/dd-trace-java --skill migrate-groovy-to-java -a codex`. Or copy the skill folder (.agents/skills/migrate-groovy-to-java in DataDog/dd-trace-java) into .agents/skills/migrate-groovy-to-java in your project. Codex loads it when a task matches its description.

Can I use Migrate Groovy To Java in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add DataDog/dd-trace-java --skill migrate-groovy-to-java -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/migrate-groovy-to-java, .gemini/skills/migrate-groovy-to-java, .github/skills/migrate-groovy-to-java and .opencode/skills/migrate-groovy-to-java in your project.

What does Migrate Groovy To Java need to run?

SKILL.md names no scripts, command-line tools or credentials: Migrate Groovy To Java is instructions for the agent only.

Does Migrate Groovy To Java access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Migrate Groovy To Java safe to install?

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.

What licence does Migrate Groovy To Java use?

Migrate Groovy To Java is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Migrate Groovy To Java use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Migrate Groovy To Java?

Skills that share tags, products or a category with Migrate Groovy To Java: Incremental Java Programmer (ArabelaTso/Skills-4-SE, 253 stars), Java 21 Developer Guide for Grails (apache/grails-core, 2.9k stars), Java Architect (Jeffallan/claude-skills, 12k stars) and Jvm Helper (shepherdjerred/monorepo, 112 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Migrate Groovy To Java?

DataDog (a GitHub organization, an official publisher) maintains it in DataDog/dd-trace-java, which has 736 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 8, 2026.

Source: DataDog/dd-trace-java on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.