openrewrite

openrewrite is a skill for Claude Code from motlin/claude-code-plugins. It costs 11 tokens per session (3,322 once invoked), scanned A, original, Apache-2.0.

A set of guidelines for maintaining tests for OpenRewrite recipes, which are automated Java code transformations. It covers test failures caused by import order, type checks, and editor warnings.

In plain words
What is it for?
Use it when fixing OpenRewrite recipe tests, validating generated Java code, or writing broader tests for transformation rules.
Why use it?
It helps distinguish formatting or import-order differences from real transformation bugs, so recipe tests can be corrected efficiently.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the java plugin — 6 skills shipped together

Good fit Use it when fixing OpenRewrite recipe tests, validating generated Java code, or writing broader tests for transformation rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/motlin/claude-code-plugins/openrewrite
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add motlin/claude-code-plugins --skill openrewrite
Clone the repo
git clone --depth 1 https://github.com/motlin/claude-code-plugins

Made for: Claude Code.

Or install java, the plugin that ships this one along with the rest of its 6 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for openrewrite

README.md
[![agentmods](https://agentmods.dev/badge/skills/motlin/claude-code-plugins/openrewrite/github.svg)](https://agentmods.dev/skills/motlin/claude-code-plugins/openrewrite)
Your own site
<a href="https://agentmods.dev/skills/motlin/claude-code-plugins/openrewrite"><img src="https://agentmods.dev/badge/skills/motlin/claude-code-plugins/openrewrite/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for openrewrite

Your own site · 80×15
<a href="https://agentmods.dev/skills/motlin/claude-code-plugins/openrewrite"><img src="https://agentmods.dev/badge/skills/motlin/claude-code-plugins/openrewrite.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,322 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.03322
Opus 5.5 $0.00004 $0.01329
Sonnet 5.5 $0.00002 $0.00664
Haiku 4.5 $0.00001 $0.00332

Measured 1mo ago against content hash 5db085a61054, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

openrewrite scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/java/skills/openrewrite/SKILL.md · 420 lines

How it starts

The opening of the file, as written. The whole thing — 420 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenRewrite Recipes

MethodMatcher

Use wildcards instead of enumerating methods

// BAD: separate matcher per variant
private static final MethodMatcher IS_TRACE_ENABLED = new MethodMatcher("org.slf4j.Logger isTraceEnabled()");
private static final MethodMatcher IS_DEBUG_ENABLED = new MethodMatcher("org.slf4j.Logger isDebugEnabled()");
// ... repeated for info, warn, error, plus marker overloads = 10 matchers

// GOOD: single wildcard matcher
private static final MethodMatcher IS_X_ENABLED = new MethodMatcher("org.slf4j.Logger is*Enabled(..)");

This also simplifies Preconditions.check():

// BAD
Preconditions.check(or(
    new UsesMethod<>(IS_TRACE_ENABLED),
    new UsesMethod<>(IS_DEBUG_ENABLED),
    // ... 8 more
), visitor);

// GOOD
Preconditions.check(new UsesMethod<>(IS_X_ENABLED), visitor);

Use MethodMatcher for method+type validation

Instead of manually checking method name and receiver type:

// BAD
if (!"getMessage".equals(method.getSimpleName())) return false;
Expression select = method.getSelect();
if (select == null) return false;
return TypeUtils.isAssignableTo("java.lang.Throwable", select.getType());

// GOOD
private static final MethodMatcher GET_MESSAGE = new MethodMatcher("java.lang.Throwable getMessage()");
// then: GET_MESSAGE.matches(argument)

TypeUtils

Use isOfClassType() instead of manual FQN comparison

// BAD
JavaType.FullyQualified type = TypeUtils.asFullyQualified(select.getType());
return type != null && "org.slf4j.Logger".equals(type.getFullyQualifiedName());

// GOOD
TypeUtils.isOfClassType(select.getType(), "org.slf4j.Logger")

Use TypeUtils.isOfType() instead of FQN string equality

// BAD
currentType.getFullyQualifiedName().equals(targetType.getFullyQualifiedName())

// GOOD
TypeUtils.isOfType(currentType, targetType)

Handle inheritance with isAssignableTo()

When matching a member's declaring type against the current class, check both exact match and subtype. Otherwise inherited members get attributed to the superclass:

Read the full file on GitHub · 420 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +92 lines 5db085a61054
  2. 1mo ago Changed · +254 lines · -21 tokens per session dec4a4670b9b
  3. 2mo ago Changed · -149 lines 487a12dbaced
  4. 2mo ago Changed b55222a6bd6a
  5. 3mo ago First seen · 223 lines · 32 tokens per session scan A 13f0dcff0bdd

Subscribe to this mod's changes

openrewrite is a skill published in the GitHub repository motlin/claude-code-plugins (20 stars, last pushed 2d ago), licensed Apache-2.0. It adds 11 tokens to every session and 3,322 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

Related

openrewrite compared with skills from other repositories

openrewrite next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
openrewritemotlin/claude-code-pluginsSkill202d agoApache-2.0A11Claude Code
rust-testingaffaan-m/ECCSkill317k3d agoMITA31Claude Code, Kiro
golang-testingaffaan-m/ECCSkill317k3d agoMITA37Claude Code, Kiro
java-affected-testsopen-metadata/OpenMetadataSkill16ktodayApache-2.0A120Claude Code
migrate-xunit-to-xunit-v3dotnet/skillsSkill6.5ktodayMITA149Claude Code
golang-testingsamber/cc-skills-golangSkill4.1k3d agoMITA115Claude Code
adk-setupgoogle/adk-pythonSkill23ktodayApache-2.0C146Claude Code, Codex