design-patterns-creational-structural

design-patterns-creational-structural is a skill for Claude Code, Codex from mickeyyaya/refactoring-skills. It costs 51 tokens per session (2,678 once invoked), scanned A, original, MIT.

A code-review guide to creational and structural design patterns, which organize object creation and how objects fit together.

In plain words
What is it for?
Use it when reviewing object creation, class composition, adapters, builders, factories, inheritance, or shared-instance designs.
Why use it?
It helps identify scattered construction logic, rigid class relationships, missing abstractions, and duplication that make code harder to change.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when reviewing object creation, class composition, adapters, builders, factories, inheritance, or shared-instance designs.

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

Made for: Claude Code, Codex.

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-creational-structural

README.md
[![agentmods](https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/design-patterns-creational-structural/github.svg)](https://agentmods.dev/skills/mickeyyaya/refactoring-skills/design-patterns-creational-structural)
Your own site
<a href="https://agentmods.dev/skills/mickeyyaya/refactoring-skills/design-patterns-creational-structural"><img src="https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/design-patterns-creational-structural/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 design-patterns-creational-structural

Your own site · 80×15
<a href="https://agentmods.dev/skills/mickeyyaya/refactoring-skills/design-patterns-creational-structural"><img src="https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/design-patterns-creational-structural.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,678 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.00051 $0.02678
Opus 5 $0.00026 $0.01339
Sonnet 5 $0.00010 $0.00536
Haiku 4.5 $0.00005 $0.00268

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

Security

Grade A, and why

design-patterns-creational-structural 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 10d 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/design-patterns-creational-structural/SKILL.md · 308 lines

How it starts

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

Design Patterns: Creational and Structural

Overview

Creational patterns control how objects are created. Structural patterns control how objects are composed into larger structures. Recognizing which pattern is — or should be — present is a core code review skill.

When to Use

  • Object instantiation logic scattered or tightly coupled to concrete classes
  • Class hierarchies becoming difficult to extend independently
  • Missing abstraction causing duplication or fragility

Quick Reference

Pattern Category Core Problem Solved Key Red Flag
Factory Method Creational Subclasses choose which class to instantiate new ConcreteClass() scattered across callers
Abstract Factory Creational Create families of related objects Mixed product-family objects in one branch
Builder Creational Construct complex objects step by step Telescoping constructors or long optional-param lists
Prototype Creational Clone objects without coupling to class Manual field-by-field copy code
Singleton Creational One shared instance (use sparingly) Global state hiding dependencies
Adapter Structural Bridge incompatible interfaces Conversion logic duplicated at every call site
Bridge Structural Vary abstraction and implementation independently Exponential subclass explosion
Composite Structural Treat leaves and composites uniformly instanceof checks for leaf vs. group
Decorator Structural Add behavior dynamically without subclassing Subclass explosion for feature combinations
Facade Structural Simplified interface to complex subsystem Caller knows too many internal classes
Flyweight Structural Share fine-grained objects to reduce memory Thousands of near-identical objects
Proxy Structural Control access to another object Cross-cutting concerns duplicated across callers

Creational Patterns

1. Factory Method

Read the full file on GitHub · 308 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. 10d ago First seen · 308 lines · 51 tokens per session scan A 5694e58d89d2

Subscribe to this mod's changes

design-patterns-creational-structural is a skill published in the GitHub repository mickeyyaya/refactoring-skills (6 stars, last pushed 5mo ago), licensed MIT. It adds 51 tokens to every session and 2,678 once invoked, about $0.0003 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-31.