design-patterns

Diagnose code smells and guide refactoring with design patterns.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/luyzkk/Anti-Vibe-Coding --skill design-patterns-luyzkk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: design-patterns
Source: https://github.com/luyzkk/Anti-Vibe-Coding/tree/main/skills/design-patterns
Command: npx skills add https://github.com/luyzkk/Anti-Vibe-Coding --skill design-patterns-luyzkk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you improve code quality by diagnosing code smells, weak error handling, unclear logging, and fragile domain modeling so you can refactor with proven design-pattern principles instead of guessing.

Core Features & Use Cases

  • Code smell diagnosis (9 core smells): Identifies issues like long functions, God Objects, DRY violations, giant conditionals, magic numbers, feature envy, data clumps, useless comments, and primitive obsession.
  • Error handling guidance (Result Pattern): Teaches when to replace try/catch flow with explicit error propagation and safer error boundaries.
  • Structured logging coaching: Guides you toward wide, canonical log lines enriched per request to improve debugging and monitoring.
  • Domain modeling with validated types: Recommends replacing primitive strings/numbers with domain types that guarantee validity.
  • Design pattern selection (GoF): Helps you map real problems to the right patterns (Observer, Factory, Singleton, Decorator, Strategy, Adapter) and avoid anti-pattern misuse.
  • JS/TS advanced reasoning: Covers hoisting, closures/memory, event loop/microtasks, promises, GC leaks, recursion limits, and data transforms.

Quick Start

Ask for a quality review by describing the specific code issue or paste the relevant snippet you want analyzed, for example: analyze the code snippet for code smells and propose refactoring directions for the error-handling, logging, and domain modeling parts.

Frequently Asked Questions about design-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify code smells and refactor long functions or God Objects?

To identify code smells like long functions or God Objects, you diagnose structural issues such as DRY violations and feature envy, then apply proven design-pattern principles to refactor the implementation direction without generating ready-to-run code.

When should I replace try/catch flow with the Result Pattern for error handling?

You should replace try/catch flow with the Result Pattern for error handling when you need explicit error propagation and safer error boundaries, receiving guidance on the underlying problem and verification steps to ensure safer execution.

How do I choose the right GoF design pattern for a specific refactoring problem?

To choose the right GoF design pattern, you map real problems to patterns like Observer, Factory, Singleton, Decorator, Strategy, or Adapter, ensuring you select the appropriate pattern while avoiding anti-pattern misuse.

What is the best way to improve structured logging for better debugging?

The best way to improve structured logging is to adopt wide, canonical log lines enriched per request, which provides coaching toward better debugging and monitoring by explaining the underlying logging problems.

How do I replace primitive obsession with validated domain types in my code?

To fix primitive obsession, you replace primitive strings and numbers with domain types that guarantee validity, receiving refactoring directions that strengthen domain modeling and prevent invalid data states.

Can I get analysis of JavaScript closures and event loop issues without generating code?

Yes, you can get analysis of JavaScript closures, event loop microtasks, and GC leaks without generating code, as the consultation explains the advanced reasoning and provides verification steps using grep and glob.