bundles/infrastructure/skills/nestjs-queue-architect/SKILL.md
Queue job management patterns, processors, and async workflows for video/image processing
npx skillsauth add shipshitdev/library nestjs-queue-architectInstall 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.
You are a senior queue architect specializing in BullMQ with NestJS. Design resilient, scalable job processing systems for media-heavy workflows.
Before implementing:
.agents/memory/ for any architecture files describing queue patterns[project]-queue-architect skillexport const QUEUE_NAMES = {
VIDEO_PROCESSING: 'video-processing',
IMAGE_PROCESSING: 'image-processing',
} as const;
export const JOB_PRIORITY = {
HIGH: 1, // User-facing
NORMAL: 5, // Standard
LOW: 10, // Background
} as const;
@Injectable()
export class VideoQueueService {
constructor(@InjectQueue(QUEUE_NAMES.VIDEO) private queue: Queue) {}
async addJob(data: VideoJobData) {
return this.queue.add(JOB_TYPES.RESIZE, data, {
priority: JOB_PRIORITY.NORMAL,
attempts: 3,
backoff: { type: 'exponential', delay: 2000 },
});
}
}
@Processor(QUEUE_NAMES.VIDEO)
export class VideoProcessor extends WorkerHost {
async process(job: Job<VideoJobData>) {
switch (job.name) {
case JOB_TYPES.RESIZE: return this.handleResize(job);
case JOB_TYPES.MERGE: return this.handleMerge(job);
default: throw new Error(`Unknown job: ${job.name}`);
}
}
}
job.nameBullModule.registerQueue({
name: QUEUE_NAMES.VIDEO,
defaultJobOptions: {
attempts: 3,
backoff: { type: 'exponential', delay: 2000 },
removeOnComplete: 100, // Prevent Redis bloat
removeOnFail: 50,
},
});
| Job Type | Attempts | Delay | Reason | |----------|----------|-------|--------| | Resize | 3 | 2000ms | Transient failures | | Merge | 2 | 5000ms | Resource-intensive | | Metadata | 2 | 1000ms | Fast, fail quickly | | Cleanup | 5 | 1000ms | Must succeed |
removeOnComplete/Failtimeout for heavy jobsFor complete processor examples, testing patterns, Bull Board setup, and Redis pub/sub integration, see: references/full-guide.md
development
Create an isolated git worktree from the correct base branch and check it out into a clean, gitignored directory. Use when the user asks to make a worktree, spin up a parallel/isolated workspace, work on something without disturbing the current checkout, branch off the current work, or run multiple agents on the same repo at once. Picks the base branch smartly — the current feature branch when you are on one, otherwise the develop integration branch — so worktrees continue your in-progress work by default instead of forking from the wrong place.
development
Verify a release was fully promoted through develop, staging, and master/main, then prune merged local and remote branches and stale git worktrees. Squash-merge aware — uses GitHub PR merge state as the merge oracle, not commit ancestry. Use when the user asks to clean up branches after a deploy, prune worktrees, remove merged branches, tidy up after promoting develop to staging to master, or confirm nothing stale was left behind before pruning.
development
Structured "done coding, now what?" workflow: verify tests pass, detect the repository environment (normal repo vs worktree, named branch vs detached HEAD), present exactly the right merge / PR / keep / discard options, and execute the chosen path including safe worktree cleanup. Use when implementation is complete and the branch needs to be integrated, published, or abandoned.
tools
Capture a client or stakeholder feature request, turn it into a planner-ready PRD epic with scoped sub-issues, check for duplicate work, and place approved issues on a GitHub Projects kanban. Use when a user invokes feature intake, asks to turn a rough client requirement into GitHub issues, or wants an idea written as a PRD and pushed to a board.