nestjs-bullmq
Implement BullMQ job workflows in NestJS. Use when building queue processors, redis-throttler, Upstash limits, idle polling, stalled jobs, and retention policies.
- 0
- Installs
- —
- Rating
- —
- Success rate
- 3
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 110bd088f6fbe18e… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.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:
ThrottlerGuardregistered as globalAPP_GUARD— Redis blip propagates errors to ALL HTTP routes.RedisThrottlerStorage.increment()must catch all Redis errors and return fail-open pass-through record. 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 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
Files
3- SKILL.md
6f4fc60d423.6 KB - evals/evals.json
c15ac3c2ea3.8 KB - references/patterns.md
80c2985ce69.3 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from HoangNguyen0403/agent-skills-standard8
Upgrade an Android project to Android Gradle Plugin (AGP) 9. Use when migrating to AGP 9, updating Gradle build files, migrating to built-in Kotlin, or adopting the new AGP DSL.
Apply Clean Architecture layering, modularization, and Unidirectional Data Flow in Android projects. Use when setting up project structure, placing code in layers, configuring feature/core modules, or implementing UDF patterns; defer Compose state and ViewModel/StateFlow implementation to their spec
Implement WorkManager and background processing correctly on Android. Use when creating Worker classes, scheduling tasks, choosing between WorkManager and Foreground Services, or setting up Hilt in workers; defer FCM and notification delivery to android-notifications.
Build high-performance declarative UI with Jetpack Compose. Use when writing Composable functions, optimizing recomposition, hoisting state, or working with LazyColumn and side effects; defer deep-link and navigation routing to android-navigation.
Migrate an Android XML View to Jetpack Compose following a structured 10-step workflow. Use when converting XML layouts to Compose, setting up Compose in an existing View-based project, or incrementally adopting Compose.
Write correct coroutine scopes, lifecycle collection, and dispatcher injection in Android production code. Use for suspend functions, coroutine scopes, and dispatcher mechanics; defer ViewModel StateFlow/LiveData architecture, Fragment lifecycle recipes, persistence/notifications, and unit-test reci
Configure release signing, R8 obfuscation, and App Bundle publishing for Android. Use when setting up signing configs, enabling minification, adding ProGuard keep rules, or preparing for Play Store submission.
Enforce Material Design 3 theming and design token usage in Jetpack Compose. Use when implementing M3 components, color schemes, typography, or design tokens.
Related backend skillsscan passed
Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes. Use when building or reviewing Node.js, Express, or Next.js API routes and their data access.
Report browser/API/CLI/job/worker/webhook bugs. (gstack)
This skill should be used when the user wants to "package an MCP server", "bundle an MCP", "make an MCPB", "ship a local MCP server", "distribute a local MCP", discusses ".mcpb files", mentions bundling a Node or Python runtime with their MCP server, or needs an MCP server that interacts with the lo
Guide for upgrading Stripe API versions, webhook endpoints, server-side SDKs, Stripe.js, and mobile SDKs
PostHog integration for server-side Node.js applications using posthog-node
Mount tRPC as a Fastify plugin with fastifyTRPCPlugin from @trpc/server/adapters/fastify. Configure prefix, trpcOptions (router, createContext, onError). Enable WebSocket subscriptions with useWSS and @fastify/websocket. Set routerOptions.maxParamLength for batch requests. Requires Fastify v5+. Fast