refactor-assistant

Identify and fix code smells while preserving behavior.

1|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/tygwan/ultra-codex-init --skill refactor-assistant-tygwan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-assistant
Source: https://github.com/tygwan/ultra-codex-init/tree/main/.codex/skills/refactor-assistant
Command: npx skills add https://github.com/tygwan/ultra-codex-init --skill refactor-assistant-tygwan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify and fix code smells to improve structure while preserving behavior.

Core Features & Use Cases

  • Refactoring Principles: small, safe changes with test preservation and clear rationale.
  • Catalog of techniques: Extract Method, Extract Class, Replace Conditional with Polymorphism, and related patterns.
  • Use Cases: clean up long methods, decompose large classes, and simplify complex conditionals in production code.

Quick Start

Explain a small, safe refactoring plan for a given code snippet and show the before/after changes.

Frequently Asked Questions about refactor-assistant

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

FAQPage Schema
How do I refactor long methods and large classes without breaking existing behavior?

Fix code smells by applying small, safe structural changes like Extract Method and Extract Class. This preserves behavior by maintaining functional equivalence and passing tests while documenting the reasoning behind each modification.

What is the best way to simplify complex conditionals in production code?

Simplify complex conditionals by applying the Replace Conditional with Polymorphism pattern. This refactoring technique improves code structure and readability while maintaining functional equivalence and ensuring tests still pass.

How do I identify code smells before starting a refactoring plan?

Identify code smells by analyzing production code for long methods, large classes, and complex conditionals. Recognizing these structural issues determines the appropriate refactoring patterns needed to safely improve the codebase.

Can I use design patterns to clean up complex conditionals across multiple modules?

Yes, you can apply design patterns like Replace Conditional with Polymorphism to clean up complex conditionals across typical software project modules. This approach applies structural improvements while maintaining functional equivalence and passing tests.

Do I need passing tests before applying refactoring techniques like Extract Class?

Yes, passing tests are a required constraint when applying refactoring techniques like Extract Class. Maintaining functional equivalence and test preservation ensures structural changes improve code quality without altering external behavior.