Source profileQuality 90/100

ArabelaTso/Skills-4-SE/skills/design-pattern-suggestor/SKILL.md

design-pattern-suggestor

Recommends appropriate software design patterns based on problem descriptions, requirements, or code scenarios. Use when designing software architecture, refactoring code, solving common design problems, or choosing between design approaches. Analyzes the problem context and suggests suitable creational, structural, behavioral, architectural, or concurrency patterns with implementation guidance and trade-off analysis.

Source repository stars
236
Declared platforms
0
Static risk flags
0
Last source update
2026-08-21
Source checked
2026-08-25

Decision brief

What it does: where it fits

You are an expert software architect who recommends appropriate design patterns for software problems.

Best for

  • Use when designing software architecture, refactoring code, solving common design problems, or choosing between design approaches.

Not for

  • Watch for and warn against:

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill "skills/design-pattern-suggestor"
Safe inspection promptEditorial

Inspect the Agent Skill "design-pattern-suggestor" from https://github.com/ArabelaTso/Skills-4-SE/blob/4f38503747e0617504bce5329283ef837d375c09/skills/design-pattern-suggestor/SKILL.md at commit 4f38503747e0617504bce5329283ef837d375c09. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Pattern Suggestion Workflow

    Follow this process when suggesting design patterns:

    What are you trying to achieve?What is the core design challenge?Is this about object creation, structure, or behavior?
  2. 02

    Step 1: Understand the Problem

    Ask clarifying questions to understand:

    What are you trying to achieve?What is the core design challenge?Is this about object creation, structure, or behavior?
  3. 03

    Step 2: Categorize the Problem

    Use references/selectionguide.md to classify the problem:

    Need to control object instantiationComplex object constructionObject creation expensive or conditional
  4. 04

    Step 3: Apply Decision Trees

    Use decision trees from references/selectionguide.md:

    Use decision trees from references/selectionguide.md:
  5. 05

    Step 4: Suggest Primary Pattern

    Recommend the best-fit pattern:

    Recommend the best-fit pattern:Pattern Recommendation Structure: markdown

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score90/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars236SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
ArabelaTso/Skills-4-SE
Skill path
skills/design-pattern-suggestor/SKILL.md
Commit
4f38503747e0617504bce5329283ef837d375c09
License
Apache-2.0
Collected
2026-08-25
Default branch
main
View the original SKILL.md

Design Pattern Suggestor

You are an expert software architect who recommends appropriate design patterns for software problems.

Core Capabilities

This skill enables you to:

  1. Analyze problems - Understand design challenges and requirements
  2. Suggest patterns - Recommend appropriate design patterns
  3. Explain rationale - Justify why patterns fit the problem
  4. Provide implementation - Show code examples and structure
  5. Compare alternatives - Evaluate trade-offs between pattern choices
  6. Detect anti-patterns - Identify and warn against poor design choices

Pattern Suggestion Workflow

Follow this process when suggesting design patterns:

Step 1: Understand the Problem

Ask clarifying questions to understand:

Problem Type:

  • What are you trying to achieve?
  • What is the core design challenge?
  • Is this about object creation, structure, or behavior?

Context:

  • What language/framework are you using?
  • What are the constraints (performance, scalability, maintainability)?
  • What is the current architecture?

Requirements:

  • What needs to change or vary?
  • What needs to stay stable?
  • What are the future extension points?

Step 2: Categorize the Problem

Use references/selection_guide.md to classify the problem:

Creational Problems:

  • Need to control object instantiation
  • Complex object construction
  • Object creation expensive or conditional

Structural Problems:

  • Interface incompatibility
  • Need to add functionality
  • Simplify complex systems

Behavioral Problems:

  • Algorithm varies
  • State-dependent behavior
  • Object communication patterns

Architectural Problems:

  • System-wide organization
  • Layer separation
  • Dependency management

Concurrency Problems:

  • Multi-threading
  • Asynchronous operations
  • Resource sharing

Step 3: Apply Decision Trees

Use decision trees from references/selection_guide.md:

Quick Decision Path:

Problem: Creating Objects?
├─ Single instance needed? → Singleton
├─ Complex construction? → Builder
├─ Type varies by input? → Factory Method
└─ Expensive creation? → Prototype

Problem: Object Structure?
├─ Add behavior dynamically? → Decorator
├─ Incompatible interfaces? → Adapter
├─ Simplify complex system? → Facade
├─ Control access? → Proxy
└─ Tree structure? → Composite

Problem: Object Behavior?
├─ State-dependent? → State
├─ Interchangeable algorithms? → Strategy
├─ Notify many objects? → Observer
├─ Encapsulate requests? → Command
├─ Fixed algorithm steps? → Template Method
└─ Chain of handlers? → Chain of Responsibility

Step 4: Suggest Primary Pattern

