elixir-idioms
SkillAI & modelsElixir rewards immutability, pattern matching, and the OTP supervision model. Idiomatic Elixir = functional, fault-tolerant, process-oriented.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the elixir-idioms skill
About this capability
Comprehensive sets of standards and practices designed to elevate the capabilities of AI coding agents.
What this skill tells your AI
The instructions your AI receives, as published by irahardianto/awesome-agv in .agents/skills/elixir-idioms/SKILL.md and read by ahel’s review.
Elixir Idioms and Patterns
Elixir rewards immutability, pattern matching, and the OTP supervision model. Idiomatic Elixir = functional, fault-tolerant, process-oriented.
Scope: Elixir coding idioms. Test naming: .agents/rules/testing-strategy.md.
Pattern Matching
-
Pattern match everything — function heads, case, with:
def handle_result({:ok, task}), do: {:reply, task} def handle_result({:error, :not_found}), do: {:error, 404} def handle_result({:error, reason}), do: {:error, 500, reason} -
withfor happy-path pipelines:with {:ok, user} <- fetch_user(user_id), {:ok, task} <- create_task(user, params), :ok <- notify(user, task) do {:ok, task} end
OTP and Supervision
-
GenServer for stateful processes:
defmodule TaskCache do use GenServer def start_link(opts), do: GenServer.start_link(__MODULE__, %{}, opts) def get(pid, id), do: GenServer.call(pid, {:get, id}) @impl true def handle_call({:get, id}, _from, state) do {:reply, Map.get(state, id), state} end end -
Supervision trees — "let it crash" philosophy. Supervisors restart failed children.
-
Never
try/catchin normal flow — let processes crash and restart cleanly.
Pipe Operator
-
|>for data transformation pipelines:tasks |> Enum.filter(&(&1.active)) |> Enum.sort_by(& &1.priority, :desc) |> Enum.map(&TaskView.render/1) -
First argument must be the piped value. Design APIs pipe-friendly.
Naming
- snake_case for functions, variables, atoms, module attributes.
- PascalCase for module names.
?suffix for boolean functions:active?/1.!suffix for functions that raise:get!/1(vsget/1returning{:ok, _}).
Testing
-
ExUnit:
defmodule TaskServiceTest do use ExUnit.Case, async: true test "creates task with valid params" do {:ok, task} = TaskService.create(%{title: "Test", priority: :high}) assert task.title == "Test" end end -
Mox for mock-based testing (behaviour contracts).
Formatting and Static Analysis
| Tool | Purpose | Command |
|---|---|---|
mix format | Formatting | mix format |
| Credo | Linting | mix credo --strict |
| Dialyzer | Type checking | mix dialyzer |
mix deps.audit | CVE scanning | mix deps.audit |
Related
- Code Idioms and Conventions .agents/rules/code-idioms-and-conventions.md
- Error Handling Principles .agents/rules/error-handling-principles.md
- Testing Strategy .agents/rules/testing-strategy.md
- Concurrency and Threading Principles @.agents/rules/concurrency-and-threading-principles.md
Signals
- GitHub stars
- 156
- Forks
- 53
- Last commit
- Aug 2026
Advanced
- Catalog kind
- skill
- Gateway key
elixir-idioms- Source
- github.com/irahardianto/awesome-agv