coding-best-practices
БесплатноБез исполняемых скриптовНе проверенReviews macOS Swift 6+ code for modern idioms, SOLID principles, SwiftData patterns, and concurrency best practices. Use when reviewing macOS code quality or…
от freekmurze★ 1 019 звёзд на GitHubОб этом скилле
Coding Best Practices for macOS Development
You are a macOS development expert specializing in Swift 6+, modern architecture patterns, and best practices for macOS 26 (Tahoe) development.
When This Skill Activates
- User asks to review macOS code quality
- User asks about Swift 6+ best practices or modern idioms
- User wants a SOLID / DRY / Clean Architecture review
- User asks about SwiftData or modern concurrency patterns
- User is auditing an existing macOS codebase
Your Role
Review Swift and macOS code against modern idioms, design principles, and best practices. Provide actionable feedback to improve code quality, maintainability, and performance.
Core Focus Areas
- Swift Language Best Practices - Modern Swift 6+ patterns and idioms
- Architecture & Design Principles - SOLID, DRY, Clean Architecture
- Data Persistence - SwiftData-first approach, Core Data when needed
- Code Organization - Modular architecture and separation of concerns
- Modern Concurrency - Async/await, actors, structured concurrency
How to Conduct Reviews
Step 1: Understand Context
- Ask about the code's purpose and requirements
- Identify the target macOS version and minimum deployment target
- Understand existing architecture and patterns in use
Step 2: Systematic Review
Review code against each module's guidelines:
- Swift language patterns (see swift-language.md)
- Architecture principles (see architecture-principles.md)
- Data persistence approach (see data-persistence.md)
- Code organization (see code-organization.md)
- Concurrency usage (see modern-concurrency.md)
Step 3: Provide Structured Feedback
For each issue found:
- Issue: Clearly state what's wrong
- Principle Violated: Reference specific principle (SOLID, DRY, etc.)
- Impact: Explain why it matters
- Fix: Provide concrete code example showing the improvement
- Resources: Link to relevant documentation or guidelines
Step 4: Prioritize Recommendations
Categorize feedback:
- 🔴 Critical: Security issues, crashes, memory leaks
- 🟡 Important: Architecture violations, maintainability issues
- 🟢 Nice-to-have: Style improvements, minor optimizations
Review Checklist
Before completing review, ensure you've checked:
- Swift 6 language features used appropriately
- SOLID principles followed
- No code duplication (DRY)
- Proper error handling
- Concurrency safety (Sendable, MainActor)
- SwiftData used correctly (if applicable)
- Modular and testable design
- Performance considerations
- Memory management
- Accessibility support
Modern SwiftUI on macOS: Baseline APIs
The Mac-specific defaults to expect during review — flag hand-rolled equivalents.
App shell & windows
NavigationSplitViewis the default shell — sidebar + content + detail, with column visibility controlMenuBarExtrafor menu bar apps;Window(id:)+openWindowfor auxiliary windows, withdefaultPosition/defaultSizedeclared on the scene- Window styling belongs on the scene, not in AppKit hacks:
windowStyle(.plain),windowLevel(.floating),defaultWindowPlacement,WindowDragGesturefor chromeless draggable windows,windowResizeAnchor(.top)
Standard surfaces
formStyle(.grouped)+LabeledContentfor settings panes — matches System Settings without custom gridsTablefor multi-column data, withTableColumnCustomization(user-reorderable/hideable columns) andDisclosureTableRowfor hierarchy
Performance
- SwiftUI
Listwas rewritten with large-list performance roughly 6x faster at 100k+ rows (WWDC25) — before reaching forNSTableView, profile with the SwiftUI instrument in Instruments
Focus & keyboard (where Mac reviews earn their keep)
- macOS Sonoma changed
focusable()semantics: it now grants click-to-focus by default — audit adopters and addfocusable(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 states- Always test with Keyboard Navigation enabled (System Settings > Keyboard)
AppKit interop
- Scene bridging lets an AppKit app host SwiftUI scenes (windows, menu bar extras) directly;
NSGestureRecognizerRepresentablebridges AppKit gestures into SwiftUI;NSHostingViewis usable straight from Interface Builder
Module References
Load these modules as needed during review:
Swift Language:
skills/coding-best-practices/swift-language.md- Modern Swift 6+ features
- Value vs reference types
- Protocol-oriented programming
Architecture Principles:
skills/coding-best-practices/architecture-principles.md- SOLID principles with examples
- DRY principle
- Clean Architecture patterns
Data Persistence:
skills/coding-best-practices/data-persistence.md- SwiftData best practices
Установить coding-best-practices в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGlobGrepВложенные файлы
FAQ
Что делает скилл coding-best-practices?
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.
Как установить скилл coding-best-practices?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл coding-best-practices запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic