TopRank Skills

Home / Claw Skills / 数据解析 / elixir-dev
Official OpenClaw rules 36%

elixir-dev

Elixir/Phoenix development companion. Run and interpret mix test, mix credo, mix dialyzer, mix format. Generate modules following OTP conventions: contexts, schemas, GenServers, supervisors, tasks. Debug compilation errors and warnings. Help with Ecto migrations, queries, changesets, and associations. Use for any Elixir or Phoenix development task including writing modules, fixing tests, refactoring code, or understanding OTP patterns.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 elixir-dev 技能。 若已安装,则直接安装 elixir-dev 技能。

Overview

Skill Key
gchapim/elixir-dev
Author
gchapim
Source Repo
openclaw/skills
Version
-
Source Path
skills/gchapim/elixir-dev
Latest Commit SHA
120f0da8200c265e60c0080b3bda5e24f365be22

Extracted Content

SKILL.md excerpt

# Elixir Dev

## Running Mix Commands

See [references/mix-commands.md](references/mix-commands.md) for full command reference.

### Test

```bash
# Run all tests
mix test

# Specific file or line
mix test test/my_app/accounts_test.exs:42

# By tag
mix test --only integration

# Failed only (requires --failed flag from prior run)
mix test --failed

# With coverage
mix test --cover
```

**Interpreting failures:**
- `** (MatchError)` — Pattern match failed; check return value shape.
- `** (Ecto.NoResultsError)` — `Repo.get!` with non-existent ID; use `Repo.get` or seed data.
- `** (DBConnection.OwnershipError)` — Missing `async: true` or sandbox setup.
- `no function clause matching` — Wrong arity or unexpected arg type.

### Credo

```bash
mix credo --strict
mix credo suggest --format json
mix credo explain MyApp.Module  # Explain issues for specific module
```

**Common Credo fixes:**
- `Credo.Check.Readability.ModuleDoc` — Add `@moduledoc`.
- `Credo.Check.Refactor.CyclomaticComplexity` — Extract helper functions.
- `Credo.Check.Design.TagTODO` — Address or remove TODO comments.

### Dialyzer

```bash
mix dialyzer
mix dialyzer --format short
```

**Common Dialyzer warnings:**
- `The pattern can never match` — Dead code or wrong type in pattern.
- `Function has no local return` — Crashes on all paths; check internal calls.
- `The call will never return` — Calling a function that always raises.
- Fix: Add `@spec` annotations; use `@dialyzer {:nowarn_function, func: arity}` as last resort.

### Format

```bash
mix format
mix format --check-formatted  # CI mode — exit 1 if unformatted
```

## Module Generation

Always include `@moduledoc`, `@doc`, and `@spec` on public functions.

### Context Module

```elixir
defmodule MyApp.Notifications do
  @moduledoc """
  Manages notification delivery and preferences.
  """
  import Ecto.Query
  alias MyApp.Repo
  alias MyApp.Notifications.Notification

  @doc "List notifications for a user, most recent first."
  @spec list_notifi...

Related Claw Skills