design-patterns

design-patterns is a skill for Claude Code from krzysztofsurdy/code-virtuoso. It costs 141 tokens per session (1,217 once invoked), scanned A, original, MIT.

A reference for the 26 Gang of Four design patterns, with PHP 8.3+ implementations, UML guidance, and practical examples. Design patterns are reusable ways to structure common software-design problems.

In plain words
What is it for?
Use it to apply a design pattern, compare patterns, refactor PHP code, or review code that already uses patterns.
Why use it?
It helps choose and apply a suitable pattern without relying on vague terminology or reinventing a solution. It also supports reviewing whether existing pattern use fits the problem.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the knowledge-virtuoso plugin — 15 skills shipped together

Good fit Use it to apply a design pattern, compare patterns, refactor PHP code, or review code that already uses patterns.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/krzysztofsurdy/code-virtuoso/design-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add krzysztofsurdy/code-virtuoso --skill design-patterns
Clone the repo
git clone --depth 1 https://github.com/krzysztofsurdy/code-virtuoso

Made for: Claude Code.

Or install knowledge-virtuoso, the plugin that ships this one along with the rest of its 15 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for design-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/design-patterns.svg)](https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/design-patterns)
Your own site
<a href="https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/design-patterns"><img src="https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/design-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 141 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,217 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00141 $0.01217
Opus 5 $0.00071 $0.00609
Sonnet 5 $0.00028 $0.00243
Haiku 4.5 $0.00014 $0.00122

Measured 8d ago against content hash 7224d3da7263, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

design-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/knowledge/design-patterns/SKILL.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Design Patterns

A thorough reference covering 26 design patterns organized by intent — creational, structural, and behavioral — featuring PHP 8.3+ implementations, UML guidance, and practical use cases.

Pattern Index

Creational Patterns

  • Abstract Factory — Produce families of related objects without specifying their concrete classes → reference
  • Builder — Assemble complex objects through a step-by-step process → reference
  • Factory Method — Declare an interface for object creation, letting subclasses determine the concrete type → reference
  • Prototype — Duplicate existing objects without coupling to their concrete classes → reference
  • Singleton — Guarantee that a class has exactly one instance → reference
  • Object Pool — Recycle expensive-to-create objects for repeated use → reference

Structural Patterns

  • Adapter — Translate one interface into another that clients expect → reference
  • Bridge — Separate an abstraction from its implementation so both can evolve independently → reference
  • Composite — Arrange objects into tree structures for uniform treatment → reference
  • Decorator — Layer new behaviors onto objects dynamically through wrapping → reference
  • Facade — Offer a streamlined interface to a complex subsystem → reference
  • Flyweight — Minimize memory usage by sharing common state across many objects → reference
  • Proxy — Manage access to an object through a surrogate → reference
  • Private Class Data — Limit access to class attributes → reference

Behavioral Patterns

  • Chain of Responsibility — Route requests through a chain of handlers → reference
  • Command — Represent requests as standalone objects → reference
  • Interpreter — Establish a grammar representation and an interpreter for it → reference
  • Iterator — Walk through elements without revealing the underlying structure → reference
  • Mediator — Tame chaotic dependencies through a central coordinator → reference
  • Memento — Snapshot and restore object state without breaking encapsulation → reference
  • Null Object — Supply a do-nothing default to eliminate null checks → reference
  • Observer — Automatically inform dependents when state changes → reference
  • State — Change behavior when internal state transitions → reference
  • Strategy — Make algorithms interchangeable at runtime → reference
  • Template Method — Outline an algorithm skeleton and let subclasses fill in specific steps → reference
  • Visitor — Introduce operations to objects without altering their classes → reference

Read the full file on GitHub · 81 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 81 lines · 141 tokens per session scan A 7224d3da7263

Subscribe to this mod's changes

design-patterns is a skill published in the GitHub repository krzysztofsurdy/code-virtuoso (21 stars, last pushed 3mo ago), licensed MIT. It adds 141 tokens to every session and 1,217 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

hermes-diagnostic-review

Use when running a read-only diagnostic review of recent Hermes sessions to find recurring mistakes, failed tool calls, and repeated fixes, then propose suggestion-only improvements and reusable skills. Human-gated; never auto-applies.

AtlasOmnia/hermes-custom-pack · 49 tokens

instruction-eval

Change one condition an agent runs under (instruction text, the reference material instructions point at, MCP tools and permissions, hooks, skill files), then run the same prompts before and after, several times each, to see what actually changes. Produces an HTML report showing both arms' answers side by side. Use…

2ykwang/agent-skills · 179 tokens

worth-building

Decide how elaborate to build something (simple vs. robust) and return a concrete, PoC-shaped proposal at that level — not over- or under-engineered, but right-sized. Use whenever someone is building something and the investment level is unclear: "quick or proper?", "MVP vs. real product", "is this over-engineering?"…

2ykwang/agent-skills · 128 tokens

django-ticket-triage

Analyze a Django Trac ticket and produce a triage recommendation report — duplicate search, related PRs, forum threads, and the affected source code. Use when the user gives a Django ticket number, or asks whether a ticket is valid, a duplicate, or ready for a triage stage.

2ykwang/agent-skills · 65 tokens

gh-issues

Fetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5]…

SafeAI-Lab-X/ClawKeeper · 116 tokens

healthcheck

Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).

SafeAI-Lab-X/ClawKeeper · 70 tokens