@mmerterden/multi-agent-pipeline 20.37.1 → 20.38.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 (443) hide show
  1. package/CHANGELOG.md +98 -49
  2. package/README.md +12 -10
  3. package/README.tr.md +12 -10
  4. package/docs/adr/0006-skills-core-external-split.md +5 -5
  5. package/docs/adr/0010-own-code-graph.md +6 -7
  6. package/docs/adr/0013-lsp-code-intelligence.md +6 -8
  7. package/docs/adr/0017-change-impact-from-the-graph.md +4 -5
  8. package/docs/adr/0018-cross-repo-links-not-a-global-graph.md +1 -1
  9. package/docs/adr/README.md +1 -1
  10. package/docs/ecosystem.md +53 -41
  11. package/docs/facts.json +15 -13
  12. package/docs/features.md +1 -1
  13. package/install/_dev-only-files.mjs +3 -0
  14. package/install/_platform-filter.mjs +1 -23
  15. package/install/catalog-history.json +1 -1
  16. package/install/claude.mjs +8 -1
  17. package/install/codex.mjs +0 -2
  18. package/install/copilot.mjs +0 -2
  19. package/install/templates/claude-hooks.json +47 -1
  20. package/manifest.json +429 -311
  21. package/package.json +5 -2
  22. package/pipeline/agents/security-auditor.md +58 -6
  23. package/pipeline/commands/multi-agent/build-optimize/SKILL.md +1 -2
  24. package/pipeline/commands/multi-agent/complaint-analysis/SKILL.md +1 -1
  25. package/pipeline/commands/multi-agent/design-check/SKILL.md +1 -1
  26. package/pipeline/commands/multi-agent/graph/SKILL.md +12 -3
  27. package/pipeline/commands/multi-agent/research/SKILL.md +2 -2
  28. package/pipeline/commands/multi-agent/search/SKILL.md +10 -1
  29. package/pipeline/commands/multi-agent/security-review/SKILL.md +4 -0
  30. package/pipeline/commands/multi-agent/setup/SKILL.md +1 -0
  31. package/pipeline/commands/multi-agent/stack/SKILL.md +8 -0
  32. package/pipeline/commands/multi-agent/store-ready/SKILL.md +1 -1
  33. package/pipeline/commands/sim-test.md +34 -1
  34. package/pipeline/lib/context-budget.mjs +103 -0
  35. package/pipeline/lib/credential-inventory.sh +2 -3
  36. package/pipeline/lib/identifier-scan.mjs +145 -0
  37. package/pipeline/lib/outbound-gate.mjs +28 -1
  38. package/pipeline/lib/unattended-profile-check.mjs +13 -4
  39. package/pipeline/multi-agent-refs/analysis/locked.md +1 -1
  40. package/pipeline/multi-agent-refs/analysis/redesign.md +17 -3
  41. package/pipeline/multi-agent-refs/analysis-template-corporate.md +8 -4
  42. package/pipeline/multi-agent-refs/analysis-template.md +7 -5
  43. package/pipeline/multi-agent-refs/complaint-analysis/phases.md +1 -0
  44. package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +1 -1
  45. package/pipeline/multi-agent-refs/features/code-graph.md +25 -0
  46. package/pipeline/multi-agent-refs/features/design-conformance.md +20 -4
  47. package/pipeline/multi-agent-refs/features/free-models.md +10 -3
  48. package/pipeline/multi-agent-refs/features/research.md +4 -3
  49. package/pipeline/multi-agent-refs/features/security-audit.md +25 -3
  50. package/pipeline/multi-agent-refs/features/unattended-security.md +20 -0
  51. package/pipeline/multi-agent-refs/help/en.md +15 -9
  52. package/pipeline/multi-agent-refs/help/tr.md +15 -9
  53. package/pipeline/multi-agent-refs/knowledge.md +17 -0
  54. package/pipeline/multi-agent-refs/outside-the-pipeline.md +9 -0
  55. package/pipeline/multi-agent-refs/phases/log-format.md +5 -0
  56. package/pipeline/multi-agent-refs/phases/operations.md +3 -5
  57. package/pipeline/multi-agent-refs/picker-contract.md +1 -1
  58. package/pipeline/multi-agent-refs/research/engine.md +2 -1
  59. package/pipeline/multi-agent-refs/setup/free-models.md +10 -0
  60. package/pipeline/multi-agent-refs/store-ready/gate-3-policy.md +15 -0
  61. package/pipeline/multi-agent-refs/web-guide.md +2 -1
  62. package/pipeline/office/index.html +3 -7
  63. package/pipeline/office/toolkit.json +1 -1
  64. package/pipeline/rules/outside-the-pipeline.md +1 -1
  65. package/pipeline/schemas/learnings-ledger.schema.json +7 -2
  66. package/pipeline/schemas/prefs.schema.json +16 -3
  67. package/pipeline/schemas/reviewer-output.schema.json +113 -5
  68. package/pipeline/schemas/secret-patterns.json +49 -0
  69. package/pipeline/schemas/security-finding.schema.json +49 -5
  70. package/pipeline/scripts/_code-graph.mjs +3 -3
  71. package/pipeline/scripts/_graph-analysis.mjs +51 -0
  72. package/pipeline/scripts/_memory-policy.mjs +11 -3
  73. package/pipeline/scripts/_secret-scan.mjs +1 -1
  74. package/pipeline/scripts/_skill-practices.mjs +178 -0
  75. package/pipeline/scripts/_stack-routing.mjs +1 -0
  76. package/pipeline/scripts/autopilot-runner.mjs +8 -3
  77. package/pipeline/scripts/build-stack-plugins.mjs +8 -44
  78. package/pipeline/scripts/capture-resume.sh +19 -0
  79. package/pipeline/scripts/file-context.mjs +306 -70
  80. package/pipeline/scripts/gen-skills-index.mjs +1 -1
  81. package/pipeline/scripts/graph-hint.mjs +197 -0
  82. package/pipeline/scripts/graph-hint.sh +20 -0
  83. package/pipeline/scripts/graph-query.mjs +306 -11
  84. package/pipeline/scripts/graph-report.mjs +29 -1
  85. package/pipeline/scripts/learnings-ledger.mjs +71 -15
  86. package/pipeline/scripts/note-agent-event.mjs +160 -0
  87. package/pipeline/scripts/note-agent-event.sh +19 -0
  88. package/pipeline/scripts/parity-score.mjs +139 -0
  89. package/pipeline/scripts/pre-commit-check.sh +25 -4
  90. package/pipeline/scripts/pre-push-check.sh +3 -0
  91. package/pipeline/scripts/repo-recommend.mjs +321 -0
  92. package/pipeline/scripts/scan-agent-config.sh +1 -2
  93. package/pipeline/scripts/security-evidence-gate.mjs +282 -0
  94. package/pipeline/scripts/unattended_policy.py +3 -2
  95. package/pipeline/scripts/validate-analysis-doc.mjs +17 -1
  96. package/pipeline/skills/.skill-manifest.json +72 -68
  97. package/pipeline/skills/shared/README.md +41 -40
  98. package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +6 -6
  99. package/pipeline/skills/shared/core/apple-archive-compliance/references/examples.md +1 -1
  100. package/pipeline/skills/shared/core/apple-archive-compliance/references/version-history.md +1 -1
  101. package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +1 -1
  102. package/pipeline/skills/shared/core/google-play-compliance/references/notes.md +1 -1
  103. package/pipeline/skills/shared/core/multi-agent/SKILL.md +1 -1
  104. package/pipeline/skills/shared/core/multi-agent-build-optimize/SKILL.md +0 -1
  105. package/pipeline/skills/shared/core/multi-agent-complaint-analysis/SKILL.md +1 -1
  106. package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +5 -5
  107. package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +10 -0
  108. package/pipeline/skills/shared/core/multi-agent-research/SKILL.md +2 -2
  109. package/pipeline/skills/shared/core/multi-agent-search/SKILL.md +9 -0
  110. package/pipeline/skills/shared/core/multi-agent-security-review/SKILL.md +3 -2
  111. package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -0
  112. package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +8 -0
  113. package/pipeline/skills/shared/core/multi-agent-store-ready/SKILL.md +4 -3
  114. package/pipeline/skills/shared/core/multi-agent-test/SKILL.md +1 -1
  115. package/pipeline/skills/shared/core/multi-agent-test-accessibility/SKILL.md +1 -1
  116. package/pipeline/skills/shared/core/multi-agent-test-dark-mode/SKILL.md +1 -1
  117. package/pipeline/skills/shared/core/multi-agent-test-dynamic-type/SKILL.md +1 -1
  118. package/pipeline/skills/shared/core/multi-agent-test-gen/SKILL.md +1 -1
  119. package/pipeline/skills/shared/core/multi-agent-test-screenshots/SKILL.md +1 -1
  120. package/pipeline/skills/shared/core/multi-agent-testflight-validation/SKILL.md +2 -2
  121. package/pipeline/skills/shared/external/accessibility-compliance-accessibility-audit/evals/evals.json +44 -0
  122. package/pipeline/skills/shared/external/agent-introspection-debugging/evals/evals.json +42 -0
  123. package/pipeline/skills/shared/external/android-architecture/SKILL.md +1 -1
  124. package/pipeline/skills/shared/external/android-architecture/evals/evals.json +45 -0
  125. package/pipeline/skills/shared/external/android-build-quality-gates/evals/evals.json +45 -0
  126. package/pipeline/skills/shared/external/android-datastore/evals/evals.json +45 -0
  127. package/pipeline/skills/shared/external/android-design-tokens-codegen/evals/evals.json +43 -0
  128. package/pipeline/skills/shared/external/android-jetpack-compose-expert/evals/evals.json +43 -0
  129. package/pipeline/skills/shared/external/android-mvi-viewmodel/evals/evals.json +45 -0
  130. package/pipeline/skills/shared/external/android-performance/SKILL.md +1 -1
  131. package/pipeline/skills/shared/external/android-performance/evals/evals.json +44 -0
  132. package/pipeline/skills/shared/external/android-security/SKILL.md +1 -1
  133. package/pipeline/skills/shared/external/android-security/evals/evals.json +45 -0
  134. package/pipeline/skills/shared/external/api-patterns/evals/evals.json +43 -0
  135. package/pipeline/skills/shared/external/api-security-best-practices/evals/evals.json +44 -0
  136. package/pipeline/skills/shared/external/app-store-changelog/SKILL.md +65 -49
  137. package/pipeline/skills/shared/external/app-store-changelog/evals/evals.json +40 -0
  138. package/pipeline/skills/shared/external/app-store-changelog/references/release-notes-guidelines.md +64 -34
  139. package/pipeline/skills/shared/external/app-store-changelog/scripts/collect_release_changes.sh +21 -23
  140. package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +4 -1
  141. package/pipeline/skills/shared/external/app-store-review/SKILL.md +6 -0
  142. package/pipeline/skills/shared/external/architecture/evals/evals.json +42 -0
  143. package/pipeline/skills/shared/external/backlog/evals/evals.json +42 -0
  144. package/pipeline/skills/shared/external/ci-cd-pipelines/evals/evals.json +44 -0
  145. package/pipeline/skills/shared/external/clean-code/evals/evals.json +45 -0
  146. package/pipeline/skills/shared/external/compose-components/SKILL.md +1 -1
  147. package/pipeline/skills/shared/external/compose-components/evals/evals.json +44 -0
  148. package/pipeline/skills/shared/external/compose-navigation/SKILL.md +1 -1
  149. package/pipeline/skills/shared/external/compose-navigation/evals/evals.json +43 -0
  150. package/pipeline/skills/shared/external/compose-testing/SKILL.md +1 -1
  151. package/pipeline/skills/shared/external/compose-testing/evals/evals.json +44 -0
  152. package/pipeline/skills/shared/external/context-compression/evals/evals.json +43 -0
  153. package/pipeline/skills/shared/external/core-data/SKILL.md +1 -1
  154. package/pipeline/skills/shared/external/council/evals/evals.json +41 -0
  155. package/pipeline/skills/shared/external/css-modern/evals/evals.json +44 -0
  156. package/pipeline/skills/shared/external/css-modern/references/code-examples.md +5 -0
  157. package/pipeline/skills/shared/external/database-patterns/evals/evals.json +46 -0
  158. package/pipeline/skills/shared/external/database-patterns/references/orm-examples.md +5 -0
  159. package/pipeline/skills/shared/external/debugging-strategies/evals/evals.json +43 -0
  160. package/pipeline/skills/shared/external/docker-expert/evals/evals.json +45 -0
  161. package/pipeline/skills/shared/external/e2e-testing/SKILL.md +21 -21
  162. package/pipeline/skills/shared/external/e2e-testing/evals/evals.json +44 -0
  163. package/pipeline/skills/shared/external/e2e-testing/references/document-fixtures.md +5 -5
  164. package/pipeline/skills/shared/external/evidence-github/evals/evals.json +41 -0
  165. package/pipeline/skills/shared/external/evidence-registry/SKILL.md +1 -1
  166. package/pipeline/skills/shared/external/evidence-registry/evals/evals.json +41 -0
  167. package/pipeline/skills/shared/external/fastapi-pro/evals/evals.json +57 -0
  168. package/pipeline/skills/shared/external/firebase/SKILL.md +132 -54
  169. package/pipeline/skills/shared/external/firebase/evals/evals.json +42 -0
  170. package/pipeline/skills/shared/external/firebase/references/functions-and-products.md +51 -0
  171. package/pipeline/skills/shared/external/firebase/references/security-rules.md +59 -0
  172. package/pipeline/skills/shared/external/fix-review-verdicts/evals/evals.json +57 -0
  173. package/pipeline/skills/shared/external/free-llm-apis/SKILL.md +70 -0
  174. package/pipeline/skills/shared/external/free-llm-apis/evals/evals.json +44 -0
  175. package/pipeline/skills/shared/external/free-llm-apis/references/providers.md +33 -0
  176. package/pipeline/skills/shared/external/github-actions-templates/evals/evals.json +44 -0
  177. package/pipeline/skills/shared/external/gradle-kotlin-dsl/SKILL.md +1 -1
  178. package/pipeline/skills/shared/external/gradle-kotlin-dsl/evals/evals.json +58 -0
  179. package/pipeline/skills/shared/external/handle-request/SKILL.md +2 -2
  180. package/pipeline/skills/shared/external/handle-request/evals/evals.json +44 -0
  181. package/pipeline/skills/shared/external/hig-app-icons/SKILL.md +2 -2
  182. package/pipeline/skills/shared/external/hig-app-icons/references/icon-workflow.md +1 -1
  183. package/pipeline/skills/shared/external/hig-components-content/evals/evals.json +43 -0
  184. package/pipeline/skills/shared/external/hig-components-status/evals/evals.json +43 -0
  185. package/pipeline/skills/shared/external/hig-components-system/evals/evals.json +43 -0
  186. package/pipeline/skills/shared/external/hig-inputs/evals/evals.json +44 -0
  187. package/pipeline/skills/shared/external/hig-patterns/evals/evals.json +46 -0
  188. package/pipeline/skills/shared/external/hig-platforms/evals/evals.json +45 -0
  189. package/pipeline/skills/shared/external/hig-technologies/evals/evals.json +44 -0
  190. package/pipeline/skills/shared/external/html-semantic/evals/evals.json +46 -0
  191. package/pipeline/skills/shared/external/humanizer/evals/evals.json +46 -0
  192. package/pipeline/skills/shared/external/ios-coding-standard/evals/evals.json +44 -0
  193. package/pipeline/skills/shared/external/ios-debugger-agent/SKILL.md +91 -52
  194. package/pipeline/skills/shared/external/ios-debugger-agent/evals/evals.json +41 -0
  195. package/pipeline/skills/shared/external/ios-design-review/SKILL.md +12 -12
  196. package/pipeline/skills/shared/external/ios-design-review/references/appearance-matrix.md +16 -16
  197. package/pipeline/skills/shared/external/ios-design-review/references/checklist.md +1 -1
  198. package/pipeline/skills/shared/external/ios-iphone-duo/SKILL.md +0 -1
  199. package/pipeline/skills/shared/external/ios-module-structure/evals/evals.json +42 -0
  200. package/pipeline/skills/shared/external/ios-security/SKILL.md +1 -1
  201. package/pipeline/skills/shared/external/ios-security/evals/evals.json +45 -0
  202. package/pipeline/skills/shared/external/kotlin-coroutines-expert/evals/evals.json +43 -0
  203. package/pipeline/skills/shared/external/localization-reuse-map/evals/evals.json +45 -0
  204. package/pipeline/skills/shared/external/macos-menubar-tuist-app/SKILL.md +170 -74
  205. package/pipeline/skills/shared/external/macos-menubar-tuist-app/evals/evals.json +52 -0
  206. package/pipeline/skills/shared/external/macos-spm-app-packaging/SKILL.md +119 -77
  207. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Package.swift +5 -5
  208. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/MyApp.swift +24 -0
  209. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/version.env +2 -0
  210. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/build_icon.sh +46 -39
  211. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/compile_and_run.sh +70 -49
  212. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/launch.sh +24 -17
  213. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/make_appcast.sh +74 -59
  214. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/package_app.sh +201 -170
  215. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/setup_dev_signing.sh +50 -42
  216. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/sign-and-notarize.sh +65 -35
  217. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/version.env +2 -0
  218. package/pipeline/skills/shared/external/macos-spm-app-packaging/evals/evals.json +45 -0
  219. package/pipeline/skills/shared/external/macos-spm-app-packaging/references/packaging.md +49 -17
  220. package/pipeline/skills/shared/external/macos-spm-app-packaging/references/release.md +48 -23
  221. package/pipeline/skills/shared/external/macos-spm-app-packaging/references/scaffold.md +74 -44
  222. package/pipeline/skills/shared/external/monorepo-architect/evals/evals.json +45 -0
  223. package/pipeline/skills/shared/external/nextjs-app-router/SKILL.md +14 -3
  224. package/pipeline/skills/shared/external/nextjs-app-router/evals/evals.json +43 -0
  225. package/pipeline/skills/shared/external/nextjs-app-router/references/app-router-examples.md +3 -0
  226. package/pipeline/skills/shared/external/nodejs-backend-patterns/evals/evals.json +45 -0
  227. package/pipeline/skills/shared/external/observability-engineer/evals/evals.json +45 -0
  228. package/pipeline/skills/shared/external/passkit-wallet/SKILL.md +10 -0
  229. package/pipeline/skills/shared/external/photos-camera-media/evals/evals.json +45 -0
  230. package/pipeline/skills/shared/external/play-store-review/evals/evals.json +45 -0
  231. package/pipeline/skills/shared/external/python-patterns/evals/evals.json +46 -0
  232. package/pipeline/skills/shared/external/react-best-practices/evals/evals.json +43 -0
  233. package/pipeline/skills/shared/external/rest-api-design/evals/evals.json +46 -0
  234. package/pipeline/skills/shared/external/retrofit-networking/SKILL.md +1 -1
  235. package/pipeline/skills/shared/external/retrofit-networking/evals/evals.json +43 -0
  236. package/pipeline/skills/shared/external/room-database/SKILL.md +1 -1
  237. package/pipeline/skills/shared/external/room-database/evals/evals.json +43 -0
  238. package/pipeline/skills/shared/external/scenario-gap-analysis/SKILL.md +1 -1
  239. package/pipeline/skills/shared/external/scenario-gap-analysis/evals/evals.json +43 -0
  240. package/pipeline/skills/shared/external/search-first/evals/evals.json +42 -0
  241. package/pipeline/skills/shared/external/security-review/SKILL.md +14 -3
  242. package/pipeline/skills/shared/external/security-review/evals/evals.json +48 -0
  243. package/pipeline/skills/shared/external/security-review/references/agentic-systems.md +93 -0
  244. package/pipeline/skills/shared/external/security-review/references/firebase-rules.md +100 -0
  245. package/pipeline/skills/shared/external/security-review/references/graphql.md +82 -0
  246. package/pipeline/skills/shared/external/security-review/references/llm-prompt-injection.md +93 -0
  247. package/pipeline/skills/shared/external/security-review/references/oauth-oidc.md +100 -0
  248. package/pipeline/skills/shared/external/security-review/references/owasp-mobile-top10-2024.md +1 -1
  249. package/pipeline/skills/shared/external/security-review/references/owasp-web-api-top10-2021.md +1 -1
  250. package/pipeline/skills/shared/external/security-review/references/supabase.md +73 -0
  251. package/pipeline/skills/shared/external/signal-community/SKILL.md +29 -10
  252. package/pipeline/skills/shared/external/signal-community/evals/evals.json +42 -0
  253. package/pipeline/skills/shared/external/skill-creator/evals/evals.json +43 -0
  254. package/pipeline/skills/shared/external/skill-creator/template.md +1 -3
  255. package/pipeline/skills/shared/external/spm-build-analysis/SKILL.md +80 -61
  256. package/pipeline/skills/shared/external/spm-build-analysis/evals/evals.json +56 -0
  257. package/pipeline/skills/shared/external/spm-build-analysis/references/build-optimization-sources.md +83 -133
  258. package/pipeline/skills/shared/external/spm-build-analysis/references/recommendation-format.md +41 -40
  259. package/pipeline/skills/shared/external/spm-build-analysis/references/spm-analysis-checks.md +89 -87
  260. package/pipeline/skills/shared/external/spm-build-analysis/scripts/check_spm_pins.py +90 -85
  261. package/pipeline/skills/shared/external/swift-concurrency-expert/SKILL.md +78 -69
  262. package/pipeline/skills/shared/external/swift-concurrency-expert/evals/evals.json +54 -0
  263. package/pipeline/skills/shared/external/swift-concurrency-expert/references/approachable-concurrency.md +52 -48
  264. package/pipeline/skills/shared/external/swift-concurrency-expert/references/swift-6-2-concurrency.md +118 -184
  265. package/pipeline/skills/shared/external/swift-concurrency-expert/references/swiftui-concurrency-tour-wwdc.md +68 -22
  266. package/pipeline/skills/shared/external/swift-concurrency-pro/SKILL.md +117 -94
  267. package/pipeline/skills/shared/external/swift-concurrency-pro/evals/evals.json +57 -0
  268. package/pipeline/skills/shared/external/swift-concurrency-pro/references/actors.md +102 -97
  269. package/pipeline/skills/shared/external/swift-concurrency-pro/references/async-streams.md +36 -37
  270. package/pipeline/skills/shared/external/swift-concurrency-pro/references/bridging.md +82 -34
  271. package/pipeline/skills/shared/external/swift-concurrency-pro/references/bug-patterns.md +90 -52
  272. package/pipeline/skills/shared/external/swift-concurrency-pro/references/cancellation.md +55 -55
  273. package/pipeline/skills/shared/external/swift-concurrency-pro/references/diagnostics.md +66 -43
  274. package/pipeline/skills/shared/external/swift-concurrency-pro/references/hotspots.md +39 -23
  275. package/pipeline/skills/shared/external/swift-concurrency-pro/references/interop.md +66 -68
  276. package/pipeline/skills/shared/external/swift-concurrency-pro/references/new-features.md +152 -131
  277. package/pipeline/skills/shared/external/swift-concurrency-pro/references/structured.md +60 -57
  278. package/pipeline/skills/shared/external/swift-concurrency-pro/references/testing.md +131 -118
  279. package/pipeline/skills/shared/external/swift-concurrency-pro/references/unstructured.md +37 -29
  280. package/pipeline/skills/shared/external/swift-formatstyle/evals/evals.json +43 -0
  281. package/pipeline/skills/shared/external/swift-testing-pro/SKILL.md +77 -58
  282. package/pipeline/skills/shared/external/swift-testing-pro/evals/evals.json +59 -0
  283. package/pipeline/skills/shared/external/swift-testing-pro/references/async-tests.md +139 -144
  284. package/pipeline/skills/shared/external/swift-testing-pro/references/core-rules.md +90 -28
  285. package/pipeline/skills/shared/external/swift-testing-pro/references/migrating-from-xctest.md +38 -21
  286. package/pipeline/skills/shared/external/swift-testing-pro/references/new-features.md +139 -156
  287. package/pipeline/skills/shared/external/swift-testing-pro/references/writing-better-tests.md +173 -147
  288. package/pipeline/skills/shared/external/swiftdata-pro/SKILL.md +75 -59
  289. package/pipeline/skills/shared/external/swiftdata-pro/evals/evals.json +50 -0
  290. package/pipeline/skills/shared/external/swiftdata-pro/references/cloudkit.md +34 -7
  291. package/pipeline/skills/shared/external/swiftdata-pro/references/indexing.md +20 -14
  292. package/pipeline/skills/shared/external/swiftdata-pro/references/inheritance.md +127 -0
  293. package/pipeline/skills/shared/external/swiftdata-pro/references/model-rules.md +141 -0
  294. package/pipeline/skills/shared/external/swiftdata-pro/references/predicates.md +37 -44
  295. package/pipeline/skills/shared/external/swiftlint/evals/evals.json +44 -0
  296. package/pipeline/skills/shared/external/swiftui-expert-skill/SKILL.md +89 -88
  297. package/pipeline/skills/shared/external/swiftui-expert-skill/evals/evals.json +55 -0
  298. package/pipeline/skills/shared/external/swiftui-expert-skill/references/accessibility-patterns.md +104 -122
  299. package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-advanced.md +73 -93
  300. package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-basics.md +144 -169
  301. package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-transitions.md +122 -133
  302. package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts-accessibility.md +141 -99
  303. package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts.md +273 -333
  304. package/pipeline/skills/shared/external/swiftui-expert-skill/references/image-optimization.md +105 -128
  305. package/pipeline/skills/shared/external/swiftui-expert-skill/references/latest-apis.md +199 -312
  306. package/pipeline/skills/shared/external/swiftui-expert-skill/references/layout-best-practices.md +129 -169
  307. package/pipeline/skills/shared/external/swiftui-expert-skill/references/liquid-glass.md +17 -30
  308. package/pipeline/skills/shared/external/swiftui-expert-skill/references/list-patterns.md +198 -258
  309. package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-scenes.md +145 -218
  310. package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-views.md +150 -249
  311. package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-window-styling.md +109 -208
  312. package/pipeline/skills/shared/external/swiftui-expert-skill/references/performance-patterns.md +225 -271
  313. package/pipeline/skills/shared/external/swiftui-expert-skill/references/scroll-patterns.md +117 -210
  314. package/pipeline/skills/shared/external/swiftui-expert-skill/references/sheet-navigation-patterns.md +171 -237
  315. package/pipeline/skills/shared/external/swiftui-expert-skill/references/state-management.md +196 -260
  316. package/pipeline/skills/shared/external/swiftui-expert-skill/references/view-structure.md +167 -230
  317. package/pipeline/skills/shared/external/swiftui-gestures/evals/evals.json +43 -0
  318. package/pipeline/skills/shared/external/swiftui-layout-components/evals/evals.json +43 -0
  319. package/pipeline/skills/shared/external/swiftui-navigation/evals/evals.json +44 -0
  320. package/pipeline/skills/shared/external/swiftui-navigation/references/navigationstack.md +1 -2
  321. package/pipeline/skills/shared/external/swiftui-patterns/evals/evals.json +43 -0
  322. package/pipeline/skills/shared/external/swiftui-performance/evals/evals.json +44 -0
  323. package/pipeline/skills/shared/external/swiftui-performance-audit/SKILL.md +71 -79
  324. package/pipeline/skills/shared/external/swiftui-performance-audit/evals/evals.json +55 -0
  325. package/pipeline/skills/shared/external/swiftui-performance-audit/references/audit-layout.md +50 -0
  326. package/pipeline/skills/shared/external/swiftui-performance-audit/references/capture-checklist.md +51 -0
  327. package/pipeline/skills/shared/external/swiftui-performance-audit/references/hangs.md +34 -0
  328. package/pipeline/skills/shared/external/swiftui-performance-audit/references/instruments-guide.md +68 -0
  329. package/pipeline/skills/shared/external/swiftui-performance-audit/references/smell-catalog.md +191 -0
  330. package/pipeline/skills/shared/external/swiftui-performance-audit/references/update-model.md +69 -0
  331. package/pipeline/skills/shared/external/swiftui-pro/SKILL.md +65 -63
  332. package/pipeline/skills/shared/external/swiftui-pro/evals/evals.json +45 -0
  333. package/pipeline/skills/shared/external/swiftui-pro/references/accessibility.md +40 -13
  334. package/pipeline/skills/shared/external/swiftui-pro/references/api.md +74 -29
  335. package/pipeline/skills/shared/external/swiftui-pro/references/data.md +44 -24
  336. package/pipeline/skills/shared/external/swiftui-pro/references/design.md +45 -31
  337. package/pipeline/skills/shared/external/swiftui-pro/references/hygiene.md +17 -8
  338. package/pipeline/skills/shared/external/swiftui-pro/references/navigation.md +19 -9
  339. package/pipeline/skills/shared/external/swiftui-pro/references/performance.md +50 -34
  340. package/pipeline/skills/shared/external/swiftui-pro/references/swift.md +73 -45
  341. package/pipeline/skills/shared/external/swiftui-pro/references/views.md +48 -23
  342. package/pipeline/skills/shared/external/swiftui-ui-patterns/SKILL.md +89 -83
  343. package/pipeline/skills/shared/external/swiftui-ui-patterns/evals/evals.json +44 -0
  344. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/app-wiring.md +119 -114
  345. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/async-state.md +76 -61
  346. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/components-index.md +63 -46
  347. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/controls.md +32 -31
  348. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/deeplinks.md +49 -38
  349. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/focus.md +77 -49
  350. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/form.md +61 -44
  351. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/grids.md +40 -42
  352. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/input-toolbar.md +44 -31
  353. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/lightweight-clients.md +90 -64
  354. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/list.md +48 -49
  355. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/loading-placeholders.md +36 -25
  356. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/macos-settings.md +30 -30
  357. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/matched-transitions.md +49 -32
  358. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/media.md +49 -41
  359. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/menu-bar.md +52 -48
  360. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/navigationstack.md +119 -104
  361. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/overlay.md +30 -27
  362. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/performance.md +33 -31
  363. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/previews.md +27 -27
  364. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scroll-reveal.md +79 -86
  365. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scrollview.md +47 -40
  366. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/searchable.md +55 -40
  367. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/sheets.md +113 -84
  368. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/split-views.md +37 -34
  369. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/tabview.md +75 -75
  370. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/theming.md +37 -32
  371. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/title-menus.md +41 -51
  372. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/top-bar.md +46 -30
  373. package/pipeline/skills/shared/external/swiftui-uikit-interop/evals/evals.json +44 -0
  374. package/pipeline/skills/shared/external/swiftui-view-refactor/SKILL.md +152 -121
  375. package/pipeline/skills/shared/external/swiftui-view-refactor/evals/evals.json +56 -0
  376. package/pipeline/skills/shared/external/swiftui-view-refactor/references/mv-patterns.md +107 -98
  377. package/pipeline/skills/shared/external/swiftui-webkit/evals/evals.json +44 -0
  378. package/pipeline/skills/shared/external/tailwind-css/evals/evals.json +43 -0
  379. package/pipeline/skills/shared/external/test-result-triage/SKILL.md +2 -2
  380. package/pipeline/skills/shared/external/test-result-triage/evals/evals.json +44 -0
  381. package/pipeline/skills/shared/external/testing-backend/evals/evals.json +42 -0
  382. package/pipeline/skills/shared/external/tipkit/evals/evals.json +44 -0
  383. package/pipeline/skills/shared/external/typescript-patterns/evals/evals.json +42 -0
  384. package/pipeline/skills/shared/external/valven-rules/evals/evals.json +44 -0
  385. package/pipeline/skills/shared/external/vision-framework/evals/evals.json +44 -0
  386. package/pipeline/skills/shared/external/vue-composition/evals/evals.json +42 -0
  387. package/pipeline/skills/shared/external/weatherkit/evals/evals.json +42 -0
  388. package/pipeline/skills/shared/external/web-accessibility/evals/evals.json +43 -0
  389. package/pipeline/skills/shared/external/web-performance/evals/evals.json +44 -0
  390. package/pipeline/skills/shared/external/web-testing/SKILL.md +2 -2
  391. package/pipeline/skills/shared/external/web-testing/evals/evals.json +43 -0
  392. package/pipeline/skills/shared/external/web-testing/references/testing-examples.md +2 -2
  393. package/pipeline/skills/shared/external/widgetkit/evals/evals.json +44 -0
  394. package/pipeline/skills/shared/external/xcode-build-benchmark/SKILL.md +61 -55
  395. package/pipeline/skills/shared/external/xcode-build-benchmark/evals/evals.json +42 -0
  396. package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmark-artifacts.md +69 -67
  397. package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmarking-workflow.md +39 -47
  398. package/pipeline/skills/shared/external/xcode-build-benchmark/schemas/build-benchmark.schema.json +72 -154
  399. package/pipeline/skills/shared/external/xcode-build-benchmark/scripts/benchmark_builds.py +207 -245
  400. package/pipeline/skills/shared/external/xcode-build-fixer/SKILL.md +145 -139
  401. package/pipeline/skills/shared/external/xcode-build-fixer/evals/evals.json +54 -0
  402. package/pipeline/skills/shared/external/xcode-build-fixer/references/build-settings-best-practices.md +81 -175
  403. package/pipeline/skills/shared/external/xcode-build-fixer/references/fix-patterns.md +188 -143
  404. package/pipeline/skills/shared/external/xcode-build-fixer/references/recommendation-format.md +41 -40
  405. package/pipeline/skills/shared/external/xcode-build-fixer/scripts/benchmark_builds.py +207 -245
  406. package/pipeline/skills/shared/external/xcode-build-orchestrator/SKILL.md +107 -98
  407. package/pipeline/skills/shared/external/xcode-build-orchestrator/evals/evals.json +54 -0
  408. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/benchmark-artifacts.md +69 -67
  409. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/build-settings-best-practices.md +81 -175
  410. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/orchestration-report-template.md +81 -69
  411. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/recommendation-format.md +41 -40
  412. package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/benchmark_builds.py +207 -245
  413. package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/diagnose_compilation.py +155 -210
  414. package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/generate_optimization_report.py +355 -480
  415. package/pipeline/skills/shared/external/xcode-compilation-analyzer/SKILL.md +70 -69
  416. package/pipeline/skills/shared/external/xcode-compilation-analyzer/evals/evals.json +54 -0
  417. package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/build-optimization-sources.md +83 -133
  418. package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/code-compilation-checks.md +85 -73
  419. package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/recommendation-format.md +41 -40
  420. package/pipeline/skills/shared/external/xcode-compilation-analyzer/scripts/diagnose_compilation.py +155 -210
  421. package/pipeline/skills/shared/external/xcode-project-analyzer/SKILL.md +54 -52
  422. package/pipeline/skills/shared/external/xcode-project-analyzer/evals/evals.json +54 -0
  423. package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-optimization-sources.md +83 -133
  424. package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-settings-best-practices.md +81 -175
  425. package/pipeline/skills/shared/external/xcode-project-analyzer/references/project-audit-checks.md +115 -83
  426. package/pipeline/skills/shared/external/xcode-project-analyzer/references/recommendation-format.md +41 -40
  427. package/pipeline/scripts/_notices.mjs +0 -171
  428. package/pipeline/skills/shared/external/NOTICE-avdlee-swiftui-agent-skill.md +0 -48
  429. package/pipeline/skills/shared/external/NOTICE-dimillian-skills.md +0 -63
  430. package/pipeline/skills/shared/external/NOTICE-paul-hudson-skills.md +0 -54
  431. package/pipeline/skills/shared/external/NOTICE-vibeship-spawner-skills.md +0 -203
  432. package/pipeline/skills/shared/external/NOTICE-xcode-build-skills.md +0 -60
  433. package/pipeline/skills/shared/external/ios-iphone-duo/NOTICE.md +0 -53
  434. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/main.swift +0 -11
  435. package/pipeline/skills/shared/external/swiftdata-pro/references/class-inheritance.md +0 -104
  436. package/pipeline/skills/shared/external/swiftdata-pro/references/core-rules.md +0 -20
  437. package/pipeline/skills/shared/external/swiftui-performance-audit/references/code-smells.md +0 -158
  438. package/pipeline/skills/shared/external/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +0 -46
  439. package/pipeline/skills/shared/external/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +0 -29
  440. package/pipeline/skills/shared/external/swiftui-performance-audit/references/profiling-intake.md +0 -44
  441. package/pipeline/skills/shared/external/swiftui-performance-audit/references/report-template.md +0 -47
  442. package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +0 -33
  443. package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-improving-swiftui-performance.md +0 -52
