elixir-phoenix-patterns
Apply Elixir and Phoenix framework patterns for building concurrent, fault-tolerant applications. Use for real-time systems, APIs, and distributed applications.
Works with
Agent Skills format with YAML frontmatter. Claude Code reads it as-is.
---
name: "elixir-phoenix-patterns"
description: "Apply Elixir and Phoenix framework patterns for building concurrent, fault-tolerant applications. Use for real-time systems, APIs, and distributed applications."
license: "MIT"
---
# Elixir Phoenix Patterns
Build concurrent, fault-tolerant applications with Elixir and Phoenix.
## Core Concepts
- Immutability and functional programming
- Actor model with processes
- Supervision trees for fault tolerance
- Phoenix Channels for real-time communication
## Patterns
### GenServer Pattern
```elixir
defmodule MyApp.UserCache do
use GenServer
def start_link(_opts) do
GenServer.start_link(__MODULE__, %{}, name: __MODULE__)
end
def get(user_id) do
GenServer.call(__MODULE__, {:get, user_id})
end
def init(state) do
{:ok, state}
end
def handle_call({:get, user_id}, _from, state) do
{:reply, Map.get(state, user_id), state}
end
end
```
### Phoenix Context Pattern
```elixir
defmodule MyApp.Accounts do
alias MyApp.Accounts.User
alias MyApp.Repo
def list_users do
Repo.all(User)
end
def create_user(attrs) do
%User{}
|> User.changeset(attrs)
|> Repo.insert()
end
end
```
### LiveView for Real-Time UI
```elixir
defmodule MyAppWeb.UserLive do
use MyAppWeb, :live_view
def mount(_params, _session, socket) do
{:ok, assign(socket, users: list_users())}
end
def handle_event("delete", %{"id" => id}, socket) do
delete_user(id)
{:noreply, assign(socket, users: list_users())}
end
end
```
## Resources
- Elixir School
- Phoenix Framework GuidesMore General & Other skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

