К основному содержанию
скилл CX Codex GP ChatGPT официальный · OpenAI

swiftui-performance-audit — скилл для Codex: аудит и установка

Находит причины просадок кадров, долгого рендеринга и утечек памяти в SwiftUI. Помогает разобрать код вьюшек или подготовить замеры для профилирования.

Установить в Codex · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add openai/plugins --skill swiftui-performance-audit -a codex
Открыть на GitHub

Что делает swiftui-performance-audit

Скилл начинает проверку с исходного кода вьюшек и моделей данных. Он ищет частые проблемы: лишние перерисовки из-за широких подписок на @State или @Binding, нестабильные идентификаторы в ForEach, тяжелые вычисления внутри body и перегрузку главного потока декодированием картинок. Также проверяется влияние GeometryReader на сброс разметки.

Если статического анализа недостаточно, ассистент запрашивает трассировки из Instruments, данные SwiftUI timeline или Time Profiler. По итогам формируется отчёт с таблицей метрик, списком проблем по силе влияния и конкретными рекомендациями по исправлению.

Ставить этот скилл стоит при регулярных фризах интерфейса в iOS-проектах. Без предоставления кода проблемной вью или логов профилирования пользы от него мало.

Какие задачи решает

  • локализовать причины фризов при скролле списков
  • выявить тяжелые вычисления внутри body
  • устранить лишние перерисовки из-за @Binding и внешних моделей
  • подготовить сценарий профилирования для Time Profiler и SwiftUI timeline

Примеры запросов агенту

  • Проверь этот View на причины медленного скролла в Release-сборке
  • Почему этот ForEach вызывает постоянные перерисовки всего экрана?
  • Помоги настроить сбор метрик в Instruments для поиска утечек памяти

Как установить swiftui-performance-audit

1Через Skills CLI (Vercel)

npx skills add openai/plugins --skill swiftui-performance-audit -a codex

2Вручную: положить файлы

.agents/skills/swiftui-performance-audit/SKILL.md

Для всех проектов — ~/.agents/skills/

Из того же набора201

Весь набор →
supabase официальный supabase Скилл помогает настраивать базу данных, аутентификацию и RLS в Supabase без скрытых дыр в безопасности. CX Codex GP ChatGPT 8установок remotion-render официальный Remotion Экспортирует видео и отдельные кадры из проектов Remotion через консольные команды. CX Codex GP ChatGPT 3установок figma-create-new-file официальный Figma Создаёт пустые файлы Figma, FigJam или Slides в черновиках нужной команды. Скилл готовит параметры и planKey перед запуском MCP-инструментов. CX Codex GP ChatGPT 6установок swiftui-liquid-glass официальный OpenAI Скилл помогает создавать и проверять интерфейсы SwiftUI с Liquid Glass для iOS 26+. Он нужен при внедрении эффекта, ревью и проверке fallback-сценариев. CX Codex GP ChatGPT 121установок swiftui-ui-patterns официальный OpenAI Скилл помогает собирать и рефакторить SwiftUI-интерфейсы: навигацию, состояние, компоновку и контролы. Подойдёт для новых экранов и правок существующего проекта. CX Codex GP ChatGPT 114установок swiftui-view-refactor официальный OpenAI Скилл наводит порядок в коде SwiftUI: делит разросшиеся экраны на отдельные структуры View и выносит побочные эффекты из body. CX Codex GP ChatGPT 113установок ios-memgraph-leaks официальный OpenAI Скилл захватывает и разбирает утечки памяти iOS из симулятора или .memgraph. Нужен для поиска удерживающих связей и проверки исправлений. CX Codex GP ChatGPT 1 054установок status официальный Vercel Labs Проверяет состояние проекта Vercel, последние деплои, домены и настройки наблюдаемости прямо через диалог с моделью. CX Codex GP ChatGPT 348установок

Похожие

dart-setup-ffi-assets flutter Скилл помогает агентам автоматизировать компиляцию и упаковку кода на C/C++ в динамические или статические библиотеки через систему Native Assets в Dart. Нужен, если вы интегрируете нативный код в Flutter или Dart-пакеты. Claude Code CX Codex Cursor +1 13 800установок expo-design-system expo Помогает выстроить дизайн-систему в приложении на Expo: организовать токены, вынести общие компоненты и убрать расхождения в стилях. Claude Code CX Codex Cursor +1 16 500установок imagegen-frontend-mobile nexu-io Генерирует premium mobile-экраны и флоу для iOS, Android и кросс-платформы с чистой иерархией, читаемым текстом и контролируемой палитрой. Claude Code CX Codex Cursor +1 1 700установок expo-overview expo Скилл определяет задачу в Expo или EAS и направляет агента к нужному скиллу. Пригодится перед разработкой, обновлением SDK и публикацией приложения. Claude Code CX Codex Cursor +1 15 000установок ce-test-xcode EveryInc Собирает и запускает iOS-приложение в симуляторе через XcodeBuildMCP, сохраняя логи и скриншоты проверок перед передачей кода. Claude Code CX Codex Cursor +1 2 900установок react-native vercel-labs Скилл помогает собирать нативные React Native-интерфейсы из JSON-спецификаций. Пригодится для мобильных UI с состоянием, условиями видимости и действиями. Claude Code CX Codex Cursor +1 3 200установок vercel-react-native-skills vercel Набор правил по React Native и Expo для ИИ-агента: списки, анимации, навигация. Пригодится, когда агент правит мобильный код и надо, чтобы он делал это одинаково. Claude Code CX Codex Cursor +1 253 900установок animate-expo emilkowalski Создаёт мобильные анимации для React Native и Expo на базе Reanimated и Gesture Handler. Помогает избежать просадок кадров на реальных устройствах. Claude Code CX Codex Cursor +1 135 900установок

