Redis Guardrails and Playbooks
Purpose
Help an assistant propose safe, production-ready Redis patterns and operational guidance while avoiding high-risk mistakes.
When to use
Use this skill when the user asks about:
- Using Redis as a cache, session store, rate limiter, lock provider, queue/stream, or pub/sub
- Choosing TTL, eviction, key naming, or data modeling in Redis
- Operating Redis safely (scanning keys, deleting keys, mitigating hot keys, memory issues)
- Migrating or scaling Redis (single node → replicas → cluster)
Avoid this skill when:
- The user needs vendor-specific operational runbooks (managed service dashboards, exact console clicks)
- The request is unrelated to Redis
Inputs
- Scenario: what Redis is being used for (cache, sessions, rate limiting, locks, queues, pub/sub, etc.)
- Constraints: latency requirements, consistency needs, scale/QPS, key cardinality, data size, and deployment mode (standalone/replica/cluster)
If any of the above are missing or ambiguous, ask targeted questions before recommending a design.
Outputs
- A structured playbook (Markdown) that includes:
- recommended approach and data layout
- key naming scheme and TTL strategy
- operational guardrails (safe commands and anti-patterns)
- failure modes and mitigation
- verification and rollback guidance
Steps
- Clarify the scenario and constraints.
- Identify the Redis deployment mode (standalone/replica/cluster) and persistence requirements.
- Choose the closest playbook template and tailor it:
- cache
- sessions
- rate limiting
- distributed locks
- queues/streams
- Produce a safe design:
- key naming and namespacing
- TTL strategy (what should expire, when, and why)
- read/write patterns and concurrency controls
- Add guardrails:
- prefer
SCAN over KEYS for key discovery
- avoid mass deletes without a plan (pipeline/batches)
- call out cluster pitfalls (multi-key ops, hash tags)
- Provide verification steps:
- functional tests
- load/latency checks
- operational signals (memory, eviction, slowlog)
- Provide a rollback or mitigation plan.
Verification
Boundaries
- MUST NOT recommend
KEYS * on production datasets; use SCAN and batch operations
- MUST NOT recommend
FLUSHALL/FLUSHDB or mass deletion without explicit approval and an environment check
- MUST NOT suggest disabling persistence, changing eviction policy, or resizing memory without confirming impact
- MUST NOT claim distributed locking is "solved"; clearly state trade-offs and provide safe primitives
- SHOULD NOT propose multi-key operations that break under Redis Cluster without using hash tags or an alternative design
Included assets
- Template:
./templates/redis-playbook.md
- Reference:
./reference/common-pitfalls.md, ./reference/playbooks.md
- Examples:
./examples/
1---2name: redis-guardrails-and-playbooks3description: Provide Redis design/operation guardrails and scenario playbooks to prevent common mistakes (keys, TTL, memory, cluster, locks, rate limits).4---56# Redis Guardrails and Playbooks78## Purpose9Help an assistant propose safe, production-ready Redis patterns and operational guidance while avoiding high-risk mistakes.1011## When to use12Use this skill when the user asks about:13- Using Redis as a cache, session store, rate limiter, lock provider, queue/stream, or pub/sub14- Choosing TTL, eviction, key naming, or data modeling in Redis15- Operating Redis safely (scanning keys, deleting keys, mitigating hot keys, memory issues)16- Migrating or scaling Redis (single node → replicas → cluster)1718Avoid this skill when:19- The user needs vendor-specific operational runbooks (managed service dashboards, exact console clicks)20- The request is unrelated to Redis2122## Inputs23- Scenario: what Redis is being used for (cache, sessions, rate limiting, locks, queues, pub/sub, etc.)24- Constraints: latency requirements, consistency needs, scale/QPS, key cardinality, data size, and deployment mode (standalone/replica/cluster)2526If any of the above are missing or ambiguous, ask targeted questions before recommending a design.2728## Outputs29- A structured playbook (Markdown) that includes:30 - recommended approach and data layout31 - key naming scheme and TTL strategy32 - operational guardrails (safe commands and anti-patterns)33 - failure modes and mitigation34 - verification and rollback guidance3536## Steps371. Clarify the scenario and constraints.382. Identify the Redis deployment mode (standalone/replica/cluster) and persistence requirements.393. Choose the closest playbook template and tailor it:40 - cache41 - sessions42 - rate limiting43 - distributed locks44 - queues/streams454. Produce a safe design:46 - key naming and namespacing47 - TTL strategy (what should expire, when, and why)48 - read/write patterns and concurrency controls495. Add guardrails:50 - prefer `SCAN` over `KEYS` for key discovery51 - avoid mass deletes without a plan (pipeline/batches)52 - call out cluster pitfalls (multi-key ops, hash tags)536. Provide verification steps:54 - functional tests55 - load/latency checks56 - operational signals (memory, eviction, slowlog)577. Provide a rollback or mitigation plan.5859## Verification60- [ ] The recommendation matches the stated scenario and constraints61- [ ] Key naming and TTL strategy are explicit62- [ ] High-risk commands are either avoided or gated behind explicit user approval63- [ ] Cluster considerations are addressed when relevant (hash tags, multi-key ops)64- [ ] Failure modes and mitigation/rollback steps are documented6566## Boundaries67- MUST NOT recommend `KEYS *` on production datasets; use `SCAN` and batch operations68- MUST NOT recommend `FLUSHALL`/`FLUSHDB` or mass deletion without explicit approval and an environment check69- MUST NOT suggest disabling persistence, changing eviction policy, or resizing memory without confirming impact70- MUST NOT claim distributed locking is "solved"; clearly state trade-offs and provide safe primitives71- SHOULD NOT propose multi-key operations that break under Redis Cluster without using hash tags or an alternative design7273## Included assets74- Template: `./templates/redis-playbook.md`75- Reference: `./reference/common-pitfalls.md`, `./reference/playbooks.md`76- Examples: `./examples/`