code-smells

Identify code smells and apply structured refactorings during PR reviews.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/mechemsi/claude-template --skill code-smells-mechemsi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-smells
Source: https://github.com/mechemsi/claude-template/tree/main/skills/code-smells
Command: npx skills add https://github.com/mechemsi/claude-template --skill code-smells-mechemsi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Code smells are subtle design issues that hinder readability, maintainability, and evolution of a codebase; this Skill maps common smells to targeted refactorings to guide improvement.

Core Features & Use Cases

  • Defines a catalog of common smells (Long Method, Large Class, Long Parameter List, Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Magic Literals, Switch Statements, Shotgun Surgery, Divergent Change, Lazy Class, Dead Code, Speculative Generality, Comments) and their recommended refactorings (e.g., Extract Method, Extract Class/Module, Rename, Move Method).
  • Provides concrete examples and decision rules to help PR reviews, design discussions, and incremental refactors.
  • Serves as a reference during code reviews to quickly identify where to apply structural improvements.

Quick Start

Review a PR against the listed smells and apply the corresponding refactorings using the examples as a practical guide.

Frequently Asked Questions about code-smells

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

FAQPage Schema
How do I identify code smells during a PR review?

Identify code smells during a PR review by checking the submission against a catalog of common structural issues like Long Method, Large Class, and Duplicated Code. This skill provides concrete examples and decision rules to quickly spot maintainability issues in your codebase.

What is the best way to refactor long methods and large classes?

The best way to refactor long methods and large classes is to apply targeted techniques like Extract Method and Extract Class. This skill maps these specific code smells to actionable refactorings to improve software design and readability.

How do I fix feature envy and shotgun surgery in legacy code?

Fix feature envy and shotgun surgery in legacy code by applying Move Method and Move Field refactorings. This skill guides incremental structural improvements to address these specific smells during legacy codebase maintenance.

Does this refactoring technique work across different programming languages?

Yes, this refactoring technique works across different programming languages. The skill is applicable across languages whenever modules grow, methods become large, or related data moves together during feature additions and maintenance.

What are common code smells that hinder software maintainability?

Common code smells that hinder software maintainability include Long Parameter List, Primitive Obsession, Data Clumps, Magic Literals, and Dead Code. This skill defines a catalog of these subtle design issues and maps them to targeted refactorings.