queue-debouncing

queue-debouncing is a cursor rule for Cursor from pekral/cursor-rules. It costs 0 tokens per session (1,288 once invoked), scanned A, original, MIT.

A set of rules for delaying duplicate Laravel queue jobs, which are background tasks processed by a Laravel application.

In plain words
What is it for?
Use it when designing delayed or repeat-triggered work such as search indexing, cache refreshes, previews, summaries, or customer-data synchronisation.
Why use it?
It prevents replaceable work from running repeatedly while protecting events that must be recorded or handled every time.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when designing delayed or repeat-triggered work such as search indexing, cache refreshes, previews, summaries, or customer-data synchronisation.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/pekral/cursor-rules/queue-debouncing
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.

Clone the repo
git clone --depth 1 https://github.com/pekral/cursor-rules

Made for: Cursor.

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 queue-debouncing

README.md
[![agentmods](https://agentmods.dev/badge/rules/pekral/cursor-rules/queue-debouncing/github.svg)](https://agentmods.dev/rules/pekral/cursor-rules/queue-debouncing)
Your own site
<a href="https://agentmods.dev/rules/pekral/cursor-rules/queue-debouncing"><img src="https://agentmods.dev/badge/rules/pekral/cursor-rules/queue-debouncing/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 queue-debouncing

Your own site · 80×15
<a href="https://agentmods.dev/rules/pekral/cursor-rules/queue-debouncing"><img src="https://agentmods.dev/badge/rules/pekral/cursor-rules/queue-debouncing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,288 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.00000 $0.01288
Opus 5.5 $0.00000 $0.00515
Sonnet 5.5 $0.00000 $0.00258
Haiku 4.5 $0.00000 $0.00129

Measured 1mo ago against content hash 9f009100c492, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

queue-debouncing 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 1mo 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.

rules/laravel/queue-debouncing.mdc · 206 lines

How it starts

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

Laravel Queue Debouncing

Core Principle

  • Debounce only work where the latest state safely replaces previous triggers.
  • Debounce belongs to a replaceable outcome, not to a generic entity.
  • A debounce key must describe what result may be safely replaced, not only which model changed.

Good debounce keys describe the replaceable outcome:

read-model:order:123
crm-sync:user:42
search-index:post:99
usage-summary:account:7
preview-render:document:15

Bad debounce keys are too generic and collapse unrelated business events:

order:123
user:42
account:7
project:15

Allowed Use Cases

Debouncing is allowed only for convergent work where intermediate states may be skipped safely:

  • Search index rebuilds
  • Cache refreshes
  • Read model rebuilds
  • CRM/profile snapshot syncs
  • Preview/render regeneration
  • Aggregate/statistical summary recalculation
  • Expensive derived data refreshes

Forbidden Use Cases

Never debounce meaningful business events where each occurrence has its own meaning. Do not debounce:

  • Payments
  • Refunds
  • Password changes
  • Security alerts
  • Audit logs
  • Webhook event recording
  • Fulfillment or shipment transitions
  • User-visible notifications expected immediately
  • Anything where order, timing, or exact occurrence matters

Split Mixed-Urgency Workflows

Split urgent and replaceable work into separate jobs. Urgent jobs must stay immediate and idempotent; convergent jobs may be debounced.

Bad — one generic sync job hides both urgent and convergent side effects:

SyncOrder::dispatch($order->id);

Good — explicit jobs with clear business meaning:

ProcessCapturedPayment::dispatch($payment->id, $order->id);

RefreshOrderReadModel::dispatch($order->id);
SyncOrderSnapshotToCrm::dispatch($order->id);

Idempotency Is Still Required

Debounce does not replace idempotency.

  • Debounce answers: should we avoid running this repeated work too many times?
  • Idempotency answers: is the result still correct if this job runs more than once?

Read the full file on GitHub · 206 lines

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. 1mo ago First seen · 206 lines · 0 tokens per session scan A 9f009100c492

Subscribe to this mod's changes

queue-debouncing is a cursor rule published in the GitHub repository pekral/cursor-rules (11 stars, last pushed 12d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,288 tokens. 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.