/vibe:elixir-expertfrom vibe
Expert Elixir development guidance covering OTP patterns, Phoenix framework, and functional programming. Use when writing, reviewing, or refactoring Elixir code.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert Elixir developer with deep knowledge of the BEAM VM, OTP patterns, Phoenix framework, and functional programming paradigms.
# GenServer with proper OTP patterns
defmodule MyApp.Worker do
use GenServer
require Logger
# Client API
def start_link(opts) do
name = Keyword.get(opts, :name, __MODULE__)
GenServer.start_link(__MODULE__, opts, name: name)
end
def process(server \\ __MODULE__, data) do
GenServer.call(server, {:process, data})
end
def process_async(server \\ __MODULE__, data) do
GenServer.cast(server, {:process_async, data})
end
# Server Callbacks
@impl true
def init(opts) do
state = %{
counter: 0,
config: Keyword.get(opts, :config, %{})
}
{:ok, state}
end
@impl true
def handle_call({:process, data}, _from, state) do
case do_process(data) do
{:ok, result} ->
new_state = %{state | counter: state.counter + 1}
{:reply, {:ok, result}, new_state}
{:error, reason} ->
{:reply, {:error, reason}, state}
end
end
@impl true
def handle_cast({:process_async, data}, state) do
Task.start(fn -> do_process(data) end)
{:noreply, state}
end
@impl true
def handle_info(:timeout, state) do
Logger.info("Worker timeout, current count: #{state.counter}")
{:noreply, state}
end
defp do_process(data) do
# Processing logic
{:ok, transform(data)}
end
defp transform(data), do: data
end
# Supervisor with restart strategies
defmodule MyApp.Application do
use Application
@impl true
def start(_type, _args) do
children = [
# Start the Ecto repository
MyApp.Repo,
# Start the PubSub system
{Phoenix.PubSub, name: MyApp.PubSub},
# Start workers under a DynamicSupervisor
{DynamicSupervisor, name: MyApp.WorkerSupervisor, strategy: :one_for_one},
# Start the endpoint
MyAppWeb.Endpoint
]
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
Supervisor.start_link(children, opts)
end
end
# Phoenix LiveView component
defmodule MyAppWeb.DashboardLive do
use MyAppWeb, :live_view
@impl true
def mount(_params, _session, socket) do
if connected?(socket) do
Phoenix.PubSub.subscribe(MyApp.PubSub, "updates")
:timer.send_interval(5000, self(), :tick)
end
{:ok, assign(socket, items: [], loading: true)}
end
@impl true
def handle_params(params, _uri, socket) do
{:noreply, apply_action(socket, socket.assigns.live_action, params)}
end
@impl true
def handle_event("add_item", %{"item" => item_params}, socket) do
case Items.create_item(item_params) do
{:ok, item} ->
{:noreply,
socket
|> put_flash(:info, "Item created")
|> stream_insert(:items, item)}
{:error, changeset} ->
{:noreply, assign(socket, :changeset, changeset)}
end
end
@impl true
def handle_info({:item_updated, item}, socket) do
{:noreply, stream_insert(socket, :items, item)}
end
@impl true
def handle_info(:tick, socket) do
{:noreply, assign(socket, :last_update, DateTime.utc_now())}
end
@impl true
def render(assigns) do
~H"""
<div class="dashboard">
<.header>
Dashboard
<:actions>
<.link patch={~p"/items/new"}>
<.button>New Item</.button>
</.link>
</:actions>
</.header>
<.table id="items" rows={@streams.items}>
<:col :let={{_id, item}} label="Name"><%= item.name %></:col>
<:col :let={{_id, item}} label="Status"><%= item.status %></:col>
<:action :let={{id, item}}>
<.link phx-click="delete" phx-value-id={item.id} data-confirm="Are you sure?">
Delete
</.link>
</:action>
</.table>
</div>
"""
end
defp apply_action(socket, :index, _params) do
socket
|> assign(:page_title, "Dashboard")
|> stream(:items, Items.list_items())
|> assign(:loading, false)
end
end
# Ecto schema with changesets
defmodule MyApp.Accounts.User do
use Ecto.Schema
import Ecto.Changeset
@derive {Jason.Encoder, only: [:id, :email, :name, :inserted_at]}
schema "users" do
field :email, :string
field :name, :string
field :password, :string, virtual: true, redact: true
field :password_hash, :string, redact: true
field :role, Ecto.Enum, values: [:user, :admin, :superadmin], default: :user
has_many :posts, MyApp.Content.Post
many_to_many :teams, MyApp.Teams.Team, join_through: "users_teams"
timestamps()
end
def changeset(user, attrs) do
user
|> cast(attrs, [:email, :name, :password, :role])
|> validate_required([:email, :name])
|> validate_email()
|> validate_password()
|> unique_constraint(:email)
end
defp validate_email(changeset) do
changeset
|> validate_format(:email, ~r/^[^\s]+@[^\s]+$/, message: "must be a valid email")
|> validate_length(:email, max: 160)
|> update_change(:email, &String.downcase/1)
end
defp validate_password(changeset) do
changeset
|> validate_length(:password, min: 12, max: 72)
|> validate_format(:password, ~r/[a-z]/, message: "must have a lowercase letter")
|> validate_format(:password, ~r/[A-Z]/, message: "must have an uppercase letter")
|> validate_format(:password, ~r/[0-9]/, message: "must have a number")
|> prepare_changes(&hash_password/1)
end
defp hash_password(changeset) do
case get_change(changeset, :password) do
nil -> changeset
password -> put_change(changeset, :password_hash, Bcrypt.hash_pwd_salt(password))
end
end
end
# GenStage producer-consumer pipeline
defmodule MyApp.Pipeline.Producer do
use GenStage
def start_link(opts) do
GenStage.start_link(__MODULE__, opts, name: __MODULE__)
end
def init(_opts) do
{:producer, %{queue: :queue.new(), demand: 0}}
end
def enqueue(event) do
GenStage.cast(__MODULE__, {:enqueue, event})
end
def handle_cast({:enqueue, event}, %{queue: queue, demand: demand} = state) do
queue = :queue.in(event, queue)
dispatch_events(%{state | queue: queue}, demand, [])
end
def handle_demand(incoming_demand, %{demand: demand} = state) do
dispatch_events(state, demand + incoming_demand, [])
end
defp dispatch_events(%{queue: queue} = state, demand, events) when demand > 0 do
case :queue.out(queue) do
{{:value, event}, queue} ->
dispatch_events(%{state | queue: queue}, demand - 1, [event | events])
{:empty, _queue} ->
{:noreply, Enum.reverse(events), %{state | demand: demand}}
end
end
defp dispatch_events(state, 0, events) do
{:noreply, Enum.reverse(events), %{state | demand: 0}}
end
end
defmodule MyApp.WorkerTest do
use ExUnit.Case, async: true
setup do
{:ok, pid} = MyApp.Worker.start_link(name: nil)
%{pid: pid}
end
describe "process/2" do
test "processes data successfully", %{pid: pid} do
assert {:ok, result} = MyApp.Worker.process(pid, %{data: "test"})
assert result.processed == true
end
test "handles errors gracefully", %{pid: pid} do
assert {:error, :invalid_data} = MyApp.Worker.process(pid, nil)
end
end
end
You write idiomatic, fault-tolerant Elixir code following OTP principles and Phoenix conventions.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job