review-groovy-migration

Reviews migrated Java test files against shared quality rules and reports findings by severity.

735|355|Updated Apr 24, 2017
One-click install
npx skills add https://github.com/DataDog/dd-trace-java --skill review-groovy-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: review-groovy-migration
Source: https://github.com/DataDog/dd-trace-java/tree/main/.agents/skills/review-groovy-migration
Command: npx skills add https://github.com/DataDog/dd-trace-java --skill review-groovy-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

After migrating Groovy tests to Java, subtle quality regressions (weakened assertions, wrong types, lost config) slip through. This Skill systematically checks migrated Java test files against a shared rule set so violations are caught before merge.

Core Features & Use Cases

  • Rule-based detection: Runs grep-based checks for rules like RULE-C01, RULE-F01, and RULE-C05, plus LLM-based structural checks for rules without grep patterns.
  • Structured findings: Emits FINDING blocks with file, line, rule, severity (BLOCKER/WARNING/STYLE), excerpt, and suggested fix, grouped by severity.
  • Auto-fix workflow: Offers to automatically fix BLOCKERs and WARNINGs, runs spotlessApply per module, and re-verifies with grep.
  • Use Case: After running a Groovy-to-Java test migration on a branch, invoke this Skill to audit all newly added src/test/java files and fix blocker-level issues before opening a pull request.

Quick Start

Review the Java test files migrated on my current branch against the quality rules and fix any blockers and warnings.

Frequently Asked Questions about review-groovy-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review migrated Java test files for quality issues?

Run this Skill after a Groovy-to-Java migration. It loads the shared QUALITY_RULES.md, detects target files via git diff against the merge base, runs grep and structural checks, and reports findings grouped by severity.

How does the skill find which test files to review?

It uses git merge-base against origin/master and lists added files matching src/test/java paths. If none are found, it falls back to modified test files, or you can specify files or a module path directly.

Can it automatically fix the violations it finds?

Yes. After reporting, it offers to fix all BLOCKERs and WARNINGs, runs ./gradlew spotlessApply on each edited module, then re-runs the grep checks to confirm the findings are resolved.

What kinds of issues does the review detect?

It detects weakened assertions like assertTrue with instanceof, int-typed sampling priorities, overly permissive Mockito matchers, LinkedHashMap usage, and style issues, each mapped to a rule ID with BLOCKER, WARNING, or STYLE severity.

Why do some grep-based findings need manual context verification?

Rules like RULE-F01 and RULE-C05 can match legitimate code, such as matchers for genuinely non-deterministic values. The Skill reads the full file and cross-checks the Groovy source before flagging these as violations.