recipe-writer

Develop OpenRewrite recipes using test-first development practices.

13|1|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/sjungling/claude-plugins --skill recipe-writer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: recipe-writer
Source: https://github.com/sjungling/claude-plugins/tree/main/plugins/openrewrite/skills/recipe-writer
Command: npx skills add https://github.com/sjungling/claude-plugins --skill recipe-writer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) and examples (resource) components.

What problem does it solve?

This Skill eliminates the complexity and guesswork from creating production-quality OpenRewrite recipes for automated code migrations and refactoring.

Core Features & Use Cases

  • Recipe Type Selection: Guides choosing between declarative YAML, Refaster templates, and imperative Java recipes.
  • Test-First Development: Implements the RED-GREEN-REFACTOR workflow for reliable recipe development.
  • Use Case: Imagine you need to migrate a large codebase from JUnit 4 to JUnit 5. Use this Skill to plan, implement, test, and validate your migration recipes.

Quick Start

Use the recipe-writer skill to help me create an OpenRewrite recipe that updates all GitHub Actions checkout actions from v2 to v4.

Frequently Asked Questions about recipe-writer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an OpenRewrite recipe for automated code refactoring?

OpenRewrite recipes use declarative YAML, Refaster templates, or imperative Java to automate code migrations and refactoring. Test-first development—writing test cases before implementing the recipe logic—ensures reliability. Plan your recipe type based on complexity, implement visitor patterns or JavaTemplate usage, and validate with RewriteTest coverage before deployment.

What's the best way to migrate a large codebase using OpenRewrite?

Use test-first development: define test cases covering your migration scenarios, implement the recipe (YAML for simple transforms, Java for complex LST manipulation), apply preconditions to target the right code, then validate across your full codebase. This RED-GREEN-REFACTOR workflow catches edge cases early and produces production-ready recipes.

Can I use OpenRewrite recipes for YAML transformations and Kubernetes manifests?

Yes. OpenRewrite recipes handle Java code refactoring, YAML transformations, Kubernetes manifests, GitHub Actions, and related declarative formats. Choose YAML recipes for straightforward structural changes or Java recipes for complex logic involving visitor patterns and LST traversal.

Do I need to write Java code to develop OpenRewrite recipes?

Not always. Declarative YAML recipes suit simple transformations. Refaster templates offer a middle ground for templated replacements. Only complex migrations requiring visitor pattern logic, JavaTemplate usage, and precondition scanning demand imperative Java—test-first practices help validate either approach.

What are the key requirements for production-quality OpenRewrite recipes?

Production recipes require comprehensive RewriteTest coverage, proper visitor pattern implementation or JavaTemplate usage, preconditions to scope transformations, robust documentation, and validated packaging for distribution. Test-first development ensures functional requirements are met and edge cases in code migrations are handled correctly.

How do I test OpenRewrite recipes before deploying them?

Use RewriteTest to write test cases covering before-and-after code transformations, edge cases, and precondition scenarios. Test-first development means writing these tests before recipe logic, running the RED-GREEN-REFACTOR cycle, and validating that your recipe produces the expected refactored output reliably.