rpce-swift-concurrency-fix
Skill943 starsChanged 2 months agoApache-2.0View on GitHub
Diagnose and repair a bounded set of Swift concurrency compiler errors or warnings in RepoPrompt CE, including actor isolation, Sendable crossings, task captures, continuations, cancellation, global mutable state, and Objective-C interoperability. Use for a specific diagnostic, file, target, or coherent diagnostic family. Preserve behavior and avoid unrelated refactors; use the migration skill for project-wide settings, inventory, sequencing, or progress planning.
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-6-concurrency-migrationSkill
- rpce-test-qualitySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 10 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Read references/diagnostic-playbook.md, classify the boundary, then load the matching detailed reference below.
- Very specific: line 16
Read references/repository-patterns.md before changing an existing RepoPrompt task, continuation, synchronization, UI-publication, or …
- Very specific: line 19
Before running builds or tests, read root AGENTS.md and the applicable section of …
- Distinctive: line 35
Follow the value, closure, or mutable state through its real execution path.
- Distinctive: line 51
keep non-Sendable state within one isolation domain.
- Very specific: line 57
Use @concurrent only for intentional off-actor async work after verifying Swift 6.2 settings and sendability crossings.
- Very specific: line 61
After reading the repository validation instructions, recompile the smallest supported affected product through conductor, then run focused …
- Distinctive: line 63
Stop when the requested diagnostic family is resolved.
- Very specific: line 67
Do not add @unchecked Sendable, nonisolated(unsafe), @preconcurrency, MainActor.assumeIsolated, Task.detached, or a new manual lock merely …
- Distinctive: line 69
If no checked design is practical, document:
- Distinctive: line 81
Do not rename, reorganize, or broadly reformat adjacent code.
- Distinctive: line 82
Do not modernize unrelated async APIs.
- Distinctive: line 83
Do not convert neighboring types to actors without a traced invariant requiring it.
- Distinctive: line 84
Do not replace established synchronization without a demonstrated defect.
- Very specific: line 85
Do not blanket-apply @MainActor.
- Distinctive: line 86
Do not assume all GCD, locks, or detached work is wrong.
- Distinctive: line 87
Do not use sleeps as deterministic concurrency verification.
≈ “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 Concurrency Fix
Resolve the requested diagnostics with the smallest semantic change that makes the runtime ownership explicit. Do not treat an annotation-only compile as proof of safety.
Required context
- Read
references/diagnostic-playbook.md, classify the boundary, then load the matching detailed reference below. Load another only if the traced boundary spans families:references/isolation-sendability-samples.mdfor actor isolation, Sendable crossings, global state, isolated conformances, reentrancy, or escape-hatch repairs;references/tasks-cancellation-continuations-samples.mdfor task ownership, detached work, continuation races, streams, or deterministic concurrency tests;references/synchronization-interop-samples.mdfor locks, queues,@unchecked Sendable, Objective-C/C callbacks, runtime assertions, or@preconcurrency.
- Read
references/repository-patterns.mdbefore changing an existing RepoPrompt task, continuation, synchronization, UI-publication, or concurrency-utility pattern. - For Swift 6.2 settings or execution semantics, read
../rpce-swift-6-concurrency-migration/references/official-swift-6-2.mdand its linked local samples. - Inspect the owning target's actual manifest settings before interpreting a diagnostic.
- Before running builds or tests, read root
AGENTS.mdand the applicable section of../rpce-swift-6-concurrency-migration/references/validation-matrix.md.
Workflow
1. Capture the failure
Record:
- exact diagnostic text;
- package, target, file, and declaration;
- compiler and Swift language mode;
- strict checking, default isolation, and upcoming-feature settings;
- whether the issue is first-party, imported, generated, or dependency code.
2. Trace the boundary
Follow the value, closure, or mutable state through its real execution path. Identify:
- source and destination isolation domains;
- owning actor, task, lock, queue, or immutable value;
- suspension and reentrancy points;
- task lifetime and cancellation owner;
- callback/continuation completion paths;
- public API or interoperability constraints.
State the runtime invariant the compiler cannot see. If it is unknown, investigate rather than selecting an escape hatch.
3. Choose the smallest semantic fix
Prefer, in order:
- express the correct actor or global-actor isolation;
- keep non-Sendable state within one isolation domain;
- transfer immutable or genuinely
Sendablesnapshots; - give unstructured work an explicit owner or replace it with structured concurrency;
- protect short synchronous mutable state using an established actor/lock/queue invariant;
- adjust a boundary API when the existing contract is the root cause.
Use @concurrent only for intentional off-actor async work after verifying Swift 6.2 settings and sendability crossings.
4. Verify immediately
After reading the repository validation instructions, recompile the smallest supported affected product through conductor, then run focused tests for the changed contract. Use $rpce-test-quality before adding timing-sensitive concurrency tests.
Stop when the requested diagnostic family is resolved. Record causally unrelated diagnostics for the migration inventory rather than expanding the change.
Escape-hatch gate
Do not add @unchecked Sendable, nonisolated(unsafe), @preconcurrency, MainActor.assumeIsolated, Task.detached, or a new manual lock merely to silence the compiler.
If no checked design is practical, document:
- protected state and allowed operations;
- synchronization or ownership mechanism;
- why it prevents concurrent invalid access;
- cancellation, lifetime, and reentrancy behavior;
- why checked alternatives are impractical;
- focused verification;
- audit or removal condition.
Anti-refactor rules
- Do not rename, reorganize, or broadly reformat adjacent code.
- Do not modernize unrelated async APIs.
- Do not convert neighboring types to actors without a traced invariant requiring it.
- Do not replace established synchronization without a demonstrated defect.
- Do not blanket-apply
@MainActor. - Do not assume all GCD, locks, or detached work is wrong; prove whether the ownership is valid.
- Do not use sleeps as deterministic concurrency verification.
Handoff
Summarize the diagnostic, confirmed boundary, invariant, minimal fix, escape-hatch decision, focused build/test evidence, and deferred unrelated findings.
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.

