bullmq

bullmq is a skill for Claude Code from zhe-qi/clhoria-template. It costs 45 tokens per session (2,389 once invoked), scanned A, original, MIT.

A guide for BullMQ background jobs, where BullMQ is a system that places work in Redis queues for workers to process later.

In plain words
What is it for?
Use it to add queues, job types, workers, scheduled tasks, validated job data, or a queue-monitoring page.
Why use it?
It standardizes queue definitions, job data validation, workers, scheduled jobs, and monitoring in this project.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to add queues, job types, workers, scheduled tasks, validated job data, or a queue-monitoring page.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zhe-qi/clhoria-template/bullmq
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zhe-qi/clhoria-template --skill bullmq
Clone the repo
git clone --depth 1 https://github.com/zhe-qi/clhoria-template

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bullmq

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhe-qi/clhoria-template/bullmq/github.svg)](https://agentmods.dev/skills/zhe-qi/clhoria-template/bullmq)
Your own site
<a href="https://agentmods.dev/skills/zhe-qi/clhoria-template/bullmq"><img src="https://agentmods.dev/badge/skills/zhe-qi/clhoria-template/bullmq/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bullmq

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhe-qi/clhoria-template/bullmq"><img src="https://agentmods.dev/badge/skills/zhe-qi/clhoria-template/bullmq.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,389 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.02389
Opus 5 $0.00023 $0.01195
Sonnet 5 $0.00009 $0.00478
Haiku 4.5 $0.00005 $0.00239

Measured 13d ago against content hash affb6c59df3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

bullmq scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/bullmq/SKILL.md · 321 lines

How it starts

The opening of the file, as written. The whole thing — 321 lines — stays where its author put it; the contents beside it link to each section on GitHub.

BullMQ 队列任务开发指南

技术栈

  • 队列系统: BullMQ v5.16.0+
  • 类型安全: TypeScript + Zod 运行时验证
  • Effect 集成: Effect 系统封装(Promise → Effect)
  • Redis: ioredis (maxRetriesPerRequest: null)
  • UI 监控: Bull Board (Hono adapter)

文件结构

src/lib/
├── enums/bullmq.ts                      # 队列和任务名称枚举
├── infrastructure/
│   ├── bullmq/
│   │   └── job-registry.ts              # 类型映射和 Zod 验证
│   ├── bullmq-adapter.ts                # QueueManager 核心类
│   └── effect/services/bullmq.ts        # Effect Layer
│   └── bootstrap.ts                     # Worker 注册位置
src/routes/admin/
└── queue-board.index.ts                 # Bull Board UI 路由

核心规则(MANDATORY)

三层类型安全架构

  1. 编译时约束QueueJobsMapping 确保队列只能使用特定 job name
  2. 类型推断JobDefinitionRegistry 自动推断 job data 类型
  3. 运行时验证JobSchemaRegistry 使用 Zod 验证数据

命名约定

  • 队列名称:小写字母(emailcleanup,不用 EMAIL_QUEUE
  • 任务名称:kebab-case(send-welcomedaily-cleanup
  • 常量枚举:对象字面量 + as const(不用 enum
  • 索引签名:[JobName.XXX]: Schema 形式

数据验证规则

  • 所有 job data 必须有对应的 Zod schema
  • Schema 必须包含中文错误消息
  • 日期格式:ISO 8601 字符串(2024-01-01T00:00:00Z
  • 日期字符串:YYYY-MM-DD 格式
  • UUID:使用 z.uuid() 验证

Effect 使用规范

  • 所有异步操作使用 Effect 封装(Effect.tryPromise
  • 同步操作使用 Effect.sync
  • 错误统一返回 Error 类型
  • Worker 注册使用 Effect.sync(立即返回 Worker 实例)

开发步骤

1. 添加新队列

参考 queue-definition.md

  1. src/lib/enums/bullmq.ts 添加队列名称
  2. job-registry.ts 创建 QueueJobsMapping 映射(初始为 never
  3. 注册 Worker(见步骤 3)

2. 添加新任务类型

参考 job-definition.md

  1. src/lib/enums/bullmq.ts 添加任务名称
  2. job-registry.ts 创建 Zod schema
  3. 更新 JobDefinitionRegistry 类型映射
  4. 更新 JobSchemaRegistry 验证映射
  5. 更新 QueueJobsMapping 关联队列

3. 注册 Worker

参考 worker-registration.md

  1. 在应用启动时调用 queueManager.registerWorker
  2. 实现 processor 函数(接收 Job<T> 类型)
  3. 可选配置:并发数、限流、重试策略
  4. Worker 自动验证 job data(无需手动验证)

4. 添加任务到队列

在业务代码中使用(无需创建文件):

Read the full file on GitHub · 321 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 321 lines · 45 tokens per session scan A affb6c59df3f

Subscribe to this mod's changes

bullmq is a skill published in the GitHub repository zhe-qi/clhoria-template (190 stars, last pushed 1mo ago), licensed MIT. It adds 45 tokens to every session and 2,389 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

using-redis-token-buckets

Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…

PostHog/posthog-foss · 148 tokens

spring-boot-cache

Provides patterns for implementing Spring Boot caching: configures Redis/Caffeine/EhCache providers with TTL and eviction policies, applies @Cacheable/@CacheEvict/@CachePut annotations, validates cache hit/miss behavior, and exposes metrics via Actuator. Use when adding caching to Spring Boot services, configuring…

giuseppe-trisciuoglio/developer-kit · 79 tokens

using-redis-token-buckets

Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…

PostHog/posthog · 148 tokens

spring-data-redis

Use when implementing caching, session storage, rate limiting, or any Redis integration. Covers cache-aside pattern, key naming, TTL strategy, and serialization config.

rrezartprebreza/spring-boot-skills · 37 tokens

background-job-orchestrator

Expert in background job processing with Bull/BullMQ (Redis), Celery, and cloud queues. Implements retries, scheduling, priority queues, and worker management. Use for async task processing, email campaigns, report generation, batch operations. Activate on "background job", "async task", "queue", "worker", "BullMQ"…

curiositech/some_claude_skills · 95 tokens

nw-sd-patterns

Core distributed systems patterns - load balancing, caching, sharding, consistent hashing, message queues, rate limiting, CDN, Bloom filters, ID generation, replication, conflict resolution, CAP theorem.

nWave-ai/nWave · 43 tokens