> nestjs-bullmq
Implement BullMQ job workflows in NestJS. Use when building queue processors, redis-throttler, Upstash limits, idle polling, stalled jobs, and retention policies. (triggers: **/*.processor.ts, **/*.module.ts, **/bull-queue.constants.ts, **/redis-throttler*.ts, queue, background job, worker, processor, bullmq, drainDelay, stalledInterval, removeOnComplete, redis limit, upstash, fail-open, throttler)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/nestjs-bullmq?format=md"NestJS BullMQ Implementation
Priority: P0 (Critical)
Guidelines
- Set idle polling: Add
drainDelay+stalledInterval+maxStalledCountto every@Processor. DefaultdrainDelay(5 ms) burns 570M Redis commands/day at idle. See patterns.md. - Throttle worker error logs: BullMQ workers emit raw unhandled ReplyErrors on Redis failure (e.g. Upstash rate limits). Always extend
BaseProcessorinstead ofWorkerHostto rate-limit these logs. See patterns.md. - Set job retention: Add
removeOnComplete,removeOnFail,attempts,backoffto everyBullModule.registerQueue. See patterns.md. - Use shared constants: All numeric options live in
src/common/constants/bull-queue.constants.ts. Key constants:QUEUE_DRAIN_DELAY_MS(10 000 ms),QUEUE_STALLED_INTERVAL_MS(60 000 ms). UsegetSharedBullQueueOptionshelper forregisterQueue. Queue/job names go in{feature}.constants.ts. Never inline magic numbers. - Wrap every
queue.add(): Persist DB record first, then enqueue inside try-catch. Redis errors must not surface as 500s. See patterns.md. - Throttler fail-open:
ThrottlerGuardis registered as globalAPP_GUARD— a Redis blip propagates errors to ALL HTTP routes.RedisThrottlerStorage.increment()must catch all Redis errors and return a fail-open pass-through record. A Redis blip must not kill all HTTP routes. See patterns.md. - Guard new queues: Follow
isRedisEnabled()conditional + mock token pattern in every module. NestJS DI throws on startup without mock. - Keep processor and cron: Cron schedules; processor executes. Both always required — they are complementary. See patterns.md.
- Use local Redis in dev: Never point dev machines at Upstash — idle workers exhaust free tier (500K/day) in minutes.
Anti-Patterns
- No bare
@Processor(NAME): Always pass worker options object withdrainDelayandstalledInterval. - No bare
WorkerHostextension: Always extendBaseProcessorinstead to intercept and rate-limit worker errors. - No
registerQueuewithoutdefaultJobOptions: Omitting causes unbounded Redis memory growth. - No inline numbers: Use
bull-queue.constants.ts— never write10_000,60_000,50,20,3, or5_000directly. - No unguarded
queue.add(): Wrap in try-catch; persist DB state first. - No throws in throttler increment: Catch Redis errors; return fail-open record.
- No missing mock token: Provide
getQueueTokenmock whenredisEnabled = false. - No removing processor because cron exists: They serve different roles.
- No cloud Redis in dev: Use local Docker Redis.
References
> related_skills --same-repo
> common-store-changelog
Generate user-facing release notes for the Apple App Store and Google Play Store by collecting git history, triaging user-impacting changes, and drafting store-compliant changelogs. Enforces character limits (App Store ≤4000, Google Play ≤500), tone, and bullet format. Use when generating release notes, app store changelog, play store release, what's new, or version release notes for any mobile app. (triggers: generate changelog, app store notes, play store release, what's new, release notes, ve
> golang-tooling
Go developer toolchain — gopls LSP diagnostics, linting, formatting, and vet. Use when setting up Go tooling, running linters, or integrating gopls with Claude Code. (triggers: gopls, golangci-lint, golangci.yml, go vet, goimports, staticcheck, go tooling, go lint)
> common-ui-design
Design distinctive, production-grade frontend UI with bold aesthetic choices. Use when building web components, pages, interfaces, dashboards, or applications in any framework (React, Next.js, Angular, Vue, HTML/CSS). (triggers: build a page, create a component, design a dashboard, landing page, UI for, build a layout, make it look good, improve the design, build UI, create interface, design screen)
> common-owasp
OWASP Top 10 audit checklist for Web Applications (2021) and APIs (2023). Load during any security review, PR review, or codebase audit touching web, mobile backend, or API code. (triggers: security review, OWASP, broken access control, IDOR, BOLA, injection, broken auth, API review, authorization, access control)