Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

design-patterns

/design-patterns

Pomaga wybrać i wdrożyć nazwany wzorzec, np. Strategy, Observer, Repository, Circuit Breaker czy Outbox, z opisem kiedy go użyć.

Repozytorium
agent-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
13.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
24
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 13.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pomaga wybrać i wdrożyć nazwany wzorzec, np. Strategy, Observer, Repository, Circuit Breaker czy Outbox, z opisem kiedy go użyć.

Oryginalny opis (EN)

Use when picking or implementing a named pattern: Strategy, Observer, Adapter, Decorator, Factory, Repository, Unit of Work, Dependency injection, Retry with backoff, Circuit Breaker, Idempotency key, Outbox, Result type. Not for whether to abstract at all (use engineering-principles), SOLID refactors (use solid-principles), aggregates (use domain-driven-design), CQRS, event sourcing, sagas, event-driven design, service boundaries or service-to-service communication (use code-architectures).

Jak działa

  1. Default to no pattern
  2. What to load
  3. Related skills
Sekcje z nagłówków SKILL.md, w oryginale · 54 linii, 680 słów
Podgląd SKILL.md
---
name: design-patterns
description: >-
  Use when picking or implementing a named pattern: Strategy, Observer, Adapter, Decorator, Factory, Repository, Unit of Work, Dependency injection, Retry with backoff, Circuit Breaker, Idempotency key, Outbox, Result type. Not for whether to abstract at all (use engineering-principles), SOLID refactors (use solid-principles), aggregates (use domain-driven-design), CQRS, event sourcing, sagas, event-driven design, service boundaries or service-to-service communication (use code-architectures).
metadata:
  last_updated: "2026-11-11"
---

# Design Patterns

A catalog of the patterns that show up in production code, with one reference per pattern in Python and TypeScript. Most are a function, a closure or a `Protocol` in these languages, not a class hierarchy.

Python examples assume 3.12 or later.

## Default to no pattern

Start with a plain function, a dict of functions, or an `if`. A second CSV export format is a function argument. Reach for a pattern when the plain version has already hurt: the third `elif` on a provider name, a notification call copied into four callers, a module that cannot be tested without the database.

If the request names a variant-selection pattern (Strategy, Factory, State, Command, Chain of Responsibility), count the real variants or callers, including any this change adds. With fewer than three, write the plain version and say so in one line. Resilience and data-access patterns (Retry, Circuit Breaker, Idempotency key, Outbox, Unit of Work) are triggered by a failure mode, not a count: one call site that can double-charge or lose an event already needs them. Observer is triggered by a coupling boundary, not a count: subscribers the publisher should not import.

Every reference has an early "Do you need this?" section that names the plain alternative and the signal that tips you over. If you cannot point at that signal, skip the pattern.

## What to load

Open only the file the task needs. [catalog.md](references/catalog.md) lists every pattern with a one-line summary and how common it is.

| You are... | Read |
|---|---|
| Choosing a pattern, or refreshing what one is | [catalog.md](references/catalog.md) |
| Choosing an implementation once, by name or config, at construction (payment provider, exporter) | [factory.md](references/creational/factory.md) |
| Constructing an object with many optional parts | [builder.md](references/creational/builder.md) |
| Passing collaborators in instead of creating them inside, so tests can swap them | [dependency-injection.md](references/creational/dependency-injection.md) |
| Tempted by a global instance | [singleton.md](references/creational/singleton.md) |
| Making a third-party API or legacy module fit your interface, or putting one simple front (Facade) on a messy subsystem | [adapter.md](references/structural/adapter.md) |
| Wrapping one call with logging, caching, auth or timing without editing it | [decorator.md](references/structural/decorator.md) |
| Standing in for an object with the same interface to control access: lazy load, remote stand-in, permission gate | [proxy.md](references/structural/proxy.md) |
| Choosing an algorithm per call at runtime (pricing, routing, sorting) | [strategy.md](references/behavioral/strategy.md) |
| Notifying other modules when something happens | [observer.md](references/behavioral/observer.md) |
| Queuing, undoing or replaying an action as data | [command.md](references/behavioral/command.md) |
| Sending one request through an ordered list of handlers, each able to stop it (middleware, validation) | [chain-of-responsibility.md](references/behavioral/chain-of-responsibility.md) |
| Behavior that depends on a lifecycle status (order or payment states) | [state.md](references/behavioral/state.md) |
| Fixed skeleton with steps that vary | [template-method.md](references/behavioral/template-method.md) |
| Walking a collection lazily or in pages | [iterator.md](references/behavioral/iterator.md) |
| Hiding persistence behind a domain-shaped interface (a repository inside an aggregate belongs to `domain-driven-design`) | [repository.md](references/data-access/repository.md) |
| Several writes that must commit or roll back together | [unit-of-work.md](references/data-access/unit-of-work.md) |
| Separating wire or database shapes from domain objects | [dto-mapper.md](references/data-access/dto-mapper.md) |
| Calling something flaky | [retry-backoff.md](references/resilience/retry-backoff.md) |
| Stopping calls to a dependency that is down | [circuit-breaker.md](references/resilience/circuit-breaker.md) |
| Making a retried request safe to repeat | [idempotency-key.md](references/resilience/idempotency-key.md) |
| Writing to the database and publishing an event atomically | [outbox.md](references/resilience/outbox.md) |
| Returning errors or absence without exceptions or null checks, or substituting a do-nothing default object (Null Object) | [result-option.md](references/value-modeling/result-option.md) |

