RE

Expert configuration and implementation patterns for Redis caching and data management.

Install

mkdir -p .claude/skills/redis-expert && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14226" && unzip -o skill.zip -d .claude/skills/redis-expert && rm skill.zip

Installs to .claude/skills/redis-expert

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Redis expert. Caching strategies, session storage, rate limiting, pub/sub. Use for caching implementation and Redis configuration.
130 chars✓ has a “when” trigger
Beginner

Key capabilities

  • Install Redis server on Ubuntu or Docker
  • Set and retrieve string, hash, list, and set data types
  • Implement Cache-Aside, Write-Through, Write-Behind, and TTL caching strategies
  • Integrate Redis with Node.js for caching and session management
  • Apply rate limiting using Redis INCR and EXPIRE commands
  • Utilize Redis Pub/Sub for message broadcasting

How it works

Redis stores data in-memory as key-value pairs, allowing for fast read and write operations. It supports various data structures and can be integrated into applications using client libraries.

Inputs & outputs

You give it
A key-value pair, a list of items, or a hash object
You get back
The stored value, a list item, or a boolean indicating success

When to use redis-expert

  • Implement Redis caching
  • Set up rate limiting
  • Configure session storage
  • Perform Redis key management

About this skill

Redis Expert

Installation

# Ubuntu
apt install redis-server -y
systemctl enable redis-server

# Docker
docker run -d --name redis -p 6379:6379 redis:alpine

Basic Commands

redis-cli

# Strings
SET key "value"
GET key
SETEX key 3600 "value"    # With TTL (1 hour)
TTL key                    # Check TTL

# Hash (objects)
HSET user:1 name "John" email "[email protected]"
HGET user:1 name
HGETALL user:1

# Lists
LPUSH queue "task1"
RPOP queue

# Sets
SADD tags "node" "redis"
SMEMBERS tags

# Sorted Sets
ZADD leaderboard 100 "player1"
ZRANGE leaderboard 0 -1 WITHSCORES

Node.js Integration

import { createClient } from 'redis';

const redis = createClient({ url: 'redis://localhost:6379' });
await redis.connect();

// Cache pattern
async function getUser(id: string) {
  const cached = await redis.get(`user:${id}`);
  if (cached) return JSON.parse(cached);
  
  const user = await db.user.findUnique({ where: { id } });
  await redis.setEx(`user:${id}`, 3600, JSON.stringify(user));
  return user;
}

// Invalidate
await redis.del(`user:${id}`);

Caching Strategies

StrategyUse CaseImplementation
Cache-AsideRead-heavyCheck cache → Miss → Load DB → Store cache
Write-ThroughConsistencyWrite DB → Write cache
Write-BehindWrite-heavyWrite cache → Async write DB
TTLGeneralSet expiration time

Common Patterns

// Rate limiting
async function rateLimit(ip: string, limit = 100) {
  const key = `rate:${ip}`;
  const count = await redis.incr(key);
  if (count === 1) await redis.expire(key, 60);
  return count <= limit;
}

// Session storage
app.use(session({
  store: new RedisStore({ client: redis }),
  secret: 'secret',
  resave: false,
  saveUninitialized: false
}));

// Pub/Sub
await redis.subscribe('channel', (message) => {
  console.log('Received:', message);
});
await redis.publish('channel', 'Hello!');

When not to use it

  • When a persistent, transactional database is required
  • For complex query patterns that require relational database features
  • When data integrity and durability are the absolute highest priority without additional persistence layers

Limitations

  • The skill focuses on basic commands and common patterns, not advanced Redis features or cluster management.
  • Node.js integration examples are provided, but other language integrations are not detailed.
  • The skill does not cover Redis persistence configurations or high-availability setups.

How it compares

This skill provides specific commands and Node.js integration examples for Redis, offering a direct approach to implementing caching and other patterns compared to manually configuring a database.

Compared to similar skills

redis-expert side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
redis-expert (this skill)06moReviewBeginner
supabase-developer957moReviewIntermediate
senior-backend147moReviewAdvanced
database-migration32moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

supabase-developer

daffy0208

Build full-stack applications with Supabase (PostgreSQL, Auth, Storage, Real-time, Edge Functions). Use when implementing authentication, database design with RLS, file storage, real-time features, or serverless functions.

95185

senior-backend

davila7

Comprehensive backend development skill for building scalable backend systems using NodeJS, Express, Go, Python, Postgres, GraphQL, REST APIs. Includes API scaffolding, database optimization, security implementation, and performance tuning. Use when designing APIs, optimizing database queries, implementing business logic, handling authentication/authorization, or reviewing backend code.

1446

database-migration

wshobson

Execute database migrations across ORMs and platforms with zero-downtime strategies, data transformation, and rollback procedures. Use when migrating databases, changing schemas, performing data transformations, or implementing zero-downtime deployment strategies.

324

cloudbase-guidelines

TencentCloudBase

Essential CloudBase (TCB, Tencent CloudBase, 云开发, 微信云开发) development guidelines. MUST read when working with CloudBase projects, developing web apps, mini programs, or backend services using CloudBase platform.

17

prisma-connection-pool-exhaustion

blader

Fix Prisma "Too many connections" and connection pool exhaustion errors in serverless environments (Vercel, AWS Lambda, Netlify). Use when: (1) Error "P2024: Timed out fetching a new connection from the pool", (2) PostgreSQL "too many connections for role", (3) Database works locally but fails in production serverless, (4) Intermittent database timeouts under load.

14

pagination

dadbodgeoff

Implement cursor-based and offset pagination for APIs. Covers efficient database queries, stable sorting, and pagination metadata.

13

Search skills

Search the agent skills registry