erlang-otp-behaviors

Demonstrate OTP patterns for Erlang processes with gen_server, gen_statem, and supervisors.

Updated Jan 15, 2026
One-click install
npx skills add https://github.com/KaiserWhoLearns/skillsbench --skill erlang-otp-behaviors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erlang-otp-behaviors
Source: https://github.com/KaiserWhoLearns/skillsbench/tree/main/tasks/fix-erlang-ssh-cve/environment/skills/erlang-otp-behaviors
Command: npx skills add https://github.com/KaiserWhoLearns/skillsbench --skill erlang-otp-behaviors

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

OTP patterns solve the complexity of building reliable, concurrent Erlang applications by providing reusable building blocks for stateful processes, state machines, and fault-tolerant supervision trees.

Core Features & Use Cases

  • Gen_server basics: client-server processes with managed state and robust callbacks.
  • Gen_statem for state machines: explicit state transitions for protocol-heavy logic.
  • Supervisors and trees: automatic recovery and fault tolerance across components.
  • Practical examples: from simple counters to a cache with timeouts and dynamic supervision.

Quick Start

Set up an Erlang project that demonstrates gen_server, gen_statem, and a simple supervisor tree to illustrate OTP patterns.

Frequently Asked Questions about erlang-otp-behaviors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build fault-tolerant Erlang processes with supervision trees?

You build fault-tolerant Erlang processes using OTP supervisors to create supervision trees that provide automatic recovery. This Skill demonstrates configuring supervisor trees to manage stateful components and ensure reliable recovery across components.

When should I use gen_statem instead of gen_server for Erlang state machines?

Use gen_statem instead of gen_server when building Erlang state machines for protocol-heavy logic requiring explicit state transitions. Gen_server handles basic client-server state, while gen_statem manages complex event handling and transitions.

How to implement gen_server callbacks for managed state in Erlang OTP?

Implement gen_server callbacks by defining standard OTP functions to handle client-server requests and maintain managed state. This Skill provides practical examples from simple counters to caches with timeouts using gen_server patterns.

Can I create dynamic supervision for stateful Erlang services with timeouts?

Yes, you can create dynamic supervision for stateful Erlang services with timeouts using OTP patterns. This Skill demonstrates practical examples including a cache implementation with timeouts and dynamic supervision for production-friendly services.

What Erlang OTP knowledge is required to use supervision patterns effectively?

Effective use of OTP supervision patterns requires practical Erlang/OTP knowledge including gen_server, gen_statem, supervisors, and related patterns. This Skill targets developers building production-friendly Erlang services with stateful components and fault-tolerant trees.