agentleFS
pahlevikunpahlevikun/levistack/skills/architecture/super-elixir/SKILL.md

super-elixir

Skill0 starsChanged 19 days agoMITView on GitHub

Use for any Elixir work: .ex, .exs and .heex files, mix.exs, Phoenix, Ecto, OTP, GenServer, Supervisor, ExUnit and mix tasks. One skill with specialities: write idiomatic code, design OTP, Ecto and Phoenix apps, work test-first, write docs, and review code, security, performance and anti-patterns. It detects the job, loads only the guide it needs, and can run a full multi-pass review in one invocation.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do this first and do not announce it.

    line 39
  2. Distinctive:

    Use this for "review everything", "full review" or any request naming more than one concern.

    line 63
  3. Very specific:

    Facts: Run node scripts/elixir-scan.mjs detect <dir>.

    line 65
  4. Very specific:

    Candidates: Run node scripts/elixir-scan.mjs scan <dir>.

    line 66
  5. Distinctive:

    Every guide keeps its own full list.

    line 88
  6. Very specific:

    Supervise every long-lived process: No bare start_link in production.

    line 91
  7. Very specific:

    Guards use and, or, not: Never &&, ||, !

    line 94
  8. Distinctive:

    Messages are copied: Keep them small.

    line 96
  9. Distinctive:

    No finding was reported that failed the verification protocol.

    line 158

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Super Elixir

One skill, many specialities. Call it once. It picks the speciality from the job, loads only that guide, and for reviews it can run several passes and return one report.

The guides are kept whole. Each is a full, separate skill that was merged in; the router decides which to open.

Step 0: detect the job

Do this first and do not announce it. Signals and precedence are in references/auto-detect.md. For project facts (Elixir version, Phoenix, Ecto, Oban, which linters exist), run node scripts/elixir-scan.mjs detect <dir>.

If the user is doing thisSpecialityLoad
Writing or changing Elixir, "is this idiomatic", moving from OOP habitsthinking, idiomsthinking, idioms
case, with, guards, function heads, destructuringpattern-matchingpattern-matching
GenServer, Supervisor, Agent, Task, Registry, "should this be a process"thinking first, then otpthinking, otp
Schemas, changesets, queries, transactions, migrationsectoecto
New Phoenix project, umbrella, Bun assets, devenv, end-to-end testsphoenixphoenix
LiveView pages, components, streamsthe separate phoenix-liveview skillphoenix-liveview
Designing a new app, supervision trees, Ash, ADRs, a docs packagearchitectarchitect
Implementing a feature or fixing a bugtddtdd; language-agnostic loop: tdd
@moduledoc, @doc, @typedoc, doctests, cross-referencesdocsdocs
"Review this code" (style, patterns, OTP basics, docs)code-reviewcode-review
"Security review", user input, secrets, String.to_atom, Code.eval_stringsecurity-reviewsecurity-review
"Slow", throughput, mailbox growth, memory, N+1performance-reviewperformance-review
Known bad patterns, refactoring toward better onesantipatternsantipatterns
"Review everything", "audit this repo", "full review"the review pipeline belowseveral
"Act as an Elixir expert", broad checklists, BEAM backgroundfoundations, expertfoundations, BEAM expert, expert

Order of precedence: a safety finding, then the user's explicit words, then the detected job. A security finding, a data-loss risk or an irreversible action is always stated in full sentences.

Review pipeline: several passes, one report

