Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

laravel-queues

БесплатноБез исполняемых скриптовНе проверен

Laravel 13 queue and job patterns — driver choice, job design (idempotency, ShouldQueue, model serialisation), retry and failure handling, worker scaling, Bus…

AsyrafHussinот AsyrafHussin★ 112 звёзд на GitHub

Об этом скилле

Laravel Queues & Jobs

Production-grade queue patterns for Laravel 13 (MySQL + Redis). Contains 22 rules across 6 categories covering driver choice, job design, retry/failure handling, worker scaling, batching/chaining, and testing. Targets the failure modes that pass code review but break under load — silent re-dispatch on retry, relations reloaded in full on the worker, missing idempotency on payment jobs, workers leaking memory, and "we forgot ShouldQueue and the request takes 12 seconds in production."

Metadata

  • Version: 1.1.0
  • Scope: PHP / Laravel 13.x (tested 13.43+) + MySQL + Redis (queues), optional Horizon
  • Rule Count: 22 rules across 6 categories
  • Updated: November 2026
  • License: MIT

How to Use

When the user asks "design this background job", "audit our queue setup", "why is this job not running", or anything queue-related — work through this skill's rules as a checklist against the relevant files (job classes, config/queue.php, config/horizon.php, supervisor config, the dispatching call sites).

For audit mode, output per-rule verdicts:

  • PASS — pattern correctly applied
  • FAIL — anti-pattern present (with file:line + fix recommendation)
  • N/A — does not apply to this codebase

End with a top-priority fix list (idempotency on payment jobs, missing ShouldQueue, supervisor stopwaitsecs too low — these are the most common production-bite issues).

When to Apply

Reference this skill when:

  • Writing a new background job (php artisan make:job)
  • Reviewing a PR that adds or modifies a job class
  • Setting up queue workers on a new server (Forge / Vapor / bare server)
  • Configuring config/queue.php or config/horizon.php
  • Debugging a stuck, looping, or repeatedly-failing job
  • Choosing between dispatch(), dispatchSync(), dispatchAfterResponse(), Bus::batch(), Bus::chain()
  • Adding queue testing (Queue::fake(), Bus::fake())
  • Deciding whether to adopt Horizon

Step 1: Detect Queue Setup

Inspect:

File What to learn
config/queue.php Default connection (QUEUE_CONNECTION env), failed-jobs storage, after_commit setting
config/horizon.php (if present) Horizon environments, balance strategy, worker counts, timeouts
app/Jobs/*.php Job classes, ShouldQueue usage, tries/backoff, failed() methods
app/Console/Kernel.php or routes/console.php Scheduled jobs (Schedule::job(...), withoutOverlapping)
database/migrations/0001_01_01_000002_create_jobs_table.php (or *_create_failed_jobs_table.php) jobs, job_batches, failed_jobs tables; or DynamoDB driver in config
supervisor*.conf / /etc/supervisor/conf.d/ Worker process management, numprocs, --max-time, stopwaitsecs

Typical setups:

Stack Queue driver Failed driver Worker manager
Small Laravel + MySQL database database Supervisor (or systemd)
Production Laravel + Redis redis database (or dynamodb for serverless) Supervisor + Horizon
Laravel Vapor sqs dynamodb Vapor-managed

Rule Categories by Priority

Priority Category Impact Prefix
1 Driver & Config CRITICAL config-
2 Job Design CRITICAL design-
3 Retry & Failure HIGH retry-
4 Scaling & Workers HIGH scaling-
5 Batching & Chaining HIGH bus-
6 Testing & Operations MEDIUM ops-

Quick Reference

1. Driver & Config (CRITICAL)

  • config-driver-choice — database for small apps; redis for production scale; sqs for Laravel Vapor
  • config-after-commit — set after_commit: true to prevent dispatching jobs that reference uncommitted DB rows
  • config-failed-storage — failed_jobs table is required (default database-uuids driver, created by the default jobs migration; or DynamoDB on Vapor); schedule queue:prune-failed (not supported on DynamoDB — use TTL)

2. Job Design (CRITICAL)

  • design-shouldqueue — every async job MUST implement ShouldQueue (the #1 production bug: forgetting it makes the job run synchronously)
  • design-pass-ids-not-models — SerializesModels stores class + key + loaded relation names and re-queries on the worker; use #[WithoutRelations] and load what handle() needs; pass an ID when the job should own the lookup
  • design-idempotency — payment, external API, and "create resource" jobs must be safe to run twice (ShouldBeUnique, idempotency keys, unique DB constraints)
  • design-constructor-vs-handle — constructor runs at dispatch (sync); handle() runs on the worker. No DB writes or HTTP calls in the constructor.
  • design-debounce-jobs — #[DebounceFor(30, maxWait: 120)] + debounceId() so a burst of dispatches runs once, with the latest data; not with ShouldBeUnique

3. Retry & Failure (HIGH)

  • retry-tries-and-backoff — set both: #[Tries(5)] + #[Backoff([1, 5, 30])]; the defau
Полный SKILL.md на GitHub

Установить laravel-queues в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

AGENTS.mdREADME.mdmetadata.jsonrules/_sections.mdrules/_template.mdrules/bus-batch-failure-handling.mdrules/bus-batch-vs-chain.mdrules/bus-chunking-large-sets.mdrules/config-after-commit.mdrules/config-driver-choice.mdrules/config-failed-storage.mdrules/design-constructor-vs-handle.mdrules/design-debounce-jobs.mdrules/design-idempotency.mdrules/design-pass-ids-not-models.mdrules/design-shouldqueue.mdrules/ops-horizon-when.mdrules/ops-queue-fake.mdrules/ops-schedule-queued-jobs.mdrules/retry-fail-on-timeout.mdrules/retry-failed-method.mdrules/retry-failure-control.mdrules/retry-transient-vs-permanent.mdrules/retry-tries-and-backoff.mdrules/scaling-multi-queue-priority.mdrules/scaling-supervisor-config.mdrules/scaling-worker-recycling.md

FAQ

Что делает скилл laravel-queues?

Laravel 13 queue and job patterns — driver choice, job design (idempotency, ShouldQueue, model serialisation), retry and failure handling, worker scaling, Bus batching and chaining, Horizon when warranted, queue testing. Use when designing async jobs, scheduling background work, configuring Horizon, debugging stuck jobs, or auditing queue health. Triggers on "Laravel queue", "Laravel job", "background job", "Horizon setup", "failed jobs", "Bus batch", "queue worker tuning".

Как установить скилл laravel-queues?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл laravel-queues запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить laravel-queues с