Skip to content

openrewrite/rewrite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11,290 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenRewrite Logo

ci Apache 2.0 Maven Central Revved up by Develocity Contributing Guide

Fast, repeatable refactoring for developers

The OpenRewrite project (managed by Moderne) is an open-source automated refactoring ecosystem for source code, enabling developers to effectively eliminate technical debt within their repositories.

It consists of an auto-refactoring engine that runs prepackaged, open source refactoring recipes for common framework migrations, security fixes, and stylistic consistency tasks—reducing your coding effort from hours or days to minutes.

OpenRewrite provides open-source parsers and base recipes for multiple languages, including Java, Kotlin, Groovy, JavaScript/TypeScript, Python, and C#. For Java, the OpenRewrite Gradle Plugin and OpenRewrite Maven Plugin let you run one recipe at a time against a single repository. Recipes are easy to customize, so you can adapt any of them - or even write your own.

Start with our quickstart guide and let OpenRewrite handle the boring parts of software development for you.

Get and stay informed:

OpenRewrite is maintained by Moderne. The core framework is Apache2 licensed and will always be open source, as are many recipes in the catalog. See Licensing for how the framework and recipes are licensed.

Building on OpenRewrite with Moderne

OpenRewrite is built to migrate, secure, and refactor code one repository at a time. Moderne is the commercial platform built on that foundation, running the same recipes across hundreds or thousands of repositories at once. Migrations are a common starting point with OpenRewrite, and the platform expands on this to include large-scale impact analysis, security remediation, and the tools coding agents use to understand and change code across a whole organization. Moderne also extends OpenRewrite from Java to additional languages and from individual developers to teams and coding agents. While the parsers and base recipes for those additional languages are open source, running recipes against them requires a Moderne license.

A lot of this comes down to how the Lossless Semantic Tree (LST) is handled. The LST is OpenRewrite's type-aware model of your source code, built in memory each time a recipe runs. Moderne batch-builds LSTs once and serializes them, so they can be reused across repos and across teams without rebuilding. That same LST gives coding agents pre-computed context, type-aware search, and direct access to OpenRewrite recipes as deterministic tool calls through tools like Prethink, Trigrep, and a local MCP server. Agents work with less token overhead and more accuracy than they would reading a codebase file by file.

See how Moderne and OpenRewrite work in different ways to transform your code:

Moderne

Moderne also includes a multi-repo command line interface (CLI) for building LSTs, running recipes locally, and developing custom recipes across many repositories.

Moderne

Moderne runs a free public service for the benefit of tens of thousands of open source projects. To learn more about how Moderne can help your team, contact us.

Contributing

We appreciate all types of contributions. See the contributing guide for detailed instructions on how to get started.