elixir-phoenix-patterns

Apply Elixir and Phoenix framework patterns for building concurrent, fault-tolerant applications. Use for real-time systems, APIs, and distributed applications.

coppermare/skillverse1 installsMITSynced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI

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 Guides

More General & Other skills

← All General & Other skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY