Back to list
willsigmon

actor-isolation-fixer

by willsigmon

Website for sigstack.dev - Claude Code stack showcase

0🍴 0📅 Jan 23, 2026

SKILL.md


name: Actor Isolation Fixer description: Fix Swift 6 actor isolation errors in Leavn app - deinit accessing @MainActor properties, nonisolated contexts, concurrent access violations allowed-tools: Read, Edit, Grep

Actor Isolation Fixer

Instructions

Fix actor isolation errors systematically:

  1. Error: "main actor-isolated property X cannot be accessed from nonisolated"

    • In deinit: Mark property as nonisolated(unsafe) private var
    • In closure: Add @MainActor to Task or use await MainActor.run { }
    • In method: Mark method @MainActor or nonisolated
  2. Common Leavn patterns:

    // Timer in @MainActor class deinit
    nonisolated(unsafe) private var timer: Timer?
    
    deinit {
        timer?.invalidate() // Safe - Timer.invalidate() is thread-safe
    }
    
    // Task property in @MainActor class
    nonisolated(unsafe) private var task: Task<Void, Never>?
    
    deinit {
        task?.cancel() // Safe - Task.cancel() is thread-safe
    }
    
  3. Don't use nonisolated(unsafe) for:

    • UI properties (views, layers)
    • Mutable state accessed across threads
    • Non-thread-safe types
  4. Safe to use nonisolated(unsafe) for:

    • Timers (invalidate is thread-safe)
    • Tasks (cancel is thread-safe)
    • Notification observers (removeObserver is thread-safe)

Use this skill when: Actor isolation errors, deinit cannot access properties, concurrent access violations

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon