refactor-suggestion

Analyze code to identify smells and suggest refactoring steps with examples.

Updated Jan 31, 2026
One-click install
npx skills add https://github.com/ddsyasas/pomodoro-app-shared --skill refactor-suggestion-ddsyasas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-suggestion
Source: https://github.com/ddsyasas/pomodoro-app-shared/tree/main/pomodoro-app/.claude/skills/refactor-suggestion
Command: npx skills add https://github.com/ddsyasas/pomodoro-app-shared --skill refactor-suggestion-ddsyasas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers identify and propose targeted refactoring to improve readability, reduce complexity, and lower maintenance costs by adhering to Clean Code principles.

Core Features & Use Cases

  • Identify Code Smells: Detect long methods, large classes, duplicated logic, and tight coupling.
  • Suggest Refactor Patterns: Recommend Extract Method, Rename, Extract Class, Replace Conditional with Polymorphism, and other patterns.
  • Contextual Guidance: Provide concrete steps, rationale, and code examples tailored to the language and architecture.
  • Use Case: When code is hard to modify after features are added, ask this skill to surface actionable refactor steps and representative snippets.

Quick Start

Analyze the target file or snippet to surface actionable refactor opportunities and generate a step-by-step plan.

Frequently Asked Questions about refactor-suggestion

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

FAQPage Schema
How do I identify code smells and decide what to refactor?

Code smells like long methods, large classes, and tight coupling indicate where to refactor. Analyze messy code sections to detect these issues, then select appropriate refactoring patterns to reduce complexity and improve maintainability.

What is the best way to refactor a long method with duplicated logic?

The best way to refactor a long method with duplicated logic is applying the Extract Method pattern. This involves identifying distinct functional blocks within the messy method, extracting them into separate well-named methods, and replacing the original code with calls to these new methods.

How do I apply refactoring patterns to improve code quality after adding features?

To apply refactoring patterns after adding features, analyze the hard-to-modify sections to surface actionable refactor steps. Use patterns like Replace Conditional with Polymorphism or Extract Class, following concrete steps and code examples to systematically lower maintenance costs.

Can I get language-specific refactoring guidance for my codebase?

Yes, you can get contextual refactoring guidance. The analysis provides concrete steps, rationale, and example snippets tailored to your specific programming language and architecture, ensuring the refactoring patterns are correctly applied across different projects.

When do I need to use the Extract Class refactoring pattern?

You need to use the Extract Class pattern when a single class has grown too large and taken on multiple responsibilities. This refactoring separates distinct responsibilities into new classes to reduce tight coupling and adhere to Clean Code principles.

What are the limitations of automated refactoring suggestions for legacy code?

Automated refactoring suggestions require readable input code to detect smells and propose patterns like Rename or Extract Method. Limitations include handling deeply tightly coupled legacy architectures where isolated pattern application is insufficient without broader architectural changes.