elixir--phoenixlisted
Install: claude install-skill Claudient/Claudient
# Elixir + Phoenix
## When to activate
- Building Phoenix web applications or APIs
- Designing OTP supervision trees with GenServer and Supervisor
- Implementing Phoenix LiveView for server-rendered reactive UIs
- Writing Ecto changesets and database transactions
- Configuring mix releases for production deployment
- Using the pipe operator and pattern matching idioms
## When NOT to use
- Non-Elixir Erlang/OTP work where Elixir syntax is irrelevant
- Simple scripting tasks better handled by a shell script
- When the codebase is Elixir but the question is purely about PostgreSQL query optimization with no Ecto involvement
## Instructions
### GenServer Skeleton
A GenServer is a stateful process. Implement all standard callbacks explicitly:
```elixir
defmodule MyApp.Cache do
use GenServer
require Logger
# --- Client API ---
def start_link(opts \\ []) do
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
end
def get(key), do: GenServer.call(__MODULE__, {:get, key})
def put(key, value), do: GenServer.cast(__MODULE__, {:put, key, value})
def delete(key), do: GenServer.cast(__MODULE__, {:delete, key})
# --- Server Callbacks ---
@impl true
def init(_opts) do
{:ok, %{}} # initial state is an empty map
end
@impl true
def handle_call({:get, key}, _from, state) do
{:reply, Map.get(state, key), state}
end
@impl true
def handle_cast({:put, key, value}, state) do
{:noreply, Map.put(state, key, value)}
end
@impl true