@mmerterden/multi-agent-pipeline 20.37.0 → 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 (469) hide show
  1. package/CHANGELOG.md +123 -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 +2 -2
  13. package/docs/recovery-guide.md +1 -1
  14. package/install/_dev-only-files.mjs +3 -0
  15. package/install/_platform-filter.mjs +1 -23
  16. package/install/catalog-history.json +1 -1
  17. package/install/claude.mjs +8 -1
  18. package/install/codex.mjs +0 -2
  19. package/install/copilot.mjs +0 -2
  20. package/install/templates/claude-hooks.json +47 -1
  21. package/manifest.json +455 -332
  22. package/package.json +5 -2
  23. package/pipeline/agents/security-auditor.md +58 -6
  24. package/pipeline/commands/multi-agent/build-optimize/SKILL.md +1 -2
  25. package/pipeline/commands/multi-agent/complaint-analysis/SKILL.md +1 -1
  26. package/pipeline/commands/multi-agent/design-check/SKILL.md +1 -1
  27. package/pipeline/commands/multi-agent/graph/SKILL.md +12 -3
  28. package/pipeline/commands/multi-agent/manual-test/SKILL.md +12 -7
  29. package/pipeline/commands/multi-agent/research/SKILL.md +2 -2
  30. package/pipeline/commands/multi-agent/search/SKILL.md +10 -1
  31. package/pipeline/commands/multi-agent/security-review/SKILL.md +4 -0
  32. package/pipeline/commands/multi-agent/setup/SKILL.md +1 -0
  33. package/pipeline/commands/multi-agent/stack/SKILL.md +8 -0
  34. package/pipeline/commands/multi-agent/store-ready/SKILL.md +1 -1
  35. package/pipeline/commands/sim-test.md +34 -1
  36. package/pipeline/lib/context-budget.mjs +103 -0
  37. package/pipeline/lib/credential-inventory.sh +2 -3
  38. package/pipeline/lib/identifier-scan.mjs +145 -0
  39. package/pipeline/lib/outbound-gate.mjs +28 -1
  40. package/pipeline/lib/unattended-profile-check.mjs +13 -4
  41. package/pipeline/multi-agent-refs/analysis/locked.md +1 -1
  42. package/pipeline/multi-agent-refs/analysis/redesign.md +17 -3
  43. package/pipeline/multi-agent-refs/analysis-template-corporate.md +8 -4
  44. package/pipeline/multi-agent-refs/analysis-template.md +7 -5
  45. package/pipeline/multi-agent-refs/audit-guide.md +20 -0
  46. package/pipeline/multi-agent-refs/complaint-analysis/phases.md +1 -0
  47. package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +1 -1
  48. package/pipeline/multi-agent-refs/features/code-graph.md +25 -0
  49. package/pipeline/multi-agent-refs/features/commit-multi-repo.md +63 -0
  50. package/pipeline/multi-agent-refs/features/design-conformance.md +20 -4
  51. package/pipeline/multi-agent-refs/features/dev-multi-repo.md +51 -0
  52. package/pipeline/multi-agent-refs/features/free-models.md +10 -3
  53. package/pipeline/multi-agent-refs/features/research.md +4 -3
  54. package/pipeline/multi-agent-refs/features/security-audit.md +25 -3
  55. package/pipeline/multi-agent-refs/features/test-gap.md +40 -0
  56. package/pipeline/multi-agent-refs/features/unattended-security.md +20 -0
  57. package/pipeline/multi-agent-refs/features/worktree-finalize.md +1 -1
  58. package/pipeline/multi-agent-refs/help/en.md +15 -9
  59. package/pipeline/multi-agent-refs/help/tr.md +15 -9
  60. package/pipeline/multi-agent-refs/knowledge.md +17 -0
  61. package/pipeline/multi-agent-refs/orchestrator/phase-3-user-test.md +12 -9
  62. package/pipeline/multi-agent-refs/outside-the-pipeline.md +9 -0
  63. package/pipeline/multi-agent-refs/phases/log-format.md +5 -0
  64. package/pipeline/multi-agent-refs/phases/operations.md +3 -5
  65. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +4 -4
  66. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +8 -47
  67. package/pipeline/multi-agent-refs/phases/phase-3-review.md +21 -65
  68. package/pipeline/multi-agent-refs/phases/phase-4-commit.md +9 -59
  69. package/pipeline/multi-agent-refs/phases/phase-5-report.md +0 -31
  70. package/pipeline/multi-agent-refs/picker-contract.md +1 -1
  71. package/pipeline/multi-agent-refs/research/engine.md +2 -1
  72. package/pipeline/multi-agent-refs/rules.md +1 -1
  73. package/pipeline/multi-agent-refs/setup/free-models.md +10 -0
  74. package/pipeline/multi-agent-refs/store-ready/gate-3-policy.md +15 -0
  75. package/pipeline/multi-agent-refs/web-guide.md +2 -1
  76. package/pipeline/office/index.html +8 -9
  77. package/pipeline/office/toolkit.json +1 -1
  78. package/pipeline/rules/figma-pipeline.md +6 -3
  79. package/pipeline/rules/outside-the-pipeline.md +1 -1
  80. package/pipeline/schemas/learnings-ledger.schema.json +7 -2
  81. package/pipeline/schemas/prefs.schema.json +17 -4
  82. package/pipeline/schemas/reviewer-output.schema.json +113 -5
  83. package/pipeline/schemas/secret-patterns.json +49 -0
  84. package/pipeline/schemas/security-finding.schema.json +49 -5
  85. package/pipeline/scripts/_code-graph.mjs +3 -3
  86. package/pipeline/scripts/_graph-analysis.mjs +51 -0
  87. package/pipeline/scripts/_memory-policy.mjs +37 -7
  88. package/pipeline/scripts/_secret-scan.mjs +1 -1
  89. package/pipeline/scripts/_skill-practices.mjs +178 -0
  90. package/pipeline/scripts/_stack-routing.mjs +1 -0
  91. package/pipeline/scripts/autopilot-runner.mjs +8 -3
  92. package/pipeline/scripts/build-stack-plugins.mjs +8 -44
  93. package/pipeline/scripts/capture-resume.sh +19 -0
  94. package/pipeline/scripts/checkpoint-fold.sh +59 -0
  95. package/pipeline/scripts/file-context.mjs +306 -70
  96. package/pipeline/scripts/gate-ledger.mjs +1 -1
  97. package/pipeline/scripts/gen-skills-index.mjs +1 -1
  98. package/pipeline/scripts/graph-hint.mjs +197 -0
  99. package/pipeline/scripts/graph-hint.sh +20 -0
  100. package/pipeline/scripts/graph-query.mjs +306 -11
  101. package/pipeline/scripts/graph-report.mjs +29 -1
  102. package/pipeline/scripts/learnings-ledger.mjs +71 -15
  103. package/pipeline/scripts/note-agent-event.mjs +160 -0
  104. package/pipeline/scripts/note-agent-event.sh +19 -0
  105. package/pipeline/scripts/office-control.mjs +41 -15
  106. package/pipeline/scripts/offload-ref.sh +1 -1
  107. package/pipeline/scripts/parity-score.mjs +139 -0
  108. package/pipeline/scripts/pre-commit-check.sh +25 -4
  109. package/pipeline/scripts/pre-push-check.sh +3 -0
  110. package/pipeline/scripts/repo-recommend.mjs +321 -0
  111. package/pipeline/scripts/rework-rulings.mjs +5 -3
  112. package/pipeline/scripts/scan-agent-config.sh +1 -2
  113. package/pipeline/scripts/scope-check-gate.mjs +15 -2
  114. package/pipeline/scripts/security-evidence-gate.mjs +282 -0
  115. package/pipeline/scripts/unattended_policy.py +3 -2
  116. package/pipeline/scripts/user-test-handoff.sh +203 -0
  117. package/pipeline/scripts/validate-analysis-doc.mjs +17 -1
  118. package/pipeline/scripts/validate-planning.mjs +5 -3
  119. package/pipeline/scripts/validate-triage.mjs +2 -1
  120. package/pipeline/scripts/write-state.mjs +13 -4
  121. package/pipeline/skills/.skill-manifest.json +73 -69
  122. package/pipeline/skills/shared/README.md +41 -40
  123. package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +6 -6
  124. package/pipeline/skills/shared/core/apple-archive-compliance/references/examples.md +1 -1
  125. package/pipeline/skills/shared/core/apple-archive-compliance/references/version-history.md +1 -1
  126. package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +1 -1
  127. package/pipeline/skills/shared/core/google-play-compliance/references/notes.md +1 -1
  128. package/pipeline/skills/shared/core/multi-agent/SKILL.md +1 -1
  129. package/pipeline/skills/shared/core/multi-agent-build-optimize/SKILL.md +0 -1
  130. package/pipeline/skills/shared/core/multi-agent-complaint-analysis/SKILL.md +1 -1
  131. package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +5 -5
  132. package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +10 -0
  133. package/pipeline/skills/shared/core/multi-agent-manual-test/SKILL.md +12 -7
  134. package/pipeline/skills/shared/core/multi-agent-research/SKILL.md +2 -2
  135. package/pipeline/skills/shared/core/multi-agent-search/SKILL.md +9 -0
  136. package/pipeline/skills/shared/core/multi-agent-security-review/SKILL.md +3 -2
  137. package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -0
  138. package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +8 -0
  139. package/pipeline/skills/shared/core/multi-agent-store-ready/SKILL.md +4 -3
  140. package/pipeline/skills/shared/core/multi-agent-test/SKILL.md +1 -1
  141. package/pipeline/skills/shared/core/multi-agent-test-accessibility/SKILL.md +1 -1
  142. package/pipeline/skills/shared/core/multi-agent-test-dark-mode/SKILL.md +1 -1
  143. package/pipeline/skills/shared/core/multi-agent-test-dynamic-type/SKILL.md +1 -1
  144. package/pipeline/skills/shared/core/multi-agent-test-gen/SKILL.md +1 -1
  145. package/pipeline/skills/shared/core/multi-agent-test-screenshots/SKILL.md +1 -1
  146. package/pipeline/skills/shared/core/multi-agent-testflight-validation/SKILL.md +2 -2
  147. package/pipeline/skills/shared/external/accessibility-compliance-accessibility-audit/evals/evals.json +44 -0
  148. package/pipeline/skills/shared/external/agent-introspection-debugging/evals/evals.json +42 -0
  149. package/pipeline/skills/shared/external/android-architecture/SKILL.md +1 -1
  150. package/pipeline/skills/shared/external/android-architecture/evals/evals.json +45 -0
  151. package/pipeline/skills/shared/external/android-build-quality-gates/evals/evals.json +45 -0
  152. package/pipeline/skills/shared/external/android-datastore/evals/evals.json +45 -0
  153. package/pipeline/skills/shared/external/android-design-tokens-codegen/evals/evals.json +43 -0
  154. package/pipeline/skills/shared/external/android-jetpack-compose-expert/evals/evals.json +43 -0
  155. package/pipeline/skills/shared/external/android-mvi-viewmodel/evals/evals.json +45 -0
  156. package/pipeline/skills/shared/external/android-performance/SKILL.md +1 -1
  157. package/pipeline/skills/shared/external/android-performance/evals/evals.json +44 -0
  158. package/pipeline/skills/shared/external/android-security/SKILL.md +1 -1
  159. package/pipeline/skills/shared/external/android-security/evals/evals.json +45 -0
  160. package/pipeline/skills/shared/external/api-patterns/evals/evals.json +43 -0
  161. package/pipeline/skills/shared/external/api-security-best-practices/evals/evals.json +44 -0
  162. package/pipeline/skills/shared/external/app-store-changelog/SKILL.md +65 -49
  163. package/pipeline/skills/shared/external/app-store-changelog/evals/evals.json +40 -0
  164. package/pipeline/skills/shared/external/app-store-changelog/references/release-notes-guidelines.md +64 -34
  165. package/pipeline/skills/shared/external/app-store-changelog/scripts/collect_release_changes.sh +21 -23
  166. package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +4 -1
  167. package/pipeline/skills/shared/external/app-store-review/SKILL.md +6 -0
  168. package/pipeline/skills/shared/external/architecture/evals/evals.json +42 -0
  169. package/pipeline/skills/shared/external/backlog/evals/evals.json +42 -0
  170. package/pipeline/skills/shared/external/ci-cd-pipelines/evals/evals.json +44 -0
  171. package/pipeline/skills/shared/external/clean-code/evals/evals.json +45 -0
  172. package/pipeline/skills/shared/external/compose-components/SKILL.md +1 -1
  173. package/pipeline/skills/shared/external/compose-components/evals/evals.json +44 -0
  174. package/pipeline/skills/shared/external/compose-navigation/SKILL.md +1 -1
  175. package/pipeline/skills/shared/external/compose-navigation/evals/evals.json +43 -0
  176. package/pipeline/skills/shared/external/compose-testing/SKILL.md +1 -1
  177. package/pipeline/skills/shared/external/compose-testing/evals/evals.json +44 -0
  178. package/pipeline/skills/shared/external/context-compression/evals/evals.json +43 -0
  179. package/pipeline/skills/shared/external/core-data/SKILL.md +1 -1
  180. package/pipeline/skills/shared/external/council/evals/evals.json +41 -0
  181. package/pipeline/skills/shared/external/css-modern/evals/evals.json +44 -0
  182. package/pipeline/skills/shared/external/css-modern/references/code-examples.md +5 -0
  183. package/pipeline/skills/shared/external/database-patterns/evals/evals.json +46 -0
  184. package/pipeline/skills/shared/external/database-patterns/references/orm-examples.md +5 -0
  185. package/pipeline/skills/shared/external/debugging-strategies/evals/evals.json +43 -0
  186. package/pipeline/skills/shared/external/docker-expert/evals/evals.json +45 -0
  187. package/pipeline/skills/shared/external/e2e-testing/SKILL.md +21 -21
  188. package/pipeline/skills/shared/external/e2e-testing/evals/evals.json +44 -0
  189. package/pipeline/skills/shared/external/e2e-testing/references/document-fixtures.md +5 -5
  190. package/pipeline/skills/shared/external/evidence-github/evals/evals.json +41 -0
  191. package/pipeline/skills/shared/external/evidence-registry/SKILL.md +1 -1
  192. package/pipeline/skills/shared/external/evidence-registry/evals/evals.json +41 -0
  193. package/pipeline/skills/shared/external/fastapi-pro/evals/evals.json +57 -0
  194. package/pipeline/skills/shared/external/firebase/SKILL.md +132 -54
  195. package/pipeline/skills/shared/external/firebase/evals/evals.json +42 -0
  196. package/pipeline/skills/shared/external/firebase/references/functions-and-products.md +51 -0
  197. package/pipeline/skills/shared/external/firebase/references/security-rules.md +59 -0
  198. package/pipeline/skills/shared/external/fix-review-verdicts/evals/evals.json +57 -0
  199. package/pipeline/skills/shared/external/free-llm-apis/SKILL.md +70 -0
  200. package/pipeline/skills/shared/external/free-llm-apis/evals/evals.json +44 -0
  201. package/pipeline/skills/shared/external/free-llm-apis/references/providers.md +33 -0
  202. package/pipeline/skills/shared/external/github-actions-templates/evals/evals.json +44 -0
  203. package/pipeline/skills/shared/external/gradle-kotlin-dsl/SKILL.md +1 -1
  204. package/pipeline/skills/shared/external/gradle-kotlin-dsl/evals/evals.json +58 -0
  205. package/pipeline/skills/shared/external/handle-request/SKILL.md +2 -2
  206. package/pipeline/skills/shared/external/handle-request/evals/evals.json +44 -0
  207. package/pipeline/skills/shared/external/hig-app-icons/SKILL.md +2 -2
  208. package/pipeline/skills/shared/external/hig-app-icons/references/icon-workflow.md +1 -1
  209. package/pipeline/skills/shared/external/hig-components-content/evals/evals.json +43 -0
  210. package/pipeline/skills/shared/external/hig-components-status/evals/evals.json +43 -0
  211. package/pipeline/skills/shared/external/hig-components-system/evals/evals.json +43 -0
  212. package/pipeline/skills/shared/external/hig-inputs/evals/evals.json +44 -0
  213. package/pipeline/skills/shared/external/hig-patterns/evals/evals.json +46 -0
  214. package/pipeline/skills/shared/external/hig-platforms/evals/evals.json +45 -0
  215. package/pipeline/skills/shared/external/hig-technologies/evals/evals.json +44 -0
  216. package/pipeline/skills/shared/external/html-semantic/evals/evals.json +46 -0
  217. package/pipeline/skills/shared/external/humanizer/evals/evals.json +46 -0
  218. package/pipeline/skills/shared/external/ios-coding-standard/evals/evals.json +44 -0
  219. package/pipeline/skills/shared/external/ios-debugger-agent/SKILL.md +91 -52
  220. package/pipeline/skills/shared/external/ios-debugger-agent/evals/evals.json +41 -0
  221. package/pipeline/skills/shared/external/ios-design-review/SKILL.md +12 -12
  222. package/pipeline/skills/shared/external/ios-design-review/references/appearance-matrix.md +16 -16
  223. package/pipeline/skills/shared/external/ios-design-review/references/checklist.md +1 -1
  224. package/pipeline/skills/shared/external/ios-iphone-duo/SKILL.md +0 -1
  225. package/pipeline/skills/shared/external/ios-module-structure/evals/evals.json +42 -0
  226. package/pipeline/skills/shared/external/ios-security/SKILL.md +1 -1
  227. package/pipeline/skills/shared/external/ios-security/evals/evals.json +45 -0
  228. package/pipeline/skills/shared/external/kotlin-coroutines-expert/evals/evals.json +43 -0
  229. package/pipeline/skills/shared/external/localization-reuse-map/evals/evals.json +45 -0
  230. package/pipeline/skills/shared/external/macos-menubar-tuist-app/SKILL.md +170 -74
  231. package/pipeline/skills/shared/external/macos-menubar-tuist-app/evals/evals.json +52 -0
  232. package/pipeline/skills/shared/external/macos-spm-app-packaging/SKILL.md +119 -77
  233. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Package.swift +5 -5
  234. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/MyApp.swift +24 -0
  235. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/version.env +2 -0
  236. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/build_icon.sh +46 -39
  237. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/compile_and_run.sh +70 -49
  238. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/launch.sh +24 -17
  239. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/make_appcast.sh +74 -59
  240. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/package_app.sh +201 -170
  241. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/setup_dev_signing.sh +50 -42
  242. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/sign-and-notarize.sh +65 -35
  243. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/version.env +2 -0
  244. package/pipeline/skills/shared/external/macos-spm-app-packaging/evals/evals.json +45 -0
  245. package/pipeline/skills/shared/external/macos-spm-app-packaging/references/packaging.md +49 -17
  246. package/pipeline/skills/shared/external/macos-spm-app-packaging/references/release.md +48 -23
  247. package/pipeline/skills/shared/external/macos-spm-app-packaging/references/scaffold.md +74 -44
  248. package/pipeline/skills/shared/external/monorepo-architect/evals/evals.json +45 -0
  249. package/pipeline/skills/shared/external/nextjs-app-router/SKILL.md +14 -3
  250. package/pipeline/skills/shared/external/nextjs-app-router/evals/evals.json +43 -0
  251. package/pipeline/skills/shared/external/nextjs-app-router/references/app-router-examples.md +3 -0
  252. package/pipeline/skills/shared/external/nodejs-backend-patterns/evals/evals.json +45 -0
  253. package/pipeline/skills/shared/external/observability-engineer/evals/evals.json +45 -0
  254. package/pipeline/skills/shared/external/passkit-wallet/SKILL.md +10 -0
  255. package/pipeline/skills/shared/external/photos-camera-media/evals/evals.json +45 -0
  256. package/pipeline/skills/shared/external/play-store-review/evals/evals.json +45 -0
  257. package/pipeline/skills/shared/external/python-patterns/evals/evals.json +46 -0
  258. package/pipeline/skills/shared/external/react-best-practices/evals/evals.json +43 -0
  259. package/pipeline/skills/shared/external/rest-api-design/evals/evals.json +46 -0
  260. package/pipeline/skills/shared/external/retrofit-networking/SKILL.md +1 -1
  261. package/pipeline/skills/shared/external/retrofit-networking/evals/evals.json +43 -0
  262. package/pipeline/skills/shared/external/room-database/SKILL.md +1 -1
  263. package/pipeline/skills/shared/external/room-database/evals/evals.json +43 -0
  264. package/pipeline/skills/shared/external/scenario-gap-analysis/SKILL.md +1 -1
  265. package/pipeline/skills/shared/external/scenario-gap-analysis/evals/evals.json +43 -0
  266. package/pipeline/skills/shared/external/search-first/evals/evals.json +42 -0
  267. package/pipeline/skills/shared/external/security-review/SKILL.md +14 -3
  268. package/pipeline/skills/shared/external/security-review/evals/evals.json +48 -0
  269. package/pipeline/skills/shared/external/security-review/references/agentic-systems.md +93 -0
  270. package/pipeline/skills/shared/external/security-review/references/firebase-rules.md +100 -0
  271. package/pipeline/skills/shared/external/security-review/references/graphql.md +82 -0
  272. package/pipeline/skills/shared/external/security-review/references/llm-prompt-injection.md +93 -0
  273. package/pipeline/skills/shared/external/security-review/references/oauth-oidc.md +100 -0
  274. package/pipeline/skills/shared/external/security-review/references/owasp-mobile-top10-2024.md +1 -1
  275. package/pipeline/skills/shared/external/security-review/references/owasp-web-api-top10-2021.md +1 -1
  276. package/pipeline/skills/shared/external/security-review/references/supabase.md +73 -0
  277. package/pipeline/skills/shared/external/signal-community/SKILL.md +29 -10
  278. package/pipeline/skills/shared/external/signal-community/evals/evals.json +42 -0
  279. package/pipeline/skills/shared/external/skill-creator/evals/evals.json +43 -0
  280. package/pipeline/skills/shared/external/skill-creator/template.md +1 -3
  281. package/pipeline/skills/shared/external/spm-build-analysis/SKILL.md +80 -61
  282. package/pipeline/skills/shared/external/spm-build-analysis/evals/evals.json +56 -0
  283. package/pipeline/skills/shared/external/spm-build-analysis/references/build-optimization-sources.md +83 -133
  284. package/pipeline/skills/shared/external/spm-build-analysis/references/recommendation-format.md +41 -40
  285. package/pipeline/skills/shared/external/spm-build-analysis/references/spm-analysis-checks.md +89 -87
  286. package/pipeline/skills/shared/external/spm-build-analysis/scripts/check_spm_pins.py +90 -85
  287. package/pipeline/skills/shared/external/swift-concurrency-expert/SKILL.md +78 -69
  288. package/pipeline/skills/shared/external/swift-concurrency-expert/evals/evals.json +54 -0
  289. package/pipeline/skills/shared/external/swift-concurrency-expert/references/approachable-concurrency.md +52 -48
  290. package/pipeline/skills/shared/external/swift-concurrency-expert/references/swift-6-2-concurrency.md +118 -184
  291. package/pipeline/skills/shared/external/swift-concurrency-expert/references/swiftui-concurrency-tour-wwdc.md +68 -22
  292. package/pipeline/skills/shared/external/swift-concurrency-pro/SKILL.md +117 -94
  293. package/pipeline/skills/shared/external/swift-concurrency-pro/evals/evals.json +57 -0
  294. package/pipeline/skills/shared/external/swift-concurrency-pro/references/actors.md +102 -97
  295. package/pipeline/skills/shared/external/swift-concurrency-pro/references/async-streams.md +36 -37
  296. package/pipeline/skills/shared/external/swift-concurrency-pro/references/bridging.md +82 -34
  297. package/pipeline/skills/shared/external/swift-concurrency-pro/references/bug-patterns.md +90 -52
  298. package/pipeline/skills/shared/external/swift-concurrency-pro/references/cancellation.md +55 -55
  299. package/pipeline/skills/shared/external/swift-concurrency-pro/references/diagnostics.md +66 -43
  300. package/pipeline/skills/shared/external/swift-concurrency-pro/references/hotspots.md +39 -23
  301. package/pipeline/skills/shared/external/swift-concurrency-pro/references/interop.md +66 -68
  302. package/pipeline/skills/shared/external/swift-concurrency-pro/references/new-features.md +152 -131
  303. package/pipeline/skills/shared/external/swift-concurrency-pro/references/structured.md +60 -57
  304. package/pipeline/skills/shared/external/swift-concurrency-pro/references/testing.md +131 -118
  305. package/pipeline/skills/shared/external/swift-concurrency-pro/references/unstructured.md +37 -29
  306. package/pipeline/skills/shared/external/swift-formatstyle/evals/evals.json +43 -0
  307. package/pipeline/skills/shared/external/swift-testing-pro/SKILL.md +77 -58
  308. package/pipeline/skills/shared/external/swift-testing-pro/evals/evals.json +59 -0
  309. package/pipeline/skills/shared/external/swift-testing-pro/references/async-tests.md +139 -144
  310. package/pipeline/skills/shared/external/swift-testing-pro/references/core-rules.md +90 -28
  311. package/pipeline/skills/shared/external/swift-testing-pro/references/migrating-from-xctest.md +38 -21
  312. package/pipeline/skills/shared/external/swift-testing-pro/references/new-features.md +139 -156
  313. package/pipeline/skills/shared/external/swift-testing-pro/references/writing-better-tests.md +173 -147
  314. package/pipeline/skills/shared/external/swiftdata-pro/SKILL.md +75 -59
  315. package/pipeline/skills/shared/external/swiftdata-pro/evals/evals.json +50 -0
  316. package/pipeline/skills/shared/external/swiftdata-pro/references/cloudkit.md +34 -7
  317. package/pipeline/skills/shared/external/swiftdata-pro/references/indexing.md +20 -14
  318. package/pipeline/skills/shared/external/swiftdata-pro/references/inheritance.md +127 -0
  319. package/pipeline/skills/shared/external/swiftdata-pro/references/model-rules.md +141 -0
  320. package/pipeline/skills/shared/external/swiftdata-pro/references/predicates.md +37 -44
  321. package/pipeline/skills/shared/external/swiftlint/evals/evals.json +44 -0
  322. package/pipeline/skills/shared/external/swiftui-expert-skill/SKILL.md +89 -88
  323. package/pipeline/skills/shared/external/swiftui-expert-skill/evals/evals.json +55 -0
  324. package/pipeline/skills/shared/external/swiftui-expert-skill/references/accessibility-patterns.md +104 -122
  325. package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-advanced.md +73 -93
  326. package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-basics.md +144 -169
  327. package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-transitions.md +122 -133
  328. package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts-accessibility.md +141 -99
  329. package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts.md +273 -333
  330. package/pipeline/skills/shared/external/swiftui-expert-skill/references/image-optimization.md +105 -128
  331. package/pipeline/skills/shared/external/swiftui-expert-skill/references/latest-apis.md +199 -312
  332. package/pipeline/skills/shared/external/swiftui-expert-skill/references/layout-best-practices.md +129 -169
  333. package/pipeline/skills/shared/external/swiftui-expert-skill/references/liquid-glass.md +17 -30
  334. package/pipeline/skills/shared/external/swiftui-expert-skill/references/list-patterns.md +198 -258
  335. package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-scenes.md +145 -218
  336. package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-views.md +150 -249
  337. package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-window-styling.md +109 -208
  338. package/pipeline/skills/shared/external/swiftui-expert-skill/references/performance-patterns.md +225 -271
  339. package/pipeline/skills/shared/external/swiftui-expert-skill/references/scroll-patterns.md +117 -210
  340. package/pipeline/skills/shared/external/swiftui-expert-skill/references/sheet-navigation-patterns.md +171 -237
  341. package/pipeline/skills/shared/external/swiftui-expert-skill/references/state-management.md +196 -260
  342. package/pipeline/skills/shared/external/swiftui-expert-skill/references/view-structure.md +167 -230
  343. package/pipeline/skills/shared/external/swiftui-gestures/evals/evals.json +43 -0
  344. package/pipeline/skills/shared/external/swiftui-layout-components/evals/evals.json +43 -0
  345. package/pipeline/skills/shared/external/swiftui-navigation/evals/evals.json +44 -0
  346. package/pipeline/skills/shared/external/swiftui-navigation/references/navigationstack.md +1 -2
  347. package/pipeline/skills/shared/external/swiftui-patterns/evals/evals.json +43 -0
  348. package/pipeline/skills/shared/external/swiftui-performance/evals/evals.json +44 -0
  349. package/pipeline/skills/shared/external/swiftui-performance-audit/SKILL.md +71 -79
  350. package/pipeline/skills/shared/external/swiftui-performance-audit/evals/evals.json +55 -0
  351. package/pipeline/skills/shared/external/swiftui-performance-audit/references/audit-layout.md +50 -0
  352. package/pipeline/skills/shared/external/swiftui-performance-audit/references/capture-checklist.md +51 -0
  353. package/pipeline/skills/shared/external/swiftui-performance-audit/references/hangs.md +34 -0
  354. package/pipeline/skills/shared/external/swiftui-performance-audit/references/instruments-guide.md +68 -0
  355. package/pipeline/skills/shared/external/swiftui-performance-audit/references/smell-catalog.md +191 -0
  356. package/pipeline/skills/shared/external/swiftui-performance-audit/references/update-model.md +69 -0
  357. package/pipeline/skills/shared/external/swiftui-pro/SKILL.md +65 -63
  358. package/pipeline/skills/shared/external/swiftui-pro/evals/evals.json +45 -0
  359. package/pipeline/skills/shared/external/swiftui-pro/references/accessibility.md +40 -13
  360. package/pipeline/skills/shared/external/swiftui-pro/references/api.md +74 -29
  361. package/pipeline/skills/shared/external/swiftui-pro/references/data.md +44 -24
  362. package/pipeline/skills/shared/external/swiftui-pro/references/design.md +45 -31
  363. package/pipeline/skills/shared/external/swiftui-pro/references/hygiene.md +17 -8
  364. package/pipeline/skills/shared/external/swiftui-pro/references/navigation.md +19 -9
  365. package/pipeline/skills/shared/external/swiftui-pro/references/performance.md +50 -34
  366. package/pipeline/skills/shared/external/swiftui-pro/references/swift.md +73 -45
  367. package/pipeline/skills/shared/external/swiftui-pro/references/views.md +48 -23
  368. package/pipeline/skills/shared/external/swiftui-ui-patterns/SKILL.md +89 -83
  369. package/pipeline/skills/shared/external/swiftui-ui-patterns/evals/evals.json +44 -0
  370. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/app-wiring.md +119 -114
  371. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/async-state.md +76 -61
  372. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/components-index.md +63 -46
  373. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/controls.md +32 -31
  374. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/deeplinks.md +49 -38
  375. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/focus.md +77 -49
  376. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/form.md +61 -44
  377. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/grids.md +40 -42
  378. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/input-toolbar.md +44 -31
  379. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/lightweight-clients.md +90 -64
  380. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/list.md +48 -49
  381. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/loading-placeholders.md +36 -25
  382. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/macos-settings.md +30 -30
  383. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/matched-transitions.md +49 -32
  384. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/media.md +49 -41
  385. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/menu-bar.md +52 -48
  386. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/navigationstack.md +119 -104
  387. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/overlay.md +30 -27
  388. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/performance.md +33 -31
  389. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/previews.md +27 -27
  390. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scroll-reveal.md +79 -86
  391. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scrollview.md +47 -40
  392. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/searchable.md +55 -40
  393. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/sheets.md +113 -84
  394. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/split-views.md +37 -34
  395. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/tabview.md +75 -75
  396. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/theming.md +37 -32
  397. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/title-menus.md +41 -51
  398. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/top-bar.md +46 -30
  399. package/pipeline/skills/shared/external/swiftui-uikit-interop/evals/evals.json +44 -0
  400. package/pipeline/skills/shared/external/swiftui-view-refactor/SKILL.md +152 -121
  401. package/pipeline/skills/shared/external/swiftui-view-refactor/evals/evals.json +56 -0
  402. package/pipeline/skills/shared/external/swiftui-view-refactor/references/mv-patterns.md +107 -98
  403. package/pipeline/skills/shared/external/swiftui-webkit/evals/evals.json +44 -0
  404. package/pipeline/skills/shared/external/tailwind-css/evals/evals.json +43 -0
  405. package/pipeline/skills/shared/external/test-result-triage/SKILL.md +2 -2
  406. package/pipeline/skills/shared/external/test-result-triage/evals/evals.json +44 -0
  407. package/pipeline/skills/shared/external/testing-backend/evals/evals.json +42 -0
  408. package/pipeline/skills/shared/external/tipkit/evals/evals.json +44 -0
  409. package/pipeline/skills/shared/external/typescript-patterns/evals/evals.json +42 -0
  410. package/pipeline/skills/shared/external/valven-rules/evals/evals.json +44 -0
  411. package/pipeline/skills/shared/external/vision-framework/evals/evals.json +44 -0
  412. package/pipeline/skills/shared/external/vue-composition/evals/evals.json +42 -0
  413. package/pipeline/skills/shared/external/weatherkit/evals/evals.json +42 -0
  414. package/pipeline/skills/shared/external/web-accessibility/evals/evals.json +43 -0
  415. package/pipeline/skills/shared/external/web-performance/evals/evals.json +44 -0
  416. package/pipeline/skills/shared/external/web-testing/SKILL.md +2 -2
  417. package/pipeline/skills/shared/external/web-testing/evals/evals.json +43 -0
  418. package/pipeline/skills/shared/external/web-testing/references/testing-examples.md +2 -2
  419. package/pipeline/skills/shared/external/widgetkit/evals/evals.json +44 -0
  420. package/pipeline/skills/shared/external/xcode-build-benchmark/SKILL.md +61 -55
  421. package/pipeline/skills/shared/external/xcode-build-benchmark/evals/evals.json +42 -0
  422. package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmark-artifacts.md +69 -67
  423. package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmarking-workflow.md +39 -47
  424. package/pipeline/skills/shared/external/xcode-build-benchmark/schemas/build-benchmark.schema.json +72 -154
  425. package/pipeline/skills/shared/external/xcode-build-benchmark/scripts/benchmark_builds.py +207 -245
  426. package/pipeline/skills/shared/external/xcode-build-fixer/SKILL.md +145 -139
  427. package/pipeline/skills/shared/external/xcode-build-fixer/evals/evals.json +54 -0
  428. package/pipeline/skills/shared/external/xcode-build-fixer/references/build-settings-best-practices.md +81 -175
  429. package/pipeline/skills/shared/external/xcode-build-fixer/references/fix-patterns.md +188 -143
  430. package/pipeline/skills/shared/external/xcode-build-fixer/references/recommendation-format.md +41 -40
  431. package/pipeline/skills/shared/external/xcode-build-fixer/scripts/benchmark_builds.py +207 -245
  432. package/pipeline/skills/shared/external/xcode-build-orchestrator/SKILL.md +107 -98
  433. package/pipeline/skills/shared/external/xcode-build-orchestrator/evals/evals.json +54 -0
  434. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/benchmark-artifacts.md +69 -67
  435. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/build-settings-best-practices.md +81 -175
  436. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/orchestration-report-template.md +81 -69
  437. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/recommendation-format.md +41 -40
  438. package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/benchmark_builds.py +207 -245
  439. package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/diagnose_compilation.py +155 -210
  440. package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/generate_optimization_report.py +355 -480
  441. package/pipeline/skills/shared/external/xcode-compilation-analyzer/SKILL.md +70 -69
  442. package/pipeline/skills/shared/external/xcode-compilation-analyzer/evals/evals.json +54 -0
  443. package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/build-optimization-sources.md +83 -133
  444. package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/code-compilation-checks.md +85 -73
  445. package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/recommendation-format.md +41 -40
  446. package/pipeline/skills/shared/external/xcode-compilation-analyzer/scripts/diagnose_compilation.py +155 -210
  447. package/pipeline/skills/shared/external/xcode-project-analyzer/SKILL.md +54 -52
  448. package/pipeline/skills/shared/external/xcode-project-analyzer/evals/evals.json +54 -0
  449. package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-optimization-sources.md +83 -133
  450. package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-settings-best-practices.md +81 -175
  451. package/pipeline/skills/shared/external/xcode-project-analyzer/references/project-audit-checks.md +115 -83
  452. package/pipeline/skills/shared/external/xcode-project-analyzer/references/recommendation-format.md +41 -40
  453. package/pipeline/scripts/_notices.mjs +0 -171
  454. package/pipeline/skills/shared/external/NOTICE-avdlee-swiftui-agent-skill.md +0 -48
  455. package/pipeline/skills/shared/external/NOTICE-dimillian-skills.md +0 -63
  456. package/pipeline/skills/shared/external/NOTICE-paul-hudson-skills.md +0 -54
  457. package/pipeline/skills/shared/external/NOTICE-vibeship-spawner-skills.md +0 -203
  458. package/pipeline/skills/shared/external/NOTICE-xcode-build-skills.md +0 -60
  459. package/pipeline/skills/shared/external/ios-iphone-duo/NOTICE.md +0 -53
  460. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/main.swift +0 -11
  461. package/pipeline/skills/shared/external/swiftdata-pro/references/class-inheritance.md +0 -104
  462. package/pipeline/skills/shared/external/swiftdata-pro/references/core-rules.md +0 -20
  463. package/pipeline/skills/shared/external/swiftui-performance-audit/references/code-smells.md +0 -158
  464. package/pipeline/skills/shared/external/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +0 -46
  465. package/pipeline/skills/shared/external/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +0 -29
  466. package/pipeline/skills/shared/external/swiftui-performance-audit/references/profiling-intake.md +0 -44
  467. package/pipeline/skills/shared/external/swiftui-performance-audit/references/report-template.md +0 -47
  468. package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +0 -33
  469. package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-improving-swiftui-performance.md +0 -52
