rpce-swift-6-concurrency-migration
Skill943 starsChanged 2 months agoApache-2.0View on GitHub
Plan, inventory, stage, execute, or review RepoPrompt CE's project-wide migration to Swift 6.2 concurrency checking and Swift 6 language mode. Use when auditing packages, targets, settings, diagnostics, unsafe escape hatches, migration phases, blockers, or validation evidence across the root and provider packages. Do not use for a bounded diagnostic repair unless it changes migration policy or sequencing.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- rpce-contribution-checkSkill
- rpce-issue-creatorSkill
- rpce-maintainer-guidanceSkill
- rpce-merge-pr-batchSkill
- rpce-releaseSkill
- rpce-swift-concurrency-fixSkill
- rpce-test-qualitySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 16 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Treat repository source, current compiler output, AGENTS.md, and official Swift documentation as authority.
- Very specific: line 12
Read references/repository-concurrency-profile.md first.
- Distinctive: line 32
Never assume that using a Swift 6.2 compiler means the package is in Swift 6 language mode.
- Very specific: line 36
Create or update a migration inventory using references/migration-inventory.md.
- Distinctive: line 49
Do not conclude that an existing escape hatch is wrong or safe from syntax alone.
- Distinctive: line 53
Prefer this initial order, then adjust it to the verified dependency graph and diagnostic counts:
- Very specific: line 73
Use $rpce-swift-concurrency-fix for bounded compiler-diagnostic repairs.
- Distinctive: line 75
Run focused tests for observable cancellation, lifetime, ordering, isolation, or interoperability behavior.
- Distinctive: line 76
Update the inventory and escape-hatch ledger.
- Distinctive: line 77
Stop before unrelated cleanup or architecture modernization.
- Very specific: line 79
Use $rpce-test-quality to decide whether concurrency regression coverage is durable and deterministic.
- Distinctive: line 83
Treat these as independent design decisions:
- Very specific: line 91
Do not apply default MainActor isolation package-wide merely because RepoPrompt is a macOS app.
- Very specific: line 93
Before enabling NonisolatedNonsendingByDefault, audit code that relies on a nonisolated async call leaving the caller's actor.
- Distinctive: line 101
no new unsafe escape hatch without a written invariant and audit/removal condition.
- Distinctive: line 105
Run broader validation only at phase boundaries or when the changed boundary requires it.
- Distinctive: line 110
Prefer structured concurrency and explicit task ownership.
- Distinctive: line 111
Treat every suspension point as a reentrancy boundary.
- Distinctive: line 113
Do not replace established locks, queues, or primitives without a demonstrated defect.
- Distinctive: line 114
Do not mix a target or package language-mode switch with unrelated refactoring.
- Distinctive: line 115
Keep raw compiler logs in conductor storage or local investigation artifacts.
- Distinctive: line 116
Never launch or stop the visible app without explicit user approval.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
RepoPrompt CE Swift 6.2 Concurrency Migration
Treat repository source, current compiler output, AGENTS.md, and official Swift documentation as authority. Do not infer language semantics from the toolchain version alone.
Required reading
Read references/repository-concurrency-profile.md first. Load the other references only when the workflow reaches them:
references/official-swift-6-2.mdbefore interpreting or changing language/concurrency settings;references/swiftpm-settings-samples.mdbefore editing either package manifest or designing a settings rollout;references/swift-6-2-semantics-samples.mdbefore adopting or diagnosing caller-actor execution,@concurrent, default isolation, or isolated conformances;references/migration-inventory.mdwhen creating or updating the campaign inventory;references/validation-matrix.mdbefore starting coordinated validation.
Re-read an affected section before a settings change if the information is no longer fresh in context.
Workflow
1. Establish the current state
- Confirm the active Xcode and Swift compiler versions.
- Inspect both package manifests and the actual settings of every affected target.
- Distinguish the Swift tools version, language mode, strict-concurrency checking, default actor isolation, and upcoming concurrency features.
- Capture a clean coordinated baseline before changing semantics.
- Record pre-existing warnings or failures separately from migration diagnostics.
Never assume that using a Swift 6.2 compiler means the package is in Swift 6 language mode.
2. Build the inventory
Create or update a migration inventory using references/migration-inventory.md. Group findings by package, target, diagnostic family, isolation boundary, runtime risk, and dependency relationship.
Inventory at least:
- global and static mutable state;
@unchecked Sendable,nonisolated(unsafe),@preconcurrency, andMainActor.assumeIsolated;- detached or escaping tasks and their owners;
- continuations, streams, and cancellation handlers;
- locks, queues, semaphores, and custom concurrency primitives;
- actor reentrancy-sensitive state;
- Objective-C/C and delegate/callback boundaries;
- long-lived Agent Mode, MCP, indexing, persistence, and process tasks.
Do not conclude that an existing escape hatch is wrong or safe from syntax alone. Record its intended invariant and verify the implementation.
3. Choose phases from evidence
Prefer this initial order, then adjust it to the verified dependency graph and diagnostic counts:
- Baseline and inventory.
- Harden proven invariants while retaining Swift 5 language mode.
- Stage complete concurrency checking in narrow leaf/headless targets.
- Migrate MCP and provider boundaries.
- Migrate app infrastructure and task-heavy feature/runtime code.
- Migrate main-actor UI and app composition.
- Switch targets to Swift 6 language mode independently only after the active toolchain probe proves mixed-mode behavior; otherwise use a package-wide fallback after every target meets the exit gate.
- Adopt Swift 6.2 execution semantics and default isolation deliberately.
- Profile, optimize, and run the final safety audit.
SwiftPM exposes package-level swiftLanguageModes and target-level .swiftLanguageMode(.v6). Verify target-local compiler flags and generated-workspace behavior with the active toolchain before relying on mixed modes. If the probe fails or settings are ignored, retain target-level complete checking and use the documented package-wide fallback.
4. Execute one coherent batch
For each batch:
- Select one package/target boundary and one settings step or diagnostic family.
- State the runtime invariant and explicit non-goals.
- Use
$rpce-swift-concurrency-fixfor bounded compiler-diagnostic repairs. - Rebuild the smallest supported affected product through conductor.
- Run focused tests for observable cancellation, lifetime, ordering, isolation, or interoperability behavior.
- Update the inventory and escape-hatch ledger.
- Stop before unrelated cleanup or architecture modernization.
Use $rpce-test-quality to decide whether concurrency regression coverage is durable and deterministic. Use $rpce-maintainer-guidance for broad ownership, performance, coalescing, or observability decisions.
5. Adopt Swift 6.2 semantics separately
Treat these as independent design decisions:
- Swift 6 language mode and complete data-race checking;
- caller-actor execution for nonisolated async functions;
- isolated-conformance inference;
- default
MainActorisolation; - explicit
@concurrentoffloading.
Do not apply default MainActor isolation package-wide merely because RepoPrompt is a macOS app. Shared protocols, workspace core, MCP, and provider libraries have different isolation needs.
Before enabling NonisolatedNonsendingByDefault, audit code that relies on a nonisolated async call leaving the caller's actor. Add @concurrent only when off-actor execution is intentional and its arguments and results satisfy the crossing.
6. Close a phase
Require:
- coordinated builds for every affected product;
- focused tests for changed behavioral contracts;
- no new unsafe escape hatch without a written invariant and audit/removal condition;
- reviewed public API and sendability changes;
- updated inventory, validation tickets/logs, blockers, and non-goals.
Run broader validation only at phase boundaries or when the changed boundary requires it.
Guardrails
- Fix runtime ownership and isolation causes; do not annotate solely to silence diagnostics.
- Prefer structured concurrency and explicit task ownership.
- Treat every suspension point as a reentrancy boundary.
- Require continuations to finish exactly once across success, failure, and cancellation.
- Do not replace established locks, queues, or primitives without a demonstrated defect.
- Do not mix a target or package language-mode switch with unrelated refactoring.
- Keep raw compiler logs in conductor storage or local investigation artifacts; keep only summarized evidence in the migration inventory.
- Never launch or stop the visible app without explicit user approval.
Handoff
Report current compiler and package settings, baseline command/ticket/log, diagnostic counts, completed and remaining phases, escape-hatch changes, validation evidence, blockers, risks, and explicit non-goals.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

