Elixir — Functional Language for Scalable Applications
You are an expert in Elixir, the functional programming language built on the Erlang VM (BEAM). You help developers build highly concurrent, fault-tolerant, and distributed systems using Elixir's process model, pattern matching, GenServer, supervision trees, Phoenix web framework, LiveView for real-time UI, and Ecto for database interactions — achieving massive concurrency with lightweight processes and "let it crash" reliability.
Best use case
Elixir — Functional Language for Scalable Applications is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
You are an expert in Elixir, the functional programming language built on the Erlang VM (BEAM). You help developers build highly concurrent, fault-tolerant, and distributed systems using Elixir's process model, pattern matching, GenServer, supervision trees, Phoenix web framework, LiveView for real-time UI, and Ecto for database interactions — achieving massive concurrency with lightweight processes and "let it crash" reliability.
Teams using Elixir — Functional Language for Scalable Applications should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/elixir/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Elixir — Functional Language for Scalable Applications Compares
| Feature / Agent | Elixir — Functional Language for Scalable Applications | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
You are an expert in Elixir, the functional programming language built on the Erlang VM (BEAM). You help developers build highly concurrent, fault-tolerant, and distributed systems using Elixir's process model, pattern matching, GenServer, supervision trees, Phoenix web framework, LiveView for real-time UI, and Ecto for database interactions — achieving massive concurrency with lightweight processes and "let it crash" reliability.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Elixir — Functional Language for Scalable Applications
You are an expert in Elixir, the functional programming language built on the Erlang VM (BEAM). You help developers build highly concurrent, fault-tolerant, and distributed systems using Elixir's process model, pattern matching, GenServer, supervision trees, Phoenix web framework, LiveView for real-time UI, and Ecto for database interactions — achieving massive concurrency with lightweight processes and "let it crash" reliability.
## Core Capabilities
### Language Basics
```elixir
# Pattern matching
{:ok, user} = fetch_user(id)
%{name: name, email: email} = user
# Pipeline operator (chain transformations)
result =
data
|> Enum.filter(&(&1.active))
|> Enum.map(&transform/1)
|> Enum.sort_by(& &1.score, :desc)
|> Enum.take(10)
# Modules and functions
defmodule MyApp.Accounts do
def create_user(attrs) do
%User{}
|> User.changeset(attrs)
|> Repo.insert()
end
def authenticate(email, password) do
with {:ok, user} <- get_user_by_email(email),
true <- Bcrypt.verify_pass(password, user.password_hash) do
{:ok, user}
else
_ -> {:error, :invalid_credentials}
end
end
end
```
### GenServer (Stateful Processes)
```elixir
defmodule MyApp.RateLimiter do
use GenServer
# Client API
def start_link(opts) do
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
end
def check_rate(user_id, limit \\ 100) do
GenServer.call(__MODULE__, {:check, user_id, limit})
end
# Server callbacks
@impl true
def init(_opts) do
schedule_cleanup()
{:ok, %{}} # Initial state: empty map
end
@impl true
def handle_call({:check, user_id, limit}, _from, state) do
now = System.monotonic_time(:second)
requests = Map.get(state, user_id, [])
recent = Enum.filter(requests, &(&1 > now - 60))
if length(recent) < limit do
{:reply, :ok, Map.put(state, user_id, [now | recent])}
else
{:reply, {:error, :rate_limited}, state}
end
end
@impl true
def handle_info(:cleanup, state) do
now = System.monotonic_time(:second)
cleaned = Map.new(state, fn {k, v} ->
{k, Enum.filter(v, &(&1 > now - 60))}
end)
schedule_cleanup()
{:noreply, cleaned}
end
defp schedule_cleanup, do: Process.send_after(self(), :cleanup, 60_000)
end
```
### Phoenix LiveView (Real-Time UI)
```elixir
defmodule MyAppWeb.DashboardLive do
use MyAppWeb, :live_view
@impl true
def mount(_params, session, socket) do
if connected?(socket) do
MyApp.PubSub.subscribe("metrics")
:timer.send_interval(5000, :tick)
end
{:ok, assign(socket,
users_online: 0,
orders_today: 0,
revenue: Decimal.new(0)
)}
end
@impl true
def handle_info(:tick, socket) do
{:noreply, assign(socket,
users_online: MyApp.Presence.count(),
orders_today: MyApp.Orders.count_today(),
revenue: MyApp.Orders.revenue_today()
)}
end
@impl true
def handle_info({:new_order, order}, socket) do
{:noreply, update(socket, :orders_today, &(&1 + 1))
|> update(:revenue, &Decimal.add(&1, order.total))}
end
@impl true
def render(assigns) do
~H"""
<div class="grid grid-cols-3 gap-4">
<.stat_card title="Users Online" value={@users_online} />
<.stat_card title="Orders Today" value={@orders_today} />
<.stat_card title="Revenue" value={"$#{@revenue}"} />
</div>
"""
end
end
```
### Supervision Trees
```elixir
defmodule MyApp.Application do
use Application
def start(_type, _args) do
children = [
MyApp.Repo, # Database (auto-restarts on crash)
{Phoenix.PubSub, name: MyApp.PubSub},
MyApp.RateLimiter, # Custom GenServer
MyAppWeb.Endpoint, # Web server
{Task.Supervisor, name: MyApp.TaskSupervisor},
]
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
Supervisor.start_link(children, opts)
# If any child crashes, only that child restarts (one_for_one)
end
end
```
## Installation
```bash
# Install Elixir
brew install elixir # macOS
# Or: https://elixir-lang.org/install.html
# New Phoenix project
mix phx.new my_app
cd my_app && mix deps.get
mix ecto.create && mix phx.server
```
## Best Practices
1. **Let it crash** — Don't over-handle errors; use supervisors to restart failed processes automatically
2. **Pattern matching** — Match on function arguments and return values; avoid if/else chains
3. **Pipeline operator** — Chain transformations with `|>`; reads top-to-bottom like a data pipeline
4. **GenServer for state** — Use GenServer for in-memory state, rate limiters, caches; supervised and fault-tolerant
5. **LiveView over SPAs** — Use Phoenix LiveView for real-time UI; no JavaScript framework needed, server-rendered
6. **Ecto changesets** — Validate and cast data through changesets; never trust raw input
7. **PubSub for events** — Use Phoenix.PubSub for inter-process communication; scales across nodes
8. **Telemetry for observability** — Attach to `:telemetry` events for metrics; Ecto, Phoenix emit events automaticallyRelated Skills
next-intl-add-language
Add new language to a Next.js + next-intl application
answering-natural-language-questions-with-dbt
Writes and executes SQL queries against the data warehouse using dbt's Semantic Layer or ad-hoc SQL to answer business questions. Use when a user asks about analytics, metrics, KPIs, or data (e.g., "What were total sales last quarter?", "Show me top customers by revenue"). NOT for validating, testing, or building dbt models during development.
go-functional-options
Use when designing a Go constructor or factory function with optional configuration — especially with 3+ optional parameters or extensible APIs. Also use when building a New* function that takes many settings, even if they don't mention "functional options" by name. Does not cover general function design (see go-functions).
elixir-pro
Write idiomatic Elixir code with OTP patterns, supervision trees, and Phoenix LiveView. Masters concurrency, fault tolerance, and distributed systems. Use PROACTIVELY for Elixir refactoring, OTP design, or complex BEAM optimizations.
functional-patterns
Functional programming patterns that promote testability, composability, and maintainability.
when-validating-code-works-use-functionality-audit
Validates that code actually works through sandbox testing, execution verification, and systematic debugging. Use this skill after code generation or modification to ensure functionality is genuine rather than assumed. The skill creates isolated test environments, executes code with realistic inputs, identifies bugs through systematic analysis, and applies best practices to fix issues without breaking existing functionality.
functionality-audit
Validates that code actually works through sandbox testing, execution verification, and systematic debugging. Use this skill after code generation or modification to ensure functionality is genuine rather than assumed. The skill creates isolated test environments, executes code with realistic inputs, identifies bugs through systematic analysis, and applies best practices to fix issues without breaking existing functionality. This ensures code delivers its intended behavior reliably.
containerizing-applications
Containerizes applications with Docker, docker-compose, and Helm charts. Use when creating Dockerfiles, docker-compose configurations, or Helm charts for Kubernetes. Includes Docker Hardened Images (95% fewer CVEs), multi-stage builds, and 15+ battle-tested gotchas.
Zig — Modern Systems Programming Language
## Overview
Stagehand — AI Browser Automation in Natural Language
You are an expert in Stagehand by BrowserBase, the AI-powered browser automation framework that lets you control web pages using natural language instructions. You help developers build web automations that act, extract data, and observe pages using plain English commands instead of brittle CSS selectors — powered by GPT-4o or Claude for visual understanding of page layouts.
Mojo — Python-Speed Systems Language for AI
## Overview
Malloy — Semantic Data Language
## Overview