@@ -1,125 +1,148 @@
1
1
  ---
2
2
  name: swift-concurrency-pro
3
- description: "Reviews Swift code for concurrency correctness, modern API usage, and common async/await pitfalls. Use when reading, writing, or reviewing Swift concurrency code; to fix one compiler diagnostic use swift-concurrency-expert, for language rules and Swift 6 migration use swift-concurrency."
4
- license: MIT
3
+ description: "Audits Swift concurrency per file: actor reentrancy, leaked tasks, cancellation, continuations, streams and unsafe Sendable, with before/after fixes. Use when reviewing concurrency code; one diagnostic: swift-concurrency-expert; Swift 6 migration: swift-concurrency."
5
4
  metadata:
6
- source: "twostraws/Swift-Concurrency-Agent-Skill (MIT)"
7
- author: Paul Hudson
8
- version: "1.0"
5
+ source: multi-agent-pipeline
9
6
  ---
10
7
 
11
- Review Swift concurrency code for correctness, modern API usage, and adherence to project conventions. Report only genuine problems - do not nitpick or invent issues.
12
-
13
- Review process:
14
-
15
- 1. Scan for known-dangerous patterns using `references/hotspots.md` to prioritize what to inspect.
16
- 1. Check for recent Swift 6.2 concurrency behavior using `references/new-features.md`.
17
- 1. Validate actor usage for reentrancy and isolation correctness using `references/actors.md`.
18
- 1. Ensure structured concurrency is preferred over unstructured where appropriate using `references/structured.md`.
19
- 1. Check unstructured task usage for correctness using `references/unstructured.md`.
20
- 1. Verify cancellation is handled correctly using `references/cancellation.md`.
21
- 1. Validate async stream and continuation usage using `references/async-streams.md`.
22
- 1. Check bridging code between sync and async worlds using `references/bridging.md`.
23
- 1. Review any legacy concurrency migrations using `references/interop.md`.
24
- 1. Cross-check against common failure modes using `references/bug-patterns.md`.
25
- 1. If the project has strict-concurrency errors, map diagnostics to fixes using `references/diagnostics.md`.
26
- 1. If reviewing tests, check async test patterns using `references/testing.md`.
27
-
28
- If doing a partial review, load only the relevant reference files.
29
-
30
-
31
- ## Core Instructions
32
-
33
- - Target Swift 6.2 or later with strict concurrency checking.
34
- - If code spans multiple targets or packages, compare their concurrency build settings before assuming behavior should match.
35
- - Prefer structured concurrency (task groups) over unstructured (`Task {}`).
36
- - Prefer Swift concurrency over Grand Central Dispatch for new code. GCD is still acceptable in low-level code, framework interop, or performance-critical synchronous work where queues and locks are the right tool - don't flag these as errors.
37
- - If an API offers both `async`/`await` and closure-based variants, always prefer `async`/`await`.
38
- - Do not introduce third-party concurrency frameworks without asking first.
39
- - Do not suggest `@unchecked Sendable` to fix compiler errors. It silences the diagnostic without fixing the underlying race. Prefer actors, value types, or `sending` parameters instead. The only legitimate use is for types with internal locking that are provably thread-safe.
40
-
41
-
42
- ## Output Format
43
-
44
- Organize findings by file. For each issue:
45
-
46
- 1. State the file and relevant line(s).
47
- 2. Name the rule being violated.
48
- 3. Show a brief before/after code fix.
49
-
50
- Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.
51
-
52
- Example output:
53
-
54
- ### DataLoader.swift
55
-
56
- **Line 18: Actor reentrancy - state may have changed across the `await`.**
8
+ # Swift Concurrency Review
9
+
10
+ The job is a review of Swift concurrency code: is it correct, does it use the
11
+ current APIs, and does it follow the conventions the project already has.
12
+ Flag real defects only. A finding that would not change behaviour, safety or
13
+ clarity in a meaningful way does not belong in the report.
14
+
15
+ ## Baseline assumptions
16
+
17
+ - The target language mode is Swift 6.2 or newer, with strict concurrency
18
+ checking turned on.
19
+ - When the code under review lives in more than one target or package, read
20
+ each one's concurrency build settings first. Two modules can legitimately
21
+ behave differently.
22
+ - Structured concurrency (task groups, `async let`) beats unstructured
23
+ `Task {}` whenever both fit.
24
+ - New code should use Swift concurrency rather than Grand Central Dispatch.
25
+ Queues and locks remain a valid choice in low-level code, framework
26
+ interop and hot synchronous paths; those uses are not findings.
27
+ - Where an API ships both an `async` form and a completion-handler form, the
28
+ `async` form wins.
29
+ - Ask the user before adding a third-party concurrency library.
30
+ - Never offer `@unchecked Sendable` as the cure for a compiler error. It
31
+ mutes the diagnostic and leaves the race in place. Reach for an actor, a
32
+ value type or a `sending` parameter instead. The one honest use is a type
33
+ whose thread safety comes from its own locking and can be shown to hold.
34
+
35
+ ## Review workflow
36
+
37
+ Work through the steps that apply. For a narrow review, open only the
38
+ reference files that match the code in front of you.
39
+
40
+ 1. Triage with [references/hotspots.md](references/hotspots.md): the grep
41
+ targets that most often hide a bug.
42
+ 2. Check the target's Approachable Concurrency and Default Actor Isolation
43
+ settings first, then check behaviour that changed in Swift 6.2 against
44
+ [references/new-features.md](references/new-features.md).
45
+ 3. Check actor isolation and reentrancy with
46
+ [references/actors.md](references/actors.md).
47
+ 4. Confirm structured concurrency is used where it fits, with
48
+ [references/structured.md](references/structured.md).
49
+ 5. Check every unstructured task with
50
+ [references/unstructured.md](references/unstructured.md).
51
+ 6. Verify cancellation handling with
52
+ [references/cancellation.md](references/cancellation.md).
53
+ 7. Check `AsyncStream` and continuation lifecycles with
54
+ [references/async-streams.md](references/async-streams.md).
55
+ 8. Check sync-to-async bridges with
56
+ [references/bridging.md](references/bridging.md).
57
+ 9. Check migrations away from GCD, locks, delegates and Combine with
58
+ [references/interop.md](references/interop.md).
59
+ 10. Compare the code against the known failure catalogue in
60
+ [references/bug-patterns.md](references/bug-patterns.md).
61
+ 11. When the build reports strict-concurrency errors, map each one to a
62
+ remedy with [references/diagnostics.md](references/diagnostics.md).
63
+ 12. When tests are in scope, check them with
64
+ [references/testing.md](references/testing.md).
65
+
66
+ ## Report format
67
+
68
+ Group findings by file, and leave out files that have none. Each finding
69
+ carries:
70
+
71
+ 1. The file and the line or lines involved.
72
+ 2. The rule it breaks.
73
+ 3. A short before/after snippet that shows the fix.
74
+
75
+ Close with a ranked summary that says which changes matter most.
76
+
77
+ A sample report:
78
+
79
+ ### ThumbnailStore.swift
80
+
81
+ **Line 22: Reentrancy - the dictionary may change while `render` is suspended.**
57
82
 
