gof-refactor

Generate phased GoF pattern migration plans without writing code.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/mikecubed/agent-orchestration --skill gof-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gof-refactor
Source: https://github.com/mikecubed/agent-orchestration/tree/main/plugins/patterns/skills/gof-refactor
Command: npx skills add https://github.com/mikecubed/agent-orchestration --skill gof-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Produces phased, safe refactoring plans to introduce or fix GoF patterns in an existing codebase. It helps you migrate to or from patterns such as Strategy, State, Decorator, or Singleton without writing the refactored code.

Core Features & Use Cases

  • Phased migration planning: generates multiple, independently verifiable phases that keep the system working.
  • Targeted refactoring guidance: aligns changes to a defined source and a specified target GoF pattern.
  • Design-rule adherence: avoids design questions without a codebase context and routes to the appropriate GoF advisor/evaluator.

Quick Start

Provide the source file or directory and the target GoF pattern to generate a safe, multi-phase refactor plan.

Frequently Asked Questions about gof-refactor

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

FAQPage Schema
How do I plan a safe migration to a GoF design pattern without breaking my existing codebase?

A safe GoF pattern migration requires a phased refactoring plan that keeps the system working at each stage. You generate multiple independently verifiable phases to transition code safely without writing the refactored code.

What is the best way to refactor code to use the Strategy or State pattern?

Refactoring to the Strategy or State pattern involves aligning changes to a defined source and target pattern. You produce a multi-phase migration plan with a minimum of three phases to ensure safe, verifiable transitions.

Can I use this to generate the actual refactored code for a Decorator pattern migration?

No, this approach generates safe refactoring plans for GoF pattern migrations but does not write the refactored code. It explicitly separates planning from execution to keep the migration process safe and verifiable.

What do I need to provide to create a refactoring plan for a GoF pattern migration?

You need to provide the source file or directory and the target GoF pattern. This allows the system to generate a detailed, multi-phase migration plan tailored to your specific codebase context.

Why does my refactoring plan need multiple phases for a Singleton or Decorator pattern migration?

Multiple phases ensure the system remains operational and independently verifiable during the migration. A minimum of three phases keeps the refactoring safe by separating structural changes across manageable steps.

When should I not use a phased refactoring plan for design pattern migration?

You should not use a phased refactoring plan if you need the actual refactored code written out, or if you lack a defined source pattern and target GoF pattern in your codebase context.