
redis-expert
Expert-level Redis for caching, pub/sub, data structures, and high-performance applications. Use when the user mentions cache, pub/sub, in-memory stores, key-value stores, or NoSQL, or when the task involves Data Structures, Basic Operations, Advanced Patterns, or Redis Streams.
- Installs
- 273
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/personamanagmentlayer/pcl --skill redis-expert- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads redis-expert automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Redis Expert
Expert guidance for Redis - the in-memory data structure store used as cache, message broker, and database with microsecond latency.
Core Concepts
Data Structures
- Strings (binary-safe, up to 512MB)
- Lists (linked lists)
- Sets (unordered unique strings)
- Sorted Sets (sets ordered by score)
- Hashes (field-value pairs)
- Streams (append-only log)
- Bitmaps and HyperLogLog
- Geospatial indexes
Key Features
- In-memory storage with persistence
- Pub/Sub messaging
- Transactions
- Lua scripting
- Pipelining
- Master-Replica replication
- Redis Sentinel (high availability)
- Redis Cluster (horizontal scaling)
Use Cases
- Caching layer
- Session storage
- Real-time analytics
- Message queues
- Rate limiting
- Leaderboards
- Geospatial queries
Installation and Configuration
Docker Setup
# Development
docker run --name redis -p 6379:6379 -d redis:7-alpine
# Production with persistence
docker run --name redis \
-p 6379:6379 \
-v redis-data:/data \
-d redis:7-alpine \
redis-server --appendonly yes --requirepass strongpassword
# Redis with config file
docker run --name redis \
-p 6379:6379 \
-v ./redis.conf:/usr/local/etc/redis/redis.conf \
-d redis:7-alpine \
redis-server /usr/local/etc/redis/redis.conf
Configuration (redis.conf)
# Network
bind 0.0.0.0
port 6379
protected-mode yes
# Security
requirepass strongpassword
# Memory
maxmemory 2gb
maxmemory-policy allkeys-lru
# Persistence
save 900 1 # Save after 900s if 1 key changed
save 300 10 # Save after 300s if 10 keys changed
save 60 10000 # Save after 60s if 10000 keys changed
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
# Replication
replica-read-only yes
repl-diskless-sync yes
# Performance
tcp-backlog 511
timeout 0
tcp-keepalive 300
Redis Cluster
Setup
# Create 6 nodes (3 masters, 3 replicas)
for port in {7000..7005}; do
mkdir -p cluster/${port}
cat > cluster/${port}/redis.conf <<EOF
port ${port}
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
EOF
redis-server cluster/${port}/redis.conf &
done
# Create cluster
redis-cli --cluster create \
127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 \
127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 \
--cluster-replicas 1
Cluster Client
import Redis from 'ioredis';
const cluster = new Redis.Cluster([
{ host: '127.0.0.1', port: 7000 },
{ host: '127.0.0.1', port: 7001 },
{ host: '127.0.0.1', port: 7002 },
]);
// Operations work transparently
await cluster.set('key', 'value');
await cluster.get('key');
Performance Optimization
Connection Pooling
const redis = new Redis({
host: 'localhost',
port: 6379,
maxRetriesPerRequest: 3,
enableReadyCheck: true,
lazyConnect: true,
});
Avoid KEYS Command
// ❌ Bad: Blocks entire server
const keys = await redis.keys('user:*');
// ✅ Good: Use SCAN for large datasets
async function* scanKeys(pattern: string) {
let cursor = '0';
do {
const [newCursor, keys] = await redis.scan(
cursor,
'MATCH',
pattern,
'COUNT',
100
);
cursor = newCursor;
yield* keys;
} while (cursor !== '0');
}
for await (const key of scanKeys('user:*')) {
console.log(key);
}
Optimize Data Structures
// Use hashes for objects instead of multiple keys
// ❌ Bad: 3 keys
await redis.set('user:1000:name', 'Alice');
await redis.set('user:1000:email', 'alice@example.com');
await redis.set('user:1000:age', '30');
// ✅ Good: 1 key
await redis.hset('user:1000', {
name: 'Alice',
email: 'alice@example.com',
age: '30',
});
Anti-Patterns to Avoid
❌ Using Redis as primary database: Use for caching/sessions ❌ Not setting TTL on cache keys: Causes memory bloat ❌ Using KEYS in production: Use SCAN instead ❌ Large values in keys: Keep values small (<1MB) ❌ No monitoring: Track memory, latency, hit rate ❌ Synchronous blocking operations: Use async operations ❌ Not handling connection failures: Implement retry logic ❌ Storing large collections in single key: Split into multiple keys
Common Use Cases
Session Store (Express)
import session from 'express-session';
import RedisStore from 'connect-redis';
app.use(
session({
store: new RedisStore({ client: redis }),
// Session signing secret - from the environment, never a literal.
secret: process.env.SESSION_SECRET,
resave: false,
saveUninitialized: false,
cookie: {
secure: true,
httpOnly: true,
maxAge: 1000 * 60 * 60 * 24, // 24 hours
},
})
);
Job Queue (BullMQ)
import { Queue, Worker } from 'bullmq';
const queue = new Queue('emails', { connection: redis });
// Add job
await queue.add('send-email', {
to: 'user@example.com',
subject: 'Welcome',
body: 'Hello!',
});
// Process jobs
const worker = new Worker(
'emails',
async (job) => {
await sendEmail(job.data);
},
{ connection: redis }
);
Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- Best Practices — Memory Management, Key Naming, Expiration, Persistence, Monitoring
- Node.js Client (ioredis) — Basic Operations, Advanced Patterns, Pub/Sub, Redis Streams, Transactions, Pipelining, Lua Scripts
Resources
- Redis Documentation: https://redis.io/docs/
- ioredis: https://github.com/redis/ioredis
- Redis University: https://university.redis.com/
- BullMQ: https://docs.bullmq.io/
FAQ
What does the redis-expert skill do?
Expert-level Redis for caching, pub/sub, data structures, and high-performance applications. Use when the user mentions cache, pub/sub, in-memory stores, key-value stores, or NoSQL, or when the task involves Data Structures, Basic Operations, Advanced Patterns, or Redis Streams.
How do I install redis-expert?
Run npx skills add https://github.com/personamanagmentlayer/pcl --skill redis-expert in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/redis-expert/ (personal) or .claude/skills/redis-expert/ (project).
Which AI agents can use redis-expert?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is redis-expert safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains redis-expert?
It is published by personamanagmentlayer/pcl in personamanagmentlayer/pcl. It has 273 recorded installs.
More from personamanagmentlayer/pcl
finance-expert
personamanagmentlayer/pcl
Designs, reviews, operates and audits systems that hold, move, account for and report money — ledgers, payments, banking and open finance, reconciliation and close, risk, fraud, AML, markets and portfolio accounting, and corporate finance/FP&A. Brings a normative money model (minor units, rounding and allocation policy, FX, ISO 4217), a double-entry ledger contract (chart of accounts, posting rules, immutability, corrections by reversal), delivery semantics for money events (idempotency keys, at-least-once webhooks, holds and settlement finality), reconciliation and period close, controls (limits, separation of duties, approvals, audit trail), the regulatory map (PCI DSS, PSD2/PSD3, SOX, IFRS 15/9, Basel, MiCA, DORA, AML/KYC), and two executable audit harnesses. Use it whenever a task touches an amount of money — a balance, a charge, a refund, a payout, a transfer, an invoice, a fee, a tax, an FX conversion, an interest accrual, a journal entry, a trial balance, a settlement file, a ch
telecommunications-expert
personamanagmentlayer/pcl
Expert-level telecommunications systems, network management, billing, 5G, SDN, and telecom infrastructure. Use when the user mentions telecom, networking, 5G, billing, OSS, or BSS, or when the task involves Telecommunications Systems, Network Technologies, Standards and Protocols, or Network Management.
trading-expert
personamanagmentlayer/pcl
Expert-level algorithmic trading, market systems, quantitative analysis, and trading platforms. Use when the user mentions algorithmic trading, quant, markets, finance, or high-frequency trading, or when the task involves Trading Systems, Market Data, or Execution.
real-estate-expert
personamanagmentlayer/pcl
Expert-level real estate systems, property management, MLS integration, CRM, virtual tours, and market analysis. Use when the user mentions property, MLS, CRM, proptech, or listings, or when the task involves Real Estate Systems, PropTech Solutions, Standards and Regulations, or Listing Management.
banking-expert
personamanagmentlayer/pcl
Expert-level banking systems, core banking, regulations, and banking technology. Use when the user mentions finance, core banking, regulations, or payments, or when the task involves Banking Systems or Key Technologies.
insurance-expert
personamanagmentlayer/pcl
Expert-level insurance systems, underwriting, claims processing, actuarial analysis, risk assessment, and insurtech solutions. Use when the user mentions underwriting, claims, actuarial, risk, or insurtech, or when the task involves Insurance Systems, Insurance Types, Standards and Regulations, or Claims Processing.
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-postgres-setup
prisma/skills
Obtain or reuse a Prisma Postgres database and connect an application. Use when the user needs a database and has none configured ("I need a database", "add a Postgres database", "set up a database for this app"), runs or mentions create-db or npx create-db, or asks to set up or connect Prisma Postgres, including in v0 and the Vercel Marketplace. Hands Prisma ORM configuration to prisma-orm-setup; reuses an existing connection first and honors an explicit provider, driver, alternative ORM, or database-only choice.