58
83
  ```swift
59
84
  // Before
60
- actor Cache {
61
- var items: [String: Data] = [:]
85
+ actor ThumbnailStore {
86
+ private var thumbnails: [Int: Thumbnail] = [:]
62
87
 
63
- func fetch(_ key: String) async throws -> Data {
64
- if items[key] == nil {
65
- items[key] = try await download(key)
88
+ func thumbnail(for photoID: Int) async throws -> Thumbnail {
89
+ if thumbnails[photoID] == nil {
90
+ thumbnails[photoID] = try await render(photoID)
66
91
  }
67
- return items[key]!
92
+ return thumbnails[photoID]!
68
93
  }
69
94
  }
70
95
 
71
96
  // After
72
- actor Cache {
73
- var items: [String: Data] = [:]
74
-
75
- func fetch(_ key: String) async throws -> Data {
76
- if let existing = items[key] { return existing }
77
- let data = try await download(key)
78
- items[key] = data
79
- return data
97
+ actor ThumbnailStore {
98
+ private var thumbnails: [Int: Thumbnail] = [:]
99
+
100
+ func thumbnail(for photoID: Int) async throws -> Thumbnail {
101
+ if let ready = thumbnails[photoID] { return ready }
102
+ let rendered = try await render(photoID)
103
+ thumbnails[photoID] = rendered
104
+ return rendered
80
105
  }
81
106
  }
82
107
  ```
