redis-game-patterns

redis-game-patterns is a skill for Claude Code from fcsouza/agent-skills. It costs 88 tokens per session (1,674 once invoked), scanned A, original, MIT.

A set of guidance for using Redis in online games. Redis is a fast data store commonly used for temporary data and messages between game servers.

In plain words
What is it for?
Building caches, leaderboards, pub/sub messaging, session storage, rate limits, and temporary game state.
Why use it?
It gives implementation guidance for common game features that need quick shared state or short-lived communication.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the game-dev plugin — 39 skills shipped together

Good fit Building caches, leaderboards, pub/sub messaging, session storage, rate limits, and temporary game state.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fcsouza/agent-skills/redis-game-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fcsouza/agent-skills --skill redis-game-patterns
Clone the repo
git clone --depth 1 https://github.com/fcsouza/agent-skills

Made for: Claude Code.

Or install game-dev, the plugin that ships this one along with the rest of its 39 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for redis-game-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/fcsouza/agent-skills/redis-game-patterns/github.svg)](https://agentmods.dev/skills/fcsouza/agent-skills/redis-game-patterns)
Your own site
<a href="https://agentmods.dev/skills/fcsouza/agent-skills/redis-game-patterns"><img src="https://agentmods.dev/badge/skills/fcsouza/agent-skills/redis-game-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for redis-game-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/fcsouza/agent-skills/redis-game-patterns"><img src="https://agentmods.dev/badge/skills/fcsouza/agent-skills/redis-game-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,674 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00088 $0.01674
Opus 5.5 $0.00035 $0.00670
Sonnet 5.5 $0.00018 $0.00335
Haiku 4.5 $0.00009 $0.00167

Measured 19d ago against content hash 815fbd78f6ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

redis-game-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 19d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (boilerplate/leaderboard.ts, templates/ephemeral-state.ts, templates/rate-limiter.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/redis-game-patterns/SKILL.md · 140 lines

How it starts

The opening of the file, as written. The whole thing — 140 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Redis Game Patterns

Redis holds hot, disposable game state. The database holds outcomes. If Redis restarts empty, players should lose nothing that matters: match results, rewards and currency are written to the database first.

Client choice

The code here uses ioredis 6, because BullMQ 6 creates its Redis connections with ioredis by default and most game servers in this bundle already run BullMQ (bullmq-game-queues). The ioredis README says that for new projects node-redis is the recommended client; if the project has no BullMQ and no ioredis yet, consider node-redis and port the commands. BullMQ 6 marks ioredis as an optional peer, so install it explicitly: bun add ioredis.

Every file takes the client as a parameter typed Redis from ioredis. Create the client once in the server and pass it in. Keep the default replyMapping: "legacy": the parsers expect WITHSCORES replies as flat [member, score, ...] string arrays. The code needs Redis 6.2 or newer (ZRANGE ... REV).

Pattern 1: leaderboard

Copy boilerplate/leaderboard.ts when the game ranks players by score.

  • One sorted set per board and period: lb:weekly:2026-W46, lb:season:3. A new period is a new key; snapshot the old one, then delete it.
  • ZADD overwrites the score. For "best score counts", decide on purpose: ZADD ... GT keeps the higher value; ZINCRBY adds points.
  • Ties: equal scores sort by member ID bytes (reverse order under REV), not by who reached the score first. If first-to-score must win, encode the tie break into the score, and keep the whole score inside the exact integer range of a double (2^53).
  • Rank from ZREVRANK is zero-based; the boilerplate returns rank 1 for the top player.
  • At season end, call snapshot() with a function that writes the rows to Postgres (postgres-game-schema), then reset the board.

Pattern 2: presence and ephemeral state

Copy templates/ephemeral-state.ts when the game shows who is online, keeps live match state outside the database, or applies timed buffs.

Read the full file on GitHub · 140 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 19d ago Changed · -9 lines · +36 tokens per session 815fbd78f6ab
  2. 3mo ago First seen · 149 lines · 52 tokens per session scan A 111b1d1a7c28

Subscribe to this mod's changes

redis-game-patterns is a skill published in the GitHub repository fcsouza/agent-skills (29 stars, last pushed today), licensed MIT. It adds 88 tokens to every session and 1,674 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

redis-game-patterns compared with skills from other repositories

redis-game-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
redis-game-patternsfcsouza/agent-skillsSkill29todayMITA88Claude Code
bex-keyvaluebex-co/bexSkill1.6ktodayApache-2.0A117Claude Code, Codex
redis-jsupstash/redis-jsSkill9896d agoMITA93Claude Code, Codex
bun-redissecondsky/claude-skillsSkill2573d agoMITA32Claude Code
database-redisHoangNguyen0403/agent-skills-standardSkill597yesterdayMITA37Claude Code, Codex
nw-database-technology-selectionnWave-ai/nWaveSkill63814d agoMITA38Claude Code
architecture-paradigm-space-basedathola/claude-night-marketSkill358todayMITA32Claude Code