Install any skill in seconds. Free to start, no credit card required.
Get Started Free →doccker/redis-safety
当用户操作 Redis 相关代码(go-redis、Jedis、redis-py、ioredis)时触发。提供 Redis 安全与性能规范。
Passed 22 of 22 test cases with the skill, and 13 of 22 without it.
and 6 more in the full report
9 fixed13 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 9 test cases the skill fixed. Same model, same prompt, with and without the skill.
Write Python redis-py code to save string key config:user:10 with default options.
| Checked | Without skill | With skill |
|---|---|---|
| passes an explicit ex or px expiration parameter | Missed | Passed |
The instructions your model reads when the skill loads.
防止 Redis 常见性能和稳定性问题,适用于所有语言。
| 禁止 | 替代 | 原因 |
|---|---|---|
KEYS * / KEYS pattern | SCAN 游标迭代 | KEYS 是 O(N) 阻塞操作,生产环境会导致 Redis 卡死 |
FLUSHDB / FLUSHALL | 按 key 前缀 SCAN + DEL | 全量删除风险极高 |
| 无 TTL 的 SET | 所有 key 必须设置 TTL | 避免内存泄漏 |
// Go (go-redis) ❌
keys, _ := rdb.Keys(ctx, "user:*").Result()
// Go (go-redis) ✅
var cursor uint64
for {
keys, cursor, _ = rdb.Scan(ctx, cursor, "user:*", 100).Result()
// 处理 keys
if cursor == 0 { break }
}
// Java (Jedis) ❌
Set<String> keys = jedis.keys("user:*");
// Java (Jedis) ✅
ScanParams params = new ScanParams().match("user:*").count(100);
String cursor = "0";
do {
test cases passed, vs 13 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.