Facade is described inside the adapter file and Null Object inside the result-option file. Abstract Factory, Prototype, Bridge, Composite, Flyweight, Memento, Mediator, Visitor and Interpreter are catalog-only; the catalog says what to use instead.

## Related skills

- `engineering-principles`: whether to abstract at all, and how much. Read it first if you are unsure a pattern is warranted.
- `solid-principles`: the SRP/OCP/LSP/ISP/DIP treatment that most patterns apply, plus the anti-patterns for needless indirection.
- `domain-driven-design`: aggregates and repositories inside aggregates.
- `code-architectures`: layering, CQRS, event sourcing and service boundaries. Architecture-level material lives there, not here.
Pliki w paczce (24)
  • SKILL.md 6 KB
  • references/catalog.md 5 KB
  • references/behavioral/chain-of-responsibility.md 6 KB
  • references/behavioral/command.md 5 KB
  • references/behavioral/iterator.md 5 KB
  • references/behavioral/observer.md 6 KB
  • references/behavioral/state.md 6 KB
  • references/behavioral/strategy.md 6 KB
  • references/behavioral/template-method.md 5 KB
  • references/creational/builder.md 7 KB
  • references/creational/dependency-injection.md 6 KB
  • references/creational/factory.md 5 KB
  • references/creational/singleton.md 7 KB
  • references/data-access/dto-mapper.md 7 KB
  • references/data-access/repository.md 7 KB
  • references/data-access/unit-of-work.md 7 KB
  • references/resilience/circuit-breaker.md 10 KB
  • references/resilience/idempotency-key.md 11 KB
  • references/resilience/outbox.md 13 KB
  • references/resilience/retry-backoff.md 13 KB
  • references/structural/adapter.md 10 KB
  • references/structural/decorator.md 9 KB
  • references/structural/proxy.md 7 KB
  • references/value-modeling/result-option.md 9 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · joeblackwaslike/agent-skills100MIT
spencerbeggs/effected100MIT
spencerbeggs/effected100MIT
krzysztofsurdy/code-virtuoso100MIT
nimadorostkar/Claude-Skills-collection100MIT
andreibesleaga/gabbe100CC-BY-4.0
pantheon-org/tekhne100MIT
itzcull/software-skills100MIT
guilhermevozniak/refactor-pilot-framework100MIT

Migawka bazy z 13.11.2026 · wersja paczki 94ffc93d9556 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100code-architectures
    Pomaga wybrać sposób budowy systemu: warstwy heksagonalne, CQRS, event sourcing, mikrousługi lub monolit.
  • 100engineering-principles
    Podpowiada, gdzie umieścić logikę, jak dużo abstrakcji wystarczy, jak ułożyć moduły, obsługiwać błędy i nazywać rzeczy w kodzie.
  • 100design-patterns-implementation
    Stosuje wzorce projektowe (Singleton, Factory, Observer, Strategy i inne) do problemów architektonicznych, przy refaktoryzacji, systemach rozszerzalnych i zasadach SOLID.
  • 100software-patterns
    Porównuje kompromisy wzorców architektonicznych, na przykład repozytorium, zdarzenia domenowe czy circuit breaker, i poleca właściwy.
  • 100php-patterns
    Stosuje wzorce projektowe w PHP (Singleton, Factory, Strategy, Observer, Repository, Decorator, wstrzykiwanie zależności) przy strukturze rozszerzeń WooCommerce i złożonej logice biznesowej.
  • 100microservices-patterns
    Dzieli systemy na mikroserwisy i stosuje wzorce rozproszone: granice usług, wybór między mikroserwisami a modularnym monolitem, sagi, outbox, CQRS, event sourcing, API gateway i odporność.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.