Repo of the Day
openrewrite/rewrite
Published: Nov 3, 2026
Open repository ↗Automated mass refactoring of source code
Summary
OpenRewrite is an open-source ecosystem for automated, repeatable source-code refactoring, built around prepackaged recipes for framework migrations, security fixes, and stylistic consistency. The repository is written in Java and provides a type-aware model called the Lossless Semantic Tree (LST), which is built in memory when a recipe runs.
What it is useful for
OpenRewrite is useful when an engineer needs to make the same structural change across many source files without editing each file manually. Typical examples include applying a framework migration, applying a security-related recipe, or bringing code into stylistic consistency across a repository.
Recipes operate over OpenRewrite’s LST representation rather than treating source as plain text. The README lists parsers and base recipes for Java, Kotlin, Groovy, JavaScript/TypeScript, Python, and C#. Recipes are also customizable, so teams can adapt an existing recipe or implement their own transformation.
The core workflow is repository-oriented: Java developers can run one recipe at a time against a single repository through the OpenRewrite Gradle Plugin or Maven Plugin. The README presents broader operations—such as running across hundreds or thousands of repositories, reusing serialized LSTs, organization-wide impact analysis, and certain agent tools—as capabilities of the commercial Moderne platform rather than the basic OpenRewrite workflow.
How engineers can use it
Start by selecting a documented recipe for the migration, fix, or consistency change you need. For a Java codebase, the documented integration points are the Gradle and Maven plugins; each can run a recipe against one repository. Review the resulting source changes in the same way you would review any other automated refactoring, then use the recipe documentation to configure or customize its behavior.
The README does not include copy-paste installation or execution commands, so engineers should follow the OpenRewrite quickstart guide for current setup instructions. The documentation is the main reference for supported languages, plugin configuration, recipes, and the LST model.
For contributors, the repository points to a separate contributing guide. Licensing also needs attention: the repository metadata identifies Apache-2.0, while the README describes a tiered model covering the framework, parsers, and recipes. Check the licensing documentation, especially before using proprietary Moderne recipes or redistributing components.