Skip to main content

anti-patterns

Common software anti-patterns, code smells, and how to avoid them

Source facts

Repository
NeuralBlitz/Mito
Last source activity
March 22, 2026 at 13:29
Detected SKILL.md language
English
Stars
0
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
anti-patterns
description
Common software anti-patterns, code smells, and how to avoid them
license
MIT
compatibility
opencode
metadata
{"audience":"developers","category":"software-development"}
## What I do - Identify code anti-patterns in existing code - Suggest refactoring solutions - Avoid common mistakes in design and implementation - Improve code quality and maintainability - Recognize technical debt indicators ## When to use me When reviewing code, improving designs, or fixing maintainability issues. ## Code Anti-Patterns ### Object-Oriented - **God Object**: Single class doing too much - **Spaghetti Code**: Unstructured, tangled control flow - **Magic Numbers**: Hard-coded values without constants - **Feature Envy**: Excessive use of another class's data - **Data Clumps**: Groups of variables passed together - **Refused Bequest**: Not using inherited methods - **Switch Statements**: Complex conditionals instead of polymorphism - **Parallel Inheritance**: Duplicate class hierarchies ### Design Anti-Patterns - **Singleton Abuse**: Overuse of singletons - **Dependency Hell**: Complex dependency chains - **Circular Dependencies**: A→B→C→A - **Interface Bloat**: Overly complex interfaces - **Leaky Abstractions**: Exposing internal details - **Golden Hammer**: Using one solution for everything - **Reinvention**: Not using built-in features - **Analysis Paralysis**: Over-planning ### Database Anti-Patterns - **Database as IPC**: Using DB for communication - **God Table**: One table for everything - **EAV**: Entity-Attribute-Value pattern - **Naive Enum**: Storing enums as strings without constraints - **Missing Indexes**: Slow queries due to full table scans - **N+1 Queries**: Loading related data inefficiently ### Concurrency - **Race Conditions**: Uncoordinated concurrent access - **Deadlock**: Circular wait dependencies - **Blocking Operations**: Synchronous calls in async code - **Shared Mutex**: Global locks causing contention ### Testing - **Testing the Implementation**: Instead of behavior - **Happy Path Only**: Only testing success cases - **Manual Testing**: No automated tests - **Tight Coupling**: Tests depend on implementation details ## Code Smells - Long methods - Large classes - Duplicate code - Long parameter lists - Primitive obsession - Data classes - Comments explaining bad code ## Refactoring Strategies - Extract Method - Move Method - Replace Conditional with Polymorphism - Introduce Parameter Object - Replace Magic Numbers - Extract Class - Inline Class - Introduce Null Object
View on GitHub