develop-in-swift
SKILL.md
Develop in Swift Best Practices
Comprehensive guide for Swift and SwiftUI app development, extracted from Apple's official Develop in Swift Tutorials. Contains 41 rules across 13 categories, covering Swift fundamentals through app distribution.
When to Apply
Reference these guidelines when:
- Learning Swift programming language
- Building SwiftUI views and interfaces
- Managing state and data flow
- Working with SwiftData persistence
- Implementing navigation patterns
- Adding accessibility and localization
- Debugging and testing your app
- Preparing for App Store distribution
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Swift Language Fundamentals | CRITICAL | swift- |
| 2 | SwiftUI View Basics | CRITICAL | view- |
| 3 | State & Data Flow | CRITICAL | state- |
| 4 | SwiftData & Persistence | HIGH | data- |
| 5 | Navigation & Presentation | HIGH | nav- |
| 6 | Lists & Dynamic Content | HIGH | list- |
| 7 | User Input & Forms | MEDIUM-HIGH | input- |
| 8 | Testing & Quality | MEDIUM-HIGH | test- |
| 9 | Accessibility & Localization | MEDIUM-HIGH | access- |
| 10 | Debugging & Refinement | MEDIUM | debug- |
| 11 | Machine Learning Integration | MEDIUM | ml- |
| 12 | visionOS & Spatial Computing | MEDIUM | spatial- |
| 13 | App Distribution | LOW | dist- |
Quick Reference
1. Swift Language Fundamentals (CRITICAL)
swift-let-vs-var- Use let for constants, var for variablesswift-structs-vs-classes- Prefer structs over classesswift-camel-case-naming- Use camelCase naming conventionswift-string-interpolation- Use string interpolation for dynamic textswift-functions-clear-names- Name functions and parameters for clarityswift-for-in-loops- Use for-in loops for collectionsswift-optionals- Handle optionals safely with unwrappingswift-closures- Use closures for inline functions
2. SwiftUI View Basics (CRITICAL)
view-body-some-view- Return some View from body propertyview-vstack-hstack-zstack- Use VStack, HStack, ZStack for layoutview-modifier-order-matters- Apply modifiers in correct orderview-custom-properties- Use properties to customize viewsview-preview-macro- Use #Preview for live developmentview-sf-symbols- Use SF Symbols for system iconsview-colors-system- Use system colors for dark mode supportview-gradients- Apply gradients for visual interest
3. State & Data Flow (CRITICAL)
state-state-for-local- Use @State for view-local value typesstate-binding-for-two-way- Use @Binding for two-way data flowstate-observable-for-models- Use @Observable for shared model classesstate-environment-for-system- Use @Environment for system and shared values
4. SwiftData & Persistence (HIGH)
data-model-macro- Use @Model for SwiftData persistencedata-query-for-fetching- Use @Query to fetch SwiftData modelsdata-model-container- Configure modelContainer in app entry pointdata-relationships- Define model relationships with propertiesdata-crud-operations- Perform CRUD with modelContext
5. Navigation & Presentation (HIGH)
nav-navigationstack- Use NavigationStack for hierarchical navigationnav-tabview- Use TabView for top-level sectionsnav-sheets- Use sheets for modal presentation
6. Lists & Dynamic Content (HIGH)
list-foreach-identifiable- Use List and ForEach with Identifiable datalist-swipe-actions- Add swipe actions to list rows
7. User Input & Forms (MEDIUM-HIGH)
input-textfield- Use TextField with binding for text inputinput-buttons-actions- Use Button with action closuresinput-picker-toggle- Use Picker and Toggle for selection input
8. Testing & Quality (MEDIUM-HIGH)
test-swift-testing- Write unit tests with Swift Testing
9. Accessibility & Localization (MEDIUM-HIGH)
access-accessibility-labels- Add accessibility labels to interactive elementsaccess-dynamic-type- Support Dynamic Type for all text
10. Debugging & Refinement (MEDIUM)
debug-breakpoints- Use breakpoints to debug codedebug-console-output- Use debug console for runtime inspection
11. Machine Learning Integration (MEDIUM)
ml-natural-language- Use Natural Language framework for text analysis
12. visionOS & Spatial Computing (MEDIUM)
spatial-visionos-windows- Build visionOS apps with windows
13. App Distribution (LOW)
dist-testflight- Test with TestFlight before release
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
Full Compiled Document
For a complete compiled guide with all rules in a single document, see AGENTS.md.
Reference Files
| File | Description |
|---|---|
| AGENTS.md | Complete compiled guide with all rules |
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
Weekly Installs
3
Repository
pproenca/dot-skillsGitHub Stars
70
First Seen
Feb 6, 2026
Security Audits
Installed on
opencode3
gemini-cli3
antigravity3
claude-code3
windsurf3
codex3