Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/ndisisnd/cook/swiftnpx skills add ndisisnd/cook --skill swiftgit clone --depth 1 https://github.com/ndisisnd/cookWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ndisisnd/cook/swift)<a href="https://agentmods.dev/skills/ndisisnd/cook/swift"><img src="https://agentmods.dev/badge/skills/ndisisnd/cook/swift.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00056 | $0.01877 |
| Opus 5 | $0.00028 | $0.00938 |
| Sonnet 5 | $0.00011 | $0.00375 |
| Haiku 4.5 | $0.00006 | $0.00188 |
Grade A, and why
swift scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Swift Standards
Default load: this file only; pull refs (see References) on demand.
Swift owns language-level correctness only: optionals, errors, concurrency semantics, value/reference types, protocols and generics, ARC, naming, access control. Platform and app-shape concerns — scenes/windows, SwiftUI architecture, sandboxing, distribution, persistence, localization — live in standards/macos/. Universal rules stay in standards/global/.
Scope: these rules apply in full to new targets and modules. In existing code, match established conventions; propose migrations (language mode, ObservableObject → @Observable, deployment targets, dependency swaps) as separate explicit tasks — never as a side effect of a feature change.
Priority: P0 — Language Correctness
Language Mode, Isolation & Concurrency
P0 rules → refs/concurrency.md — load for any concurrency, isolation, or language-mode task.
Availability
- Gate every API newer than the deployment target with
if #available/@availableand a real fallback path. Annotate declarations rather than sprinkling runtime checks. Never raise the deployment target to dodge a check.
Optionals
- Never force-unwrap (
!) or force-cast (as!) in production paths. If non-nil is a true invariant, useguard let x else { preconditionFailure("why") }so failure carries a message. - No implicitly unwrapped optionals (
T!) in new pure-Swift code; acceptable only for UI-lifecycle objects (@IBOutlet) and Obj-C bridging. guard letfor early-exit preconditions (happy path stays unindented);if letfor genuine branching. Use shorthand:if let user,guard let self.- Prefer
??and optional chaining; neverif x != nilfollowed byx!. - Return empty collections, not optional collections, unless nil vs empty is semantically meaningful.
Error Handling
- Untyped
throwsis the default. Typed throws (throws(E)) only for closed error domains in libraries, generic error propagation (a typed alternative torethrows), and measured hot paths — error domains grow, and typed errors become breaking changes. - Never
try!outside tests.try?only when nil is a genuinely acceptable outcome — never to discard an error that matters. Don't returnnilto signal failure — throw. Resultis for storing an error or crossing a non-throwing boundary — not a general replacement forthrows. Convert withResult(catching:)/.get().- Domain errors are enums/structs with associated values; user-facing errors conform to
LocalizedError, separating user message from debug detail. - Use
deferfor cleanup that must run on every exit path, including thrown errors.
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 127 lines · 56 tokens per session scan A b817b37e2517
swift is a skill published in the GitHub repository ndisisnd/cook (2 stars, last pushed 23d ago), licensed MIT. It adds 56 tokens to every session and 1,877 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
kotlin-specialist
Provides idiomatic Kotlin implementation patterns including coroutine concurrency, Flow stream handling, multiplatform architecture, Compose UI construction, Ktor server setup, and type-safe DSL design. Use when building Kotlin applications requiring coroutines, multiplatform development, or Android with Compose.…
macos-swiftpm
Build, run, and test SwiftPM macOS packages and executables. Use when the repo is package-first or has no Xcode project.
kotlin-tooling-java-to-kotlin
Use when converting Java source files to idiomatic Kotlin, when user mentions "java to kotlin", "j2k", "convert java", "migrate java to kotlin", or when working with .java files that need to become .kt files. Handles framework-aware conversion for Spring, Lombok, Hibernate, Jackson, Micronaut, Quarkus, Dagger/Hilt…
swift-mlx
MLX Swift - High-performance ML framework for Apple Silicon with lazy evaluation, automatic differentiation, and unified memory.
signals-migration-6-to-7
Detailed guidelines, patterns, and rules for migrating codebases from signals.dart version 6.x to version 7.x.
Swift Performance Optimization Skill
Use when investigating measured Swift or Apple-platform regressions in CPU, memory, launch, scrolling, animation hitches, image processing, energy, networking, or concurrency, or when designing performance tests and Instruments experiments. Do not use for speculative micro-optimization, ordinary refactoring, or a…