Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/igmarin-oban-essentials
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/oban-essentials
What's inside
- Skill name
oban-essentials- Description
- MANDATORY for ALL Oban work. Invoke before writing workers or enqueuing jobs. Covers worker definition, enqueuing, return values, queue configuration, idempotency, unique jobs, scheduled/recurring jobs, pruning, testing with Oban.Testing, and arg best practices. Trigger words: Oban, worker, job, queue, enqueue, perform, cron, idempotent, background job.
- License
- MIT
- Metadata
- version: 1.0.0 · user-invocable: true
- Instructions
- 317 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (3)
- SKILL.md
- oban_job_template.ex · assets/
- oban_testing_checklist.md · assets/
SKILL.md (first lines)
# Oban Essentials
Use this skill before writing ANY Oban worker or enqueuing jobs.
## End-to-End Workflow
When setting up a new Oban worker, follow these steps in order:
1. **Add queue to config** — define the queue name and concurrency in `config/config.exs`
2. **Define worker module** — `use Oban.Worker` with explicit `queue`, `max_attempts`, and `unique` options
3. **Enqueue from context** — call `Oban.insert/1` inside a context function, not a LiveView
4. **Write tests** — use `Oban.Testing` with `assert_enqueued` and `perform_job`, covering all return paths
## RULES — Follow these with no exceptions
**1.** **Use `Oban.Worker` with explicit `queue` and `max_attempts`** — never rely on defaults — see [Worker Definition](#worker-definition)
**2.** **Make workers idempotent** — the same job may execute more than once, so guard side effects — see [Idempotency](#idempotency)
**3.** **Never put large data in job args** — store IDs and fetch fresh data in the worker — see [Job Args Best Practices](#job-args-best-practices)
**4.** **Use `Oban.insert/1` (not `Oban.insert!/1`)** — handle the error tuple instead of raising — see [Enqueuing Jobs](#enqueuing-jobs)
**5.** **Enqueue from contexts, not LiveViews** — keep the web layer thin — see [Enqueuing from Contexts](#enqueuing-from-contexts)
**6.** **Return one of `{:ok, _}`, `{:error, _}`, `{:cancel, _}`, `{:snooze, _}` from `perform/1`** — never raise for expected failures — see [Return Values](#return-values)
## FCIS at this boundary
`perform/1` is an **edge runner**: load by ID, call pure/context functions, return Oban-tagged results. Do not bury domain rules only inside the worker.
❌ **Bad:** worker owns complex domain state
```elixir
def perform(%Oban.Job{args: %{"order_id" => id}}) do
order = Repo.get!(Order, id)
total = Enum.reduce(order.lines, 0, &(&1.amount + &2))
# ad-hoc retries / partial updates mixed here...
Repo.update!(Ecto.Changeset.change(order, total: total, shipped: true))
:ok
end
```
✅ **Good:** fetch → domain → tuple
```elixir
@impl Oban.Worker
def perform(%Oban.Job{args: %{"order_id" => id}}) do
with {:ok, order} <- Orders.fetch(id),
{:ok, order} <- Orders.mark_shipped(order) do
{:ok, order.id}
else
{:error, :not_found} -> {:cancel, "order missing"}
{:error, reason} -> {:error, reason}
end
end
```
## Worker Definition
See [`assets/oban_job_template.ex`](assets/oban_job_template.ex) for a copy-paste worker skeleton (`perform/1`, `max_attempts`, `unique:`, `backoff/1`, idempotency guard).
```elixir
defmodule MyApp.Workers.SendWelcomeEmail do
use Oban.Worker,
queue: :mailers,
max_attempts: 3,
unique: [period: 300, fields: [:args], keys: [:user_id]]
@impl Oban.Worker
def perform(%Oban.Job{args: %{"user_id" => user_id}}) do
with {:ok, user} <- MyApp.Accounts.fetch_user(user_id),
{:ok, result} <- MyApp.Accounts.send_welcome_if_needed(user) do
{:ok, result}
else
{:error, :not_found} -> {:cancel, "user #{user_id} not found"}
{:error, reason} -> {:error, reason}
end
end
end
```
## Enqueuing Jobs
```elixir
# Basic insert — always handle the result
case MyApp.Workers.SendWelcomeEmail.new(%{user_id: user.id}) |> Oban.insert() do
{:ok, job} -> {:ok, job}
{:error, changeset} -> {:error, changeset}
end
# Schedule for later
%{user_id: user.id}
|> MyApp.Workers.SendWelcomeEmail.new(schedule_in: 3600)
|> Oban.insert()
```
❌ **Bad — raises on failure:**
```elixir
MyApp.Workers.SendWelcomeEmail.new(%{user_id: user.id}) |> Oban.insert!()
```
### Enqueuing from Contexts
✅ **Good — context handles the job:**
```elixir
defmodule MyApp.Accounts do
def register_user(attrs) do
with {:ok, user} <- create_user(attrs) do
MyApp.Workers.SendWelcomeEmail.new(%{user_id: user.id})
|> Oban.insert()
{:ok, user}
end
end
end
```
❌ **Bad — LiveView enqueues directly:**
```elixirFrom igmarin/elixir-phoenix-skills, MIT.
More from igmarin/elixir-phoenix-skills
- 0.585score
phoenix-authorization-patterns
igmarin
Handles all authorization and access control work in Phoenix and LiveView applications.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
ash-framework
igmarin
MANDATORY when considering, adopting, or working with Ash Framework for Elixir applications.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
benchee-profiling
igmarin
MANDATORY when profiling and benchmarking Elixir code, or before optimizing performance-critical code.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
broadway-data-pipelines
igmarin
MANDATORY when building data processing pipelines or consuming message queues.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
mix-tasks-generators
igmarin
MANDATORY when creating custom Mix tasks or using Phoenix generators.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
cachex-caching
igmarin
MANDATORY for implementing caching in Elixir applications.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
otp-essentials
igmarin
MANDATORY for ALL OTP work.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
phoenix-authentication
igmarin
Use when adding or changing Phoenix authentication, phx.gen.auth integration, LiveView session identity, or migration between current_user and Phoenix 1.8…
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
apply-phoenix-controller-conventions
igmarin
Use when writing new controller code in Phoenix applications.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
deployment-gotchas
igmarin
MANDATORY for deployment and release configuration.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
ecto-changeset-patterns
igmarin
MANDATORY for ALL changeset work beyond basic CRUD.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
ecto-nested-associations
igmarin
MANDATORY for ALL nested association and multi-table work.
SkillAFreshness: A★ 5Claude Code +9
Signals
- Stars
- 5
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 28, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.0
- License
- MIT
- Repository
- github.com/igmarin/elixir-phoenix-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from igmarin
- 0.619score
implement-hotwire
igmarin
Use when adding Turbo Frames, Turbo Streams, or Stimulus controllers.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
optimize-performance
igmarin
Use when investigating N+1s, slow queries, caching, or query plans in Rails.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
extract-engine
igmarin
Use when extracting a host-app feature into a Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
implement-authorization
igmarin
Use when adding or reviewing Rails authorization with Pundit, CanCanCan, or policy objects.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
create-engine
igmarin
Use when scaffolding a new Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
seed-database
igmarin
Use when choosing seeds, fixtures, or factories for Rails dev/test data.
SkillAFreshness: A★ 28Claude Code +9
Cite this page
oban-essentials skill. Agent Mart. https://agentmart.dev/skills/igmarin-oban-essentials (last updated 2026-10-24)