Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Redis

ASecurity

How to use @owlmeans/redis — the Redis connection service (makeRedisService / appendRedis) registered on a server context, its cfg.dbs configuration, the options() seam for consumers that need a connection of their own, and the cluster caveat. Auto-invoked when wiring Redis into a server app.

3 stars
0 votes
0 copies
0 views
Added 9/22/2026
devopstypescriptgonodedatabase

Works with

cli

Security Analysis

A100/100

Scanned 9/22/2026

Install to Claude Code

$npx -y skills add owlmeans/common --skill redis --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Redis?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Redis
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/owlmeans-redis/badge)](https://www.skillsdirectory.com/skills/owlmeans-redis)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: redis
description: How to use @owlmeans/redis — the Redis connection service (makeRedisService / appendRedis) registered on a server context, its cfg.dbs configuration, the options() seam for consumers that need a connection of their own, and the cluster caveat. Auto-invoked when wiring Redis into a server app.
user-invocable: false
---

# @owlmeans/redis

**Layer:** Infra
**Install:** `"@owlmeans/redis": "^0.1.18-rc.27"` in `dependencies`

The connection half. The `Resource` contract over those connections is `@owlmeans/redis-resource`;
queues on them are `@owlmeans/redis-queue`.

## Key Exports

| Export | Description |
|--------|-------------|
| `appendRedis(context, alias?)` | Register the service — the usual wiring |
| `makeRedisService(alias?)` | The bare factory, when registering it yourself |
| `RedisMeta` | What `cfg.dbs[].meta` accepts here: `dbIndex`, `masterNumber`, `slaveNumber`, plus any ioredis option |
| Constants | `DEFAULT_ALIAS` (`redis`, shared with `@owlmeans/redis-resource`) |

The service interface itself (`RedisDbService`, `RedisClient`, `RedisDb`, `RedisConnection`) is
declared in `@owlmeans/redis-resource`, so a consumer types against the contract package rather
than against the driver.

## Usage

```typescript
import { appendRedis } from '@owlmeans/redis'

appendRedis(context)
```

```typescript
const redis = context.service<RedisDbService>(DEFAULT_ALIAS)
await redis.ready()
const client = await redis.client()          // the pooled connection
const { single, cluster, prefix } = redis.options()
```

Connections are configured through `cfg.dbs` — a LIST of `DbConfig` entries, each naming the
`service` that owns it and the `alias` it answers to. Every entry for this service is resolved when
the service initializes, and its client is closed on SIGTERM.

| Field | Meaning |
|---|---|
| `host` | A string for a single server; an ARRAY makes it a cluster (see below) |
| `port` | Defaults to 6379 |
| `secret` | The password |
| `user` | Sent as ioredis' `username` **only when set** — a bare `requirepass` server rejects AUTH with a username, so leave it absent unless the server has ACL users |
| `schema` | The key prefix, falling back to the entry's `alias` and then the service's. Every resource on the connection namespaces itself `<prefix>-<resource name>:<id>` |
| `meta.dbIndex` | The database index (`SELECT n`). Accepts a string, so it can come from a file-mounted config value; never use ioredis' own `db` |

**A `dbIndex` other than 0 turns `watch` off.** Redis publishes keyspace events per database, as
`__keyspace@<db>__:<key>`, and `@owlmeans/redis-resource` subscribes to `__keyspace@0__:` — so on
any other index a resource's `watch` handler silently never fires. Deployments sharing one instance
isolate on the key prefix (`schema`), and leave `dbIndex` alone wherever anything watches.

## `options()` versus `client()`

`options(alias)` hands out the settings rather than a client, because a consumer that BLOCKS on a
read holds its connection for the duration and so cannot share the pooled one. Anything doing that
— BullMQ's workers and event streams, for instance — builds its own client from these settings,
which keeps the configuration here instead of being re-derived from `cfg.dbs` and drifting. It
answers `{ single, prefix }` for one host and `{ cluster, prefix }` for several; exactly one of the
two is present, which is how a consumer that cannot work on a cluster refuses at connection time.

## Server Requirements

- Redis **6.2 or newer** — `@owlmeans/redis-resource` deletes with `GETDEL`, which is the whole
  reason `delete`/`take` hand back the record they removed without a preceding read.
- `notify-keyspace-events` enabled if any resource uses `watch` — redis publishes nothing
  otherwise.
- **A single server for anything answering criteria.** A resource answers `list`/`count`/`purge`
  and `load(where)` by walking its own prefix with `SCAN`, which reaches one server — so in a
  clustered deployment those calls see a fraction of the keyspace. Keep clustered resources on the
  by-id operations, or put the data in mongo or postgres. Queues refuse a cluster outright.

## A multi-host entry OWNS its cluster

A `dbs[]` entry whose `host` is an array of more than one does not merely connect: it asserts the
topology. It MEETs the nodes it was given, FORGETs the ones it was not, and where the layout does
not match `meta.masterNumber` / `meta.slaveNumber` it resets nodes and reassigns slot ranges —
which flushes them. Point such an entry only at a cluster this service is meant to own; for a
cluster managed elsewhere, or for a single server, give `host` one string. (A one-element array
collapses to a single connection and is safe.)

## Tests

This package's `tests/` hold the integration specs for the `@owlmeans/redis-resource` contract —
it supplies the connection they run against. Gated on `REDIS_URL` (see `/.env.example`); run them
with `bun test ./tests`.

## Depends On

- `@owlmeans/redis-resource` — the service and resource contracts, and `DEFAULT_DB_ALIAS`
- `@owlmeans/resource` — `createDbService`, `DbConfig`
- `@owlmeans/server-context` — the config and context this service binds to
- `ioredis` (runtime)

## Related

- `redis-resource` — records, TTL, pub/sub, keyspace watching and streams over these connections
- `redis-queue` — BullMQ queues over them

Attribution

owlmeansowlmeans
View sourceMore from owlmeans →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Terraform Module Library

Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

397921 votes

sematext-otel

Wire a service's OpenTelemetry output to Sematext Cloud. Walks through region, App-type, instrumentation flow (managed OTLP endpoint vs Sematext Agent), and signal selection (traces/metrics/logs), then produces the exact env-var block and points at a runnable reference example in this repo. Invoke when instrumenting a new app for Sematext.

01 votes

Deployment Patterns

Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.

2459130 votes

Babysit

Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.

942310 votes

V7 Roster

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

805540 votes
View all in devops →