83
108
 
84
- **Line 34: Use `withTaskGroup` instead of creating tasks in a loop.**
109
+ **Line 41: Replace the per-item `Task` loop with a task group.**
85
110
 
86
111
  ```swift
87
112
  // Before
88
- for url in urls {
89
- Task { try await fetch(url) }
113
+ for photoID in selection {
114
+ Task { try await upload(photoID) }
90
115
  }
91
116
 
92
117
  // After
93
- try await withThrowingTaskGroup(of: Data.self) { group in
94
- for url in urls {
95
- group.addTask { try await fetch(url) }
118
+ try await withThrowingTaskGroup(of: UploadReceipt.self) { group in
119
+ for photoID in selection {
120
+ group.addTask { try await upload(photoID) }
96
121
  }
97
-
98
- for try await result in group {
99
- process(result)
122
+ for try await receipt in group {
123
+ record(receipt)
100
124
  }
101
125
  }
102
126
  ```
103
127
 
104
128
  ### Summary
105
129
 
106
- 1. **Correctness (high):** Actor reentrancy bug on line 18 may cause duplicate downloads and a force-unwrap crash.
107
- 2. **Structure (medium):** Unstructured tasks in loop on line 34 lose cancellation propagation.
108
-
109
- End of example.
110
-
111
-
112
- ## References
113
-
114
- - `references/hotspots.md` - Grep targets for code review: known-dangerous patterns and what to check for each.
115
- - `references/new-features.md` - Swift 6.2 changes that alter review advice: default actor isolation, isolated conformances, caller-actor async behavior, `@concurrent`, `Task.immediate`, task naming, and priority escalation.
116
- - `references/actors.md` - Actor reentrancy, shared-state annotations, global actor inference, and isolation patterns.
117
- - `references/structured.md` - Task groups over loops, discarding task groups, concurrency limits.
118
- - `references/unstructured.md` - Task vs Task.detached, when Task {} is a code smell.
119
- - `references/cancellation.md` - Cancellation propagation, cooperative checking, broken cancellation patterns.
120
- - `references/async-streams.md` - AsyncStream factory, continuation lifecycle, back-pressure.
121
- - `references/bridging.md` - Checked continuations, wrapping legacy APIs, `@unchecked Sendable`.
122
- - `references/interop.md` - Migrating from GCD, `Mutex`/locks, completion handlers, delegates, and Combine.
123
- - `references/bug-patterns.md` - Common concurrency failure modes and their fixes.
124
- - `references/diagnostics.md` - Strict-concurrency compiler errors, protocol conformance fixes, and likely remedies.
125
- - `references/testing.md` - Async test strategy with Swift Testing, race detection, avoiding timing-based tests.
130
+ 1. **Correctness (high):** the reentrancy defect on line 22 can render the
131
+ same thumbnail twice and crash on the force unwrap.
132
+ 2. **Structure (medium):** the loose tasks on line 41 escape cancellation and
133
+ drop their errors.
134
+
135
+ ## Reference files
136
+
137
+ - [references/hotspots.md](references/hotspots.md): search targets and what to check at each one.
138
+ - [references/new-features.md](references/new-features.md): what Swift 6.2 changed for reviewers (main-actor default, isolated conformances, caller-actor async functions, `@concurrent`, `Task.immediate`, isolated deinit, priority escalation, task names).
139
+ - [references/actors.md](references/actors.md): reentrancy, protecting shared state, global actor inference, `isolated` parameters, isolation assertions.
140
+ - [references/structured.md](references/structured.md): `async let` versus task groups, discarding groups, throttling, partial results.
141
+ - [references/unstructured.md](references/unstructured.md): `Task` versus `Task.detached` and when `Task {}` is a smell.
142
+ - [references/cancellation.md](references/cancellation.md): propagation, cooperative checks, cancellation handlers, broken patterns.
143
+ - [references/async-streams.md](references/async-streams.md): the `makeStream(of:)` factory, finishing continuations, buffering.
144
+ - [references/bridging.md](references/bridging.md): checked continuations, delegate wrapping, runtime isolation checks, `@unchecked Sendable`.
145
+ - [references/interop.md](references/interop.md): moving off GCD, locks and `Mutex`, completion handlers, delegates and Combine.
146
+ - [references/bug-patterns.md](references/bug-patterns.md): frequent failure modes and the preferred fix for each.
147
+ - [references/diagnostics.md](references/diagnostics.md): compiler error text mapped to the fix to try first.
148
+ - [references/testing.md](references/testing.md): async tests with Swift Testing, cancellation tests, race detection.
@@ -0,0 +1,57 @@
1
+ {
2
+ "skill_name": "swift-concurrency-pro",
3
+ "evals": [
4
+ {
5
+ "id": 0,
6
+ "prompt": "Review this actor before we merge it:\n\nactor TokenCache {\n var tokens: [String: Token] = [:]\n func token(for account: String) async throws -> Token {\n if tokens[account] == nil {\n tokens[account] = try await refreshToken(account)\n }\n return tokens[account]!\n }\n}\n\nAlso, ProfileScreen calls it like this: for account in accounts { Task { try await cache.token(for: account) } }",
7
+ "expected_output": "Reports findings grouped by file with line, rule and a before/after fix: the actor reentrancy check-then-act across await (duplicate refreshes and a force-unwrap crash), fixed by storing the awaited value in a local and optionally caching in-flight Task handles; and the per-item unstructured Task loop that loses cancellation and errors, replaced by withThrowingTaskGroup. Ends with a prioritized summary.",
8
+ "files": [],
9
+ "expectations": [
10
+ "Identifies actor reentrancy: state can change across the await inside the actor",
11
+ "Flags the force unwrap after await as a possible crash",
12
+ "Shows a fix that captures the awaited result in a local before writing, and mentions deduplicating with in-flight Task handles",
13
+ "Replaces the Task-per-item loop with withTaskGroup or withThrowingTaskGroup and explains lost cancellation and swallowed errors",
14
+ "Organizes output per file with line references and ends with a prioritized summary"
15
+ ]
16
+ },
17
+ {
18
+ "id": 1,
19
+ "prompt": "Our Swift 6.2 app target has main-actor default isolation on. A teammate wrote `nonisolated func decodeCatalog(_ data: Data) async -> Catalog` that parses a 40 MB JSON file and says it runs in the background because it is async and nonisolated. Another teammate wants to fix a 'Static property shared is not concurrency-safe' error by adding @unchecked Sendable to the class. What do you recommend?",
20
+ "expected_output": "Checks the NonisolatedNonsendingByDefault (Approachable Concurrency) setting first: with it on, a nonisolated async function stays on the caller's actor, so the CPU-heavy parse runs on the main actor; with it off, it hops to the global executor; recommends marking it @concurrent. Rejects @unchecked Sendable as a silencer; recommends @MainActor on the static (possibly already implied by the module default), a Sendable let-only type, or nonisolated(unsafe) only for truly immutable state, and notes default isolation is a per-module setting.",
21
+ "files": [],
22
+ "expectations": [
23
+ "Checks the setting first: with NonisolatedNonsendingByDefault (Approachable Concurrency) on, the nonisolated async function stays on the caller's actor; off, it hops to the global executor",
24
+ "Recommends @concurrent for the CPU-heavy decoding",
25
+ "Does not recommend @unchecked Sendable to silence the static property error",
26
+ "Suggests @MainActor on the static property and notes main-actor default isolation may already imply it",
27
+ "Mentions that default actor isolation is configured per module"
28
+ ]
29
+ },
30
+ {
31
+ "id": 2,
32
+ "prompt": "Here is how we test our sync engine with Swift Testing:\n\n@Test(.serialized) func syncCompletes() async throws {\n engine.start()\n try await Task.sleep(for: .seconds(2))\n #expect(engine.isIdle)\n}\n\nWe added .serialized because the test is flaky in parallel. Also our cancellation test calls try Task.checkCancellation() inside the test body after cancelling. Is this right?",
33
+ "expected_output": "Explains that .serialized on a single non-parameterized test function has no effect (it serializes the cases of a parameterized test, or every test in a suite); that sleeping for a fixed time is a flaky timing-based test and the test should await the real async work (or use confirmation or a checked continuation); and that a cancellation test must exercise a cancellation check that lives in production code, cancelling the task while the code under test is running and expecting CancellationError from the task's value. May suggest Thread Sanitizer for races.",
34
+ "files": [],
35
+ "expectations": [
36
+ "States that .serialized has no effect on a single non-parameterized test function",
37
+ "Rejects Task.sleep based waiting as flaky and recommends awaiting the real operation",
38
+ "Mentions confirmation() or withCheckedContinuation for callback-based APIs",
39
+ "Explains the cancellation check must be in production code, not in the test",
40
+ "Shows expecting CancellationError from awaiting the cancelled task's value"
41
+ ]
42
+ },
43
+ {
44
+ "id": 3,
45
+ "prompt": "I'm wrapping a C SDK: `sdk_download(url, completion)` returns a handle with `sdk_cancel(handle)`, and the completion sometimes never fires when the network drops. I used withUnsafeContinuation for speed and AsyncStream { cont in self.cont = cont } for its progress callbacks. Review the approach.",
46
+ "expected_output": "Recommends withCheckedThrowingContinuation by default (unsafe only after profiling), resuming exactly once on every path and adding a timeout or restructuring since the callback can be dropped; bridging cancellation with withTaskCancellationHandler calling sdk_cancel in onCancel; using AsyncStream.makeStream(of:) with a bounded buffering policy, finishing the continuation on completion and stopping the SDK in onTermination.",
47
+ "files": [],
48
+ "expectations": [
49
+ "Recommends checked continuations over unsafe ones unless profiling proves a bottleneck",
50
+ "Requires resuming exactly once and handling the never-fired callback with a timeout or restructuring",
51
+ "Uses withTaskCancellationHandler with onCancel calling the SDK cancel function",
52
+ "Recommends AsyncStream.makeStream(of:) instead of the closure initializer",
53
+ "Mentions finishing the stream continuation and cleaning up in onTermination, and a bounded buffering policy"
54
+ ]
55
+ }
56
+ ]
57
+ }
@@ -6,160 +6,165 @@
6
6
  - [Global actor inference rules](#global-actor-inference-rules)
7
7
  - [`isolated` parameters](#isolated-parameters)
8
8
  - [`isolated deinit`](#isolated-deinit)
9
- - [What a custom actor changes](#what-a-custom-actor-changes)
10
- - [Making assertions](#making-assertions)
9
+ - [What a custom actor costs](#what-a-custom-actor-costs)
10
+ - [Isolation assertions](#isolation-assertions)
11
11
  <!-- /toc -->
12
12
 
13
13
  ## Reentrancy
14
14
 
15
- **Important:** This is the most common concurrency bug LLMs produce: after every `await` inside an actor, all assumptions about the actor's state are invalidated because other calls may have run in the meantime.
15
+ **The single most frequent actor bug in generated code:** every `await`
16
+ inside an actor method is a point where other calls can run on the actor.
17
+ Anything the method believed about the actor's state before the `await` must
18
+ be treated as unknown after it.
16
19
 
17
20
  ```swift
18
- // Bug: After the await, items[key] may already have been set by another caller.
19
- // This causes duplicate work, and the force unwrap will crash if another caller
20
- // removed the key between assignment and return.
21
- actor VideoCache {
22
- var items: [URL: Video] = [:]
23
-
24
- func video(for url: URL) async throws -> Video {
25
- if items[url] == nil {
26
- items[url] = try await downloadVideo(url)
21
+ // Defect: while `loadAvatar` is suspended, another caller may already have
22
+ // stored an avatar for this user, so the work runs twice. If someone removes
23
+ // the entry between the store and the return, the `!` traps.
24
+ actor AvatarCache {
25
+ private var avatars: [UserID: Avatar] = [:]
26
+
27
+ func avatar(for user: UserID) async throws -> Avatar {
28
+ if avatars[user] == nil {
29
+ avatars[user] = try await loadAvatar(user)
27
30
  }
28
- return items[url]!
31
+ return avatars[user]!
29
32
  }
30
33
  }
31
34
  ```
32
35
 
33
- Fix: capture the result in a local, then assign. **Never assume state is unchanged after `await`.**
36
+ Fix: put the awaited result in a local, then store it. **Do not assume any
37
+ state survived an `await` unchanged.**
34
38
 
35
39
  ```swift
36
- actor VideoCache {
37
- var items: [URL: Video] = [:]
38
-
39
- func video(for url: URL) async throws -> Video {
40
- if let cached = items[url] { return cached }
41
- let video = try await downloadVideo(url)
42
- items[url] = video
43
- return video
40
+ actor AvatarCache {
41
+ private var avatars: [UserID: Avatar] = [:]
42
+
43
+ func avatar(for user: UserID) async throws -> Avatar {
44
+ if let known = avatars[user] { return known }
45
+ let fresh = try await loadAvatar(user)
46
+ avatars[user] = fresh
47
+ return fresh
44
48
  }
45
49
  }
46
50
  ```
47
51
 
48
- To avoid two callers both downloading the same URL, you could try storing in-flight tasks similar to this:
52
+ That still lets two callers load the same avatar at once. To share one load,
53
+ keep the in-flight tasks too:
49
54
 
50
55
  ```swift
51
- actor VideoCache {
52
- var items: [URL: Video] = [:]
53
- var inFlight: [URL: Task<Video, Error>] = [:]
56
+ actor AvatarCache {
57
+ private var avatars: [UserID: Avatar] = [:]
58
+ private var pending: [UserID: Task<Avatar, Error>] = [:]
54
59
 
55
- func video(for url: URL) async throws -> Video {
56
- if let cached = items[url] { return cached }
60
+ func avatar(for user: UserID) async throws -> Avatar {
61
+ if let known = avatars[user] { return known }
62
+ if let running = pending[user] { return try await running.value }
57
63
 
58
- if let task = inFlight[url] {
59
- return try await task.value
60
- }
61
-
62
- let task = Task {
63
- try await downloadVideo(url)
64
- }
64
+ let load = Task { try await loadAvatar(user) }
65
+ pending[user] = load
66
+ defer { pending[user] = nil }
65
67
 
66
- inFlight[url] = task
67
-
68
- do {
69
- let video = try await task.value
70
- items[url] = video
71
- inFlight[url] = nil
72
- return video
73
- } catch {
74
- inFlight[url] = nil
75
- throw error
76
- }
68
+ let fresh = try await load.value
69
+ avatars[user] = fresh
70
+ return fresh
77
71
  }
78
72
  }
79
73
  ```
80
74
 
81
-
82
75
  ## Protecting global and static state
83
76
 
84
- Global and static mutable variables need an explicit plan for isolation.
77
+ Every mutable global or static needs a stated isolation strategy, one the
78
+ compiler can check:
85
79
 
86
- For shared globals, describe the protection mechanism the compiler can rely on:
87
-
88
- - `@MainActor` when the symbol belongs to main-actor code and callers should keep synchronous access there. (This is particularly important for any code that interacts with or updates the UI.)
89
- - `@unchecked Sendable` when safety already comes from locks, queues, or another manual scheme the compiler cannot prove. (**Important:** This requires a high standard of coding to get right, so check carefully.)
90
- - If neither description is true, the shared global still is likely to have an isolation problem.
91
-
92
- Example:
80
+ - `@MainActor` when main-actor code owns the symbol and reads it
81
+ synchronously. Anything that reads or updates UI
82
+ falls in this group.
83
+ - `@unchecked Sendable` when locks, queues or some other manual scheme already
84
+ provide the safety and the compiler simply cannot see it. **This takes very
85
+ careful code to get right, so review it closely.**
86
+ - When neither statement holds, the global almost certainly has an isolation
87
+ problem.
93
88
 
94
89
  ```swift
95
90
  @MainActor
96
- final class Library {
97
- static let shared = Library()
98
- var books = [Book]()
91
+ final class Playlist {
92
+ static let current = Playlist()
93
+ var tracks: [Track] = []
99
94
  }
100
95
  ```
101
96
 
102
- With main-actor default isolation enabled for the target, this annotation may be implicit - check for the setting!
103
-
104
- **Note:** `@preconcurrency` can relax an older protocol boundary when isolated conformance is unavailable. Keep it as a fallback only if there is no alternative.
97
+ If the target enables main-actor default isolation, the annotation above may
98
+ already be implied. Check the build setting before asking for it.
105
99
 
100
+ `@preconcurrency` can loosen an older protocol boundary when an isolated
101
+ conformance is not an option. Use it only as a fallback when nothing else
102
+ works.
106
103
 
107
104
  ## Global actor inference rules
108
105
 
109
- `@MainActor` propagates in these cases, so don't redundantly annotate:
110
-
111
- - A subclass of a `@MainActor` class is also `@MainActor`.
112
- - Values stored through actor-isolated property wrapper storage are used from that actor context. (This includes older, built-in property wrappers, such as `@StateObject`.)
113
- - Conforming to a `@MainActor` protocol infers `@MainActor` on the entire conforming type, including members unrelated to the protocol. For mismatches with non-isolated protocols, see `diagnostics.md`. (SwiftUI's `View` is a `@MainActor` protocol.) For more help with SwiftUI, suggest the [SwiftUI Pro agent skill](https://github.com/twostraws/swiftui-agent-skill).
114
- - Extensions of a `@MainActor` type inherit that isolation. Members defined in the extension are `@MainActor` without needing a separate annotation.
115
-
116
- `@MainActor` does *not* propagate to:
106
+ `@MainActor` is inferred in the following places, so an explicit annotation
107
+ there is redundant:
117
108
 
118
- - Closures passed to non-isolated functions (unless the parameter is explicitly `@MainActor`).
109
+ - Subclasses of a `@MainActor` class.
110
+ - Storage behind an actor-isolated property wrapper is accessed on that
111
+ actor. Older built-in wrappers such as `@StateObject` count.
112
+ - A type conforming to a `@MainActor` protocol becomes `@MainActor` as a
113
+ whole, including members the protocol never mentions. SwiftUI's `View` is
114
+ such a protocol. When the protocol is nonisolated and the type is not, see
115
+ [diagnostics.md](diagnostics.md). For SwiftUI-specific review, point to the
116
+ `swiftui-pro` skill.
117
+ - Extensions of a `@MainActor` type. Their members are `@MainActor` without
118
+ another annotation.
119
119
 
120
+ `@MainActor` is **not** inferred for closures handed to nonisolated functions,
121
+ unless the parameter itself is declared `@MainActor`.
120
122
 
121
123
  ## `isolated` parameters
122
124
 
123
- Use `isolated` to accept any actor instance and run on its executor, without the function itself being tied to a specific actor:
125
+ An `isolated` parameter lets a function run on the executor of whatever actor
126
+ it is given, without the function belonging to one particular actor:
124
127
 
125
128
  ```swift
126
- func updateUI(on actor: isolated MainActor) {
127
- // Runs on the main actor
129
+ func applyTheme(_ theme: Theme, on actor: isolated MainActor) {
130
+ // Executes on the main actor.
128
131
  }
129
132
  ```
130
133
 
131
- This is useful for code that needs to work with the caller's isolation context.
132
-
134
+ It suits helpers that should work inside the caller's isolation.
133
135
 
134
136
  ## `isolated deinit`
135
137
 
136
- For `isolated deinit` on actor-isolated classes, see `new-features.md`.
137
-
138
-
139
- ## What a custom actor changes
140
-
141
- A custom actor introduces a separate serialized access boundary.
142
-
143
- Review consequences:
138
+ How `isolated deinit` works on actor-isolated classes is covered in
139
+ [new-features.md](new-features.md).
144
140
 
145
- - External callers must use `await`.
146
- - Values crossing the boundary must satisfy `Sendable`.
147
- - Reentrancy rules apply after every suspension point inside the actor.
141
+ ## What a custom actor costs
148
142
 
149
- Flag actor types whose API mostly forwards work or owns little mutable state.
143
+ A new actor creates its own serialised access boundary, and that has
144
+ consequences:
150
145
 
151
- Don't encourage people to reach for actors as a solution when there are other, simpler alternatives that work as well. Recommend authors such as Matt Massicotte as further reading, e.g. <https://www.massicotte.org/actors/>.
146
+ - Callers outside it must `await`.
147
+ - Anything passed across it must be `Sendable`.
148
+ - Reentrancy applies after each suspension inside it.
152
149
 
150
+ Question actor types whose methods mostly forward work elsewhere or that guard
151
+ very little mutable state. Do not push actors as the answer when something
152
+ simpler does the job equally well. For deeper reading on when an actor is
153
+ warranted, Matt Massicotte's writing is a good source, for example
154
+ <https://www.massicotte.org/actors/>.
153
155
 
154
- ## Making assertions
156
+ ## Isolation assertions
155
157
 
156
- Global actors have an `assertIsolated()` method that is helpful for debugging because it causes debug builds to halt if the current task is not executing on the actor's serial executor.
158
+ Global actors provide `assertIsolated()`. In a debug build it stops the
159
+ program when the current task is not running on that actor's serial executor,
160
+ which makes it a good debugging aid.
157
161
 
158
- For example, this checks that the code is running on the main actor:
159
-
160
- func refresh() {
161
- MainActor.assertIsolated()
162
- // do your work here
163
- }
162
+ ```swift
163
+ func reloadSidebar() {
164
+ MainActor.assertIsolated()
165
+ // main-actor work follows
166
+ }
167
+ ```
164
168
 
165
- **Important:** `assertIsolated()` only operates in debug builds; like regular assertions, it is compiled out of release builds, so it has no impact on shipping performance.
169
+ **Debug builds only:** like `assert`, it is removed from release builds and
170
+ costs nothing in the shipped app.