Redis core

From Kilo-Org/kilo-marketplace · View interactive version

Redis core is an AI agent skill from the GitHub repository Kilo-Org/kilo-marketplace. Core Redis modeling guidance — choose the right data structure (String, Hash, List, Set, Sorted Set, JSON, Stream, Vector Set) and use consistent colon-separated key names. Use when designing a Redis data model, caching objects, deciding between Hash and JSON, building counters, leaderboards, member

How to use this skill

Skill file

Redis Core

Foundational guidance for modeling data in Redis. Covers data-type selection and key-name conventions — the two decisions that most directly drive memory, performance, and maintainability.

When to apply

1. Choose the right data structure

Pick the type that matches the access pattern, not just the shape of the data.

| Use case | Recommended type | Why |

|---|---|---|

| Simple values, counters | String | Atomic INCR/DECR, SET/GET |

| Object with independently updated fields | Hash | Per-field reads/writes, no whole-object rewrite |

| Queue, recent-N items | List | O(1) push/pop at ends |

| Unique items, membership checks | Set | O(1) SADD/SISMEMBER/SCARD |

| Rankings, score-based ranges | Sorted Set | Score-ordered; ZADD/ZRANGE/ZRANK |

| Nested / hierarchical data | JSON | Path-level updates, nested arrays, RQE indexing |

| Event log, fan-out messaging | Stream | Persistent, consumer groups |

| Vector similarity | Vector Set | Native vector storage with HNSW |

Common anti-pattern: stuffing a flat object into a serialized string. Updating one field means fetch + parse + mutate + rewrite. Use a Hash instead.

See references/choose-data-structure.md for full rationale and Python/Java examples.

2. Use consistent key names

Use colon-separated segments with a stable hierarchy:

{entity}:{id}:{attribute}
user:1001:profile
user:1001:settings
order:2024:items
session:abc123
article:987:likes
game:space-invaders:leaderboard

Rules of thumb:

See references/key-naming.md for cleanup examples and edge cases.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.