laravel-queues
БесплатноБез исполняемых скриптовНе проверенLaravel 13 queue and job patterns — driver choice, job design (idempotency, ShouldQueue, model serialisation), retry and failure handling, worker scaling, Bus…
от 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.phporconfig/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—databasefor small apps;redisfor production scale;sqsfor Laravel Vaporconfig-after-commit— setafter_commit: trueto prevent dispatching jobs that reference uncommitted DB rowsconfig-failed-storage—failed_jobstable is required (defaultdatabase-uuidsdriver, created by the default jobs migration; or DynamoDB on Vapor); schedulequeue:prune-failed(not supported on DynamoDB — use TTL)
2. Job Design (CRITICAL)
design-shouldqueue— every async job MUST implementShouldQueue(the #1 production bug: forgetting it makes the job run synchronously)design-pass-ids-not-models—SerializesModelsstores class + key + loaded relation names and re-queries on the worker; use#[WithoutRelations]and load whathandle()needs; pass an ID when the job should own the lookupdesign-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 withShouldBeUnique
3. Retry & Failure (HIGH)
retry-tries-and-backoff— set both:#[Tries(5)]+#[Backoff([1, 5, 30])]; the defau
Установить laravel-queues в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic