moai-lang-elixir

Implements Elixir 1.17, Phoenix 1.7, LiveView, Ecto, and OTP development patterns.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/h102-log/pdfrag --skill moai-lang-elixir-h102-log
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: moai-lang-elixir
Source: https://github.com/h102-log/pdfrag/tree/main/.claude/skills/moai-lang-elixir
Command: npx skills add https://github.com/h102-log/pdfrag --skill moai-lang-elixir-h102-log

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building real-time, fault-tolerant applications in Elixir requires deep knowledge of Phoenix, LiveView, Ecto, and OTP conventions, and mistakes in supervision trees, changesets, or LiveView state handling lead to subtle production bugs. ## Core Features & Use Cases - Phoenix & LiveView Patterns: Provides controllers, LiveView components, streams, channels, verified routes, and HEEx templates following Phoenix 1.7 conventions. - Ecto & OTP Guidance: Covers schemas, changesets, Ecto.Multi transactions, query composition, GenServer, supervisors, Registry, and Oban background jobs. - Testing & Deployment: Includes ExUnit and LiveView test patterns, runtime configuration, releases, Dockerfiles, and libcluster distributed setups. - Use Case: When scaffolding a new Phoenix LiveView CRUD feature with real-time updates, use this Skill to generate the context module, schema with validations, LiveView with streams, and corresponding tests. ## Quick Start Use the Elixir skill to create a Phoenix LiveView page with an Ecto schema, changeset validation, and ExUnit tests for a user registration feature.

Frequently Asked Questions about moai-lang-elixir

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Phoenix LiveView form with Ecto changeset validation?▼

Create a changeset in mount and assign it with to_form, then implement a validate event handler that rebuilds the changeset with the :validate action and a save handler that calls the context create function. On success use put_flash and push_patch; on error reassign the form with the error changeset.

How do I use Ecto.Multi for database transactions in Elixir?▼

Build an Ecto.Multi by piping Ecto.Multi.new() through Multi.run, Multi.update, and Multi.insert operations with named keys, then pass it to Repo.transaction(). Each step can access results from previous steps, and the whole operation rolls back if any step fails.

What is the difference between GenServer and DynamicSupervisor in OTP?▼

A GenServer encapsulates stateful process logic with handle_call, handle_cast, and handle_info callbacks, while a DynamicSupervisor starts and stops child processes on demand at runtime. Use DynamicSupervisor when children are created dynamically, such as per-user worker processes.

Does Phoenix 1.7 support verified routes instead of path helpers?▼

Yes, Phoenix 1.7 uses the ~p sigil for verified routes, which are checked at compile time against your router definitions. For example, ~p"/users/#{user}" generates the path and raises a compile error if the route does not exist.

Why is my Phoenix LiveView not connecting in the browser?▼

Check the websocket connection in the browser developer console, verify the endpoint configuration includes the websocket transport, and ensure Phoenix.LiveView is listed in mix.exs dependencies. Also confirm the live_view signing salt is configured in the endpoint.

How do I deploy an Elixir Phoenix application to production?▼

Use mix release with MIX_ENV=prod to build a self-contained release, configure secrets and database URLs in config/runtime.exs, and package it with a multi-stage Dockerfile based on an Elixir build image and a slim runtime image.