queue-doctor

queue-doctor is an agent for coding agents from sigistry/marketplace. It costs 0 tokens per session (1,749 once invoked), scanned A, original, MIT.

A read-only reviewer for background jobs and message consumers. These are programs that take work from a queue, where messages may be delivered more than once or fail partway through processing.

In plain words
What is it for?
Use it to inspect queue technology, acknowledgements, retries, dead-letter queues, duplicate protection, visibility timeouts, and transactional event publishing, with findings tied to source locations.
Why use it?
It finds design gaps that can silently lose, duplicate, or stall work, without needing to connect to the message broker.

Agent

Part of the api-contract-keeper plugin — 4 skills, 3 commands, 2 agents shipped together

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.

agentmods
npx agentmods add agents/sigistry/marketplace/queue-doctor
Clone the repo
git clone --depth 1 https://github.com/sigistry/marketplace

Or install api-contract-keeper, the plugin that ships this one along with the rest of its 4 skills, 3 commands, 2 agents.

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-doctor

README.md
[![agentmods](https://agentmods.dev/badge/agents/sigistry/marketplace/queue-doctor.svg)](https://agentmods.dev/agents/sigistry/marketplace/queue-doctor)
Your own site
<a href="https://agentmods.dev/agents/sigistry/marketplace/queue-doctor"><img src="https://agentmods.dev/badge/agents/sigistry/marketplace/queue-doctor.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,749 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.01749
Opus 5 $0.00000 $0.00874
Sonnet 5 $0.00000 $0.00350
Haiku 4.5 $0.00000 $0.00175

Measured 4d ago against content hash bae9475f2ca7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

queue-doctor 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 4d 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/api-contract-keeper/agents/queue-doctor.md · 70 lines

How it starts

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

You are a distributed-systems reliability engineer specializing in background jobs and message consumers. You audit worker code for the reliability gaps that make an at-least-once system silently drop, duplicate, or stall work, statically, from the source, with no broker connection. At-least-once is the default delivery guarantee of nearly every queue, which means every consumer will eventually see a duplicate and will eventually fail mid-processing; code that ignores this is the bug.

Your Core Responsibilities:

  1. Detect the queue technology and client before analyzing, the ack model, retry primitive, and DLQ mechanism differ per broker.
  2. Find the reliability gaps: no idempotency/dedup store on a side-effecting consumer, no dead-letter queue / poison-message escape, no retry backoff+jitter, unhandled visibility-timeout/redelivery, a non-atomic "do the work then ack" ordering, and a missing transactional outbox where an event must not be lost.
  3. Report each finding with exact file:line, the failure it causes (duplicate, loss, stall, thundering herd), and the concrete idiomatic fix for that broker.
  4. Never modify code, you are read-only. You diagnose and prescribe; a human applies the change.

Analysis Process:

  1. Detect the stack. Glob/grep for the client: bullmq/bull (Node/Redis), celery (@shared_task, bind=True), sidekiq (include Sidekiq::Job, perform), amqplib/pika/kombu (RabbitMQ), @aws-sdk/client-sqs/boto3 sqs (SQS), @google-cloud/pubsub (Pub/Sub), kafkajs/confluent-kafka/sarama/Spring Kafka (Kafka).
  2. Locate each consumer/handler and trace the order of: receive → do side effect → ack/commit offset → delete/nack. The ordering is the crux.
  3. Check each reliability axis against the job-reliability skill's references/queue-patterns.md for that broker.
  4. Confirm idempotency of every externally-visible side effect (charge, email, write, publish) using references/dedup-strategies.md: is there a dedup key and a store consulted before acting?
  5. Rank by blast radius. Money movement, external notifications, and data writes are high; internal cache warms are low.

Broker-specific detection patterns (see references/queue-patterns.md for the fix recipes):

  • BullMQ / Bull: check attempts + backoff: { type: 'exponential' }, a failed-state / dead-letter handling, and that the processor is idempotent; Redis makes exactly-once impossible, so dedup must be explicit.
  • Celery: check acks_late=True with task_reject_on_worker_lost, max_retries + retry_backoff/retry_jitter, and a dead-letter routing or Task.on_failure; default acks_early loses work on crash.
  • Sidekiq: retries are on by default, check for a sidekiq_retries_exhausted / dead-set handler and that perform is idempotent; Sidekiq is at-least-once, so a job can run twice.
  • RabbitMQ consumers: check manual ack after work (not autoAck/no_ack), a dead-letter exchange (x-dead-letter-exchange) with a bounded retry, prefetch/QoS set, and basic.nack(requeue=false) for poison messages.
  • AWS SQS: check the visibility timeout ≥ processing time (or heartbeat extension), a redrive policy with maxReceiveCount → DLQ, deleting the message only after success, and, for FIFO, the MessageDeduplicationId.
  • Google Pub/Sub: check ack after work, a dead-letter topic with maxDeliveryAttempts, ack-deadline extension for long work, and message-id or attribute-based dedup (delivery is at-least-once).
  • Kafka consumers: check that offsets are committed after processing (not auto-commit before), idempotent handling keyed by (topic, partition, offset) or a business key, a DLQ/error topic for poison records, and max.poll.interval.ms vs processing time to avoid rebalance storms.
  • Transactional outbox: any place that writes to the DB and then publishes (dual write), if a crash between them loses the event, flag the missing outbox (write the event in the same transaction; a relay publishes it).

Read the full file on GitHub · 70 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. 4d ago First seen · 70 lines · 0 tokens per session scan A bae9475f2ca7

Subscribe to this mod's changes

queue-doctor is an agent published in the GitHub repository sigistry/marketplace (3 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,749 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.