cassini-workshop: Skill for Claude Code

.claude/skills/gof-patterns/SKILL.md

gof-patterns is a skill for Claude Code from opagani/cassini-workshop. It costs 79 tokens per session (1,015 once invoked), scanned A, a copy of gof-patterns, MIT.

A TypeScript reference for the 23 classic Gang of Four design patterns—reusable approaches to common software-design problems. It explains when patterns such as Factory, Adapter, Strategy, and Observer fit, and when simpler TypeScript code is better.

In plain words
What is it for?
Use it when choosing or implementing a design pattern, refactoring code toward one, reviewing pattern misuse, or deciding which pattern fits a problem.
Why use it?
It helps developers choose an appropriate structure when code is hard to change, and avoid adding unnecessary classes or abstractions.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is opagani/cassini-workshop's own configuration. It tells Claude Code how to work on cassini-workshop itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cassini-workshop configures →

Reuse

Borrowing it

Nothing to install: this file belongs to opagani/cassini-workshop. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/opagani/cassini-workshop/main/.claude/skills/gof-patterns/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/opagani/cassini-workshop

Made for: Claude Code.

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 gof-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/opagani/cassini-workshop/gof-patterns/github.svg)](https://agentmods.dev/skills/opagani/cassini-workshop/gof-patterns)
Your own site
<a href="https://agentmods.dev/skills/opagani/cassini-workshop/gof-patterns"><img src="https://agentmods.dev/badge/skills/opagani/cassini-workshop/gof-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 gof-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/opagani/cassini-workshop/gof-patterns"><img src="https://agentmods.dev/badge/skills/opagani/cassini-workshop/gof-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,015 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 100% copy Near-identical to another mod 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.00079 $0.01015
Opus 5 $0.00039 $0.00508
Sonnet 5 $0.00016 $0.00203
Haiku 4.5 $0.00008 $0.00102

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

Security

Grade A, and why

gof-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.

Origin

This is a copy

100% identical to gof-patterns — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/skills/gof-patterns/SKILL.md · 89 lines

How it starts

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

Gang of Four Patterns in TypeScript

The 23 classic design patterns from Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, Helm, Johnson, Vlissides), adapted to idiomatic TypeScript.

🎯 Why: Design for Change

The goal of writing software is to be able to change it safely. Every GoF pattern is a named seam that isolates one axis of change: Strategy hides algorithm choice, Adapter hides a vendor swap, Observer hides who's listening, Factory hides what's instantiated. Reach for a pattern when you have a demonstrated axis of change to absorb. A pattern installed speculatively adds coupling without buying any change-safety.

How to use this skill

  1. Identify the kind of problem from the decision guide below.
  2. Open the matching reference file for the full TypeScript example and the "when to use / when not to" notes.
  3. Prefer the simplest construct that solves the problem. In TypeScript, a union type, a closure, or a plain function often beats a class-heavy pattern. Reach for a GoF pattern when the indirection earns its keep.

Reference files

  • references/creational.md — object creation: Factory Method, Abstract Factory, Builder, Prototype, Singleton.
  • references/structural.md — object composition: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy.
  • references/behavioral.md — object interaction & responsibility: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor.

Decision guide — symptom → pattern

You are trying to… Consider Category
Create objects without naming the concrete class Factory Method, Abstract Factory Creational
Build a complex object step by step Builder Creational
Copy an existing object Prototype Creational
Guarantee exactly one instance Singleton (often a module instead) Creational
Make an incompatible interface usable Adapter Structural
Vary abstraction and implementation independently Bridge Structural
Treat individual objects and groups uniformly Composite Structural
Add behavior to objects without subclassing Decorator Structural
Hide a complex subsystem behind one interface Facade Structural
Share many fine-grained objects cheaply Flyweight Structural
Control access to an object (lazy, remote, guarded) Proxy Structural
Pass a request along a series of handlers Chain of Responsibility Behavioral
Encapsulate a request as an object (undo, queue) Command Behavioral
Evaluate sentences in a small language Interpreter Behavioral
Traverse a collection without exposing its structure Iterator Behavioral
Reduce many-to-many object coupling Mediator Behavioral
Capture and restore object state Memento Behavioral
Notify dependents of state changes Observer Behavioral
Change behavior when internal state changes State Behavioral
Swap one of several algorithms at runtime Strategy Behavioral
Fix an algorithm skeleton, vary steps Template Method Behavioral
Add operations to a class hierarchy without editing it Visitor Behavioral

Read the full file on GitHub · 89 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 89 lines · 79 tokens per session scan A 368a9c5885cb

Subscribe to this mod's changes

gof-patterns is a skill published in the GitHub repository opagani/cassini-workshop (0 stars, last pushed 2mo ago), licensed MIT. It adds 79 tokens to every session and 1,015 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to gof-patterns, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

add-export

Add a new subpath export to the @cyanheads/mcp-ts-core package. Use when creating a new public API surface that consumers import from a dedicated subpath (e.g., @cyanheads/mcp-ts-core/newutil).

cyanheads/mcp-ts-core · 50 tokens

fluent-development

This skill should be used when the user asks to "build a fluent app", "create a servicenow app in typescript", or mentions "servicenow sdk", "now-sdk", "fluent", "scoped app as code", or "pro-code development" — or when the working directory contains a now.config.json or .now.ts files.

serac-labs/serac · 77 tokens

kernelcad-authoring

Author or modify kernelCAD models in TypeScript. Scripts live in .kcad.ts files; the kernelCAD CLI (kernelcad evaluate and kernelcad export stl|step|dxf|3mf|glb -o ) executes them via an OpenCASCADE WASM kernel.

w1ne/kernelCAD-web · 55 tokens

migrate-waniwani-sdk-0.16-to-0.17

Migrate a project from @waniwani/sdk 0.16.x to 0.17.0 and auto-apply its breaking change: useWaniwani() from @waniwani/sdk/mcp/react no longer auto-discovers its config from a WidgetProvider context or by opening its own host connection, so a bare useWaniwani() in a widget silently stops tracking. Skybridge widgets…

WaniWani-AI/sdk · 177 tokens

migrate-waniwani-sdk-0.17-to-0.18

Migrate a project from @waniwani/sdk 0.17.x to 0.18.0 and auto-apply its breaking change: the generic funnel events quote.requested, quote.succeeded, quote.failed, and purchase.completed are removed from the track() taxonomy (with the QuoteSucceededProperties / PurchaseCompletedProperties types and the legacy…

WaniWani-AI/sdk · 172 tokens

model-context

MCP (Model Context Protocol) - Build AI-native servers with tools, resources, and prompts. TypeScript/Python SDKs for Claude Desktop integration.

bobmatnyc/claude-mpm-skills · 34 tokens