lang-erlang
Skill0 starsChanged 7 days agoMITView on GitHub
Use when writing, reviewing, testing or setting up Erlang backend code in a loops run (the erlang language pack) - toolchain, layout, race policy, coverage, idioms and footguns.
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/work/platforms/claude.mdCLAUDE.md
- llms.txtllms.txt
- clarifySkill
- consistencySkill
- debuggingSkill
- documentationSkill
- featureSkill
- hexagonalSkill
- initSkill
- jobs-and-state-machinesSkill
- lang-clojureSkill
- lang-cppSkill
- lang-csharpSkill
- lang-elixirSkill
- lang-goSkill
- lang-javaSkill
- lang-kotlinSkill
- lang-phpSkill
- lang-pythonSkill
- lang-rubySkill
- lang-rustSkill
- lang-scalaSkill
- lang-swiftSkill
- lang-typescriptSkill
- memorySkill
- parallel-workSkill
- performanceSkill
- qualitySkill
- reportSkill
- review-integrationSkill
- statusSkill
- testingSkill
- workSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Every module with a gen_statem, an ETS table or a multi-process protocol has a proper_statem test (ERL-CONC-03, ERL-TEST-08).
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Erlang backend (OTP, rebar3)
Applies when loops lang detect reports erlang (rebar.config, rebar.lock or erlang.mk). Rules: specs/languages/erlang/RULES.md (IDs ERL-<SEC>-NN). Pack data: specs/languages/erlang/pack.json (loops lang show erlang). Layering and SOLID are language-neutral: specs/ARCHITECTURE.md, specs/SOLID.md.
Project rules first
The project's own config wins over this skill: rebar.config, elvis.config, .editorconfig, .tool-versions, the framework (Cowboy, Nova, Elli) and any erlang.mk Makefile. When you follow one over a loops rule, record it: loops run override --rule "<loops rule>" --project "<project rule, file:line>" --note "<what you did>" (ROLES.md "Project rules first"). The practices-researcher reads config_files from the pack. An erlang.mk repo keeps its Makefile targets; the pack's argv are rebar3.
Toolchain the gate runs
loops gate runs these in order; while iterating run a single one.
| Check | Command | Notes |
| compile (required) | rebar3 compile | warnings_as_errors comes from rebar.config (ERL-TOOL-03) |
| fmt (optional) | rebar3 fmt --check | erlfmt plugin; skipped with a hint if absent (ERL-TOOL-02) |
| xref (required, arch) | rebar3 xref | undefined and deprecated calls; app direction only with project xref_queries (ERL-TOOL-04, ERL-ARCH-02) |
| elvis (optional) | rebar3 lint | runs only when elvis.config exists; exits 1 without one (ERL-TOOL-05) |
| dialyzer (required) | rebar3 dialyzer | first run builds the PLT; keep REBAR_CACHE_DIR shared (ERL-TOOL-06) |
| eunit (required) | rebar3 eunit --cover | race check, once per +S variant |
| ct (required) | rebar3 ct --cover | race check, once per +S variant |
| proper (optional) | rebar3 proper -n 100 --cover | ERL-TEST-08 |
| coverage (required) | rebar3 covertool generate, then loops parses _build/test/covertool/*.covertool.xml | Cobertura, new code at least 70% |
| audit, sbom (off by default) | rebar3 audit, rebar3 sbom | --vuln; audit needs network (ERL-TOOL-08) |
Narrow scope while working: rebar3 eunit --module=m, rebar3 ct --suite=test/x_SUITE --case=c (ERL-TEST-10). Never run the full gate as an implementer; the lead and QA do (ROLES.md). ERL_CRASH_DUMP is scoped per run by the gate; REBAR_CACHE_DIR and REBAR_GLOBAL_CONFIG_DIR stay shared (they hold packages, project plugins and the PLT), only _build is per project (ERL-OPS-05).
Race policy (WORKFLOW §6)
The BEAM has no race detector, so the pack's mode is none; the substitute is required and never skipped:
eunitandcteach run twice:ERL_FLAGS="+S 1:1"andERL_FLAGS="+S 8:8"(race.variants).ERL_FLAGSreaches the BEAM that rebar3 starts. A test that passes under only one is flaky; never add retries.- Every module with a gen_statem, an ETS table or a multi-process protocol has a
proper_statemtest (ERL-CONC-03,ERL-TEST-08). Userebar3 ct --repeat Nto hunt flakes locally. - No
timer:sleepfor sync: wait on a monitor or message (ERL-TEST-09). Concuerror is not used (stale, dropped).
Coverage recipe and wave-0 prerequisites (D13)
The architect or erlang-engineer adds these in wave 0 and logs each as an override if the project already differs:
- In
rebar.config:{cover_enabled, true}.and{cover_export_enabled, true}.. {project_plugins, [covertool]}.and{covertool, [{coverdata_files, ["eunit.coverdata", "ct.coverdata"]}]}.. Without themcovertool generatewrites nothing and coverage fails.{erl_opts, [debug_info, warnings_as_errors, warn_missing_spec]}.,{xref_checks, [...]},{dialyzer, [...]}(ERL-TOOL-03/04/06).- Plugins
erlfmt,rebar3_lint(with a committedelvis.config) andrebar3_properwhen the project wants those checks; commitrebar.lock. - Exclude generated modules with
{cover_excl_mods, [...]}.
How the loops layers map
apps/ms_domain/ pure functions, records, types; applications [kernel, stdlib]; no process, ets, os, clock
apps/ms_app/ use cases; ports are -callback behaviours here (consumer-owned); gen_server/gen_statem, supervisors
apps/ms_http/ inbound adapter: Cowboy handlers decode, call a use case, encode
apps/ms_pg/ outbound adapter: epgsql/pgo implementing an ms_app behaviour
apps/ms_release/ composition root: sup tree, adapter modules injected via application env, sys.config.srcDirection is the .app.src applications list plus project xref_queries (plain rebar3 xref does not check direction); modules are flat atoms, so use a per-app prefix (ERL-ARCH-01/02). There is no import parser; loops arch defers to the xref check, and reviewers check direction.
Ten footguns
binary_to_atom/2orlist_to_atom/1on input:binary_to_existing_atom/2or a lookup table.binary_to_term/1on network data:[safe]and still no funs; use JSON or Protobuf.- Distribution cookie as security: TLS distribution, internal interface, never expose 4369.
- Unbounded mailbox: admission control, a pool,
max_heap_size, watchmessage_queue_len. - Selective
receiveover a large mailbox: usegen_server:callor aliases. try f() catch _:_ -> ok end: let it crash or catch a specific class with the stacktrace.gen_server:callcycles or the 5 s default: cast, async reply, chosen timeouts.- Bare
spawn:proc_libor agen_*under a supervisor. - ETS
lookuptheninsertfrom many processes:update_counter/4,insert_new/2or one owner. - Big terms copied between processes, or a small slice keeping a huge binary:
binary:copy/1, ETS,persistent_term.
Load on demand
repo.md: rebar3 layout, lock, toolchain pin, CI, Hex.architecture.md: apps as layers, behaviours as ports, OTP process design, purity.idioms.md: let it crash, specs, strings, atoms, time, macros.testing.md: EUnit, Common Test, PropEr, fakes, cover, flakiness.concurrency.md: processes, mailboxes, ETS, call timeouts, the race substitute.security.md: atoms, deserialization, distribution, crypto, supply chain.data-api.md: persistence, migrations, HTTP, messaging, observability, releases.frameworks.md: Cowboy, Nova, Elli, erlang.mk, footguns.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

