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 ronmkr/PromptBook --skill redis-patternsgit clone --depth 1 https://github.com/ronmkr/PromptBookWrote 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/ronmkr/promptbook/redis-patterns)<a href="https://agentmods.dev/skills/ronmkr/promptbook/redis-patterns"><img src="https://agentmods.dev/badge/skills/ronmkr/promptbook/redis-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.
<a href="https://agentmods.dev/skills/ronmkr/promptbook/redis-patterns"><img src="https://agentmods.dev/badge/skills/ronmkr/promptbook/redis-patterns.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.00028 | $0.02964 |
| Opus 5.5 | $0.00011 | $0.01186 |
| Sonnet 5.5 | $0.00006 | $0.00593 |
| Haiku 4.5 | $0.00003 | $0.00296 |
Grade A, and why
redis-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 2mo 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.
This is a copy
88% identical to redis-patterns — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 404 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Redis Patterns
Quick reference for Redis best practices across common backend use cases.
How It Works
Redis is an in-memory data structure store that supports strings, hashes, lists, sets, sorted sets, streams, and more. Individual Redis commands are atomic on a single instance; multi-step workflows require Lua scripts, MULTI/EXEC transactions, or explicit synchronization to stay atomic. Data is optionally persisted via RDB snapshots or AOF logs. Clients communicate over TCP using the RESP protocol; connection pools are essential to avoid per-request handshake overhead.
When to Activate
- Adding caching to an application
- Implementing rate limiting or throttling
- Building distributed locks or coordination
- Setting up session or token storage
- Using Pub/Sub or Redis Streams for messaging
- Configuring Redis in production (pooling, eviction, clustering)
Data Structure Cheat Sheet
| Use Case | Structure | Example Key |
|---|---|---|
| Simple cache | String | product:123 |
| User session | Hash | session:abc |
| Leaderboard | Sorted Set | scores:weekly |
| Unique visitors | Set | visitors:2024-01-01 |
| Activity feed | List | feed:user:456 |
| Event stream | Stream | events:orders |
| Counters / rate limits | String (INCR) | ratelimit:user:123 |
| Bloom filter / HLL | HyperLogLog | hll:pageviews |
Core Patterns
Cache-Aside (Lazy Loading)
import redis
import json
r = redis.Redis(host='localhost', port=6379, decode_responses=True)
def get_product(product_id: int):
cache_key = f"product:{product_id}"
cached = r.get(cache_key)
if cached:
return json.loads(cached)
product = db.query("SELECT * FROM products WHERE id = %s", product_id)
r.setex(cache_key, 3600, json.dumps(product)) # TTL: 1 hour
return product
Write-Through Cache
def update_product(product_id: int, data: dict):
# Write to DB first
db.execute("UPDATE products SET ... WHERE id = %s", product_id)
# Immediately update cache
cache_key = f"product:{product_id}"
r.setex(cache_key, 3600, json.dumps(data))
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.
- 2mo ago First seen · 404 lines · 28 tokens per session scan A 736aacae582a
redis-patterns is a skill published in the GitHub repository ronmkr/PromptBook (2 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 28 tokens to every session and 2,964 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 88% identical to redis-patterns, differing in 5 lines, and is treated as a copy.
redis-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| redis-patternsronmkr/PromptBook | Skill | 2 | 6mo ago | Apache-2.0 | A | 28 | Claude Code, Codex |
| caching-strategyberkcangumusisik/claude-code-practices | Skill | 11 | 7mo ago | MIT | A | 19 | Claude Code |
| bullmq-specialistDokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI | Skill | 513 | 5mo ago | none | A | 47 | Claude Code, Codex |
| backend-patternsonfire7777/universal-ai-skills-library | Skill | 17 | 5d ago | MIT | A | 31 | Codex |
| nestjs-caching-queuesdkmqflx/nestjs-best-practices-plugin | Skill | 1 | 5mo ago | MIT | A | 63 | Claude Code |
| upstash-ratelimit-jsfrontal-labs/mcp-server | Skill | 1 | today | Apache-2.0 | A | 177 | Claude Code, Codex |
| content-hash-cache-patternx-cmd/skill | Skill | 26 | 4mo ago | Apache-2.0 | A | 30 | Claude Code, Codex |