@@ -1,170 +1,185 @@
1
1
  # NavigationStack
2
2
 
3
3
  <!-- toc -->
4
- - [Intent](#intent)
5
- - [Core architecture](#core-architecture)
6
- - [Example: custom router with per-tab stack](#example-custom-router-with-per-tab-stack)
7
- - [Example: centralized destination mapping](#example-centralized-destination-mapping)
8
- - [Example: binding per tab (tabs with independent history)](#example-binding-per-tab-tabs-with-independent-history)
9
- - [Example: generic tabs with per-tab NavigationStack](#example-generic-tabs-with-per-tab-navigationstack)
10
- - [Design choices to keep](#design-choices-to-keep)
11
- - [Pitfalls](#pitfalls)
4
+ - [Contents](#contents)
5
+ - [Purpose](#purpose)
6
+ - [Building blocks](#building-blocks)
7
+ - [A router owned by one tab](#a-router-owned-by-one-tab)
8
+ - [One place that maps routes to views](#one-place-that-maps-routes-to-views)
9
+ - [Tabs that each keep their own history](#tabs-that-each-keep-their-own-history)
10
+ - [Data-driven tabs with a router registry](#data-driven-tabs-with-a-router-registry)
11
+ - [Keep](#keep)
12
+ - [Avoid](#avoid)
12
13
  <!-- /toc -->
13
14
 
14
- ## Intent
15
+ ## Contents
15
16
 
16
- Use this pattern for programmatic navigation and deep links, especially when each tab needs an independent navigation history. The key idea is one `NavigationStack` per tab, each with its own path binding and router object.
17
+ - [Purpose](#purpose)
18
+ - [Building blocks](#building-blocks)
19
+ - [A router owned by one tab](#a-router-owned-by-one-tab)
20
+ - [One place that maps routes to views](#one-place-that-maps-routes-to-views)
21
+ - [Tabs that each keep their own history](#tabs-that-each-keep-their-own-history)
22
+ - [Data-driven tabs with a router registry](#data-driven-tabs-with-a-router-registry)
23
+ - [Keep](#keep)
24
+ - [Avoid](#avoid)
17
25
 
18
- ## Core architecture
26
+ ## Purpose
19
27
 
20
- - Define a route enum that is `Hashable` and represents all destinations.
21
- - Create a lightweight router (or use a library such as `https://github.com/Dimillian/AppRouter`) that owns the `path` and any sheet state.
22
- - Each tab owns its own router instance and binds `NavigationStack(path:)` to it.
23
- - Inject the router into the environment so child views can navigate programmatically.
24
- - Centralize destination mapping with a single `navigationDestination(for:)` block (or a `withAppRouter()` modifier).
28
+ Programmatic navigation and deep links, above all when every tab must remember its own back stack. The core move: each tab gets its own `NavigationStack`, bound to its own path on its own router.
25
29
 
26
- ## Example: custom router with per-tab stack
30
+ ## Building blocks
31
+
32
+ - A `Hashable` route enum that names every destination.
33
+ - A small router that owns `path` and, optionally, the sheet currently shown. A third-party router package works too; the shape is the same.
34
+ - One router instance per tab, with `NavigationStack(path:)` bound to it.
35
+ - The router injected into the environment so descendants can push screens.
36
+ - Route-to-view mapping in exactly one `navigationDestination(for:)`, usually wrapped in a modifier such as `withAppRoutes()`.
37
+
38
+ ## A router owned by one tab
27
39
 
28
40
  ```swift
41
+ enum Route: Hashable {
42
+ case book(id: String)
43
+ case author(id: String)
44
+ }
45
+
29
46
  @MainActor
30
47
  @Observable
31
48
  final class RouterPath {
32
- var path: [Route] = []
33
49
  var presentedSheet: SheetDestination?
50
+ var path: [Route] = []
34
51
 
35
- func navigate(to route: Route) {
36
- path.append(route)
37
- }
38
-
39
- func reset() {
40
- path = []
41
- }
42
- }
43
-
44
- enum Route: Hashable {
45
- case account(id: String)
46
- case status(id: String)
52
+ func push(_ next: Route) { path.append(next) }
53
+ func popToRoot() { path.removeAll() }
47
54
  }
48
55
 
49
- @MainActor
50
- struct TimelineTab: View {
51
- @State private var routerPath = RouterPath()
56
+ struct LibraryTab: View {
57
+ @State private var router = RouterPath()
52
58
 
53
59
  var body: some View {
54
- NavigationStack(path: $routerPath.path) {
55
- TimelineView()
56
- .navigationDestination(for: Route.self) { route in
57
- switch route {
58
- case .account(let id): AccountView(id: id)
59
- case .status(let id): StatusView(id: id)
60
+ NavigationStack(path: $router.path) {
61
+ ShelfView()
62
+ .navigationDestination(for: Route.self) { destination in
63
+ switch destination {
64
+ case .book(let id): BookDetail(bookID: id)
65
+ case .author(let id): AuthorPage(authorID: id)
60
66
  }
61
67
  }
62
68
  }
63
- .environment(routerPath)
69
+ .environment(router)
70
+ }
71
+ }
72
+ ```
73
+
74
+ A row deeper in the tree navigates without any binding passed down:
75
+
76
+ ```swift
77
+ struct BookRow: View {
78
+ @Environment(RouterPath.self) var navigator
79
+ let book: Book
80
+
81
+ var body: some View {
82
+ Button(book.title) { navigator.push(.book(id: book.id)) }
64
83
  }
65
84
  }
66
85
  ```
67
86
 
68
- ## Example: centralized destination mapping
87
+ ## One place that maps routes to views
69
88
 
70
- Use a shared view modifier to avoid duplicating route switches across screens.
89
+ Repeating the `switch` in every screen drifts. Put it in a modifier and attach that modifier a single time per stack.
71
90
 
72
91
  ```swift
73
92
  extension View {
74
- func withAppRouter() -> some View {
75
- navigationDestination(for: Route.self) { route in
76
- switch route {
77
- case .account(let id):
78
- AccountView(id: id)
79
- case .status(let id):
80
- StatusView(id: id)
93
+ func withAppRoutes() -> some View {
94
+ navigationDestination(for: Route.self) { destination in
95
+ switch destination {
96
+ case .book(let id): BookDetail(bookID: id)
97
+ case .author(let id): AuthorPage(authorID: id)
81
98
  }
82
99
  }
83
100
  }
84
101
  }
85
- ```
86
-
87
- Then apply it once per stack:
88
102
 
89
- ```swift
90
- NavigationStack(path: $routerPath.path) {
91
- TimelineView()
92
- .withAppRouter()
103
+ // In the stack:
104
+ NavigationStack(path: $router.path) {
105
+ ShelfView().withAppRoutes()
93
106
  }
94
107
  ```
95
108
 
96
- ## Example: binding per tab (tabs with independent history)
109
+ ## Tabs that each keep their own history
110
+
111
+ With a fixed set of tabs, the container holds one router per tab and hands each one in; the tab views take a `router` parameter instead of creating their own.
97
112
 
98
113
  ```swift
99
- @MainActor
100
- struct TabsView: View {
101
- @State private var timelineRouter = RouterPath()
102
- @State private var notificationsRouter = RouterPath()
114
+ struct FixedTabs: View {
115
+ @State private var libraryRouter = RouterPath()
116
+ @State private var discoverRouter = RouterPath()
103
117
 
104
118
  var body: some View {
105
119
  TabView {
106
- TimelineTab(router: timelineRouter)
107
- NotificationsTab(router: notificationsRouter)
120
+ LibraryTab(router: libraryRouter)
121
+ DiscoverTab(router: discoverRouter)
108
122
  }
109
123
  }
110
124
  }
111
125
  ```
112
126
 
113
- ## Example: generic tabs with per-tab NavigationStack
127
+ ## Data-driven tabs with a router registry
114
128
 
115
- Use this when tabs are built from data and each needs its own path without hard-coded names.
129
+ When tabs come from an enum or from data, a registry hands out one router per tab on demand and builds the path binding for it.
116
130
 
117
131
  ```swift
118
132
  @MainActor
119
- struct TabsView: View {
120
- @State private var selectedTab: AppTab = .timeline
121
- @State private var tabRouter = TabRouter()
133
+ @Observable
134
+ final class TabRouter {
135
+ private var byTab: [AppTab: RouterPath] = [:]
136
+
137
+ func router(of tab: AppTab) -> RouterPath {
138
+ if let existing = byTab[tab] { return existing }
139
+ let created = RouterPath()
140
+ byTab[tab] = created
141
+ return created
142
+ }
143
+
144
+ func pathBinding(of tab: AppTab) -> Binding<[Route]> {
145
+ let router = router(of: tab)
146
+ return Binding { router.path } set: { newPath in router.path = newPath }
147
+ }
148
+ }
149
+
150
+ struct RootTabs: View {
151
+ @State private var selection: AppTab = .library
152
+ @State private var routers = TabRouter()
122
153
 
123
154
  var body: some View {
124
- TabView(selection: $selectedTab) {
125
- ForEach(AppTab.allCases) { tab in
126
- NavigationStack(path: tabRouter.binding(for: tab)) {
127
- tab.makeContentView()
155
+ TabView(selection: $selection) {
156
+ ForEach(AppTab.allCases) { item in
157
+ NavigationStack(path: routers.pathBinding(of: item)) {
158
+ item.rootView().withAppRoutes()
128
159
  }
129
- .environment(tabRouter.router(for: tab))
130
- .tabItem { tab.label }
131
- .tag(tab)
160
+ .environment(routers.router(of: item))
161
+ .tabItem { item.label }
162
+ .tag(item)
132
163
  }
133
164
  }
134
165
  }
135
166
  }
136
167
  ```
137
168
 
138
- @MainActor
139
- @Observable
140
- final class TabRouter {
141
- private var routers: [AppTab: RouterPath] = [:]
142
-
143
- func router(for tab: AppTab) -> RouterPath {
144
- if let router = routers[tab] { return router }
145
- let router = RouterPath()
146
- routers[tab] = router
147
- return router
148
- }
149
-
150
- func binding(for tab: AppTab) -> Binding<[Route]> {
151
- let router = router(for: tab)
152
- return Binding(get: { router.path }, set: { router.path = $0 })
153
- }
154
- }
169
+ `AppTab` is defined in [app-wiring.md](app-wiring.md).
155
170
 
156
- ## Design choices to keep
171
+ ## Keep
157
172
 
158
- - One `NavigationStack` per tab to preserve independent history.
159
- - A single source of truth for navigation state (`RouterPath` or library router).
160
- - Use `navigationDestination(for:)` to map routes to views.
161
- - Reset the path when app context changes (account switch, logout, etc.).
162
- - Inject the router into the environment so child views can navigate and present sheets without prop-drilling.
163
- - Keep sheet presentation state on the router if you want a single place to manage modals.
173
+ - A separate `NavigationStack` per tab so histories stay independent.
174
+ - Navigation state lives in exactly one object, the router (hand-written or a library type).
175
+ - `navigationDestination(for:)` as the only route-to-view mapping.
176
+ - Clearing the path when the app context changes, such as switching accounts or signing out.
177
+ - The router in the environment, so children push screens and present sheets without threading bindings through every layer.
178
+ - Sheet state on the router too, if modals should be managed in the same place.
164
179
 
165
- ## Pitfalls
180
+ ## Avoid
166
181
 
167
- - Do not share one path across all tabs unless you want global history.
168
- - Ensure route identifiers are stable and `Hashable`.
169
- - Avoid storing view instances in the path; store lightweight route data instead.
170
- - If using a router object, keep it outside other `@Observable` objects to avoid nested observation.
182
+ - One path shared by all tabs, unless a single global history is what the product wants.
183
+ - Routes whose identity is unstable or that are not `Hashable`.
184
+ - Putting views into the path. The path holds small route values; views are built from them at destination time.
185
+ - Routers stored inside other `@Observable` objects; nested observation causes surprises, so keep the router on its own.
@@ -1,45 +1,48 @@
1
- # Overlay and toasts
1
+ # Overlays and toasts
2
2
 
3
- ## Intent
3
+ ## When to reach for it
4
4
 
5
- Use overlays for transient UI (toasts, banners, loaders) without affecting layout.
5
+ Short-lived UI such as toasts, banners and loading indicators sits in an overlay so it never pushes the layout around.
6
6
 
7
- ## Core patterns
7
+ ## Building blocks
8
8
 
9
- - Use `.overlay(alignment:)` to place global UI without changing the underlying layout.
10
- - Keep overlays lightweight and dismissible.
11
- - Use a dedicated `ToastCenter` (or similar) for global state if multiple features trigger toasts.
9
+ - `.overlay(alignment:)` places app-wide UI on top of the content without changing how the content lays out.
10
+ - Overlays stay small and can be dismissed.
11
+ - When several features can raise a toast, route them through one shared owner (a `ToastCenter` or similar) instead of local state in each feature.
12
12
 
13
- ## Example: toast overlay
13
+ ## Example: banner that hides itself
14
14
 
15
15
  ```swift
16
- struct AppRootView: View {
17
- @State private var toast: Toast?
16
+ struct ShellView: View {
17
+ @State private var banner: Banner?
18
18
 
19
19
  var body: some View {
20
- content
21
- .overlay(alignment: .top) {
22
- if let toast {
23
- ToastView(toast: toast)
24
- .transition(.move(edge: .top).combined(with: .opacity))
25
- .onAppear {
26
- DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
27
- withAnimation { self.toast = nil }
28
- }
29
- }
20
+ MainTabs()
21
+ .overlay(alignment: .bottom) {
22
+ if let banner {
23
+ BannerView(banner: banner)
24
+ .padding()
25
+ .transition(.move(edge: .bottom).combined(with: .opacity))
30
26
  }
31
27
  }
28
+ .task(id: banner?.id) {
29
+ guard banner != nil else { return }
30
+ try? await Task.sleep(for: .seconds(2))
31
+ withAnimation { banner = nil }
32
+ }
32
33
  }
33
34
  }
34
35
  ```
35
36
 
36
- ## Design choices to keep
37
+ Keying the dismissal task on the banner ID restarts the timer when a new banner replaces the old one, and the task is cancelled with the view.
38
+
39
+ ## Keep in the design
37
40
 
38
- - Prefer overlays for transient UI rather than embedding in layout stacks.
39
- - Use transitions and short auto-dismiss timers.
40
- - Keep the overlay aligned to a clear edge (`.top` or `.bottom`).
41
+ - Transient UI goes in an overlay, not in the layout stacks.
42
+ - Pair a transition with a short automatic dismissal.
43
+ - Anchor the overlay to one clear edge, `.top` or `.bottom`.
41
44
 
42
- ## Pitfalls
45
+ ## Watch out for
43
46
 
44
- - Avoid overlays that block all interaction unless explicitly needed.
45
- - Don't stack many overlays; use a queue or replace the current toast.
47
+ - Overlays that swallow every touch, unless blocking is the intent.
48
+ - Piling overlays on top of each other. Queue them or replace the current one.
@@ -1,62 +1,64 @@
1
1
  # Performance guardrails
2
2
 
3
- ## Intent
3
+ ## When to reach for it
4
4
 
5
- Use these rules when a SwiftUI screen is large, scroll-heavy, frequently updated, or at risk of unnecessary recomputation.
5
+ Apply these rules to screens that are large, scroll a lot, update often, or risk recomputing more than they need to.
6
6
 
7
- ## Core rules
7
+ ## Rules
8
8
 
9
- - Give `ForEach` and list content stable identity. Do not use unstable indices as identity when the collection can reorder or mutate.
10
- - Keep expensive filtering, sorting, and formatting out of `body`; precompute or move it into a model/helper when it is not trivial.
11
- - Narrow observation scope so only the views that read changing state need to update.
12
- - Prefer lazy containers for larger scrolling content and extract subviews when only part of a screen changes frequently.
13
- - Avoid swapping entire top-level view trees for small state changes; keep a stable root view and vary localized sections or modifiers.
9
+ - Content in `ForEach` and lists needs stable identity. If the collection can be reordered or mutated, index-based identity is wrong.
10
+ - Filtering, sorting and formatting that is more than trivial does not belong in `body`. Compute it ahead of time, or move it into a model or helper.
11
+ - Scope observation tightly, so the only views that update are the ones that read the changed state.
12
+ - Large scrolling content goes in lazy containers. When one part of a screen changes often, extract it into its own subview.
13
+ - Small state changes should not swap the whole top-level view tree. Keep the root stable and vary local sections or modifiers.
14
14
 
15
- ## Example: stable identity
15
+ ## Example: identity
16
+
17
+ Identity taken from the model survives reordering:
16
18
 
17
19
  ```swift
18
- ForEach(items) { item in
19
- Row(item: item)
20
+ ForEach(tasks) { task in
21
+ TaskRow(task: task)
20
22
  }
21
23
  ```
22
24
 
23
- Prefer that over index-based identity when the collection can change order:
25
+ Offset-based identity does not. Avoid this shape when the order can change:
24
26
 
25
27
  ```swift
26
- ForEach(Array(items.enumerated()), id: \.offset) { _, item in
27
- Row(item: item)
28
+ ForEach(Array(tasks.enumerated()), id: \.offset) { _, task in
29
+ TaskRow(task: task)
28
30
  }
29
31
  ```
30
32
 
31
- ## Example: move expensive work out of body
33
+ ## Example: derived data outside the body
32
34
 
33
35
  ```swift
34
- struct FeedView: View {
35
- let items: [FeedItem]
36
+ struct InboxView: View {
37
+ let messages: [Message]
36
38
 
37
- private var sortedItems: [FeedItem] {
38
- items.sorted(using: KeyPathComparator(\.createdAt, order: .reverse))
39
+ private var newestFirst: [Message] {
40
+ messages.sorted(using: KeyPathComparator(\.receivedAt, order: .reverse))
39
41
  }
40
42
 
41
43
  var body: some View {
42
- List(sortedItems) { item in
43
- FeedRow(item: item)
44
+ List(newestFirst) { message in
45
+ MessageRow(message: message)
44
46
  }
45
47
  }
46
48
  }
47
49
  ```
48
50
 
49
- If the work is more expensive than a small derived property, move it into a model, store, or helper that updates less often.
51
+ A small computed property like this is fine. Anything heavier belongs in a model, store or helper that recomputes less often than the view renders.
50
52
 
51
- ## When to investigate further
53
+ ## Signs that deserve a closer look
52
54
 
53
- - Janky scrolling in long feeds or grids
54
- - Typing lag from search or form validation
55
- - Overly broad view updates when one small piece of state changes
56
- - Large screens with many conditionals or repeated formatting work
55
+ - Stutter while scrolling a long feed or grid.
56
+ - Lag while typing, caused by search or form validation.
57
+ - Wide view updates triggered by one small piece of state.
58
+ - Big screens full of conditionals or repeated formatting.
57
59
 
58
- ## Pitfalls
60
+ ## Watch out for
59
61
 
60
- - Recomputing heavy transforms every render
61
- - Observing a large object from many descendants when only one field matters
62
- - Building custom scroll containers when `List`, `LazyVStack`, or `LazyHGrid` would already solve the problem
62
+ - Running a heavy transform on every render.
63
+ - Many descendants observing one large object when they each need a single field.
64
+ - Hand-rolled scroll containers where `List`, `LazyVStack` or `LazyHGrid` already does the job.
@@ -1,48 +1,48 @@
1
1
  # Previews
2
2
 
3
- ## Intent
3
+ ## When to reach for it
4
4
 
5
- Use previews to validate layout, state wiring, and injected dependencies without relying on a running app or live services.
5
+ A preview checks layout, state wiring and injected dependencies with no running app and no live services behind it.
6
6
 
7
- ## Core rules
7
+ ## Rules
8
8
 
9
- - Add `#Preview` coverage for the primary state plus important secondary states such as loading, empty, and error.
10
- - Use deterministic fixtures, mocks, and sample data. Do not make previews depend on live network calls, real databases, or global singletons.
11
- - Install required environment dependencies directly in the preview so the view can render in isolation.
12
- - Keep preview setup close to the view until it becomes noisy; then extract lightweight preview helpers or fixtures.
13
- - If a preview crashes, fix the state initialization or dependency wiring before expanding the feature further.
9
+ - Write a `#Preview` for the main state and for the secondary states that matter: loading, empty, error.
10
+ - Feed previews deterministic fixtures, mocks and sample data. Live network calls, real databases and global singletons have no place in them.
11
+ - Put every environment dependency the view needs into the preview itself, so the view renders on its own.
12
+ - Keep preview setup next to the view. Once it gets noisy, pull it into small preview helpers or fixtures.
13
+ - A crashing preview is a signal: repair the state initialization or the dependency wiring before building more of the feature.
14
14
 
15
- ## Example: simple preview states
15
+ ## Example: one preview per state
16
16
 
17
17
  ```swift
18
- #Preview("Loaded") {
19
- ProfileView(profile: .fixture)
18
+ #Preview("Order shipped") {
19
+ OrderStatusView(order: .sampleShipped)
20
20
  }
21
21
 
22
- #Preview("Empty") {
23
- ProfileView(profile: nil)
22
+ #Preview("No orders yet") {
23
+ OrderStatusView(order: nil)
24
24
  }
25
25
  ```
26
26
 
27
- ## Example: preview with injected dependencies
27
+ ## Example: dependencies installed in the preview
28
28
 
29
29
  ```swift
30
- #Preview("Search results") {
31
- SearchView()
32
- .environment(SearchClient.preview(results: [.fixture, .fixture2]))
33
- .environment(Theme.preview)
30
+ #Preview("Cart with two items") {
31
+ CartScreen()
32
+ .environment(CartService.stub(items: [.sampleMug, .sampleTeapot]))
33
+ .environment(BrandTheme.sample)
34
34
  }
35
35
  ```
36
36
 
37
- ## Preview checklist
37
+ ## Checklist
38
38
 
39
- - Does the preview install every required environment dependency?
40
- - Does it cover at least one success path and one non-happy path?
41
- - Are fixtures stable and small enough to be read quickly?
42
- - Can the preview render without network, auth, or app-global initialization?
39
+ - Is every required environment dependency installed?
40
+ - Is there at least one happy path and one unhappy path?
41
+ - Are the fixtures stable and short enough to read at a glance?
42
+ - Does it render with no network, no sign-in and no app-wide startup code?
43
43
 
44
- ## Pitfalls
44
+ ## Watch out for
45
45
 
46
- - Do not hide preview crashes by making dependencies optional if the production view requires them.
47
- - Avoid huge inline fixtures when a named sample is easier to read.
48
- - Do not couple previews to global shared singletons unless the project has no alternative.
46
+ - Making a dependency optional only so the preview stops crashing, when the real view requires it.
47
+ - Long inline fixtures where a named sample reads better.
48
+ - Tying previews to shared global singletons, unless the project offers no other way.