estack-otp
Installation
SKILL.md
OTP patterns
Inspect the supervision tree and installed Elixir/OTP versions. Start with the runtime requirement, not a preference for process-shaped code.
Choose the mechanism
| 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.