design-patterns — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited design-patterns (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Most "design patterns" exist to work around missing language features. Go and Python in 2026 don't need most of them. This skill names what's still useful, what's covered by other skills, and what to actively avoid. Detail (code samples, anti-pattern rationale, language-specific smells) lives in PATTERNS.md. Companion to ddd-architect, hexagonal-arch, logic-cleaner, improve-codebase-architecture.
Patterns aren't free. Each one:
Never introduce a pattern speculatively. Wait for the third place that wants the same behavior (rule of three, per logic-cleaner §6). One repetition is fine; two might be coincidence; three is a pattern asking to be extracted.
The "Gang of Four" book is a museum piece. Most of its patterns were workarounds for Java's lack of first-class functions, sum types, and structural typing. Modern Go has interfaces-where-used; modern Python has Protocols, dataclasses, and match. Neither needs Visitor, Abstract Factory, or Singleton-as-language-feature.
| Pattern | Use when | Skip when |
|---|---|---|
| Repository | Domain has aggregates with identity that need persistence | No domain layer — just functions reading/writing rows |
| Adapter | Dependency has ≥2 real implementations and a small interface surface | One implementation, no plausible second |
| Strategy (as function value) | Behavior varies per caller/context/environment | Single strategy + config flag would do it |
| Decorator / middleware | Concern is genuinely cross-cutting | Only one wrapped function — inline the concern |
| Observer / pub-sub (as domain events) | Multiple unknown consumers care about a state change | Exactly one consumer — call it directly |
| Builder | Many optional params, validation, multi-step assembly | 4 args fit on one line |
| Factory method | Caller can't know concrete type at compile time | Caller knows — call constructor directly |
| Iterator | Use the language feature (iter.Seq, generators) | — never reach for a separate class |
Code samples + rationale in PATTERNS §1.
| Pattern | Replace with |
|---|---|
| Singleton | Dependency injection — pass instances to constructors |
| Abstract Factory | Discriminated union + parse function |
| Visitor | Python match, Go type switch / interface dispatch |
| Chain of Responsibility | Middleware chain (func(handler) handler) |
| Mediator | Domain events or direct calls |
| Template Method (inheritance) | Composition + functions/strategies passed in |
| Prototype / Memento | Native cloning + serialization |
Detail + worked examples in PATTERNS §2.
These are real patterns; this skill names them once and points to their owner:
| Pattern | Owner skill |
|---|---|
| Repository | ddd-architect §5 |
| Aggregate | ddd-architect §3–4 |
| Value Object | ddd-architect §3 |
| Domain Event | ddd-architect §6 |
| Anticorruption Layer | ddd-architect §8 |
| Ports & Adapters | hexagonal-arch |
| Middleware chain | nethttp-architect §7, gin-architect §9, fastapi-architect §8 |
| Functional options (Go) | go-architect §3 |
| Dependency injection | go-architect §11, python-architect §3 |
| Iterator / generator | go-architect §6 |
Don't restate them here — load the owner skill when the topic comes up.
When asked "should we apply pattern X?":
match beats Visitor. A goroutine + channel beats Producer-Consumer-with-buffer-class. Reach for patterns after you've exhausted what the language gives you for free.If the answer to (1) is "no" or to (3) is "no", skip the pattern and revisit when reality has caught up.
Quick lookup; see PATTERNS §3 for the full table.
The pattern is the option, not the answer. Always check the decision rules in §5 first.
Go and Python each have their own list of "looks like a pattern, is actually a smell" — see PATTERNS §4. Highlights:
any everywhere, empty struct receivers, returning interfaces from constructors.@staticmethod-only classes, inheritance for reuse, metaclass magic, *args/**kwargs passthrough.If a pattern appears across many skills and projects in this repo (Repository everywhere, Middleware in every HTTP framework), it stops being a "design pattern" decision and becomes a convention encoded in the architect skill for that area. Read the architect skill first; this catalog is for when you're in genuinely new territory.
The architect skills already enforce the patterns we use universally. This skill exists for the edge cases where the architect skills don't pre-decide, and for pushing back when someone wants to add a pattern without a real reason.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.