buildanything 1.7.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +55 -0
  4. package/agents/ios-app-review-guardian.md +49 -0
  5. package/agents/ios-foundation-models-specialist.md +46 -0
  6. package/agents/ios-storekit-specialist.md +52 -0
  7. package/agents/ios-swift-architect.md +102 -0
  8. package/agents/ios-swift-search.md +130 -0
  9. package/agents/ios-swift-ui-design.md +104 -0
  10. package/commands/build.md +80 -176
  11. package/commands/fix.md +65 -0
  12. package/commands/setup.md +73 -0
  13. package/commands/ux-review.md +63 -0
  14. package/commands/verify.md +72 -0
  15. package/hooks/session-start +18 -1
  16. package/package.json +5 -2
  17. package/protocols/brainstorm.md +99 -0
  18. package/protocols/build-fix.md +52 -0
  19. package/protocols/cleanup.md +54 -0
  20. package/protocols/design.md +269 -0
  21. package/protocols/eval-harness.md +61 -0
  22. package/protocols/fake-data-detector.md +64 -0
  23. package/protocols/ios-context.md +235 -0
  24. package/protocols/ios-frameworks-map.md +323 -0
  25. package/protocols/ios-phase-branches.md +162 -0
  26. package/protocols/ios-preflight.md +27 -0
  27. package/protocols/metric-loop.md +93 -0
  28. package/protocols/planning.md +87 -0
  29. package/protocols/smoke-test.md +110 -0
  30. package/protocols/verify.md +67 -0
  31. package/protocols/web-phase-branches.md +201 -0
  32. package/skills/ios/_VENDORED.md +60 -0
  33. package/skills/ios/activitykit/LICENSE +131 -0
  34. package/skills/ios/activitykit/SKILL.md +505 -0
  35. package/skills/ios/activitykit/references/activitykit-patterns.md +868 -0
  36. package/skills/ios/app-intents/LICENSE +131 -0
  37. package/skills/ios/app-intents/SKILL.md +494 -0
  38. package/skills/ios/app-intents/references/appintents-advanced.md +1076 -0
  39. package/skills/ios/apple-on-device-ai/LICENSE +131 -0
  40. package/skills/ios/apple-on-device-ai/SKILL.md +505 -0
  41. package/skills/ios/apple-on-device-ai/references/coreml-conversion.md +425 -0
  42. package/skills/ios/apple-on-device-ai/references/coreml-optimization.md +344 -0
  43. package/skills/ios/apple-on-device-ai/references/foundation-models.md +508 -0
  44. package/skills/ios/apple-on-device-ai/references/mlx-swift.md +285 -0
  45. package/skills/ios/ios-26-platform/SKILL.md +53 -0
  46. package/skills/ios/ios-26-platform/references/automatic-adoption.md +161 -0
  47. package/skills/ios/ios-26-platform/references/backward-compat.md +238 -0
  48. package/skills/ios/ios-26-platform/references/liquid-glass.md +255 -0
  49. package/skills/ios/ios-26-platform/references/swiftui-apis.md +277 -0
  50. package/skills/ios/ios-26-platform/references/toolbar-navigation.md +250 -0
  51. package/skills/ios/ios-bootstrap/SKILL.md +98 -0
  52. package/skills/ios/ios-bootstrap/references/apple-docs-mcp-config.md +28 -0
  53. package/skills/ios/ios-bootstrap/references/new-project-dialog.md +41 -0
  54. package/skills/ios/ios-bootstrap/references/xcode-mcp-config.md +29 -0
  55. package/skills/ios/ios-debugger-agent/LICENSE +21 -0
  56. package/skills/ios/ios-debugger-agent/SKILL.md +58 -0
  57. package/skills/ios/ios-debugger-agent/agents/openai.yaml +4 -0
  58. package/skills/ios/ios-entitlements-generator/SKILL.md +47 -0
  59. package/skills/ios/ios-hig/SKILL.md +41 -0
  60. package/skills/ios/ios-hig/references/accessibility.md +81 -0
  61. package/skills/ios/ios-hig/references/content.md +142 -0
  62. package/skills/ios/ios-hig/references/feedback.md +123 -0
  63. package/skills/ios/ios-hig/references/interaction.md +199 -0
  64. package/skills/ios/ios-hig/references/performance-platform.md +129 -0
  65. package/skills/ios/ios-hig/references/privacy-permissions.md +181 -0
  66. package/skills/ios/ios-hig/references/visual-design.md +84 -0
  67. package/skills/ios/ios-info-plist-hardening/SKILL.md +130 -0
  68. package/skills/ios/ios-maestro-flow-author/SKILL.md +68 -0
  69. package/skills/ios/ios-maestro-flow-author/references/input-and-scroll.yaml +17 -0
  70. package/skills/ios/ios-maestro-flow-author/references/modal-and-dismiss.yaml +14 -0
  71. package/skills/ios/ios-maestro-flow-author/references/onboarding-flow.yaml +16 -0
  72. package/skills/ios/ios-maestro-flow-author/references/tab-navigation.yaml +13 -0
  73. package/skills/ios/ios-maestro-flow-author/references/tap-and-assert.yaml +9 -0
  74. package/skills/ios/swift-accessibility/LICENSE +21 -0
  75. package/skills/ios/swift-accessibility/SKILL.md +371 -0
  76. package/skills/ios/swift-accessibility/examples/before-after-appkit.md +446 -0
  77. package/skills/ios/swift-accessibility/examples/before-after-swiftui.md +441 -0
  78. package/skills/ios/swift-accessibility/examples/before-after-uikit.md +464 -0
  79. package/skills/ios/swift-accessibility/references/assistive-access.md +441 -0
  80. package/skills/ios/swift-accessibility/references/display-settings.md +491 -0
  81. package/skills/ios/swift-accessibility/references/dynamic-type.md +420 -0
  82. package/skills/ios/swift-accessibility/references/media-accessibility.md +421 -0
  83. package/skills/ios/swift-accessibility/references/motor-input.md +393 -0
  84. package/skills/ios/swift-accessibility/references/nutrition-labels.md +362 -0
  85. package/skills/ios/swift-accessibility/references/platform-specifics.md +515 -0
  86. package/skills/ios/swift-accessibility/references/semantic-structure.md +585 -0
  87. package/skills/ios/swift-accessibility/references/testing-auditing.md +507 -0
  88. package/skills/ios/swift-accessibility/references/voice-control.md +317 -0
  89. package/skills/ios/swift-accessibility/references/voiceover-swiftui.md +584 -0
  90. package/skills/ios/swift-accessibility/references/voiceover-uikit.md +519 -0
  91. package/skills/ios/swift-accessibility/references/wcag-mapping.md +167 -0
  92. package/skills/ios/swift-accessibility/resources/audit-template.swift +128 -0
  93. package/skills/ios/swift-accessibility/resources/qa-checklist.md +258 -0
  94. package/skills/ios/swift-concurrency/LICENSE +21 -0
  95. package/skills/ios/swift-concurrency/SKILL.md +171 -0
  96. package/skills/ios/swift-concurrency/references/_index.md +50 -0
  97. package/skills/ios/swift-concurrency/references/actors.md +660 -0
  98. package/skills/ios/swift-concurrency/references/async-algorithms.md +847 -0
  99. package/skills/ios/swift-concurrency/references/async-await-basics.md +266 -0
  100. package/skills/ios/swift-concurrency/references/async-sequences.md +710 -0
  101. package/skills/ios/swift-concurrency/references/core-data.md +560 -0
  102. package/skills/ios/swift-concurrency/references/glossary.md +135 -0
  103. package/skills/ios/swift-concurrency/references/linting.md +155 -0
  104. package/skills/ios/swift-concurrency/references/memory-management.md +569 -0
  105. package/skills/ios/swift-concurrency/references/migration.md +1104 -0
  106. package/skills/ios/swift-concurrency/references/performance.md +593 -0
  107. package/skills/ios/swift-concurrency/references/sendable.md +598 -0
  108. package/skills/ios/swift-concurrency/references/tasks.md +636 -0
  109. package/skills/ios/swift-concurrency/references/testing.md +592 -0
  110. package/skills/ios/swift-concurrency/references/threading.md +495 -0
  111. package/skills/ios/swift-security-expert/LICENSE +21 -0
  112. package/skills/ios/swift-security-expert/SKILL.md +470 -0
  113. package/skills/ios/swift-security-expert/references/biometric-authentication.md +565 -0
  114. package/skills/ios/swift-security-expert/references/certificate-trust.md +592 -0
  115. package/skills/ios/swift-security-expert/references/common-anti-patterns.md +690 -0
  116. package/skills/ios/swift-security-expert/references/compliance-owasp-mapping.md +537 -0
  117. package/skills/ios/swift-security-expert/references/credential-storage-patterns.md +721 -0
  118. package/skills/ios/swift-security-expert/references/cryptokit-public-key.md +505 -0
  119. package/skills/ios/swift-security-expert/references/cryptokit-symmetric.md +497 -0
  120. package/skills/ios/swift-security-expert/references/keychain-access-control.md +508 -0
  121. package/skills/ios/swift-security-expert/references/keychain-fundamentals.md +596 -0
  122. package/skills/ios/swift-security-expert/references/keychain-item-classes.md +476 -0
  123. package/skills/ios/swift-security-expert/references/keychain-sharing.md +458 -0
  124. package/skills/ios/swift-security-expert/references/migration-legacy-stores.md +727 -0
  125. package/skills/ios/swift-security-expert/references/secure-enclave.md +539 -0
  126. package/skills/ios/swift-security-expert/references/testing-security-code.md +781 -0
  127. package/skills/ios/swift-testing-expert/LICENSE +21 -0
  128. package/skills/ios/swift-testing-expert/SKILL.md +79 -0
  129. package/skills/ios/swift-testing-expert/references/_index.md +12 -0
  130. package/skills/ios/swift-testing-expert/references/async-testing-and-waiting.md +127 -0
  131. package/skills/ios/swift-testing-expert/references/expectations.md +145 -0
  132. package/skills/ios/swift-testing-expert/references/fundamentals.md +141 -0
  133. package/skills/ios/swift-testing-expert/references/migration-from-xctest.md +127 -0
  134. package/skills/ios/swift-testing-expert/references/parallelization-and-isolation.md +95 -0
  135. package/skills/ios/swift-testing-expert/references/parameterized-testing.md +284 -0
  136. package/skills/ios/swift-testing-expert/references/performance-and-best-practices.md +187 -0
  137. package/skills/ios/swift-testing-expert/references/traits-and-tags.md +114 -0
  138. package/skills/ios/swift-testing-expert/references/xcode-workflows.md +70 -0
  139. package/skills/ios/swiftdata-pro/LICENSE +21 -0
  140. package/skills/ios/swiftdata-pro/SKILL.md +102 -0
  141. package/skills/ios/swiftdata-pro/agents/openai.yaml +10 -0
  142. package/skills/ios/swiftdata-pro/assets/swiftdata-pro-icon.png +0 -0
  143. package/skills/ios/swiftdata-pro/assets/swiftdata-pro-icon.svg +29 -0
  144. package/skills/ios/swiftdata-pro/references/class-inheritance.md +104 -0
  145. package/skills/ios/swiftdata-pro/references/cloudkit.md +10 -0
  146. package/skills/ios/swiftdata-pro/references/core-rules.md +20 -0
  147. package/skills/ios/swiftdata-pro/references/indexing.md +27 -0
  148. package/skills/ios/swiftdata-pro/references/predicates.md +73 -0
  149. package/skills/ios/swiftui-design-principles/AGENTS.md +21 -0
  150. package/skills/ios/swiftui-design-principles/LICENSE +21 -0
  151. package/skills/ios/swiftui-design-principles/README.md +41 -0
  152. package/skills/ios/swiftui-design-principles/SKILL.md +605 -0
  153. package/skills/ios/swiftui-design-principles/metadata.json +10 -0
  154. package/skills/ios/swiftui-liquid-glass/LICENSE +21 -0
  155. package/skills/ios/swiftui-liquid-glass/SKILL.md +95 -0
  156. package/skills/ios/swiftui-liquid-glass/agents/openai.yaml +4 -0
  157. package/skills/ios/swiftui-liquid-glass/references/liquid-glass.md +280 -0
  158. package/skills/ios/swiftui-performance-audit/LICENSE +21 -0
  159. package/skills/ios/swiftui-performance-audit/SKILL.md +111 -0
  160. package/skills/ios/swiftui-performance-audit/agents/openai.yaml +4 -0
  161. package/skills/ios/swiftui-performance-audit/references/code-smells.md +150 -0
  162. package/skills/ios/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +46 -0
  163. package/skills/ios/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +29 -0
  164. package/skills/ios/swiftui-performance-audit/references/profiling-intake.md +44 -0
  165. package/skills/ios/swiftui-performance-audit/references/report-template.md +47 -0
  166. package/skills/ios/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +33 -0
  167. package/skills/ios/swiftui-performance-audit/references/understanding-improving-swiftui-performance.md +52 -0
  168. package/skills/ios/swiftui-pro/LICENSE +21 -0
  169. package/skills/ios/swiftui-pro/SKILL.md +108 -0
  170. package/skills/ios/swiftui-pro/agents/openai.yaml +10 -0
  171. package/skills/ios/swiftui-pro/assets/swiftui-pro-icon.png +0 -0
  172. package/skills/ios/swiftui-pro/assets/swiftui-pro-icon.svg +29 -0
  173. package/skills/ios/swiftui-pro/references/accessibility.md +13 -0
  174. package/skills/ios/swiftui-pro/references/api.md +39 -0
  175. package/skills/ios/swiftui-pro/references/data.md +43 -0
  176. package/skills/ios/swiftui-pro/references/design.md +31 -0
  177. package/skills/ios/swiftui-pro/references/hygiene.md +9 -0
  178. package/skills/ios/swiftui-pro/references/navigation.md +14 -0
  179. package/skills/ios/swiftui-pro/references/performance.md +46 -0
  180. package/skills/ios/swiftui-pro/references/swift.md +56 -0
  181. package/skills/ios/swiftui-pro/references/views.md +35 -0
  182. package/skills/ios/swiftui-ui-patterns/LICENSE +21 -0
  183. package/skills/ios/swiftui-ui-patterns/SKILL.md +100 -0
  184. package/skills/ios/swiftui-ui-patterns/agents/openai.yaml +4 -0
  185. package/skills/ios/swiftui-ui-patterns/references/app-wiring.md +201 -0
  186. package/skills/ios/swiftui-ui-patterns/references/async-state.md +96 -0
  187. package/skills/ios/swiftui-ui-patterns/references/components-index.md +50 -0
  188. package/skills/ios/swiftui-ui-patterns/references/controls.md +57 -0
  189. package/skills/ios/swiftui-ui-patterns/references/deeplinks.md +66 -0
  190. package/skills/ios/swiftui-ui-patterns/references/focus.md +90 -0
  191. package/skills/ios/swiftui-ui-patterns/references/form.md +97 -0
  192. package/skills/ios/swiftui-ui-patterns/references/grids.md +71 -0
  193. package/skills/ios/swiftui-ui-patterns/references/haptics.md +71 -0
  194. package/skills/ios/swiftui-ui-patterns/references/input-toolbar.md +51 -0
  195. package/skills/ios/swiftui-ui-patterns/references/lightweight-clients.md +93 -0
  196. package/skills/ios/swiftui-ui-patterns/references/list.md +86 -0
  197. package/skills/ios/swiftui-ui-patterns/references/loading-placeholders.md +38 -0
  198. package/skills/ios/swiftui-ui-patterns/references/macos-settings.md +71 -0
  199. package/skills/ios/swiftui-ui-patterns/references/matched-transitions.md +59 -0
  200. package/skills/ios/swiftui-ui-patterns/references/media.md +73 -0
  201. package/skills/ios/swiftui-ui-patterns/references/menu-bar.md +101 -0
  202. package/skills/ios/swiftui-ui-patterns/references/navigationstack.md +159 -0
  203. package/skills/ios/swiftui-ui-patterns/references/overlay.md +45 -0
  204. package/skills/ios/swiftui-ui-patterns/references/performance.md +62 -0
  205. package/skills/ios/swiftui-ui-patterns/references/previews.md +48 -0
  206. package/skills/ios/swiftui-ui-patterns/references/scroll-reveal.md +133 -0
  207. package/skills/ios/swiftui-ui-patterns/references/scrollview.md +87 -0
  208. package/skills/ios/swiftui-ui-patterns/references/searchable.md +71 -0
  209. package/skills/ios/swiftui-ui-patterns/references/sheets.md +155 -0
  210. package/skills/ios/swiftui-ui-patterns/references/split-views.md +72 -0
  211. package/skills/ios/swiftui-ui-patterns/references/tabview.md +114 -0
  212. package/skills/ios/swiftui-ui-patterns/references/theming.md +71 -0
  213. package/skills/ios/swiftui-ui-patterns/references/title-menus.md +93 -0
  214. package/skills/ios/swiftui-ui-patterns/references/top-bar.md +49 -0
  215. package/skills/ios/swiftui-view-refactor/LICENSE +21 -0
  216. package/skills/ios/swiftui-view-refactor/SKILL.md +207 -0
  217. package/skills/ios/swiftui-view-refactor/agents/openai.yaml +4 -0
  218. package/skills/ios/swiftui-view-refactor/references/mv-patterns.md +161 -0
  219. package/skills/ios/widgetkit/LICENSE +131 -0
  220. package/skills/ios/widgetkit/SKILL.md +502 -0
  221. package/skills/ios/widgetkit/references/widgetkit-advanced.md +871 -0
