Identifies anti-patterns specific to amplihack philosophy. Use when reviewing code for quality issues or refactoring. Detects: over-abstraction, complex inheritance, large functions (>50 lines), tight coupling, missing __all__ exports. Provides specific fixes and explanations for each smell.
View on GitHub.claude/skills/code-smell-detector/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/rysweet/amplihack/blob/main/.claude/skills/code-smell-detector/SKILL.md -a claude-code --skill code-smell-detectorInstallation paths:
.claude/skills/code-smell-detector/# Code Smell Detector Skill
## Purpose
This skill identifies anti-patterns that violate amplihack's development philosophy and provides constructive, specific fixes. It ensures code maintains ruthless simplicity, modular design, and zero-BS implementations.
## When to Use This Skill
- **Code review**: Identify violations before merging
- **Refactoring**: Find opportunities to simplify and improve code quality
- **New module creation**: Catch issues early in development
- **Philosophy compliance**: Ensure code aligns with amplihack principles
- **Learning**: Understand why patterns are problematic and how to fix them
- **Mentoring**: Educate team members on philosophy-aligned code patterns
## Core Philosophy Reference
**Amplihack Development Philosophy focuses on:**
- **Ruthless Simplicity**: Every abstraction must justify its existence
- **Modular Design (Bricks & Studs)**: Self-contained modules with clear connection points
- **Zero-BS Implementation**: No stubs, no placeholders, only working code
- **Single Responsibility**: Each module/function has ONE clear job
## Code Smells Detected
### 1. Over-Abstraction
**What It Is**: Unnecessary layers of abstraction, generic base classes, or interfaces that don't provide clear value.
**Why It's Bad**: Violates "ruthless simplicity" - adds complexity without proportional benefit. Makes code harder to understand and maintain.
**Red Flags**:
- Abstract base classes with only one implementation
- Generic helper classes that do very little
- Deep inheritance hierarchies (3+ levels)
- Interfaces for single implementations
- Over-parameterized functions
**Example - SMELL**:
```python
# BAD: Over-abstracted
class DataProcessor(ABC):
@abstractmethod
def process(self, data):
pass
class SimpleDataProcessor(DataProcessor):
def process(self, data):
return data * 2
```
**Example - FIXED**:
```python
# GOOD: Direct implementation
def process_data(data):
"""Process data by doubling it.""