swift-diagnostics — скилл для Claude Code: диагностика Swift
Скилл swift-diagnostics помогает разбирать сбои навигации, сборки и памяти в проектах iOS и macOS. Он ведёт по диагностическим шагам до проверки исправления.
MIT ★ 233 обновлён 2026-01-18
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineeringЧто делает swift-diagnostics
Сначала агент определяет тип симптома: навигация, сборка, память или производительность. Затем обращается к подходящему справочнику с деревом диагностики, выполняет первичные проверки и предлагает менять по одной вещи за раз. Для навигации, проблем сборки и памяти в комплекте есть отдельные справочные файлы; также есть материалы по производительности сборки и отладке в Xcode.
Скилл охватывает проблемы NavigationStack, разрешение зависимостей SPM, ошибки No such module, утечки памяти и случаи, когда не вызывается deinit. При поиске утечек он советует подтвердить их в Instruments, а не сразу менять архитектуру. Одновременная очистка Derived Data и перезапуск симулятора затруднят поиск причины, поэтому проверки лучше выполнять по очереди.
Какие задачи решает
- найти причину неожиданных переходов и сбоев
NavigationStack - разобраться с ошибками разрешения SPM и
No such module - проверить утечку памяти, retain cycle или отсутствие вызова
deinit - отделить проблемы производительности сборки от ошибок кода
Примеры запросов агенту
- Разбери, почему
NavigationStackнеожиданно возвращается назад, и проверь состояние пути. - Найди причину ошибки
No such moduleпри сборке и проведи проверки по порядку. - Проверь, почему у объекта не вызывается
deinit, и подскажи, как подтвердить утечку в Instruments.
Как установить swift-diagnostics
1Через маркетплейс плагинов
/plugin marketplace add johnrogers/claude-swift-engineering/plugin install swift-engineering@claude-swift-engineeringКоманда ставит плагин swift-engineering целиком, со всеми его скиллами
2Через Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swift-diagnostics -a claude-code3Вручную: положить файлы
~/.claude/skills/swift-diagnostics/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/swift-diagnostics/
1Через Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swift-diagnostics -a codex2Вручную: положить файлы
.agents/skills/swift-diagnostics/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swift-diagnostics -a cursor2Вручную: положить файлы
.cursor/skills/swift-diagnostics/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install johnrogers/claude-swift-engineering plugins/swift-engineering/skills/swift-diagnostics2Вручную: положить файлы
.github/skills/swift-diagnostics/SKILL.md1Через Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swift-diagnostics -a gemini-cli2Командой платформы
gemini skills install https://github.com/johnrogers/claude-swift-engineering --path plugins/swift-engineering/skills/swift-diagnosticsВручную: положить файлы
.devin/skills/swift-diagnostics/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о swift-diagnostics
Как установить swift-diagnostics в Claude Code?
Выполните команды по порядку: /plugin marketplace add johnrogers/claude-swift-engineering, затем /plugin install swift-engineering@claude-swift-engineering.
Что делает swift-diagnostics?
Скилл направляет диагностику проблем навигации, сборки, памяти и производительности в iOS/macOS-проектах. Он использует тематические справочники и предлагает проверять исправления по одному.
Как swift-diagnostics помогает искать утечки памяти?
Он разбирает retain cycle, рост памяти и отсутствие вызова deinit. Для подтверждения утечки скилл рекомендует использовать Instruments.
Исходный текст
SKILL.md · MIT
--- name: swift-diagnostics description: Use when debugging NavigationStack issues (not responding, unexpected pops, crashes), build failures (SPM resolution, "No such module", hanging builds), or memory problems (retain cycles, leaks, deinit not called). Systematic diagnostic workflows for iOS/macOS. --- # Swift Diagnostics Systematic debugging workflows for iOS/macOS development. These patterns help identify root causes in minutes rather than hours by following structured diagnostic approaches. ## Reference Loading Guide **ALWAYS load reference files if there is even a small chance the content may be required.** It's better to have the context than to miss a pattern or make a mistake. | Reference | Load When | |-----------|-----------| | **[Navigation](references/navigation.md)** | NavigationStack not responding, unexpected pops, deep link failures | | **[Build Issues](references/build-issues.md)** | SPM resolution, "No such module", dependency conflicts | | **[Memory](references/memory.md)** | Retain cycles, memory growth, deinit not called | | **[Build Performance](references/build-performance.md)** | Slow builds, Derived Data issues, Xcode hangs | | **[Xcode Debugging](references/xcode-debugging.md)** | LLDB commands, breakpoints, view debugging | ## Core Workflow 1. **Identify symptom category** - Navigation, build, memory, or performance 2. **Load the relevant reference** - Each has diagnostic decision trees 3. **Run mandatory first checks** - Before changing any code 4. **Follow the decision tree** - Reach diagnosis in 2-5 minutes 5. **Apply fix and verify** - One fix at a time, test each ## Key Principle 80% of "mysterious" issues stem from predictable patterns: - Navigation: Path state management or destination placement - Build: Stale caches or dependency resolution - Memory: Timer/observer leaks or closure captures - Performance: Environment problems, not code bugs Diagnose systematically. Never guess. ## Common Mistakes 1. **Skipping mandatory first checks** — Jumping straight to code changes before running diagnostics (clean build, restart simulator, restart Xcode) means you'll chase ghosts. Always start with the mandatory checks. 2. **Changing multiple things at once** — "Let me delete DerivedData AND restart simulator AND kill Xcode" means you can't isolate which fix actually worked. Change one variable at a time. 3. **Assuming you know the cause** — "NavigationStack stopped working, must be my reducer" — actually it was stale DerivedData. Diagnostic trees prevent assumptions. Follow the tree, don't guess. 4. **Missing memory basics** — Calling `deinit` not being called is a retain cycle, but beginners often blame architecture. Use Instruments to verify leaks before refactoring. Data, not intuition. 5. **Not isolating the problem** — Testing with your whole app complicates diagnosis. Create a minimal reproducible example with just the problematic feature. Isolation reveals root causes.
© John Rogers (@johnrogers) · MIT · johnrogers/claude-swift-engineering