A systematic, AI-assisted framework for safely refactoring legacy codebases. Includes five skills: analyze-codebase, generate-tests, refactor-code, verify-changes, and design-patterns — covering the full refactoring lifecycle from analysis to deployment, with all 22 Gang of Four design patterns.
Use this skill whenever the user wants to understand, analyze, or audit a codebase before refactoring. Triggers include: "analyze this project", "what does this codebase do", "give me an overview of the code", "audit dependencies", "map the file structure", "what are the code smells", "assess code quality", "review this project", "what needs refactoring", or any request to understand a codebase before changing it. Also triggers when a user shares a project folder and wants to know where to start. Do NOT use for actually writing refactored code — use refactor-code for that.
Use this skill whenever the user wants to identify, apply, or refactor toward design patterns in their codebase. Triggers include: "apply design patterns", "identify patterns", "what patterns should I use", "refactor to strategy pattern", "apply factory method", "use observer pattern", "code smells that need patterns", "which design pattern fits", "improve architecture with patterns", "decouple this code", "make this extensible", "reduce coupling", "apply SOLID principles", or any mention of a specific GoF pattern name (Factory, Singleton, Observer, Strategy, etc.). Also triggers when the user mentions "Refactoring Guru", "Gang of Four", or "GoF patterns". Works standalone or as a companion to the refactor-code skill during Phase 3 (Transform). Do NOT use for general code analysis — use analyze-codebase for that.
Use this skill whenever the user wants to generate tests before refactoring, create a test plan, add safety net tests, lock down behavior with tests, or generate test code for existing modules. Triggers include: "generate tests", "create test plan", "add tests before refactoring", "write tests for this", "I need safety net tests", "test this module", "lock down behavior", or any request to add tests in preparation for code changes. Also use when the user asks to "prepare for refactoring" and needs the testing phase. Do NOT use for running tests or verifying test results — use verify-changes for that.
Use this skill whenever the user wants to actually refactor, rewrite, modernize, or transform existing code. Triggers include: "refactor this", "rewrite this code", "convert to hooks", "modernize this", "extract utilities", "clean up this code", "apply the refactor plan", "transform this module", or any request to change code structure while preserving behavior. Also triggers for pattern conversions like "convert class to function", "switch to async/await", "extract shared logic", or "restructure this module". Do NOT use for analysis-only tasks — use analyze-codebase for those. Do NOT use for generating tests — use generate-tests for that.
Use this skill whenever the user wants to verify refactored code, run a verification checklist, check that refactoring didn't break anything, validate changes before deployment, or assess the quality of a completed refactoring. Triggers include: "verify the refactoring", "check if everything works", "run the verification", "is the refactor safe to deploy", "validate the changes", "compare before and after", "check performance", or any request to ensure refactored code is correct and deployable. Do NOT use for writing refactored code — use refactor-code for that.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
A systematic, AI-assisted framework for safely refactoring legacy codebases.
Refactor Pilot Framework gives you a repeatable, four-phase process for using large language models (LLMs) to understand, test, transform, and verify code — turning weeks of manual refactoring into hours of guided, AI-accelerated work.
Whether you use Claude, ChatGPT, Copilot, Cursor, or any other AI coding tool, the prompts and scripts in this repo are designed to be tool-agnostic and copy-paste ready. If you use Claude Code, you can drop the included skills directly into your workflow for an even more integrated experience.
Every codebase has that one corner nobody wants to touch. The authentication module that was "temporary" three years ago. The 2,000-line utility file where six different teams dumped helper functions. The styling layer where every other rule needs !important because the cascade became a war zone. Configuration files with flags nobody remembers setting, and entire directories that only one person (who left the company) understood.
Technical debt doesn't happen overnight — it accumulates one shortcut at a time until the cost of changing anything exceeds the cost of just building around it. And now you've got a codebase that works, but nobody can confidently modify it without breaking something unexpected.
AI changes the economics of this problem. What used to require a senior developer spending days carefully tracing dependencies and hand-rewriting modules can now be done in a fraction of the time — but only if you approach it methodically. Pasting your whole codebase into a chat window and asking "fix this" is not a strategy. You need structure: understand first, protect behavior with tests, transform with a plan, then verify everything. That's the process Refactor Pilot Framework gives you.
If you have Claude Code installed, you can add the Refactor Pilot Framework marketplace and install the plugin directly from your terminal:
# Add the marketplace
/plugin marketplace add GuilhermeVozniak/refactor-pilot-framework
# Install the plugin
/plugin install refactor-pilot@refactor-pilot-marketplace
That's it. All five skills (analyze-codebase, generate-tests, refactor-code, verify-changes, design-patterns) will be available in your Claude Code sessions. Updates are pulled automatically when the marketplace is refreshed.
prompts/ directory00-define-requirements.md to establish your refactoring goals01-project-metadata.md — copy the prompt, paste it into your AI tool along with your project files03a-03d prompts for deeper analysis of specific file types./scripts/analyze-project.sh /path/to/your/project
./scripts/map-file-structure.sh /path/to/your/project
./scripts/generate-file-summaries.sh /path/to/your/project
./scripts/capture-baselines.sh /path/to/your/project
Prerequisites: Claude Code must be installed on your system.
Recommended approach — clone the full repo alongside your project:
# Clone Refactor Pilot Framework somewhere accessible
git clone https://github.com/GuilhermeVozniak/refactor-pilot-framework.git ~/refactor-pilot-framework
npx claudepluginhub guilhermevozniak/refactor-pilot-framework --plugin refactor-pilotDisciplined refactoring using small, verifiable steps based on Fowler's 'Refactoring' and Feathers' 'Working Effectively with Legacy Code'
Code cleanup, refactoring automation, and technical debt management with context restoration
Full-spectrum design patterns skill: Detect anti-patterns, diagnose architectural debt, and generate production-ready refactored code. Covers GoF, SOLID, Clean Architecture, DDD, CQRS, Microservices, and Cloud patterns.
Refactor code following best practices and design patterns
Codebase exploration, refactoring, and quality analysis
AI-powered codebase modernization assessment - Interactive audit and quick scan skills to identify technical debt, anti-patterns, and quality issues from older AI-generated code