agentleFS
repopromptrepoprompt/repoprompt-ce/.agents/skills/rpce-swift-concurrency-fix/SKILL.md

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.

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
  1. Very specific:

    Read references/diagnostic-playbook.md, classify the boundary, then load the matching detailed reference below.

    line 12
  2. Very specific:

    Read references/repository-patterns.md before changing an existing RepoPrompt task, continuation, synchronization, UI-publication, or …

    line 16
  3. Very specific:

    Before running builds or tests, read root AGENTS.md and the applicable section of …

    line 19
  4. Distinctive:

    Follow the value, closure, or mutable state through its real execution path.

    line 35
  5. Distinctive:

    keep non-Sendable state within one isolation domain.

    line 51
  6. Very specific:

    Use @concurrent only for intentional off-actor async work after verifying Swift 6.2 settings and sendability crossings.

    line 57
  7. Very specific:

    After reading the repository validation instructions, recompile the smallest supported affected product through conductor, then run focused …

    line 61
  8. Distinctive:

    Stop when the requested diagnostic family is resolved.

    line 63
  9. Very specific:

    Do not add @unchecked Sendable, nonisolated(unsafe), @preconcurrency, MainActor.assumeIsolated, Task.detached, or a new manual lock merely …

    line 67
  10. Distinctive:

    If no checked design is practical, document:

    line 69
  11. Distinctive:

    Do not rename, reorganize, or broadly reformat adjacent code.

    line 81
  12. Distinctive:

    Do not modernize unrelated async APIs.

    line 82
  13. Distinctive:

    Do not convert neighboring types to actors without a traced invariant requiring it.

    line 83
  14. Distinctive:

    Do not replace established synchronization without a demonstrated defect.

    line 84
  15. Very specific:

    Do not blanket-apply @MainActor.

    line 85
  16. Distinctive:

    Do not assume all GCD, locks, or detached work is wrong.

    line 86
  17. Distinctive:

    Do not use sleeps as deterministic concurrency verification.

    line 87

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. 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.md for actor isolation, Sendable crossings, global state, isolated conformances, reentrancy, or escape-hatch repairs;
    • references/tasks-cancellation-continuations-samples.md for task ownership, detached work, continuation races, streams, or deterministic concurrency tests;
    • references/synchronization-interop-samples.md for locks, queues, @unchecked Sendable, Objective-C/C callbacks, runtime assertions, or @preconcurrency.
  2. Read references/repository-patterns.md before changing an existing RepoPrompt task, continuation, synchronization, UI-publication, or concurrency-utility pattern.
  3. For Swift 6.2 settings or execution semantics, read ../rpce-swift-6-concurrency-migration/references/official-swift-6-2.md and its linked local samples.
  4. Inspect the owning target's actual manifest settings before interpreting a diagnostic.
  5. Before running builds or tests, read root AGENTS.md and 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:

  1. express the correct actor or global-actor isolation;
  2. keep non-Sendable state within one isolation domain;
  3. transfer immutable or genuinely Sendable snapshots;
  4. give unstructured work an explicit owner or replace it with structured concurrency;
  5. protect short synchronous mutable state using an established actor/lock/queue invariant;
  6. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.