design-patterns

design-patterns is a skill for Claude Code from camilooscargbaptista/cto-toolkit. It costs 138 tokens per session (997 once invoked), scanned A, original, MIT.

A software design guide and advisor covering common design patterns, SOLID principles, Clean Code, Clean Architecture, domain-driven design, and refactoring.

In plain words
What is it for?
Use it to review or reorganize code, explain design choices, reduce coupling, and plan clearer application architecture.
Why use it?
It helps you choose structures that fit your situation instead of applying patterns by habit. It also makes problems such as tangled responsibilities and tightly connected code easier to identify.

Skill for Claude Code

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

Part of the cto-toolkit plugin — 54 skills, 6 agents, 3 hooks shipped together

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.

agentmods
npx agentmods add skills/camilooscargbaptista/cto-toolkit/design-patterns
Any agent
npx skills add camilooscargbaptista/cto-toolkit --skill design-patterns
Clone the repo
git clone --depth 1 https://github.com/camilooscargbaptista/cto-toolkit

Made for: Claude Code.

Or install cto-toolkit, the plugin that ships this one along with the rest of its 54 skills, 6 agents, 3 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 design-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/camilooscargbaptista/cto-toolkit/design-patterns.svg)](https://agentmods.dev/skills/camilooscargbaptista/cto-toolkit/design-patterns)
Your own site
<a href="https://agentmods.dev/skills/camilooscargbaptista/cto-toolkit/design-patterns"><img src="https://agentmods.dev/badge/skills/camilooscargbaptista/cto-toolkit/design-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 138 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 997 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00138 $0.00997
Opus 5 $0.00069 $0.00498
Sonnet 5 $0.00028 $0.00199
Haiku 4.5 $0.00014 $0.00100

Measured 6d ago against content hash 92a1784bf0d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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.

design-patterns/SKILL.md · 95 lines

How it starts

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

Design Patterns, SOLID & Clean Architecture

You are a software architect advisor. Help the user choose and apply the right patterns for their specific context. Patterns are tools, not rules — always explain WHY a pattern fits, not just HOW to implement it.

SOLID Principles

S — Single Responsibility: A class has one reason to change. Separate concerns, one actor/stakeholder per class.

O — Open/Closed: Open for extension, closed for modification. Strategy pattern solves this: new implementations without editing existing code.

L — Liskov Substitution: Subtypes are substitutable for base types without breaking behavior. If a child breaks the parent's contract, LSP is violated.

I — Interface Segregation: Clients depend only on interfaces they use. Many small interfaces beat one fat interface.

D — Dependency Inversion: Depend on abstractions, not concretions. Domain defines ports (interfaces); infrastructure implements adapters.

See solid-examples.md for detailed TypeScript examples.

Clean Architecture

┌─────────────────────────────────────┐
│           Presentation              │  ← Controllers, CLI, UI
│  ┌─────────────────────────────┐    │
│  │        Application          │    │  ← Use Cases, DTOs
│  │  ┌─────────────────────┐    │    │
│  │  │      Domain          │    │    │  ← Entities, Value Objects, Interfaces
│  │  └─────────────────────┘    │    │
│  └─────────────────────────────┘    │
└─────────────────────────────────────┘
         Infrastructure                   ← DB, APIs, Messaging, Files

Dependency Rule: Dependencies always point inward. Domain knows nothing about infrastructure.

See clean-architecture-guide.md for Entities, Value Objects, Use Cases, and Repositories.

Common Design Patterns

Creational Structural Behavioral
Factory Method Adapter Strategy
Abstract Factory Decorator Observer
Builder Facade Command
Singleton Proxy State
Chain of Responsibility

Read the full file on GitHub · 95 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. 6d ago First seen · 95 lines · 138 tokens per session scan A 92a1784bf0d7

Subscribe to this mod's changes

design-patterns is a skill published in the GitHub repository camilooscargbaptista/cto-toolkit (7 stars, last pushed 5mo ago), licensed MIT. It adds 138 tokens to every session and 997 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-31.