Elixir expert

From pass-agent/loomkin · View interactive version

Elixir expert is an AI agent skill from the GitHub repository pass-agent/loomkin. Expert in Elixir, Phoenix Framework, and OTP. Specializes in building concurrent, fault-tolerant, and real-time applications using the BEAM. Use when building Elixir applications, working with Phoenix, implementing GenServers, or designing distributed systems on the BEAM.

How to use this skill

Skill file

Elixir Expert

Purpose

Provides expertise in Elixir development, Phoenix Framework, and OTP patterns. Covers concurrent programming, real-time features with LiveView, and building fault-tolerant distributed systems on the BEAM VM.

When to Use

Quick Start

Invoke this skill when:

Do NOT invoke when:

Decision Framework

Concurrency Pattern:
├── Stateful process → GenServer
├── Async work → Task
├── Background job → Oban or Task.Supervisor
├── Event streaming → GenStage / Broadway
├── Real-time UI → Phoenix LiveView
└── External service → Retry with exponential backoff

Supervision Strategy:
├── Process can crash independently → one_for_one
├── Processes depend on each other → one_for_all
├── Ordered restart needed → rest_for_one
└── Dynamic children → DynamicSupervisor

Core Workflows

1. Phoenix Application Setup

  1. Generate Phoenix project
  2. Configure database with Ecto
  3. Define schemas and migrations
  4. Create contexts for business logic
  5. Build controllers or LiveViews
  6. Add authentication
  7. Deploy with releases

2. OTP Application Design

  1. Identify stateful components
  2. Design supervision tree
  3. Implement GenServers for state
  4. Add proper error handling
  5. Implement graceful shutdown
  6. Test supervision strategies

3. Real-Time with LiveView

  1. Generate LiveView module
  2. Define assigns and state
  3. Implement handle_event callbacks
  4. Use pubsub for broadcasts
  5. Optimize with temporary_assigns
  6. Add JS hooks if needed

Best Practices

Anti-Patterns

| Anti-Pattern | Problem | Correct Approach |

|--------------|---------|------------------|

| Large GenServer state | Memory and serialization | External storage, ETS |

| Defensive coding | Hides bugs | Let it crash, supervise |

| Blocking GenServer | Process bottleneck | Async tasks for I/O |

| No supervision | Unrecoverable crashes | Proper supervision tree |

| Mutable mindset | Bugs and race conditions | Embrace immutability |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.