Elixir Coding Practices
Application skill for Elixir style learning (from the archived awesome-guidelines style capsules). For OTP/supervision design, combine with stack capsules in skills/*-foundation.
Core Principle
Elixir quality is formatter-mechanical + explicit modules, ordered attributes, documented public API, purposeful pipelines.
When to Use / NOT
- Elixir/Phoenix/Mix libraries and applications.
- Setting up
mix format, Credo, Dialyzer, ExUnit in CI.
NOT when:
- Erlang
.erl, use Erlang practices when ingested.
- HEEx/templates only, validate
.ex context modules.
Workflow
- Format & modules, mix format, module order (
elixir-style-formatting-modules.md).
- Naming, snake/Camel,?, Error (
elixir-style-naming-functions.md).
- Expressions, pipes, cond, defs (
elixir-style-expressions-pipelines.md).
- Docs & types, moduledoc, spec, errors (
elixir-style-docs-types-errors.md).
- Verify,
mix format, mix test, Credo/Dialyzer per project.
Red Flags
- Unformatted source
- camelCase functions or snake_case modules
- Single-step pipe
@moduledoc after use
- Missing
@spec on public API (when Dialyzer enabled)
- Exception not ending in
Error
- Capitalized raise message with
.
unless ... else
- Repetitive module namespace (
Foo.Foo)
- Needless macros
Verification
mix format --check-formatted
mix test
mix credo / mix dialyzer (project policy)
- ExDoc build for public packages
- Capsule checklist on new modules
References
awesome-guidelines/references/elixir-style-learning-note.md
awesome-guidelines/references/elixir-style-formatting-modules.md
awesome-guidelines/references/elixir-style-naming-functions.md
awesome-guidelines/references/elixir-style-expressions-pipelines.md
awesome-guidelines/references/elixir-style-docs-types-errors.md
1---2name: elixir-coding-practices3description: Use when authoring or reviewing Elixir, mix format, snake_case/CamelCase naming, module attribute order, pipelines, @moduledoc/@spec, Error exceptions, and mix test/credo in CI.4---56# Elixir Coding Practices78Application skill for Elixir style learning (from the archived `awesome-guidelines` style capsules). For OTP/supervision design, combine with stack capsules in `skills/*-foundation`.910## Core Principle1112Elixir quality is **formatter-mechanical + explicit modules**, ordered attributes, documented public API, purposeful pipelines.1314## When to Use / NOT1516- Elixir/Phoenix/Mix libraries and applications.17- Setting up `mix format`, Credo, Dialyzer, ExUnit in CI.1819**NOT when:**2021- Erlang `.erl`, use Erlang practices when ingested.22- HEEx/templates only, validate `.ex` context modules.2324## Workflow25261. **Format & modules**, mix format, module order (`elixir-style-formatting-modules.md`).272. **Naming**, snake/Camel,?, Error (`elixir-style-naming-functions.md`).283. **Expressions**, pipes, cond, defs (`elixir-style-expressions-pipelines.md`).294. **Docs & types**, moduledoc, spec, errors (`elixir-style-docs-types-errors.md`).305. **Verify**, `mix format`, `mix test`, Credo/Dialyzer per project.3132## Red Flags3334- Unformatted source35- camelCase functions or snake_case modules36- Single-step pipe37- `@moduledoc` after `use`38- Missing `@spec` on public API (when Dialyzer enabled)39- Exception not ending in `Error`40- Capitalized raise message with `.`41- `unless ... else`42- Repetitive module namespace (`Foo.Foo`)43- Needless macros4445## Verification4647- `mix format --check-formatted`48- `mix test`49- `mix credo` / `mix dialyzer` (project policy)50- ExDoc build for public packages51- Capsule checklist on new modules525354## References5556- `awesome-guidelines/references/elixir-style-learning-note.md`57- `awesome-guidelines/references/elixir-style-formatting-modules.md`58- `awesome-guidelines/references/elixir-style-naming-functions.md`59- `awesome-guidelines/references/elixir-style-expressions-pipelines.md`60- `awesome-guidelines/references/elixir-style-docs-types-errors.md`