npx claudepluginhub arbazkhan971/godmodeThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
/godmode:redis, "design a cache", "redis cluster"redis-cli INFO server | grep redis_version
redis-cli INFO memory | grep -E \
"used_memory_human|maxmemory_human|maxmemory_policy"
redis-cli INFO stats | grep keyspace_hit
Version: Redis 6|7|8|Valkey 7+
Hosting: self-managed|ElastiCache|Upstash|Redis Cloud
Use cases: cache|queue|pub-sub|session|rate-limit|lock
| Use Case | Structure | Key Pattern |
| Cache | String/Hash | cache:{entity}:{id} |
| Counter | String (INCR) | count:{entity}:{id} |
| Session | Hash | session:{token} |
| Queue | List (LPUSH/BRPOP) | queue:{name} |
| Unique set | Set | set:{entity}:{scope} |
| Leaderboard | Sorted Set | lb:{game}:{period} |
| Events/log | Stream | stream:{topic} |
| Lock | String (SET NX EX) | lock:{resource} |
IF using wrong structure (String for leaderboard): wastes memory and complicates operations.
Cache-aside: app checks Redis, miss->DB->store.
Write-through: write DB+cache simultaneously.
Write-behind: write cache, async flush to DB.
Stampede prevention: lock-based refresh OR
stale-while-revalidate with jitter on TTL.
IF popular key expires and 1000 concurrent requests: use lock-based cache refresh to prevent stampede.
Simple queue: LPUSH + BRPOP (30s timeout)
Reliable queue: BRPOPLPUSH + processing list
Pub/Sub: fire-and-forget (no persistence)
Streams: persistent, consumer groups, ack, replay
IF message must not be lost: use Streams, not Pub/Sub. IF consumer crashes: Streams with XACK survive it.
Sentinel: HA with automatic failover
WHEN: < 100K ops/sec, data fits single node
Cluster: horizontal scaling + auto-sharding
WHEN: data > single node, > 100K ops/sec
Use {hash-tag} for multi-key operations
Replication: primary writes, replicas read
IF mem_fragmentation_ratio > 1.5: MEMORY PURGE or restart.
Set maxmemory and maxmemory-policy ALWAYS.
| Policy | Use When |
| allkeys-lru | General cache |
| volatile-lru | Mix of cache + permanent data |
| allkeys-lfu | Frequency-based (hot data) |
| noeviction | Queue/lock (never lose data) |
IF used_memory > 80% maxmemory: audit with --bigkeys. IF values > 100KB: compress or split.
-- Atomic rate limiter (sliding window)
-- KEYS[1]=key, ARGV[1]=window_ms, ARGV[2]=limit
local count = redis.call('ZCARD', KEYS[1])
if count >= tonumber(ARGV[2]) then return 0 end
redis.call('ZADD', KEYS[1], ARGV[3], ARGV[4])
redis.call('PEXPIRE', KEYS[1], ARGV[1])
return 1
redis-cli EVAL "$(cat rate_limit.lua)" 1 \
"rate:user:1234" 60000 100
Lua scripts MUST be idempotent (may retry on MOVED).
Rate limiter: Sorted Set, score=timestamp
ZREMRANGEBYSCORE + ZCARD + ZADD + PEXPIRE
Distributed lock: SET key uuid NX EX 30
Release: Lua check uuid before DEL
Leaderboard: ZADD lb score player
ZREVRANGE lb 0 9 WITHSCORES (top 10)
# Redis diagnostics
redis-cli INFO memory | grep used_memory_human
redis-cli --latency -i 1
redis-cli DBSIZE
# Redis diagnostics
redis-cli INFO memory | grep used_memory_human
redis-cli DBSIZE
# Redis health check
curl -s http://localhost:8080/health/redis
grep -r "redis" config/ | head -5
Append .godmode/redis.tsv:
timestamp operation data_structure key_pattern ttl verdict
KEEP if: tests pass AND metrics improved.
DISCARD if: tests fail OR regression detected.
STOP when FIRST of:
- used_memory < 80% maxmemory
- keyspace_hit_ratio > 90%
- All keys follow naming convention with TTLs
On failure: git reset --hard HEAD~1. Never pause.
| Failure | Action |
|---|---|
| Connection refused | Check running, host/port, firewall |
| Cache stampede | Lock-based refresh, jitter TTLs |
| OOM | Check maxmemory-policy, audit --bigkeys |