Actor Isolation Fixer

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

181 stars

Best use case

Actor Isolation Fixer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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

Teams using Actor Isolation Fixer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/actor-isolation-fixer/SKILL.md --create-dirs "https://raw.githubusercontent.com/majiayu000/claude-skill-registry/main/skills/data/actor-isolation-fixer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/actor-isolation-fixer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Actor Isolation Fixer Compares

Feature / AgentActor Isolation FixerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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

Related Skills

advanced-math-trading/portfolio-factors

181
from majiayu000/claude-skill-registry

Factor modeling and portfolio construction (Markowitz, Black-Litterman, constraints, turnover).

adapter-factory

181
from majiayu000/claude-skill-registry

Guide for creating new CLI or HTTP adapters to integrate AI models into the AI Counsel deliberation system

actor-critic-methods

181
from majiayu000/claude-skill-registry

Master A2C, A3C, SAC, TD3 - actor-critic methods for continuous control

acc-create-psr17-http-factory

181
from majiayu000/claude-skill-registry

Generates PSR-17 HTTP Factories implementation for PHP 8.5. Creates RequestFactoryInterface, ResponseFactoryInterface, StreamFactoryInterface, UriFactoryInterface, ServerRequestFactoryInterface, UploadedFileFactoryInterface. Includes unit tests.

acc-create-factory

181
from majiayu000/claude-skill-registry

Generates DDD Factory for PHP 8.5. Creates factories for complex domain object instantiation with validation and encapsulated creation logic. Includes unit tests.

Refactor-Monolith

181
from majiayu000/claude-skill-registry

Skill para decomposição segura de arquivos monolíticos. Análise estrutural profunda, mapeamento exaustivo de dependências, extração incremental com zero quebra de lógica. Exige entendimento completo do negócio antes de qualquer ação.

52-execute-refactor-150

181
from majiayu000/claude-skill-registry

[52] EXECUTE. Three-stage refactoring workflow: (1) iterative research of refactor/modularization options, (2) plan + risk/edge-case analysis + Scope150 validation, then implement with tests after user confirmation, and (3) apply Scout105 cleanup protocol. Use when asked to refactor, modularize, or restructure code safely.

theme-factory

181
from majiayu000/claude-skill-registry

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

competitive-ads-extractor

181
from majiayu000/claude-skill-registry

Extracts and analyzes competitors' ads from ad libraries (Facebook, LinkedIn, etc.) to understand what messaging, problems, and creative approaches are working. Helps inspire and improve your own ad campaigns.

12-factor-apps

181
from majiayu000/claude-skill-registry

Perform 12-Factor App compliance analysis on any codebase. Use when evaluating application architecture, auditing SaaS applications, or reviewing cloud-native applications against the original 12-Factor methodology.

twelve-factor-app

181
from majiayu000/claude-skill-registry

The Twelve-Factor App methodology for building scalable, maintainable cloud-native applications. Use when designing backend services, APIs, microservices, or any software-as-a-service application. Triggers on deployment patterns, configuration management, process architecture, logging, and infrastructure decisions.

astro

159
from majiayu000/claude-skill-registry

This skill provides essential Astro framework patterns, focusing on server-side rendering (SSR), static site generation (SSG), middleware, and TypeScript best practices. It helps AI agents implement secure authentication, manage API routes, and debug rendering behaviors within Astro projects.

Coding & Development