phoenix — Claude Code skill: Phoenix and Elixir guidelines
Tells the agent how to write Elixir and Phoenix code: LiveView, Ecto, contexts, tests. Useful once the project is already on Phoenix.
npx skills add Mindrally/skills --skill phoenix -a claude-codeWhat phoenix does
The skill frames the agent as an expert in Elixir, Phoenix, PostgreSQL, LiveView and Tailwind CSS. It sets the style: concise idiomatic code, pattern matching and guards, the |> pipe, snake_case for files and functions, PascalCase for modules. Files follow Phoenix conventions — controllers, contexts, views, schemas.
Ecto and error handling get their own sections. Data is validated through changesets, controller errors surface as flash messages, and the "let it crash" approach leans on supervisor trees. On the UI side you get LiveView for real-time interactions, responsive Tailwind layouts, and view helpers to keep templates DRY.
Performance and architecture are covered too: database indexes, caching with ETS or Redis, and killing N+1 queries with preload, joins or select. Background work goes into GenServers and Tasks, routing stays RESTful, tests use ExUnit with ExMachina. Skip this one if your stack is not Elixir — the skill pulls the agent toward Phoenix conventions, which gets in the way elsewhere. The skill itself ships as a SKILL.md instruction file with no dependencies.
What it helps with
- keep Elixir code style consistent across a team
- lay out files into Phoenix contexts and schemas
- remove N+1 queries with preload and joins
- validate incoming data in Ecto changesets
- move background work into a GenServer or Task
Example prompts for the agent
- Add a LiveView page listing orders with real-time updates
- Check this context for N+1 queries and suggest preload
- Write ExUnit tests for the User schema using ExMachina
How to install phoenix
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill phoenix -a claude-code2Manually: put the files in place
~/.claude/skills/phoenix/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/phoenix/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill phoenix -a codex2Manually: put the files in place
.agents/skills/phoenix/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill phoenix -a cursor2Manually: put the files in place
.cursor/skills/phoenix/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills phoenix2Manually: put the files in place
.github/skills/phoenix/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill phoenix -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path phoenixManually: put the files in place
.devin/skills/phoenix/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill phoenix -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about phoenix
How do I install phoenix in Claude?
Run npx skills add Mindrally/skills --skill phoenix -a claude-code. The skill lands at ~/.claude/skills/phoenix/SKILL.md.
What does the phoenix skill do?
It gives the agent Phoenix and Elixir development rules: code style, naming, Ecto, LiveView, error handling, testing and query optimization.
Which platforms does phoenix support?
Besides Claude there are installs for Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. The commands differ by the -a flag.
Source text
SKILL.md · Apache-2.0
--- name: phoenix description: Phoenix framework development guidelines covering LiveView, Ecto, real-time features, and best practices for building scalable web applications with Elixir. metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Phoenix Framework Development You are an expert in Elixir, Phoenix, PostgreSQL, LiveView, and Tailwind CSS. ## Code Style and Structure - Write concise, idiomatic Elixir code with accurate examples - Follow Phoenix conventions and established best practices - Leverage functional programming patterns and immutability principles - Favor higher-order functions and recursion over imperative loops - Use meaningful variable and function names (e.g., `user_signed_in?`, `calculate_total`) - Organize files per Phoenix conventions: controllers, contexts, views, schemas ## Naming Standards - Use snake_case for files, functions, and variables - Use PascalCase for module names - Adhere to Phoenix naming conventions for contexts, schemas, and controllers ## Elixir and Phoenix Implementation - Utilize pattern matching and guards effectively - Leverage Phoenix's built-in functions and macros - Apply Ecto proficiently for database operations ## Syntax and Formatting - Follow the Elixir Style Guide - Chain functions with the pipe operator `|>` - Use single quotes for charlists, double quotes for strings ## Error Handling - Embrace the "let it crash" philosophy with supervisor trees - Log errors properly and provide user-friendly messaging - Validate data through Ecto changesets - Display appropriate flash messages for controller errors ## UI and Styling - Use LiveView for real-time, dynamic interactions - Implement responsive design with Tailwind CSS - Employ view helpers to maintain DRY templates ## Performance Optimization - Index databases effectively - Cache strategically (ETS, Redis) - Prevent N+1 queries using `preload`, `joins`, or `select` - Optimize database queries for efficient data retrieval ## Architecture Patterns - Follow RESTful routing conventions - Organize functionality within contexts - Use GenServers for stateful processes and background work - Deploy Tasks for concurrent, isolated operations ## Testing - Write comprehensive ExUnit tests - Practice TDD (Test-Driven Development) - Use ExMachina for test data generation ## Security - Implement authentication and authorization (Guardian, Pow) - Validate strong parameters in controllers - Defend against XSS, CSRF, and SQL injection vulnerabilities
© Mindrally · Apache-2.0 · Mindrally/skills