OpenRewrite is an automated refactoring engine and source-to-source migration framework. It uses a lossless semantic tree parser to represent source code as type-aware trees that preserve original whitespace and formatting, enabling precise and deterministic modifications.
The project utilizes a declarative refactoring pipeline where sequences of transformations are defined in YAML to resolve breaking changes and technical debt. It features type-aware pattern matching and cross-language model mapping to apply similar refactoring patterns across different programming languages.
The framework covers a wide range of capabilities, including automated API, dependency, and framework migrations. It provides tools for semantic code analysis, data flow tracing, and codebase-wide refactoring execution. The system also includes a recipe authoring environment with templating for code generation and a verification suite to validate transformation results.
Custom refactoring recipes can be developed, validated locally, and distributed via artifact repositories or package managers.