Skip to content
Back to skills

Rules Swift

ASecurity

ANVIL coding rules for swift code (**/*.swift, **/*Tests.swift, Tests/**/*.swift): Swift, Swift Testing.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsswifttesting

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill rules-swift --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rules Swift?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rules Swift
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-rules-swift/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-rules-swift)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rules-swift
description: "ANVIL coding rules for swift code (**/*.swift, **/*Tests.swift, Tests/**/*.swift): Swift, Swift Testing."
---

<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->

# ANVIL rules: swift

Follow these rules for swift code (**/*.swift, **/*Tests.swift, Tests/**/*.swift).

## Swift

# Swift
- No force unwraps outside tests; `guard` for early exits.
- Structured concurrency; `@MainActor` for UI.
- Keychain for secrets.

## Swift Testing

# Swift Testing

- Use Swift Testing (`@Test`, `#expect`, `#require`) or `XCTest` consistently with value-based assertions instead of optional chaining silently skipping checks.
- Inject protocol-backed services and mocked `URLProtocol` handlers instead of real network requests or `Task.sleep` timings.
- Isolate `UserDefaults` / Keychain wrappers per suite and mark async actor/main-thread UI tests explicitly (`@MainActor`).
- Never leave force unwraps (`!`) unchecked in setup when `XCTUnwrap` or `#require` gives a clear failure line.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.