AGENT SKILL
elixir-project-conventions
How to read, change and test an Elixir or Phoenix project without breaking its conventions. Use when editing .ex or .exs files, adding a module, a test, a migration or a dependency, or when mix, ExUnit, Ecto or LiveView come up.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-22
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- elixir-project-conventions
- license
- Apache-2.0
- trinity
- { "risk": "write", "requires_toolsets": [ "fs" ] }
- metadata
- { "author": "trinity", "version": "1.0", "category": "development" }
- description
- How to read, change and test an Elixir or Phoenix project without breaking its conventions. Use when editing .ex or .exs files, adding a module, a test, a migration or a dependency, or when mix, ExUnit, Ecto or LiveView come up.
02 资源文件 1
- 参考文档references/mix-commands.md606 B
03 SKILL.md 正文
Elixir project conventions
Before changing anything
- Read
mix.exsfor the app name, the Elixir version and the aliases; read.formatter.exs. - Find the module you are changing with
fs_grepfordefmodule, and read the whole file before editing part of it. - If the project has
CLAUDE.md,AGENTS.mdorCONTRIBUTING.md, they win over this skill.
Changing code
- One module per file, the file path mirroring the module name (
lib/app/thing.exforApp.Thing). - Public functions carry
@docand@spec; a module carries@moduledoc. Private helpers go below the public ones. - Pattern match in function heads before reaching for
case; keep functions short; noCode.eval_stringon anything that came from outside. - Run
mix formaton what you touched andmix compile --warnings-as-errorsbefore you say it compiles. Warnings are failures in most gated projects.
Tests
- A test lives beside its module's path under
test/and ends in_test.exs. - Tests that touch a database use the project's DataCase; tests that reach the network are tagged and excluded by default. Do not add a network call to a test.
- Run the test file you changed, then the whole suite; report the numbers, not "tests pass".
Migrations and dependencies
- A schema change is a migration (
mix ecto.gen.migration), never an edit to an old one. - A new dependency goes through
mix.exswith a version requirement, andmix deps.get; say why it is needed.references/mix-commands.mdlists the commands.
04 同仓库更多 Skills
no-shell-fallback
What to do without a shell. Shown only when the shell toolset has no tool.
★ 3
needs-web
Requires a toolset that no configuration names. Hidden.
★ 3
needs-shell
Requires the shell toolset. Shown where the shell tool is registered.
★ 3
needs-missing-tool
Requires a tool nobody registers. Hidden by conditional activation.
★ 3
echo-skill
The user's own echo skill, which shadows the bundled one. Use when a test wants precedence.
★ 3
tampered
A skill whose manifest was written for other bytes. Refused.
★ 3