redis

Governs Redis key design, TTL policies, caching patterns, and runtime state storage.

Updated Sep 20, 2026
One-click install
npx skills add https://github.com/aascer39/codeagent --skill redis-aascer39
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: redis
Source: https://github.com/aascer39/codeagent/tree/main/.agents/skills/redis
Command: npx skills add https://github.com/aascer39/codeagent --skill redis-aascer39

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams often misuse Redis by creating unnamespaced keys, skipping TTLs, storing long-term business data, or ignoring cache penetration, breakdown, and avalanche risks. This Skill enforces a single set of conventions so Redis is used only for high-performance, short-lifecycle runtime state while MySQL remains the source of truth. ## Core Features & Use Cases - Key and TTL Governance: Mandates the codeagent:{domain}:{id} naming template, centralized key factories, business-meaningful TTLs, and 0-10% random jitter to prevent cache avalanches. - Data Structure and Concurrency Rules: Defines when to use String, Hash, List, Set, Sorted Set, and Redis Streams, plus safe distributed locks (SET NX + TTL + unique token + Lua release) and atomic operations. - Scenario Coverage: Standardizes Session, Agent State, short-term Memory, SSE streaming state, and Redis Stack vector search including embedding dimension and index metadata consistency. - Use Case: When adding a new agent execution state to Redis, follow this Skill to pick the right structure, namespace, TTL with jitter, recovery strategy, and MySQL boundary before writing any code. ## Quick Start Ask the AI to design or review a Redis data structure, key naming, TTL, and cache consistency plan for a new feature following the redis skill rules.

Frequently Asked Questions about redis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design Redis key naming conventions for a project?▼

Use a fixed namespace template like codeagent:{domain}:{id} with lowercase segments separated by colons. Centralize key construction in a constants class or key factory so business code never hardcodes key strings.

How to prevent Redis cache avalanche with TTL?▼

Add random jitter of 0-10% to the base TTL so mass-created keys do not expire simultaneously. For example, a 3600-second base becomes 3600-3960 seconds, spreading expirations and protecting the database from a sudden load spike.

When should data go in Redis vs MySQL?▼

Redis holds high-frequency, short-lifecycle, loss-tolerant runtime state like sessions and agent execution state. MySQL holds long-term facts requiring persistence, audit, or recovery such as conversations, executions, and documents.

How do I implement a safe Redis distributed lock?▼

Use SET NX with a TTL and a unique token per holder, then release via a Lua script that verifies the token before deleting. Never create locks without TTL or delete a lock unconditionally, since another thread may have acquired it after expiry.

Can Redis vector search mix embeddings from different models?▼

No. Embedding dimensions must match the model that produced them, and index metadata should record the model name and dimension. Switching embedding models requires rebuilding the index and all stored vectors.

What are the limitations of using Redis as a primary database?▼

Redis is a cache and runtime state store, not a source of truth; data loss must never cause permanent business loss. It also has no cross-store transactions with MySQL, so consistency, retry, and compensation strategies must be designed explicitly.