Agent skill

Elixir OTP Concurrency

by georgeguimaraes in georgeguimaraes/elixir-agent-tools

Guides choices among GenServer, Supervisor, Task, Registry, ETS and Broadway when designing or debugging Elixir concurrency, state and fault recovery.

Apache-2.0Auto-check passedBackend & APIs

Install Elixir OTP Concurrency

skills CLI
$ npx skills add georgeguimaraes/elixir-agent-tools --skill otp -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install georgeguimaraes/elixir-agent-tools otp --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/georgeguimaraes/elixir-agent-tools.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/elixir-dev/skills/otp .claude/skills/otp && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
otp
GitHub stars
184
Token cost
~1.2k tokens
SKILL.md length
455 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guides choices among GenServer, Supervisor, Task, Registry, ETS and Broadway when designing or debugging Elixir concurrency, state and fault recovery.

  • Works in 3 steps: Do I actually need serialized access? → Will this become a throughput bottleneck? → Can reads bypass the GenServer via ETS?
  • Deciding whether a piece of state needs a GenServer at all
  • SKILL.md covers The Iron Law, GenServer Patterns, Task.Supervisor, Not Task.async and DynamicSupervisor + Registry =…, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The central rule is that a GenServer is a bottleneck by design, since it handles one message at a time. Before creating one, ask whether serialized access is really needed, whether it will limit throughput and whether reads can skip it through ETS. The suggested pattern has the GenServer own the ETS table, send writes through itself and let reads bypass it with read concurrency. Stateless functions should not be wrapped in a GenServer. Prefer `call` for back-pressure with sensible timeouts, and use `handle_continue` for post-init work.

Further guidance covers Task.Supervisor over Task.async, because linked tasks take the caller down while `async_nolink` lets it survive. DynamicSupervisor supports only one-for-one strategy and should pair with Registry for names, never dynamically created atoms, with PartitionSupervisor for scale. Registry serves a single node and `:pg` a cluster, and Horde adds a distributed supervisor and registry. Broadway suits external queues such as SQS, Kafka or RabbitMQ, while Oban handles durable database-backed background jobs.

When your agent uses it

  • Deciding whether a piece of state needs a GenServer at all
  • Fixing a process bottleneck in an Elixir application
  • Choosing between Task.async and Task.Supervisor for background work
  • Designing dynamic named processes with Registry and DynamicSupervisor

Example prompts

  • “Review this GenServer cache and move the reads to ETS.”
  • “Replace Task.async in our importer with something that survives task crashes.”
  • “Design a supervised process per chat room using Registry and DynamicSupervisor.”
  • “Should this SQS consumer use Broadway or Oban?”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Do I actually need serialized access?
  2. Will this become a throughput bottleneck?
  3. Can reads bypass the GenServer via ETS?

What it can do on your machine

Read from SKILL.md and the folder at commit ac3a5a1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are elixir).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Elixir OTP Concurrency loads about 1.2k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 455 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from georgeguimaraes/elixir-agent-tools at commit ac3a5a1, republished under its Apache-2.0 licence (© georgeguimaraes). 455 words, ~1,242 tokens.

