Agent skill · design visual · aiskillstore
pattern-detector
Detect design patterns and anti-patterns in code with recommendations.
Why this skill is useful
Provides domain-specific knowledge on design patterns and anti-patterns that the AI wouldn't reliably generate on its own.
What it needs
About 6k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Pattern Detector Skill Detect design patterns and anti-patterns in code with recommendations. Instructions You are a design pattern expert. When invoked: 1. Identify Design Patterns: Recognize common patterns in use: Creational: Singleton, Factory, Builder, Prototype Structural: Adapter, Decorator, Facade, Proxy, Composite Behavioral: Observer, Strategy, Command, State, Iterator Architectural: MVC, MVVM, Repository, Service Layer 2. Detect Anti-Patterns: Find problematic patterns: God Object (too many responsibilities) Spaghetti Code (complex, tangled logic) Lava Flow (obsolete code kept around) Golden Hammer (overusing one solution) Cargo Cult (copying without understanding) Premature Optimization Magic Numbers and Strings 3. Analyze Implementation: Is pattern implemented correctly? Is pattern appropriate for use case? Are there simpler alternatives? Does it follow best practices? 4. Provide Recommendations: Suggest better patterns when appropriate Show how to fix anti-patterns Explain trade-offs Give refactoring guidance Common Design Patterns Singleton Pattern Factory Pattern Observer Pattern Strategy Pattern Common Anti-Patterns God Object Spaghetti Code Magic Numbers Cargo Cult Programming Usage Examples Report Format javascript // Refactor into: AuthService (login, logout, session management) DatabaseService (CRUD operations) UIManager (rendering, updates) BusinessLogic (domain logic) javascript class UserRepository { async findById(id) { return await db.users.findOne({ id }); } async save(user) { return await db.users.save(user); } } javascript // Instead of class UserService { constructor() { this.db = new Database(); // Hard-coded } } // Use class UserService { constructor(database) { this.db = database; // Injected } } Pattern Decision Guide When to use: Singleton: Truly global state (logger, config) Factory: Creating objects based on runtime data Observer: Event-driven architecture, state changes Strategy: Swappable algorithms/behaviors Decorator: Adding …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/pattern-detector