Agent skill

Redis Patterns

by rohitg00 in rohitg00/awesome-claude-code-toolkit

Redis patterns including caching strategies, pub/sub, streams for event processing, Lua scripts, and data structures

Apache-2.0Auto-check passedDatabases

Install Redis Patterns

skills CLI
$ npx skills add rohitg00/awesome-claude-code-toolkit --skill redis-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rohitg00/awesome-claude-code-toolkit redis-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rohitg00/awesome-claude-code-toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/redis-patterns .claude/skills/redis-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
redis-patterns
GitHub stars
2.7k
Token cost
~1.2k tokens
SKILL.md length
154 words
Files
1
Skills in repo
37
Repo updated
First seen
Licence
Apache-2.0

At a glance

Redis patterns including caching strategies, pub/sub, streams for event processing, Lua scripts, and data structures

  • Tasks that involve Event-driven systems
  • SKILL.md covers Caching Strategies, Rate Limiting with Sliding…, Pub/Sub and Streams for Event Processing, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Caching

What it does

Redis Patterns is an agent skill from rohitg00/awesome-claude-code-toolkit. Redis patterns including caching strategies, pub/sub, streams for event processing, Lua scripts, and data structures

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering Event-driven systems and Caching. It works with Redis and Lua. The repository describes itself as: The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills, 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 14 MCP configs, 26 companion apps, 52… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Event-driven systems
  • Tasks that involve Caching

Example prompts

  • “/redis-patterns”

What it can do on your machine

Read from SKILL.md and the folder at commit ebdf1d5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Redis Patterns loads about 1.2k tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 154 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~33
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rohitg00/awesome-claude-code-toolkit at commit ebdf1d5, republished under its Apache-2.0 licence (© rohitg00). 154 words, ~1,191 tokens.

