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.
npx agentmods add skills/pekral/cursor-rules/redis-patternsnpx skills add pekral/cursor-rules --skill redis-patternsgit clone --depth 1 https://github.com/pekral/cursor-rulesWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00043 | $0.01996 |
| Opus 5 | $0.00022 | $0.00998 |
| Sonnet 5 | $0.00009 | $0.00399 |
| Haiku 4.5 | $0.00004 | $0.00200 |
Grade A, and why
redis-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 2d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Redis Patterns
Constraints
- Apply
@rules/laravel/laravel.mdc— use the framework's facades (Cache,RateLimiter,Redis), not a raw client. - Apply
@rules/laravel/queue-debouncing.mdcfor queue/job coalescing concerns when Redis backs the queue. - Cross-link
@rules/sql/optimalize.mdc(DB-level caching) — Redis caching sits in front of the query tuning that rule owns; cache the result, do not paper over an unindexed query. finalclasses,declare(strict_types=1), Pest tests (use thearraycache driver in tests unless asserting Redis-specific behavior).- Always set a TTL. Keys without expiry accumulate and cause memory pressure.
Use when
- Adding caching, rate limiting, distributed coordination, or pub/sub to a Laravel app.
- Choosing a cache strategy, protecting a cold cache from stampede, or designing key/TTL conventions.
- Configuring Redis as the session, cache, or queue store.
Use Laravel facades throughout. Reach for raw Redis::command(...) only for structures the Cache abstraction does not expose (sorted sets, streams).
Caching Strategies
Cache-Aside (default for read-heavy data)
$product = Cache::remember("product:{$id}", now()->addMinutes(10), fn () =>
Product::findOrFail($id),
);
remember() is read-through cache-aside: returns the cached value or runs the closure, stores it, and returns it. Use rememberForever() only with an explicit invalidation path.
Write-Through (consistency required)
$product->update($data);
Cache::put("product:{$product->id}", $product->fresh(), now()->addMinutes(10));
// Or simply invalidate so the next read repopulates:
Cache::forget("product:{$product->id}");
Invalidate (forget) rather than rewrite when the cached shape may differ from the model.
Cache Tags (grouped invalidation)
Cache::tags(['products', "category:{$categoryId}"])
->remember("product:{$id}", now()->addMinutes(10), fn () => Product::findOrFail($id));
Cache::tags(["category:{$categoryId}"])->flush(); // drop the whole group at once
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.
- 2d ago First seen · 194 lines · 43 tokens per session scan A dea966a87131
redis-patterns is a skill published in the GitHub repository pekral/cursor-rules (6 stars, last pushed 8d ago), licensed MIT. It adds 43 tokens to every session and 1,996 once invoked, about $0.0002 per session on Opus 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-31.
Other skills, from other repositories
laravel-async
Asynchronous and caching rules for Laravel — idempotent queued jobs with retries and backoff, domain events for side effects, queue separation and failure handling, deterministic cache keys with event-driven invalidation, and scheduled tasks that queue rather than block. Use when writing or reviewing jobs, events…
laravel-infrastructure
Laravel Horizon queues, Octane performance, Reverb WebSockets, Redis caching, PostgreSQL database. ALWAYS activate when: working with queue jobs, cache, sessions, broadcasting, database performance, supervisor, worker. Triggers on: job failed, queue stuck, cache not clearing, Redis connection, broadcast event…
parse-table
Parse table definition to extract module name, model name, table name, and field definitions. First step of CRUD generation.
owl-admin-ops-commands
Use this skill for Owl Admin installation, publishing assets, upgrades, diagnostics, database inspection, menu maintenance, user creation, password reset, route generation, IDE helper, admin:publish, admin:install, admin:update, admin:doctor, admin:db, admin:menu, admin:create-user, or deployment troubleshooting.
redis-connections
Redis client and connection guidance covering connection pooling, multiplexing, pipelining, client-side caching with RESP3, avoiding slow commands (KEYS, SMEMBERS, HGETALL), and tuning socket timeouts. Use when configuring a Redis client (redis-py, Jedis, Lettuce, NRedisStack), batching commands for throughput…
redis-security
Redis security guidance covering authentication (requirepass and ACL users), TLS, ACL-based least-privilege access control, restricting network exposure via bind and protected-mode, firewall rules, and disabling dangerous commands. Use when deploying Redis to production, defining ACL users for an application…