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.
npx agentmods add skills/madappgang/claude-code/universal-patternsnpx skills add MadAppGang/claude-code --skill universal-patternsgit clone --depth 1 https://github.com/MadAppGang/claude-codeWrote 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.
[](https://agentmods.dev/skills/madappgang/claude-code/universal-patterns)<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="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00032 | $0.01895 |
| Opus 5 | $0.00016 | $0.00948 |
| Sonnet 5 | $0.00006 | $0.00379 |
| Haiku 4.5 | $0.00003 | $0.00189 |
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 yesterday.
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.
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 */ }
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.
- yesterday First seen · 310 lines · 32 tokens per session scan A f15075e283d4
universal-patterns is a skill published in the GitHub repository MadAppGang/claude-code (279 stars, last pushed 5mo ago), licensed MIT. It adds 32 tokens to every session and 1,895 once invoked, about $0.0002 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-09-03.
Other skills, from other repositories
event_driven
Structure systems around asynchronous, event-based communication to decouple producers and consumers for improved scalability and resilience. Use when building loosely coupled systems with asynchronous message-based communication.
event_driven
Structure systems around asynchronous, event-based communication to decouple producers and consumers for improved scalability and resilience. Use when building loosely coupled systems with asynchronous message-based communication.
nodejs-project-arch
Node.js project architecture standards for AI-assisted development. Enforces file splitting (<400 lines), config externalization, route modularization, and admin dashboards. Use when creating new Node.js projects, refactoring large single-file codebases, or when AI context window is being consumed by oversized files.…
code-architecture
Application architecture patterns and code organization — clean architecture, hexagonal architecture, feature-based structure, dependency inversion, module boundaries, SOLID principles at module scale. Activate on "clean architecture", "hexagonal architecture", "feature-based structure", "dependency inversion"…
cache_patterns
Instruction set for enabling and operating the Spring Cache abstraction in Spring Boot when implementing application-level caching for performance-sensitive workloads.
cache_patterns
Instruction set for enabling and operating the Spring Cache abstraction in Spring Boot when implementing application-level caching for performance-sensitive workloads.