@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.
- package/CHANGELOG.md +98 -49
- package/README.md +12 -10
- package/README.tr.md +12 -10
- package/docs/adr/0006-skills-core-external-split.md +5 -5
- package/docs/adr/0010-own-code-graph.md +6 -7
- package/docs/adr/0013-lsp-code-intelligence.md +6 -8
- package/docs/adr/0017-change-impact-from-the-graph.md +4 -5
- package/docs/adr/0018-cross-repo-links-not-a-global-graph.md +1 -1
- package/docs/adr/README.md +1 -1
- package/docs/ecosystem.md +53 -41
- package/docs/facts.json +15 -13
- package/docs/features.md +1 -1
- package/install/_dev-only-files.mjs +3 -0
- package/install/_platform-filter.mjs +1 -23
- package/install/catalog-history.json +1 -1
- package/install/claude.mjs +8 -1
- package/install/codex.mjs +0 -2
- package/install/copilot.mjs +0 -2
- package/install/templates/claude-hooks.json +47 -1
- package/manifest.json +429 -311
- package/package.json +5 -2
- package/pipeline/agents/security-auditor.md +58 -6
- package/pipeline/commands/multi-agent/build-optimize/SKILL.md +1 -2
- package/pipeline/commands/multi-agent/complaint-analysis/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/design-check/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/graph/SKILL.md +12 -3
- package/pipeline/commands/multi-agent/research/SKILL.md +2 -2
- package/pipeline/commands/multi-agent/search/SKILL.md +10 -1
- package/pipeline/commands/multi-agent/security-review/SKILL.md +4 -0
- package/pipeline/commands/multi-agent/setup/SKILL.md +1 -0
- package/pipeline/commands/multi-agent/stack/SKILL.md +8 -0
- package/pipeline/commands/multi-agent/store-ready/SKILL.md +1 -1
- package/pipeline/commands/sim-test.md +34 -1
- package/pipeline/lib/context-budget.mjs +103 -0
- package/pipeline/lib/credential-inventory.sh +2 -3
- package/pipeline/lib/identifier-scan.mjs +145 -0
- package/pipeline/lib/outbound-gate.mjs +28 -1
- package/pipeline/lib/unattended-profile-check.mjs +13 -4
- package/pipeline/multi-agent-refs/analysis/locked.md +1 -1
- package/pipeline/multi-agent-refs/analysis/redesign.md +17 -3
- package/pipeline/multi-agent-refs/analysis-template-corporate.md +8 -4
- package/pipeline/multi-agent-refs/analysis-template.md +7 -5
- package/pipeline/multi-agent-refs/complaint-analysis/phases.md +1 -0
- package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +1 -1
- package/pipeline/multi-agent-refs/features/code-graph.md +25 -0
- package/pipeline/multi-agent-refs/features/design-conformance.md +20 -4
- package/pipeline/multi-agent-refs/features/free-models.md +10 -3
- package/pipeline/multi-agent-refs/features/research.md +4 -3
- package/pipeline/multi-agent-refs/features/security-audit.md +25 -3
- package/pipeline/multi-agent-refs/features/unattended-security.md +20 -0
- package/pipeline/multi-agent-refs/help/en.md +15 -9
- package/pipeline/multi-agent-refs/help/tr.md +15 -9
- package/pipeline/multi-agent-refs/knowledge.md +17 -0
- package/pipeline/multi-agent-refs/outside-the-pipeline.md +9 -0
- package/pipeline/multi-agent-refs/phases/log-format.md +5 -0
- package/pipeline/multi-agent-refs/phases/operations.md +3 -5
- package/pipeline/multi-agent-refs/picker-contract.md +1 -1
- package/pipeline/multi-agent-refs/research/engine.md +2 -1
- package/pipeline/multi-agent-refs/setup/free-models.md +10 -0
- package/pipeline/multi-agent-refs/store-ready/gate-3-policy.md +15 -0
- package/pipeline/multi-agent-refs/web-guide.md +2 -1
- package/pipeline/office/index.html +3 -7
- package/pipeline/office/toolkit.json +1 -1
- package/pipeline/rules/outside-the-pipeline.md +1 -1
- package/pipeline/schemas/learnings-ledger.schema.json +7 -2
- package/pipeline/schemas/prefs.schema.json +16 -3
- package/pipeline/schemas/reviewer-output.schema.json +113 -5
- package/pipeline/schemas/secret-patterns.json +49 -0
- package/pipeline/schemas/security-finding.schema.json +49 -5
- package/pipeline/scripts/_code-graph.mjs +3 -3
- package/pipeline/scripts/_graph-analysis.mjs +51 -0
- package/pipeline/scripts/_memory-policy.mjs +11 -3
- package/pipeline/scripts/_secret-scan.mjs +1 -1
- package/pipeline/scripts/_skill-practices.mjs +178 -0
- package/pipeline/scripts/_stack-routing.mjs +1 -0
- package/pipeline/scripts/autopilot-runner.mjs +8 -3
- package/pipeline/scripts/build-stack-plugins.mjs +8 -44
- package/pipeline/scripts/capture-resume.sh +19 -0
- package/pipeline/scripts/file-context.mjs +306 -70
- package/pipeline/scripts/gen-skills-index.mjs +1 -1
- package/pipeline/scripts/graph-hint.mjs +197 -0
- package/pipeline/scripts/graph-hint.sh +20 -0
- package/pipeline/scripts/graph-query.mjs +306 -11
- package/pipeline/scripts/graph-report.mjs +29 -1
- package/pipeline/scripts/learnings-ledger.mjs +71 -15
- package/pipeline/scripts/note-agent-event.mjs +160 -0
- package/pipeline/scripts/note-agent-event.sh +19 -0
- package/pipeline/scripts/parity-score.mjs +139 -0
- package/pipeline/scripts/pre-commit-check.sh +25 -4
- package/pipeline/scripts/pre-push-check.sh +3 -0
- package/pipeline/scripts/repo-recommend.mjs +321 -0
- package/pipeline/scripts/scan-agent-config.sh +1 -2
- package/pipeline/scripts/security-evidence-gate.mjs +282 -0
- package/pipeline/scripts/unattended_policy.py +3 -2
- package/pipeline/scripts/validate-analysis-doc.mjs +17 -1
- package/pipeline/skills/.skill-manifest.json +72 -68
- package/pipeline/skills/shared/README.md +41 -40
- package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +6 -6
- package/pipeline/skills/shared/core/apple-archive-compliance/references/examples.md +1 -1
- package/pipeline/skills/shared/core/apple-archive-compliance/references/version-history.md +1 -1
- package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +1 -1
- package/pipeline/skills/shared/core/google-play-compliance/references/notes.md +1 -1
- package/pipeline/skills/shared/core/multi-agent/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-build-optimize/SKILL.md +0 -1
- package/pipeline/skills/shared/core/multi-agent-complaint-analysis/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +5 -5
- package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +10 -0
- package/pipeline/skills/shared/core/multi-agent-research/SKILL.md +2 -2
- package/pipeline/skills/shared/core/multi-agent-search/SKILL.md +9 -0
- package/pipeline/skills/shared/core/multi-agent-security-review/SKILL.md +3 -2
- package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -0
- package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +8 -0
- package/pipeline/skills/shared/core/multi-agent-store-ready/SKILL.md +4 -3
- package/pipeline/skills/shared/core/multi-agent-test/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-accessibility/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-dark-mode/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-dynamic-type/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-gen/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-screenshots/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-testflight-validation/SKILL.md +2 -2
- package/pipeline/skills/shared/external/accessibility-compliance-accessibility-audit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/agent-introspection-debugging/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/android-architecture/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-architecture/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-build-quality-gates/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-datastore/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-design-tokens-codegen/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/android-jetpack-compose-expert/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/android-mvi-viewmodel/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-performance/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/android-security/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-security/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/api-patterns/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/api-security-best-practices/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/app-store-changelog/SKILL.md +65 -49
- package/pipeline/skills/shared/external/app-store-changelog/evals/evals.json +40 -0
- package/pipeline/skills/shared/external/app-store-changelog/references/release-notes-guidelines.md +64 -34
- package/pipeline/skills/shared/external/app-store-changelog/scripts/collect_release_changes.sh +21 -23
- package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +4 -1
- package/pipeline/skills/shared/external/app-store-review/SKILL.md +6 -0
- package/pipeline/skills/shared/external/architecture/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/backlog/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/ci-cd-pipelines/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/clean-code/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/compose-components/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-components/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/compose-navigation/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-navigation/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/compose-testing/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-testing/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/context-compression/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/core-data/SKILL.md +1 -1
- package/pipeline/skills/shared/external/council/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/css-modern/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/css-modern/references/code-examples.md +5 -0
- package/pipeline/skills/shared/external/database-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/database-patterns/references/orm-examples.md +5 -0
- package/pipeline/skills/shared/external/debugging-strategies/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/docker-expert/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/e2e-testing/SKILL.md +21 -21
- package/pipeline/skills/shared/external/e2e-testing/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/e2e-testing/references/document-fixtures.md +5 -5
- package/pipeline/skills/shared/external/evidence-github/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/evidence-registry/SKILL.md +1 -1
- package/pipeline/skills/shared/external/evidence-registry/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/fastapi-pro/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/firebase/SKILL.md +132 -54
- package/pipeline/skills/shared/external/firebase/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/firebase/references/functions-and-products.md +51 -0
- package/pipeline/skills/shared/external/firebase/references/security-rules.md +59 -0
- package/pipeline/skills/shared/external/fix-review-verdicts/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/free-llm-apis/SKILL.md +70 -0
- package/pipeline/skills/shared/external/free-llm-apis/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/free-llm-apis/references/providers.md +33 -0
- package/pipeline/skills/shared/external/github-actions-templates/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/gradle-kotlin-dsl/SKILL.md +1 -1
- package/pipeline/skills/shared/external/gradle-kotlin-dsl/evals/evals.json +58 -0
- package/pipeline/skills/shared/external/handle-request/SKILL.md +2 -2
- package/pipeline/skills/shared/external/handle-request/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/hig-app-icons/SKILL.md +2 -2
- package/pipeline/skills/shared/external/hig-app-icons/references/icon-workflow.md +1 -1
- package/pipeline/skills/shared/external/hig-components-content/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-components-status/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-components-system/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-inputs/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/hig-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/hig-platforms/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/hig-technologies/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/html-semantic/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/humanizer/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/ios-coding-standard/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/ios-debugger-agent/SKILL.md +91 -52
- package/pipeline/skills/shared/external/ios-debugger-agent/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/ios-design-review/SKILL.md +12 -12
- package/pipeline/skills/shared/external/ios-design-review/references/appearance-matrix.md +16 -16
- package/pipeline/skills/shared/external/ios-design-review/references/checklist.md +1 -1
- package/pipeline/skills/shared/external/ios-iphone-duo/SKILL.md +0 -1
- package/pipeline/skills/shared/external/ios-module-structure/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/ios-security/SKILL.md +1 -1
- package/pipeline/skills/shared/external/ios-security/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/kotlin-coroutines-expert/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/localization-reuse-map/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/macos-menubar-tuist-app/SKILL.md +170 -74
- package/pipeline/skills/shared/external/macos-menubar-tuist-app/evals/evals.json +52 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/SKILL.md +119 -77
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Package.swift +5 -5
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/MyApp.swift +24 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/version.env +2 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/build_icon.sh +46 -39
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/compile_and_run.sh +70 -49
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/launch.sh +24 -17
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/make_appcast.sh +74 -59
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/package_app.sh +201 -170
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/setup_dev_signing.sh +50 -42
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/sign-and-notarize.sh +65 -35
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/version.env +2 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/packaging.md +49 -17
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/release.md +48 -23
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/scaffold.md +74 -44
- package/pipeline/skills/shared/external/monorepo-architect/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/nextjs-app-router/SKILL.md +14 -3
- package/pipeline/skills/shared/external/nextjs-app-router/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/nextjs-app-router/references/app-router-examples.md +3 -0
- package/pipeline/skills/shared/external/nodejs-backend-patterns/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/observability-engineer/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/passkit-wallet/SKILL.md +10 -0
- package/pipeline/skills/shared/external/photos-camera-media/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/play-store-review/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/python-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/react-best-practices/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/rest-api-design/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/retrofit-networking/SKILL.md +1 -1
- package/pipeline/skills/shared/external/retrofit-networking/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/room-database/SKILL.md +1 -1
- package/pipeline/skills/shared/external/room-database/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/scenario-gap-analysis/SKILL.md +1 -1
- package/pipeline/skills/shared/external/scenario-gap-analysis/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/search-first/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/security-review/SKILL.md +14 -3
- package/pipeline/skills/shared/external/security-review/evals/evals.json +48 -0
- package/pipeline/skills/shared/external/security-review/references/agentic-systems.md +93 -0
- package/pipeline/skills/shared/external/security-review/references/firebase-rules.md +100 -0
- package/pipeline/skills/shared/external/security-review/references/graphql.md +82 -0
- package/pipeline/skills/shared/external/security-review/references/llm-prompt-injection.md +93 -0
- package/pipeline/skills/shared/external/security-review/references/oauth-oidc.md +100 -0
- package/pipeline/skills/shared/external/security-review/references/owasp-mobile-top10-2024.md +1 -1
- package/pipeline/skills/shared/external/security-review/references/owasp-web-api-top10-2021.md +1 -1
- package/pipeline/skills/shared/external/security-review/references/supabase.md +73 -0
- package/pipeline/skills/shared/external/signal-community/SKILL.md +29 -10
- package/pipeline/skills/shared/external/signal-community/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/skill-creator/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/skill-creator/template.md +1 -3
- package/pipeline/skills/shared/external/spm-build-analysis/SKILL.md +80 -61
- package/pipeline/skills/shared/external/spm-build-analysis/evals/evals.json +56 -0
- package/pipeline/skills/shared/external/spm-build-analysis/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/spm-build-analysis/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/spm-build-analysis/references/spm-analysis-checks.md +89 -87
- package/pipeline/skills/shared/external/spm-build-analysis/scripts/check_spm_pins.py +90 -85
- package/pipeline/skills/shared/external/swift-concurrency-expert/SKILL.md +78 -69
- package/pipeline/skills/shared/external/swift-concurrency-expert/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/approachable-concurrency.md +52 -48
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/swift-6-2-concurrency.md +118 -184
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/swiftui-concurrency-tour-wwdc.md +68 -22
- package/pipeline/skills/shared/external/swift-concurrency-pro/SKILL.md +117 -94
- package/pipeline/skills/shared/external/swift-concurrency-pro/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/actors.md +102 -97
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/async-streams.md +36 -37
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/bridging.md +82 -34
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/bug-patterns.md +90 -52
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/cancellation.md +55 -55
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/diagnostics.md +66 -43
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/hotspots.md +39 -23
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/interop.md +66 -68
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/new-features.md +152 -131
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/structured.md +60 -57
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/testing.md +131 -118
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/unstructured.md +37 -29
- package/pipeline/skills/shared/external/swift-formatstyle/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swift-testing-pro/SKILL.md +77 -58
- package/pipeline/skills/shared/external/swift-testing-pro/evals/evals.json +59 -0
- package/pipeline/skills/shared/external/swift-testing-pro/references/async-tests.md +139 -144
- package/pipeline/skills/shared/external/swift-testing-pro/references/core-rules.md +90 -28
- package/pipeline/skills/shared/external/swift-testing-pro/references/migrating-from-xctest.md +38 -21
- package/pipeline/skills/shared/external/swift-testing-pro/references/new-features.md +139 -156
- package/pipeline/skills/shared/external/swift-testing-pro/references/writing-better-tests.md +173 -147
- package/pipeline/skills/shared/external/swiftdata-pro/SKILL.md +75 -59
- package/pipeline/skills/shared/external/swiftdata-pro/evals/evals.json +50 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/cloudkit.md +34 -7
- package/pipeline/skills/shared/external/swiftdata-pro/references/indexing.md +20 -14
- package/pipeline/skills/shared/external/swiftdata-pro/references/inheritance.md +127 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/model-rules.md +141 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/predicates.md +37 -44
- package/pipeline/skills/shared/external/swiftlint/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-expert-skill/SKILL.md +89 -88
- package/pipeline/skills/shared/external/swiftui-expert-skill/evals/evals.json +55 -0
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/accessibility-patterns.md +104 -122
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-advanced.md +73 -93
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-basics.md +144 -169
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-transitions.md +122 -133
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts-accessibility.md +141 -99
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts.md +273 -333
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/image-optimization.md +105 -128
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/latest-apis.md +199 -312
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/layout-best-practices.md +129 -169
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/liquid-glass.md +17 -30
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/list-patterns.md +198 -258
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-scenes.md +145 -218
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-views.md +150 -249
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-window-styling.md +109 -208
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/performance-patterns.md +225 -271
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/scroll-patterns.md +117 -210
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/sheet-navigation-patterns.md +171 -237
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/state-management.md +196 -260
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/view-structure.md +167 -230
- package/pipeline/skills/shared/external/swiftui-gestures/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-layout-components/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-navigation/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-navigation/references/navigationstack.md +1 -2
- package/pipeline/skills/shared/external/swiftui-patterns/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/SKILL.md +71 -79
- package/pipeline/skills/shared/external/swiftui-performance-audit/evals/evals.json +55 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/audit-layout.md +50 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/capture-checklist.md +51 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/hangs.md +34 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/instruments-guide.md +68 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/smell-catalog.md +191 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/update-model.md +69 -0
- package/pipeline/skills/shared/external/swiftui-pro/SKILL.md +65 -63
- package/pipeline/skills/shared/external/swiftui-pro/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/swiftui-pro/references/accessibility.md +40 -13
- package/pipeline/skills/shared/external/swiftui-pro/references/api.md +74 -29
- package/pipeline/skills/shared/external/swiftui-pro/references/data.md +44 -24
- package/pipeline/skills/shared/external/swiftui-pro/references/design.md +45 -31
- package/pipeline/skills/shared/external/swiftui-pro/references/hygiene.md +17 -8
- package/pipeline/skills/shared/external/swiftui-pro/references/navigation.md +19 -9
- package/pipeline/skills/shared/external/swiftui-pro/references/performance.md +50 -34
- package/pipeline/skills/shared/external/swiftui-pro/references/swift.md +73 -45
- package/pipeline/skills/shared/external/swiftui-pro/references/views.md +48 -23
- package/pipeline/skills/shared/external/swiftui-ui-patterns/SKILL.md +89 -83
- package/pipeline/skills/shared/external/swiftui-ui-patterns/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/app-wiring.md +119 -114
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/async-state.md +76 -61
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/components-index.md +63 -46
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/controls.md +32 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/deeplinks.md +49 -38
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/focus.md +77 -49
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/form.md +61 -44
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/grids.md +40 -42
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/input-toolbar.md +44 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/lightweight-clients.md +90 -64
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/list.md +48 -49
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/loading-placeholders.md +36 -25
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/macos-settings.md +30 -30
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/matched-transitions.md +49 -32
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/media.md +49 -41
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/menu-bar.md +52 -48
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/navigationstack.md +119 -104
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/overlay.md +30 -27
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/performance.md +33 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/previews.md +27 -27
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scroll-reveal.md +79 -86
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scrollview.md +47 -40
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/searchable.md +55 -40
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/sheets.md +113 -84
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/split-views.md +37 -34
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/tabview.md +75 -75
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/theming.md +37 -32
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/title-menus.md +41 -51
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/top-bar.md +46 -30
- package/pipeline/skills/shared/external/swiftui-uikit-interop/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-view-refactor/SKILL.md +152 -121
- package/pipeline/skills/shared/external/swiftui-view-refactor/evals/evals.json +56 -0
- package/pipeline/skills/shared/external/swiftui-view-refactor/references/mv-patterns.md +107 -98
- package/pipeline/skills/shared/external/swiftui-webkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/tailwind-css/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/test-result-triage/SKILL.md +2 -2
- package/pipeline/skills/shared/external/test-result-triage/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/testing-backend/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/tipkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/typescript-patterns/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/valven-rules/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/vision-framework/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/vue-composition/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/weatherkit/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/web-accessibility/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/web-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/web-testing/SKILL.md +2 -2
- package/pipeline/skills/shared/external/web-testing/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/web-testing/references/testing-examples.md +2 -2
- package/pipeline/skills/shared/external/widgetkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/xcode-build-benchmark/SKILL.md +61 -55
- package/pipeline/skills/shared/external/xcode-build-benchmark/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmark-artifacts.md +69 -67
- package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmarking-workflow.md +39 -47
- package/pipeline/skills/shared/external/xcode-build-benchmark/schemas/build-benchmark.schema.json +72 -154
- package/pipeline/skills/shared/external/xcode-build-benchmark/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-fixer/SKILL.md +145 -139
- package/pipeline/skills/shared/external/xcode-build-fixer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-build-fixer/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-build-fixer/references/fix-patterns.md +188 -143
- package/pipeline/skills/shared/external/xcode-build-fixer/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-build-fixer/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-orchestrator/SKILL.md +107 -98
- package/pipeline/skills/shared/external/xcode-build-orchestrator/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/benchmark-artifacts.md +69 -67
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/orchestration-report-template.md +81 -69
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/diagnose_compilation.py +155 -210
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/generate_optimization_report.py +355 -480
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/SKILL.md +70 -69
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/code-compilation-checks.md +85 -73
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/scripts/diagnose_compilation.py +155 -210
- package/pipeline/skills/shared/external/xcode-project-analyzer/SKILL.md +54 -52
- package/pipeline/skills/shared/external/xcode-project-analyzer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/project-audit-checks.md +115 -83
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/recommendation-format.md +41 -40
- package/pipeline/scripts/_notices.mjs +0 -171
- package/pipeline/skills/shared/external/NOTICE-avdlee-swiftui-agent-skill.md +0 -48
- package/pipeline/skills/shared/external/NOTICE-dimillian-skills.md +0 -63
- package/pipeline/skills/shared/external/NOTICE-paul-hudson-skills.md +0 -54
- package/pipeline/skills/shared/external/NOTICE-vibeship-spawner-skills.md +0 -203
- package/pipeline/skills/shared/external/NOTICE-xcode-build-skills.md +0 -60
- package/pipeline/skills/shared/external/ios-iphone-duo/NOTICE.md +0 -53
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/main.swift +0 -11
- package/pipeline/skills/shared/external/swiftdata-pro/references/class-inheritance.md +0 -104
- package/pipeline/skills/shared/external/swiftdata-pro/references/core-rules.md +0 -20
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/code-smells.md +0 -158
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +0 -46
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +0 -29
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/profiling-intake.md +0 -44
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/report-template.md +0 -47
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +0 -33
- 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: "
|
|
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:
|
|
7
|
-
author: Paul Hudson
|
|
8
|
-
version: "1.0"
|
|
5
|
+
source: multi-agent-pipeline
|
|
9
6
|
---
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
3.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
|
61
|
-
var
|
|
85
|
+
actor ThumbnailStore {
|
|
86
|
+
private var thumbnails: [Int: Thumbnail] = [:]
|
|
62
87
|
|
|
63
|
-
func
|
|
64
|
-
if
|
|
65
|
-
|
|
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
|
|
92
|
+
return thumbnails[photoID]!
|
|
68
93
|
}
|
|
69
94
|
}
|
|
70
95
|
|
|
71
96
|
// After
|
|
72
|
-
actor
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
func
|
|
76
|
-
if let
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
return
|
|
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
|
|
109
|
+
**Line 41: Replace the per-item `Task` loop with a task group.**
|
|
85
110
|
|
|
86
111
|
```swift
|
|
87
112
|
// Before
|
|
88
|
-
for
|
|
89
|
-
Task { try await
|
|
113
|
+
for photoID in selection {
|
|
114
|
+
Task { try await upload(photoID) }
|
|
90
115
|
}
|
|
91
116
|
|
|
92
117
|
// After
|
|
93
|
-
try await withThrowingTaskGroup(of:
|
|
94
|
-
for
|
|
95
|
-
group.addTask { try await
|
|
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
|
-
|
|
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):**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
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
|
|
10
|
-
- [
|
|
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
|
-
**
|
|
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
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
actor
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
func
|
|
25
|
-
if
|
|
26
|
-
|
|
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
|
|
31
|
+
return avatars[user]!
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
```
|
|
32
35
|
|
|
33
|
-
Fix:
|
|
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
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
func
|
|
40
|
-
if let
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
return
|
|
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
|
-
|
|
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
|
|
52
|
-
var
|
|
53
|
-
var
|
|
56
|
+
actor AvatarCache {
|
|
57
|
+
private var avatars: [UserID: Avatar] = [:]
|
|
58
|
+
private var pending: [UserID: Task<Avatar, Error>] = [:]
|
|
54
59
|
|
|
55
|
-
func
|
|
56
|
-
if let
|
|
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
|
-
|
|
59
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
77
|
+
Every mutable global or static needs a stated isolation strategy, one the
|
|
78
|
+
compiler can check:
|
|
85
79
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- `@unchecked Sendable` when
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
|
97
|
-
static let
|
|
98
|
-
var
|
|
91
|
+
final class Playlist {
|
|
92
|
+
static let current = Playlist()
|
|
93
|
+
var tracks: [Track] = []
|
|
99
94
|
}
|
|
100
95
|
```
|
|
101
96
|
|
|
102
|
-
|
|
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`
|
|
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
|
-
-
|
|
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
|
-
|
|
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
|
|
127
|
-
//
|
|
129
|
+
func applyTheme(_ theme: Theme, on actor: isolated MainActor) {
|
|
130
|
+
// Executes on the main actor.
|
|
128
131
|
}
|
|
129
132
|
```
|
|
130
133
|
|
|
131
|
-
|
|
132
|
-
|
|
134
|
+
It suits helpers that should work inside the caller's isolation.
|
|
133
135
|
|
|
134
136
|
## `isolated deinit`
|
|
135
137
|
|
|
136
|
-
|
|
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
|
-
|
|
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
|
-
|
|
143
|
+
A new actor creates its own serialised access boundary, and that has
|
|
144
|
+
consequences:
|
|
150
145
|
|
|
151
|
-
|
|
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
|
-
##
|
|
156
|
+
## Isolation assertions
|
|
155
157
|
|
|
156
|
-
Global actors
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
```swift
|
|
163
|
+
func reloadSidebar() {
|
|
164
|
+
MainActor.assertIsolated()
|
|
165
|
+
// main-actor work follows
|
|
166
|
+
}
|
|
167
|
+
```
|
|
164
168
|
|
|
165
|
-
**
|
|
169
|
+
**Debug builds only:** like `assert`, it is removed from release builds and
|
|
170
|
+
costs nothing in the shipped app.
|