otp-essentials

otp-essentials is a skill for Claude Code, Codex from j-morgan6/elixir-phoenix-guide. It costs 36 tokens per session (2,860 once invoked), scanned A, original, MIT.

A set of rules for writing Elixir OTP code, the tools Elixir uses to run concurrent, fault-tolerant processes. It covers GenServers, supervisors, tasks, agents, and registries.

In plain words
What is it for?
Use it when building or reviewing GenServers, supervisors, tasks, agents, or registries in an Elixir application.
Why use it?
It helps avoid common process-lifecycle, timeout, naming, and request-handling mistakes.

Skill for Claude CodeCodex

Part of the elixir-phoenix-guide plugin — 19 skills, 3 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/j-morgan6/elixir-phoenix-guide/otp-essentials
Any agent
npx skills add j-morgan6/elixir-phoenix-guide --skill otp-essentials
Clone the repo
git clone --depth 1 https://github.com/j-morgan6/elixir-phoenix-guide

Made for: Claude Code, Codex.

Or install elixir-phoenix-guide, the plugin that ships this one along with the rest of its 19 skills, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for otp-essentials

README.md
[![agentmods](https://agentmods.dev/badge/skills/j-morgan6/elixir-phoenix-guide/otp-essentials.svg)](https://agentmods.dev/skills/j-morgan6/elixir-phoenix-guide/otp-essentials)
Your own site
<a href="https://agentmods.dev/skills/j-morgan6/elixir-phoenix-guide/otp-essentials"><img src="https://agentmods.dev/badge/skills/j-morgan6/elixir-phoenix-guide/otp-essentials.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,860 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00036 $0.02860
Opus 5 $0.00018 $0.01430
Sonnet 5 $0.00007 $0.00572
Haiku 4.5 $0.00004 $0.00286

Measured 5d ago against content hash edafde8b9fc2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

otp-essentials scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/otp-essentials/SKILL.md · 436 lines

How it starts

The opening of the file, as written. The whole thing — 436 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OTP Essentials

RULES — Follow these with no exceptions

  1. Always use @impl true before GenServer/Agent callbacks (init, handle_call, handle_cast, handle_info, terminate)
  2. Keep init/1 fast — no blocking calls, no DB queries; use handle_continue for expensive setup
  3. Use GenServer.call for request/response, GenServer.cast for fire-and-forget — never cast when you need a result
  4. Always define a public API wrapping GenServer calls — callers should never use GenServer.call(pid, ...) directly
  5. Use Task.async/Task.await with bounded timeouts — never Task.async without a corresponding Task.await or Task.yield
  6. Name processes via Registry, not atoms — atom table is finite and never garbage collected
  7. Supervisors own process lifecycle — never start unsupervised long-running processes

GenServer

Public API Pattern

Always wrap GenServer calls behind a public module API. Callers should not know they're talking to a GenServer.

# Bad — leaks GenServer implementation to callers
GenServer.call(MyApp.Cache, {:get, key})

# Good — public API hides the GenServer
defmodule MyApp.Cache do
  use GenServer

  # --- Public API ---

  def start_link(opts) do
    name = Keyword.get(opts, :name, __MODULE__)
    GenServer.start_link(__MODULE__, opts, name: name)
  end

  def get(key, server \\ __MODULE__) do
    GenServer.call(server, {:get, key})
  end

  def put(key, value, server \\ __MODULE__) do
    GenServer.cast(server, {:put, key, value})
  end

  # --- Callbacks ---

  @impl true
  def init(_opts) do
    {:ok, %{}}
  end

  @impl true
  def handle_call({:get, key}, _from, state) do
    {:reply, Map.get(state, key), state}
  end

  @impl true
  def handle_cast({:put, key, value}, state) do
    {:noreply, Map.put(state, key, value)}
  end
end

Fast Init with handle_continue

Never block in init/1. Use handle_continue for expensive setup.

# Bad — blocks the supervisor while loading data
@impl true
def init(opts) do
  data = MyApp.Repo.all(MyApp.Item)  # Blocks!
  {:ok, %{items: data}}
end

# Good — returns immediately, loads data asynchronously
@impl true
def init(opts) do
  {:ok, %{items: []}, {:continue, :load_data}}
end

@impl true
def handle_continue(:load_data, state) do
  data = MyApp.Repo.all(MyApp.Item)
  {:noreply, %{state | items: data}}
end

Read the full file on GitHub · 436 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 436 lines · 36 tokens per session scan A edafde8b9fc2

Subscribe to this mod's changes

otp-essentials is a skill published in the GitHub repository j-morgan6/elixir-phoenix-guide (159 stars, last pushed 2mo ago), licensed MIT. It adds 36 tokens to every session and 2,860 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

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

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens