universal-patterns

universal-patterns is a skill for Claude Code from MadAppGang/claude-code. It costs 32 tokens per session (1,895 once invoked), scanned A, original, MIT.

A guide to software structure and coding patterns that apply across programming languages. It covers ways to separate user interfaces, business rules, data access, and external services, along with dependency injection and error handling.

In plain words
What is it for?
Use it when organising applications, separating responsibilities, introducing layers, or deciding how components should depend on one another.
Why use it?
It helps prevent tangled code by giving projects a consistent structure as they grow.

Skill for Claude Code

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

Part of the dev plugin — 47 skills, 12 commands, 14 agents shipped together

Good fit Use it when organising applications, separating responsibilities, introducing layers, or deciding how components should depend on one another.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/madappgang/claude-code/universal-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 MadAppGang/claude-code --skill universal-patterns
Clone the repo
git clone --depth 1 https://github.com/MadAppGang/claude-code

Made for: Claude Code.

Or install dev, the plugin that ships this one along with the rest of its 47 skills, 12 commands, 14 agents.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/madappgang/claude-code/universal-patterns"><img src="https://agentmods.dev/badge/skills/madappgang/claude-code/universal-patterns.svg" alt="Reviewed on agentmods" width="80" 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 1,895 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.00032 $0.01895
Opus 5.5 $0.00013 $0.00758
Sonnet 5.5 $0.00006 $0.00379
Haiku 4.5 $0.00003 $0.00189

Measured 3mo ago against content hash f15075e283d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

universal-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 3mo 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.

plugins/dev/skills/core/universal-patterns/SKILL.md · 310 lines

How it starts

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

Universal Development Patterns

Overview

Language-agnostic development patterns and best practices applicable across all technology stacks.

Architecture Patterns

Layered Architecture

┌─────────────────────────────┐
│     Presentation Layer      │  UI, API handlers, CLI
├─────────────────────────────┤
│     Application Layer       │  Use cases, services
├─────────────────────────────┤
│       Domain Layer          │  Business logic, entities
├─────────────────────────────┤
│    Infrastructure Layer     │  DB, cache, external APIs
└─────────────────────────────┘

When to Use: Most applications benefit from clear separation of concerns.

Clean Architecture

         ┌─────────────────┐
         │   Frameworks    │  (outermost)
         │   & Drivers     │
     ┌───┴─────────────────┴───┐
     │    Interface Adapters    │
     │   (Controllers, Gateways)│
 ┌───┴─────────────────────────┴───┐
 │        Application Business      │
 │           Rules (Use Cases)      │
 ┌─────────────────────────────────┐
 │    Enterprise Business Rules     │  (innermost)
 │         (Entities)               │
 └─────────────────────────────────┘

Dependency Rule: Dependencies point inward. Inner layers don't know about outer layers.

Component-Based Architecture (Frontend)

src/
├── components/
│   ├── common/         # Shared UI components
│   ├── layout/         # Layout components
│   └── features/       # Feature-specific components
├── hooks/              # Custom hooks
├── stores/             # State management
├── services/           # API services
└── utils/              # Utilities

Code Organization Principles

Single Responsibility

Each module/function should do ONE thing well.

// BAD: Multiple responsibilities
function processUser(user) {
  validateUser(user);
  saveToDatabase(user);
  sendEmail(user);
  logAnalytics(user);
}

// GOOD: Single responsibility
function validateUser(user) { /* validation only */ }
function saveUser(user) { /* persistence only */ }
function notifyUser(user) { /* notification only */ }

Read the full file on GitHub · 310 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. 3mo ago First seen · 310 lines · 32 tokens per session scan A f15075e283d4

Subscribe to this mod's changes

universal-patterns is a skill published in the GitHub repository MadAppGang/claude-code (291 stars, last pushed 8mo ago), licensed MIT. It adds 32 tokens to every session and 1,895 once invoked, about $0.0001 per session on Opus 5.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

universal-patterns compared with skills from other repositories

universal-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
universal-patternsMadAppGang/claude-codeSkill2918mo agoMITA32Claude Code
event_drivenvuralserhat86/antigravity-agentic-skillsSkill4311mo agononeA36Claude Code, Codex
event_drivenDonggangChen/antigravity-agentic-skillsSkill211mo agononeA36Claude Code, Codex
nodejs-project-archabczsl520/nodejs-project-archSkill211mo agoMITA100Claude Code, Codex
code-architecturecuriositech/windags-skillsSkill217d agononeA104Claude Code
cache_patternsvuralserhat86/antigravity-agentic-skillsSkill4311mo agononeA26Claude Code
cache_patternsDonggangChen/antigravity-agentic-skillsSkill211mo agononeA26Claude Code