agentleFS
anhnguyen0905anhnguyen0905/codex-mcp/skills/exec-swift/SKILL.md

exec-swift

Skill4 starsChanged 5 days agoMITView on GitHub

Swift execution idioms to embed into Codex prompts when the target project is Swift — optionals, value semantics, Swift Concurrency, and error handling.

The file

Files
SKILL.md

Swift Idioms (embed when project is Swift)

Swift standards:
- Optionals: no force-unwrap (!) or try! in production paths; use if let / guard let / ??; guard for
  early exit at the top of functions. Model absence with Optional, not sentinel values.
- Errors: throwing functions + do/try/catch with typed error enums; never empty catch; use Result
  only at async/callback boundaries. Propagate, don't swallow.
- Value semantics: prefer struct/enum over class unless reference identity is needed; let over var;
  immutable properties by default; mutating methods explicit on value types.
- Swift Concurrency: async/await + structured concurrency (async let, TaskGroup); actors for shared
  mutable state; respect @MainActor for UI; propagate cancellation (Task.checkCancellation); avoid
  unstructured Task {} that outlives its scope. No blocking calls on the main thread.
- Protocol-oriented design: small protocols, protocol extensions for defaults; avoid forced downcasts
  (as!). Use generics/some over type erasure unless erasure is required.
- Memory: [weak self]/[unowned self] in escaping closures to avoid retain cycles; break cycles in
  delegates (weak).
- Follow the project's SwiftFormat/SwiftLint config and file/folder structure; SwiftUI or UIKit
  idioms as the project uses them.
- Tests: XCTest (or Swift Testing if the repo uses it); given-when-then; test behavior; match the
  existing test target layout and naming.

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.