Use this for "review everything", "full review" or any request naming more than one concern. A single named concern runs only its own pass.

  1. Facts. Run node scripts/elixir-scan.mjs detect <dir>. It tells you which passes apply (no Ecto, no GenServers, no Phoenix) and which gates the project really has.
  2. Candidates. Run node scripts/elixir-scan.mjs scan <dir>. The output is a list of places to look, not findings. Never report a candidate without reading the code around it.
  3. Passes, in this order. Open each guide and its references, apply its checklist, its Valid Patterns (Do NOT Flag) and its Context-Sensitive Rules.
    1. code-review: style, pattern matching, OTP basics, docs.
    2. security-review: injection, atoms, secrets, process exposure.
    3. performance-review: GenServer bottlenecks, memory, concurrency, database.
    4. antipatterns: the known-bad catalog, only for what the earlier passes did not already cover.
  4. Verify every finding with references/verification-protocol.md. A finding that fails a gate is dropped or downgraded to a question.
  5. Report once. Fill templates/review-report.md. De-duplicate across passes, order by severity, give each finding a path:line, the evidence, and a fix.

Review only. Do not edit code during a review pass unless the user asked for fixes.

Build pipeline: one feature, in order

  1. Think. thinking: does this need a process at all? What is the data, what are the functions?
  2. Shape. New app or large feature: architect. Otherwise skip.
  3. Test first. tdd: a failing test, then the smallest change.
  4. Write. idioms, pattern-matching, plus otp or ecto as the code needs.
  5. Document. docs for public modules and functions.
  6. Gate. mix format, mix compile --warnings-as-errors, mix test, then only the linters in mix.exs (Credo, Sobelow, Dialyzer). Use templates/feature-checklist.md to track it.

The short list of iron laws

Every guide keeps its own full list. These recur across the sources and rarely conflict:

  1. No process without a runtime reason. State, concurrency or fault isolation. Otherwise plain functions.
  2. Supervise every long-lived process. No bare start_link in production.
  3. Tagged tuples for expected failure. Raise for bugs. rescue only around external code.
  4. In with, every failable step uses <-. A = swallows the error.
  5. Guards use and, or, not. Never &&, ||, !.
  6. No atoms from external input. String.to_atom/1 on user data leaks the atom table.
  7. Messages are copied. Keep them small.
  8. Changesets for external data. cast/4 for input, change/2 for internal changes.
  9. No code without a failing test first.
  10. Verify before you report. Evidence, not impression.

Where two guides disagree, the stricter rule wins, and the project's own AGENTS.md and rules (see rules/elixir/) win over both.

Overlaps: which copy to read

These topics exist in more than one guide. All are kept. Pick by the job.

TopicTo write codeTo review code
Pattern matchingpattern-matching (full), idioms/pattern-matching (short)code-review/pattern-matching
OTPotp (full), idioms/otp-patterns (short)code-review/otp-basics
Anti-patternsantipatterns, extended catalogidioms/anti-patterns
Documentationdocscode-review/documentation
Errorsidioms/error-handlingthe anti-patterns guides

Layout

FolderHolds
specialities/One folder per speciality. GUIDE.md is the entry point; references/ and assets/ hold the depth
references/auto-detect.md, verification-protocol.md
templates/review-report.md, feature-checklist.md
scripts/elixir-scan.mjs: project detection and risk-pattern candidates

Old skill names

Text inside the guides may name the skill it came from. Resolve it here.

Old nameSpeciality
elixir, elixir-profoundations
elixir-thinkingthinking
elixir-idiomsidioms
elixir-pattern-matchingpattern-matching
elixir-antipatternsantipatterns
elixir-otp-patternsotp
elixir-ecto-patternsecto
elixir-phoenixphoenix
elixir-architectarchitect
elixir-tddtdd
elixir-writing-docsdocs
elixir-code-reviewcode-review
elixir-security-reviewsecurity-review
elixir-performance-reviewperformance-review
elixir-expertexpert

Related skills

  • tdd: drive a change test-first.
  • safe-refactor: clean up Elixir without changing behavior.
  • super-protobuf: the service exposes protobuf, gRPC or Connect.
  • verify: prove tests and gates pass before you claim done.
  • handoff: pause a long review or change.

Done when

  • The right speciality (or the pipeline) ran, and only the needed guides were opened.
  • Code compiles and tests pass, or the review report is complete with evidence for every finding.
  • No finding was reported that failed the verification protocol.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.