[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EVPCSVEHYEEPFH7G7Q5N8C":3,"skill-same:01M7EVPCSVEHYEEPFH7G7Q5N8C":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EVPCSVEHYEEPFH7G7Q5N8C","redis-pro-dev",null,"Redis guidance — data structures, caching patterns, pub\u002Fsub, streams, transactions, and production operations.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-redis-pro-dev\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: redis-pro-dev\ndescription: Redis guidance — data structures, caching patterns, pub\u002Fsub, streams, transactions, and production operations.\ncategory: development\n---\n\n## Overview\n\nRedis is an in-memory data-structure server that teams use as a cache, session store, rate limiter, queue, pub\u002Fsub bus, and sometimes a primary database. Its power comes from the data structures — strings, hashes, lists, sets, sorted sets, streams — each with atomic operations that let you build correct concurrent systems without a database round trip.\n\nThe failure mode is treating Redis as magic fast storage without understanding eviction, persistence, and single-threaded command execution. This skill covers using the right structure for the job, caching patterns that stay correct, and operating Redis (persistence, clustering, memory) in production.\n\n## When to use\n\n- Adding caching to an application (choosing structure and pattern).\n- Implementing rate limiting, leaderboards, sessions, or locks.\n- Choosing between Redis pub\u002Fsub, Streams, lists, or a dedicated queue.\n- Designing Redis key schemas and TTL strategies.\n- Operating Redis in production (persistence, replication, Cluster, Sentinel).\n- Debugging memory growth, eviction, or latency spikes.\n- Deciding between Redis, Memcached, or a database for a workload.\n\n## Core concepts\n\n- **Data structures first.** Strings (caching, counters), hashes (objects), lists (queues), sets (uniqueness), sorted sets (leaderboards, time series), streams (event logs), HyperLogLog (cardinality), bitmaps (flags). The structure determines what's atomic and efficient.\n- **Commands are atomic.** Single commands (INCR, HSET, ZADD) execute atomically — use them to avoid read-modify-write races. Multi-key atomicity needs Lua scripts or transactions.\n- **Caching patterns.** Cache-aside (app manages cache, most common), read-through\u002Fwrite-through (cache manages), write-behind (async persistence). Cache-aside with TTL is the default; choose deliberately for consistency needs.\n- **TTL everything.** Keys without TTLs accumulate forever. Set expirations on cache entries, sessions, locks, and rate-limit windows — unbounded growth is the most common Redis outage.\n- **Eviction policies.** `volatile-lru` \u002F `allkeys-lru` and friends decide what dies when memory fills. Match the policy to the workload: caches evict, persistent stores must never silently lose data.\n- **Persistence options.** RDB snapshots (point-in-time, compact) and AOF logs (durable, larger). For cache-only use, persistence can be off; for anything you can't rebuild, AOF with fsync policy chosen for your durability needs.\n- **Pub\u002Fsub is fire-and-forget.** Messages to zero subscribers vanish; slow subscribers get disconnected. It's for ephemeral broadcast (cache invalidation, live updates), not reliable delivery — use Streams for that.\n- **Streams for reliable messaging.** Append-only logs with consumer groups, acknowledgments, and pending-message tracking — a real queue built into Redis. Prefer over list-based queues for anything needing redelivery.\n- **Transactions and Lua.** `MULTI`\u002F`EXEC` for atomic multi-command batches (no rollback on error — know this); Lua scripts for atomic read-modify-write logic server-side. Keep scripts fast — they block the event loop.\n- **Distributed locks.** Redlock or single-instance `SET NX PX` with fencing tokens. Locks are hard: handle expiry, clock drift, and the fact that a lock doesn't stop a paused process from acting after its lease died.\n- **Cluster and Sentinel.** Cluster shards data across nodes (hash slots) for horizontal scale; Sentinel provides HA failover for single-primary setups. Cluster clients must handle MOVED\u002FASK redirects.\n- **Single-threaded execution.** One command at a time per instance — slow commands (KEYS, unbatched SMEMBERS on huge sets) block everyone. Use SCAN, keep values small, and avoid algorithmic complexity surprises.\n- **Key design.** Namespaced, predictable keys (`shop:order:123`, `ratelimit:user:456`) with TTLs; avoid huge numbers of keys with per-key overhead unaccounted — hashes can pack many fields efficiently.\n- **Pipelining.** Batch round trips with pipelines for bulk operations — an order of magnitude fewer round trips for seed\u002Fload scripts.\n- **Client-side caching.** Server-assisted invalidation lets clients cache with correctness — for read-heavy workloads that outgrow server round trips.\n- **Redis Stack modules.** Search, JSON, time-series, and probabilistic structures extend Redis — evaluate whether you need the module or a dedicated system.\n\n## Practical workflow\n\n1. **Pick the structure.** Cache → strings with TTL; session → hash\u002Fstring with TTL; leaderboard → sorted set; queue → stream with consumer group; rate limit → fixed window with INCR+EXPIRE or sliding window with sorted sets.\n   ```\n   # fixed-window rate limit: atomic, 3 commands\n   INCR ratelimit:user:456\n   EXPIRE ratelimit:user:456 60\n   # (check count against limit in app code or Lua)\n   ```\n2. **Design keys and TTLs.** Namespace every key; set a TTL at write time for anything ephemeral; document the key schema so the next engineer isn't guessing.\n3. **Implement cache-aside.** Read: check cache → on miss, load from DB, populate cache with TTL. Write: update DB, invalidate (or update) cache. Invalidate deliberately — stale reads are a correctness bug.\n   - For thundering-herd protection on hot keys: probabilistic early refresh or a single-flight lock around recomputation.\n4. **Use Streams for work queues.** `XADD` to publish, consumer groups with `XREADGROUP`, `XACK` on success; monitor pending entries and dead-letter poison messages after N retries.\n   ```\n   XADD jobs:email * to=user@example.com template=welcome\n   XREADGROUP GROUP workers w1 COUNT 10 BLOCK 5000 STREAMS jobs:email >\n   ```\n5. **Script atomic multi-key logic in Lua.** Check-and-set, token buckets, and compare-and-delete unlocks belong server-side where they're atomic.\n6. **Configure persistence for the data's value.** Cache-only: RDB snapshots or nothing. Durable: AOF with `appendfsync everysec`. Test restores — an untested backup is a rumor.\n7. **Set up HA.** Sentinel for automatic failover (odd number of sentinels, quorum configured) or Cluster for sharding; clients configured for the topology; test failover before you need it.\n8. **Monitor the right signals.** Memory usage vs maxmemory, eviction counts, hit rate, replication lag, slowlog, and blocked clients. Alert on evictions in non-cache databases and on replication lag growth.\n\n   ```lua\n   -- token bucket rate limit: atomic check-and-consume\n   local tokens = tonumber(redis.call(\"get\", KEYS[1]) or ARGV[2])\n   if tokens \u003C= 0 then return 0 end\n   redis.call(\"set\", KEYS[1], tokens - 1, \"EX\", ARGV[3])\n   return 1\n   ```\n\n## Common pitfalls\n\n- **No TTLs** — keys accumulating until maxmemory, then evictions or write errors; TTL everything ephemeral.\n- **`KEYS *` in production** — blocks the server; use `SCAN` with a reasonable COUNT.\n- **Pub\u002Fsub for reliable delivery** — messages lost with no subscribers; use Streams for anything that must not drop.\n- **Huge values** — multi-MB strings blocking the event loop on read\u002Fwrite; keep values small, chunk large objects.\n- **No persistence for durable data** — treating Redis as a database without AOF; a restart wipes everything.\n- **Wrong eviction policy** — `noeviction` on a cache (write errors) or `allkeys-lru` on a persistent store (silent data loss).\n- **Slow Lua scripts** — complex scripts blocking all clients; keep them O(1)-ish and fast.\n- **Locks without fencing** — expired lock + still-running holder = two actors thinking they own the resource; use fencing tokens.\n- **Thundering herds** — hot key expiry stampeding the DB; single-flight recomputation or probabilistic refresh.\n- **Cluster key assumptions** — multi-key operations must share a hash slot (hash tags `{user:456}`); cross-slot transactions fail.\n- **Unmonitored replication lag** — reading stale data from replicas unknowingly; track lag and route critical reads to primary.\n- **Storing sessions without a plan** — session keys outliving their usefulness; TTL = session lifetime, always.\n","## Overview\n\nRedis is an in-memory data-structure server that teams use as a cache, session store, rate limiter, queue, pub\u002Fsub bus, and sometimes a primary database. Its power comes from the data structures — strings, hashes, lists, sets, sorted sets, streams — each with atomic operations that let you build correct concurrent systems without a database round trip.\n\nThe failure mode is treating Redis as magic fast storage without understanding eviction, persistence, and single-threaded command execution. This skill covers using the right structure for the job, caching patterns that stay correct, and operating Redis (persistence, clustering, memory) in production.\n\n## When to use\n\n- Adding caching to an application (choosing structure and pattern).\n- Implementing rate limiting, leaderboards, sessions, or locks.\n- Choosing between Redis pub\u002Fsub, Streams, lists, or a dedicated queue.\n- Designing Redis key schemas and TTL strategies.\n- Operating Redis in production (persistence, replication, Cluster, Sentinel).\n- Debugging memory growth, eviction, or latency spikes.\n- Deciding between Redis, Memcached, or a database for a workload.\n\n## Core concepts\n\n- **Data structures first.** Strings (caching, counters), hashes (objects), lists (queues), sets (uniqueness), sorted sets (leaderboards, time series), streams (event logs), HyperLogLog (cardinality), bitmaps (flags). The structure determines what's atomic and efficient.\n- **Commands are atomic.** Single commands (INCR, HSET, ZADD) execute atomically — use them to avoid read-modify-write races. Multi-key atomicity needs Lua scripts or transactions.\n- **Caching patterns.** Cache-aside (app manages cache, most common), read-through\u002Fwrite-through (cache manages), write-behind (async persistence). Cache-aside with TTL is the default; choose deliberately for consistency needs.\n- **TTL everything.** Keys without TTLs accumulate forever. Set expirations on cache entries, sessions, locks, and rate-limit windows — unbounded growth is the most common Redis outage.\n- **Eviction policies.** `volatile-lru` \u002F `allkeys-lru` and friends decide what dies when memory fills. Match the policy to the workload: caches evict, persistent stores must never silently lose data.\n- **Persistence options.** RDB snapshots (point-in-time, compact) and AOF logs (durable, larger). For cache-only use, persistence can be off; for anything you can't rebuild, AOF with fsync policy chosen for your durability needs.\n- **Pub\u002Fsub is fire-and-forget.** Messages to zero subscribers vanish; slow subscribers get disconnected. It's for ephemeral broadcast (cache invalidation, live updates), not reliable delivery — use Streams for that.\n- **Streams for reliable messaging.** Append-only logs with consumer groups, acknowledgments, and pending-message tracking — a real queue built into Redis. Prefer over list-based queues for anything needing redelivery.\n- **Transactions and Lua.** `MULTI`\u002F`EXEC` for atomic multi-command batches (no rollback on error — know this); Lua scripts for atomic read-modify-write logic server-side. Keep scripts fast — they block the event loop.\n- **Distributed locks.** Redlock or single-instance `SET NX PX` with fencing tokens. Locks are hard: handle expiry, clock drift, and the fact that a lock doesn't stop a paused process from acting after its lease died.\n- **Cluster and Sentinel.** Cluster shards data across nodes (hash slots) for horizontal scale; Sentinel provides HA failover for single-primary setups. Cluster clients must handle MOVED\u002FASK redirects.\n- **Single-threaded execution.** One command at a time per instance — slow commands (KEYS, unbatched SMEMBERS on huge sets) block everyone. Use SCAN, keep values small, and avoid algorithmic complexity surprises.\n- **Key design.** Namespaced, predictable keys (`shop:order:123`, `ratelimit:user:456`) with TTLs; avoid huge numbers of keys with per-key overhead unaccounted — hashes can pack many fields efficiently.\n- **Pipelining.** Batch round trips with pipelines for bulk operations — an order of magnitude fewer round trips for seed\u002Fload scripts.\n- **Client-side caching.** Server-assisted invalidation lets clients cache with correctness — for read-heavy workloads that outgrow server round trips.\n- **Redis Stack modules.** Search, JSON, time-series, and probabilistic structures extend Redis — evaluate whether you need the module or a dedicated system.\n\n## Practical workflow\n\n1. **Pick the structure.** Cache → strings with TTL; session → hash\u002Fstring with TTL; leaderboard → sorted set; queue → stream with consumer group; rate limit → fixed window with INCR+EXPIRE or sliding window with sorted sets.\n   ```\n   # fixed-window rate limit: atomic, 3 commands\n   INCR ratelimit:user:456\n   EXPIRE ratelimit:user:456 60\n   # (check count against limit in app code or Lua)\n   ```\n2. **Design keys and TTLs.** Namespace every key; set a TTL at write time for anything ephemeral; document the key schema so the next engineer isn't guessing.\n3. **Implement cache-aside.** Read: check cache → on miss, load from DB, populate cache with TTL. Write: update DB, invalidate (or update) cache. Invalidate deliberately — stale reads are a correctness bug.\n   - For thundering-herd protection on hot keys: probabilistic early refresh or a single-flight lock around recomputation.\n4. **Use Streams for work queues.** `XADD` to publish, consumer groups with `XREADGROUP`, `XACK` on success; monitor pending entries and dead-letter poison messages after N retries.\n   ```\n   XADD jobs:email * to=user@example.com template=welcome\n   XREADGROUP GROUP workers w1 COUNT 10 BLOCK 5000 STREAMS jobs:email >\n   ```\n5. **Script atomic multi-key logic in Lua.** Check-and-set, token buckets, and compare-and-delete unlocks belong server-side where they're atomic.\n6. **Configure persistence for the data's value.** Cache-only: RDB snapshots or nothing. Durable: AOF with `appendfsync everysec`. Test restores — an untested backup is a rumor.\n7. **Set up HA.** Sentinel for automatic failover (odd number of sentinels, quorum configured) or Cluster for sharding; clients configured for the topology; test failover before you need it.\n8. **Monitor the right signals.** Memory usage vs maxmemory, eviction counts, hit rate, replication lag, slowlog, and blocked clients. Alert on evictions in non-cache databases and on replication lag growth.\n\n   ```lua\n   -- token bucket rate limit: atomic check-and-consume\n   local tokens = tonumber(redis.call(\"get\", KEYS[1]) or ARGV[2])\n   if tokens \u003C= 0 then return 0 end\n   redis.call(\"set\", KEYS[1], tokens - 1, \"EX\", ARGV[3])\n   return 1\n   ```\n\n## Common pitfalls\n\n- **No TTLs** — keys accumulating until maxmemory, then evictions or write errors; TTL everything ephemeral.\n- **`KEYS *` in production** — blocks the server; use `SCAN` with a reasonable COUNT.\n- **Pub\u002Fsub for reliable delivery** — messages lost with no subscribers; use Streams for anything that must not drop.\n- **Huge values** — multi-MB strings blocking the event loop on read\u002Fwrite; keep values small, chunk large objects.\n- **No persistence for durable data** — treating Redis as a database without AOF; a restart wipes everything.\n- **Wrong eviction policy** — `noeviction` on a cache (write errors) or `allkeys-lru` on a persistent store (silent data loss).\n- **Slow Lua scripts** — complex scripts blocking all clients; keep them O(1)-ish and fast.\n- **Locks without fencing** — expired lock + still-running holder = two actors thinking they own the resource; use fencing tokens.\n- **Thundering herds** — hot key expiry stampeding the DB; single-flight recomputation or probabilistic refresh.\n- **Cluster key assumptions** — multi-key operations must share a hash slot (hash tags `{user:456}`); cross-slot transactions fail.\n- **Unmonitored replication lag** — reading stale data from replicas unknowingly; track lag and route critical reads to primary.\n- **Storing sessions without a plan** — session keys outliving their usefulness; TTL = session lifetime, always.\n",{"name":5,"category":24,"description":7},"development","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-redis-pro-dev",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill redis-pro-dev",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill redis-pro-dev",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill redis-pro-dev","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-redis-pro-dev\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]