bullmq-specialist

Designs and reviews BullMQ job queues with Redis in a NestJS monorepo.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/SleyiW/iWana-neXt --skill bullmq-specialist-sleyiw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bullmq-specialist
Source: https://github.com/SleyiW/iWana-neXt/tree/main/.agents/skills/bullmq-specialist
Command: npx skills add https://github.com/SleyiW/iWana-neXt --skill bullmq-specialist-sleyiw

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @nestjs/bullmq, bullmq.

What problem does it solve? Building reliable asynchronous processing with BullMQ is error-prone: jobs can be non-idempotent, payloads can leak PII, retries can loop forever, and producers can become coupled to consumers. This Skill provides concrete patterns and review heuristics for designing safe, idempotent, tenant-aware BullMQ queues in a NestJS modulith where the API enqueues jobs and a separate worker app processes them. ## Core Features & Use Cases - Producer/Consumer Architecture Guidance: Enforces the split between @iwana/api (enqueue only) and @iwana/worker (process only) with concrete @nestjs/bullmq code patterns. - Idempotency & Retry Rules: Defines mandatory idempotency for financial, provisioning, and audit flows, plus criteria for retries, backoff, and dead-letter queues. - Payload & Tenant Safety: Establishes rules for minimal, secure payloads without PII or secrets, and explicit tenant context propagation. - Use Case: When implementing a tenant provisioning flow, use this Skill to define the queue contract, set jobId-based deduplication, configure exponential backoff retries, and review the worker processor for boundary violations. ## Quick Start Ask the assistant to design or review a BullMQ job flow for a NestJS service, for example to create an idempotent tenant provisioning queue with safe payloads and retry strategy.

Frequently Asked Questions about bullmq-specialist

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up BullMQ queues in a NestJS application?

Use @nestjs/bullmq with InjectQueue in the API service to enqueue jobs via Queue.add, and a @Processor class extending WorkerHost in a separate worker app to process them. Keep the producer and consumer in different applications so workers scale independently.

How do I make BullMQ jobs idempotent?

Assign a deterministic jobId derived from the business key, such as provision-{tenantId}, so duplicate submissions are deduplicated. The processor logic must also tolerate retries, duplicates, and re-execution after restarts without repeating side effects.

What should a BullMQ job payload contain?

Payloads should be minimal contracts containing ids, correlation keys, and only the context the worker needs. Avoid full entity snapshots, large objects, PII, secrets, or tokens; rehydrate data from secure sources inside the worker instead.

How should BullMQ retries and dead-letter queues be configured?

Use bounded retries with exponential backoff, for example attempts: 3 with a 1000ms base delay. Distinguish transient from permanent errors and route unrecoverable jobs to a DLQ or equivalent terminal handling instead of infinite requeue loops.

Why is my BullMQ worker processing jobs with the wrong tenant context?

Tenant context must travel explicitly in the job payload or a secure context mechanism; it cannot be inferred from ephemeral producer state. Never hardcode schemas, tenants, or data paths inside the worker.

When should I not use BullMQ for asynchronous processing?

Avoid BullMQ to disguise coupling between modules, to store domain data persistently in Redis, or to hide real failures behind endless retries. Complex untested business logic should live in application services, not inside the processor.