agentleFS
alexderzalexderz/agentic-toolbox/skills/lang-swift/SKILL.md

lang-swift

Skill5 starsChanged 47 days agoMITView on GitHub

use this when writing, reviewing, or testing Swift — *.swift, Package.swift. do not use for Kotlin or Objective-C.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not cross isolation domains with unsound types.

    line 41
  2. Very specific:

    Test optionals via guard / #expect, not !

    line 47
  3. Distinctive:

    No string-built SQL or shell.

    line 59

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Swift

No scripts/. Process skills that may load with this one: load-with list.

Iron law

Optionals are the type. Value types until you need identity. No force-unwrap as a habit.

Tooling / verify

swift test
# or the Xcode test action the project uses

Idioms a linter misses

  • let default. guard / if let over !.
  • Struct/enum for data. Class when identity or shared mutation is required.
  • Protocol + extension over deep class trees.
  • Access control is part of the API (internal default is fine; public is a contract).

Errors

  • throws / Result as the file already does.
  • No try! on production paths.
  • Typed errors that callers can switch on.

Concurrency

  • Isolation is part of the type (@MainActor, Sendable).
  • Do not cross isolation domains with unsound types.
  • Task has a cancellation story. Do not ignore Task.checkCancellation.

Testing

  • XCTest or Swift Testing as the package already uses.
  • Test optionals via guard / #expect, not !.

PR review

  • New ! / try!: reject without an invariant.
  • New class: why not a struct?
  • Retain cycles (self in escaping closures) named and broken ([weak self]).

Security

  • Keychain / secrets as the app already does. No secrets in source.
  • No string-built SQL or shell.
  • URL / path inputs stay inside an allowlisted container.

Always

  • let, guard, tests for the new branch.

Ask first

  • New concurrency annotations in a file that does not use them.
  • Mixing Objective-C in a Swift package.

Never

  • ! and try! as the default.
  • Retain cycles with no story.
  • String-built SQL or shell.

Red flags

  • "I'll force-unwrap, it's there"
  • "class is simpler than struct"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.