Skip to content
Back to skills

Architecture

ASecurity

Match a design problem to a standard pattern (strategy, adapter, facade, observer, circuit breaker) and refactor to it. Use when code has long if/else chains, tangled integrations or repeated construction logic.

  • 24 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added October 14, 2026
ai-agentsgoapidatabasefrontendbackendsecuritydocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned November 22, 2026

npx -y skills add andreibesleaga/GABBE --skill architecture --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Architecture?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Architecture
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/andreibesleaga-architecture-ebb8a070/badge)](https://www.skillsdirectory.com/skills/andreibesleaga-architecture-ebb8a070)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: design-patterns
description: Match a design problem to a standard pattern (strategy, adapter, facade, observer, circuit breaker) and refactor to it. Use when code has long if/else chains, tangled integrations or repeated construction logic.
triggers: [design pattern, refactor pattern, strategy pattern, observer pattern, factory pattern, singleton]
tags: [architecture]
context_cost: low
---
# Design Patterns Skill

## Goal
To improve code maintainability, flexibility, and readability by applying proven solutions to common design problems.

## Supported Patterns (2025 Context)

### Creational
-   **Factory / Builder**: For complex object construction (e.g., configuring LLM clients).
-   **Singleton**: Use sparingly (e.g., for Database connections or Logging service).

### Structural
-   **Adapter**: Connecting legacy code or external APIs (e.g., standardizing different LLM APIs).
-   **Facade**: Simplifying complex subsystems (e.g., a simple `WebScraper` class wrapping Puppeteer).
-   **Composite**: For tree structures (e.g., parsing code ASTs).

### Behavioral
-   **Strategy**: Swappable algorithms (e.g., switching between 'Fast' and 'Smart' search).
-   **Observer**: Event handling (e.g., updating UI when data changes).
-   **State**: Managing complex entity lifecycles (e.g., Order status: Pending -> Paid -> Shipped).

### Modern / Cloud
-   **Circuit Breaker**: Preventing cascading failures in distributed calls.
-   **Sidecar**: Offloading infra concerns (logging, proxying) to a separate process/container.
-   **BFF (Backend for Frontend)**: API layer tailored to specific UIs.

## Steps
1.  **Identify the Problem**: "I have a lot of `if/else` statements for different payment methods."
2.  **Match Pattern**: "This looks like a use case for the **Strategy Pattern**."
3.  **Refactor**:
    -   Define the Interface.
    -   Implement Concrete Strategies.
    -   Inject the Strategy into the Context.
4.  **Document**: Add a comment or use `DESIGN_PATTERN_USAGE.md` if complex.

## Anti-Patterns to Avoid
-   **God Object**: Class that does everything.
-   **Golden Hammer**: Using the same pattern everywhere (e.g., everything is a Singleton).

## Constraints
- Apply a pattern only to a named problem in the code.
- Avoid the Golden Hammer: one pattern everywhere.

## Output Format
The refactored code and, for complex cases, `DESIGN_PATTERN_USAGE.md` (`templates/architecture/`).

## Limits and safety
- A wrapper (adapter, facade, proxy) must keep the authentication and input checks of the call chain it wraps; compare before and after.
- A shared single instance (pool, singleton) has explicit size and timeout limits and is created thread-safely in multi-threaded languages; check against the language documentation.
- If a sidecar or BFF carries a security function, confirm that the backend accepts traffic only from it.
- Events sent to observers carry no secrets or personal data.
- Use the simplest pattern; do not stack patterns for a problem one `if` would solve.

Files in this skill

  • adaptive-architecture.skill.md3.7 KB
  • api-design.skill.md4.7 KB
  • api-standards.skill.md1.7 KB
  • arch-debt.skill.md8.2 KB
  • arch-design.skill.md12.6 KB
  • arch-patterns.skill.md3.9 KB
  • arch-review.skill.md14.1 KB
  • architecture-governance.skill.md3.6 KB
  • attribute-driven-design.skill.md7.5 KB
  • blockchain-dlt.skill.md1.9 KB
  • compatibility-design.skill.md3.6 KB
  • critical-systems-arch.skill.md2 KB
  • design-patterns.skill.md4.3 KB
  • diagramming.skill.md13.9 KB
  • domain-model.skill.md12.1 KB
  • enterprise-migration-scenario.skill.md2 KB
  • enterprise-patterns.skill.md1.9 KB
  • error-handling-strategy.skill.md3.9 KB
  • event-driven-architecture.skill.md1.8 KB
  • event-governance.skill.md3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.