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.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- maintainers/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- buying-researcherSkill
- cursor-cloud-agents-whenSkill
- debug-anthropicSkill
- debug-pocockSkill
- debugSkill
- discover-the-ideaSkill
- docs-google-styleSkill
- golang-safetySkill
- golang-securitySkill
- golang-testingSkill
- grok-acpSkill
- host-config-pyinfraSkill
- lang-cppSkill
- lang-csharpSkill
- lang-cSkill
- lang-dartSkill
- lang-dockerSkill
- lang-goSkill
- lang-javaSkill
- lang-js-tsSkill
- lang-kotlinSkill
- lang-luaSkill
- lang-makefileSkill
- lang-phpSkill
- lang-powershellSkill
- lang-protobufSkill
- lang-pythonSkill
- lang-rubySkill
- lang-rustSkill
- lang-shellSkill
- lang-sqlSkill
- lang-terraformSkill
- language-routerSkill
- lang-web-markupSkill
- modern-pythonSkill
- pr-reviewSkill
- sdlc-artifactsSkill
- sdlc-onboardingSkill
- security-hardeningSkill
- shell-safetySkill
- tddSkill
- tracker-sdlcSkill
- ui-craftSkill
- ux-designSkill
- verify-before-doneSkill
- yagniSkill
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
- Distinctive: line 41
Do not cross isolation domains with unsound types.
- Very specific: line 47
Test optionals via guard / #expect, not !
- Distinctive: line 59
No string-built SQL or shell.
≈ “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.
Files
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 usesIdioms a linter misses
letdefault.guard/if letover!.- 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 (
internaldefault is fine;publicis a contract).
Errors
throws/Resultas 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.
Taskhas a cancellation story. Do not ignoreTask.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 (
selfin 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
!andtry!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"
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
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.

