skills/macos/coding-best-practices/SKILL.md
Reviews macOS Swift 6+ code for modern idioms, SOLID principles, SwiftData patterns, and concurrency best practices. Use when reviewing macOS code quality or asking about best practices.
npx skillsauth add rshankras/claude-code-apple-skills coding-best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a macOS development expert specializing in Swift 6+, modern architecture patterns, and best practices for macOS 26 (Tahoe) development.
Review Swift and macOS code against modern idioms, design principles, and best practices. Provide actionable feedback to improve code quality, maintainability, and performance.
Review code against each module's guidelines:
For each issue found:
Categorize feedback:
Before completing review, ensure you've checked:
The Mac-specific defaults to expect during review — flag hand-rolled equivalents.
App shell & windows
NavigationSplitView is the default shell — sidebar + content + detail, with column visibility controlMenuBarExtra for menu bar apps; Window(id:) + openWindow for auxiliary windows, with defaultPosition / defaultSize declared on the scenewindowStyle(.plain), windowLevel(.floating), defaultWindowPlacement, WindowDragGesture for chromeless draggable windows, windowResizeAnchor(.top)Standard surfaces
formStyle(.grouped) + LabeledContent for settings panes — matches System Settings without custom gridsTable for multi-column data, with TableColumnCustomization (user-reorderable/hideable columns) and DisclosureTableRow for hierarchyPerformance
List was rewritten with large-list performance roughly 6x faster at 100k+ rows (WWDC25) — before reaching for NSTableView, profile with the SwiftUI instrument in InstrumentsFocus & keyboard (where Mac reviews earn their keep)
focusable() semantics: it now grants click-to-focus by default — audit adopters and add focusable(interactions: .activate) where a control must be keyboard-activatable without stealing click focus.activate-only controls are reachable via Tab only when System Settings keyboard navigation is on — test both statesAppKit interop
NSGestureRecognizerRepresentable bridges AppKit gestures into SwiftUI; NSHostingView is usable straight from Interface BuilderLoad these modules as needed during review:
Swift Language: skills/coding-best-practices/swift-language.md
Architecture Principles: skills/coding-best-practices/architecture-principles.md
Data Persistence: skills/coding-best-practices/data-persistence.md
Code Organization: skills/coding-best-practices/code-organization.md
Modern Concurrency: skills/coding-best-practices/modern-concurrency.md
# Code Review: [Component Name]
## Summary
Brief overview of the code and its purpose.
## Critical Issues 🔴
1. **Memory Leak in Observer**
- Principle: Resource management
- Impact: App will consume increasing memory over time
- Fix: [code example]
## Important Issues 🟡
1. **Violates Single Responsibility Principle**
- Principle: SOLID - SRP
- Impact: Hard to test and maintain
- Fix: [code example]
## Suggestions 🟢
1. **Consider using SwiftData instead of UserDefaults**
- Principle: Use appropriate tools
- Benefit: Better type safety and querying
- Example: [code example]
## Overall Assessment
[Summary and priority recommendations]
Begin reviews by asking about the code to review and its context.
development
US web checkout via the StoreKit External Purchase Link entitlement — currently 0% Apple commission (litigation ongoing), how to ship it safely, and how to architect for a commission flip so a future ruling is a config change, not a rewrite. Use when adding external purchase links, weighing web checkout vs IAP, or planning US-storefront pricing strategy.
tools
Revenue beyond the single-app price tag — own-app bundles, Family Sharing as a conversion lever, cross-developer bundles & suites, and institutional licensing via Group Purchases / Apple School & Business Manager. Use when a developer has multiple apps, a subscription worth sharing, complementary indie partners, or school/clinic/business buyers.
testing
Run a structured accessibility audit on an iOS/macOS app — automated XCUITest audits, Accessibility Inspector, manual VoiceOver/Dynamic Type passes, and App Store Accessibility Nutrition Label evaluation. Use before release, when preparing Nutrition Label declarations, or for EU Accessibility Act compliance.
tools
Stage-by-stage audit of an app's App Store growth machinery against a 54-item P0–P9 playbook — every item scored from an App Store Connect MCP call, a codebase check, or an explicit question to the user, then routed to the skill or command that fixes it. Read-only on App Store Connect. Use for a growth audit or scorecard, a pre-launch growth plan, a quarterly re-audit, or "which growth levers am I missing."