refactoring-playbook

Migrates Java Spring Boot anti-patterns to canonical patterns through step-by-step green-bar refactorings.

Updated Jun 25, 2026
One-click install
npx skills add https://github.com/oriddd/ai-toolkit --skill refactoring-playbook-oriddd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-playbook
Source: https://github.com/oriddd/ai-toolkit/tree/main/copilot/public/skills/refactoring-playbook
Command: npx skills add https://github.com/oriddd/ai-toolkit --skill refactoring-playbook-oriddd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Legacy Spring Boot codebases accumulate anti-patterns like scattered @Value fields, RestTemplate calls, hand-rolled retry loops, and anaemic services that are risky to change. This Skill provides safe, mechanical, test-preserving migration recipes so each refactor keeps the build green. ## Core Features & Use Cases - 15 step-by-step migrations: Covers @Value to @ConfigurationProperties records, if/else dispatch to Strategy + Handler, RestTemplate to RestClient with Resilience4j, anaemic services to DDD aggregates, @MockBean sprawl to @TestConfiguration boundary fakes, Hibernate auto-DDL to Flyway, and more. - Green-bar discipline: Every migration is sequenced so tests stay passing after each commit, with rules like one refactor per PR and behavior-pinning tests first. - Use Case: During a quality review you find a service with five @Value fields and a hand-rolled retry loop. Follow playbook sections 1 and 5 to introduce a properties record and Resilience4j @Retry, shipping each as a small reviewable PR. ## Quick Start Apply the refactoring playbook to migrate the RestTemplate calls in my FooService to a RestClient-based client with Resilience4j retry.

Frequently Asked Questions about refactoring-playbook

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

FAQPage Schema
How do I replace @MockBean in every Spring Boot test?

Create a ComponentTestConfiguration with @Profile("component-test") and @Primary fake beans that branch on inputs to drive success, forbidden, and not-found cases. Replace @MockBean declarations with @Import of that configuration and reset mocks in @AfterEach where needed.