redis-patterns
Redis patterns including caching strategies, pub/sub, streams for event processing, Lua scripts, and data structures
npx skills add rohitg00/awesome-claude-code-toolkit --skill redis-patterns --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Redis Patterns ## Caching Strategies ```typescript async function getUser(userId: string): Promise<User> { const cacheKey = `user:${userId}`; const cached = await redis.get(cacheKey); if (cached) { return JSON.parse(cached); } const user = await db.user.findUnique({ where: { id: userId } }); if (user) { await redis.set(cacheKey, JSON.stringify(user), "EX", 3600); } return user; } async function invalidateUser(userId: string): Promise<void> { await redis.del(`user:${userId}`); await redis.del(`user:${userId}:orders`); } async function cacheAside<T>( key: string, ttlSeconds: number, fetcher: () => Promise<T> ): Promise<T> { const cached = await redis.get(key); if (cached) return JSON.parse(cached); const value = await fetcher(); await redis.set(key, JSON.stringify(value), "EX", ttlSeconds); return value; } ``` ## Rate Limiting with Sliding Window ```typescript async function isRateLimited( clientId: string, limit: number, windowSeconds: number ): Promise<boolean> { const key = `ratelimit:${clientId}`; const now = Date.now(); const windowStart = now - windowSeconds * 1000; const pipe = redis.multi(); pipe.zremrangebyscore(key, 0, windowStart); pipe.zadd(key, now, `${now}:${crypto.ra
- Caching Strategies
- Rate Limiting with Sliding Window
- Pub/Sub
- Streams for Event Processing
- Lua Script for Atomic Operations
- Anti-Patterns
- Checklist
What does the redis-patterns skill do?
Redis patterns including caching strategies, pub/sub, streams for event processing, Lua scripts, and data structures
How do I install it?
Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill redis-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From rohitg00/awesome-claude-code-toolkit, a repository with 2,438 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.