agentsclimarketplace

Redis master

Skill AtulPurohit/Antigravity-Awesome-Skills/plugins/backend-microservices/skills/redis-master

Installable GitHub library of 300+ professional agentic skills for Claude Code, Antigravity IDE, Gemini CLI, Cursor, and Copilot. Features a custom NPX installer, 9 stack-specific bundles, validation schemas, security auditing, and an interactive catalog explorer app.

Install
npx -y skills add AtulPurohit/Antigravity-Awesome-Skills --skill redis-master

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

3 things to look at

  • 28 days oldThe repository was created 28 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Leverage Redis for caching, sessions, pub/sub, queues, rate limiting, and real-time features. Design Redis data structures for optimal performance.

SKILL.md

4.4 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

Redis Master

Purpose

Use Redis effectively as a cache, message broker, session store, queue, and real-time data structure server.

Operating Mode

You are a Redis expert who selects appropriate data structures, implements patterns correctly, and avoids common pitfalls like memory bloat and cache stampedes.

The Process

1️⃣ Data Structure Selection

StructureBest ForExample Use Case
StringSimple values, countersCache, rate limiting
HashObjects, recordsUser sessions, config
ListQueues, activity feedsJob queues, recent items
SetUnique collectionsTags, permissions
Sorted SetRanked dataLeaderboards, rate windows
StreamEvent logActivity stream, audit log
BitmapBoolean flags at scaleFeature flags, presence
HyperLogLogCardinality estimatesUnique visitor counts

2️⃣ Caching Patterns

// Cache-Aside (Lazy Loading) - Most common
$user = Cache::remember("user:{$id}", 3600, function () use ($id) {
    return User::find($id);
});

// Write-Through: Update cache on every write
public function updateUser(User $user, array $data): User
{
    $user->update($data);
    Cache::put("user:{$user->id}", $user, 3600);
    return $user;
}

// Cache stampede prevention (atomically set cache)
$value = Cache::lock("lock:user:{$id}", 10)->block(5, function () use ($id) {
    return Cache::remember("user:{$id}", 3600, fn() => User::find($id));
});

// Tagging for bulk invalidation
Cache::tags(['posts', 'user:123'])->put("post:{$postId}", $post, 3600);
Cache::tags(['user:123'])->flush(); // Invalidate all user's cached data

3️⃣ Rate Limiting with Redis

// Sliding window rate limiter using Sorted Set
function checkRateLimit(string $key, int $limit, int $windowSeconds): bool
{
    $now = microtime(true);
    $windowStart = $now - $windowSeconds;
    
    $redis = Redis::connection();
    $redis->zRemRangeByScore($key, '-inf', $windowStart);
    $count = $redis->zCard($key);
    
    if ($count >= $limit) {
        return false; // Rate limited
    }
    
    $redis->zAdd($key, $now, $now);
    $redis->expire($key, $windowSeconds);
    return true;
}

// Laravel rate limiter
RateLimiter::for('api', function (Request $request) {
    return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});

4️⃣ Pub/Sub for Real-time

// Publisher (broadcasting events)
Redis::publish('notifications', json_encode([
    'user_id' => $userId,
    'type'    => 'order_ready',
    'message' => 'Your order #123 is ready!',
]));

// Subscriber (in a separate process)
Redis::subscribe(['notifications'], function ($message, $channel) {
    $data = json_decode($message, true);
    // Process notification...
    WebSocket::send($data['user_id'], $data);
});

5️⃣ Leaderboard with Sorted Sets

// Add/update player score
Redis::zAdd('leaderboard:weekly', $score, $userId);

// Get top 10 with scores
$leaderboard = Redis::zRevRangeWithScores('leaderboard:weekly', 0, 9);

// Get player rank
$rank = Redis::zRevRank('leaderboard:weekly', $userId);

// Get player score
$score = Redis::zScore('leaderboard:weekly', $userId);

6️⃣ Session Storage

SESSION_DRIVER=redis
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=null

7️⃣ Redis Best Practices

  • Always set TTL on cached keys — never use SET key value without expiry
  • Use namespaced keys: app:users:123 not just user
  • Monitor memory: redis-cli info memory
  • Set maxmemory-policy allkeys-lru for cache-only Redis instances
  • Use pipelining for bulk operations
  • Enable persistence (RDB + AOF) for non-cache data
  • Use Redis Cluster or Sentinel for HA

Outputs

  1. Caching layer implementation
  2. Rate limiting configuration
  3. Session storage setup
  4. Pub/sub patterns
  5. Leaderboard/ranking implementation
  6. Redis configuration for production

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.