Skip to content
Back to skills

Actor Isolation Fixer

ASecurity

Fix Swift 6 actor isolation errors in Leavn app - deinit accessing @MainActor properties, nonisolated contexts, concurrent access violations

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentsswift

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add majiayu000/claude-skill-registry --skill actor-isolation-fixer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Actor Isolation Fixer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Actor Isolation Fixer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-actor-isolation-fixer-claude-skill-registry/badge)](https://www.skillsdirectory.com/skills/majiayu000-actor-isolation-fixer-claude-skill-registry)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
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**:
   ```swift
   // 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.