mcpbeat Sign in

Oban Skill for Claude

Oban job processing — workers, perform/1 (OSS) and process/1 (Pro), queues, cron, retries, unique jobs, idempotency, Oban Pro (Workflow, Batch, Chunk, Smart Engine), Testing. Use when writing Oban workers, queue config, or debugging jobs.

6k tokens
context cost
the whole folder, loaded on every use
5
files
instructions only
0
copies elsewhere
how many repositories repackaged it
514
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/oliver-kriska/claude-elixir-phoenix --skill oban

What comes with it

18 774 bytes besides the instruction
references/oban-pro-basics.md
references/queue-config.md
references/testing-patterns.md
references/worker-patterns.md

The instruction itself

10 sections, as written by the author

Oban Background Jobs Reference

Quick reference for Elixir Oban patterns.

Oban Pro Detection

Before applying patterns, check for Oban Pro:

grep -E "oban_pro|oban_web" mix.exs
grep -r "use Oban.Pro.Worker" lib/
grep -r "Oban.Pro.Engines.Smart" config/

If Oban Pro detected, use Pro patterns for ALL new workers:

| Standard Oban | Oban Pro |

|---------------|----------|

| use Oban.Worker | use Oban.Pro.Worker |

| def perform(%Job{}) | def process(%Job{}) |

| Oban.Testing | Oban.Pro.Testing |

| Advisory lock engine | Oban.Pro.Engines.Smart |

Pro features (all optional): args_schema (typed args), Workflows, Batches, Chunks,

Relay, hooks, encryption, deadlines, chaining, Smart Engine (global concurrency + rate limiting).

Pro plugins (DynamicCron, DynamicLifeline, DynamicPruner) enhance OSS equivalents — swap module, don't run both.

See references/oban-pro-basics.md for all patterns and migration guide.


Iron Laws — Never Violate These

  • JOBS MUST BE IDEMPOTENT — Safe to retry. Use idempotency keys for payments
  • JOBS MUST STORE IDs, NOT STRUCTS — JSON serialization. %{user_id: 1} not %{user: %User{}}
  • JOBS MUST HANDLE ALL RETURN VALUES:ok, {:error, _}, {:cancel, _}, {:snooze, _}
  • ARGS USE STRING KEYS — Pattern match %{"user_id" => id} not %{user_id: id}
  • UNIQUE CONSTRAINTS FOR USER ACTIONS — Prevent double-click duplicates
  • NEVER STORE LARGE DATA IN ARGS — Store references (IDs, paths), not content
  • SMART ENGINE: NEVER USE attempt TO LIMIT SNOOZES — Snooze rolls back attempt counter. Use meta["snoozed"] instead. Causes infinite loops

Quick Worker Template

defmodule MyApp.Workers.ExampleWorker do
  use Oban.Worker,
    queue: :default,
    max_attempts: 5,
    unique: [period: {5, :minutes}, keys: [:entity_id]]

  @impl Oban.Worker
  def perform(%Oban.Job{args: %{"entity_id" => id}}) do
    case process(id) do
      {:ok, _} -> :ok
      {:error, :not_found} -> {:cancel, "Entity not found"}
      {:error, :rate_limited} -> {:snooze, {5, :minutes}}
      {:error, reason} -> {:error, reason}
    end
  end
end

Return Value Meanings

| Return | State | Behavior |

|--------|-------|----------|

| :ok | completed | Success |

| {:ok, value} | completed | Success with value |

| {:error, reason} | retryable | Retry with backoff |

| {:cancel, reason} | cancelled | Stop permanently |

| {:snooze, seconds} | scheduled | Delay and retry |

Quick Decisions

Which Queue?

  • Critical operations → High concurrency (20+)
  • Mailers/Webhooks (I/O) → Medium concurrency (30-50)
  • CPU-intensive → Low concurrency (3-5)
  • External APIs → Use dispatch_cooldown for rate limiting

Testing Pattern

use Oban.Testing, repo: MyApp.Repo

# Assert enqueued
assert_enqueued worker: MyApp.Worker, args: %{id: 1}

# Execute and verify
assert :ok = perform_job(MyApp.Worker, %{id: 1})

Common Anti-patterns

| Wrong | Right |

|-------|-------|

| %{user_id: id} pattern match | %{"user_id" => id} (string keys) |

| %{user: %User{}} in args | %{user_id: 1} (IDs only) |

| No idempotency for payments | Use idempotency keys |

| Ignoring return values | Handle all outcomes explicitly |

References

For detailed patterns, see:

  • references/worker-patterns.md - Worker options, backoff, timeout
  • references/queue-config.md - Queue design, pool sizing, cron, Smart Engine
  • references/testing-patterns.md - Testing, assertions, drain (OSS + Pro)
  • references/oban-pro-basics.md - Pro.Worker, Workflow, Batch, Chunk, Relay, plugins

Other skills for the same job

different authors, same section of the catalogue
Webapp Testing
by anthropics
vendor ×12

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

6k tokens scripts
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
Test Driven Development
by w95
×7

Use when implementing any feature or bugfix, before writing implementation code

2k tokens
Systematic Debugging
by ratacat
×7

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

10k tokens scripts
Verification Before Completion
by ZhanlinCui
×6

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

1k tokens
Backtest Expert
by BaggaT236
×3

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.

15k tokens scripts
Adaptyv
by christophacham
×3

Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.

16k tokens
Aeon
by christophacham
×3

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

19k tokens

How to use it

Copy the folder

Take oliver-kriska/claude-elixir-phoenix-oban from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.