Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

adversarial-swift

БесплатноБез исполняемых скриптовНе проверен

Use this skill to gate Swift language code with a pass/fail adversarial review — a single blind reviewer subagent judges a diff or file set against 36…

pproencaот pproenca★ 231 звезда на GitHub

Об этом скилле

Adversarial Swift Gate

A Swift language 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 are filtered down to the checks a reviewer can decide from code evidence alone. The gate judges the failure modes agents and experienced-but-not-expert developers actually produce: continuations that hang, loops that ignore cancellation, serialized independent awaits, hand-synchronized derived state, discarded underlying errors, hand-maintained case lists that rot, boolean parameter rows, O(n²) collection accumulation, and index arithmetic that corrupts on slices.

When to Apply

  • A Swift diff, feature, or PR is about to merge and needs an objective PASS/FAIL, not advisory feedback — any target: app logic, server-side Swift, CLI tools, packages.
  • An agent (Claude, Codex) authored the code and you want an independent check that it is not reproducing the classic concurrency and error-handling failure shapes (unresumed continuation branches, try? await Task.sleep posing as a cancellation check, catch blocks that throw payload-free domain cases) or hand-rolling what the compiler synthesizes (CaseIterable, Comparable, memberwise inits, definite-initialization checking).
  • Pre-concurrency or Objective-C-era Swift is being modernized and the ported surface needs auditing against current language affordances (@unknown default, rethrows, canImport, reduce(into:), count(where:), String(validating:)).

Do not apply to non-Swift codebases (the reviewer prompt's precondition aborts with "GATE NOT APPLICABLE"), or when the user wants explanations and refactors rather than a verdict. SwiftUI-specific review (state ownership, view identity, update cost, task lifecycle, lists, accessibility) is owned entirely by the sibling adversarial-swift-ui gate — this gate's rules are framework-independent and stay in scope alongside it. Rules whose remedy needs a newer toolchain than the project's are N/A, not FAIL — the reviewer prompt carries the version-gate table.

Review Protocol

Follow these steps exactly — the gate's value is that every review runs the same way.

Two preconditions before step 1 — both exist because their violation is the gate family's recorded field-failure mode (July 2026: gates run as cleanup drivers on a moving target rendered zero verdicts while the diff grew to 33 files):

  • Frozen target. Dispatch only against a fixed ref — a commit SHA, stash, or saved diff — recorded as the target manifest. If the code under review is still changing (the worktree keeps collecting edits, other agents are active on it), do not dispatch. A target change while the reviewer is in flight voids the run: report GATE VOID — target changed in place of a verdict and re-dispatch against the new frozen state. A dispatched gate must always end in a rendered verdict, a GATE NOT APPLICABLE, or a recorded void — never silence, which is indistinguishable from "reviewed".
  • Verdicts, not cleanup. This gate is a terminal check on finished work. "Run the gate and fix everything aggressively" inverts the contract and is the documented path to scope explosion: implement first, freeze, then gate. After a FAIL, the caller applies fixes within the original target only, and the re-gate dispatches a fresh blind reviewer against the same target manifest — the surface never widens between rounds; new code means a new gate invocation with its own manifest.

When other agents may mutate the workspace mid-review, the reviewer reads the rules from an immutable snapshot (e.g. git archive <ref> <skill-dir> | tar -x -C "$TMPDIR") rather than the live checkout — and skill directories are read-only infrastructure, excluded from every cleanup or fix scope.

  1. Identify the target. Pin down exactly what is under review (a diff, a set of files, a PR) and note the ref/paths so the review runs against an unambiguous, fixed target. Record the stack facts the reviewer prompt requires: Swift toolchain version (from Package.swift or project settings), the target's default actor isolation setting (MainActor default or not — decides conc-concurrent-offload-under-mainactor-default), and any visible warnings-as-errors or TODO-linter conventions (carve-outs for err-warning-directive-for-pending-work). Include the repo root in the target description — enum-unknown-default-external-enums, prop-private-set-internal-mutation, prop-computed-over-stored-derived, enum-caseless-namespaces, api-final-or-private-classes, and api-autoclosure-conditional-params require searching beyond the diff for declaring modules, write sites, instantiations, subclasses, and call sites.
  2. Load the rules. Read references/_sections.md and every rule file in references/ (all conc-*.md, prop-*.md, `err-*.m
Полный SKILL.md на GitHub

Установить adversarial-swift в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

assets/templates/verdict.mdgotchas.mdmetadata.jsonreferences/_sections.mdreferences/api-autoclosure-conditional-params.mdreferences/api-final-or-private-classes.mdreferences/api-memberwise-init-via-extension.mdreferences/api-never-for-nonreturning-paths.mdreferences/api-opaque-return-over-concrete-nesting.mdreferences/api-optionset-over-boolean-rows.mdreferences/api-unavailable-on-fatalerror-stubs.mdreferences/coll-count-where-over-filter-count.mdreferences/coll-dictionary-default-subscript.mdreferences/coll-mapvalues-value-only-transforms.mdreferences/coll-optional-chaining-in-place-mutation.mdreferences/coll-reduce-into-accumulators.mdreferences/conc-async-let-for-independent-awaits.mdreferences/conc-check-cancellation-in-loops.mdreferences/conc-concurrent-offload-under-mainactor-default.mdreferences/conc-resume-continuation-every-path.mdreferences/conc-taskgroup-for-dynamic-fanout.mdreferences/enum-caseiterable-over-hand-lists.mdreferences/enum-caseless-namespaces.mdreferences/enum-derived-comparable-declaration-order.mdreferences/enum-unknown-default-external-enums.mdreferences/err-callsite-location-default-args.mdreferences/err-preserve-underlying-error.mdreferences/err-result-get-over-manual-switch.mdreferences/err-rethrows-for-closure-only-throws.mdreferences/err-warning-directive-for-pending-work.mdreferences/flow-branch-assigned-let.mdreferences/flow-canimport-over-os-chains.mdreferences/flow-raw-strings-escape-heavy.mdreferences/flow-take-for-one-shot-optionals.mdreferences/flow-validating-untrusted-bytes.mdreferences/flow-zip-indices-over-enumerated.mdreferences/prop-computed-over-stored-derived.mdreferences/prop-defer-observed-init-assignments.mdreferences/prop-discard-self-in-consuming-cleanup.mdreferences/prop-private-set-internal-mutation.md

FAQ

Что делает скилл adversarial-swift?

Use this skill to gate Swift language code with a pass/fail adversarial review — a single blind reviewer subagent judges a diff or file set against 36 decidable rules covering concurrency (unresumed continuations, cancellation checks, async let, TaskGroup, @concurrent), property invariants (stored-derived state, private(set), observers skipped in init, discard self), error handling (underlying errors preserved, rethrows, Result.get(),

Как установить скилл adversarial-swift?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл adversarial-swift запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить adversarial-swift с