redis-patterns
Skill1 starsChanged 2 months agoMITView on GitHub
Use Redis correctly — client choice and connection handling, namespaced key design, TTL on everything, the right data structure per use, SCAN not KEYS, pipelines vs MULTI, and maxmemory-policy. Use when adding Redis to a service, reviewing Redis code, or when asked "how should I key this" / "why is Redis slow".
20 other projects use a version of this.
Adopted by
Most recently taken up by
- valentinesamuel/claude-skillstheir own version, first seen Nov 8, 2026
- ahmadvahidi/skill-atlastheir own version, first seen Nov 8, 2026
- huanglei288766/claude-code-zhtheir own version, first seen Nov 8, 2026
- renepf/claude-skillstheir own version, first seen Oct 25, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- Ronnasayd/aipptheir own version, first seen Oct 20, 2026
Used with
Projects with it also use vite-patterns, orch-pipeline and 10 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.
ronmkrSkillvite-patterns
Vite build tool patterns including config, plugins, HMR, env variables, proxy setup, SSR, library mode, dependency pre-bundling, and build optimization. Activate when working with vite.config.ts, Vite plugins, or Vite-based projects.
Also in 8 projects that use this
renepfSkillorch-pipeline
Shared orchestration engine for the orch-* skill family. Defines the gated Research-Plan-TDD-Review-Commit pipeline, the size classifier, the agent map, and the two human gates that the orch-* operation skills delegate to. Not usually invoked directly.
Also in 4 projects that use this
marcusgollSkillparallel-execution-optimizer
Identify and execute independent operations in parallel for 3-5x speedup. Auto-analyzes task dependencies, groups into batches, launches parallel Task() calls. Applies to /optimize (5 checks), /ship pre-flight (5 checks), /implement (task batching), /prototype (N screens). Auto-triggers when detecting multiple independent operations in a phase.
Also in 5 projects that use this
ronmkrSkillquarkus-security
Quarkus Security best practices for authentication, authorization, JWT/OIDC, RBAC, input validation, CSRF, secrets management, and dependency security.
Also in 5 projects that use this
renepfSkillmotion-advanced
Advanced motion patterns for React / Next.js — drag & drop, gestures, text animations, SVG path drawing, custom hooks, imperative sequences (useAnimate), loaders, and the full API decision tree. Requires motion-foundations.
Also in 4 projects that use this
RojiosSkilldefi-amm-security
Security checklist for Solidity AMM contracts, liquidity pools, and swap flows. Covers reentrancy, CEI ordering, donation or inflation attacks, oracle manipulation, slippage, admin controls, and integer math.
Also in 6 projects that use this
- +1 more from ronmkr
- +2 more from renepf
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- Fmarzochi/EGC★ 61same name
- pekral/cursor-rules★ 10same name
- gongyijie85/dsh-ecc★ 8same name
- huanglei288766/claude-code-zh★ 6same name
- nek1987/auto-agent-harness★ 4same name
- ronmkr/PromptBook★ 2same name
- yuanJewel/skills★ 2same name
- diego-tobalina/vibe-coding★ 1same name
- NISTALTALSON/essential-claude-skills★ 1same name
- productionx-in/Core-Skills★ 1same name
10 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 repository73 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bigquery-analyticsSkill
- cache-invalidationSkill
- mongo-aggregationSkill
- mongo-modelingSkill
- postgres-aggregationSkill
- postgres-indexingSkill
- redis-coordinationSkill
- review-querySkill
- code-migrationSkill
- cut-releaseSkill
- data-migrationSkill
- deploy-serviceSkill
- hotfixSkill
- rollbackSkill
- design-endpointSkill
- design-eventSkill
- design-schemaSkill
- evolve-contractSkill
- scaffold-nestjs-moduleSkill
- scaffold-projectSkill
- incident-responseSkill
- investigate-bugSkill
- on-callSkill
- postmortemSkill
- audit-skillsSkill
- distill-review-styleSkill
- write-skillSkill
- debug-with-tracesSkill
- define-alertsSkill
- instrument-serviceSkill
- evaluate-dependencySkill
- grillSkill
- handoffSkill
- orientSkill
- phased-deliverySkill
- spikeSkill
- to-questionnaireSkill
- write-adrSkill
- write-prdSkill
- devops-pr-reviewSkill
- go-backend-pr-reviewSkill
- nestjs-backend-pr-reviewSkill
- python-backend-pr-reviewSkill
- react-frontend-pr-reviewSkill
- bisectSkill
- break-couplingSkill
- dead-code-sweepSkill
- deslopifySkill
- extract-moduleSkill
- rebase-cleanSkill
- resolve-merge-conflictsSkill
- split-commitSkill
- tddSkill
- wait-whatSkill
- wide-renameSkill
- bullmqSkill
- kafkaSkill
- sqs-consumerSkill
- audit-dependenciesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
Add jitter to TTLs of keys that get populated together (avoid a synchronized stampede when they all expire at once).
“Common” is measured: kept by at least 6 in 10 of the 18 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 patterns
Reference: redis/redis-stack, maxmemory 256mb, allkeys-lru (the ember
compose). Node client: ioredis (mature, cluster support) or node-redis v4+.
Go: go-redis. NestJS: a single global: true cache module, one connection.
Connection
- One shared client per process, injected — not one per call (fd exhaustion, no pooling benefit). ioredis multiplexes over one connection.
- Reconnect must be infinite with capped backoff. A blip after a deploy that makes the client give up permanently leaves every call throwing until the pod restarts. Bound only the initial connect.
- Redis being down must degrade, not crash — cache miss → hit the source; a cache write failure → log and continue. Same "optional dependency" rule as telemetry.
redis://:password@host:portfrom env, never committed.
Keys
- Namespaced, structured:
<app>:<domain>:<entity>:<id>— e.g.auth:user:otp:{userId}. Predictable, greppable, drop-able by prefix. - Cross-service prefixes (shared with another service) → export the constant from the shared SDK so nobody hardcodes the string on either side.
- The read key and the write key must be derived identically — normalize the inputs once, use that for both the lookup and the loader. (A recurring review bug: they diverge and the cache never hits.)
TTL
- Every key gets a TTL. A key with no expiry is a leak waiting for
allkeys-lruto evict it unpredictably (possibly the wrong key). - Set it atomically with the write:
SET k v EX 300, notSETthenEXPIRE. - Add jitter to TTLs of keys that get populated together (avoid a synchronized stampede when they all expire at once).
PERSISTonly with a deliberate reason.
Data structures
| Use | Structure |
| single value / JSON blob / counter | String (GET/SET, INCR) |
| object with fields you update independently | Hash (HSET/HGET) |
| membership / unique set | Set (SADD/SISMEMBER) |
| leaderboard / time-ordered / rate window | Sorted Set (ZADD/ZRANGEBYSCORE) |
| event log / stream with consumer groups | Stream (XADD/XREADGROUP) |
| ephemeral pub/sub (no delivery guarantee) | Pub/Sub |
Operations
- Never
KEYSon a shared instance — it blocks the server. UseSCANwith a cursor andCOUNT, or restructure so you don't need to enumerate. - Pipeline independent commands to cut round-trips (
pipeline()/MULTIwithoutWATCHfor batching). MULTI/EXECis not a rollback — if a command in the transaction fails at runtime, earlier ones still applied. Scan the result array. UseWATCHfor optimistic concurrency.- Lua scripts (
EVALSHA) for read-modify-write that must be atomic (counters with caps, conditional sets). - Read-your-writes on OTP / rate-limit / session must go to the primary, not a read replica — replica lag = stale/missing.
Anti-patterns
- ❌ A client per request.
- ❌ Reconnect that gives up permanently.
- ❌
KEYS *anywhere. - ❌ A key with no TTL.
- ❌
SETthen a separateEXPIRE(non-atomic — crash between = immortal key). - ❌ Trusting
MULTI/EXECto roll back. - ❌ Read-your-writes off a replica.
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.

