skills/bullmq-game-queues/SKILL.md
Use when implementing job queues, matchmaking systems, async game events, delayed jobs, or scheduled tasks with BullMQ. Triggers: queue, matchmaking, async events, jobs, workers, scheduling.
npx skillsauth add fcsouza/agent-skills engineering-bullmq-game-queuesInstall 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.
Job queue patterns for games using BullMQ + Redis — matchmaking, async events, delayed jobs, scheduled tasks.
Trigger: job queue, matchmaking, async events, delayed jobs, scheduled tasks, BullMQ, background processing, game events, retry strategy, dead letter queue
redis-game-patterns (Redis connection)Will Wright: "Simulation systems benefit from decoupled event processing." Sid Meier: "Queue priorities ensure the most interesting events happen first."
bun add bullmq ioredis
Use the connection from redis-game-patterns, or create a dedicated one for queues. See templates/queue-config.ts for the full configuration pattern.
Start with the type definitions in templates/job-types.ts. These cover matchmaking, game events, rewards, notifications, and analytics job payloads.
Use boilerplate/queues.ts to define typed queues per domain. Each queue has its own retry strategy, concurrency, and priority settings.
See boilerplate/workers.ts for worker implementations. Each worker processes jobs from a specific queue with proper error handling, logging, and result tracking.
Use boilerplate/scheduler.ts to set up cron-based repeatable jobs (daily rewards, leaderboard snapshots, session cleanup) and delayed one-off jobs (season events, timed rewards).
Add queue event listeners for completed, failed, and stalled jobs. Integrate with your monitoring stack via monitoring-game-ops.
import { matchmakingQueue } from './queues';
await matchmakingQueue.add('find-match', {
playerId: 'player_123',
skillRating: 1500,
region: 'us-east',
preferences: { mode: 'ranked', teamSize: 2 },
}, { priority: 1 });
import { rewardQueue } from './queues';
await rewardQueue.add('distribute-reward', {
playerId: 'player_123',
rewardType: 'daily-login',
payload: { currency: 100, items: ['item_rare_box'] },
}, { delay: 60_000 }); // 1 minute delay
import { gameEventQueue } from './queues';
await gameEventQueue.add('process-event', {
eventType: 'match-completed',
sessionId: 'session_456',
participants: ['player_123', 'player_456'],
outcome: { winnerId: 'player_123', duration: 300 },
});
See boilerplate/queues.ts for full queue definitions, boilerplate/workers.ts for worker implementations, and boilerplate/scheduler.ts for scheduled jobs.
redis-game-patterns for Redis connection and cachingpostgres-game-schema for persisting job results to the databasegame-backend-architecture for integrating queues with the game servermonitoring-game-ops for queue monitoring and alertingWill Wright: Simulation systems benefit from decoupled event processing. Queues let game systems communicate asynchronously, the same way SimCity processes zoning, traffic, and utilities independently. Each queue is a subsystem that can evolve without affecting others.
Sid Meier: Queue priorities ensure the most "interesting" events happen first. A player waiting for a match should never be blocked by analytics processing. Priority levels map directly to player-perceived responsiveness.
tools
Use when implementing client-server state synchronization, delta compression, optimistic updates, rollback netcode, or real-time game state reconciliation. Triggers: state sync, netcode, delta, rollback, interpolation, prediction.
testing
Use when designing virtual economies, currencies, sink/faucet balance, loot tables, crafting systems, shops, or inflation control. Triggers: economy, currency, sinks, loot, inflation, crafting, shop.
development
Audits existing game code against design principles — checks server-authority, schema conventions, auth security, payment safety, narrative coherence, and MVP scope drift. Extract the optional component name or path from the user's message (defaults to entire src/). Use after building components or before committing.
testing
Designs a single quest end-to-end — coherence check, objective tree, quest brief, and registry entry. Extract the quest name from the user's message. Requires docs/world-lore.md and docs/quest-registry.md.