staff-level-elixir
/staff-level-elixir
Use this skill when writing, reviewing, or refactoring Elixir, OTP, Ecto, or Phoenix/LiveView code. It corrects the staff-level judgment calls a capable model gets wrong by default — reaching for a GenServer as the universal tool, rescuing instead of letting processes crash, N+1 Ecto access, non-atomic writes, unbounded/linked Task fan-out, atom exhaustion from user input, eager Enum where Stream fits, and calling Repo from the web layer. Applies whenever the work touches process design, error handling, concurrency, data access, or LiveView, even if the user doesn't name them.
- Author
- pproenca ↗
- Repository
- dot-skills ↗
- Licence
- MIT
- Last repository change
- 15.08.2026
Assessment and security
- Files in this package
- 28
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 15.08.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use this skill when writing, reviewing, or refactoring Elixir, OTP, Ecto, or Phoenix/LiveView code. It corrects the staff-level judgment calls a capable model gets wrong by default — reaching for a GenServer as the universal tool, rescuing instead of letting processes crash, N+1 Ecto access, non-atomic writes, unbounded/linked Task fan-out, atom exhaustion from user input, eager Enum where Stream fits, and calling Repo from the web layer. Applies whenever the work touches process design, error handling, concurrency, data access, or LiveView, even if the user doesn't name them.
Original author description
Use this skill when writing, reviewing, or refactoring Elixir, OTP, Ecto, or Phoenix/LiveView code. It corrects the staff-level judgment calls a capable model gets wrong by default — reaching for a GenServer as the universal tool, rescuing instead of letting processes crash, N+1 Ecto access, non-atomic writes, unbounded/linked Task fan-out, atom exhaustion from user input, eager Enum where Stream fits, and calling Repo from the web layer. Applies whenever the work touches process design, error handling, concurrency, data access, or LiveView, even if the user doesn't name them.
How it works
- When to Apply
- Rule Categories
- Quick Reference
- How to Use
- Reference Files
SKILL.md preview
---
name: staff-level-elixir
description: Use this skill when writing, reviewing, or refactoring Elixir, OTP, Ecto, or Phoenix/LiveView code. It corrects the staff-level judgment calls a capable model gets wrong by default — reaching for a GenServer as the universal tool, rescuing instead of letting processes crash, N+1 Ecto access, non-atomic writes, unbounded/linked Task fan-out, atom exhaustion from user input, eager Enum where Stream fits, and calling Repo from the web layer. Applies whenever the work touches process design, error handling, concurrency, data access, or LiveView, even if the user doesn't name them.
---
# Staff-Level Elixir
Distilled staff-level judgment for Elixir on the BEAM — the design decisions Elixir, OTP, Ecto, and Phoenix force, and how an experienced engineer settles them, written so an agent applies them while writing or reviewing code. Each rule corrects a specific wrong default; there is no rule for things the model already gets right (syntax, basic idioms, the standard library).
## When to Apply
- Writing or reviewing OTP code — deciding whether something needs a process, and which (GenServer, Task, Agent, ETS, supervisor)
- Handling failure — choosing between tagged tuples, exceptions, `with`, and letting a process crash
- Writing Ecto — queries, associations, transactions, changesets, large result sets
- Building Phoenix controllers and LiveViews — context boundaries, socket state, mount lifecycle
- Running concurrent work — parallel fan-out, fire-and-forget tasks, handling untrusted input
- Any request to make Elixir code more idiomatic, more fault-tolerant, or "staff-level"
## Rule Categories
| # | Category | Prefix | Covers |
|---|----------|--------|--------|
| 1 | Process & OTP Design | `otp-` | Whether a problem needs a process, and which one; supervision |
| 2 | Error Handling & Let-It-Crash | `err-` | Signalling failure; when to raise, rescue, or crash |
| 3 | Idioms & Design Choices | `data-` | Pattern matching, Stream/Enum, iolists, pipes, macros |
| 4 | Concurrency & the Scheduler | `conc-` | Bounded/isolated parallelism; atom-table safety |
| 5 | Ecto & Data Access | `ecto-` | N+1, atomic writes, constraint races, large sets |
| 6 | Phoenix & LiveView | `phx-` | Context boundaries, socket memory, mount lifecycle |
## Quick Reference
### 1. Process & OTP Design
- [`otp-genserver-not-default`](references/otp-genserver-not-default.md) — a GenServer is a serialization point, not the default abstraction
- [`otp-ets-for-shared-reads`](references/otp-ets-for-shared-reads.md) — read-heavy shared state belongs in ETS, not behind a GenServer.get
- [`otp-supervise-over-manual-restart`](references/otp-supervise-over-manual-restart.md) — child specs + DynamicSupervisor/Registry, not hand-rolled restart logic
- [`otp-handle-continue-init`](references/otp-handle-continue-init.md) — defer heavy startup to `handle_continue`; `init/1` blocks the supervisor
### 2. Error Handling & Let-It-Crash
- [`err-tagged-tuples-vs-raise`](references/err-tagged-tuples-vs-raise.md) — `{:ok/:error}` for expected failures, raise only for invariant violations
- [`err-let-it-crash`](references/err-let-it-crash.md) — don't rescue to mask bugs; let the supervisor restart clean state
- [`err-with-happy-path`](references/err-with-happy-path.md) — chain fallible steps with `with`; keep the error term intact
### 3. Idioms & Design Choices
- [`data-pattern-match-over-conditionals`](references/data-pattern-match-over-conditionals.md) — function clauses + guards over if/cond on argument shape
- [`data-stream-vs-enum`](references/data-stream-vs-enum.md) — Stream for large/lazy/early-exit, Enum for small concrete lists
- [`data-iolists-over-concat`](references/data-iolists-over-concat.md) — build large output as iolists; `<>` in a loop is O(n²)
- [`data-pipe-idioms`](references/data-pipe-idioms.md) — pipe a data subject through transformations, not to save a variable
- [`data-functions-over-macros`](references/data-functions-over-macros.md) — solve it with a function before reaching for a macro
### 4. Concurrency & the Scheduler
- [`conc-async-stream-bounded`](references/conc-async-stream-bounded.md) — `Task.async_stream` with `max_concurrency` + explicit `timeout`
- [`conc-task-supervised-nolink`](references/conc-task-supervised-nolink.md) — supervised, unlinked Task for fire-and-forget work
- [`conc-atom-exhaustion`](references/conc-atom-exhaustion.md) — never build atoms from external input; use `to_existing_atom`
### 5. Ecto & Data Access
- [`ecto-preload-n-plus-one`](references/ecto-preload-n-plus-one.md) — preload up front, never inside an Enum loop
- [`ecto-multi-for-transactions`](references/ecto-multi-for-transactions.md) — `Ecto.Multi` for atomic multi-step writes with failure attribution
- [`ecto-db-constraints-over-validation`](references/ecto-db-constraints-over-validation.md) — DB constraint + `unique_constraint`, not a racy validation query
- [`ecto-stream-large-sets`](references/ecto-stream-large-sets.md) — `Repo.stream`/batch large sets; `Repo.all` OOMs at scale
- [`ecto-atomic-counters`](references/ecto-atomic-counters.md) — `update_all` with `inc:` for counters; read-modify-write loses updates
### 6. Phoenix & LiveView
- [`phx-context-boundary`](references/phx-context-boundary.md) — web layer calls contexts, never Repo or schemas directly
- [`phx-liveview-streams`](references/phx-liveview-streams.md) — streams for large/growing collections, not full lists in assigns
- [`phx-mount-twice-connected`](references/phx-mount-twice-connected.md) — gate side effects on `connected?/1`; mount runs twice
## How to Use
Read a reference file when its decision comes up. Each rule names the wrong default it corrects, then shows the canonical way (with an incorrect/correct contrast only where the wrong way is a real trap).
- [Section definitions](references/_sections.md) — category structure and ordering
- [Rule template](assets/templates/_template.md) — for adding new rules
- [AGENTS.md](AGENTS.md) — auto-built table of contents across all rules
## Reference Files
| File | Description |
|------|-------------|
| [references/_sections.md](references/_sections.md) | Category definitions and ordering |
| [assets/templates/_template.md](assets/templates/_template.md) | Template for new rules |
| [metadata.json](metadata.json) | Version and source references |
Files in this package (28)
- AGENTS.md 5 KB
- SKILL.md 6 KB
- metadata.json 1 KB
- assets/templates/_template.md 1 KB
- references/_sections.md 2 KB
- references/conc-async-stream-bounded.md 2 KB
- references/conc-atom-exhaustion.md 2 KB
- references/conc-task-supervised-nolink.md 1 KB
- references/data-functions-over-macros.md 2 KB
- references/data-iolists-over-concat.md 1 KB
- references/data-pattern-match-over-conditionals.md 2 KB
- references/data-pipe-idioms.md 1 KB
- references/data-stream-vs-enum.md 1 KB
- references/ecto-atomic-counters.md 1 KB
- references/ecto-db-constraints-over-validation.md 2 KB
- references/ecto-multi-for-transactions.md 2 KB
- references/ecto-preload-n-plus-one.md 1 KB
- references/ecto-stream-large-sets.md 1 KB
- references/err-let-it-crash.md 2 KB
- references/err-tagged-tuples-vs-raise.md 2 KB
- references/err-with-happy-path.md 2 KB
- references/otp-ets-for-shared-reads.md 2 KB
- references/otp-genserver-not-default.md 2 KB
- references/otp-handle-continue-init.md 1 KB
- references/otp-supervise-over-manual-restart.md 2 KB
- references/phx-context-boundary.md 1 KB
- references/phx-liveview-streams.md 1 KB
- references/phx-mount-twice-connected.md 1 KB
Versions
The database has no other skills named staff-level-elixir.
Database snapshot: 13.11.2026 · package version 6e4d576fab0f (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 95elixir
Use this skill when building with Elixir — Phoenix framework, OTP, BEAM, LiveView, Ecto, supervision trees. This skill enforces: OTP design principles, Phoenix context boundaries, LiveView state management, Ecto schema conventions, supervision tree structure. Do NOT use for:… - 100phoenix
Use when building an Elixir web app with Phoenix — contexts, Ecto schemas, changesets and migrations, LiveView, channels and PubSub, the generators, and the boundary between domain logic and the web layer. Covers the classic LiveView over-rendering and Ecto N+1 traps. NOT pure… - 100elixir
Elixir is a functional language on the Erlang VM (BEAM) for concurrent, fault-tolerant and distributed systems. Use when someone asks to "write Elixir", "build a Phoenix app", "Phoenix LiveView", "GenServer", "supervision tree", "Ecto schema or changeset", "mix project", or… - 90elixir-pro
Write idiomatic Elixir code with OTP patterns, supervision trees, and Phoenix LiveView. Masters concurrency, fault tolerance, and distributed systems. Use for Elixir refactoring, OTP design, or complex BEAM optimizations. - 100phoenix
Expert Phoenix assistance covering Elixir web development, LiveView real-time reactive UIs, Ecto queries, and Channels. Use when building high-concurrency real-time web applications with minimal JavaScript. - 100review
Review Elixir/Phoenix changes before committing — bugs, security, Ecto, LiveView, and Oban anti-patterns, via parallel specialist agents. Use when asked to review changes, a component, a diff, or a PR.