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 hamzabellouch/agent-skills --skill redis-caching-and-pubsubgit clone --depth 1 https://github.com/hamzabellouch/agent-skillsWrote 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/hamzabellouch/agent-skills/redis-caching-and-pubsub)<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/redis-caching-and-pubsub"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/redis-caching-and-pubsub/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.
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/redis-caching-and-pubsub"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/redis-caching-and-pubsub.svg" alt="Reviewed on agentmods" width="80" 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.00064 | $0.02015 |
| Opus 5 | $0.00032 | $0.01007 |
| Sonnet 5 | $0.00013 | $0.00403 |
| Haiku 4.5 | $0.00006 | $0.00201 |
Grade A, and why
redis-caching-and-pubsub 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 7d 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 — 209 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Redis Caching & Pub/Sub Architecture Guide
Production-grade guide for designing, implementing, and scaling Redis as a high-performance cache, session store, real-time pub/sub message broker, and distributed coordinator.
1. Caching Strategies & Design Patterns
1.1 Cache-Aside (Lazy Loading)
The application reads from the cache first. On a cache miss, it reads from the primary database, updates the cache, and returns the result.
+-------------+ 1. Read Key +-------+
| Application | --------------------> | Cache |
| | <-------------------- | |
+-------------+ 2. Cache Hit +-------+
|
| 3. Cache Miss
v
+---------------+
| Primary DB |
+---------------+
- Best For: Read-heavy workloads with unpredictable access patterns.
- Trade-off: Stale data risk if DB writes don't invalidate/update cache; higher latency on cache miss.
1.2 Write-Through Caching
The application writes data directly to the cache, and the cache synchronously writes to the database.
- Best For: Mission-critical reads where cache staleness cannot be tolerated.
- Trade-off: Higher write latency; potential cache pollution with infrequently read data.
1.3 Write-Behind (Write-Back) Caching
The application writes to the cache immediately, and an asynchronous process flushes cache updates to the underlying DB in batches.
- Best For: Write-heavy systems (e.g., analytics, metrics aggregators, counter updates).
- Trade-off: Risk of data loss if Redis crashes before flushing to primary DB.
1.4 Cache Stampede (Thundering Herd) Mitigation
When a popular cache key expires, thousands of concurrent requests hit the backend database simultaneously.
Solution A: Distributed Mutex / Lock
Acquire a lock to recompute the cache value; force other concurrent requests to wait or return stale data.
Solution B: Probabilistic Early Expiration (XFetch Algorithm)
As a key nears expiration, probabilistically refresh it in the background before it expires.
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.
- 7d ago First seen · 209 lines · 64 tokens per session scan A 3993d5f70e29
redis-caching-and-pubsub is a skill published in the GitHub repository hamzabellouch/agent-skills (4 stars, last pushed 1mo ago), licensed MIT. It adds 64 tokens to every session and 2,015 once invoked, about $0.0003 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
redis
Redis in-memory cache, pub/sub, streams, and data structures. Use for caching and real-time data.
bullmq-specialist
BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications. Use when: bullmq, bull queue, redis queue, background job, job queue.
redis-operations
Redis operational runbooks — memory management, eviction policy, persistence config, Sentinel/Cluster, K8s-hosted Redis ops.
bullmq-specialist
BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications.
redis-patterns
Redis patterns — caching (cache-aside, write-through), sessions, pub/sub, work queues, distributed locks, data structures (sorted sets, streams, hashes). Covers ioredis, node-redis, Redis 7+. Use when designing Redis usage in Node.js or Python apps.
redis-caching
Redis caching, rate limiting, session storage, pub/sub, and production integration patterns for TypeScript, Next.js, NestJS, and Prisma applications. Use when adding cache-aside or write-through caching, rate limiting, session or lock storage, pub/sub fanout, or reviewing Redis key design and TTLs.