mit einem Klick
redis-use-case-ports
// Port a Redis use-case example (cache-aside, session store, rate limiter, leaderboard, etc.) to all 9 supported client libraries in parallel, with cross-client synthesis and audit
// Port a Redis use-case example (cache-aside, session store, rate limiter, leaderboard, etc.) to all 9 supported client libraries in parallel, with cross-client synthesis and audit
Generate tabbed code examples (TCEs) for Redis commands across all supported client languages
Extract Redis CLI examples from documentation pages, identify which commands are demonstrated, and determine what multi-language code examples need to be created or updated.
| name | redis-use-case-ports |
| description | Port a Redis use-case example (cache-aside, session store, rate limiter, leaderboard, etc.) to all 9 supported client libraries in parallel, with cross-client synthesis and audit |
This skill describes how to implement a single Redis use case across all 9 client libraries (redis-py, node-redis, go-redis, Jedis, Lettuce, StackExchange.Redis, Predis, redis-rb, redis-rs) — fast, consistently, and with a meaningful end-to-end review.
It is intended for any agent that can spawn parallel sub-agents and synthesise their outputs. It assumes the host repo is redis/docs and that each use case lives under content/develop/use-cases/<use-case-name>/.
Use this skill when:
Do NOT use this skill for:
generate-tce-examples for tabbed multi-language examples within a single doc page).The workflow has seven phases. Phase 1 is sequential and human-reviewed; phases 2–6 are mechanical and benefit from parallelism + automated review.
redis-py). Establishes conventions and acts as the spec for the other 8.assets/brief-template.md and returns a report per assets/report-template.md.assets/audit-checklist.md, each scanning all 9 implementations for that specific class.
4b. Independent review — Hand the full codebase to a fresh reviewer (different model, no context) to catch what structured audits missed. Append any new bug classes to assets/audit-checklist.md.assets/cross-diff-checklist.md.Each phase has a specific output and gate; do not skip phases.
Goal: produce one working client implementation that establishes every convention the other 8 will follow.
Steps:
content/develop/use-cases/<use-case-name>/_index.md) following the section skeleton in assets/redis-conventions.md.redis-py because Python's syntax surfaces design decisions most clearly.Outputs of Phase 1:
content/develop/use-cases/<use-case-name>/_index.md (landing page)content/develop/use-cases/<use-case-name>/redis-py/ (full implementation: guide + helper + primary + demo server)Goal: produce 8 client implementations in one wall-clock unit instead of eight.
Spawn 8 general-purpose sub-agents in a single message (multiple Agent tool calls in one turn so they run concurrently). Each gets:
assets/brief-template.md, filled in with the use case specifics.assets/html-template.html, to be inlined in the target language's preferred string-literal style.nodejs, go, java-jedis, java-lettuce, dotnet, php, ruby, rust).assets/report-template.md) the agent must fill in and return.Sub-agents must:
redis-cli FLUSHDB before their tests.Outputs of Phase 2:
_index.md, helper file, primary file, demo server, and any language-specific config (go.mod, Cargo.toml, *.csproj).Goal: extract cross-cutting findings that no single sub-agent could see.
Read all 8 reports plus your memory of the reference implementation. Look for:
Decide which findings should:
Surface judgement-heavy decisions to the user before Phase 5. Do not silently apply cross-cutting changes that affect the user-facing API or prose.
Goal: catch known bug classes before users do.
For each row in assets/audit-checklist.md, spawn an Explore or code-reviewer sub-agent that scans all 9 implementations for that specific class. Audits are sharper when scoped to one bug pattern at a time — broad "look for issues" passes miss the specific stuff.
Examples of audit prompts:
content/develop/use-cases/<use-case-name>/ for whether they are covered by serialisation when the connection is shared. Flag any uncovered site."Append any new bug classes discovered during this audit (or by external review like Cursor's bugbot) to assets/audit-checklist.md. This file is a living document — every future project benefits from the rows added in this one.
Goal: catch bugs the structured audits missed by handing the codebase to a fresh reviewer with no context.
Phase 4's targeted audits work well for known bug classes (the rows in audit-checklist.md). They're less good at the unknown unknowns — bugs where the shape of the audit prompt anchors the auditor to a false-positive answer. The pub/sub project's first Phase 4 said all 8 sibling ports passed the subscribe-ack check; an independent Codex review then found that Jedis returned its Subscription before the spawned thread had even sent the SUBSCRIBE, PHP's waitForSubscription silently fell through on timeout, PHP's Linux branch recorded the wrong PID, and Rust's duplicate-name check released its lock across the await. All four were real correctness bugs that Phase 4 had cleared.
Run an independent reviewer (different model, fresh context — the codex:rescue skill is a good fit, with a prompt that lists files plus the specific concerns: correctness bugs, cross-client divergence, doc drift) before declaring Phase 4 done. Treat its findings as candidates for the Phase 5 retrofit, with the orchestrator triaging which to accept (some "race conditions" are safe by accident — e.g. redis-py and go-redis subscribe-ack — because the synchronous socket write closes the window before the helper returns).
Verify each finding against the current file before fixing it. Independent reviewers occasionally work from a stale snapshot — the file they reviewed was correct when they started, but a parallel agent kept editing it during the review window. Several of the Jedis and PHP findings on the semantic-cache project turned out to be the agent re-discovering a fix that had already landed minutes earlier (the EXISTS-race comment, the 1 MiB body cap, the docs paragraph about classpath resources). grep the finding's described pattern against the current file before opening an Edit — a one-second sanity check saves an inadvertent revert.
Add a new row to assets/audit-checklist.md for any class of bug the reviewer found that wasn't already covered, so the next project's Phase 4 won't have to rediscover it.
Goal: apply the fixes from synthesis + audit.
Decision tree:
TickCount64 for each language's clock) → sequential in the main thread, lower risk of subtle per-client bugs.After retrofitting, run smoke-tests for the affected clients again. A retrofit that breaks the smoke test is worse than the original bug.
Goal: confirm the 9 clients are consistent on the things that should be consistent.
Run a final pass against assets/cross-diff-checklist.md. This can be done by a sub-agent with read-only access. Report any divergences and either justify them (per-language idiom) or fix them.
txLock-missing-in-loadWithSingleFlight bug and the .NET Environment.TickCount 24.9-day wraparound both compiled cleanly and passed smoke tests. Phase 4 exists specifically to catch this kind of issue.audit-checklist.md stagnate. The checklist's value compounds across projects. Every external bug found should be added.This skill grows over time:
assets/audit-checklist.md.assets/cross-diff-checklist.md.assets/html-template.html once and propagate via the next use case.assets/redis-conventions.md.Keep SKILL.md itself focused on the workflow. The concrete artefacts live in assets/.
content/develop/use-cases/cache-aside/ — the worked example that produced this skill. Includes the conventions, helper API shape, and prose structure that the templates encode.content/develop/use-cases/session-store/ — earlier worked example. Same shape, different helper API.content/develop/use-cases/job-queue/ — the project that introduced rows 11–13 of audit-checklist.md (token-checked atomic state transitions, crash-window fallback timer, shared-keyspace collision in parallel smoke tests).content/develop/use-cases/pub-sub/ — the first non-keyspace use case ported. Introduced rows 14–18 of audit-checklist.md (subscribe-ack race, concurrent-name reservation, detached-worker PID capture, silent timeout fallthrough, server-wide PUBSUB introspection) plus the pub/sub conventions section in redis-conventions.md. Also the project that motivated adding Phase 4b (independent review) after Codex caught four real bugs that Phase 4 cleared.content/develop/use-cases/recommendation-engine/ — the first ML / vector-search use case. Introduced the ML / vector-search use cases section in redis-conventions.md (per-client embedding library table, pre-computed catalog.json wire format, FFI / Ruby-version setup blockers, per-port deviation conventions) and rows 24–28 of audit-checklist.md (vector dim mismatch in client-side blend helpers, L2 normalisation silently skipped by the embedding wrapper, TAG escape must include the backslash itself, connection-wide state toggle race on a shared client, weight=0 must disable not normalise to default). Each of the five new rows came from a real bug — bugbot or Codex caught all of them; the Python reference shipped with the TAG-escape bug originally.content/develop/use-cases/semantic-cache/ — the second ML / vector-search use case. Cache-on-LLM-responses backed by Redis Search KNN with a thresholded hit/miss decision and tenant/locale/model-version metadata filtering. Introduced rows 29–34 of audit-checklist.md: embedder Predictor / Session thread-safety on shared instances (DJL needs synchronized, ONNX is fine); library config keys that look real but don't take effect (WEBrick's MaxRequestBodySize is not an option name; the body cap must be enforced in user code); lockfile pinning a newer runtime than the manifest declares (composer.lock requiring PHP 8.4 while composer.json said ^8.2); NaN / Inf parsing via language-specific quirks (PHP (float)"nan" → 0.0 silently, must use textual rejection before parsing); per-language strings in HTML that's shared across language demos (badge text, default threshold must be populated via /state at first load); docs wire-form snippets must show escaped TAG values (gpt\-4\.5\-2026, not gpt-4.5-2026). Also the project that motivated the Phase 4b note about verifying independent-review findings against the current file before applying — several Jedis and PHP "missing" findings were actually re-discoveries of fixes that had landed minutes earlier.