elixir-idioms
OTP/BEAM patterns and Elixir idioms — GenServer, Supervisor, Task, Registry, pattern matching, with chains, pipes
Install / Use
npx skills add oliver-kriska/claude-elixir-phoenix --skill elixir-idiomsInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Content & MediaSupported Platforms
Our assessment of elixir-idioms
elixir-idioms scores 84/100 on our quality scale, 832nd of 1,143 Content & Media skills we index.
Its SKILL.md is 4.7 KB long, well organised into 14 sections with 4 code examples: a solid amount of guidance for an agent.
It has 574 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 13 days ago, so elixir-idioms is actively maintained.
- Our last check on 2026-11-05 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-06. Automated pattern scan on 2026-10-06. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
elixir-idioms compared with similar skills
All 4 of these similar skills score higher than elixir-idioms; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| elixir-idioms (this skill)by oliver-kriska | 84 | 574 | 13d ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 118.9k | 11d ago | CLAUDE.md |
| Claude-Code-Game-Studiosby Donchitos | 100 | 40.2k | 10d ago | CLAUDE.md |
| siyuanby siyuan-note | 100 | 47.3k | today | MCP Server |
| algorithmic-artby anthropics | 100 | 177.9k | 58d ago | SKILL.md |
Frequently asked questions
- How do I install elixir-idioms?
- Run
npx skills add oliver-kriska/claude-elixir-phoenix --skill elixir-idioms. The install tabs above show the steps for each supported agent. - Which AI agents does elixir-idioms work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is elixir-idioms safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is elixir-idioms still maintained?
- The repository was last updated 13 days ago, so elixir-idioms is actively maintained.
Skill content
View source on GitHubname: elixir-idioms description: "OTP/BEAM patterns and Elixir idioms — GenServer, Supervisor, Task, Registry, pattern matching, with chains, pipes. Use when designing processes or debugging BEAM issues." effort: medium user-invocable: false
Elixir Idioms
Reference for writing idiomatic Elixir code with BEAM-aware patterns.
Iron Laws — Never Violate These
- NO PROCESS WITHOUT A RUNTIME REASON — Processes model concurrency, state, isolation—NOT code structure
- MESSAGES ARE COPIED — Keep messages small (except binaries >64 bytes)
- GUARDS USE
and/or/not— Never use short-circuit operators in guards (guards require boolean operands) - CHANGESETS FOR EXTERNAL DATA — Use
cast/4for user input,change/2for internal - RESCUE ONLY FOR EXTERNAL CODE — Never use rescue for control flow
- NO DYNAMIC ATOM CREATION —
String.to_atom(user_input)causes memory leak (atoms aren't GC'd) - @external_resource FOR COMPILE-TIME FILES — Modules reading files at compile time MUST declare
@external_resource - SUPERVISE ALL LONG-LIVED PROCESSES — Never bare
GenServer.start_link/Agent.start_linkin production. Use supervision trees - WRAP THIRD-PARTY LIBRARY APIs — Always facade external deps behind a project-owned module. Enables swapping without touching callers
- MIX TASKS START ONLY WHAT THEY NEED —
Mix.Task.run("app.config")+Application.ensure_all_started/1, neverMix.Task.run("app.start")(boots the FULL tree: endpoint port, Oban consuming) - CAPTURE LOCALE BEFORE SPAWNING — Gettext/CLDR locale is process-local. Read it in the caller and pass explicitly; a spawned Task/GenServer starts with the default locale
BEAM Architecture (Why Elixir Works This Way)
- Processes are cheap (2.6KB) — Spawn liberally for concurrency/isolation
- Complete memory isolation — No shared state, no locks needed
- Messages are copied (except binaries >64 bytes) — Keep messages small
- Per-process GC — No global GC pauses
- "Let it crash" — Supervisors restart to known-good state
Core Principles
- Pattern match over conditionals — Function heads first, then
case, thencond - Tagged tuples for expected failures —
{:ok, _}/{:error, _}for expected errors, raise for bugs - Pipe operator for data transformation — Start with data, never pipe single calls
- Let it crash — Handle expected errors, crash on unexpected ones
- Explicit over implicit — Be clear about intentions
Quick Decision Trees
Control Flow
Need patterns? → case (or function heads)
Multiple operations? → with
Boolean conditions? → cond (multiple) or if (single)
Error Handling
Expected failure? → {:ok, _}/{:error, _} tuples
Unexpected/bug? → raise exception (let supervisor handle)
External library? → rescue (only here!)
OTP
Need state?
├─ No → Plain functions
├─ Simple get/update → Agent or ETS
├─ Complex messages/timeouts → GenServer
└─ One-off async → Task
Quick Patterns
# Pattern match in function head
def process(%{status: :active} = user), do: activate(user)
def process(%{status: :inactive} = user), do: deactivate(user)
# with for happy path
with {:ok, user} <- get_user(id),
{:ok, order} <- create_order(user) do
{:ok, order}
end
# Task for async
Task.Supervisor.async_nolink(TaskSup, fn -> work() end)
|> Task.yield(5000) || Task.shutdown(task)
Common Pitfalls
| Wrong | Right |
|-------|-------|
| length(list) == 0 | list == [] or Enum.empty?(list) |
| list ++ [item] | [item \| list] \|> Enum.reverse() |
| String.to_atom(input) | String.to_existing_atom(input) |
| spawn(fn -> log(conn) end) | ip = conn.ip; spawn(fn -> log(ip) end) |
| unless condition | if !condition (unless deprecated in 1.18) |
References
For detailed patterns, see:
${CLAUDE_SKILL_DIR}/references/pattern-matching.md- Pattern matching, guards, binary matching${CLAUDE_SKILL_DIR}/references/otp-patterns.md- GenServer, Supervisor, Task, Registry${CLAUDE_SKILL_DIR}/references/error-handling.md- Tagged tuples, rescue, with${CLAUDE_SKILL_DIR}/references/with-and-pipes.md- When to usewithand|>(idiomatic patterns)${CLAUDE_SKILL_DIR}/references/troubleshooting.md- Production BEAM debugging (memory, performance, crashes)${CLAUDE_SKILL_DIR}/references/anti-patterns.md- Common mistakes and fixes${CLAUDE_SKILL_DIR}/references/mix-tasks.md- Mix task naming, option parsing, shell output${CLAUDE_SKILL_DIR}/references/elixir-118-features.md- Duration module, dbg improvements (1.18+)${CLAUDE_SKILL_DIR}/references/elixir-120-type-system.md- Gradual type checker,dynamic(), verified bugs as compile warnings (1.20+, OTP 27+)
Related Skills
taste-skill
118.9kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Claude-Code-Game-Studios
40.2kTurn Claude Code into a full game dev studio — 49 AI agents, 75 workflow skills, and a complete coordination system mirroring real studio hierarchy.
siyuan
47.3kAn open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
