INVOKE BEFORE implementing or reviewing OTP components (Application, Supervisor, GenServer, Registry, DynamicSupervisor).
Use when
Adding or modifying supervised processes.
Designing registries/dynamic supervisors.
Debugging GenServer callbacks or timeouts.
Checklist
Separate client/API vs server callbacks.
Add @impl true to callbacks; pattern match on messages.
Avoid blocking in callbacks; offload to Tasks or async streams.
Supervision: choose the lightest strategy (one_for_one default).
Register via Registry or {via, Registry, ...} instead of global names.
Instrument with telemetry events for critical paths.
Quick snippets
Start child: Supervisor.start_child/2 for static; DynamicSupervisor.start_child/2 for dynamic.
Timeout hygiene: handle_call should avoid long work; use async reply when necessary.
References
ai-rules: patterns/otp/ if present; follow BEAMAI defaults.
1---2name: otp-patterns3description: Skill: otp-patterns4---5# Skill: otp-patterns67**INVOKE BEFORE** implementing or reviewing OTP components (Application, Supervisor, GenServer, Registry, DynamicSupervisor).89## Use when10- Adding or modifying supervised processes.11- Designing registries/dynamic supervisors.12- Debugging GenServer callbacks or timeouts.1314## Checklist15- Separate client/API vs server callbacks.16- Add `@impl true` to callbacks; pattern match on messages.17- Avoid blocking in callbacks; offload to Tasks or async streams.18- Supervision: choose the lightest strategy (one_for_one default).19- Register via `Registry` or `{via, Registry, ...}` instead of global names.20- Instrument with telemetry events for critical paths.2122## Quick snippets23- Start child: `Supervisor.start_child/2` for static; `DynamicSupervisor.start_child/2` for dynamic.24- Timeout hygiene: `handle_call` should avoid long work; use async reply when necessary.2526## References27- ai-rules: `patterns/otp/` if present; follow BEAMAI defaults.
Run npx skillmds@latest add layeddie/otp-patterns in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Skill: otp-patterns It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
layeddie (@layeddie) published this skill. Their other Agent Skills are listed on their SkillMD profile.