技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
adversarial-elixir【数据与研究】Use this skill to gate Elixir, OTP, Ecto, and Phoenix code with a pass/fail adversarial review — a single blind reviewer subagent judges a diff or file set against 19 decidable rules that catch architecture ported from an alien paradigm, covering enterprise layering (repository wrappers over Ecto, service-object tiers, DI behaviours with a single imp…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
An Elixir/OTP/Ecto/Phoenix review gate — pass/fail: a single blind reviewer subagent judges the work against this gate's rules with an adversarial mandate, and the work passes only when every rule is PASS or N/A. This skill renders verdicts; it never fixes the work.
The rules target one failure mode: code that imported the wrong mental model onto the BEAM — OO/enterprise layering, processes treated as objects, anemic data, defensive control flow, transliterated loops, and needless metaprogramming. They are grounded in the official Elixir anti-pattern catalogs and each carries an Evidence of violation paragraph so a reviewer can decide PASS/FAIL/N/A from artifact evidence alone. Judgment-call refactor guidance stays in the advisory sibling staff-level-elixir.
*Service/*Manager tiers, a GenServer per entity, DI behaviours for a single implementation, raise/rescue as an if.Do not apply to non-Elixir codebases (the reviewer prompt's precondition aborts with "GATE NOT APPLICABLE"), or when the user wants explanations and refactors rather than a verdict — that is staff-level-elixir's job. arch-delete-repository-over-ecto goes N/A when the target has no Ecto; flow-normalize-at-boundary goes N/A when the target has no external-input path. Remedies newer than the project's Elixir version are judged against the nearest available remedy — the reviewer prompt carries the version-gate table.
Follow these steps exactly — the gate's value is that every review runs the same way.
mix.exs — the elixir: requirement, Phoenix/Ecto presence). Include the repo root in the target description — arch-drop-di-behaviour-single-impl, type-protocol-over-type-dispatch, proc-consolidate-interface, and meta-use-is-not-import require searching beyond the diff for implementing modules, duplicate dispatch sites, callback owners, and __using__ bodies.references/ (all arch-*.md, proc-*.md, type-*.md, flow-*.md, iter-*.md, meta-*.md files).If the same rule flips verdicts across re-reviews of an unchanged target, or a human reads the evidence and overrides the verdict, that is a decidability bug in the rule — record it in gotchas.md and sharpen the rule; do not override the gate.
The reviewer returns, per rule: PASS | FAIL | N/A, evidence (file:line or a quote — required for PASS as well as FAIL), and for every FAIL, the fix that flips the rule to PASS once applied — the named change plus its location, never a restatement of the violation. The final report follows assets/templates/verdict.md.
| # | Category | Prefix | The alien model it gates |
|---|---|---|---|
| 1 | Enterprise Ceremony & Layering | arch- | Repository/DAO wrappers over Ecto, per-entity *Service/*Manager modules, DI behaviours with one implementation, domain decisions computed inside effectful callbacks |
| 2 | Processes as Objects | proc- | GenServer-per-entity mirroring DB rows, Agents as mutable variables, message tuples leaked outside the owning module, globally-named singleton managers over partitionable state |
| 3 | Anemic Data Modeling | type- | Fixed-shape bare maps passed as entities, multi-boolean and stringly state, type-tag dispatch duplicated across modules, structs at the 32-field runtime cliff |
| 4 | Defensive Control Flow | flow- | raise/rescue converting expected outcomes into branches, nil-guards that silently swallow required values, raw external input re-checked through the core |
| 5 | Imperative Iteration | iter- | reduce/recursion reimplementing a nameable Enum combinator — FAIL requires naming the exact replacement |
| 6 | Needless Metaprogramming & Coupling | meta- | First-party macro DSLs that encode plain data, __using__ bodies that only import, module attributes calling other modules at compile time |
Read gotchas.md before dispatching reviewers — it pre-records scope guards (style lore reviewers try to import, the two name-the-replacement rules, the numeric god-struct line) so reviewers do not judge outside the rules.
staff-level-elixir — the advisory sibling: greenfield "which tool, which convention" guidance and the judgment calls this gate deliberately excludes. Use it to write or fix code; use this gate to verdict it.elixir-meta-programming — how to build macros/DSLs correctly once one is genuinely warranted (the complement to this gate's meta- rules).adversarial-swift / adversarial-rust / adversarial-zod / adversarial-ts-patterns / adversarial-tanstack — sibling gates for other stacks; same protocol, different rules.| File | Description |
|---|---|
| references/reviewer-prompt.md | Self-contained prompt template for each blind reviewer |
| assets/templates/verdict.md | Verdict report template |
| references/_sections.md | Category definitions and ordering |
| metadata.json | Version and source references |