design-patterns-skill

design-patterns-skill is a skill for OpenCode from darellchua2/opencode-config-template. It costs 32 tokens per session (5,592 once invoked), scanned A, original, Apache-2.0.

A guide to common object-oriented design patterns, such as Factory, Adapter, Strategy, and Observer, with practical examples. It helps decide when a pattern fits and when a simpler solution is better.

In plain words
What is it for?
Use it to recognize suitable patterns, refactor existing code, and extend behavior without unnecessary rewrites.
Why use it?
It reduces guesswork when code has repeated conditionals, complex object creation, or behavior that keeps expanding. It also helps avoid adding abstractions that make code harder to maintain.

Skill for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: mentions OpenCode.

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/darellchua2/opencode-config-template/design-patterns-skill
Any agent
npx skills add darellchua2/opencode-config-template --skill design-patterns-skill
Clone the repo
git clone --depth 1 https://github.com/darellchua2/opencode-config-template

Made for: OpenCode.

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-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/design-patterns-skill.svg)](https://agentmods.dev/skills/darellchua2/opencode-config-template/design-patterns-skill)
Your own site
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/design-patterns-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/design-patterns-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,592 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00032 $0.05592
Opus 5 $0.00016 $0.02796
Sonnet 5 $0.00006 $0.01118
Haiku 4.5 $0.00003 $0.00559

Measured 2d ago against content hash 94968fc1f697, 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-skill scanned grade A with 1 finding 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 2d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

def fetch(self, url: str):
opencode_app/.opencode/skills/design-patterns-skill/SKILL.md · 873 lines

How it starts

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

What I do

I help you identify and apply appropriate design patterns:

  1. Pattern Recognition: Identify when a design pattern is the right solution
  2. Prevent Over-Engineering: Avoid forcing patterns where they don't belong
  3. Apply Creational Patterns: Singleton, Factory, Builder, Prototype
  4. Apply Structural Patterns: Adapter, Decorator, Proxy, Composite
  5. Apply Behavioral Patterns: Strategy, Observer, Template Method, Command
  6. Refactor to Patterns: Let patterns emerge from refactoring, not upfront design

When to use me

Use this skill when:

  • You have a design problem and wonder if a pattern applies
  • Code has repeated type-checking or switch statements
  • You need to add behavior without modifying existing code
  • Objects need to be created with complex configuration
  • Multiple objects need to be treated uniformly
  • You're tempted to add a pattern but unsure if it's needed

Do NOT use this skill when:

  • You want to add patterns "just in case"
  • The simple solution works fine
  • You're designing before you have a real problem

Prerequisites

  • Understanding of object-oriented programming
  • Knowledge of interfaces and abstractions
  • Familiarity with basic refactoring techniques
  • A real design problem to solve (not hypothetical)

What Are Design Patterns?

Reusable solutions to common design problems. A shared vocabulary for discussing design.

WARNING: Don't Force Patterns

"Let patterns emerge from refactoring, don't force them upfront."

Patterns should solve problems you HAVE, not problems you MIGHT have.

When to Use Patterns

  1. You recognize the problem - You've seen it before
  2. The pattern fits - Not forcing it
  3. It simplifies - Doesn't add unnecessary complexity
  4. Team understands it - Shared knowledge

Creational Patterns

Singleton

Purpose: Ensure only one instance exists.

When to use: Global configuration, connection pools, logging.

Warning: Often overused. Consider dependency injection instead.

Read the full file on GitHub · 873 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. 2d ago First seen · 873 lines · 32 tokens per session scan A 94968fc1f697

Subscribe to this mod's changes

design-patterns-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed 5d ago), licensed Apache-2.0. It adds 32 tokens to every session and 5,592 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

llm-friendly-context

Clarifies inputs, outputs, success criteria, decisions, and unresolved conditions so downstream consumers can execute without guessing. Use when writing or revising LLM-facing prompts, handoffs, planning artifacts, reviews, reports, or generated instructions.

shinpr/claude-code-workflows · 52 tokens

ring:exploring-codebases

Exploring a codebase across phases: scopes the target, detects architecture, components, and layers, deep-dives each discovered perspective, then synthesizes findings into actionable guidance with file:line evidence. Use to understand how a feature or system works before planning changes, or to orient on an unfamiliar…

LerianStudio/ring · 91 tokens

ring:mapping-feature-relationships

Mapping how features relate and phasing the work: categorizing PRD features, grouping them into domains, charting cross-feature journeys, dependencies, and integration points, and defining the binding Phases that plan.md mirrors one-to-one at Gate 7. Gate 2 of ring:planning-large-features; runs after…

LerianStudio/ring · 104 tokens

megalinter-check

Collect MegaLinter lint errors for the current repository. Use when the user wants to know if the code passes linting, why the MegaLinter CI job fails, or before/after fixing lint errors. Two modes - watch a CI job (GitHub Actions, GitLab CI, Azure Pipelines, Bitbucket Pipelines) and parse its logs, or run MegaLinter…

oxsecurity/megalinter · 96 tokens

bestie-features

Add BestieTemplate features (AGENTS.md, changelog, dependabot, pre-commit, lint workflow, testitem runner) to a Julia package with the bestie CLI — no Julia needed. Use when asked to add one of these files/setups to a package, or to see what BestieTemplate can add.

JuliaBesties/BestieTemplate.jl · 71 tokens