.agent/skills/redis-expert/SKILL.md
Redis expert. Caching strategies, session storage, rate limiting, pub/sub. Use for caching implementation and Redis configuration.
npx skillsauth add ripgraphics/authorsinfo redis-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
# Ubuntu
apt install redis-server -y
systemctl enable redis-server
# Docker
docker run -d --name redis -p 6379:6379 redis:alpine
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
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}`);
| Strategy | Use Case | Implementation | |----------|----------|----------------| | Cache-Aside | Read-heavy | Check cache → Miss → Load DB → Store cache | | Write-Through | Consistency | Write DB → Write cache | | Write-Behind | Write-heavy | Write cache → Async write DB | | TTL | General | Set expiration time |
// 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!');
tools
Webpack build optimization expert with deep knowledge of configuration patterns, bundle analysis, code splitting, module federation, performance optimization, and plugin/loader ecosystem. Use PROACTIVELY for any Webpack bundling issues including complex optimizations, build performance, custom plugins/loaders, and modern architecture patterns. If a specialized expert is a better fit, I will recommend switching and stop.
development
Web application security expert. OWASP Top 10, XSS, SQLi, CSRF, SSRF, authentication bypass, IDOR. Use for web app security testing.
testing
Vitest testing framework expert for Vite integration, Jest migration, browser mode testing, and performance optimization
tools
Vite build optimization expert with deep knowledge of ESM-first development, HMR optimization, plugin ecosystem, production builds, library mode, and SSR configuration. Use PROACTIVELY for any Vite bundling issues including dev server performance, build optimization, plugin development, and modern ESM patterns. If a specialized expert is a better fit, I will recommend switching and stop.