swift-memory-management
БесплатноБез исполняемых скриптовНе проверенPrevent retain cycles via ARC, weak/unowned references, and Capture Lists in Swift. Use when managing Swift ARC, avoiding retain cycles, or configuring…
от HoangNguyen0403★ 598 звёзд на GitHubОб этом скилле
Swift Memory Management
Priority: P0 (CRITICAL)
Implementation Guidelines
ARC Fundamentals
- Default: Strong references. ARC handles retain/release automatically.
- Weak: Use weak if the reference can become nil during its lifetime (delegates, optional parent refs).
- Unowned: Use unowned if the reference is guaranteed to outlive referring object (rare; prefer
weak).
Capture Lists
- Closures:
[weak self]at beginning of the closure's capture list. Pattern:{ [weak self] in guard let self = self else { return } }. - Self in Structs: No list needed —
selfcopied by value. - Multiple Captures:
[weak self, weak delegate].
Retain Cycles
- Delegates:
weak var delegatealways. Protocol inherits from AnyObject (e.g.,protocol MyDelegate: AnyObject {}).. - Closures as Properties: Use
weakorunownedin capture list. - Two-way References: One side must
weak.
Anti-Patterns
- No strong var delegate: Use weak.
- No self in escaping closures: Use [weak self].
- No unowned unless certain: Default to weak to prevent crashes.
References
Установить swift-memory-management в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл swift-memory-management?
Prevent retain cycles via ARC, weak/unowned references, and Capture Lists in Swift. Use when managing Swift ARC, avoiding retain cycles, or configuring capture lists in closures.
Как установить скилл swift-memory-management?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл swift-memory-management запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
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…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic