redis
Skill15 starsChanged 42 days agoMITView on GitHub
Expert Redis in-memory data store assistance covering data structures, caching, pub/sub, Lua scripts, Redis Streams, and clustering. Use when building ultra-fast caches, rate limiters, session stores, or message queues.
- Reads credentials
11 other projects use a version of this.
Adopted by
Most recently taken up by
- AnyOrgName/php-skillstheir own version, first seen Nov 8, 2026
- Alteriom/ai-dev-skillstheir own version, first seen Oct 11, 2026
- kid-sid/claude-spellbooktheir own version, first seen Oct 9, 2026
- derogab/agent-kittheir own version, first seen Oct 5, 2026
- fworks-tech/agenthoodtheir own version, first seen Sep 28, 2026
- muxammadmamajonov/dot-claudetheir own version, first seen Jul 6, 2026
Used with
Projects with it also use postgres, performance and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
digitalocean-labsSkillpostgres
Configure DigitalOcean Managed Postgres with bindable variables or schema isolation. Use when setting up databases, creating users, managing permissions, configuring multi-tenant schemas, or troubleshooting database connectivity on App Platform.
Also in 3 projects that use this
klauswgSkillperformance
Optimize web performance for faster loading and better user experience. Use when asked to "speed up my site", "optimize performance", "reduce load time", "fix slow loading", "improve page speed", or "performance audit".
Also in 3 projects that use this
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 3 projects that use this
0xSeroSkillsecurity
Also in 3 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 3 projects that use this
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- kid-sid/claude-spellbook★ 190same name
- AnyOrgName/php-skills★ 4same name
- derogab/agent-kit★ 4same name
- fworks-tech/agenthood★ 3same name
- dversoza/claude-skills★ 2same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- Sorcha-Platform/Sorcha★ 2same name
- Alteriom/ai-dev-skills★ 0same name
- muxammadmamajonov/dot-claude★ 0same name
- sudarshanpjadhav/finggu-skills★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 139
Always Set an Eviction Policy: Configure maxmemory-policy volatile-lru or allkeys-lru to prevent out-of-memory crashes.
- Very specific: line 140
Use Pipelines for Multi-Key Operations: Batch commands with redis.pipeline() to eliminate network roundtrip latency.
- Very specific: line 146
Run the KEYS * command in production: KEYS blocks the single-threaded event loop.
- Very specific: line 148
Use Redis without persistence configurations: Ensure RDB snapshots or AOF (appendonly yes) are active if data loss is unacceptable.
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Redis
Redis (Remote Dictionary Server) is an in-memory data structure store, used as a database, cache, and message broker. It is incredibly fast.
When to Use
- In-Memory Caching & Sub-Millisecond Reads: Caching hot database objects, session state, and computed API payloads in RAM.
- Distributed Locking & Concurrency Control: Coordinating atomic multi-instance synchronization with Redlock or SET NX PX commands.
- High-Velocity Queues & Pub/Sub Messaging: Powering message brokers, task queues (BullMQ, Sidekiq), and real-time event broadcasting.
- Rate Limiting & Sliding Windows: Implementing sliding window rate limiters and leaderboards via Redis Sorted Sets (ZSET).
Quick Start
# Set a value with 10 second expiry
SET session:123 "active" EX 10
# Increment a counter atomically
INCR page:views
# Store a hash (object)
HSET user:100 name "Jeevan" role "admin"Core Concepts
Advanced In-Memory Data Structures
Redis goes far beyond simple string caching, offering rich native data primitives:
| Structure | Typical Use Case | Example Command |
| String | Cache values, atomic counters | INCR counter, SET key val EX 3600 |
| Hash | Object representation (User, Cart) | HSET user:101 name "Alice" role "Admin" |
| List | Job queues, event timelines | LPUSH task_queue job1, BRPOP task_queue 0 |
| Set | Unique tags, mutual followers | SADD tags "web" "api", SINTER setA setB |
| Sorted Set (ZSET) | Leaderboards, sliding rate limits | ZADD leaderboard 4500 "user101" |
| Stream | Event sourcing, append-only logs | XADD mystream * sensor "temp" val 24.5 |
Atomic Distributed Locks (SET NX PX)
Acquires safe mutual exclusion locks across distributed nodes:
import { Redis } from "ioredis";
const redis = new Redis(process.env.REDIS_URL!);
async function acquireLock(
lockKey: string,
ttlMs: number,
): Promise<string | null> {
const token = crypto.randomUUID();
const acquired = await redis.set(lockKey, token, "NX", "PX", ttlMs);
return acquired === "OK" ? token : null;
}
async function releaseLock(lockKey: string, token: string): Promise<boolean> {
// Lua script ensures atomic check-and-delete
const luaScript = `
if redis.call("get", KEYS[1]) == ARGV[1] then
return redis.call("del", KEYS[1])
else
return 0
end
`;
const result = await redis.eval(luaScript, 1, lockKey, token);
return result === 1;
}Sliding Window Rate Limiter with Sorted Sets (ZSET)
Calculates rolling request rates accurately:
async function isRateLimited(
userId: string,
limit: number,
windowSeconds: number,
): Promise<boolean> {
const now = Date.now();
const clearBefore = now - windowSeconds * 1000;
const key = `ratelimit:${userId}`;
const pipeline = redis.pipeline();
pipeline.zremrangebyscore(key, 0, clearBefore); // Remove expired requests
pipeline.zadd(key, now, now.toString()); // Add current request
pipeline.zcard(key); // Count requests in window
pipeline.expire(key, windowSeconds);
const results = await pipeline.exec();
const requestCount = results![2][1] as number;
return requestCount > limit;
}Common Patterns
Distributed Sliding-Window Rate Limiter with Lua Script
Problem: Naive rate limit checks with separate GET/SET calls have race conditions that permit request flooding.
Solution: Execute atomic sliding window rate limiting via Lua script:
-- KEYS[1]: rate limit key (e.g. rate:user123)
-- ARGV[1]: current timestamp in ms
-- ARGV[2]: window size in ms (e.g. 60000)
-- ARGV[3]: max allowed requests
local key = KEYS[1]
local now = tonumber(ARGV[1])
local window = tonumber(ARGV[2])
local limit = tonumber(ARGV[3])
local clearBefore = now - window
redis.call('ZREMRANGEBYSCORE', key, 0, clearBefore)
local currentRequests = redis.call('ZCARD', key)
if currentRequests < limit then
redis.call('ZADD', key, now, now)
redis.call('PEXPIRE', key, window)
return 1
else
return 0
endBest Practices
Do:
- Always Set an Eviction Policy: Configure
maxmemory-policy volatile-lruorallkeys-lruto prevent out-of-memory crashes. - Use Pipelines for Multi-Key Operations: Batch commands with
redis.pipeline()to eliminate network roundtrip latency. - Execute Complex Logic with Atomic Lua Scripts: Use Lua scripts or Redis Functions to guarantee atomic multi-step operations.
- Namespace Keys Systematically: Follow standardized key naming conventions (
app:environment:entity:id).
Don't:
- Run the
KEYS *command in production:KEYSblocks the single-threaded event loop; useSCANinstead. - Store massive multi-megabyte values: Redis is single-threaded; serializing huge objects delays all concurrent requests.
- Use Redis without persistence configurations: Ensure RDB snapshots or AOF (
appendonly yes) are active if data loss is unacceptable.
Troubleshooting
| Error | Cause | Solution |
OOM command not allowed when used memory > 'maxmemory' | Redis memory limit reached and eviction policy is noeviction. | Configure maxmemory-policy allkeys-lru or scale Redis memory. |
LOADING Redis is loading the dataset in memory | Server recently restarted and is parsing RDB/AOF persistence file. | Wait for dataset reload to finish; optimize AOF file size with BGREWRITEAOF. |
READONLY You can't write against a read only replica | Attempted write operation sent to a replica node instead of master. | Check client clustering configuration and verify write routing to master. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