@@ -0,0 +1,323 @@
1
+ # iOS Frameworks Capability Map
2
+
3
+ _**Reference file** — agents READ this on demand when hitting a "user wants X → which Apple framework?" question. **NOT injected into agent prompts** (323 lines would waste ~400k tokens across a build). The orchestrator cites this file by path; agents open it, grep for their capability, extract the 1-2 relevant rows. Authoritative source for framework selection. When in doubt, consult apple-docs-mcp to confirm current API status._
4
+
5
+ ## Purpose
6
+
7
+ This is a **framework-selection index**, not a best-practices guide. It answers: "the user described capability X, which Apple framework should I import?" The rule is: **prefer Apple's native framework over custom code or third-party libraries whenever one exists.**
8
+
9
+ ---
10
+
11
+ ## 1. Capability Index (user intent → framework)
12
+
13
+ ### Health & Fitness
14
+
15
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
16
+ |---|---|---|---|
17
+ | Log workouts, steps, heart rate, sleep | HealthKit | `com.apple.developer.healthkit` | — |
18
+ | Start/control workout sessions, build workout plans | WorkoutKit (iOS 17+) | HealthKit | — |
19
+ | Pull clinical records (labs, allergies, meds) | HealthKit ClinicalHealth | `health-records` | — |
20
+ | Mindful minutes / state of mind | HealthKit (iOS 17+) | HealthKit | — |
21
+
22
+ ### Calendar & Reminders
23
+
24
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
25
+ |---|---|---|---|
26
+ | Create/read calendar events | EventKit | `NSCalendarsFullAccessUsageDescription` | Deprecated: `NSCalendarsUsageDescription` (iOS 17+ splits read/write) |
27
+ | Pre-built event editor UI | EventKitUI | Calendar | — |
28
+ | Create/read reminders | EventKit | `NSRemindersFullAccessUsageDescription` | — |
29
+
30
+ ### Photos & Media
31
+
32
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
33
+ |---|---|---|---|
34
+ | Pick photos/videos from library | PhotosUI (`PhotosPicker`) | — (no permission prompt needed for picker) | Deprecated: `UIImagePickerController` |
35
+ | Full library access, albums, assets | PhotoKit | `NSPhotoLibraryUsageDescription` | — |
36
+ | Camera capture, audio/video record | AVFoundation | `NSCameraUsageDescription`, `NSMicrophoneUsageDescription` | — |
37
+ | Play video with controls | AVKit (`VideoPlayer`) | — | Deprecated: `MPMoviePlayerController` |
38
+ | Play user's music, now-playing info | MediaPlayer | `NSAppleMusicUsageDescription` | — |
39
+ | Apple Music catalog, playback | MusicKit | MusicKit capability | — |
40
+ | Song ID (Shazam) | ShazamKit | Microphone | — |
41
+ | Classify sounds on-device | SoundAnalysis | Microphone | — |
42
+ | Speech-to-text | Speech | `NSSpeechRecognitionUsageDescription` | — |
43
+ | View/annotate/render PDF | PDFKit | — | — |
44
+ | Preview documents inline | QuickLook | — | — |
45
+ | Thumbnails for any file type | QuickLookThumbnailing | — | — |
46
+ | Image filters, Core Image | CoreImage | — | — |
47
+ | Low-level audio engine/effects | AVAudioEngine | — | Prefer over `AudioToolbox` for new code |
48
+
49
+ ### Maps & Location
50
+
51
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
52
+ |---|---|---|---|
53
+ | Show a map, annotations, overlays | MapKit (SwiftUI `Map` iOS 17+) | — | Deprecated for SwiftUI: `MKMapView` wrapper |
54
+ | User location / geofencing | CoreLocation | `NSLocationWhenInUseUsageDescription`, `NSLocationAlwaysAndWhenInUseUsageDescription` | — |
55
+ | Weather forecast / historical | WeatherKit | WeatherKit capability | — |
56
+ | Directions, search, POI, lookAround | MapKit | — | — |
57
+
58
+ ### Identity & Auth
59
+
60
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
61
+ |---|---|---|---|
62
+ | Sign in with Apple, passkeys, OAuth web flow | AuthenticationServices | `com.apple.developer.applesignin` | Deprecated: custom `WKWebView` OAuth |
63
+ | Face ID / Touch ID / passcode | LocalAuthentication | `NSFaceIDUsageDescription` | — |
64
+ | Keychain storage | Security | — | Avoid: `UserDefaults` for secrets |
65
+ | Crypto primitives (AES, ChaCha, SHA, EC) | CryptoKit | — | Deprecated: `CommonCrypto` in new Swift code |
66
+
67
+ ### Payments & Commerce
68
+
69
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
70
+ |---|---|---|---|
71
+ | In-app purchases, subscriptions | StoreKit 2 | In-App Purchase capability | Deprecated: StoreKit 1 (`SKPayment*`) |
72
+ | Apple Pay, Wallet passes | PassKit | `com.apple.developer.in-app-payments`, merchant IDs | — |
73
+
74
+ ### Communication & Notifications
75
+
76
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
77
+ |---|---|---|---|
78
+ | Local + remote push notifications | UserNotifications | `aps-environment` (remote) | Deprecated: `UILocalNotification`, `UIUserNotification*` |
79
+ | VoIP push | PushKit + CallKit | VoIP capability | — |
80
+ | System call UI, CallKit directory | CallKit | — | — |
81
+ | iMessage app extensions, stickers | Messages | — | — |
82
+ | Peer-to-peer device networking | MultipeerConnectivity | Local network | — |
83
+ | Bonjour / local network discovery | Network | `NSLocalNetworkUsageDescription` | Deprecated: `NetService` |
84
+ | Email / SMS compose sheets | MessageUI | — | — |
85
+
86
+ ### AR / Vision / ML
87
+
88
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
89
+ |---|---|---|---|
90
+ | World-tracking AR, plane detection | ARKit | Camera | — |
91
+ | 3D rendering for AR | RealityKit | Camera | Deprecated in AR: `SceneKit+ARKit` combo |
92
+ | Room scanning (LiDAR) | RoomPlan | Camera | — |
93
+ | Text recognition, face/body detect, barcode | Vision | — | — |
94
+ | Document scanner, data-scanner UI | VisionKit | Camera | — |
95
+ | Run custom ML models | CoreML | — | — |
96
+ | Train models on-device | CreateML | — | — |
97
+ | On-device LLM (text gen, summarize) | **FoundationModels (iOS 26+)** | — | iOS 26 only; check availability |
98
+ | Visual Intelligence interactions | **Visual Intelligence (iOS 26+)** | — | iOS 26 only |
99
+ | Natural-language tokenization, tagging | NaturalLanguage | — | — |
100
+ | Live Text / Data scanner | VisionKit `DataScannerViewController` | Camera | — |
101
+
102
+ ### Contacts & People
103
+
104
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
105
+ |---|---|---|---|
106
+ | Read/write contacts | Contacts | `NSContactsUsageDescription` | Deprecated: `AddressBook` |
107
+ | Contact picker UI | ContactsUI | Contacts (picker-only: not required) | — |
108
+
109
+ ### System & Device
110
+
111
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
112
+ |---|---|---|---|
113
+ | Background fetch, background processing | BackgroundTasks | `BGTaskSchedulerPermittedIdentifiers` | Deprecated: `performFetchWithCompletionHandler` |
114
+ | Background asset download at install | BackgroundAssets | Background Assets capability | — |
115
+ | VPN / content filter / packet tunnel | NetworkExtension | NetworkExtension capability | — |
116
+ | Device attestation / anti-abuse | DeviceCheck / AppAttest | — | — |
117
+ | IDFA / tracking consent | AppTrackingTransparency | `NSUserTrackingUsageDescription` | — |
118
+ | File Provider extension (cloud drive) | FileProvider | File Provider capability | — |
119
+ | Share sheet / activity items | UIKit `UIActivityViewController` (SwiftUI `ShareLink`) | — | Prefer SwiftUI `ShareLink` |
120
+ | Drag & drop, pasteboard | UniformTypeIdentifiers + SwiftUI `Transferable` | — | Deprecated: `kUTType*` constants |
121
+
122
+ ### Home & IoT
123
+
124
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
125
+ |---|---|---|---|
126
+ | HomeKit accessories | HomeKit | `NSHomeKitUsageDescription` | — |
127
+ | Matter accessory pairing | MatterSupport | Matter capability | — |
128
+ | BLE peripherals & centrals | CoreBluetooth | `NSBluetoothAlwaysUsageDescription` | — |
129
+ | Ultra-wideband ranging | NearbyInteraction | — | — |
130
+ | Car key | CarKey | CarKey entitlement | — |
131
+ | CarPlay apps / audio / nav | CarPlay | CarPlay entitlement (Apple approval) | — |
132
+
133
+ ### Wearables & Companions
134
+
135
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
136
+ |---|---|---|---|
137
+ | iPhone ↔ Apple Watch messaging | WatchConnectivity | — | — |
138
+ | Watch workouts | WorkoutKit + HealthKit | HealthKit | — |
139
+
140
+ ### Intents, Widgets & Automation
141
+
142
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
143
+ |---|---|---|---|
144
+ | Siri / Shortcuts / App Intents | AppIntents | — | Deprecated: `SiriKit` custom intents (keep only for domains AppIntents doesn't cover) |
145
+ | Home/Lock-Screen widgets | WidgetKit | App Groups (usually) | — |
146
+ | Live Activities / Dynamic Island | ActivityKit | `NSSupportsLiveActivities` Info.plist | — |
147
+ | Control Center widgets (iOS 18+) | WidgetKit `ControlWidget` | — | — |
148
+ | System-style alarms (iOS 26+) | **AlarmKit** | — | iOS 26 only |
149
+
150
+ ### Web & Content
151
+
152
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
153
+ |---|---|---|---|
154
+ | In-app Safari tab (SFSafariVC) | SafariServices | — | — |
155
+ | Full web view / JS bridge | WebKit | — | Deprecated: `UIWebView` |
156
+ | SwiftUI-native web view (iOS 26+) | SwiftUI `WebView` | — | iOS 26 only |
157
+ | Rich URL preview cards | LinkPresentation | — | — |
158
+
159
+ ### Graphics & Games
160
+
161
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
162
+ |---|---|---|---|
163
+ | 2D game engine | SpriteKit | — | — |
164
+ | 3D scene graph | SceneKit | — | (Maintenance mode; prefer RealityKit for new 3D) |
165
+ | GPU rendering | MetalKit / Metal | — | Deprecated: OpenGL ES |
166
+ | 3D model I/O (USDZ) | ModelIO | — | — |
167
+ | Game Center, leaderboards, matches | GameKit | Game Center capability | — |
168
+ | Controller input | GameController | — | — |
169
+
170
+ ### Accessibility & Input
171
+
172
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
173
+ |---|---|---|---|
174
+ | VoiceOver/Switch Control labels | Accessibility (SwiftUI modifiers) | — | — |
175
+ | Dictation / speech recognition | Speech | Speech recognition | — |
176
+ | Hand/pencil input | PencilKit | — | — |
177
+
178
+ ### Persistence
179
+
180
+ | User intent | Framework(s) | Entitlement needed | Deprecation note |
181
+ |---|---|---|---|
182
+ | Model persistence (new projects) | SwiftData | — | — |
183
+ | Model persistence (legacy) | CoreData | — | Prefer SwiftData for new work |
184
+ | Tiny prefs (≤ a few KB) | Foundation `UserDefaults` | — | Do not use for secrets or large blobs |
185
+ | iCloud key-value | Foundation `NSUbiquitousKeyValueStore` | iCloud Key-Value | — |
186
+ | iCloud Drive documents | CloudKit + UIDocument | iCloud (CloudKit) | — |
187
+ | CloudKit sync | CloudKit | iCloud (CloudKit) | — |
188
+
189
+ ---
190
+
191
+ ## 2. Selection Rules (multi-choice disambiguation)
192
+
193
+ When multiple frameworks can solve a problem, pick the most modern:
194
+
195
+ - **Photos:** PhotosUI `PhotosPicker` (iOS 16+) > PhotoKit `PHPickerViewController` (iOS 14+) > `UIImagePickerController` (deprecated).
196
+ - **Auth:** AuthenticationServices (Sign in with Apple, passkeys, OAuth) > manual `WKWebView` OAuth flows.
197
+ - **Audio:** `AVAudioEngine` (modern graph) > `AVAudioPlayer` (simple file playback) > `AudioToolbox` (low-level CoreAudio).
198
+ - **Notifications:** UserNotifications (local + remote, iOS 10+) > legacy `UIUserNotification*` (removed).
199
+ - **Maps:** SwiftUI `Map` (iOS 17+) > `MKMapView` via `UIViewRepresentable`.
200
+ - **On-device AI:** FoundationModels (iOS 26+, text) > CoreML (custom models) > MLX (low-level experimental).
201
+ - **Persistence:** SwiftData > Core Data (legacy only) > `UserDefaults` (tiny prefs only).
202
+ - **3D:** RealityKit (AR + general 3D) > SceneKit (maintenance mode).
203
+ - **Web view:** SwiftUI `WebView` (iOS 26+) > `WKWebView` via `UIViewRepresentable` > `SFSafariViewController` (if you just need a browser tab).
204
+ - **Background work:** BackgroundTasks (`BGAppRefreshTask`, `BGProcessingTask`) > deprecated background-fetch.
205
+ - **Networking:** `URLSession` + async/await > `Network` framework (sockets, Bonjour) > third-party HTTP clients.
206
+ - **JSON:** `Codable` > `JSONSerialization`.
207
+ - **Share:** SwiftUI `ShareLink` > `UIActivityViewController` wrapper.
208
+ - **Crypto:** CryptoKit > `CommonCrypto`.
209
+
210
+ ---
211
+
212
+ ## 3. Framework Combinations (common pairings)
213
+
214
+ - **Push notifications** = UserNotifications + APNs + `aps-environment` entitlement.
215
+ - **VoIP** = CallKit + PushKit + VoIP background mode + CallKit entitlement.
216
+ - **Sign in with Apple** = AuthenticationServices + "Sign in with Apple" capability.
217
+ - **Widgets** = WidgetKit + App Groups + shared SwiftData container.
218
+ - **Live Activities** = ActivityKit + UserNotifications push + `NSSupportsLiveActivities` in Info.plist.
219
+ - **App Intents in widgets** = AppIntents + WidgetKit + shared target membership.
220
+ - **HealthKit workouts** = HealthKit + WorkoutKit + HealthKit entitlement + `NSHealthShareUsageDescription` + `NSHealthUpdateUsageDescription`.
221
+ - **ARKit 3D scene** = ARKit + RealityKit + `NSCameraUsageDescription`.
222
+ - **Document scanning** = VisionKit `VNDocumentCameraViewController` + `NSCameraUsageDescription`.
223
+ - **Barcode / text scanner** = VisionKit `DataScannerViewController` + Camera.
224
+ - **Passkeys** = AuthenticationServices + Associated Domains (`webcredentials:`).
225
+ - **Universal Links** = Associated Domains (`applinks:`) + `onOpenURL` / `NSUserActivity`.
226
+ - **CloudKit-synced SwiftData** = SwiftData + iCloud (CloudKit) capability + follow CloudKit-compatible model rules (no `.unique`, all relationships optional).
227
+ - **Matter pairing** = MatterSupport + HomeKit + Matter entitlement.
228
+ - **Apple Pay** = PassKit + Merchant ID + in-app-payments entitlement.
229
+
230
+ ---
231
+
232
+ ## 4. Entitlement Mapping (feeds ios-entitlements-generator)
233
+
234
+ | Framework | Entitlement key | Info.plist keys | Setup notes |
235
+ |---|---|---|---|
236
+ | HealthKit | `com.apple.developer.healthkit` | `NSHealthShareUsageDescription`, `NSHealthUpdateUsageDescription` | Add access types to entitlement plist |
237
+ | HomeKit | — | `NSHomeKitUsageDescription` | HomeKit capability on target |
238
+ | EventKit | — | `NSCalendarsFullAccessUsageDescription`, `NSRemindersFullAccessUsageDescription` | iOS 17+ split access model |
239
+ | Contacts | — | `NSContactsUsageDescription` | — |
240
+ | Photos | — | `NSPhotoLibraryUsageDescription`, `NSPhotoLibraryAddUsageDescription` | Not needed for `PhotosPicker` |
241
+ | Camera | — | `NSCameraUsageDescription` | AVFoundation, Vision, ARKit, VisionKit |
242
+ | Microphone | — | `NSMicrophoneUsageDescription` | AVFoundation, Speech, ShazamKit |
243
+ | Speech | — | `NSSpeechRecognitionUsageDescription` | — |
244
+ | Face ID | — | `NSFaceIDUsageDescription` | LocalAuthentication |
245
+ | CoreLocation | — | `NSLocationWhenInUseUsageDescription`, `NSLocationAlwaysAndWhenInUseUsageDescription`, `NSLocationTemporaryUsageDescriptionDictionary` | — |
246
+ | Bluetooth | — | `NSBluetoothAlwaysUsageDescription` | — |
247
+ | Local Network | — | `NSLocalNetworkUsageDescription`, `NSBonjourServices` | Multipeer, Bonjour |
248
+ | Music | — | `NSAppleMusicUsageDescription` | MediaPlayer, MusicKit |
249
+ | Tracking (IDFA) | — | `NSUserTrackingUsageDescription` | AppTrackingTransparency |
250
+ | Sign in with Apple | `com.apple.developer.applesignin` | — | — |
251
+ | Push (remote) | `aps-environment` | — | `development` / `production` |
252
+ | Associated Domains | `com.apple.developer.associated-domains` | — | `applinks:`, `webcredentials:`, `activitycontinuation:` |
253
+ | App Groups | `com.apple.security.application-groups` | — | Share data with widgets/extensions |
254
+ | iCloud (CloudKit) | `com.apple.developer.icloud-services`, `com.apple.developer.icloud-container-identifiers` | — | CloudKit + iCloud Drive |
255
+ | Keychain Sharing | `keychain-access-groups` | — | Share keychain items across apps |
256
+ | In-App Purchase | `com.apple.developer.in-app-payments` (Apple Pay) | — | IAP capability on target for StoreKit |
257
+ | HealthKit Clinical | `com.apple.developer.healthkit.access` | — | Array of clinical record types |
258
+ | WeatherKit | `com.apple.developer.weatherkit` | — | Register service in developer portal |
259
+ | MusicKit | `com.apple.developer.musickit` | — | — |
260
+ | CarPlay | `com.apple.developer.carplay-*` | — | Requires Apple entitlement approval |
261
+ | CarKey | `com.apple.developer.car-key` | — | — |
262
+ | NetworkExtension | `com.apple.developer.networking.networkextension` | — | Packet tunnel, content filter, DNS proxy |
263
+ | BackgroundAssets | `com.apple.developer.background-assets` | — | — |
264
+ | Matter | `com.apple.developer.matter.allow-setup-payload` | — | — |
265
+ | DriverKit / USB / HID | various | — | Specialized — usually not needed in consumer apps |
266
+ | Live Activities | — | `NSSupportsLiveActivities`, `NSSupportsLiveActivitiesFrequentUpdates` | Info.plist only |
267
+ | Background modes | `com.apple.developer.background-modes` (via Xcode UI) | — | audio, location, voip, fetch, processing, remote-notification |
268
+
269
+ ---
270
+
271
+ ## 5. Deprecation Flags (avoid in new code)
272
+
273
+ - `UIImagePickerController` → use PhotosUI `PhotosPicker`.
274
+ - `UIUserNotification*` / `UILocalNotification` → use UserNotifications.
275
+ - Core Data in new projects → use SwiftData.
276
+ - `UIAlertView` / `UIActionSheet` → use SwiftUI `alert` / `confirmationDialog` (or `UIAlertController` in UIKit).
277
+ - `MKMapView` wrapped in SwiftUI → use SwiftUI `Map` (iOS 17+).
278
+ - `ObservableObject` / `@Published` / `@StateObject` → use `@Observable` macro.
279
+ - `DispatchQueue.main.async` for UI → use `@MainActor` + async/await.
280
+ - `Timer` / GCD timers → use async `Task.sleep` / `AsyncTimerSequence`.
281
+ - `DateFormatter` / `NumberFormatter` → use `FormatStyle` (`.formatted(...)`).
282
+ - `replacingOccurrences(of:with:)` → `.replacing("a", with: "b")`.
283
+ - `foregroundColor` → `foregroundStyle`.
284
+ - `cornerRadius` → `clipShape(.rect(cornerRadius:))`.
285
+ - `NavigationView` → `NavigationStack`.
286
+ - `tabItem` on TabView → new `Tab` API (iOS 18+).
287
+ - `UIWebView` → `WKWebView` (or SwiftUI `WebView` iOS 26+).
288
+ - `AddressBook` → Contacts.
289
+ - `CommonCrypto` in Swift → CryptoKit.
290
+ - `SKPayment*` (StoreKit 1) → StoreKit 2.
291
+ - `kUTType*` → UniformTypeIdentifiers `UTType`.
292
+ - `NetService` → Network framework.
293
+ - `UIScreen.main.bounds` for layout → SwiftUI geometry APIs.
294
+ - `performFetchWithCompletionHandler` → BackgroundTasks.
295
+ - SiriKit custom intents → AppIntents (keep SiriKit only for domains AppIntents doesn't cover: messaging, payments, ride-booking, car-commands).
296
+ - OpenGL ES → Metal.
297
+
298
+ ---
299
+
300
+ ## 6. The Reach-for-the-Kit Rule (enforcement)
301
+
302
+ When the user describes a capability that an Apple framework already solves, you **MUST** use the Apple framework. Custom implementations of these are anti-patterns:
303
+
304
+ - Rolling your own photo picker instead of `PhotosPicker`.
305
+ - Rolling your own calendar event storage instead of EventKit.
306
+ - Rolling your own notification scheduler instead of UserNotifications.
307
+ - Rolling your own keychain wrapper instead of the Security framework.
308
+ - Rolling your own biometric auth instead of LocalAuthentication.
309
+ - Rolling your own OAuth / sign-in flow instead of AuthenticationServices.
310
+ - Rolling your own map tiles instead of MapKit.
311
+ - Scraping weather APIs instead of WeatherKit.
312
+ - Rolling your own workout tracker instead of HealthKit + WorkoutKit.
313
+ - Rolling your own barcode scanner instead of Vision / VisionKit.
314
+ - Rolling your own PDF renderer instead of PDFKit.
315
+ - Rolling your own share sheet instead of `ShareLink` / `UIActivityViewController`.
316
+ - Rolling your own crypto primitives instead of CryptoKit.
317
+ - Rolling your own in-app purchase layer instead of StoreKit 2.
318
+
319
+ If unsure whether a framework covers a use case, query `apple-docs-mcp` **before** writing custom code.
320
+
321
+ ---
322
+
323
+ _See also: `ios-context.md` (Senior iOS Engineer persona + §2 Core Stack rules)._
@@ -0,0 +1,162 @@
1
+ # iOS Phase Branches
2
+
3
+ _Loaded into orchestrator session context when `project_type=ios`. Contains per-phase iOS-specific instructions. Mode-agnostic phase scaffolding lives in `commands/build.md`._
4
+
5
+ ## iOS Mode Tool Stack
6
+
7
+ When `project_type=ios` is set in `docs/plans/.build-state.md`, use this stack in place of the web defaults:
8
+
9
+ - Project creation: Xcode New Project dialog (user-guided — no Tuist, no XcodeGen)
10
+ - Structure changes: XcodeBuildMCP primary / user-assisted Add Files fallback
11
+ - Swift code edits: direct file writes (Claude via Edit/Write tools)
12
+ - Build, diagnostics, SwiftUI Preview capture: XcodeBuildMCP
13
+ - E2E tests: Maestro (`.yaml` flows — agent-friendly)
14
+ - OAuth / web-views on simulator: agent-browser `-p ios` (Mobile Safari only, not native UI)
15
+ - Design references: Apple HIG + SF Symbols + Liquid Glass (iOS 26+)
16
+ - Code signing / TestFlight / App Store: fastlane (optional — Phase 7 only)
17
+
18
+ **Architecture default for iOS:** vanilla SwiftUI + `@Observable`. TCA is opt-in only (user explicitly requests it, or existing TCA codebase detected). Do not propose TCA by default.
19
+
20
+ All iOS implementation agents inherit the `protocols/ios-context.md` persona (Senior iOS Engineer) — pass it into every agent prompt in Phases 4, 5, 6, 7 when `project_type=ios`.
21
+
22
+ ## Phase 0 additions (iOS-specific)
23
+
24
+ When Phase 0 classifier sets `project_type=ios`:
25
+ - Load `protocols/ios-context.md` into orchestrator session context — it holds the Senior iOS Engineer persona inherited by every iOS implementation agent (injected into agent prompts).
26
+ - Reference `protocols/ios-frameworks-map.md` by **path only** — do NOT load its 323 lines into session context or inject into agent prompts. It is a lookup reference: agents `Read` it on-demand when they hit a "user wants X → which Apple framework?" question, grep for their capability, extract the 1-2 relevant rows. The orchestrator cites it by path when dispatching the architect, entitlements-generator, and impl agents; those agents open it themselves.
27
+ - Use the iOS Mode Tool Stack above — not the web defaults.
28
+ - Phase 3 skips `/design-system` (no web style guide). Phase 6 dispatches to iOS twins of `/verify` + `/ux-review` + `/fix`.
29
+ - If greenfield (no `.xcodeproj` exists), **Phase -1 Bootstrap** runs before Phase 1.
30
+
31
+ ## Phase -1 — iOS Bootstrap (iOS-only, greenfield only)
32
+
33
+ **Runs ONLY if** `project_type=ios` AND no `.xcodeproj` exists in the project root. Skip entirely for `project_type=web` OR when an Xcode project already exists.
34
+
35
+ **Goal:** verify the iOS toolchain, create the Xcode project, wire MCP servers, install test tooling — so Phase 1 planning starts against a real, buildable Xcode project.
36
+
37
+ ### Step -1.1 — Environment Check
38
+
39
+ Verify (or guide the user to install):
40
+ - **Xcode 26.3+** (hard requirement — no fallback). If missing or older, direct user to Mac App Store update. Requires macOS 26 Tahoe + Apple Silicon.
41
+ - **XcodeBuildMCP** server configured in Claude settings.
42
+ - **apple-docs-mcp** server configured (for iOS 26 API lookups during architecture).
43
+ - **Maestro CLI** (`brew install maestro`) for E2E tests.
44
+ - **fastlane** — defer to Phase 7, do NOT install now (optional, ship-only).
45
+
46
+ ### Step -1.2 — Xcode Project Creation (user-guided)
47
+
48
+ Dispatch the `ios-bootstrap` skill (or inline the prompt if the skill isn't available):
49
+
50
+ Call the Agent tool — description: "iOS bootstrap" — mode: "bypassPermissions" — prompt: "Guide the user through creating a new Xcode project via Xcode's New Project dialog (File > New > Project > iOS App). Target: iOS 26.0+, Swift 6.2+, SwiftUI interface, SwiftData storage (if data persistence is in the design). Do NOT use Tuist or XcodeGen. After the user confirms project creation, verify: `.xcodeproj` exists, the project builds clean via XcodeBuildMCP, and the app launches on a simulator. Also create the canonical `maestro/` directory at the project root (for Phase 4 flow stubs + Phase 5 smoke tests) — no leading dot, committed to git. Report the project path and bundle identifier."
51
+
52
+ ### Step -1.3 — Bootstrap Verification
53
+
54
+ Confirm all of: Xcode version OK, `.xcodeproj` exists, XcodeBuildMCP responds, apple-docs-mcp responds, Maestro installed, first build+launch on simulator succeeded. Log status to `docs/plans/.build-state.md` under `## iOS Bootstrap`. If any check fails, STOP and surface the blocker — do NOT proceed to Phase 1.
55
+
56
+ **Compaction checkpoint.** Update `docs/plans/.build-state.md` per the format in `commands/build.md`.
57
+
58
+ ## Phase 1 — Plan (iOS additions)
59
+
60
+ Load phase-specific iOS skill bundle per `protocols/ios-context.md` §Phase 1. Planning agent = `ios-swift-architect` (not the generic web planner). Market/tech-feasibility research agents must check App Store category landscape, TestFlight constraints, and iOS 26 API availability (via apple-docs-mcp) in addition to standard research.
61
+
62
+ ## Phase 2 — Architecture (iOS additions)
63
+
64
+ Load phase-specific iOS skill bundle per `protocols/ios-context.md` §Phase 2. Architecture agents must select iOS 26 APIs via apple-docs-mcp (verify availability, deprecations, minimum OS). Replace "Backend architecture" / "Frontend architecture" with: (1) SwiftUI view hierarchy + navigation model, (2) SwiftData schema + CloudKit strategy, (3) Swift Concurrency / actor isolation plan, (4) iOS-specific security (Keychain, entitlements, ATS). Implementation blueprint lists Swift files + Xcode targets, not web modules.
65
+
66
+ ### Feature Flag Resolution (end of Phase 2)
67
+
68
+ Before leaving Phase 2, resolve the `ios_features` flag block (schema in `protocols/ios-context.md` §iOS Feature Flag Schema) and WRITE it to `docs/plans/.build-state.md` under the `ios_features:` key. Determine each flag from the brainstorm + architecture outputs:
69
+
70
+ - `widgets` — true if Home/Lock Screen widgets mentioned.
71
+ - `liveActivities` — true if Live Activities / Dynamic Island mentioned.
72
+ - `appIntents` — true if Siri / Shortcuts / App Intents mentioned.
73
+ - `foundationModels` — true if on-device LLM / Foundation Models mentioned.
74
+ - `storekit` — true if IAP / subscriptions mentioned.
75
+ - `healthkit` — true if health / fitness data mentioned.
76
+ - `push` — true if remote/local push notifications mentioned.
77
+ - `cloudkit` — true if cross-device sync mentioned.
78
+ - `siri` — true if Siri voice integration mentioned.
79
+ - `location` — true if Maps / geolocation / geofencing mentioned.
80
+ - `background` — true if background fetch / processing / BGTaskScheduler mentioned.
81
+ - `cameraPhoto` — true if camera or photo picker mentioned.
82
+ - `microphone` — true if audio recording / Speech mentioned.
83
+ - `contacts` — true if Contacts framework mentioned.
84
+ - `calendar` — true if EventKit / calendar / reminders mentioned.
85
+ - `appleWatch` — true if watchOS companion mentioned.
86
+
87
+ Resolution rule: keyword-match the brainstorm transcript + architecture doc; in autonomous mode default to `false` on ambiguous flags and log the assumption to `build-log.md`; in interactive mode confirm ambiguous flags with the user. These flags gate Phase 5 skill loading and Phase 4 entitlement generation.
88
+
89
+ ## Phase 3 — Design (iOS branch)
90
+
91
+ Load phase-specific iOS skill bundle per `protocols/ios-context.md` §Phase 3. Do **NOT** build `/design-system` (web-only). Instead:
92
+
93
+ - **Step 3.1 iOS** — agent-browser (`-p desktop`) harvests iOS UI references from **free** sources: screenlane.com (iOS screenshots), App Store web listings for top apps in the product category, Apple HIG pages, SF Symbols browser. No Mobbin (paid). Fallback: vibe-only design board if scraping blocked.
94
+ - **Step 3.2 iOS** — synthesize an **iOS Design Board** (`docs/plans/ios-design-board.md`) grounded in Apple HIG + Liquid Glass (iOS 26+) + SF Symbols + the harvested references + the user's stated app vibe. Cover: typography (Dynamic Type scale), color (semantic + dark mode), spacing (HIG-compliant), navigation pattern (TabView / NavigationStack / sheets), iconography (SF Symbols).
95
+ - **Skip Step 3.3** (Living Style Guide) — no web route.
96
+ - **Step 3.4 iOS** — visual QA loop uses XcodeBuildMCP SwiftUI Preview captures (not Playwright screenshots). Exit criterion = user-approved pass/fail (not a 0-100 rubric). **Max 3 iterations** (tighter than web's 5). On stall: present captures + remaining issues to user for accept/reject decision.
97
+ - Save final artifact to `docs/plans/ios-design-board.md` (Phase 4 gate reads this file instead of `visual-design-spec.md`).
98
+
99
+ Phase 4 HARD-GATE: iOS mode requires `docs/plans/ios-design-board.md` to exist before Phase 4 starts. If missing, return to Phase 3.
100
+
101
+ ## Phase 4 — Foundation (iOS branch)
102
+
103
+ Load phase-specific iOS skill bundle per `protocols/ios-context.md` §Phase 4.
104
+
105
+ Dispatch `ios-entitlements-generator` (Info.plist + entitlements based on features: push, background, HealthKit, etc.) and `ios-info-plist-hardening` (ATS config, privacy usage strings, URL schemes).
106
+
107
+ - **Step 4.1 (iOS):** Scaffolding is already done by Phase -1 Bootstrap. Instead, create the app target's folder structure (`Views/`, `Models/`, `Services/`, `Resources/`) via XcodeBuildMCP.
108
+ - **Step 4.2 (iOS):** Implement iOS-native design tokens from `docs/plans/ios-design-board.md` (SwiftUI `Color` extensions, `Font` extensions, `ShapeStyle` tokens, spacing constants) — NOT web CSS.
109
+ - **Step 4.2b (iOS):** Replace Playwright acceptance scaffolds with Maestro YAML flow stubs in `maestro/` directory.
110
+ - **Step 4.3 (iOS):** Metric Loop on scaffold health — builds clean via XcodeBuildMCP, Swift Testing `@Test`s pass, structure matches architecture. Max 3 iterations.
111
+ - **Step 4.4 (iOS):** Verification Gate via XcodeBuildMCP build + test. Do not proceed to Phase 5 until it passes.
112
+
113
+ ## Phase 5 — Build (iOS branch)
114
+
115
+ Load full iOS skill bundle per `protocols/ios-context.md` §Phase 5. Every implementation agent inherits the `ios-context.md` Senior iOS Engineer persona. Bundle includes: `swiftui-pro`, `swift-concurrency`, `swiftdata-pro`, `swift-security-expert`, `swift-accessibility`.
116
+
117
+ **Feature-flag gated skill loading** — before dispatching any gated skill, the orchestrator MUST read `ios_features` from `docs/plans/.build-state.md`. Load a gated skill only when its flag is `true`:
118
+ - `widgets: true` → load `skills/ios/widgetkit/`
119
+ - `liveActivities: true` → `skills/ios/activitykit/`
120
+ - `appIntents: true` → `skills/ios/app-intents/`
121
+ - `foundationModels: true` → `agents/ios-foundation-models-specialist.md`
122
+ - `storekit: true` → `agents/ios-storekit-specialist.md`
123
+
124
+ **Other Apple frameworks** (HealthKit, GameKit, ARKit, RealityKit, Vision, CoreML, MapKit, PhotoKit, WeatherKit, MusicKit, Contacts, EventKit, CallKit) — **available via iOS 26 SDK `import`**; agent uses `apple-docs-mcp` lookups + `ios-context.md` persona + `ios-entitlements-generator` for capability wiring. No dedicated mentor-skill yet — add one only if a specific framework becomes friction during dogfooding.
125
+
126
+ ### Step 5.1 — Implement (iOS)
127
+
128
+ Call the Agent tool — description: "[task name]" — mode: "bypassPermissions" — prompt: "TASK: [task description + acceptance criteria]. HANDOFF — Architecture section: [paste]. Design section: [paste relevant section from `docs/plans/ios-design-board.md`]. Previous task output: [if relevant]. For UI tasks: consult `docs/plans/ios-design-board.md` for visual tokens + HIG patterns, and `skills/ios/swiftui-design-principles/` for the 10-rule polish checklist. Match the design board's tokens exactly. Implement fully with real Swift code, Swift Testing `@Test`s, and XcodeBuildMCP validation. Commit: 'feat: [task]'. Report what you built, files changed, and test results."
129
+
130
+ Implementation agents edit Swift files directly and build/diagnose via XcodeBuildMCP. Set `[COMPLEXITY: S/M/L]` based on the task's Size from sprint-tasks.md.
131
+
132
+ ### Step 5.2 — Metric Loop (iOS)
133
+
134
+ Metric loop uses XcodeBuildMCP SwiftUI Preview captures for UI verification (not agent-browser). Max 5 iterations.
135
+
136
+ ### Step 5.3b — Behavioral Smoke Test (iOS)
137
+
138
+ Executes the task's **Maestro** flow from `maestro/` against a booted simulator (via XcodeBuildMCP `BuildAndRun` → `maestro test maestro/<flow>.yaml`) — NOT agent-browser or localhost. Evidence = Maestro run log + Preview/simulator screenshots. For OAuth/web-view flows on the simulator only, use agent-browser `-p ios`.
139
+
140
+ ## Phase 6 — Harden (iOS branch)
141
+
142
+ Phase 6 does NOT run the web audit bundle. Instead, **dispatch to the three iOS twin commands in sequence**:
143
+
144
+ 1. `/buildanything:verify` (iOS twin — functional correctness, XcodeBuildMCP diagnostics, Maestro E2E)
145
+ 2. `/buildanything:ux-review` (iOS twin — HIG audit via SwiftUI Preview captures + Apple HIG checklist)
146
+ 3. `/buildanything:fix` (iOS twin — dispatches specialist iOS agents for each finding)
147
+
148
+ Each twin owns its own scope and reviewer — they are NOT merged into a single loop. After all three twins complete, run **Step 6.4 Reality Check** (in `commands/build.md`) with iOS evidence (Maestro run logs, Preview captures, HIG findings).
149
+
150
+ Skip Steps 6.1, 6.1b, 6.2, 6.2b, 6.2c (Playwright E2E), 6.2d (agent-browser dogfood), 6.2e (web fake-data patterns).
151
+
152
+ ## Phase 7 — Ship (iOS branch, optional)
153
+
154
+ Ship pipeline is **optional** (simulator-only is a valid end-state — no Apple Developer account required).
155
+
156
+ If the user opts to ship: run the iOS `asc-*` pipeline:
157
+ - `asc-metadata-generator` (App Store Connect listing + keywords + description)
158
+ - `asc-screenshot-generator` (generate App Store screenshots via XcodeBuildMCP at all required device sizes)
159
+ - `asc-privacy-manifest` (PrivacyInfo.xcprivacy)
160
+ - Then `fastlane` for code signing + TestFlight upload.
161
+
162
+ This is SEPARATE from the web ship pipeline — do NOT run web README/deployment steps. Documentation = README with simulator run instructions + TestFlight invite link (if shipped). Skip Step 7.1 web docs and web deployment notes.
@@ -0,0 +1,27 @@
1
+ # iOS Preflight Protocol
2
+
3
+ _Shared preflight steps for iOS-mode commands. Included by `/verify`, `/ux-review`, `/fix` iOS twins._
4
+
5
+ ## Preflight Checks
6
+
7
+ Before running any iOS-branch command flow, verify:
8
+
9
+ 1. **`.xcodeproj` exists** in project root (use `ls *.xcodeproj` or equivalent). If not, HALT and prompt user to run `/buildanything:build` Phase -1 Bootstrap first.
10
+
11
+ 2. **XcodeBuildMCP reachable** — dispatch a simple `xcodebuild -version` or MCP health check. If unreachable, HALT with instructions to re-add MCP config per `skills/ios/ios-bootstrap/references/xcode-mcp-config.md`.
12
+
13
+ 3. **Simulator bootable** — list available iOS 26 simulators via XcodeBuildMCP. If none available, HALT and instruct user to install via Xcode.
14
+
15
+ 4. **`docs/plans/.build-state.md` exists** with `project_type: ios` and `ios_features:` populated. If missing, HALT.
16
+
17
+ 5. **apple-docs-mcp reachable** (non-blocking) — if unreachable, log warning; commands proceed with degraded docs lookup (WebFetch fallback per `protocols/ios-context.md` §apple-docs fallback rule).
18
+
19
+ ## Usage
20
+
21
+ At the top of any iOS-twin command's iOS branch, insert:
22
+
23
+ ```
24
+ **Run iOS preflight:** see `protocols/ios-preflight.md`.
25
+ ```
26
+
27
+ Then proceed with command-specific steps.
@@ -0,0 +1,93 @@
1
+ # Metric Loop Protocol
2
+
3
+ You are the orchestrator. You are about to run a metric-driven iteration loop on an artifact (code, architecture, docs, etc.) to drive it toward a quality target.
4
+
5
+ ## Step 0: Define Your Metric
6
+
7
+ Before iterating, YOU define the metric for this specific context. Consider:
8
+ - What is the artifact? (a task implementation, a security audit, an architecture doc, etc.)
9
+ - What does "good" look like? (all tests pass, zero critical vulns, all acceptance criteria met, etc.)
10
+ - Is the metric quantitative (test pass rate, vuln count, coverage %) or qualitative (architecture completeness, doc clarity)?
11
+
12
+ Write a **Metric Definition** block to `docs/plans/.build-state.md`:
13
+
14
+ ```
15
+ ## Active Metric Loop
16
+ Phase: [current phase]
17
+ Artifact: [what you're iterating on]
18
+ Metric: [what you're measuring, in one sentence]
19
+ How to measure: [what the measurement agent should do — run tests, audit code, check criteria, etc.]
20
+ Target: [score 0-100 at which you stop]
21
+ Max iterations: [hard cap, default 5]
22
+ ```
23
+
24
+ Then create a score log table:
25
+
26
+ ```
27
+ | Iter | Score | Delta | Top Issue | Files |
28
+ |------|-------|-------|-----------|-------|
29
+ ```
30
+
31
+ When starting a new metric loop, REPLACE the previous Active Metric Loop section (if any). There is only ever ONE active metric loop. Previous loop results should already be recorded in their phase's section above. When the loop completes (Step 2 exit), rename the section header from `## Active Metric Loop` to `## Completed Metric Loop — [Phase N]` and leave it for historical reference.
32
+
33
+ If you are in Phase 5, also record the current sub-step for the overall task cycle (not all of these are within the metric loop itself):
34
+ ```
35
+ Sub-step: [5.1 Implement | 5.1b Cleanup | 5.2 Metric Loop | 5.3 Loop Exit | 5.4 Verify]
36
+ ```
37
+ This tells the orchestrator exactly where to resume after context compaction.
38
+
39
+ ## Step 1: MEASURE
40
+
41
+ Call the Agent tool — description: "Measure [metric]" — prompt:
42
+
43
+ "[How to measure, from your metric definition]. Score the current state 0-100. Return your response with a clear SCORE: [number] line, a list of FINDINGS, and the single TOP ISSUE most likely to improve the score if fixed."
44
+
45
+ Read the agent's response. You need: the SCORE, the TOP ISSUE, and the file paths for diagnosis in Step 3. Record the score to `docs/plans/.build-state.md`. The full findings list is useful for diagnosis but does NOT need to persist in your context across iterations — once you've picked the top issue, the details of lower-priority findings can go. Append a row to the score log in `docs/plans/.build-state.md`:
46
+
47
+ | Iter | Score | Delta | Top Issue | Files |
48
+ |------|-------|-------|-----------|-------|
49
+
50
+ ## Step 2: CHECK EXIT
51
+
52
+ Stop the loop if ANY of these:
53
+
54
+ - **Score >= target** → done. Log "Target met at iteration [N]."
55
+ - **Iteration >= max** → done. Log "Max iterations reached. Final score: [N]."
56
+ - **Stall: last 2 scores show no improvement** (delta <= 0 twice in a row) → done. Log "Stalled at score [N]."
57
+
58
+ On stall or max iterations:
59
+ - **Interactive mode:** present score history + top remaining issue to user. Ask for direction.
60
+ - **Autonomous mode:** if score >= 60% of target, accept with warning. Otherwise skip. Log to `docs/plans/build-log.md`.
61
+
62
+ If not exiting, continue to Step 3.
63
+
64
+ ## Step 3: DIAGNOSE
65
+
66
+ Look at the findings from Step 1. Pick the ONE highest-impact issue — the single fix most likely to move the score. Do not try to fix everything at once. This is the autoresearch insight: one targeted change per iteration, measured impact.
67
+
68
+ ## Step 4: IMPROVE
69
+
70
+ Call the Agent tool — description: "Fix [top issue]" — mode: "bypassPermissions" — prompt:
71
+
72
+ "TARGETED FIX: [specific issue to fix, from diagnosis]. CONTEXT: [relevant architecture/criteria]. Make this specific change. Do not refactor unrelated code. Commit: 'fix: [description]'."
73
+
74
+ > **Do NOT pass the measurement agent's full findings to this agent. Only pass the single diagnosed issue and relevant file paths.**
75
+
76
+ ## Step 5: LOOP
77
+
78
+ Return to Step 1. Re-measure the artifact after the fix.
79
+
80
+ ---
81
+
82
+ ## Rules
83
+
84
+ <HARD-GATE>
85
+ AUTHOR-BIAS ELIMINATION: The measurement agent and the fix agent must NEVER share context.
86
+ - They MUST be separate Agent tool calls (separate subprocesses, separate context windows).
87
+ - The fix agent receives ONLY: (a) the single top issue diagnosed in Step 3, (b) the relevant file paths, (c) the acceptance criteria. It does NOT receive the measurement agent's full findings, score breakdown, or other issues.
88
+ - The measurement agent in the next iteration does NOT know what the fix agent did — it measures the artifact fresh.
89
+ </HARD-GATE>
90
+ - One fix per iteration. Measure its impact before fixing the next thing.
91
+ - Track ALL scores in `docs/plans/.build-state.md` so the history survives context compaction.
92
+ - If context was compacted mid-loop: read `docs/plans/.build-state.md`, find the Active Metric Loop section, resume from the last recorded iteration.
93
+ - CONTEXT HYGIENE: Measurement agents are analysis agents — read their full output for diagnosis. But once you've picked the top issue (Step 3) and dispatched the fix (Step 4), the detailed findings from THAT iteration are spent. Don't accumulate findings across iterations — each measurement is fresh.