using-elixir-skills
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<EXTREMELY-IMPORTANT>
If the task involves Elixir, Phoenix, or OTP code, you MUST invoke the relevant skill BEFORE doing ANYTHING else—including exploring the codebase.
THIS IS NOT OPTIONAL. Skills tell you HOW to explore and WHAT to look for. You cannot rationalize your way out of this.
</EXTREMELY-IMPORTANT>
<EXTREMELY-IMPORTANT>
如果任务涉及Elixir、Phoenix或OTP代码,你必须先调用相关技能,再进行任何操作——包括查看代码库。
这并非可选步骤。技能会告诉你如何查看代码以及需要关注哪些内容。你不能跳过这一步。
</EXTREMELY-IMPORTANT>
The Rule
规则
Elixir/Phoenix/OTP task → Invoke skill FIRST → Then explore/research → Then write codeSkills come before exploration. The skills tell you what patterns to look for, what questions to ask, and what anti-patterns to avoid. Exploring without the skill means you don't know what you're looking for.
Elixir/Phoenix/OTP任务 → 先调用技能 → 再查看/调研 → 然后编写代码技能优先于查看代码。技能会告诉你需要寻找哪些模式、提出哪些问题以及避免哪些反模式。不调用技能就直接查看代码意味着你不知道自己要找什么。
Skill Triggers
技能触发条件
| Trigger Phrases | Skill to Invoke |
|---|---|
| code, implement, write, design, architecture, structure, pattern | |
| LiveView, Plug, PubSub, mount, channel, socket, component | |
| context, schema, Ecto, changeset, preload, Repo, migration | |
| GenServer, supervisor, Task, ETS, bottleneck, Broadway | |
| Oban, workflow, job queue, cascade, graft, background job, async job | |
| 触发短语 | 需调用的技能 |
|---|---|
| code, implement, write, design, architecture, structure, pattern | |
| LiveView, Plug, PubSub, mount, channel, socket, component | |
| context, schema, Ecto, changeset, preload, Repo, migration | |
| GenServer, supervisor, Task, ETS, bottleneck, Broadway | |
| Oban, workflow, job queue, cascade, graft, background job, async job | |
Red Flags
警示信号
These thoughts mean STOP—invoke the skill:
| Thought | Reality |
|---|---|
| "Let me explore the codebase first" | Skills tell you WHAT to look for. Invoke first. |
| "Let me understand the code first" | Skills guide understanding. Invoke first. |
| "But first, let me..." | No. Skills come first. Always. |
| "I'll add a process to organize this" | Processes are for runtime, not organization. |
| "GenServer is the Elixir way" | GenServer is a bottleneck by design. |
| "I'll query in mount" | mount is called twice. |
| "Task.async is simpler" | Use Task.Supervisor in production. |
| "I know Elixir well enough" | These skills contain paradigm shifts. Invoke them. |
出现以下想法时请立即停止——调用技能:
| 想法 | 实际情况 |
|---|---|
| “我先查看一下代码库” | 技能会告诉你需要关注什么内容。先调用技能。 |
| “我先理解一下代码” | 技能会引导你理解代码。先调用技能。 |
| “不过先让我……” | 不行。技能永远优先。 |
| “我要添加一个进程来整理这个” | 进程是用于运行时的,不是用于整理的。 |
| “GenServer是Elixir的标准做法” | GenServer在设计上就是性能瓶颈。 |
| “我要在mount中查询” | mount会被调用两次。 |
| “Task.async更简单” | 生产环境中请使用Task.Supervisor。 |
| “我对Elixir足够熟悉了” | 这些技能包含范式转变。请调用它们。 |