implement-background-job — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited implement-background-job (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill when the task is to add, configure, or review background jobs in a Rails application.
EVERY job MUST have its test written and validated BEFORE implementation:
1. Write the job spec (idempotency, retry, error handling)
2. Run the spec — verify it fails
3. ONLY THEN write the job class
The authoritative perform contract — EVERY perform method does exactly three things:
1. Load the record from the passed ID
2. Guard for idempotency / permanent no-op conditions
3. Delegate the side effect or orchestration to a service object
If perform needs more than that, extract a service.
EVERY job that performs a side effect (charge, email, API call) MUST have
an idempotency check BEFORE the side effect.| Aspect | Rule |
|---|---|
| Arguments | Pass IDs, not objects |
| Retries | retry_on (explicit attempts:) for transient; discard_on for permanent errors |
| Backend (Rails 8) | Solid Queue (database-backed, no Redis) |
| Backend (Rails 7) | Sidekiq + Redis for high throughput |
| Recurring | config/recurring.yml (Solid Queue) or cron/sidekiq-cron |
| Anti-patterns | No ActiveRecord objects as args; no :inline/:async in production; no business logic in perform |
retry_on with explicit attempts: limit and discard_on for at least one permanent error.config/recurring.yml (Rails 8) or the chosen scheduler config.Rails 8 vs Rails 7
| Aspect | Rails 7 and earlier | Rails 8 |
|---|---|---|
| Default | No default; set queue_adapter (often Sidekiq) | Solid Queue (database-backed) |
| Dev/test | :async or :inline | Same |
| Recurring | External (cron, sidekiq-cron) | config/recurring.yml |
| Dashboard | Third-party (Sidekiq Web) | Mission Control Jobs |
Examples
Thin job with idempotency and retry:
class SendInvoiceReminderJob < ApplicationJob
queue_as :default
retry_on Net::OpenTimeout, wait: :polynomially_longer, attempts: 5
discard_on ActiveRecord::RecordNotFound
def perform(invoice_id)
invoice = Invoice.find(invoice_id)
return if invoice.reminder_sent_at?
InvoiceReminders::Send.call(invoice:)
end
endService owns the side effect and state update:
module InvoiceReminders
class Send
def self.call(invoice:)
InvoiceMailer.overdue(invoice).deliver_now
invoice.update!(reminder_sent_at: Time.current)
end
end
endLoad these files only when their specific content is needed:
retry_on/discard_on for specific error classes beyond the basic patterns aboveperform receives IDs, loads record, guards idempotency, delegates to serviceretry_on with attempts: limit and discard_on for permanent errorconfig/recurring.yml or scheduler configprocess_log.md| Skill | When to chain |
|---|---|
| review-migration | Solid Queue uses DB tables; add migrations safely |
| security-check | Jobs receive serialized input; validate like any entry point |
| write-tests | TDD gate: write job spec before implementation; use perform_enqueued_jobs |
| create-service-object | Keep perform thin; call service objects for business logic |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.