rails-job

Standardize Rails background jobs with Sidekiq, retries, and scheduling.

Updated Oct 12, 2024
One-click install
npx skills add https://github.com/samrocks03/shuttle-office-service --skill rails-job
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-job
Source: https://github.com/samrocks03/shuttle-office-service/tree/main/.claude/skills/rails-job
Command: npx skills add https://github.com/samrocks03/shuttle-office-service --skill rails-job

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps Rails teams implement background jobs consistently by providing a standards-driven pattern for ApplicationJob inheritance, queue management, retry strategies, and safe external calls, reducing boilerplate and mistakes.

Core Features & Use Cases

  • Job skeleton and location: guides placement under app/jobs with a base ApplicationJob and practical examples.
  • Retry and failure handling: defines deterministic retry_on strategies, logging, and error handling for reliable processing.
  • Scheduling and external calls: supports sidekiq-cron for scheduled tasks and a consistent ExternalService wrapper for external requests.

Quick Start

Create a new job under app/jobs that inherits from ApplicationJob and enqueue it with perform_later.

Frequently Asked Questions about rails-job

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize Rails background jobs using Sidekiq?

Standardize Rails background jobs by inheriting from ApplicationJob, declaring queues, using retry_on for deterministic failure handling, and logging with Sidekiq. This approach reduces boilerplate and ensures consistent asynchronous processing across your project.

How do I configure scheduled tasks with sidekiq-cron in Rails?

Configure scheduled tasks with sidekiq-cron by applying optional Sidekiq Cron configuration to your ApplicationJob classes. This allows you to manage recurring asynchronous jobs consistently alongside standard background processing in your Rails application.

What is the best way to handle retries and external service calls in Sidekiq?

Handle retries and external service calls by defining deterministic retry_on strategies within ApplicationJob and wrapping external requests in a consistent ExternalService wrapper. This ensures reliable processing and structured error handling for external requests.

Does this background job pattern work with transactional work in Rails?

Yes, this pattern works with transactional work in Rails. It standardizes ApplicationJob implementation to safely handle transactional boundaries, external service calls, and scheduled tasks, ensuring reliable asynchronous processing without common mistakes.

Why do my Sidekiq background jobs fail without consistent error handling?

Sidekiq background jobs fail without consistent error handling when lacking deterministic retry_on strategies and structured logging. Standardizing ApplicationJob inheritance and queue management prevents these gaps and ensures reliable failure recovery.