refactoring-specialist

Refactor code to improve structure and reduce complexity using test-driven techniques.

30|7|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/saeed-vayghan/gemini-agent-skills --skill refactoring-specialist-saeed-vayghan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-specialist
Source: https://github.com/saeed-vayghan/gemini-agent-skills/tree/main/.gemini/skills/refactoring-specialist
Command: npx skills add https://github.com/saeed-vayghan/gemini-agent-skills --skill refactoring-specialist-saeed-vayghan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill addresses the challenge of improving code quality, reducing complexity, and enhancing maintainability through systematic and safe refactoring techniques.

Core Features & Use Cases

  • Code Smell Detection: Identifies common issues like long methods and large classes.
  • Refactoring Pattern Application: Implements established patterns like Extract Method and Replace Conditional with Polymorphism.
  • Test-Driven Refactoring: Ensures behavior preservation through comprehensive testing.
  • Use Case: Refactor a legacy codebase with high cyclomatic complexity and significant code duplication into a more modular and maintainable structure.

Quick Start

Use the refactoring specialist skill to analyze and improve the provided code snippet for better structure and readability.

Frequently Asked Questions about refactoring-specialist

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

FAQPage Schema
How do I refactor legacy code to reduce high cyclomatic complexity?

Refactoring legacy code with high cyclomatic complexity involves analyzing code smells and applying established patterns to transform the structure into a modular, maintainable design.

What is the best way to ensure behavior preservation during code transformation?

Ensuring behavior preservation during code transformation requires test-driven refactoring techniques, which validate that the software design changes do not alter the original functional logic.

How do I identify code smells like long methods and large classes?

Identifying code smells like long methods and large classes is the first step in this Skill's process, utilizing systematic analysis to detect common structural issues before applying refactoring patterns.

Can I use test-driven development to safely apply refactoring patterns?

Yes, you can use test-driven development to safely apply refactoring patterns, as this Skill integrates automated testing practices to enforce safety and behavior preservation throughout the code transformation.

When do I need to apply established refactoring patterns like Extract Method?

You need to apply established refactoring patterns like Extract Method when code smell detection reveals structural degradation, allowing you to reduce complexity and improve overall code quality systematically.