---
name: "rails-active-job-sidekiq-redis"
description: "Offload time-consuming tasks to asynchronous background worker queues using Sidekiq and Redis."
metadata:
  author: "Sidekiq"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "configure sidekiq in rails"
  - "write active job class"
  - "sidekiq queue priority"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Rails Active Job & Sidekiq Redis Background Processing

Configures Active Job with Sidekiq: defining job classes (ApplicationJob), retry_on exponential backoff, discard_on for unrecoverable errors, queue prioritization (critical, default, low), and Sidekiq Web UI.

## When to Invoke
Invoke this skill whenever you need to:
- configure sidekiq in rails
- write active job class
- sidekiq queue priority

## Execution SOP & Rules
1. Set queue adapter in config/application.rb: config.active_job.queue_adapter = :sidekiq.
2. Create job: class InvoiceJob < ApplicationJob; queue_as :default; def perform(id): ... end.
3. Configure config/sidekiq.yml defining concurrency (e.g. 10) and queues: [critical, default, mailers].
4. Mount Sidekiq::Web in routes.rb protected behind admin authentication constraints.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