Download SKILL.mdSave it as .claude/skills/otp/SKILL.md (or your agent's skills folder).
name
otp
description
Design and debug Elixir runtime concurrency, process state, and supervision. Use for GenServer, Supervisor, Task, Registry, ETS, process bottlenecks, and Broadway pipelines. Use oban for durable background jobs, retries, and scheduling.

OTP

Choose processes, supervision strategies, and storage for runtime concurrency and fault recovery.

The Iron Law

GENSERVER IS A BOTTLENECK BY DESIGN

A GenServer processes ONE message at a time. Before creating one, ask:

  1. Do I actually need serialized access?
  2. Will this become a throughput bottleneck?
  3. Can reads bypass the GenServer via ETS?

The ETS pattern: GenServer owns ETS table, writes serialize through GenServer, reads bypass it entirely with :read_concurrency.

No exceptions: Don't wrap stateless functions in GenServer. Don't create GenServer "for organization".

GenServer Patterns

FunctionUse For
call/3Synchronous requests expecting replies
cast/2Fire-and-forget messages

When in doubt, use call to ensure back-pressure. Set appropriate timeouts for call/3.

Use handle_continue/2 for post-init work—keeps init/1 fast and non-blocking.

Task.Supervisor, Not Task.async

Task.async spawns a linked process—if task crashes, caller crashes too.

PatternOn task crash
Task.async/1Caller crashes (linked, unsupervised)
Task.Supervisor.async/2Caller crashes (linked, supervised)
Task.Supervisor.async_nolink/2Caller survives, can handle error

Use Task.Supervisor for: Production code, graceful shutdown, observability, async_nolink. Use Task.async for: Quick experiments, scripts, when crash-together is acceptable.

DynamicSupervisor + Registry = Named Dynamic Processes

DynamicSupervisor only supports :one_for_one (dynamic children have no ordering). Use Registry for names—never create atoms dynamically:

elixir
defp via_tuple(id), do: {:via, Registry, {MyApp.Registry, id}}

PartitionSupervisor scales DynamicSupervisor for millions of children.

:pg for Distributed, Registry for Local

ToolScopeUse Case
RegistrySingle nodeNamed dynamic processes
:pgCluster-wideProcess groups, pub/sub

:pg replaced deprecated :pg2. Horde provides distributed supervisor/registry with CRDTs.

Broadway vs Oban: Different Problems

ToolUse For
BroadwayExternal queues (SQS, Kafka, RabbitMQ) — data ingestion with batching
ObanBackground jobs with database persistence

Broadway is NOT a job queue.

Show full SKILL.md (199 more words)Show less
Broadway Gotchas

Processors are for runtime, not code organization. Dispatch to modules in handle_message, don't add processors for different message types.

one_for_all is for Broadway bugs, not your code. Your handle_message errors are caught and result in failed messages, not supervisor restarts.

Handle expected failures in the producer (connection loss, rate limits). Reserve max_restarts for unexpected bugs.

Supervision Strategies Encode Dependencies

StrategyChildren Relationship
:one_for_oneIndependent
:one_for_allInterdependent (all restart)
:rest_for_oneSequential dependency

Use :max_restarts and :max_seconds to prevent restart loops.

Think about failure cascades BEFORE coding.

Abstraction Decision Tree

Need state?
├── No → Plain function
└── Yes → Complex behavior?
    ├── No → Agent
    └── Yes → Supervision?
        ├── No → spawn_link
        └── Yes → Request/response?
            ├── No → Task.Supervisor
            └── Yes → Explicit states?
                ├── No → GenServer
                └── Yes → GenStateMachine

Storage Options

NeedUse
Memory cacheETS (:read_concurrency for reads)
Static config:persistent_term (faster than ETS)
Disk persistenceDETS (2GB limit)
Transactions/DistributionMnesia

:sys Debugs ANY OTP Process

elixir
:sys.get_state(pid)        # Current state
:sys.trace(pid, true)      # Trace events (TURN OFF when done!)

Telemetry Is Built Into Everything

Phoenix, Ecto, and most libraries emit telemetry events. Attach handlers:

elixir
:telemetry.attach("my-handler", [:phoenix, :endpoint, :stop], &handle/4, nil)

Use Telemetry.Metrics + reporters (StatsD, Prometheus, LiveDashboard).

Red Flags - STOP and Reconsider

  • GenServer wrapping stateless computation
  • Task.async in production when you need error handling
  • Creating atoms dynamically for process names
  • Single GenServer becoming throughput bottleneck
  • Using Broadway for background jobs (use Oban)
  • Using Oban for external queue consumption (use Broadway)
  • No supervision strategy reasoning

Any of these? Re-read The Iron Law and use the Abstraction Decision Tree.

© georgeguimaraes, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/elixir-dev/skills/otp of georgeguimaraes/elixir-agent-tools.

Open the folder on GitHubat commit ac3a5a1

Compare with similar skills

Elixir OTP Concurrency next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Elixir OTP Concurrency compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Elixir OTP Concurrency this skillgeorgeguimaraes/elixir-agent-tools184—~1.2kAutomated safety check: PassApache-2.0
Dotnet Backend Patternswshobson/agents40k8 repos~6.6kAutomated safety check: PassMIT
Nodejsblencorp/claude-code-kit106—~2.6kAutomated safety check: PassMIT
C# and .NET DeveloperJeffallan/claude-skills12k—~1.3kAutomated safety check: PassMIT
Python Prodiegosouzapw/awesome-omni-skills159—~3.8kAutomated safety check: PassMIT
FastAPI Project Templateswshobson/agents40k11 repos~901Automated safety check: PassMIT

Similar skills

  • Master C/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications.

    40k GitHub starsUsed in 8 repos~6.6k tokens
    Backend & APIsAuto-check passed
  • Nodejs

    blencorp/claude-code-kit

    Core Node.js backend patterns for TypeScript applications including async/await error handling, middleware concepts, configuration management, testing strategies, and layered architecture principles.

    106 GitHub stars~2.6k tokensUpdated 10 mo ago
    Backend & APIsAuto-check passed
  • C# and .NET Developer

    Jeffallan/claude-skills

    Guides C# work on .NET 8+: ASP.NET Core APIs, Entity Framework Core data access, Blazor apps and CQRS with MediatR, following a five-step build workflow.

    12k GitHub stars~1.3k tokensUpdated 7 days ago
    Backend & APIsAuto-check passed
  • Python Pro

    diegosouzapw/awesome-omni-skills

    python-pro workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~3.8k tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • Scaffolds FastAPI projects with a layered app layout, dependency injection through Depends, async handlers and database access, middleware and pytest setup.

    40k GitHub starsUsed in 11 repos~901 tokens
    Backend & APIsAuto-check passed
  • Python Pro

    davila7/claude-code-templates

    Master Python 3.12+ with modern features, async programming, performance optimization, and production-ready practices.

    33k GitHub starsUsed in 8 repos~1.8k tokens
    DevelopmentAuto-check passed

More from georgeguimaraes/elixir-agent-tools

  • Ecto Persistence Patterns

    georgeguimaraes/elixir-agent-tools

    Designs and debugs Elixir persistence with Ecto: schemas, changesets, queries, preloads, migrations and multi-tenancy, kept within application contexts.

    184 GitHub stars~1.2k tokensUpdated 21 days ago
    Auto-check passed
  • Idiomatic Elixir

    georgeguimaraes/elixir-agent-tools

    Writes and refactors idiomatic Elixir modules and functions, with rules for pattern matching, error handling, protocols and when a process is really needed.

    184 GitHub stars~2.1k tokensUpdated 21 days ago
    Auto-check passed
  • Oban Background Jobs

    georgeguimaraes/elixir-agent-tools

    Guidance for building and debugging durable background jobs in Elixir with Oban and Oban Pro, covering serialization, retries, uniqueness, chaining, chunking and workflows.

    184 GitHub stars~2.2k tokensUpdated 21 days ago
    Auto-check passed
  • Phoenix LiveView Patterns

    georgeguimaraes/elixir-agent-tools

    Guidance for building and debugging Phoenix web interfaces: where LiveView loads data, scopes, PubSub topics, external polling and component state.

    184 GitHub stars~1.3k tokensUpdated 21 days ago
    Auto-check passed

Works with

Questions about Elixir OTP Concurrency

What does Elixir OTP Concurrency do?

Guides choices among GenServer, Supervisor, Task, Registry, ETS and Broadway when designing or debugging Elixir concurrency, state and fault recovery. The central rule is that a GenServer is a bottleneck by design, since it handles one message at a time. Before creating one, ask whether serialized access is really needed, whether it will limit throughput and whether reads can skip it through ETS.

When should I use Elixir OTP Concurrency?

Elixir OTP Concurrency fits situations like: deciding whether a piece of state needs a GenServer at all; fixing a process bottleneck in an Elixir application; choosing between Task.async and Task.Supervisor for background work; designing dynamic named processes with Registry and DynamicSupervisor.

How do I install Elixir OTP Concurrency in Claude Code?

Run `npx skills add georgeguimaraes/elixir-agent-tools --skill otp -a claude-code`. Or copy the skill folder (plugins/elixir-dev/skills/otp in georgeguimaraes/elixir-agent-tools) into .claude/skills/otp in your project. Claude Code loads it when a task matches its description.

How do I install Elixir OTP Concurrency in Codex?

Run `npx skills add georgeguimaraes/elixir-agent-tools --skill otp -a codex`. Or copy the skill folder (plugins/elixir-dev/skills/otp in georgeguimaraes/elixir-agent-tools) into .agents/skills/otp in your project. Codex loads it when a task matches its description.

Can I use Elixir OTP Concurrency in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add georgeguimaraes/elixir-agent-tools --skill otp -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/otp, .gemini/skills/otp, .github/skills/otp and .opencode/skills/otp in your project.

What does Elixir OTP Concurrency need to run?

SKILL.md names no scripts, command-line tools or credentials: Elixir OTP Concurrency is instructions for the agent only.

Does Elixir OTP Concurrency access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Elixir OTP Concurrency safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Elixir OTP Concurrency use?

Elixir OTP Concurrency is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Elixir OTP Concurrency use?

About 1.2k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Elixir OTP Concurrency?

Skills that share tags, products or a category with Elixir OTP Concurrency: Dotnet Backend Patterns (wshobson/agents, 40k stars), Nodejs (blencorp/claude-code-kit, 106 stars), C# and .NET Developer (Jeffallan/claude-skills, 12k stars) and Python Pro (diegosouzapw/awesome-omni-skills, 159 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Elixir OTP Concurrency?

georgeguimaraes (a GitHub user) maintains it in georgeguimaraes/elixir-agent-tools, which has 184 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on September 20, 2026.

Source: georgeguimaraes/elixir-agent-tools on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.