design-patterns
Use when the user asks which design pattern to use, GoF patterns (strategy, factory, observer, decorator, adapter), enterprise patterns, anti-patterns or…
от j4flmao★ 47 звёзд на GitHub
Установить design-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Design Patterns
Purpose
Guide pattern selection across all categories — GoF, enterprise, integration, concurrency, architectural — with decision trees, applicability rules, trade-off analysis, and composition guidance.
Agent Protocol
Trigger
User request includes: design pattern, gof, gang of four, pattern catalog, creational, structural, behavioral, pattern selection, enterprise pattern, integration pattern, concurrency pattern, architectural pattern, anti-pattern, pattern composition, CQRS, event sourcing, saga, repository, unit of work, messaging pattern, circuit breaker, strangler fig, saga pattern, hexagonal architecture, clean architecture.
Input Context
- Problem statement with constraints (performance, memory, team size, tech stack)
- Current architecture description
- Existing patterns already in use
- Pattern category preference or openness
Output Artifact
Selected pattern(s) with rationale, rejected candidates with explicit elimination reasons, implementation sketch, trade-off table, and composition rules if multiple patterns are needed.
Response Format
No preamble. No postamble. No explanations. Strip articles a/an/the where unambiguous. Compress output. If no pattern fits, output No matching pattern. Consider: [alternative approach]. and stop.
Completion Criteria
- Decision tree traversed and documented
- Rejected candidates include explicit elimination reason
- Implementation sketch covers pattern structure (not full business logic)
- Trade-offs documented for each selected pattern
- Pattern composition rules applied if multiple patterns
Architecture Decision Tree
Which Pattern Category?
What kind of problem are you solving?
├── Object creation, instance management → Creational (Singleton, Factory, Builder, Prototype)
├── Class/object composition, interfaces → Structural (Adapter, Decorator, Proxy, Facade)
├── Object communication, algorithms → Behavioral (Observer, Strategy, Command, State)
├── Business logic organization, persistence → Enterprise (Repository, Unit of Work, Aggregate)
├── Service-to-service communication → Integration (Message Queue, Event Bus, API Gateway)
├── Thread safety, async coordination → Concurrency (Mutex, Semaphore, Actor, Fan-out/Fan-in)
├── High-level system structure → Architectural (Clean Architecture, Hexagonal, CQRS, Event Sourcing)
└── Code smells affecting maintainability → Anti-Pattern to refactor (God Class, Spaghetti Code)
GoF Pattern Selection Decision Tree
What is changing?
├── How objects are created → Creational
│ ├── Need to ensure single instance → Singleton
│ ├── Need to create families of related objects → Abstract Factory
│ ├── Need to construct complex objects step by step → Builder
│ ├── Need to create copies without knowing concrete types → Prototype
│ └── Need to delegate creation to subclasses → Factory Method
├── How objects are composed → Structural
│ ├── Need to make incompatible interfaces compatible → Adapter
│ ├── Need to add responsibilities dynamically → Decorator
│ ├── Need to control access to an object → Proxy
│ ├── Need to simplify complex subsystem → Facade
│ ├── Need to compose objects into tree structures → Composite
│ └── Need to share fine-grained objects → Flyweight (only if profiler confirms memory pressure)
└── How objects communicate and distribute work → Behavioral
├── Need to notify multiple objects of state changes → Observer
├── Need to select algorithm at runtime → Strategy
├── Need to encapsulate a request as an object → Command
├── Need to define skeleton of an algorithm → Template Method
├── Need to traverse a collection without exposing internals → Iterator
├── Need to represent a grammar → Interpreter
├── Need to capture and restore object state → Memento
├── Need to dispatch operations based on type → Visitor
└── Need to manage state-dependent behavior → State
Enterprise Pattern Selection
What enterprise problem are you solving?
├── Data access abstraction → Repository
├── Transaction coordination → Unit of Work
├── Business logic as transaction script → Transaction Script
├── Business logic as domain model → Domain Model
├── Object identity and caching → Identity Map
├── Lazy loading for related objects → Lazy Load
├── Mapping objects to database → Data Mapper
└── Separating read/write models → CQRS
Integration Pattern Selection
How do services communicate?
├── One-to-one, request-reply → RPC/HTTP + Circuit Breaker
├── One-to-many, fire-and-forget → Message Queue (Event Bus)
├── Guaranteed delivery, durability → Durable Message Queue
├── Bidirectional, low latency → WebSocket
├── Asynchronous, eventual consistency → Event-Driven + Transactional Outbox
├── Coordinating multiple services → Saga (Choreography or Orchestration
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/anti-patterns.md
- references/behavioral_patterns.md
- references/concurrency-patterns.md
- references/design-patterns-fundamentals.md
- references/domain-driven-design-patterns.md
- references/enterprise-patterns.md
- references/gof-patterns.md
- references/integration-patterns.md
- references/pattern-relationships.md
- references/selection-decision-tree.md
- references/structural_patterns.md
- references/testing-patterns.md
FAQ
Что делает скилл design-patterns?
Use when the user asks which design pattern to use, GoF patterns (strategy, factory, observer, decorator, adapter), enterprise patterns, anti-patterns or composition vs inheritance. Produces a pattern choice with trade-offs and code. Not for system layering (use backend-clean-architecture) or microservice patterns (use microservices).
Как установить скилл design-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл design-patterns запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…