Download SKILL.mdSave it as .claude/skills/redis-patterns/SKILL.md (or your agent's skills folder).
name
redis-patterns
description
Redis patterns including caching strategies, pub/sub, streams for event processing, Lua scripts, and data structures

Redis Patterns

Caching Strategies

typescript
async function getUser(userId: string): Promise<User> {
  const cacheKey = `user:${userId}`;
  const cached = await redis.get(cacheKey);

  if (cached) {
    return JSON.parse(cached);
  }

  const user = await db.user.findUnique({ where: { id: userId } });
  if (user) {
    await redis.set(cacheKey, JSON.stringify(user), "EX", 3600);
  }

  return user;
}

async function invalidateUser(userId: string): Promise<void> {
  await redis.del(`user:${userId}`);
  await redis.del(`user:${userId}:orders`);
}

async function cacheAside<T>(
  key: string,
  ttlSeconds: number,
  fetcher: () => Promise<T>
): Promise<T> {
  const cached = await redis.get(key);
  if (cached) return JSON.parse(cached);

  const value = await fetcher();
  await redis.set(key, JSON.stringify(value), "EX", ttlSeconds);
  return value;
}

Rate Limiting with Sliding Window

typescript
async function isRateLimited(
  clientId: string,
  limit: number,
  windowSeconds: number
): Promise<boolean> {
  const key = `ratelimit:${clientId}`;
  const now = Date.now();
  const windowStart = now - windowSeconds * 1000;

  const pipe = redis.multi();
  pipe.zremrangebyscore(key, 0, windowStart);
  pipe.zadd(key, now, `${now}:${crypto.randomUUID()}`);
  pipe.zcard(key);
  pipe.expire(key, windowSeconds);

  const results = await pipe.exec();
  const count = results[2][1] as number;
  return count > limit;
}

Pub/Sub

typescript
const subscriber = redis.duplicate();
await subscriber.subscribe("notifications", "orders");

subscriber.on("message", (channel, message) => {
  const event = JSON.parse(message);
  switch (channel) {
    case "notifications":
      handleNotification(event);
      break;
    case "orders":
      handleOrderEvent(event);
      break;
  }
});

async function publishEvent(channel: string, event: object): Promise<void> {
  await redis.publish(channel, JSON.stringify(event));
}

Streams for Event Processing

typescript
async function produceEvent(stream: string, event: Record<string, string>) {
  await redis.xadd(stream, "*", ...Object.entries(event).flat());
}

async function consumeEvents(
  stream: string,
  group: string,
  consumer: string
) {
  try {
    await redis.xgroup("CREATE", stream, group, "0", "MKSTREAM");
  } catch {
    // group already exists
  }

  while (true) {
    const results = await redis.xreadgroup(
      "GROUP", group, consumer,
      "COUNT", 10,
      "BLOCK", 5000,
      "STREAMS", stream, ">"
    );

    if (!results) continue;

    for (const [, messages] of results) {
      for (const [id, fields] of messages) {
        await processMessage(fields);
        await redis.xack(stream, group, id);
      }
    }
  }
}

Streams provide durable, consumer-group-based event processing with acknowledgment and replay.

Lua Script for Atomic Operations

typescript
const acquireLock = `
  local key = KEYS[1]
  local token = ARGV[1]
  local ttl = ARGV[2]
  if redis.call("SET", key, token, "NX", "EX", ttl) then
    return 1
  end
  return 0
`;

const releaseLock = `
  local key = KEYS[1]
  local token = ARGV[1]
  if redis.call("GET", key) == token then
    return redis.call("DEL", key)
  end
  return 0
`;

async function withLock<T>(
  resource: string,
  ttl: number,
  fn: () => Promise<T>
): Promise<T> {
  const token = crypto.randomUUID();
  const acquired = await redis.eval(acquireLock, 1, `lock:${resource}`, token, ttl);
  if (!acquired) throw new Error("Failed to acquire lock");
  try {
    return await fn();
  } finally {
    await redis.eval(releaseLock, 1, `lock:${resource}`, token);
  }
}

Anti-Patterns

  • Storing large objects (>100KB) in Redis without compression
  • Using KEYS * in production (blocks the server; use SCAN instead)
  • Not setting TTL on cache entries (memory grows unbounded)
  • Using pub/sub for durable messaging (messages are lost if no subscriber is connected)
  • Relying on Redis as the sole data store without persistence strategy
  • Not using pipelines for multiple sequential commands

Checklist

  • Cache keys follow a consistent naming convention (entity:id:field)
  • All cache entries have a TTL to prevent memory leaks
  • SCAN used instead of KEYS for pattern matching in production
  • Lua scripts used for operations requiring atomicity
  • Streams used instead of pub/sub when durability is needed
  • Connection pooling configured for high-throughput applications
  • Rate limiting uses sliding window with sorted sets
  • Distributed locks include fencing tokens and TTL

© rohitg00, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/redis-patterns of rohitg00/awesome-claude-code-toolkit.

Open the folder on GitHubat commit ebdf1d5

Compare with similar skills

Redis Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Redis Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Redis Patterns this skillrohitg00/awesome-claude-code-toolkit2.7k—~1.2kAutomated safety check: PassApache-2.0
Bun Redissecondsky/claude-skills227—~1.8kAutomated safety check: PassMIT
Redis Patternsaffaan-m/ECC275k1 repos~3kAutomated safety check: PassMIT
Azure Resource Manager Redis Dotnetmicrosoft/skills3.1k5 repos~3kAutomated safety check: PassMIT
Amazon Elasticacheaws/agent-toolkit-for-aws2.8k—~4.5kAutomated safety check: PassApache-2.0
Redis ExpertRightNow-AI/openfang18k—~821Automated safety check: PassApache-2.0

Similar skills

  • Bun Redis

    secondsky/claude-skills

    A skill your agent uses when working with Redis in Bun (ioredis, Upstash), caching, pub/sub, session storage, or key-value operations.

    227 GitHub stars~1.8k tokensUpdated 10 days ago
    DatabasesAuto-check passed
  • Redis Patterns

    affaan-m/ECC

    Redis data structure patterns, caching strategies, distributed locks, rate limiting, pub/sub, and connection management for production applications.

    275k GitHub starsUsed in 1 repo~3k tokens
    Backend & APIsAuto-check passed
  • Official

    Azure Resource Manager SDK for Redis in .NET. An agent skill from microsoft/skills.

    3.1k GitHub starsUsed in 5 repos~3k tokens
    DatabasesAuto-check passed
  • Amazon Elasticache

    aws/agent-toolkit-for-aws

    Official

    Activate when developers have latent caching needs: slow API responses, database read bottlenecks, DynamoDB throttling or cost, RDS/Aurora scaling pressure, Bedrock latency or cost, or adding a…

    2.8k GitHub stars~4.5k tokensUpdated today
    Backend & APIsAuto-check passed
  • Redis Expert

    RightNow-AI/openfang

    Redis expert for data structures, caching patterns, Lua scripting, and cluster operations

    18k GitHub stars~821 tokensUpdated 3 mo ago
    DatabasesAuto-check passed
  • Redis Caching

    cohen-liel/hivemind

    Redis caching and queue patterns. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~873 tokensUpdated 5 mo ago
    Backend & APIsAuto-check passed

More from rohitg00/awesome-claude-code-toolkit

All 37 skills in this repo
  • Accessibility Wcag

    rohitg00/awesome-claude-code-toolkit

    Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

    2.7k GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • API Design Patterns

    rohitg00/awesome-claude-code-toolkit

    REST API design with resource naming, pagination, versioning, and OpenAPI spec generation

    2.7k GitHub stars~1.2k tokensUpdated 4 mo ago
    Auto-check passed
  • Authentication Patterns

    rohitg00/awesome-claude-code-toolkit

    Authentication and authorization patterns including OAuth2, JWT, RBAC, session management, and PKCE flows

    2.7k GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • AWS Cloud Patterns

    rohitg00/awesome-claude-code-toolkit

    AWS cloud patterns for Lambda, ECS, S3, DynamoDB, and Infrastructure as Code with CDK/Terraform

    2.7k GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • CI CD Pipelines

    rohitg00/awesome-claude-code-toolkit

    CI/CD pipeline patterns for GitHub Actions, GitLab CI, testing strategies, and deployment automation

    2.7k GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Continuous Learning

    rohitg00/awesome-claude-code-toolkit

    Auto-extract patterns from coding sessions, track corrections, and build reusable knowledge with confidence scoring

    2.7k GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed

Works with

Questions about Redis Patterns

What does Redis Patterns do?

Redis patterns including caching strategies, pub/sub, streams for event processing, Lua scripts, and data structures. Redis Patterns is an agent skill from rohitg00/awesome-claude-code-toolkit.

When should I use Redis Patterns?

Redis Patterns fits situations like: tasks that involve Event-driven systems; tasks that involve Caching.

How do I install Redis Patterns in Claude Code?

Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill redis-patterns -a claude-code`. Or copy the skill folder (skills/redis-patterns in rohitg00/awesome-claude-code-toolkit) into .claude/skills/redis-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Redis Patterns in Codex?

Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill redis-patterns -a codex`. Or copy the skill folder (skills/redis-patterns in rohitg00/awesome-claude-code-toolkit) into .agents/skills/redis-patterns in your project. Codex loads it when a task matches its description.

Can I use Redis Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rohitg00/awesome-claude-code-toolkit --skill redis-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/redis-patterns, .gemini/skills/redis-patterns, .github/skills/redis-patterns and .opencode/skills/redis-patterns in your project.

What does Redis Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Redis Patterns is instructions for the agent only.

Does Redis Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Redis Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Redis Patterns use?

Redis Patterns is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Redis Patterns use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Redis Patterns?

Skills that share tags, products or a category with Redis Patterns: Bun Redis (secondsky/claude-skills, 227 stars), Redis Patterns (affaan-m/ECC, 275k stars), Azure Resource Manager Redis Dotnet (microsoft/skills, 3.1k stars) and Amazon Elasticache (aws/agent-toolkit-for-aws, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Redis Patterns?

rohitg00 (a GitHub user) maintains it in rohitg00/awesome-claude-code-toolkit, which has 2,685 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on May 12, 2026.

Source: rohitg00/awesome-claude-code-toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.