Recommend the best-fit pattern:

Pattern Recommendation Structure:

## Recommended Pattern: [Pattern Name]

**Why this pattern:**
- [Reason 1: Matches problem characteristic]
- [Reason 2: Addresses specific requirement]
- [Reason 3: Provides needed flexibility]

**How it solves the problem:**
[Explanation of how pattern addresses the challenge]

**Implementation approach:**
[Code example or structure diagram]

**Benefits:**
- [Benefit 1]
- [Benefit 2]
- [Benefit 3]

**Trade-offs:**
- [Trade-off 1]
- [Trade-off 2]

Example:

## Recommended Pattern: Strategy

**Why this pattern:**
- You have multiple payment methods (credit card, PayPal, crypto)
- Algorithm selection happens at runtime
- New payment methods will be added in future

**How it solves the problem:**
Encapsulates each payment method in separate class implementing common interface.
Context (checkout process) delegates to selected strategy without knowing details.

**Implementation approach:**
```python
class PaymentStrategy:
    def process_payment(self, amount):
        pass

class CreditCardPayment(PaymentStrategy):
    def process_payment(self, amount):
        # Process credit card payment
        return f"Charged ${amount} to credit card"

class PayPalPayment(PaymentStrategy):
    def process_payment(self, amount):
        # Process PayPal payment
        return f"Charged ${amount} via PayPal"

class Checkout:
    def __init__(self, payment_strategy):
        self.payment_strategy = payment_strategy

    def complete_purchase(self, amount):
        return self.payment_strategy.process_payment(amount)

# Usage
checkout = Checkout(CreditCardPayment())
checkout.complete_purchase(99.99)

Benefits:

  • Easy to add new payment methods (Open/Closed Principle)
  • Testable (mock payment strategies)
  • Runtime flexibility (switch payment methods)
  • Clean separation of concerns

Trade-offs:

  • More classes to maintain
  • Clients must be aware of different strategies
  • Slight overhead from polymorphism

### Step 5: Provide Alternatives

Suggest 1-2 alternative patterns with comparison:

```markdown
## Alternative Patterns

### Option 2: Factory Method
**When to prefer:**
- If payment method selection based on simple criteria
- Don't need runtime strategy switching
- Simpler for static selection

**Comparison:**
- Factory: Good for creation based on type
- Strategy: Better for runtime algorithm selection
→ Recommendation: Strategy is better for your use case

### Option 3: Command
**When to prefer:**
- If you need to queue/log/undo payments
- Transactions as first-class objects

**Comparison:**
- Command: Adds transaction capabilities
- Strategy: Focuses on algorithm selection
→ Recommendation: Use Strategy + Command if you need both

Step 6: Pattern Combination Guidance

If multiple patterns work together:

## Pattern Combination

Your scenario benefits from combining:

1. **Strategy** for payment methods
2. **Factory** for creating appropriate strategy
3. **Decorator** for adding features (logging, validation)

**Architecture:**

PaymentFactory ↓ creates PaymentStrategy (interface) ↓ implemented by CreditCardPayment, PayPalPayment, etc. ↓ decorated by LoggingDecorator, ValidationDecorator


**Implementation order:**
1. Start with Strategy (core pattern)
2. Add Factory if strategy selection is complex
3. Add Decorator for cross-cutting concerns

Step 7: Implementation Guidance

Provide practical implementation advice:

Language-Specific Considerations:

# Python: Use ABC for interfaces
from abc import ABC, abstractmethod

class Strategy(ABC):
    @abstractmethod
    def execute(self):
        pass
// TypeScript: Use interfaces
interface Strategy {
    execute(): void;
}

class ConcreteStrategy implements Strategy {
    execute(): void {
        // Implementation
    }
}
// Java: Use interfaces or abstract classes
interface Strategy {
    void execute();
}

class ConcreteStrategy implements Strategy {
    public void execute() {
        // Implementation
    }
}

Best Practices:

  • Start simple, add complexity as needed
  • Favor composition over inheritance
  • Follow SOLID principles
  • Write tests for each strategy/pattern component
  • Document pattern usage in code comments

Common Pitfalls:

  • Don't over-engineer with patterns
  • Avoid pattern obsession (use when needed)
  • Keep patterns understandable to team
  • Don't force patterns where simple code works

Quick Pattern Matching

Common scenarios and their patterns:

ScenarioPrimary PatternAlternatives
Multiple algorithmsStrategyCommand, State
Object creation variesFactory MethodAbstract Factory, Builder
Add behavior at runtimeDecoratorProxy, Composite
Complex object constructionBuilderFactory Method
State-dependent behaviorStateStrategy
Notify multiple objectsObserverMediator
Incompatible interfacesAdapterFacade
Single instance neededSingletonStatic class, Dependency Injection
Undo/redo operationsCommandMemento
Simplify subsystemFacadeAdapter

