phoenix — скилл для Claude Code: правила разработки на Phoenix
Задаёт агенту правила кода на Elixir и Phoenix: LiveView, Ecto, контексты, тесты. Пригодится, когда проект уже на Phoenix и нужен предсказуемый стиль.
npx skills add Mindrally/skills --skill phoenix -a claude-codeЧто делает phoenix
Скилл превращает агента в знатока Elixir, Phoenix, PostgreSQL, LiveView и Tailwind CSS. Он прописывает стиль: короткий идиоматичный код, сопоставление с образцом, конвейер |>, snake_case для файлов и функций, PascalCase для модулей. Файлы раскладываются по конвенциям Phoenix — контроллеры, контексты, представления, схемы.
Отдельные блоки посвящены Ecto и обработке ошибок. Данные проходят валидацию через changesets, ошибки контроллеров показываются во flash-сообщениях, а философия «let it crash» опирается на дерево супервизоров. Для интерфейса — LiveView и адаптивная вёрстка на Tailwind, шаблоны без дублирования через view helpers.
Есть разделы про производительность и архитектуру: индексы в базе, кэш на ETS или Redis, борьба с N+1 через preload, joins и select. Фоновые задачи выносятся в GenServers и Tasks, маршруты строятся по REST, а тесты пишутся на ExUnit с ExMachina. Скилл не подойдёт для проектов не на Elixir: он тянет агента в сторону Phoenix-конвенций, и в другом стеке это будет мешать. Зависимостей у самого скилла нет — это набор инструкций в SKILL.md.
Какие задачи решает
- удержать единый стиль кода на Elixir в большой команде
- разложить файлы по контекстам и схемам Phoenix
- убрать N+1 запросы через preload и joins
- настроить валидацию данных в changesets
- вынести фоновую работу в GenServer или Task
Примеры запросов агенту
- Добавь LiveView-страницу со списком заказов и обновлением в реальном времени
- Проверь этот контекст на N+1 и предложи preload
- Напиши ExUnit-тесты для схемы User через ExMachina
Как установить phoenix
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill phoenix -a claude-code2Вручную: положить файлы
~/.claude/skills/phoenix/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/phoenix/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill phoenix -a codex2Вручную: положить файлы
.agents/skills/phoenix/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill phoenix -a cursor2Вручную: положить файлы
.cursor/skills/phoenix/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills phoenix2Вручную: положить файлы
.github/skills/phoenix/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill phoenix -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path phoenixВручную: положить файлы
.devin/skills/phoenix/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill phoenix -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о phoenix
Как установить phoenix в Claude?
Выполните npx skills add Mindrally/skills --skill phoenix -a claude-code. Файл скилла окажется в ~/.claude/skills/phoenix/SKILL.md.
Что делает скилл phoenix?
Задаёт агенту правила разработки на Elixir и Phoenix: стиль кода, именование, Ecto, LiveView, обработку ошибок, тесты и оптимизацию запросов.
Для каких платформ подходит phoenix?
Кроме Claude есть установка для Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode. Команды отличаются флагом -a.
Исходный текст
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