/estack:estack-otpfrom estack
Guides choosing and operating Elixir OTP patterns: GenServers, supervision trees, tasks, ETS. Helps with process design, fault isolation, and diagnosing mailboxes/timeouts.
Ships in estack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Inspect the supervision tree and installed Elixir/OTP versions. Start with the runtime requirement, not a preference for process-shaped code.
| Requirement | Starting point |
|---|---|
| Pure transformation | Plain function/module |
| Bounded concurrent work | Task or Task.Supervisor with explicit result/error handling |
| Shared state with serialized operations | GenServer; Agent for very simple state |
| Explicit state/event transitions | Consider :gen_statem when complexity warrants it |
| Many reads of shared in-memory data | ETS with an explicit owner and lifecycle |
| Per-entity processes | DynamicSupervisor and Registry |
| Work surviving process/node loss | Durable queue or persisted workflow |
Stateless work can still need concurrency. Supervision and state are separate decisions. Do not choose spawn_link solely because a decision tree has no better branch.
Use linked tasks when their failure should fail the caller. Use supervised unlinked tasks when failures must be handled separately. async_nolink alone does not make Task.await safe: await exits on task failure or timeout.
This illustrative function handles an isolated task's result, failure, and timeout in an ordinary caller:
defmodule Estack.Examples.IsolatedTask do
def run(supervisor, fun, timeout) do
task = Task.Supervisor.async_nolink(supervisor, fun)
case Task.yield(task, timeout) || Task.shutdown(task, :brutal_kill) do
{:ok, result} -> {:ok, result}
{:exit, reason} -> {:error, {:task_exit, reason}}
nil -> {:error, :timeout}
end
end
end
Killing work does not reverse effects already performed. Use a durable idempotent job for important writes.
In GenServers/LiveViews, avoid blocking the mailbox waiting for long work. Handle task result and :DOWN messages, clear references, and clean up monitors; use LiveView async APIs where appropriate. Bound async-stream concurrency and handle exits/timeouts. Choose linked versus unlinked stream behavior intentionally.
Use :one_for_one for independent children, :rest_for_one for ordered dependencies, and :one_for_all only when the children must restart together. Set restart intensity based on recovery behavior. A supervisor restarts a process according to its child spec; it does not persist state, retry every Task automatically, or guarantee business completion.
Keep init fast. handle_continue defers work beyond init but still blocks that process's mailbox while it runs.
A GenServer serializes callbacks. Measure mailbox growth and latency before assuming it scales. Use call when a reply is required, but recognize that timeouts are not admission control and do not cancel server work automatically. Bound work intake explicitly when needed.
For ETS, document the owner, access mode, restart behavior, and table availability. A protected table lets callers read directly and routes writes through its owner; reads during owner restart may need handling. Use :persistent_term only for rarely changed data; updates have system-wide costs.
Name dynamic processes with Registry/via tuples instead of runtime-generated atoms. Use PartitionSupervisor only after measuring a supervisor bottleneck.
Consolidate polling when multiple views need the same external data. Add timeout, backoff, jitter, and bounded work. A named GenServer is a singleton per node, not per cluster. Use an explicit cluster coordination strategy or a durable scheduler if duplicate polling would be harmful.
Keep external I/O out of a busy shared server's callback when it would delay unrelated messages. Broadcast only the data authorized subscribers should receive.
Inspect queue length, process memory, reductions, and scheduler utilization over time. There is no universal mailbox length that proves a bottleneck. Use :sys.get_state and tracing selectively; state/traces may contain sensitive data. Turn tracing off when finished.
Carry needed locale, request metadata, and identifiers into new processes explicitly. Avoid copying large closures/sockets; reference-counted binaries have different copying behavior from ordinary terms.
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (singularityhacker/estack) — no native marketplace selected
npx claudepluginhub p/singularityhacker-estack20 skills in this plugin
/estack-architectureDesign Phoenix context boundaries and application interfaces. Use when adding a feature, deciding where modules belong, introducing API/MCP adapters, or working in an Ash or umbrella application./estack-debugInvestigate and fix Elixir/Phoenix failures from symptoms and code evidence. Use for crashes, failed tests, incorrect queries, LiveView events, Oban retries, or production error reports./estack-deployPrepare Phoenix releases, migrations, health checks, and observable rollouts. Use when editing runtime config, deployment pipelines, Docker builds, production topology, or release diagnostics./estack-doctorInspect an Elixir/Phoenix project's setup without modifying it. Use for readiness checks, installed dependency/tool detection, initial Estack adoption, or a prioritized engineering report./estack-ectoImplement Ecto data access, ownership, changesets, transactions, and safe migrations. Use when editing schemas, queries, tenant-scoped contexts, or database writes./estack-elixirWrite idiomatic, version-compatible Elixir and handle errors explicitly. Use when editing control flow, types, collections, resource handling, or library boundaries.Other plugins' skills for the same job