nestjs-caching-queues

nestjs-caching-queues is a skill for Claude Code from dkmqflx/nestjs-best-practices-plugin. It costs 63 tokens per session (776 once invoked), scanned A, original, MIT.

A set of NestJS guidelines for caching and background-job queues. Caching reuses frequently needed data, while a queue moves slow work such as emails or media processing to separate workers.

In plain words
What is it for?
It helps configure CacheModule, Redis, cache expiration, BullMQ or Bull queues, workers, retries, backoff, and decisions about which work should run asynchronously.
Why use it?
It helps keep responses fast and makes stored data, retries, expiration, and failure behavior predictable under load.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the nestjs-best-practices plugin — 12 skills shipped together

Good fit It helps configure CacheModule, Redis, cache expiration, BullMQ or Bull queues, workers, retries, backoff, and decisions about which work should run asynchronously.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dkmqflx/nestjs-best-practices-plugin/nestjs-caching-queues
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 dkmqflx/nestjs-best-practices-plugin --skill nestjs-caching-queues
Clone the repo
git clone --depth 1 https://github.com/dkmqflx/nestjs-best-practices-plugin

Made for: Claude Code.

Or install nestjs-best-practices, the plugin that ships this one along with the rest of its 12 skills.

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 nestjs-caching-queues

README.md
[![agentmods](https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-caching-queues/github.svg)](https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-caching-queues)
Your own site
<a href="https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-caching-queues"><img src="https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-caching-queues/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 nestjs-caching-queues

Your own site · 80×15
<a href="https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-caching-queues"><img src="https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-caching-queues.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 776 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.
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.00063 $0.00776
Opus 5 $0.00032 $0.00388
Sonnet 5 $0.00013 $0.00155
Haiku 4.5 $0.00006 $0.00078

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

Security

Grade A, and why

nestjs-caching-queues 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 12d 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.

plugins/nestjs-best-practices/skills/nestjs-caching-queues/SKILL.md · 46 lines

How it starts

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

NestJS Caching & Queues

Best practices for two related NestJS performance techniques: caching (@nestjs/cache-manager, backed by Keyv/Redis) and background-job queues (@nestjs/bullmq, backed by Redis). Caching avoids recomputing or re-fetching hot data; queues move slow or unreliable work off the request path so HTTP responses stay fast. Both are Redis-backed in production and share the same core concern: predictable behavior under load and failure.

Verified against the NestJS v10/v11 docs (techniques/caching, techniques/queues). Note the units gotcha: cache TTLs are in milliseconds since @nestjs/cache-manager v2 / cache-manager v5+.

When to Apply

Reference these rules when:

  • Registering CacheModule or injecting CACHE_MANAGER / using CacheInterceptor
  • Choosing a cache store (in-memory dev vs. Redis prod via @keyv/redis)
  • Setting or debugging cache TTLs and cache invalidation
  • Deciding whether work belongs inline or in a queue (email, image/video processing, external API calls)
  • Wiring BullModule, @InjectQueue, or a @Processor consumer
  • Configuring retries/backoff, or scaling workers as a separate deployment

Rules

Rule Impact Topic
cache-module-setup HIGH Register CacheModule globally; in-memory for dev, Redis for prod
set-sensible-ttl HIGH Always set a TTL (in ms); never leave caches unbounded
cache-keys-explicit HIGH Deterministic, namespaced keys; invalidate on writes
offload-heavy-work-to-queues CRITICAL Move slow/external work off the request path into a queue
idempotent-processors CRITICAL Processors must tolerate retries and duplicate deliveries
retries-and-backoff HIGH Configure attempts + exponential backoff for transient failures
separate-worker-process MEDIUM Run consumers as a separate process/deployment for scaling & isolation

How to Use

  1. Caching first. Start with cache-module-setup, then apply set-sensible-ttl and cache-keys-explicit to every cached value — a cache without a TTL or an invalidation story is a correctness bug, not just a performance one.
  2. Queues for anything slow or flaky. Apply offload-heavy-work-to-queues to decide what to enqueue, then idempotent-processors and retries-and-backoff to make the consumer safe to re-run. These two are CRITICAL: BullMQ retries and at-least-once delivery mean a non-idempotent processor will double-charge, double-send, or corrupt data.
  3. Scale out. Apply separate-worker-process when CPU-bound jobs threaten the event loop or you need to scale producers and consumers independently.

Read the full file on GitHub · 46 lines

Files

What ships with it

7 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. 12d ago First seen · 46 lines · 63 tokens per session scan A 63c64b41585c

Subscribe to this mod's changes

nestjs-caching-queues is a skill published in the GitHub repository dkmqflx/nestjs-best-practices-plugin (1 stars, last pushed 2mo ago), licensed MIT. It adds 63 tokens to every session and 776 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

bullmq-specialist

BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications. Use when: bullmq, bull queue, redis queue, background job, job queue.

agent-skills-hub/agent-skills-hub · 47 tokens

ts-db-perf

Optimize TypeScript code that interacts with databases. Use this skill when the user wants to fix N+1 queries, add caching, improve transaction safety, prevent race conditions, simplify async flows, or generally speed up a TypeScript backend. Triggers on phrases like "optimize", "slow query", "N+1", "race condition"…

widnyana/eyay-toolkits · 107 tokens

performance-caching-rate-limits

Use this capability for performance optimization, load tests, k6/JMeter/Locust plans, caching, Redis, CDN, Cache-Control, invalidation, rate limiting, quotas, token bucket, sliding window, 429 behavior, abuse protection, and cost-based throttling.

KyaniteLabs/checkyourself · 62 tokens

Cache Strategy Consistency Guard

Detect undefined or inconsistent cache strategies (layers, consistency, invalidation, TTL, failure handling) in design documents.

s977043/river-review · 29 tokens

caching-strategies

Implement effective caching at every layer: in-memory, Redis, CDN, and browser. Activate whenever the user asks about caching, performance optimization for repeated data access, Redis patterns, CDN configuration, cache invalidation, HTTP cache headers, memoization, or stale-while-revalidate strategies.

VersoXBT/claude-initial-setup · 63 tokens

caching-strategy

Drupal cache API patterns including cache tags, cache contexts, max-age, render caching, and cache invalidation strategies. Use when implementing caching, debugging cache issues, or optimizing Drupal performance.

abderrahimghazali/drupal-boost · 42 tokens