All posts
#openrewrite#java#modernization#github-copilot#live-coding

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.

March 19, 20263 min read

Project Source

Explore prompts, instructions, and examples used in the live modernization workflow.

Open Working Repository
Session Timeline

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.

Tim te Beek

Co-Speaker

Tim te Beek

Staff Software Engineer at Moderne / OpenRewrite

Tim joined the session to walk through how OpenRewrite recipes work in practice and why structural refactoring gives you much more control than ad-hoc code generation.

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.

  • 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.

Comments