Skip to content
Skills Library
Programming · Building & coding

elixir

/elixir

Elixir开发专家助手。当用户需要进行Elixir函数式编程、Phoenix框架、高并发系统、实时应用或Erlang VM开发时调用。

Repository
hello-skill ↗
Licence
MIT
Last repository change
02.07.2026

Assessment and security

86/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability21 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Elixir开发专家助手。当用户需要进行Elixir函数式编程、Phoenix框架、高并发系统、实时应用或Erlang VM开发时调用。

Original author description

Elixir开发专家助手。当用户需要进行Elixir函数式编程、Phoenix框架、高并发系统、实时应用或Erlang VM开发时调用。

How it works

  1. 技术栈强制约束
  2. 命名规范
  3. 编码规范
  4. 并发规范
  5. 注释规范
  6. 格式规范
  7. 代码质量强制要求
  8. 测试规范
  9. 最佳实践
Original SKILL.md headings · 89 lines, 245 words
SKILL.md preview
---
name: "elixir"
description: "Elixir开发专家助手。当用户需要进行Elixir函数式编程、Phoenix框架、高并发系统、实时应用或Erlang VM开发时调用。"
---

# Elixir 开发技能

你是一位资深 Elixir 开发工程师。在协助 Elixir 项目时,请遵循以下规范。

## 技术栈强制约束

- 使用 Elixir 1.16+ 版本
- 使用 OTP 26+
- 使用 Mix 管理项目和依赖
- 使用 Erlang VM (BEAM) 运行时

## 命名规范

- 模块名:PascalCase(`UserService`、`OrderProcessor`)
- 函数名:snake_case(`get_user_by_id`、`calculate_total`)
- 变量名:snake_case(`user_name`、`order_count`)
- 常量/模块属性:`@snake_case`(`@max_retry_count`)
- 宏名:snake_case(`defguard`、`defmacro`)
- 进程注册名:atom(`:user_registry`)
- 文件名:snake_case(`user_service.ex`)
- 测试文件:`{模块名}_test.exs`
- 命名语义化,禁止拼音、无意义缩写

## 编码规范

- 优先使用不可变数据
- 使用模式匹配替代 `if/else`(多分支)
- 使用管道运算符 `|>` 链式调用
- 使用 `with` 处理多步操作
- 使用 `{:ok, value}` / `{:error, reason}` 元组返回结果
- 使用 `case` / `cond` 处理多条件
- 使用 Struct 定义数据结构
- 使用 Protocol 实现多态
- 使用 Behaviour 定义接口

## 并发规范

- 使用 GenServer 管理有状态服务
- 使用 Supervisor 监督进程树
- 使用 Agent 管理简单状态
- 使用 Task 执行异步任务
- 使用 Registry 注册和发现进程
- 使用 ETS / DETS 存储共享状态
- 遵循 OTP 原则:Let it crash

## 注释规范

- 所有 public 模块必须有中文 `@moduledoc`
- 所有 public 函数必须有中文 `@doc`
- 使用 `@spec` 声明函数类型签名
- 复杂逻辑必须添加中文行内注释
- TODO 注释格式:`# TODO(作者): 具体待办事项描述`
- 禁止无意义注释

## 格式规范

- 统一使用 2 空格缩进
- 单行代码长度不超过 98 字符
- 函数体长度不超过 30 行
- 使用 `mix format` 格式化代码
- 使用 `credo` 检查代码质量
- 使用 `dialyzer` 类型检查

## 代码质量强制要求

- 禁止魔法值:常量必须定义为模块属性
- 必须处理 `{:error, reason}` 返回值
- GenServer 必须实现 `child_spec/1`
- 禁止使用 `Process.put/get`(全局进程字典)
- 必须使用 `@spec` 声明类型签名
- 禁止过深的嵌套(使用 `with` 替代)

## 测试规范

- 使用 ExUnit 测试框架
- 测试文件命名:`{模块名}_test.exs`
- 使用 `setup` 准备测试数据
- Mock 使用 Mox 库
- 覆盖率目标:核心逻辑 80%+

## 最佳实践

- 使用 Phoenix 开发 Web 应用
- 使用 LiveView 实现实时交互
- 使用 Ecto 数据库访问
- 使用 Oban 处理后台任务
- 使用 Phoenix PubSub 进程间通信

Versions

RepositoryScoreLicence
This page · dkbnull/hello-skill86MIT
ericrisco/rsc-harness100MIT
TerminalSkills/skills100Apache-2.0
G1Joshi/Agent-Skills100MIT
georgeguimaraes/claude-code-elixir100Apache-2.0
j4flmao/agent-skills95MIT
j4flmao/agent-skills95MIT

Database snapshot: 13.11.2026 · package version 46732c4c620d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95using-elixir-skills
    This skill should be used when the user works on any .ex or .exs file, mentions Elixir/Phoenix/Ecto/OTP, the project has a mix.exs, or asks "which skill should I use", "new to Elixir", "help with Elixir". Routes to the correct thinking skill BEFORE exploring code. Triggers on…
  • 95sentry-elixir-sdk
    Full Sentry SDK setup for Elixir. Use when asked to "add Sentry to Elixir", "install sentry for Elixir", or configure error monitoring, tracing, logging, or crons for Elixir, Phoenix, or Plug applications. Supports Phoenix, Plug, LiveView, Oban, and Quantum.
  • 100elixir-expert
    Expert-level Elixir, Phoenix, OTP, and concurrent systems. Use when the user mentions Phoenix, OTP, Erlang, concurrent, or functional, or when the task involves Elixir Fundamentals or Phoenix Framework.
  • 90estack-review
    Review an Elixir/Phoenix diff for correctness, security, concurrency, and regressions. Use when reviewing a PR or checking changes before committing or deployment.
  • 90elixir-pro
    Write idiomatic Elixir code with OTP patterns, supervision trees, and Phoenix LiveView. Masters concurrency, fault tolerance, and distributed systems. Use for Elixir refactoring, OTP design, or complex BEAM optimizations.
  • 100programming-elixir
    Elixir and Phoenix practices: pattern matching, supervision, process lifecycle, concurrency design. Use when writing or reviewing a mix.exs project.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.