otp-essentials

Installation
SKILL.md

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.

Installs
2
GitHub Stars
134
First Seen
Apr 21, 2026
otp-essentials — j-morgan6/elixir-phoenix-guide