Individual skill
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(),
skills/.experimental/adversarial-swift/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 222
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- engineering Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 11,932 bytesSKILL.mdcore · 11,932 bytesSKILL.mdcore · 11,932 bytesassets/templates/verdict.mddoc · 2,144 bytesgotchas.mddoc · 6,952 bytesmetadata.jsonasset · 1,119 bytesreferences/_sections.mddoc · 5,203 bytesreferences/api-autoclosure-conditional-params.mddoc · 2,469 bytesreferences/api-final-or-private-classes.mddoc · 2,152 bytesreferences/api-memberwise-init-via-extension.mddoc · 2,405 bytesreferences/api-never-for-nonreturning-paths.mddoc · 2,807 bytesreferences/api-opaque-return-over-concrete-nesting.mddoc · 2,966 bytesreferences/api-optionset-over-boolean-rows.mddoc · 2,393 bytesreferences/api-unavailable-on-fatalerror-stubs.mddoc · 2,372 bytesreferences/coll-count-where-over-filter-count.mddoc · 1,441 bytesreferences/coll-dictionary-default-subscript.mddoc · 1,705 bytesreferences/coll-mapvalues-value-only-transforms.mddoc · 1,786 bytesreferences/coll-optional-chaining-in-place-mutation.mddoc · 1,790 bytesreferences/coll-reduce-into-accumulators.mddoc · 1,710 bytesreferences/conc-async-let-for-independent-awaits.mddoc · 2,573 bytesreferences/conc-check-cancellation-in-loops.mddoc · 2,704 bytesreferences/conc-concurrent-offload-under-mainactor-default.mddoc · 3,243 bytesreferences/conc-resume-continuation-every-path.mddoc · 3,121 bytesreferences/conc-taskgroup-for-dynamic-fanout.mddoc · 2,840 bytesreferences/enum-caseiterable-over-hand-lists.mddoc · 2,347 bytesreferences/enum-caseless-namespaces.mddoc · 1,997 bytesreferences/enum-derived-comparable-declaration-order.mddoc · 2,931 bytesreferences/enum-unknown-default-external-enums.mddoc · 2,292 bytesreferences/err-callsite-location-default-args.mddoc · 2,581 bytesreferences/err-preserve-underlying-error.mddoc · 2,867 bytesreferences/err-result-get-over-manual-switch.mddoc · 1,633 bytesreferences/err-rethrows-for-closure-only-throws.mddoc · 2,380 bytesreferences/err-warning-directive-for-pending-work.mddoc · 2,025 bytesreferences/flow-branch-assigned-let.mddoc · 2,092 bytesreferences/flow-canimport-over-os-chains.mddoc · 2,242 bytesreferences/flow-raw-strings-escape-heavy.mddoc · 1,348 bytesreferences/flow-take-for-one-shot-optionals.mddoc · 1,706 bytesreferences/flow-validating-untrusted-bytes.mddoc · 2,130 bytesreferences/flow-zip-indices-over-enumerated.mddoc · 2,461 bytesreferences/prop-computed-over-stored-derived.mddoc · 2,607 bytesreferences/prop-defer-observed-init-assignments.mddoc · 2,628 bytesreferences/prop-discard-self-in-consuming-cleanup.mddoc · 2,345 bytesreferences/prop-private-set-internal-mutation.mddoc · 2,647 bytesreferences/reviewer-prompt.mddoc · 6,621 bytes
Read excerpt
# 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.