/syarif-laravel-ai-skills:queues-and-jobsfrom syarif-laravel-ai-skills
Design and operate Laravel queues, jobs, workers, and Horizon with retry safety, idempotency, failure handling, tests, and production visibility.
Ships in syarif-laravel-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use queues for work that can happen outside the request cycle: notifications, imports, exports, media processing, integration callbacks, long-running calculations, and retryable external operations.
This is the canonical queue skill. It consolidates the former queues-and-horizon topic while keeping horizon-metrics-and-dashboards for focused observability work.
Confirm the queue connection, worker manager, Horizon installation, failed-job storage, deployment process, and local runner before changing configuration or issuing operational commands. Do not assume Horizon is installed merely because Redis is used.
Queued jobs should be safe to retry.
Prefer:
handle();tries, backoff, timeout, and failure behavior when the job is important;final class ProcessRecord implements ShouldQueue
{
public function __construct(public int $recordId)
{
}
public function handle(): void
{
$record = Record::query()->findOrFail($this->recordId);
if ($record->processed_at !== null) {
return;
}
// Perform idempotent work.
}
}
Dispatch after commit when a queued job needs database writes to be visible.
ProcessRecord::dispatch($record->id)->afterCommit();
Separate transient failures from permanent failures. Retry network and temporary provider issues; fail fast for invalid state or bad input.
Log failures with redacted context. Do not log secrets, tokens, signatures, full payloads, or unnecessary personal data.
Do not force Horizon on every project. Use Horizon or equivalent visibility when queue volume, failed jobs, throughput, or production support justifies it.
Worker configuration should account for:
When Horizon is installed:
Without Horizon, apply the same timeout, memory, retry, graceful-restart, and failed-job expectations to the selected process manager.
Scheduled tasks should use overlap protection for long-running or non-reentrant work.
Schedule::command('records:process')
->everyFiveMinutes()
->withoutOverlapping()
->onOneServer();
Keep scheduled commands testable independently from cron.
Use Queue::fake() or Bus::fake() to assert dispatching. Test job behavior directly when the job contains meaningful logic.
Also verify retry/idempotency behavior, failure callbacks, batch or chain behavior when used, and after-commit dispatch for jobs that depend on newly written data. For operational changes, inspect the effective worker/Horizon configuration and perform a safe local smoke test when the required services are available.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
laravel-queues, horizon, job-design, worker-configuration, retry-safety
72 skills in this plugin
/actions-and-servicesUse Actions and Services as deliberate Laravel application boundaries for use cases, integrations, and reusable workflows./ai-sdkBuild AI features with the first-party Laravel AI SDK (Laravel 13+); agents, embeddings, images, audio, and tool calling with provider-agnostic APIs/api-resources-and-paginationLaravel guidance to use API Resources with pagination and conditional fields; keep response shapes stable and cache-friendlyGenerated from the plugin's indexed repository (soden46/syarif-laravel-ai-skills) — no native marketplace selected
npx claudepluginhub p/soden46-syarif-laravel-ai-skills