Вопросы о swiftui-performance-audit

Как установить swiftui-performance-audit в Codex?

Выполните команду npx skills add openai/plugins --skill swiftui-performance-audit в терминале проекта. Файл скилла запишется в каталог .agents/skills.

Что проверяет swiftui-performance-audit в коде?

Скилл анализирует работу ForEach, привязки @State и @Binding, размер дерева представлений и вычисления в body. Также он выявляет декодирование тяжелых картинок на главном потоке.

Что делать, если анализа кода недостаточно для поиска бага?

Ассистент запросит замеры из Instruments, график SwiftUI timeline или дерево вызовов Time Profiler. Диагностика продолжится уже на базе реальных метрик исполнения.

Исходный текст

SKILL.md · MIT
---
name: swiftui-performance-audit
description: Audit SwiftUI runtime performance from code first. Use when diagnosing slow rendering, janky scrolling, expensive updates, or profiling needs.
---

# SwiftUI Performance Audit

## Quick start

Use this skill to diagnose SwiftUI performance issues from code first, then request profiling evidence when code review alone cannot explain the symptoms.

## Workflow

1. Classify the symptom: slow rendering, janky scrolling, high CPU, memory growth, hangs, or excessive view updates.
2. If code is available, start with a code-first review using `references/code-smells.md`.
3. If code is not available, ask for the smallest useful slice: target view, data flow, reproduction steps, and deployment target.
4. If code review is inconclusive or runtime evidence is required, guide the user through profiling with `references/profiling-intake.md`.
5. Summarize likely causes, evidence, remediation, and validation steps using `references/report-template.md`.

## 1. Intake

Collect:
- Target view or feature code.
- Symptoms and exact reproduction steps.
- Data flow: `@State`, `@Binding`, environment dependencies, and observable models.
- Whether the issue shows up on device or simulator, and whether it was observed in Debug or Release.

Ask the user to classify the issue if possible:
- CPU spike or battery drain
- Janky scrolling or dropped frames
- High memory or image pressure
- Hangs or unresponsive interactions
- Excessive or unexpectedly broad view updates

For the full profiling intake checklist, read `references/profiling-intake.md`.

## 2. Code-First Review

Focus on:
- Invalidation storms from broad observation or environment reads.
- Unstable identity in lists and `ForEach`.
- Heavy derived work in `body` or view builders.
- Layout thrash from complex hierarchies, `GeometryReader`, or preference chains.
- Large image decode or resize work on the main thread.
- Animation or transition work applied too broadly.

Use `references/code-smells.md` for the detailed smell catalog and fix guidance.

Provide:
- Likely root causes with code references.
- Suggested fixes and refactors.
- If needed, a minimal repro or instrumentation suggestion.

## 3. Guide the User to Profile

If code review does not explain the issue, ask for runtime evidence:
- A trace export or screenshots of the SwiftUI timeline and Time Profiler call tree.
- Device/OS/build configuration.
- The exact interaction being profiled.
- Before/after metrics if the user is comparing a change.

Use `references/profiling-intake.md` for the exact checklist and collection steps.

## 4. Analyze and Diagnose

- Map the evidence to the most likely category: invalidation, identity churn, layout thrash, main-thread work, image cost, or animation cost.
- Prioritize problems by impact, not by how easy they are to explain.
- Distinguish code-level suspicion from trace-backed evidence.
- Call out when profiling is still insufficient and what additional evidence would reduce uncertainty.

## 5. Remediate

Apply targeted fixes:
- Narrow state scope and reduce broad observation fan-out.
- Stabilize identities for `ForEach` and lists.
- Move heavy work out of `body` into derived state updated from inputs, model-layer precomputation, memoized helpers, or background preprocessing. Use `@State` only for view-owned state, not as an ad hoc cache for arbitrary computation.
- Use `equatable()` only when equality is cheaper than recomputing the subtree and the inputs are truly value-semantic.
- Downsample images before rendering.
- Reduce layout complexity or use fixed sizing where possible.

Use `references/code-smells.md` for examples, Observation-specific fan-out guidance, and remediation patterns.

## 6. Verify

Ask the user to re-run the same capture and compare with baseline metrics.
Summarize the delta (CPU, frame drops, memory peak) if provided.

## Outputs

Provide:
- A short metrics table (before/after if available).
- Top issues (ordered by impact).
- Proposed fixes with estimated effort.

Use `references/report-template.md` when formatting the final audit.

## References

- Profiling intake and collection checklist: `references/profiling-intake.md`
- Common code smells and remediation patterns: `references/code-smells.md`
- Audit output template: `references/report-template.md`
- Add Apple documentation and WWDC resources under `references/` as they are supplied by the user.
- Optimizing SwiftUI performance with Instruments: `references/optimizing-swiftui-performance-instruments.md`
- Understanding and improving SwiftUI performance: `references/understanding-improving-swiftui-performance.md`
- Understanding hangs in your app: `references/understanding-hangs-in-your-app.md`
- Demystify SwiftUI performance (WWDC23): `references/demystify-swiftui-performance-wwdc23.md`
- In addition to the references above, use web search to consult current Apple Developer documentation when Instruments workflows or SwiftUI performance guidance may have changed.

© OpenAI · MIT · openai/plugins

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой