技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
adversarial-reactor【数据与研究】Use this skill to gate Elixir code built on the Reactor orchestration library (~> 1.0) with a pass/fail adversarial review — a single blind reviewer subagent judges a diff or file set against 28 decidable rules covering saga compensation and undo (side effects without undo, cleanup in the wrong callback, compensate returns that roll back vs continue,…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
A saga/dataflow-orchestration review gate for Elixir code built on Reactor — 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 assumes guarantees Reactor never made — that rollback is automatic, that cleanup in compensate fires on downstream failure, that :ok absorbs an error, that steps run in the order they were written, that :retry is bounded by default, that {:halt, reason} aborts, that map steps parallelize, that process-local state follows a step into its task process. These bugs compile cleanly, pass happy-path tests, and surface as orphaned payments, infinite retry loops, and races. Each rule carries an Evidence of violation paragraph so a reviewer can decide PASS/FAIL/N/A from artifact evidence alone. The sibling gates judge different layers: adversarial-elixir paradigm fit, adversarial-beam runtime semantics — run them alongside for full coverage of OTP-shaped work.
use Reactor modules, Reactor.Step implementations, Reactor.run call sites) is about to merge and needs an objective PASS/FAIL on its orchestration semantics.Do not apply to targets with no Reactor usage (the reviewer prompt's precondition aborts with "GATE NOT APPLICABLE"), or when the user wants explanations and refactors rather than a verdict. General OTP/BEAM concerns (supervision, PubSub, ETS) belong to adversarial-beam; Elixir paradigm fit belongs to adversarial-elixir.
Follow these steps exactly — the gate's value is that every review runs the same way.
mix.exs, mix.lock, test_helper.exs) — Reactor version, Ecto/sandbox presence, mocking library, telemetry consumers. Include the repo root in the target description — several rules must search beyond the diff for mounted step modules' callbacks, Reactor.run call sites, and middleware modules (the reviewer prompt lists them).references/ (all saga-*.md, retry-*.md, dep-*.md, step-*.md, comp-*.md, conc-*.md, obs-*.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 wrong assumption it gates |
|---|---|---|---|
| 1 | Saga Compensation & Undo | saga- | "Rollback is automatic" — side effects without undo/4, cleanup in compensate (fires on the step's own failure, receives the error), :ok believed to absorb errors (only {:continue, value} does), undo that breaks on re-execution |
| 2 | Retry Discipline | retry- | ":retry is safe" — catch-all retries under the max_retries :infinity DSL default, retrying deterministic business failures, immediate-retry hot loops with no backoff/4 |
| 3 | Dependency & Data Flow | dep- | "Steps run in the order I wrote them" — ordered side effects without argument/wait_for edges, inter-step data smuggled through context (no edge, races), fake unused arguments, multi-step reactors without return |
| 4 | Step Contracts | step- | Wrong callback shapes — non-documented run/3 returns treated as failure, {:halt, reason} as an error signal (it pauses, skips rollback), boolean guards / :cont from where, skip-conditionals inlined in run, side effects in unmockable inline fns |
| 5 | Composition & Iteration | comp- | Hand-rolling what the DSL plans — Reactor.run inside steps (child escapes parent rollback), Enum loops over map steps, case side-effect branching over switch, recurse without max_iterations, materialized datasets as map sources |
| 6 | Concurrency & Process Context | conc- | "Async just works" — map's allow_async? defaults false (serial), sandbox tests without async?: false, process-local state lost across the task boundary, async? false scattering instead of run-level max_concurrency |
| 7 | Observability & Middleware | obs- | Lifecycle logging hand-rolled in steps when Reactor.Middleware.Telemetry emits it all, middleware callbacks returning bare values, I/O inside event/3 on the executor's critical path |
Read gotchas.md before dispatching the reviewer — it pre-records scope guards (shapes-not-brands, what counts as a side effect, the diff-vs-repo search obligations) so the reviewer does not judge outside the rules.
adversarial-beam — the runtime-semantics sibling gate: supervision, backpressure, event delivery, shared state, distribution. A Reactor workflow lives inside an OTP app; run both on substantial work.adversarial-elixir — the paradigm-fit sibling gate: OO/enterprise habits ported onto the BEAM. Same protocol, complementary rules.staff-level-elixir — the advisory sibling: greenfield "which tool, which convention" guidance and judgment calls the gates deliberately exclude. Use it to write or fix code; use the gates to verdict it.| 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 |