.claude/skills/pikku-redis/SKILL.md
Use when setting up Redis-backed services in a Pikku app. Covers channel stores, workflow services, secret services, event hubs, agent runs, and deployment services backed by Redis. TRIGGER when: code uses RedisChannelStore, RedisWorkflowService, RedisSecretService, or user asks about Redis setup with Pikku. DO NOT TRIGGER when: user asks about BullMQ queues (use pikku-queue) or SQL databases (use pikku-kysely).
npx skillsauth add pikkujs/pikku pikku-redisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
@pikku/redis provides Redis-backed implementations of Pikku's core service interfaces using ioredis.
yarn add @pikku/redis
All services accept a Redis connection (ioredis Redis instance, RedisOptions, or connection string) in their constructor.
| Service | Interface | Purpose |
|---------|-----------|---------|
| RedisChannelStore | ChannelStore | WebSocket channel state persistence |
| RedisEventHubStore | EventHubStore | Event hub state persistence |
| RedisWorkflowService | PikkuWorkflowService | Workflow definition storage |
| RedisWorkflowRunService | WorkflowRunService | Workflow execution tracking |
| RedisDeploymentService | DeploymentService | Deployment state management |
| RedisAgentRunService | AgentRunService | Agent execution tracking |
| RedisSecretService | SecretService | Encrypted secret storage (envelope encryption) |
import { RedisSecretService } from '@pikku/redis'
const secrets = new RedisSecretService(
connectionOrConfig: Redis | RedisOptions | string,
config: { kekSecret: string; salt: string }
)
await secrets.getSecret(key: string): Promise<string>
await secrets.getSecretJSON<R>(key: string): Promise<R>
await secrets.hasSecret(key: string): Promise<boolean>
await secrets.setSecretJSON(key: string, value: unknown): Promise<void>
await secrets.deleteSecret(key: string): Promise<void>
await secrets.rotateKEK(): Promise<number>
await secrets.close(): Promise<void>
import { RedisChannelStore, RedisWorkflowService, RedisSecretService } from '@pikku/redis'
const createSingletonServices = pikkuServices(async (config) => {
const logger = new PinoLogger()
const channelStore = new RedisChannelStore(config.redisUrl)
const workflowService = new RedisWorkflowService(config.redisUrl)
const secrets = new RedisSecretService(config.redisUrl, {
kekSecret: config.kekSecret,
salt: config.salt,
})
return { config, logger, channelStore, workflowService, secrets }
})
documentation
Deprecated — use pikku-middleware instead. Tag middleware (addTagMiddleware) is now documented as a section within the pikku-middleware skill, alongside global HTTP middleware, execution order, and the service-to-service bearer auth pattern.
testing
Use when adding authorization checks to Pikku functions or routes — pikkuPermission, pikkuAuth, per-function permissions, pattern-based permissions, or understanding OR/AND permission logic. TRIGGER when: user wants to restrict who can call a function, check resource ownership, add role-based access, or understand where permission checks belong. DO NOT TRIGGER when: user asks about middleware or request interception (use pikku-middleware), authentication strategies (use pikku-security), or session management.
testing
Use when adding any middleware to a Pikku app — global HTTP middleware, tag-scoped middleware (including service-to-service bearer auth), per-route middleware, session-setting middleware, or understanding middleware execution order and priority. TRIGGER when: user wants middleware on some or all routes, machine-to-machine auth, tag-scoped cross-cutting concerns, global interceptors, or middleware priority/order questions. DO NOT TRIGGER when: user asks about permissions/authorization checks (use pikku-permissions), auth strategies like authBearer/authCookie (use pikku-security), or deployment.
documentation
Standard cleanup to run right after a Pikku template is cloned or scaffolded into a new project. TRIGGER when: a Pikku template was just cloned/scaffolded (via `pikku create`, `git clone <template>`, or the user says "I cloned the kanban template / starter / template"), or the working tree still looks like an untouched template (template README, placeholder `@project/*` name in package.json). DO NOT TRIGGER when: working in an established project mid-feature, or editing the template repo itself.