Smells

From SDiamante13/dotfiles · View interactive version

Smells is an AI agent skill from the GitHub repository SDiamante13/dotfiles. Analyze a class or module for code smells and produce a prioritized refactoring plan. Use when the user asks for code smell analysis, says `/smells`, or runs `/refactor:smells`.

How to use this skill

Skill file

Analyze the provided class for code smells and create a refactoring plan.

Usage

/smells $ARGUMENTS

Analysis Output

📊 Code Smell Analysis for: $ARGUMENTS

🔍 Top 5 Code Smells Detected:
  1. Poor Naming Conventions
  1. Long Method
  1. Large Class (God Object)
  1. Duplicate Code
  1. Feature Envy

📋 Refactoring Plan

Phase 1: Name Refactoring (No Behavior Changes)
Phase 2: Structure Improvements
Phase 3: Implementation Order
  1. Start with naming - Low risk, high readability impact
  2. Extract methods - Reduce complexity incrementally
  3. Remove duplication - Create reusable components
  4. Reorganize classes - Move methods to appropriate classes
  5. Split large classes - Final structural improvements

🎯 Success Criteria

⚠️ Risk Mitigation

Example Name Refactorings

// Before
getData() → fetchCustomerPurchaseHistory()
processItems() → calculateMonthlyRevenue()
userObj → customerProfile
temp → filteredTransactions
data → invoiceRecords
doStuff() → validatePaymentCredentials()

Next Steps

  1. Review the identified code smells
  2. Prioritize based on impact and risk
  3. Begin with Phase 1 naming refactors
  4. Proceed incrementally through the plan
  5. Measure improvements after each phase
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.