swift-best-practices
Swift Best Practices
Apply official Swift API Design Guidelines and community best practices when writing, reviewing, or auditing Swift codebases.
Scope boundaries
This skill covers core Swift language fundamentals. It does not cover:
- Concurrency (async/await, actors, Sendable, tasks) — use
swift-concurrency. - SwiftUI (views, state management, layout, animations) — use
swiftui-expert-skill.
When a topic touches a boundary (e.g., memory management in tasks, testing async code), defer to the specialized skill and cross-reference it.
Rule loading order
- Read
rules/swift-api-design-naming.md. - Read
rules/swift-value-vs-reference-types.md. - Read
rules/swift-optionals.md. - Read
rules/swift-error-handling.md. - Read
rules/swift-protocols-generics.md. - Read
rules/swift-property-wrappers-result-builders.md. - Read
rules/swift-memory-management.md. - Read
rules/swift-performance.md. - Read
rules/swift-modern-features.md. - Read
rules/swift-testing.md. - Read
rules/swift-package-manager.md. - Read
rules/swift-code-organization.md. - Read
rules/swift-common-pitfalls.md. - Use
AGENTS.mdas a compact summary plus pointer.
Enforcement policy
- Use recommendation-first language for style, naming, and organizational guidance.
- Use strict language (
must/must not) only for memory safety, type safety, or runtime failure prevention. - Prefer the official Swift API Design Guidelines (swift.org/documentation/api-design-guidelines) and The Swift Programming Language book when resolving conflicts; update these rules when best practices evolve.
- For concurrency topics, defer to
swift-concurrency. For SwiftUI topics, defer toswiftui-expert-skill.
More from jackkkonggg/skills
gsap-best-practices
Use when writing, reviewing, or refactoring GSAP animation code in JavaScript/TypeScript (tweens, timelines, ScrollTrigger, matchMedia, plugin usage, and performance tuning) to enforce production-safe animation patterns.
13react-gsap-best-practices
Use when building, reviewing, or refactoring React components that use GSAP or @gsap/react (useGSAP, contextSafe, dependency-driven updates, ScrollTrigger integration, and SSR-safe setup) to enforce production-safe animation patterns.
8convex-best-practices
Use when writing, reviewing, or refactoring Convex backend code (queries, mutations, actions, HTTP actions, schema, indexes, scheduling, file storage, and search) to enforce production-safe patterns.
7code-audit
Use when auditing a codebase against best practices. Auto-detects technologies, loads relevant docs via Context7 MCP and installed skills, evaluates code systematically, and produces a prioritized findings report with optional auto-fix.
1typescript-clean-code
Use when writing, reviewing, or refactoring TypeScript code to enforce Clean Code principles — naming, functions, types, error handling, modules, testing, comments, and code smells — adapted for idiomatic TypeScript.
1grammy-best-practices
Use when writing, reviewing, or refactoring grammY Telegram bots in Node.js/TypeScript (middleware, commands, filters, sessions, conversations, API transformers, files/media handling, flood-limit control, runner concurrency, webhooks, and deployment operations) to enforce production-safe patterns.
1