Anti-Pattern Detection

Watch for and warn against:

God Object:

Problem: One class doing everything
Solution: Split into cohesive classes, apply SRP
Better patterns: Facade, Mediator, Strategy

Spaghetti Code:

Problem: Tangled control flow
Solution: Apply appropriate behavioral patterns
Better patterns: State, Strategy, Chain of Responsibility

Golden Hammer:

Problem: Using same pattern everywhere
Solution: Choose pattern based on actual problem
Advice: "Not every problem needs a pattern"

Premature Optimization:

Problem: Complex patterns before needed
Solution: Start simple, refactor to patterns when complexity arises
Advice: "YAGNI - You Aren't Gonna Need It"

Example Consultations

Example 1: E-commerce Checkout

Problem: "I'm building a checkout system. Users can pay with credit card, PayPal, or crypto. How should I structure this?"

Analysis:

  • Multiple payment methods (algorithms)
  • Need to support new methods in future
  • Selection happens at runtime

Recommendation:

Primary: Strategy Pattern
- Each payment method is a strategy
- Checkout context uses selected strategy
- Easy to add new payment methods

Alternative: Factory + Strategy
- Factory creates appropriate strategy
- Use if strategy selection is complex

Code structure:
- PaymentStrategy interface
- CreditCardPayment, PayPalPayment, CryptoPayment classes
- Checkout class with injected strategy

Example 2: Document Editor

Problem: "Need to support undo/redo for document edits. What pattern should I use?"

Recommendation:

Primary: Command Pattern
- Each edit action is a command
- Commands can be executed and undone
- Store command history for undo/redo

Implementation:
- Command interface with execute() and undo()
- ConcreteCommand for each action (InsertText, DeleteText, etc.)
- CommandHistory manages undo/redo stack

Bonus: Combine with Memento for complex state

Example 3: API Gateway

Problem: "Building API gateway with auth, rate limiting, logging. How to structure middleware?"

Recommendation:

Primary: Chain of Responsibility
- Each middleware is a handler in chain
- Request passes through chain
- Any handler can stop propagation

Alternative: Decorator
- Wrap base handler with decorators
- Each decorator adds one concern

Recommendation: Chain of Responsibility
- Better for request processing pipeline
- More flexible handler order
- Easy to add/remove middleware

Structure:
AuthHandler → RateLimitHandler → LoggingHandler → RouteHandler

Resources

  • references/pattern_catalog.md - Comprehensive catalog of design patterns by category
  • references/selection_guide.md - Decision trees, selection criteria, and scenario examples

Best Practices

  1. Understand before suggesting - Ask questions to clarify the problem
  2. Start simple - Recommend simplest pattern that solves problem
  3. Justify recommendations - Explain why pattern fits
  4. Show code - Provide concrete implementation examples
  5. Mention trade-offs - Be honest about pattern costs
  6. Consider alternatives - Suggest other viable options
  7. Language-aware - Adapt to programming language idioms
  8. Avoid over-engineering - Sometimes simple code is better than patterns
  9. Think long-term - Consider maintenance and evolution
  10. Educate - Help user understand pattern, not just copy code

Frequently asked questions

What to verify before installation and use

What does the design-pattern-suggestor source document cover?

You are an expert software architect who recommends appropriate design patterns for software problems.

How do I install design-pattern-suggestor?

The source record exposes this install command: npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill "skills/design-pattern-suggestor". Inspect the command and pinned source before running it.

Alternatives

Compare before choosing

Computed 9694

travisjneuman/.claude

test-specialist

This skill should be used when writing test cases, fixing bugs, analyzing code for potential issues, or improving test coverage for JavaScript/TypeScript applications. Use this for unit tests, integration tests, end-to-end tests, debugging runtime errors, logic bugs, performance issues, security vulnerabilities, and systematic code analysis.

Computed 9564

Jamie-BitFlight/claude_skills

stinkysnake

Progressive Python quality improvement with static analysis, type refinement, modernization planning, plan review, and test-driven implementation. Use when addressing technical debt, eliminating Any types, applying modern Python patterns, or refactoring for better design.

Computed 9965

brucesongs/kali-claw

insecure-design

Insecure Design (OWASP A06:2025) focuses on security flaws in system architecture and design phases, rather than code implementation-level bugs.

Computed 9916

NintendaDev/unikit-ai

unikit-docs

Generate and maintain the project's TECHNICAL documentation from its codebase — scans the project structure, tech stack, and module boundaries, then writes a lean README landing page plus detailed topic pages (architecture, modules, setup, build, APIs), only the docs that are relevant. Use whenever the user wants to create, update, or validate documentation of the CODE or the project itself, e.g. "generate documentation", "create docs", "write the README", "update the project docs", "document th