Identifies anti-patterns specific to the 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.
A Claude Code Skill that identifies anti-patterns violating amplihack philosophy and provides specific, actionable fixes.
Use this skill when:
__all__ - Python modules without explicit public interfaceThe skill analyzes your code and:
Bad Pattern:
class DataProcessor(ABC):
@abstractmethod
def process(self, data):
pass
class SimpleDataProcessor(DataProcessor):
def process(self, data):
return data * 2
Good Pattern:
def process_data(data):
"""Process data by doubling it."""
return data * 2
Bad Pattern:
class Entity(Base):
pass
class TimestampedEntity(Entity):
pass
class AuditableEntity(TimestampedEntity):
pass
class User(AuditableEntity):
pass
Good Pattern:
class User:
def __init__(self, storage, timestamp_service, audit_log):
self.storage = storage
self.timestamps = timestamp_service
self.audit = audit_log
Bad Pattern:
def process_user(user_dict, validate=True, save=True, notify=True, log=True):
if validate:
# validation logic (20 lines)
if save:
# save logic (15 lines)
if notify:
# email logic (10 lines)
if log:
# logging logic (10 lines)
# ... more mixed concerns
Good Pattern:
def validate_user(user_dict):
"""Validate user data."""
# 5 lines of focused validation
def create_user(user_dict):
"""Create user from data."""
# 5 lines of focused creation
def process_user(user_dict):
"""Orchestrate workflow."""
validate_user(user_dict)
user = create_user(user_dict)
db.save(user)
notify_user(user)
log_creation(user)
Bad Pattern:
class UserService:
def create_user(self, name, email):
db = Database() # Hardcoded dependency
user = db.save_user(name, email)
email_service = EmailService() # Hardcoded dependency
email_service.send(email, "Welcome!")
return user
Good Pattern:
class UserService:
def __init__(self, db, email_service):
self.db = db
self.email_service = email_service
def create_user(self, name, email):
user = self.db.save_user(name, email)
self.email_service.send(email, "Welcome!")
return user
__all__Bad Pattern:
# module/__init__.py
from .core import process_data, _internal_helper
from .utils import validate_input, LOG_LEVEL
# Unclear what users should import
Good Pattern:
# module/__init__.py
from .core import process_data
from .utils import validate_input
__all__ = ['process_data', 'validate_input']
# Crystal clear public interface
This skill ensures code follows amplihack's key principles:
Each code smell detected:
When using this skill:
| Smell | Root Cause | Quick Fix |
| ------------------- | ------------------- | ---------------------------- |
| Over-Abstraction | "Future-proofing" | Delete the abstraction layer |
| Complex Inheritance | Code reuse attempt | Use composition instead |
| Large Functions | Mixed concerns | Extract helper functions |
| Tight Coupling | Hidden dependencies | Use dependency injection |
| Missing __all__ | Unclear API | Explicitly define exports |
Use this skill during:
~/.amplihack/.claude/context/PHILOSOPHY.md~/.amplihack/.claude/context/PATTERNS.md/skill code-smell-detector when reviewing codeRemember: This skill helps maintain quality and teach philosophy - use it to help, not criticize.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer