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 vibeeval/vibecosystem --skill caching-patternsgit clone --depth 1 https://github.com/vibeeval/vibecosystemWrote 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/vibeeval/vibecosystem/caching-patterns)<a href="https://agentmods.dev/skills/vibeeval/vibecosystem/caching-patterns"><img src="https://agentmods.dev/badge/skills/vibeeval/vibecosystem/caching-patterns.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
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.00028 | $0.02216 |
| Opus 5 | $0.00014 | $0.01108 |
| Sonnet 5 | $0.00006 | $0.00443 |
| Haiku 4.5 | $0.00003 | $0.00222 |
Grade A, and why
caching-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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 321 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Caching Patterns
Redis-based caching strategies for reducing latency and database load.
Cache Key Design
// Namespace:entity:id format
const CacheKeys = {
market: (id: string) => `market:v1:${id}`,
marketList: (filters: string) => `market:list:${filters}`,
user: (id: string) => `user:v1:${id}`,
userMarkets: (userId: string, page: number) => `user:${userId}:markets:${page}`,
leaderboard: () => 'leaderboard:v1:global'
}
// Version prefix allows instant cache bust on schema change:
// bump v1 → v2 to invalidate all market keys without scanning
Cache-Aside (Lazy Loading)
import Redis from 'ioredis'
const redis = new Redis(process.env.REDIS_URL!)
const DEFAULT_TTL = 300 // 5 minutes
async function getOrSet<T>(
key: string,
loader: () => Promise<T>,
ttl = DEFAULT_TTL
): Promise<T> {
const cached = await redis.get(key)
if (cached) return JSON.parse(cached) as T
const value = await loader()
await redis.setex(key, ttl, JSON.stringify(value))
return value
}
// Usage
async function getMarket(id: string): Promise<Market> {
return getOrSet(
CacheKeys.market(id),
() => db.market.findUniqueOrThrow({ where: { id } }),
300
)
}
Write-Through Pattern
// Write to cache AND database together - cache is always fresh
async function updateMarket(id: string, data: UpdateMarketDto): Promise<Market> {
const updated = await db.market.update({ where: { id }, data })
// Synchronously update cache so next read is fresh
await redis.setex(CacheKeys.market(id), DEFAULT_TTL, JSON.stringify(updated))
return updated
}
async function deleteMarket(id: string): Promise<void> {
await db.market.delete({ where: { id } })
await redis.del(CacheKeys.market(id))
}
Write-Behind (Write-Back) Pattern
// Write to cache immediately, flush to DB asynchronously (higher throughput)
// Risk: data loss on crash if queue not durable
class WriteBehindCache {
private dirtyKeys = new Set<string>()
private flushInterval: NodeJS.Timeout
constructor(private flushEveryMs = 1000) {
this.flushInterval = setInterval(() => this.flush(), flushEveryMs)
}
async write(key: string, value: unknown, dbWriter: () => Promise<void>): Promise<void> {
// Instant cache update
await redis.setex(key, DEFAULT_TTL, JSON.stringify(value))
this.dirtyKeys.add(key)
// Schedule DB write
dbWriter().catch(err => {
console.error(`Write-behind flush failed for ${key}:`, err)
this.dirtyKeys.add(key) // re-queue
})
}
private async flush(): Promise<void> {
// Implementation: drain dirty keys to DB in batch
this.dirtyKeys.clear()
}
destroy(): void {
clearInterval(this.flushInterval)
}
}
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.
- 4d ago First seen · 321 lines · 28 tokens per session scan A 50c212710035
caching-patterns is a skill published in the GitHub repository vibeeval/vibecosystem (530 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 2,216 once invoked, about $0.0001 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
workstation-offbox-backup
Keep a data-heavy workstation app's local database small and fast while preserving full history off-box, with archived data staying directly readable without a restore step. Splits by data shape — searchable text to a log/search platform, bulk media to snapshotted storage — and pulls data rather than scripting a push.…
db-redis
Inspect Redis instances configured in .env (DBREDISN). Use when the user asks to read keys, check cache state, list keys by pattern, or query info/dbsize on a Redis server. Picks connection by label (e.g. 'cache-dev', 'queue-prod') or numeric index. Read-only in v1 — no SET/DEL/FLUSH exposed.
redis-state-management
Comprehensive guide for Redis state management including caching strategies, session management, pub/sub patterns, distributed locks, and data structures.
pinecone
Managed vector DB for production RAG and search.
tanstack-ai-memory-redis
Use when wiring redis() from @tanstack/ai-memory/redis in production — covers client setup (ioredis or node-redis via fromNodeRedis), the storage model, client-side ranking limits, and troubleshooting.
database-expert
Advanced database design and administration for PostgreSQL, MongoDB, and Redis. Use when designing schemas, optimizing queries, managing database performance, or implementing data patterns.