AI Assisted Java Modernization: Building OpenRewrite Recipes with Tim te Beek
What I took away from this session with Tim te Beek: OpenRewrite becomes especially powerful when AI is used to help build deterministic, testable recipes instead of making uncontrolled code changes.
Project Source
Explore prompts, instructions, and examples used in the live modernization workflow.
Open Working RepositorySession Timeline
- 00:00Introduction
- 05:26Moderne CLI Skills
- 11:20Prompts to modernize the app
- 12:33Bad first try of Prompt No. 1
- 26:10Rewriting Prompt No. 1
- 35:55Exploring the Create-Recipe Skill
- 47:15AI-generated composite recipe results
- 58:18OpenRewrite's do-no-harm policy
- 01:01:37Executing a dry run
- 01:08:50Refactoring Prompt No. 2 for custom recipes
- 01:15:55Looking through comments
- 01:21:40Different kinds of prompting
- 01:34:00Results of AI-created imperative recipes
- 01:58:10Conclusion
In this session I was joined by Tim te Beek from Moderne / OpenRewrite, and the big idea was refreshingly practical: use AI to help build structured OpenRewrite recipes, not to make random edits and hope they work.
That difference is what made the whole workflow interesting to me. The result is something deterministic, reviewable, and reproducible.
What I Learned
1. The Moderne CLI Skills are already useful
This was probably the first pleasant surprise. There are already dedicated Moderne CLI Skills for helping AI use existing recipes or create new ones, and they worked better than I expected.
Instead of interacting with the model in a vague way, the skills give it structure and constraints. That made the workflow feel much more disciplined and much less like guesswork.
2. Imperative recipes are hard to write by hand
This became very clear during the session. Imperative recipes written in Java are powerful, but they are not something I would casually want to author from scratch under time pressure.
That is where the AI-assisted workflow felt strongest. With the right skills in place, it could generate the recipe and the tests around it, and that worked smoothly on the first try.
That was a big takeaway for me: AI is especially helpful when the manual version of the task is tedious, detailed, and easy to get wrong.
3. Custom recipes are valuable when you need repeatable modernization
This is the part that makes the approach useful beyond a demo.
Custom recipes are a great fit when:
- you want a very deterministic change in an existing system
- you want to modernize many projects that all share the same kind of problem
That is where OpenRewrite really stands out. You define the transformation once, review it properly, and then apply it repeatedly across repositories without drifting into inconsistent manual fixes.
Why This Approach Works
One of the strongest points in the session was the contrast with fragile text-based refactoring.
OpenRewrite works on a structured model of the code, including its lossless semantic tree. That means the change logic is based on the actual code structure, not on brittle regex-style replacements.
For modernization work, that is exactly what I want: less guessing, more control.
Useful Links
-
Moderne CLI Skills
The instruction files used to guide the AI when creating or composing recipes. -
Prompts to modernize the app
The prompts we used during the session to drive the modernization workflow. -
Moderne CLI documentation
The best place to start if you want to try the CLI yourself. -
Wispr Flow
Voice dictation tooling that can speed up writing prompts and notes. -
obra/superpowers
Extra tooling and workflow ideas around AI-assisted development. -
Conductor
Documentation for another tool in the structured AI workflow space.
Final Thought
What stayed with me most is that AI becomes much more useful when it works inside a controlled modernization workflow.
For me, the session made three things very clear: the existing skills are already good, imperative recipes are exactly the kind of hard work where AI helps a lot, and custom recipes are a strong solution when you need the same safe transformation across many projects.