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 skills add nWave-ai/nWave --skill nw-sd-patternsgit clone --depth 1 https://github.com/nWave-ai/nWaveWrote 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/nwave-ai/nwave/nw-sd-patterns)<a href="https://agentmods.dev/skills/nwave-ai/nwave/nw-sd-patterns"><img src="https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-sd-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.1 | $0.00043 | $0.01978 |
| Opus 5 | $0.00022 | $0.00989 |
| Sonnet 5 | $0.00009 | $0.00396 |
| Haiku 4.5 | $0.00004 | $0.00198 |
Grade A, and why
nw-sd-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 — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Core Distributed Systems Patterns
Load Balancing
Problem: single server can't handle all traffic.
Approaches: Round Robin (simple, ignores load) | Weighted Round Robin (accounts for capacity) | Least Connections (fewest active) | IP Hash (session affinity) | Layer 4/transport (IP/port, fast) | Layer 7/application (HTTP-aware, smarter)
Placement: client-to-web | web-to-app | app-to-database
Trade-offs: LB itself is SPOF -- use active-passive pair | session affinity complicates horizontal scaling -- prefer stateless servers | health checks critical
Caching
Problem: repeated DB reads are slow.
Strategies: Cache-aside/lazy loading (app checks cache, fills on miss -- most common) | Write-through (write cache+DB simultaneously) | Write-behind (cache only, async to DB) | Read-through (cache fronts DB transparently)
Cache-aside pattern: Read: cache.get(key) -> hit? return : db.read -> cache.set -> return | Write: db.write -> cache.delete(key)
Eviction: LRU (most common) | LFU (skewed access) | TTL (time-based)
Problems: thundering herd (many misses simultaneously -- use locking/coalescing) | cache penetration (non-existent keys -- Bloom filter or cache null) | cache avalanche (mass expiration -- jittered TTLs) | size cache based on working set, not total data
Database Replication
Master-Slave: all writes to master, reads to replicas | replication lag = eventual consistency | master fails: promote replica
Multi-Master: writes to any node, conflict resolution required | better write availability, much more complex | suitable for multi-region
Trade-offs: sync replication = consistency but higher write latency | async = lower latency but data loss risk on failure
Database Sharding
Problem: single DB can't handle write volume or data size.
Strategies: Hash-based (hash(key) % N -- even but resharding painful) | Range-based (ranges, can have hotspots) | Directory-based (lookup table, flexible but SPOF)
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 · 172 lines · 43 tokens per session scan A 5f38b31c8a49
nw-sd-patterns is a skill published in the GitHub repository nWave-ai/nWave (608 stars, last pushed yesterday), licensed MIT. It adds 43 tokens to every session and 1,978 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-06.
Other skills, from other repositories
api-database-redis
Redis in-memory data store patterns with ioredis and node-redis -- caching, sessions, rate limiting, pub/sub, streams, queues, transactions, cluster.
api-caching-strategies
Application-level caching strategies, HTTP caching, cache invalidation, and stampede prevention.
api-performance-api-performance
Query optimization, caching, indexing, connection pooling, async patterns.
performant-laravel
Strategies for high-performance, scalable Laravel systems (Octane, DB Optimization, Redis, Microservices).
performance-optimization
Optimize systems for speed and scale (Caching, Sharding, Async).
caching-strategies
Implement effective caching at every layer: in-memory, Redis, CDN, and browser. Activate whenever the user asks about caching, performance optimization for repeated data access, Redis patterns, CDN configuration, cache invalidation, HTTP cache headers, memoization, or stale-while-revalidate strategies.