buildanything 1.7.0 → 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 (222) 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/README.md +71 -61
  5. package/agents/ios-app-review-guardian.md +49 -0
  6. package/agents/ios-foundation-models-specialist.md +46 -0
  7. package/agents/ios-storekit-specialist.md +52 -0
  8. package/agents/ios-swift-architect.md +102 -0
  9. package/agents/ios-swift-search.md +130 -0
  10. package/agents/ios-swift-ui-design.md +104 -0
  11. package/commands/build.md +80 -176
  12. package/commands/fix.md +65 -0
  13. package/commands/setup.md +73 -0
  14. package/commands/ux-review.md +63 -0
  15. package/commands/verify.md +72 -0
  16. package/hooks/session-start +18 -1
  17. package/package.json +5 -2
  18. package/protocols/brainstorm.md +99 -0
  19. package/protocols/build-fix.md +52 -0
  20. package/protocols/cleanup.md +54 -0
  21. package/protocols/design.md +269 -0
  22. package/protocols/eval-harness.md +61 -0
  23. package/protocols/fake-data-detector.md +64 -0
  24. package/protocols/ios-context.md +235 -0
  25. package/protocols/ios-frameworks-map.md +323 -0
  26. package/protocols/ios-phase-branches.md +162 -0
  27. package/protocols/ios-preflight.md +27 -0
  28. package/protocols/metric-loop.md +93 -0
  29. package/protocols/planning.md +87 -0
  30. package/protocols/smoke-test.md +110 -0
  31. package/protocols/verify.md +67 -0
  32. package/protocols/web-phase-branches.md +201 -0
  33. package/skills/ios/_VENDORED.md +60 -0
  34. package/skills/ios/activitykit/LICENSE +131 -0
  35. package/skills/ios/activitykit/SKILL.md +505 -0
  36. package/skills/ios/activitykit/references/activitykit-patterns.md +868 -0
  37. package/skills/ios/app-intents/LICENSE +131 -0
  38. package/skills/ios/app-intents/SKILL.md +494 -0
  39. package/skills/ios/app-intents/references/appintents-advanced.md +1076 -0
  40. package/skills/ios/apple-on-device-ai/LICENSE +131 -0
  41. package/skills/ios/apple-on-device-ai/SKILL.md +505 -0
  42. package/skills/ios/apple-on-device-ai/references/coreml-conversion.md +425 -0
  43. package/skills/ios/apple-on-device-ai/references/coreml-optimization.md +344 -0
  44. package/skills/ios/apple-on-device-ai/references/foundation-models.md +508 -0
  45. package/skills/ios/apple-on-device-ai/references/mlx-swift.md +285 -0
  46. package/skills/ios/ios-26-platform/SKILL.md +53 -0
  47. package/skills/ios/ios-26-platform/references/automatic-adoption.md +161 -0
  48. package/skills/ios/ios-26-platform/references/backward-compat.md +238 -0
  49. package/skills/ios/ios-26-platform/references/liquid-glass.md +255 -0
  50. package/skills/ios/ios-26-platform/references/swiftui-apis.md +277 -0
  51. package/skills/ios/ios-26-platform/references/toolbar-navigation.md +250 -0
  52. package/skills/ios/ios-bootstrap/SKILL.md +98 -0
  53. package/skills/ios/ios-bootstrap/references/apple-docs-mcp-config.md +28 -0
  54. package/skills/ios/ios-bootstrap/references/new-project-dialog.md +41 -0
  55. package/skills/ios/ios-bootstrap/references/xcode-mcp-config.md +29 -0
  56. package/skills/ios/ios-debugger-agent/LICENSE +21 -0
  57. package/skills/ios/ios-debugger-agent/SKILL.md +58 -0
  58. package/skills/ios/ios-debugger-agent/agents/openai.yaml +4 -0
  59. package/skills/ios/ios-entitlements-generator/SKILL.md +47 -0
  60. package/skills/ios/ios-hig/SKILL.md +41 -0
  61. package/skills/ios/ios-hig/references/accessibility.md +81 -0
  62. package/skills/ios/ios-hig/references/content.md +142 -0
  63. package/skills/ios/ios-hig/references/feedback.md +123 -0
  64. package/skills/ios/ios-hig/references/interaction.md +199 -0
  65. package/skills/ios/ios-hig/references/performance-platform.md +129 -0
  66. package/skills/ios/ios-hig/references/privacy-permissions.md +181 -0
  67. package/skills/ios/ios-hig/references/visual-design.md +84 -0
  68. package/skills/ios/ios-info-plist-hardening/SKILL.md +130 -0
  69. package/skills/ios/ios-maestro-flow-author/SKILL.md +68 -0
  70. package/skills/ios/ios-maestro-flow-author/references/input-and-scroll.yaml +17 -0
  71. package/skills/ios/ios-maestro-flow-author/references/modal-and-dismiss.yaml +14 -0
  72. package/skills/ios/ios-maestro-flow-author/references/onboarding-flow.yaml +16 -0
  73. package/skills/ios/ios-maestro-flow-author/references/tab-navigation.yaml +13 -0
  74. package/skills/ios/ios-maestro-flow-author/references/tap-and-assert.yaml +9 -0
  75. package/skills/ios/swift-accessibility/LICENSE +21 -0
  76. package/skills/ios/swift-accessibility/SKILL.md +371 -0
  77. package/skills/ios/swift-accessibility/examples/before-after-appkit.md +446 -0
  78. package/skills/ios/swift-accessibility/examples/before-after-swiftui.md +441 -0
  79. package/skills/ios/swift-accessibility/examples/before-after-uikit.md +464 -0
  80. package/skills/ios/swift-accessibility/references/assistive-access.md +441 -0
  81. package/skills/ios/swift-accessibility/references/display-settings.md +491 -0
  82. package/skills/ios/swift-accessibility/references/dynamic-type.md +420 -0
  83. package/skills/ios/swift-accessibility/references/media-accessibility.md +421 -0
  84. package/skills/ios/swift-accessibility/references/motor-input.md +393 -0
  85. package/skills/ios/swift-accessibility/references/nutrition-labels.md +362 -0
  86. package/skills/ios/swift-accessibility/references/platform-specifics.md +515 -0
  87. package/skills/ios/swift-accessibility/references/semantic-structure.md +585 -0
  88. package/skills/ios/swift-accessibility/references/testing-auditing.md +507 -0
  89. package/skills/ios/swift-accessibility/references/voice-control.md +317 -0
  90. package/skills/ios/swift-accessibility/references/voiceover-swiftui.md +584 -0
  91. package/skills/ios/swift-accessibility/references/voiceover-uikit.md +519 -0
  92. package/skills/ios/swift-accessibility/references/wcag-mapping.md +167 -0
  93. package/skills/ios/swift-accessibility/resources/audit-template.swift +128 -0
  94. package/skills/ios/swift-accessibility/resources/qa-checklist.md +258 -0
  95. package/skills/ios/swift-concurrency/LICENSE +21 -0
  96. package/skills/ios/swift-concurrency/SKILL.md +171 -0
  97. package/skills/ios/swift-concurrency/references/_index.md +50 -0
  98. package/skills/ios/swift-concurrency/references/actors.md +660 -0
  99. package/skills/ios/swift-concurrency/references/async-algorithms.md +847 -0
  100. package/skills/ios/swift-concurrency/references/async-await-basics.md +266 -0
  101. package/skills/ios/swift-concurrency/references/async-sequences.md +710 -0
  102. package/skills/ios/swift-concurrency/references/core-data.md +560 -0
  103. package/skills/ios/swift-concurrency/references/glossary.md +135 -0
  104. package/skills/ios/swift-concurrency/references/linting.md +155 -0
  105. package/skills/ios/swift-concurrency/references/memory-management.md +569 -0
  106. package/skills/ios/swift-concurrency/references/migration.md +1104 -0
  107. package/skills/ios/swift-concurrency/references/performance.md +593 -0
  108. package/skills/ios/swift-concurrency/references/sendable.md +598 -0
  109. package/skills/ios/swift-concurrency/references/tasks.md +636 -0
  110. package/skills/ios/swift-concurrency/references/testing.md +592 -0
  111. package/skills/ios/swift-concurrency/references/threading.md +495 -0
  112. package/skills/ios/swift-security-expert/LICENSE +21 -0
  113. package/skills/ios/swift-security-expert/SKILL.md +470 -0
  114. package/skills/ios/swift-security-expert/references/biometric-authentication.md +565 -0
  115. package/skills/ios/swift-security-expert/references/certificate-trust.md +592 -0
  116. package/skills/ios/swift-security-expert/references/common-anti-patterns.md +690 -0
  117. package/skills/ios/swift-security-expert/references/compliance-owasp-mapping.md +537 -0
  118. package/skills/ios/swift-security-expert/references/credential-storage-patterns.md +721 -0
  119. package/skills/ios/swift-security-expert/references/cryptokit-public-key.md +505 -0
  120. package/skills/ios/swift-security-expert/references/cryptokit-symmetric.md +497 -0
  121. package/skills/ios/swift-security-expert/references/keychain-access-control.md +508 -0
  122. package/skills/ios/swift-security-expert/references/keychain-fundamentals.md +596 -0
  123. package/skills/ios/swift-security-expert/references/keychain-item-classes.md +476 -0
  124. package/skills/ios/swift-security-expert/references/keychain-sharing.md +458 -0
  125. package/skills/ios/swift-security-expert/references/migration-legacy-stores.md +727 -0
  126. package/skills/ios/swift-security-expert/references/secure-enclave.md +539 -0
  127. package/skills/ios/swift-security-expert/references/testing-security-code.md +781 -0
  128. package/skills/ios/swift-testing-expert/LICENSE +21 -0
  129. package/skills/ios/swift-testing-expert/SKILL.md +79 -0
  130. package/skills/ios/swift-testing-expert/references/_index.md +12 -0
  131. package/skills/ios/swift-testing-expert/references/async-testing-and-waiting.md +127 -0
  132. package/skills/ios/swift-testing-expert/references/expectations.md +145 -0
  133. package/skills/ios/swift-testing-expert/references/fundamentals.md +141 -0
  134. package/skills/ios/swift-testing-expert/references/migration-from-xctest.md +127 -0
  135. package/skills/ios/swift-testing-expert/references/parallelization-and-isolation.md +95 -0
  136. package/skills/ios/swift-testing-expert/references/parameterized-testing.md +284 -0
  137. package/skills/ios/swift-testing-expert/references/performance-and-best-practices.md +187 -0
  138. package/skills/ios/swift-testing-expert/references/traits-and-tags.md +114 -0
  139. package/skills/ios/swift-testing-expert/references/xcode-workflows.md +70 -0
  140. package/skills/ios/swiftdata-pro/LICENSE +21 -0
  141. package/skills/ios/swiftdata-pro/SKILL.md +102 -0
  142. package/skills/ios/swiftdata-pro/agents/openai.yaml +10 -0
  143. package/skills/ios/swiftdata-pro/assets/swiftdata-pro-icon.png +0 -0
  144. package/skills/ios/swiftdata-pro/assets/swiftdata-pro-icon.svg +29 -0
  145. package/skills/ios/swiftdata-pro/references/class-inheritance.md +104 -0
  146. package/skills/ios/swiftdata-pro/references/cloudkit.md +10 -0
  147. package/skills/ios/swiftdata-pro/references/core-rules.md +20 -0
  148. package/skills/ios/swiftdata-pro/references/indexing.md +27 -0
  149. package/skills/ios/swiftdata-pro/references/predicates.md +73 -0
  150. package/skills/ios/swiftui-design-principles/AGENTS.md +21 -0
  151. package/skills/ios/swiftui-design-principles/LICENSE +21 -0
  152. package/skills/ios/swiftui-design-principles/README.md +41 -0
  153. package/skills/ios/swiftui-design-principles/SKILL.md +605 -0
  154. package/skills/ios/swiftui-design-principles/metadata.json +10 -0
  155. package/skills/ios/swiftui-liquid-glass/LICENSE +21 -0
  156. package/skills/ios/swiftui-liquid-glass/SKILL.md +95 -0
  157. package/skills/ios/swiftui-liquid-glass/agents/openai.yaml +4 -0
  158. package/skills/ios/swiftui-liquid-glass/references/liquid-glass.md +280 -0
  159. package/skills/ios/swiftui-performance-audit/LICENSE +21 -0
  160. package/skills/ios/swiftui-performance-audit/SKILL.md +111 -0
  161. package/skills/ios/swiftui-performance-audit/agents/openai.yaml +4 -0
  162. package/skills/ios/swiftui-performance-audit/references/code-smells.md +150 -0
  163. package/skills/ios/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +46 -0
  164. package/skills/ios/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +29 -0
  165. package/skills/ios/swiftui-performance-audit/references/profiling-intake.md +44 -0
  166. package/skills/ios/swiftui-performance-audit/references/report-template.md +47 -0
  167. package/skills/ios/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +33 -0
  168. package/skills/ios/swiftui-performance-audit/references/understanding-improving-swiftui-performance.md +52 -0
  169. package/skills/ios/swiftui-pro/LICENSE +21 -0
  170. package/skills/ios/swiftui-pro/SKILL.md +108 -0
  171. package/skills/ios/swiftui-pro/agents/openai.yaml +10 -0
  172. package/skills/ios/swiftui-pro/assets/swiftui-pro-icon.png +0 -0
  173. package/skills/ios/swiftui-pro/assets/swiftui-pro-icon.svg +29 -0
  174. package/skills/ios/swiftui-pro/references/accessibility.md +13 -0
  175. package/skills/ios/swiftui-pro/references/api.md +39 -0
  176. package/skills/ios/swiftui-pro/references/data.md +43 -0
  177. package/skills/ios/swiftui-pro/references/design.md +31 -0
  178. package/skills/ios/swiftui-pro/references/hygiene.md +9 -0
  179. package/skills/ios/swiftui-pro/references/navigation.md +14 -0
  180. package/skills/ios/swiftui-pro/references/performance.md +46 -0
  181. package/skills/ios/swiftui-pro/references/swift.md +56 -0
  182. package/skills/ios/swiftui-pro/references/views.md +35 -0
  183. package/skills/ios/swiftui-ui-patterns/LICENSE +21 -0
  184. package/skills/ios/swiftui-ui-patterns/SKILL.md +100 -0
  185. package/skills/ios/swiftui-ui-patterns/agents/openai.yaml +4 -0
  186. package/skills/ios/swiftui-ui-patterns/references/app-wiring.md +201 -0
  187. package/skills/ios/swiftui-ui-patterns/references/async-state.md +96 -0
  188. package/skills/ios/swiftui-ui-patterns/references/components-index.md +50 -0
  189. package/skills/ios/swiftui-ui-patterns/references/controls.md +57 -0
  190. package/skills/ios/swiftui-ui-patterns/references/deeplinks.md +66 -0
  191. package/skills/ios/swiftui-ui-patterns/references/focus.md +90 -0
  192. package/skills/ios/swiftui-ui-patterns/references/form.md +97 -0
  193. package/skills/ios/swiftui-ui-patterns/references/grids.md +71 -0
  194. package/skills/ios/swiftui-ui-patterns/references/haptics.md +71 -0
  195. package/skills/ios/swiftui-ui-patterns/references/input-toolbar.md +51 -0
  196. package/skills/ios/swiftui-ui-patterns/references/lightweight-clients.md +93 -0
  197. package/skills/ios/swiftui-ui-patterns/references/list.md +86 -0
  198. package/skills/ios/swiftui-ui-patterns/references/loading-placeholders.md +38 -0
  199. package/skills/ios/swiftui-ui-patterns/references/macos-settings.md +71 -0
  200. package/skills/ios/swiftui-ui-patterns/references/matched-transitions.md +59 -0
  201. package/skills/ios/swiftui-ui-patterns/references/media.md +73 -0
  202. package/skills/ios/swiftui-ui-patterns/references/menu-bar.md +101 -0
  203. package/skills/ios/swiftui-ui-patterns/references/navigationstack.md +159 -0
  204. package/skills/ios/swiftui-ui-patterns/references/overlay.md +45 -0
  205. package/skills/ios/swiftui-ui-patterns/references/performance.md +62 -0
  206. package/skills/ios/swiftui-ui-patterns/references/previews.md +48 -0
  207. package/skills/ios/swiftui-ui-patterns/references/scroll-reveal.md +133 -0
  208. package/skills/ios/swiftui-ui-patterns/references/scrollview.md +87 -0
  209. package/skills/ios/swiftui-ui-patterns/references/searchable.md +71 -0
  210. package/skills/ios/swiftui-ui-patterns/references/sheets.md +155 -0
  211. package/skills/ios/swiftui-ui-patterns/references/split-views.md +72 -0
  212. package/skills/ios/swiftui-ui-patterns/references/tabview.md +114 -0
  213. package/skills/ios/swiftui-ui-patterns/references/theming.md +71 -0
  214. package/skills/ios/swiftui-ui-patterns/references/title-menus.md +93 -0
  215. package/skills/ios/swiftui-ui-patterns/references/top-bar.md +49 -0
  216. package/skills/ios/swiftui-view-refactor/LICENSE +21 -0
  217. package/skills/ios/swiftui-view-refactor/SKILL.md +207 -0
  218. package/skills/ios/swiftui-view-refactor/agents/openai.yaml +4 -0
  219. package/skills/ios/swiftui-view-refactor/references/mv-patterns.md +161 -0
  220. package/skills/ios/widgetkit/LICENSE +131 -0
  221. package/skills/ios/widgetkit/SKILL.md +502 -0
  222. package/skills/ios/widgetkit/references/widgetkit-advanced.md +871 -0
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: ios-swift-ui-design
3
+ description: READS `docs/plans/ios-design-board.md` + user-provided mockups/screenshots and produces a SwiftUI implementation plan for impl agents. Does NOT generate the design board itself (that's `/buildanything:build` Phase 3 Step 3.1). Use when starting from a visual design or UI description before feature planning.
4
+ tools: Read, Glob, Grep, Skill
5
+ model: opus
6
+ color: cyan
7
+ ---
8
+
9
+ # iOS UI Design Analysis
10
+
11
+ ## Identity
12
+
13
+ You are an expert UI/UX analyst for iOS applications.
14
+
15
+ **Mission:** READ `docs/plans/ios-design-board.md` + user-provided UI requirements (mockups, screenshots, OR text descriptions) and produce SwiftUI implementation specifications.
16
+ **Goal:** Produce detailed UI analysis that informs architecture and view implementation.
17
+
18
+ **Boundary:** This agent does NOT generate the design board. Design board generation is owned by `/buildanything:build` Phase 3 Step 3.1. If `docs/plans/ios-design-board.md` does not exist, HALT and instruct the user to run Phase 3 first.
19
+
20
+ ## CRITICAL: READ-ONLY MODE
21
+
22
+ **You MUST NOT create, edit, or delete any implementation files.**
23
+ Your role is UI analysis ONLY. Focus on understanding and specifying the UI requirements.
24
+
25
+ ## Context
26
+
27
+ **Platform:** iOS 26.0+, Swift 6.2+, Xcode 26.3
28
+ **Context Budget:** Target <100K tokens; prioritize critical UI design decisions.
29
+
30
+ ## Skill Usage
31
+
32
+ Invoke these skills when relevant:
33
+ - `swiftui-design-principles` — 10-rule polish checklist
34
+ - `swiftui-ui-patterns` — common SwiftUI patterns
35
+ - `swiftui-liquid-glass` — Liquid Glass material + iOS 26 aesthetics
36
+ - `ios-hig` — Human Interface Guidelines
37
+ - `ios-26-platform` — platform-level API changes
38
+
39
+ ## Input Types
40
+
41
+ This agent accepts ANY of the following:
42
+
43
+ ### Text Description
44
+ - Parse into concrete UI requirements
45
+ - Ask clarifying questions if ambiguous
46
+ - Suggest appropriate iOS patterns based on HIG
47
+ - **Most common input type** — no mockup required
48
+
49
+ ### Screenshot / Image / Mockup
50
+ - Analyze visual hierarchy
51
+ - Identify standard iOS components
52
+ - Note custom elements that need implementation
53
+ - Evaluate spacing, typography, color usage
54
+
55
+ ### Figma / Design Reference
56
+ - If URL provided, ask user to paste screenshots or describe key screens
57
+ - Work from the description/images provided
58
+
59
+ ## Analysis Checklist
60
+
61
+ For each screen or component, evaluate:
62
+
63
+ ### Component Identification
64
+ - [ ] Navigation pattern (NavigationStack, TabView, sheet, fullScreenCover)
65
+ - [ ] List/scroll patterns (List, ScrollView, LazyVStack)
66
+ - [ ] Input elements (TextField, Picker, Toggle, Slider)
67
+ - [ ] Media elements (Image, AsyncImage, video)
68
+ - [ ] Custom components needed
69
+
70
+ ### Layout Structure
71
+ - [ ] Container hierarchy (VStack, HStack, ZStack, Grid)
72
+ - [ ] Spacing and padding patterns
73
+ - [ ] Safe area handling
74
+ - [ ] Keyboard avoidance needs
75
+
76
+ ### HIG Compliance
77
+ - [ ] Standard iOS patterns used appropriately
78
+ - [ ] System colors and materials (including Liquid Glass where appropriate)
79
+ - [ ] Typography (system fonts, Dynamic Type support)
80
+ - [ ] Touch target sizes (minimum 44pt)
81
+ - [ ] Platform conventions (navigation, gestures)
82
+
83
+ ### Interaction Patterns
84
+ - [ ] Tap actions, swipe gestures, long-press menus
85
+ - [ ] Pull-to-refresh, drag and drop
86
+ - [ ] Haptic feedback points
87
+
88
+ ### State Requirements
89
+ - [ ] Data driving each view
90
+ - [ ] Loading, empty, error, and input states
91
+
92
+ ### Accessibility
93
+ - [ ] VoiceOver labels and actions
94
+ - [ ] Reduce Motion alternatives
95
+ - [ ] Color contrast
96
+ - [ ] Dynamic Type scaling
97
+
98
+ ## Output
99
+
100
+ Produce a structured UI plan: per-screen component tree, state requirements, HIG/accessibility notes, and SwiftUI implementation hints. Do not write view code — that's the implementer's job.
101
+
102
+ ---
103
+
104
+ Vendored from: https://github.com/johnrogers/claude-swift-engineering/blob/main/plugins/swift-engineering/agents/swift-ui-design.md
package/commands/build.md CHANGED
@@ -99,6 +99,12 @@ For implementation agents (Phase 5+): Do NOT paste the entire Design Document or
99
99
 
100
100
  Tag agent prompts with `[COMPLEXITY: S/M/L]` based on task size from `docs/plans/sprint-tasks.md`. This is advisory — the tag documents intent for future model routing support.
101
101
 
102
+ ### Mode-Specific Tool Stacks
103
+
104
+ Mode-specific tool stacks, per-phase branches, and persona rules are in separate files — the orchestrator loads only ONE based on `project_type` (see Phase 0 Step 0.1b below):
105
+ - iOS: `protocols/ios-phase-branches.md` (includes iOS Mode Tool Stack)
106
+ - Web: `protocols/web-phase-branches.md` (web defaults)
107
+
102
108
  ---
103
109
 
104
110
  ## Phase 0: Context & Pre-Flight
@@ -131,6 +137,30 @@ Before doing anything, scan for existing context:
131
137
  | **Partial context** | Some notes, conversation, rough sketch | Phase 1 runs fully. Feed context into brainstorming + research. |
132
138
  | **Raw idea** | One-line build request, no prior work | Phase 1 runs fully from scratch. |
133
139
 
140
+ ### Step 0.1b — Project Type Classification (iOS vs Web)
141
+
142
+ Scan the build request AND any context from Step 0.1 for iOS signals. Keywords: **iOS, iPhone, iPad, SwiftUI, Swift, App Store, TestFlight, Xcode, Apple, Liquid Glass, watchOS, visionOS, SwiftData, HIG**.
143
+
144
+ **Classification logic:**
145
+
146
+ | Signal | Action |
147
+ |---|---|
148
+ | iOS keywords present in prompt | Confirm with user: "This looks like an iOS app — confirm? [y/n]" |
149
+ | User confirms OR says iOS during brainstorming | Set `project_type: ios` in `docs/plans/.build-state.md` |
150
+ | `.xcodeproj` / `Package.swift` / `*.swift` files in existing codebase | Set `project_type: ios` automatically |
151
+ | No iOS signals, no Swift files | Default `project_type: web` (existing behavior) |
152
+
153
+ **Autonomous mode:** skip the confirmation prompt. If iOS keywords are present, set `project_type: ios` and log the inference to `docs/plans/build-log.md`.
154
+
155
+ **Conditional branch-file load:**
156
+ - If `project_type=ios`: load `protocols/ios-phase-branches.md` AND `protocols/ios-context.md` into session context. Reference `protocols/ios-frameworks-map.md` by path only (do NOT load — agents Read it on-demand).
157
+ - If `project_type=web`: load `protocols/web-phase-branches.md` into session context.
158
+ - Load only ONE branch file. The other mode's content is irrelevant to this build.
159
+
160
+ Record the classification in `docs/plans/.build-state.md` as a top-level field: `project_type: ios` or `project_type: web`. This field survives compaction and gates every branching block below.
161
+
162
+ **Mode-specific additions to Phase 0:** See `protocols/ios-phase-branches.md` §Phase 0 additions (iOS only). No web-specific Phase 0 additions.
163
+
134
164
  ### Step 0.2 — Human Prerequisites Checklist
135
165
 
136
166
  Identify everything that requires HUMAN action before going heads-down:
@@ -169,12 +199,24 @@ Autonomous mode: Log checklist to `docs/plans/build-log.md`. Create `.env.exampl
169
199
 
170
200
  ---
171
201
 
202
+ ## Phase -1: iOS Bootstrap (iOS-only, greenfield only)
203
+
204
+ **If `project_type=ios` AND no `.xcodeproj` exists:** follow `protocols/ios-phase-branches.md` §Phase -1 — iOS Bootstrap. Otherwise skip entirely (including all of web mode).
205
+
206
+ **Compaction checkpoint.** Update `docs/plans/.build-state.md` per the format above.
207
+
208
+ ---
209
+
172
210
  ## Phase 1: Brainstorm & Research
173
211
 
174
212
  **Goal**: Turn the raw idea into a validated Design Document grounded in research. This ensures Phase 2 architects receive a design, not a guess.
175
213
 
176
214
  **Skip if** Step 0.1 classified context as "Full design" — go straight to Phase 2.
177
215
 
216
+ **Mode-specific branch:**
217
+ - If `project_type=ios`: follow `protocols/ios-phase-branches.md` §Phase 1 (iOS skill bundle, ios-swift-architect, App Store/TestFlight/iOS 26 research angles)
218
+ - If `project_type=web`: no additional branch instructions — proceed with the steps below.
219
+
178
220
  ### Step 1.1 — Brainstorming
179
221
 
180
222
  Follow the Brainstorm Protocol (`protocols/brainstorm.md`).
@@ -264,6 +306,10 @@ Update TodoWrite and `docs/plans/.build-state.md`.
264
306
 
265
307
  **Goal**: Convert the validated Design Document into a concrete architecture and ordered task list. Every agent receives the Design Document — not just the build request.
266
308
 
309
+ **Mode-specific branch:**
310
+ - If `project_type=ios`: follow `protocols/ios-phase-branches.md` §Phase 2 (replaces Backend/Frontend architecture dispatch with SwiftUI/SwiftData/Concurrency/iOS security; adds Feature Flag Resolution at end of phase)
311
+ - If `project_type=web`: no additional branch instructions — proceed with the steps below.
312
+
267
313
  ### Step 2.1 — Explore (existing codebase only)
268
314
 
269
315
  If existing code, call the Agent tool — description: "Explore codebase" — prompt: "Explore this codebase. Map architecture layers, file conventions, testing patterns, existing features. Report findings."
@@ -308,59 +354,27 @@ Save to `docs/plans/sprint-tasks.md`.
308
354
 
309
355
  Update TodoWrite and `docs/plans/.build-state.md`.
310
356
 
357
+ **iOS feature flag resolution:** if `project_type=ios`, resolve `ios_features` before leaving Phase 2 per `protocols/ios-phase-branches.md` §Phase 2 → Feature Flag Resolution.
358
+
311
359
  **Compaction checkpoint.** Update `docs/plans/.build-state.md` per the format above.
312
360
 
313
361
  ---
314
362
 
315
363
  ## Phase 3: Design & Visual Identity
316
364
 
317
- **Goal**: Transform architecture into a research-backed visual design system, proven with Playwright screenshots. Fully autonomous agents research, decide, and iterate without user input.
365
+ **Goal**: Transform architecture into a research-backed visual design system grounded in real references (competitor sites for web, HIG + App Store for iOS).
318
366
 
319
367
  **Skip if** the project has no user-facing frontend (CLI tools, pure APIs, backend services).
320
368
 
321
369
  <HARD-GATE>
322
- UI/UX IS THE PRODUCT. This phase is a full peer to Architecture and Build — not a footnote, not an afterthought, not a "nice to have." Do NOT skip, compress, or rush this phase for any reason. The agents must research real competitors and award-winning sites, make deliberate visual choices backed by that research, build a living style guide with every component rendered and interactive, and iterate with Playwright-verified visual QA before a single line of product code is written.
370
+ UI/UX IS THE PRODUCT. This phase is a full peer to Architecture and Build — not a footnote, not an afterthought, not a "nice to have." Do NOT skip, compress, or rush this phase for any reason. Agents must research real references, make deliberate visual choices backed by that research, and iterate with verified visual QA before a single line of product code is written.
323
371
 
324
- Phase 4 (Foundation) WILL NOT START without `docs/plans/visual-design-spec.md`. If it does not exist, return here.
372
+ Phase 4 (Foundation) WILL NOT START without the design artifact for this mode (`docs/plans/visual-design-spec.md` for web, `docs/plans/ios-design-board.md` for iOS). If it does not exist, return here.
325
373
  </HARD-GATE>
326
374
 
327
- ### Step 3.1 — Design Research (2 agents, parallel, both use Playwright)
328
-
329
- Follow the Design Protocol (`protocols/design.md`), Step 3.1.
330
-
331
- Call the Agent tool 2 times in one message:
332
-
333
- 1. Description: "Competitive visual audit" — Prompt: "Research the top 5-8 competitors/analogues for: [product description]. Use Playwright to screenshot each site (desktop 1920x1080 + mobile 375x812). Screenshot standout components (hero, cards, forms, nav, CTAs). Save to docs/plans/design-references/competitors/. Analyze visual language: colors, typography, spacing, what feels premium vs cheap. Rank by visual quality. DESIGN DOC: [paste]."
334
-
335
- 2. Description: "Design inspiration mining" — Prompt: "Search Awwwards.com, Godly.website, SiteInspire for award-winning sites in category: [product category]. Use Playwright to screenshot top 5-8 results + standout components. Save to docs/plans/design-references/inspiration/. Identify visual trends, what separates best-in-class from generic. DESIGN DOC: [paste]."
336
-
337
- After both return, synthesize a **Design Research Brief** to `docs/plans/design-research.md`. Include all screenshot paths.
338
-
339
- ### Step 3.2 — Design Direction (2 agents, sequential)
340
-
341
- Follow the Design Protocol (`protocols/design.md`), Step 3.2.
342
-
343
- 1. Call the Agent tool — description: "UX architecture" — Prompt: "Create structural design foundation. INPUTS: frontend architecture section from architecture.md [paste], Design Research Brief [paste], reference screenshot paths [list], user persona [paste]. OUTPUT: information architecture, layout strategy, component hierarchy, responsive approach, interaction patterns. Base decisions on competitive research, not generic patterns."
344
-
345
- 2. Call the Agent tool — description: "Visual design spec" — Prompt: "Create the Visual Design Spec with AUTONOMOUS decisions — pick the single best direction, do not present options. INPUTS: UX foundation [paste previous output], Design Research Brief [paste], reference screenshot paths [list], user persona [paste]. OUTPUT: color system (with hex, light+dark), typography (Google Fonts, mathematical scale), 8px spacing system, tinted shadow system, border radius, animation/motion, component styles with ALL states. Every choice must cite the research. Apply anti-AI-template rules from the Design Protocol. Save to docs/plans/visual-design-spec.md."
346
-
347
- ### Step 3.3 — Living Style Guide (1 implementation agent)
348
-
349
- Follow the Design Protocol (`protocols/design.md`), Step 3.3.
350
-
351
- Call the Agent tool — description: "Build living style guide" — mode: "bypassPermissions" — prompt: "[COMPLEXITY: L] Build a living style guide page (/design-system route or standalone HTML). INPUTS: Visual Design Spec [paste], UX foundation [paste relevant sections], reference screenshots [list paths — these are your quality targets]. Must include rendered, interactive examples of: color swatches, typography scale, spacing scale, buttons (all states), form elements (all states), cards, navigation, feedback components (alerts, toasts, spinners, empty states), modals/overlays, and layout grid examples. Every component interactive (hover, focus, transitions work). Mobile-responsive. This ships with the product. Commit: 'feat: living style guide'."
352
-
353
- ### Step 3.4 — Visual QA Loop (Playwright + Metric Loop)
354
-
355
- Run the Metric Loop Protocol (`protocols/metric-loop.md`) using the measurement criteria from the Design Protocol (`protocols/design.md`, Step 3.4).
356
-
357
- Measurement: Playwright screenshots of the living style guide sections (desktop + mobile). Design critic agent scores 0-100 across 6 dimensions: spacing/alignment, typography hierarchy, color harmony, component polish, responsive quality, originality (anti-AI-template check). Receives screenshots + Visual Design Spec + reference screenshots.
358
-
359
- **Target: 80. Max 5 iterations.** On stall: accept if >= 65, log warning below 65.
360
-
361
- ### Step 3.5 — Autonomous Quality Gate
362
-
363
- Log to `docs/plans/build-log.md`: final screenshot paths, score history table, design decisions, originality score. No user pause. Proceed to Phase 4.
375
+ **Mode-specific branch:**
376
+ - If `project_type=ios`: follow `protocols/ios-phase-branches.md` §Phase 3 (HIG + App Store + screenlane harvest → iOS Design Board, SwiftUI Preview QA loop, max 3 iterations)
377
+ - If `project_type=web`: follow `protocols/web-phase-branches.md` §Phase 3 (competitor/Awwwards research → Visual Design Spec → living style guide at `/design-system` → Playwright visual QA, max 5 iterations)
364
378
 
365
379
  **Compaction checkpoint.** Update `docs/plans/.build-state.md` per the format above.
366
380
 
@@ -369,22 +383,16 @@ Log to `docs/plans/build-log.md`: final screenshot paths, score history table, d
369
383
  ## Phase 4: Foundation
370
384
 
371
385
  <HARD-GATE>
372
- Before starting Phase 4: Phase 2 must be approved AND Phase 3 must have produced `docs/plans/visual-design-spec.md`.
373
- If visual-design-spec.md does not exist, DO NOT PROCEED. Return to Phase 3.
374
- Step 4.2 (Design System) MUST implement from visual-design-spec.md not generic architecture tokens.
386
+ Before starting Phase 4: Phase 2 must be approved AND Phase 3 must have produced the design artifact for this mode.
387
+ - Web: `docs/plans/visual-design-spec.md` must exist.
388
+ - iOS: `docs/plans/ios-design-board.md` must exist.
389
+ If the artifact does not exist, DO NOT PROCEED. Return to Phase 3.
390
+ Step 4.2 (Design System) MUST implement from the design artifact — not generic architecture tokens.
375
391
  </HARD-GATE>
376
392
 
377
- ### Step 4.1 Scaffolding
378
-
379
- Call the Agent tool description: "Project scaffolding" — mode: "bypassPermissions" — prompt: "[COMPLEXITY: M] Set up the project from this architecture: [paste]. Create directory structure, dependencies, build tooling, linting config, test framework with one passing test, .gitignore, .env.example. Commit: 'feat: initial scaffolding'."
380
-
381
- ### Step 4.2 — Design System (frontend only)
382
-
383
- Call the Agent tool — description: "Design system setup" — mode: "bypassPermissions" — prompt: "Implement the design system from the Visual Design Spec: [paste from docs/plans/visual-design-spec.md]. Create CSS tokens matching the spec's color system, typography scale, spacing system, shadow/elevation tokens, and base layout components. The living style guide from Phase 3 is the reference implementation — components must match. Commit: 'feat: design system'."
384
-
385
- ### Step 4.2b — Acceptance Test Scaffolding
386
-
387
- Call the Agent tool — description: "Scaffold acceptance tests" — mode: "bypassPermissions" — prompt: "Read docs/plans/sprint-tasks.md. For every task with a Behavioral Test field, create a Playwright test stub in tests/e2e/acceptance/. Use Page Object Model. Each test should: navigate to the page, perform the interaction, assert the expected outcome. Tests should FAIL right now (features aren't built yet) — that's correct. Also ensure agent-browser is available (run `which agent-browser`). Commit: 'test: scaffold acceptance tests from sprint tasks'."
393
+ **Mode-specific branch (Steps 4.1, 4.2, 4.2b):**
394
+ - If `project_type=ios`: follow `protocols/ios-phase-branches.md` §Phase 4 (entitlements generator + Info.plist hardening, XcodeBuildMCP folder structure, SwiftUI design tokens, Maestro flow stubs)
395
+ - If `project_type=web`: follow `protocols/web-phase-branches.md` §Phase 4 (web project scaffolding, CSS design system tokens, Playwright acceptance test stubs)
388
396
 
389
397
  ### Step 4.3 — Metric Loop: Scaffold Health
390
398
 
@@ -411,18 +419,20 @@ Update TodoWrite and state.
411
419
  ## Phase 5: Build — Metric-Driven Dev Loops
412
420
 
413
421
  <HARD-GATE>
414
- Before starting: Phase 2 must be approved, Phase 3 must produce docs/plans/visual-design-spec.md, Phase 4 must pass. You MUST call the Agent tool for EVERY task. No exceptions.
422
+ Before starting: Phase 2 must be approved, Phase 3 must produce `docs/plans/visual-design-spec.md` (web) or `docs/plans/ios-design-board.md` (iOS), Phase 4 must pass. You MUST call the Agent tool for EVERY task. No exceptions.
415
423
  </HARD-GATE>
416
424
 
425
+ **Mode-specific branch (Step 5.1 implement, Step 5.2 metric loop, Step 5.3b smoke test):**
426
+ - If `project_type=ios`: follow `protocols/ios-phase-branches.md` §Phase 5 (iOS skill bundle, feature-flag-gated skill loading, iOS implement prompt, SwiftUI Preview metric loop, Maestro smoke tests)
427
+ - If `project_type=web`: follow `protocols/web-phase-branches.md` §Phase 5 (web implement prompt, agent-browser metric loop, localhost smoke tests)
428
+
417
429
  Expand TodoWrite with each sprint task.
418
430
 
419
- **For EACH task:**
431
+ **For EACH task, run Steps 5.1 → 5.1b → 5.2 → 5.3 → 5.3b → 5.4 below.** Step 5.1 implementation prompt and Step 5.3b smoke test technology are defined in the mode-specific branch file. The remaining steps (cleanup, loop exit, verification) are mode-agnostic and live here.
420
432
 
421
433
  ### Step 5.1 — Implement
422
434
 
423
- Call the Agent tool — description: "[task name]" — mode: "bypassPermissions" prompt: "TASK: [task description + acceptance criteria]. HANDOFF — Architecture section: [paste ONLY the relevant section from architecture.md]. Design section: [paste ONLY the relevant section from the design doc]. Previous task output: [what the last completed task produced, if relevant]. For UI tasks: the living style guide at /design-system shows every component's exact styling and states — match it. Implement fully with real code and tests. Commit: 'feat: [task]'. Report what you built, files changed, and test results."
424
-
425
- Pick the right developer framing: frontend, backend, AI, etc. Set `[COMPLEXITY: S/M/L]` based on the task's Size from sprint-tasks.md.
435
+ Per the mode-specific branch file referenced above. Pick the right developer framing: frontend, backend, AI, etc. Set `[COMPLEXITY: S/M/L]` based on the task's Size from sprint-tasks.md.
426
436
 
427
437
  ### Step 5.1b — Cleanup (De-Sloppify)
428
438
 
@@ -438,7 +448,7 @@ Call the Agent tool — description: "Cleanup [task name]" — mode: "bypassPerm
438
448
 
439
449
  ### Step 5.2 — Metric Loop: Task Quality
440
450
 
441
- Run the Metric Loop Protocol on the task implementation. Define a metric based on the task's acceptance criteria. For UI-facing tasks, include behavioral verification: the measurement agent should use agent-browser to verify the feature renders and responds to interaction, not just read the code. Max 5 iterations.
451
+ Run the Metric Loop Protocol on the task implementation. Define a metric based on the task's acceptance criteria. For UI-facing tasks, include behavioral verification per the mode-specific branch file (web: agent-browser; iOS: SwiftUI Preview captures). Max 5 iterations.
442
452
 
443
453
  ### Step 5.3 — Loop Exit
444
454
 
@@ -454,11 +464,9 @@ After each task: update TodoWrite and `docs/plans/.build-state.md`.
454
464
 
455
465
  Skip if this task has no Behavioral Test criteria (API-only, config, infrastructure tasks).
456
466
 
457
- Run the Smoke Test Protocol (`protocols/smoke-test.md`). This uses agent-browser to open the app, execute the task's behavioral acceptance criteria, and verify the feature actually works.
467
+ Run the Smoke Test Protocol (`protocols/smoke-test.md`). Technology is mode-specific follow the branch file (web: agent-browser + localhost; iOS: Maestro flow against simulator via XcodeBuildMCP). Evidence saved to `docs/plans/evidence/[task-name]/`.
458
468
 
459
- Evidence saved to `docs/plans/evidence/[task-name]/`: annotated screenshot, snapshot diff, error log, network log, HAR file.
460
-
461
- On FAIL: spawn fix agent with the evidence. The fix agent receives: what was expected (from acceptance criteria), what actually happened (snapshot diff + errors + screenshot), and the relevant source files. Max 2 fix-and-retest cycles.
469
+ On FAIL: spawn fix agent with the evidence (expected vs actual, errors, screenshots, relevant source files). Max 2 fix-and-retest cycles.
462
470
 
463
471
  On PASS: proceed to Step 5.4.
464
472
 
@@ -476,117 +484,9 @@ Run the Verification Protocol (`protocols/verify.md`). If FAIL, fix before start
476
484
 
477
485
  Run the Verification Protocol (`protocols/verify.md`). All checks must pass before starting expensive audit agents.
478
486
 
479
- ### Step 6.1 Initial Audit (5 agents in parallel, ONE message)
480
-
481
- Read the NFRs from `docs/plans/sprint-tasks.md`. Pass the relevant NFR thresholds to each audit agent so they have concrete targets, not generic checks.
482
-
483
- Call the Agent tool 5 times in one message:
484
-
485
- 1. Description: "API testing" — Prompt: "Comprehensive API validation: all endpoints, edge cases, error responses, auth flows. NFR targets: [paste performance and reliability NFRs]. Report findings with counts."
486
-
487
- 2. Description: "Performance audit" — Prompt: "Measure response times, identify bottlenecks, flag performance issues. NFR targets: [paste performance NFRs — e.g., API < 200ms, page load < 3s]. Report benchmarks AGAINST these targets."
488
-
489
- 3. Description: "Accessibility audit" — Prompt: "WCAG compliance audit on all interfaces. NFR target: [paste accessibility NFR — e.g., WCAG AA]. Check screen reader, keyboard nav, contrast. Report issues with counts."
490
-
491
- 4. Description: "Security audit" — Prompt: "Security review: auth, input validation, data exposure, dependency vulnerabilities. NFR targets: [paste security NFRs]. Report findings with severity."
492
-
493
- 5. Description: "UX quality audit" — Prompt: "UX quality review of every user-facing page. NFR targets: [paste accessibility NFRs]. First, screenshot the living style guide at /design-system as your reference for how components should look. Then review every product page and check: loading states (every async action must show a loading indicator), error states (every form and API call must show user-friendly error feedback), empty states (every list/table must handle zero items gracefully), mobile responsiveness (test at 375px viewport — touch targets >= 44px, no horizontal scroll, readable text), form validation (inline feedback, not just alert()), transition smoothness (no layout shifts, no janky animations), visual consistency (compare each page's components against the style guide — buttons, inputs, cards, colors, spacing should match). Report issues with page, severity, and screenshot."
494
-
495
- ### Step 6.1b — Eval Harness
496
-
497
- Run the Eval Harness Protocol (`protocols/eval-harness.md`). Define 8-15 concrete, executable eval cases from the audit findings and architecture doc. For UI flows, eval cases should use agent-browser: "agent-browser open /dashboard -> agent-browser click @submit -> agent-browser wait --text Success -> expect text contains confirmation ID". Run the eval agent. Record baseline pass rate. CRITICAL and HIGH failures feed into the metric loop in Step 6.2 as specific issues to fix.
498
-
499
- ### Step 6.2 — Metric Loop: Hardening Quality
500
-
501
- Run the Metric Loop Protocol on the full codebase using audit findings as initial input. Define a composite metric based on what this project needs. Max 4 iterations.
502
-
503
- When fixing, dispatch to the RIGHT specialist. Security → security agent. Accessibility → frontend agent. Don't send everything to one agent.
504
-
505
- ### Step 6.2b — Eval Re-run
506
-
507
- Re-run the Eval Harness after the metric loop exits. All CRITICAL eval cases must now pass. If any CRITICAL case still fails, include it as evidence for the Reality Checker.
508
-
509
- ### Step 6.2c — E2E Testing (3 mandatory iterations)
510
-
511
- <HARD-GATE>
512
- ALL 3 ITERATIONS ARE MANDATORY. Do NOT stop after iteration 1 even if all tests pass. The purpose of 3 runs is to catch flaky tests, timing-dependent failures, and race conditions that only surface on repeated execution. Skip this step ONLY if the project has no user-facing frontend.
513
- </HARD-GATE>
514
-
515
- Generate and execute end-to-end tests using Playwright against the running application. Tests cover the **User Journeys** defined in `docs/plans/sprint-tasks.md` (Step 0 of the Planning Protocol). Each journey = one E2E test file.
516
-
517
- **Iteration 1 — Generate & Run:**
518
-
519
- Call the Agent tool — description: "E2E test generation" — mode: "bypassPermissions" — prompt:
520
-
521
- "[COMPLEXITY: L] Generate and run end-to-end Playwright tests for this application.
522
-
523
- INPUTS:
524
- - User Journeys from docs/plans/sprint-tasks.md: [paste the User Journeys section — each journey becomes one E2E test]
525
- - Architecture doc (API contracts): [paste relevant sections from docs/plans/architecture.md]
526
- - NFRs from docs/plans/sprint-tasks.md: [paste — use performance thresholds as test assertions]
527
- - Visual Design Spec (component selectors): [paste relevant sections from docs/plans/visual-design-spec.md]
528
-
529
- REQUIREMENTS:
530
- 1. One E2E test per User Journey from sprint-tasks.md (each journey = one test file covering the full flow)
531
- 2. Use Page Object Model pattern — one page object per major view
532
- 3. Use data-testid selectors (add them to components if missing)
533
- 4. Wait for API responses, NEVER use arbitrary timeouts (no waitForTimeout)
534
- 5. Capture screenshots at critical verification points
535
- 6. Configure multi-browser: Chromium + Firefox + WebKit
536
- 7. Set up playwright.config.ts with: fullyParallel, retries: 0 (we handle retries ourselves), screenshot: 'only-on-failure', video: 'retain-on-failure', trace: 'on-first-retry'
537
- 8. Run all tests. Report: total, passed, failed, with failure details and screenshot paths.
538
- 9. Commit: 'test: e2e test suite for critical user journeys'
539
-
540
- Test priority:
541
- - CRITICAL: Auth, core feature happy path, data submission, payment/transaction flows
542
- - HIGH: Search, filtering, navigation, error states
543
- - MEDIUM: Responsive layout, animations, edge cases"
544
-
545
- Record results: total tests, pass count, fail count, failure details. Log to `docs/plans/.build-state.md` under `## E2E Testing`:
546
-
547
- ```
548
- | Iter | Total | Passed | Failed | Flaky | Top Failure |
549
- |------|-------|--------|--------|-------|-------------|
550
- | 1 | ... | ... | ... | ... | ... |
551
- ```
552
-
553
- **Iteration 2 — Fix & Re-run:**
554
-
555
- Call the Agent tool — description: "E2E fix iteration 2" — mode: "bypassPermissions" — prompt: "[COMPLEXITY: M] Fix E2E test failures from iteration 1: [paste failure details — test names, error messages, screenshot paths]. Diagnose each as real bug, flaky test, or missing selector. Fix accordingly — do NOT delete or skip tests. Re-run ALL tests. Commit: 'fix: e2e test failures iteration 2'."
556
-
557
- Record results in the E2E table. Identify flaky candidates (passed iter 1, failed iter 2 or vice versa).
558
-
559
- **Iteration 3 — Final Stability Run:**
560
-
561
- Call the Agent tool — description: "E2E stability run" — mode: "bypassPermissions" — prompt: "[COMPLEXITY: M] Final E2E stability run (3 of 3). Previous results — Iter 1: [pass/fail counts], Iter 2: [pass/fail counts], Flaky candidates: [list]. Run ALL tests with --repeat-each=3. Quarantine inconsistent tests with test.fixme(). Fix remaining consistent failures. PASS CRITERIA: 95%+ pass rate (quarantined flaky tests excluded but logged). Commit: 'test: e2e stability fixes iteration 3'."
562
-
563
- Record final results. Include in Reality Checker evidence.
564
-
565
- ### Step 6.2d — Autonomous Dogfooding
566
-
567
- Run the agent-browser dogfood skill against the running app. Unlike the per-task smoke tests (which verify specific acceptance criteria), dogfooding is **exploratory** — it autonomously navigates every reachable page, clicks buttons, fills forms, checks console errors, and finds issues we didn't think to test.
568
-
569
- Start the dev server if not running. Then invoke the dogfood skill:
570
-
571
- Call the Agent tool — description: "Dogfood the app" — mode: "bypassPermissions" — prompt: "Run the agent-browser dogfood skill against the running app at http://localhost:[port]. Explore every reachable page. Click every button. Fill every form. Check console for errors. Report a structured list of issues with severity ratings (critical/high/medium/low), screenshots, and repro steps. If dogfood skill is not available, use agent-browser manually: snapshot each page, click all interactive elements, check errors and network requests. Also evaluate UX quality: missing loading states, poor error messages, broken mobile layouts (resize to 375px), visual inconsistencies, missing empty states, form validation gaps. Report UX issues separately from functional issues."
572
-
573
- **Fix loop:** For each CRITICAL or HIGH issue found:
574
- 1. Classify: is this a code bug (fix in Phase 5 style — spawn implementation fix agent) or a structural problem (needs architecture change — spawn architect agent to propose a fix plan, then implementation agent to execute)?
575
- 2. Spawn the appropriate fix agent with: the issue description, repro steps, screenshot, affected page/component.
576
- 3. After fixes, re-run dogfood on the affected pages only (not the full app). If new CRITICAL/HIGH issues appear, repeat. Max 3 fix cycles.
577
-
578
- MEDIUM/LOW issues: log to `docs/plans/build-log.md` for the Reality Checker.
579
-
580
- ### Step 6.2e — Fake Data Detector
581
-
582
- Call the Agent tool — description: "Fake data audit" — mode: "bypassPermissions" — prompt: "Run the Fake Data Detector Protocol (protocols/fake-data-detector.md). Check for mock/hardcoded data in production paths. Static analysis: grep for Math.random() business data, hardcoded API responses, setTimeout faking async, placeholder text. Dynamic analysis: inspect HAR files from docs/plans/evidence/ for missing real API calls, static responses, absent WebSocket traffic. Report findings with file:line references and severity."
583
-
584
- **Fix loop:** For each CRITICAL finding:
585
- 1. Spawn a fix agent with: the finding (file:line, what's fake, what it should be), and the relevant source files.
586
- 2. The fix agent replaces fake data with real API calls, real WebSocket connections, real data sources. If real data sources aren't available (missing API keys, no backend), the fix agent must flag this as a blocker — not paper over it with better-looking fake data.
587
- 3. After fixes, re-run the fake data detector (static checks only — fast). Max 2 fix cycles.
588
-
589
- Remaining findings feed into the Reality Checker in Step 6.4.
487
+ **Mode-specific branch (Steps 6.1 6.2e):**
488
+ - If `project_type=ios`: follow `protocols/ios-phase-branches.md` §Phase 6 — dispatch iOS twin commands (`/buildanything:verify` → `/buildanything:ux-review` → `/buildanything:fix`) in sequence. Skip Steps 6.1, 6.1b, 6.2, 6.2b, 6.2c, 6.2d, 6.2e. Then run Step 6.4 Reality Check below with iOS evidence.
489
+ - If `project_type=web`: follow `protocols/web-phase-branches.md` §Phase 6 run Steps 6.1 (5-agent audit), 6.1b (eval harness), 6.2 (metric loop), 6.2b (eval re-run), 6.2c (Playwright E2E, 3 mandatory iterations), 6.2d (agent-browser dogfood), 6.2e (fake data detector). Then run Step 6.4 Reality Check below.
590
490
 
591
491
  ### Step 6.4 — Reality Check
592
492
 
@@ -618,6 +518,10 @@ Do not loop forever.
618
518
 
619
519
  ## Phase 7: Ship
620
520
 
521
+ **Mode-specific branch (Step 7.1 documentation + deploy):**
522
+ - If `project_type=ios`: follow `protocols/ios-phase-branches.md` §Phase 7 — ship pipeline is optional (simulator-only is a valid end-state). If shipping, run asc-* agents + fastlane. Skip web Step 7.1 below.
523
+ - If `project_type=web`: follow `protocols/web-phase-branches.md` §Phase 7 (Step 7.1 documentation + deploy notes).
524
+
621
525
  ### Step 7.0 — Pre-Ship Verification
622
526
 
623
527
  Run the Verification Protocol (`protocols/verify.md`). All checks must pass before documenting and shipping. If FAIL persists after 3 fix attempts, return to Phase 6.
@@ -635,7 +539,7 @@ If any features are MISSING: spawn implementation agents to build them, then re-
635
539
 
636
540
  ### Step 7.1 — Documentation
637
541
 
638
- Call the Agent tool — description: "Documentation" — mode: "bypassPermissions" prompt: "Write project docs: README with setup/architecture/usage, API docs if applicable, deployment notes. Commit: 'docs: project documentation'."
542
+ Per the mode-specific branch file referenced at the top of Phase 7.
639
543
 
640
544
  ### Step 7.2 — Metric Loop: Documentation Quality
641
545
 
package/commands/fix.md CHANGED
@@ -9,6 +9,15 @@ Input: $ARGUMENTS
9
9
 
10
10
  ---
11
11
 
12
+ ## Project-type branching
13
+
14
+ Read `docs/plans/.build-state.md` → `project_type`.
15
+
16
+ - **If `project_type=web`** (or unset): continue with the web flow below (Steps 1-5, unchanged).
17
+ - **If `project_type=ios`**: jump to **§ iOS Fix (project_type=ios)** at the bottom of this file and run that twin instead. Do not run the web steps.
18
+
19
+ ---
20
+
12
21
  ## Step 1: Scope the Bug
13
22
 
14
23
  Parse the user's description. Identify:
@@ -87,3 +96,59 @@ State concisely:
87
96
  - **Cause**: why it was broken (one sentence)
88
97
  - **Fix**: what was changed and in which files
89
98
  - **Evidence**: before and after screenshots taken in Steps 2 and 4
99
+
100
+ ---
101
+
102
+ ## iOS Fix (project_type=ios)
103
+
104
+ Load `protocols/ios-context.md` as your persona. Same verb (fix one bug), different stack: XcodeBuildMCP + Maestro instead of agent-browser + localhost.
105
+
106
+ ### i1. Preflight
107
+ **Run iOS preflight:** see `protocols/ios-preflight.md`. If any check fails, stop and report — do not try to scaffold.
108
+
109
+ ### i2. Reproduce
110
+ - Boot the target simulator via XcodeBuildMCP.
111
+ - Install + launch the app (`BuildProject` if needed, then install the `.app`).
112
+ - Trigger the bug via ONE of:
113
+ 1. **Existing Maestro flow** — replay the failing flow in `maestro/` if one exists.
114
+ 2. **Ad-hoc sim navigation** — drive the sim via XcodeBuildMCP UI tools to reach the bug.
115
+ 3. **User demo** — if interaction is complex, ask user to reproduce once while you observe.
116
+ - Capture evidence: sim screenshot (`before-fix.png`) + crash log / console output (if any) via XcodeBuildMCP.
117
+ - If the bug cannot be reproduced: save screenshot, report observed state, stop.
118
+
119
+ ### i3. Classify
120
+ Match the symptom to exactly one row. Dispatch the skill in the rightmost column.
121
+
122
+ | Symptom | Classification | Fix skill / agent |
123
+ |---|---|---|
124
+ | View renders wrong, modifier order, missing `@State`/`@Binding`, layout broken | SwiftUI bug | `skills/ios/swiftui-pro` |
125
+ | Data race, actor isolation warning, `Sendable` violation, hang on main | Concurrency | `skills/ios/swift-concurrency` |
126
+ | `@Query` not updating, predicate wrong, migration failure, CloudKit sync | SwiftData | `skills/ios/swiftdata-pro` |
127
+ | VoiceOver silent/wrong, Dynamic Type clipping, contrast fail, Reduce Motion ignored | Accessibility | `skills/ios/swift-accessibility` |
128
+ | Touch target <44pt, no dark mode, hard-coded padding, HIG violation | HIG | `skills/ios/ios-hig` |
129
+ | Build fails, signing error, entitlement / Info.plist / provisioning | Build/infra | dispatch `build-error-resolver` agent |
130
+ | Keychain/Crypto misuse, ATS exception, insecure storage, secret leak | Security | `skills/ios/swift-security-expert` |
131
+
132
+ If symptom doesn't match any row, pick the closest and note the gap in the fix report.
133
+
134
+ ### i4. Fix
135
+ Dispatch the classified skill with mode "bypassPermissions". Pass as input:
136
+ - Bug description (from `$ARGUMENTS`)
137
+ - Reproduction evidence (screenshot path, crash log excerpt)
138
+ - Affected file(s) — scope tightly, do not dump the whole project
139
+ - Expected behavior (one sentence)
140
+
141
+ ### i5. Verify loop
142
+ 1. `BuildProject` via XcodeBuildMCP — must succeed with zero warnings/errors.
143
+ 2. Re-install on sim, re-run the Maestro flow OR re-trigger via sim nav.
144
+ 3. Capture `after-fix.png` sim screenshot.
145
+ 4. Visual diff: compare before/after against expected.
146
+ 5. Spot-check one adjacent screen/flow for regression.
147
+ 6. If still failing → return to **i3. Classify** (bug may be mis-classified). **Max 3 fix-verify iterations** per locked plan; after that, report what's fixed, what remains, stop.
148
+
149
+ ### i6. Output
150
+ Append to `docs/plans/.build-state.md`:
151
+ - **Bug**: what was broken
152
+ - **Classification**: which row from i3
153
+ - **Fix**: files changed + skill used
154
+ - **Evidence**: `before-fix.png`, `after-fix.png`, build status
@@ -0,0 +1,73 @@
1
+ ---
2
+ description: "Install buildanything's external dependencies — companion plugins, agent-browser CLI, Chrome for Testing, and skills"
3
+ ---
4
+
5
+ # Setup
6
+
7
+ You are installing buildanything's external dependencies. The plugin itself is already installed (that's how this command is running), but the companion plugins, CLI tools, and skills it depends on are not — they need to be installed separately. This command does that in one shot.
8
+
9
+ Run every step below. Each step is idempotent: check first, install only if missing, continue on failure. Collect results as you go and report them all at the end.
10
+
11
+ ## Step 1: Install companion plugins from `claude-plugins-official`
12
+
13
+ For each plugin below, run `claude plugin install <name>@claude-plugins-official`. If the command fails, record the failure and continue — do NOT abort.
14
+
15
+ | Plugin | Purpose |
16
+ |--------|---------|
17
+ | `feature-dev` | code-architect, code-explorer, code-reviewer |
18
+ | `pr-review-toolkit` | silent-failure-hunter, code-simplifier, type-design-analyzer |
19
+ | `code-review` | final code review passes |
20
+ | `commit-commands` | clean git commits |
21
+ | `playwright` | browser automation for design research and visual QA |
22
+
23
+ For each one, treat a non-zero exit as "already installed or failed" — record it as `skipped` and keep going. Treat a success as `installed`.
24
+
25
+ ## Step 2: Install the `agent-browser` CLI globally
26
+
27
+ 1. Run `which agent-browser`. If it returns a path, record as `already present` and skip to Step 3.
28
+ 2. Otherwise run `npm install -g agent-browser`. Record `installed` or `failed` based on exit status.
29
+
30
+ ## Step 3: Download Chrome for Testing
31
+
32
+ Run `agent-browser install`. This downloads a pinned Chrome build. If `agent-browser` isn't on PATH (Step 2 failed), record `skipped (agent-browser CLI missing)` and continue. Otherwise record `ready` or `failed`.
33
+
34
+ Note: this is safe to re-run — `agent-browser install` no-ops if Chrome is already downloaded.
35
+
36
+ ## Step 4: Install the `agent-browser` skill
37
+
38
+ Run `npx skills add vercel-labs/agent-browser`. Record `installed` or `failed`.
39
+
40
+ ## Step 5: Install the `dogfood` skill
41
+
42
+ Run `npx skills add vercel-labs/agent-browser --skill dogfood`. Record `installed` or `failed`.
43
+
44
+ ## Report
45
+
46
+ Print a single summary block with three sections:
47
+
48
+ ```
49
+ buildanything setup complete.
50
+
51
+ Already present:
52
+ - <item>
53
+ - <item>
54
+
55
+ Installed:
56
+ - <item>
57
+ - <item>
58
+
59
+ Failed:
60
+ - <item> — retry with: <exact command>
61
+ - <item> — retry with: <exact command>
62
+ ```
63
+
64
+ Omit any section that has no entries. For every item in the `Failed` section, include the exact manual-install command the user can run themselves. If everything succeeded or was already present, print only a one-line success message instead of the full block.
65
+
66
+ After the summary, print this reminder:
67
+
68
+ ```
69
+ Next: restart Claude Code so newly installed plugins/skills are loaded.
70
+ Then try:
71
+ /buildanything:build <your idea>
72
+ /buildanything:idea-sweep <your idea>
73
+ ```