Agent skill

Phoenix

by ericrisco in ericrisco/rsc-harness

A skill your agent uses when building an Elixir web app with Phoenix — contexts, Ecto schemas, changesets and migrations, LiveView, channels and PubSub, the generators, and the boundary between…

MITAuto-check: notesAI & LLM Engineering

Install Phoenix

skills CLI
$ npx skills add ericrisco/rsc-harness --skill phoenix -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ericrisco/rsc-harness phoenix --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/phoenix .claude/skills/phoenix && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
phoenix
GitHub stars
156
Token cost
~2.9k tokens
SKILL.md length
1,204 words
Files
7 (incl. scripts, references)
Skills in repo
229
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building an Elixir web app with Phoenix — contexts, Ecto schemas, changesets and migrations, LiveView, channels and PubSub, the generators, and the boundary between…

  • Building an Elixir web app with Phoenix — contexts
  • SKILL.md covers Where does this code go —…, Contexts — the domain boundary, Ecto — the data layer and LiveView — stateful…, plus 5 more sections
  • Runs Shell scripts from its folder
  • Changesets and migrations

What it does

Phoenix is an agent skill from ericrisco/rsc-harness. Use when building an Elixir web app with Phoenix — contexts, Ecto schemas, changesets and migrations, LiveView, channels and PubSub, the generators, and the boundary between domain logic and the web layer. Covers the classic LiveView over-rendering and Ecto N+1 traps. NOT pure OTP work with no web or Ecto layer — GenServers, supervision trees, releases (that is elixir).

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts and reference files (for example `evals/README.md`, `evals/cases.yaml` and `references/auth-and-scopes.md`).

It sits in AI & LLM Engineering, covering LLM observability and Event-driven systems. It works with Elixir. The repository describes itself as: Your agent invents things because it has no memory, and can't touch your database because it has no arms. rsc is the meta-harness that gives it both, plus the trade to know the… The licence is MIT.

When your agent uses it

  • Building an Elixir web app with Phoenix — contexts
  • Changesets and migrations
  • Channels and PubSub
  • The boundary between domain logic and the web layer

Example prompts

  • “/phoenix”

Requirements

  • A Bash shell
  • Docker

What it can do on your machine

