elixir

Provide Elixir coding standards for Phoenix, Ecto, Ash, and OTP workflows.

3|Updated May 18, 2019
One-click install
npx skills add https://github.com/barnabasJ/dotfiles --skill elixir
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elixir
Source: https://github.com/barnabasJ/dotfiles/tree/main/agents/skills/elixir
Command: npx skills add https://github.com/barnabasJ/dotfiles --skill elixir

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert guidance on Elixir, Phoenix, Ecto, Ash, and OTP, helping developers write idiomatic, performant, and maintainable code. It addresses common pitfalls and promotes best practices, reducing debugging time and improving application reliability.

Core Features & Use Cases

  • Code Style & Best Practices: Learn correct pipe operator usage, mix run vs. elixir command, and Phoenix LiveView component patterns for compile-time validation.
  • Ash Framework & Ecto: Master Ash migrations, Ecto schema definitions, query composition, and changeset usage for robust data management.
  • Testing Methodologies: Implement Mimic expect for reliable mocks and use generators for isolated test setup, ensuring high-quality, maintainable test suites.
  • Use Case: When developing a new Elixir feature, use this skill to ensure all code adheres to best practices for LiveView components, Ash migrations, and testing, preventing common errors and ensuring a high-quality codebase.

Quick Start

Use the elixir skill to review the provided Elixir code snippet and suggest improvements based on pipe operator usage and LiveView component best practices.

Frequently Asked Questions about elixir

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

FAQPage Schema
How do I write idiomatic Elixir code using pipe operators correctly?

Pipe operators chain multi-step transformations left-to-right, passing each result as the first argument to the next function. Use pipes to compose query operations, transformations, and data processing in a readable, linear flow rather than nested function calls.

What's the best way to structure Phoenix LiveView components?

Phoenix LiveView components require public wrapper functions and attr declarations for compile-time validation. This enforces type safety and prevents runtime errors while keeping component definitions clean and reusable across your application.

How do I set up and run tests correctly in Elixir projects?

Use test/scratch_test.exs exclusively for tests and run them with mix test, not mix run or iex. This ensures consistent test discovery, proper isolation, and reliable test execution across your development and CI environments.

What are the best practices for Ash migrations and Ecto schema definitions?

Generate Ash migrations using mix ash.codegen to ensure consistency with your resource definitions. Structure Ecto schemas with proper changesets, query composition, and migration patterns to maintain data integrity and enable robust database operations.

How do I implement reliable mocks in Elixir tests?

Use Mimic expect for mocking and generators for isolated test setup, replacing manual fixtures. This approach reduces test fragility, improves readability, and ensures mocks behave predictably without coupling to implementation details.

Can I use Elixir and OTP patterns for building concurrent, fault-tolerant applications?

OTP provides supervision trees, process linking, and message passing for building systems that recover from failures automatically. Combined with Elixir's lightweight processes, OTP enables robust applications that scale reliably under load.