principle-design-patterns

principle-design-patterns is a skill for Claude Code from lugassawan/swe-workbench. It costs 44 tokens per session (744 once invoked), scanned A, original, MIT.

A guide to common ways of organizing software objects and their behaviour. These design patterns give names to recurring problems such as interchangeable algorithms, object creation, and event listeners.

In plain words
What is it for?
Use it when deciding how to vary behaviour, construct objects, connect components, add optional layers, or inject dependencies.
Why use it?
Patterns can clarify a design, but using one without the problem it solves can add unnecessary complexity.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the swe-workbench plugin — 60 skills, 25 commands, 22 agents, 4 hooks shipped together

Good fit Use it when deciding how to vary behaviour, construct objects, connect components, add optional layers, or inject dependencies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lugassawan/swe-workbench/principle-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 lugassawan/swe-workbench --skill principle-design-patterns
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench

Made for: Claude Code.

Or install swe-workbench, the plugin that ships this one along with the rest of its 60 skills, 25 commands, 22 agents, 4 hooks.

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 principle-design-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-design-patterns/github.svg)](https://agentmods.dev/skills/lugassawan/swe-workbench/principle-design-patterns)
Your own site
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/principle-design-patterns"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-design-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for principle-design-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/principle-design-patterns"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-design-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 744 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.00044 $0.00744
Opus 5 $0.00022 $0.00372
Sonnet 5 $0.00009 $0.00149
Haiku 4.5 $0.00004 $0.00074

Measured 9d ago against content hash aae11f626f58, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

principle-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 9d 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/principle-design-patterns/SKILL.md · 73 lines

How it starts

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

Design Patterns — the ones worth knowing

Patterns are vocabulary, not goals. Reach for one only when the problem it solves is actually present.

Strategy

Problem: an algorithm varies independently of its caller. Use when: multiple interchangeable behaviors selected at runtime (pricing rules, compression, sort orders). Overkill when: there is only one strategy. Modern alternative: a first-class function or lambda.

Factory Method

Problem: construction is non-trivial or must be swappable. Use when: the concrete type depends on input or config. Overkill when: new Thing() works and always will. Modern alternative: a constructor function plus DI at the composition root.

Observer

Problem: many objects need to react to a state change. Use when: loose coupling between emitter and listeners (UI, domain events). Overkill when: one listener, ever — call it directly. Modern alternative: language-native events, reactive streams, domain events on a bus.

Decorator

Problem: add behavior without subclassing the world. Use when: stacking optional behavior — caching, logging, retries around a core call. Overkill when: no composition, one behavior. Modern alternative: middleware chains, higher-order functions.

Adapter

Problem: two interfaces should work together but don't. Use when: integrating a third-party or legacy API into your domain types. Overkill when: you control both sides — just change one.

Facade

Problem: a subsystem has too many moving parts for its callers. Use when: simplifying a complex API for the common 80%. Overkill when: the facade just forwards one call.

Template Method

Problem: the skeleton of an algorithm is fixed but steps vary. Use when: several variants share a clear sequence. Overkill when: the sequence is two steps. Warning: easy to abuse — prefer Strategy when steps are independent.

Read the full file on GitHub · 73 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. 9d ago First seen · 73 lines · 44 tokens per session scan A aae11f626f58

Subscribe to this mod's changes

principle-design-patterns is a skill published in the GitHub repository lugassawan/swe-workbench (2 stars, last pushed yesterday), licensed MIT. It adds 44 tokens to every session and 744 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

design-blueprint

Run a complete design workflow -- from establishing context through four progressive design levels (Capabilities, Components, Interactions, Contracts) to an approved blueprint. Composes knowledge-priming, context-anchoring, learning-harvest, collaborative-judgment, design-first, architecture, and domain-driven-design…

techygarg/lattice · 140 tokens

modern-css

Proactively apply when creating design systems, component libraries, or any frontend application. Triggers on CSS Grid, Subgrid, Flexbox, Container Queries, :has(), @layer, @scope, CSS nesting, @property, @function, if(), oklch, color-mix, light-dark, relative color, @starting-style, scroll-driven animations, view…

ccheney/robust-skills · 181 tokens

mermaid-diagrams

Proactively suggest diagrams when explaining complex systems. Triggers on diagrams, charts, visualizations, flowcharts, sequence diagrams, architecture diagrams, ER diagrams, state machines, Gantt charts, mindmaps, C4, class diagrams, git graphs, kanban boards, sankey, timelines, quadrant charts, XY charts, packet…

ccheney/robust-skills · 105 tokens

design-first

Guide structured design thinking through 5 progressive levels before any code is written. Levels: Capabilities, Components, Interactions, Contracts, Implementation. Use when building new features, refactoring significant code, designing modules, or when the user says 'design this', 'architect this', 'let's think…

techygarg/lattice · 111 tokens

ux-heuristics

Evaluate and improve interface usability using heuristic analysis. Use when the user mentions "usability audit", "users are confused", "form usability", "navigation problems", "Nielsen heuristics", "cognitive walkthrough", or "is this easy to use". Also trigger when reviewing a design for usability issues, improving…

wondelai/skills · 122 tokens

new-skill

Scaffold a new brooks-lint analysis skill so it passes npm run validate and npm run evals on the first try — generates skills/{name}/SKILL.md (with the mandatory "Do NOT trigger for:" clause and a Process section citing guide step ranges) plus skills/{name}/{name}-guide.md (sequentially numbered steps), then appends…

hyhmrright/brooks-lint · 145 tokens