Read from SKILL.md and the folder at commit 92fde8f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Phoenix loads about 2.9k tokens when it runs, and up to ~6k if it reads all its reference files. Until then it costs about 96 tokens; SKILL.md has 1,204 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteRuns commands with sudoSKILL.md:60
    g and threading scopes, magic-link auth, sudo mode and query-level enforcement lives in `references/auth-and-scopes.md`.
  • NoteRuns commands with sudoSKILL.md:130
    a access, not in a forgotten `if`. Flow, sudo mode, custom scopes and testing authz are in `references/auth-and-scopes.m

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ericrisco/rsc-harness at commit 92fde8f, republished under its MIT licence (© ericrisco). 1,204 words, ~2,859 tokens.

Download SKILL.mdSave it as .claude/skills/phoenix/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
phoenix
description
Use when building an Elixir web app with Phoenix — contexts, Ecto schemas, changesets and migrations, LiveView, channels and PubSub, the generators, and the boundary between domain logic and the web layer. Covers the classic LiveView over-rendering and Ecto N+1 traps. NOT pure OTP work with no web or Ecto layer — GenServers, supervision trees, releases (that is `elixir`).
tags
phoenix, elixir, liveview, ecto, channels, contexts, web, beam
recommends
elixir, postgresdb, docker
origin
risco

Phoenix

You are building a web application on the BEAM with Phoenix. There is one mental model that keeps a Phoenix app coherent as it grows: contexts are the public API of your domain; the web layer (controllers, LiveViews, channels) is a thin caller of contexts. A LiveView that reaches into Repo directly, or a controller stuffed with business rules, is the first crack. Push logic down into a context function and the web layer stays a presentation shell you can swap (HTML → JSON → LiveView) without rewriting the domain.

Target the current stack: Phoenix 1.8.7 (1.8.0 shipped 2025-08-05), LiveView 1.1 (1.1.x patch line; 1.0 shipped 2024-12-03), Ecto as the data layer, Erlang/OTP 25+. The headline 1.8 change is scopes: generators thread the current actor (user/org) through every context function and into the query, so secure-by-default data access is the norm, not something you bolt on later. New apps ship daisyUI + Tailwind theming, a single root layout, and an AGENTS.md for LLM-assisted work.

If the question has no web, Ecto or LiveView in it — it is a GenServer, a supervision tree, a mix release — that is the runtime, route to ../elixir/SKILL.md.

Where does this code go — generator decision

Pick the layer first, then the generator. Getting this wrong means rewriting the boundary later.

You are buildingUseGenerator
Stateless page or JSON endpoint, request→responseController + viewmix phx.gen.html / phx.gen.json
Stateful interactive UI, server-rendered, live updatesLiveViewmix phx.gen.live
Raw bidirectional WebSocket / fan-out to many clientsChannel + PubSubhand-wire, no generator
Domain logic with no UI yet (just the boundary)Context onlymix phx.gen.context
Login, sessions, password reset, scopesAuth scaffoldmix phx.gen.auth

Rule: generate the context first, then the web layer on top of it. phx.gen.live and phx.gen.html already produce a context — don't hand-write a controller that calls Repo and skip the context.

Contexts — the domain boundary

A context is a module like Accounts, Catalog, Orders that owns a slice of the domain. The web layer calls Catalog.list_products(scope); it never calls Repo and never builds an Ecto.Query.

Rule: the public contract is plain data and functions, not Ecto schemas. Schemas are an implementation detail. Leak them and every caller couples to your column names. Why: you can refactor the table without touching controllers.

Rule: thread the scope through every context function (1.8). The scope carries the current actor; the context filters every query by it. Why: a forgotten where: user_id == is a data leak — scoping makes the safe path the default path.

elixir
# Bad — Repo + business logic in the controller, no scope, anyone reads anyone's data.
def index(conn, _params) do
  products = Repo.all(Product)            # raw Repo in web layer
  render(conn, :index, products: products)
end

# Good — controller calls a context function that takes the scope.
def index(conn, _params) do
  products = Catalog.list_products(conn.assigns.current_scope)
  render(conn, :index, products: products)
end

# In lib/my_app/catalog.ex — the boundary owns the query and the scope filter.
def list_products(%Scope{} = scope) do
  Product
  |> where(org_id: ^scope.org.id)         # secure by default
  |> Repo.all()
end

Depth on defining and threading scopes, magic-link auth, sudo mode and query-level enforcement lives in references/auth-and-scopes.md.

Ecto — the data layer

Ecto gives you Repo, schemas, Ecto.Changeset (cast + validate), Ecto.Multi (transactional pipelines) and Ecto.Query.

Rule: validate at the boundary with a changeset, never with try/rescue. A changeset casts external params, applies validations and constraints, and hands you {:ok, struct} or {:error, changeset} you can render straight into a form. Why: validation errors are expected data flow, not exceptions.

Rule: multi-write operations go through Ecto.Multi so they commit or roll back as a unit. Why: a half-written order with no payment row is corruption.

Rule: preload associations — never trigger a query per row. Why: the N+1 is the single most common Phoenix performance bug.

elixir
# Bad — N+1: each post in the loop fires a separate query for post.author.
posts = Repo.all(Post)
for post <- posts, do: post.author.name   # one SELECT per post

# Good — one query for posts, one for all authors.
posts = Post |> preload(:author) |> Repo.all()
for post <- posts, do: post.author.name

Migrations are forward-only facts about schema history — write a new one, don't edit a shipped migration. Changeset recipes, Ecto.Multi, advanced queries/preloads, constraints and sandbox config are in references/ecto-patterns.md.

LiveView — stateful server-rendered UI

A LiveView holds state in socket.assigns, renders HEEx, and reacts to events. The lifecycle:

CallbackFires whenUse it for
mount/3First connect (and the dead render)Load initial data, set up subscriptions
handle_params/3Mount and every live patchReact to URL/query changes
handle_event/3A client event (phx-click, form submit)Mutate state, call a context
handle_info/2A message arrives (PubSub, send/2)Apply external/async updates

Rule: use streams for collections — do not hold the full list in an assign. A stream keeps the list off the socket; stream_insert/3 of one item sends only that item over the wire. Why: assigning the whole list re-sends and re-diffs every row on every change — that is exactly the "re-renders the entire list when one row is added" symptom. For per-row change tracking wrap each entry in a LiveComponent.

elixir
# Bad — full list in assigns; one insert re-diffs the entire collection.
def mount(_p, _s, socket), do: {:ok, assign(socket, :messages, Chat.list_messages())}
def handle_info({:new, msg}, socket) do
  {:noreply, assign(socket, :messages, socket.assigns.messages ++ [msg])}
end

# Good — stream; only the new row crosses the wire.
def mount(_p, _s, socket), do: {:ok, stream(socket, :messages, Chat.list_messages())}
def handle_info({:new, msg}, socket), do: {:noreply, stream_insert(socket, :messages, msg)}
heex
<div id="messages" phx-update="stream">
  <div :for={{dom_id, msg} <- @streams.messages} id={dom_id}>{msg.body}</div>
</div>

Build forms with to_form/2 (carry the changeset, render errors). Route with verified routes — the ~p sigil (~p"/products/#{product}") is compile-checked, the default since 1.7. LiveView 1.1 adds colocated hooks (<script :type={Phoenix.LiveView.ColocatedHook} name="...">, extracted at compile time, requires Phoenix 1.8+), ColocatedJS, official TypeScript types for the JS client, and keyed comprehensions. Full lifecycle, streams + LiveComponent change tracking, forms/uploads, JS commands, colocated hooks and assign_async are in references/liveview.md.

Show full SKILL.md (440 more words)Show less

Channels & PubSub — real-time fan-out

Reach for a channel when you need raw bidirectional WebSocket messaging or to broadcast to many clients (chat fan-out, presence, live dashboards feeding many sockets). Reach for LiveView when one user drives a server-rendered UI — most "real-time" UI is just LiveView + Phoenix.PubSub.

elixir
Phoenix.PubSub.subscribe(MyApp.PubSub, "room:42")   # in mount/3
Phoenix.PubSub.broadcast(MyApp.PubSub, "room:42", {:new, msg})  # from a context

Phoenix.Presence tracks who is online on a topic. Keep channel callbacks thin — they call contexts too.

Auth & scopes

mix phx.gen.auth in 1.8 defaults to magic-link (passwordless) auth, with a re-auth "sudo mode" plug for sensitive operations; email+password is still available. It also sets up the default scope that generators thread through contexts. Treat scope-based filtering as the authorization layer: the query never returns rows the scope can't see, so authz is enforced in the data access, not in a forgotten if. Flow, sudo mode, custom scopes and testing authz are in references/auth-and-scopes.md.

Testing — test at the right layer

Test targetHelperIsolation
Controllers / JSONPhoenix.ConnTest via ConnCaseSQL sandbox
Context / Ecto logicDataCaseSQL sandbox
LiveView UIPhoenix.LiveViewTest (live/2, render_click, element/2)SQL sandbox
Concurrent DB testsEcto.Adapters.SQL.Sandboxper-test transaction

Rule: test domain rules at the context (DataCase), test interaction at the LiveView (LiveViewTest). Why: a context test that drives the UI is slow and brittle; a LiveView test that re-asserts every validation rule duplicates the context test.

elixir
test "creating a product shows it in the list", %{conn: conn} do
  {:ok, view, _html} = live(conn, ~p"/products")
  view |> form("#product-form", product: %{name: "Widget"}) |> render_submit()
  assert render(view) =~ "Widget"
end

Anti-patterns

Anti-patternWhy it bitesDo instead
Repo.all/insert called from a controller or LiveViewWeb layer couples to the DB; logic can't be reused or tested in isolationCall a context function; keep Repo inside the context
Returning Ecto schemas as the public contractCallers couple to column names; refactors ripple outwardExpose functions over plain data; schemas stay internal
Holding the full collection in socket.assignsEvery insert re-sends and re-diffs the whole list (lag, bandwidth)stream/3 + stream_insert/3; LiveComponent for per-row tracking
try/rescue around persistence to "validate"Hides expected errors as exceptions; no field-level messagesEcto.Changeset → {:ok, _} / {:error, changeset}
Looping over records touching an associationN+1 — one query per rowpreload/2 (or a join) before the loop
Forgetting to filter a query by the scopeCross-tenant data leak — the worst kind of bugThread scope through every context fn; filter in the query
Multi-write without a transactionPartial writes leave corrupt stateEcto.Multi, commit or roll back as one
Fat schema modules full of business logicDomain rules scatter; the boundary blursLogic lives in the context; schema holds fields + changeset
Hardcoded path strings in templatesBreaks silently when routes changeVerified routes — the ~p sigil, compile-checked

See also

  • ../elixir/SKILL.md — OTP, GenServers, supervision trees, the runtime Phoenix builds on.
  • ../postgresdb/SKILL.md — raw SQL tuning, index design and DB ops below the Ecto line.
  • references/liveview.md, references/ecto-patterns.md, references/auth-and-scopes.md — branch-specific depth.

© ericrisco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references) in skills/phoenix of ericrisco/rsc-harness.

  • SKILL.md
  • evals/README.md
  • evals/cases.yaml
  • references/auth-and-scopes.md
  • references/ecto-patterns.md
  • references/liveview.md
  • scripts/verify.sh

Open the folder on GitHubat commit 92fde8f

Compare with similar skills

Phoenix next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Phoenix compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Phoenix this skillericrisco/rsc-harness156—~2.9kAutomated safety check: NotesMIT
Elixir Expertpass-agent/loomkin1811 repos~796Automated safety check: PassMIT
Phoenix Contextsoliver-kriska/claude-elixir-phoenix564—~841Automated safety check: PassMIT
Phx Watch PRoliver-kriska/claude-elixir-phoenix564—~1kAutomated safety check: PassMIT
Ash Frameworkpodlove/radiator136—~2.1kAutomated safety check: PassMIT
Elixir Architectmaxim-ist/elixir-architect145—~7.6kAutomated safety check: PassMIT

Similar skills

  • Elixir Expert

    pass-agent/loomkin

    Expert in Elixir, Phoenix Framework, and OTP. An agent skill from pass-agent/loomkin.

    181 GitHub starsUsed in 1 repo~796 tokens
    AI & LLM EngineeringAuto-check passed
  • Phoenix Contexts

    oliver-kriska/claude-elixir-phoenix

    Phoenix context design — creating/splitting contexts, Scope (1.8+), Ecto.Multi, PubSub, routers, plugs, controllers.

    564 GitHub stars~841 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Phx Watch PR

    oliver-kriska/claude-elixir-phoenix

    Watch an Elixir/Phoenix PR with an Amp Orb keep-alive lease until required non-deployment CI is green and review threads are resolved.

    564 GitHub stars~1k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Ash Framework

    podlove/radiator

    Use this skill working with Ash Framework or any of its extensions.

    136 GitHub stars~2.1k tokensUpdated 12 days ago
    AI & LLM EngineeringAuto-check passed
  • Elixir Architect

    maxim-ist/elixir-architect

    A skill your agent uses when designing or architecting Elixir/Phoenix applications, creating comprehensive project documentation, planning OTP supervision trees, defining domain models with Ash…

    145 GitHub stars~7.6k tokensUpdated 10 mo ago
    AI & LLM EngineeringAuto-check passed
  • Phoenix Framework

    podlove/radiator

    Use this skill working with Phoenix Framework. An agent skill from podlove/radiator.

    136 GitHub stars~562 tokensUpdated 12 days ago
    AI & LLM EngineeringAuto-check passed

More from ericrisco/rsc-harness

All 229 skills in this repo
  • Ab Testing

    ericrisco/rsc-harness

    A skill your agent uses when designing or analyzing a controlled experiment — falsifiable hypothesis, sample size from an MDE, reading significance/CI/power, CUPED, or rescuing tests that won't go…

    156 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Accessibility

    ericrisco/rsc-harness

    A skill your agent uses when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast…

    156 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Ads

    ericrisco/rsc-harness

    A skill your agent uses when running or fixing paid acquisition on Google or Meta — campaign structure (Performance Max, Demand Gen, Search, Advantage+), platform-fit creative, budget/scaling rules…

    156 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Agent Eval

    ericrisco/rsc-harness

    A skill your agent uses when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual…

    156 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • AI Media

    ericrisco/rsc-harness

    A skill your agent uses when a creative goal must become a finished media file: pick and order generative-media models per modality — AI voiceover, image-to-video clips, score — then glue them with…

    156 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    156 GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Works with

Questions about Phoenix

What does Phoenix do?

A skill your agent uses when building an Elixir web app with Phoenix — contexts, Ecto schemas, changesets and migrations, LiveView, channels and PubSub, the generators, and the boundary between…. Phoenix is an agent skill from ericrisco/rsc-harness. Use when building an Elixir web app with Phoenix — contexts, Ecto schemas, changesets and migrations, LiveView, channels and PubSub, the generators, and the boundary between domain logic and the web layer.

When should I use Phoenix?

Phoenix fits situations like: building an Elixir web app with Phoenix — contexts; changesets and migrations; channels and PubSub; the boundary between domain logic and the web layer.

How do I install Phoenix in Claude Code?

Run `npx skills add ericrisco/rsc-harness --skill phoenix -a claude-code`. Or copy the skill folder (skills/phoenix in ericrisco/rsc-harness) into .claude/skills/phoenix in your project. Claude Code loads it when a task matches its description.

How do I install Phoenix in Codex?

Run `npx skills add ericrisco/rsc-harness --skill phoenix -a codex`. Or copy the skill folder (skills/phoenix in ericrisco/rsc-harness) into .agents/skills/phoenix in your project. Codex loads it when a task matches its description.

Can I use Phoenix in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ericrisco/rsc-harness --skill phoenix -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/phoenix, .gemini/skills/phoenix, .github/skills/phoenix and .opencode/skills/phoenix in your project.

What does Phoenix need to run?

Going by SKILL.md and its folder, Phoenix needs a shell for the scripts in its folder. Our summary lists: A Bash shell; Docker.

Does Phoenix access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Phoenix safe to install?

Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Phoenix use?

Phoenix is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Phoenix use?

About 2.9k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.1k tokens, read only when the agent opens those files.

What are the alternatives to Phoenix?

Skills that share tags, products or a category with Phoenix: Elixir Expert (pass-agent/loomkin, 181 stars), Phoenix Contexts (oliver-kriska/claude-elixir-phoenix, 564 stars), Phx Watch PR (oliver-kriska/claude-elixir-phoenix, 564 stars) and Ash Framework (podlove/radiator, 136 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Phoenix?

ericrisco (a GitHub user) maintains it in ericrisco/rsc-harness, which has 156 GitHub stars. The repository holds 229 skills in this directory. The repository was last updated on October 6, 2026.

Source: ericrisco/rsc-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.