← all repositories
AvdLee/SwiftUI-Agent-Skill

A SwiftUI style guide your AI agent can actually read

Curated best practices packaged as an Agent Skill so Claude, Cursor, or Codex stops hallucinating SwiftUI state management.

3k stars Python Coding AssistantsOther AI
SwiftUI-Agent-Skill
Velocity · 7d
+22
★ / day
Trend
steady
star history

What it does This repo is a structured knowledge pack — not code, but guidance — in the open Agent Skills format. It feeds your AI assistant concise, correct defaults for SwiftUI: which property wrapper to use, how to keep list identity stable, when @Observable beats @StateObject, and what iOS 26 Liquid Glass actually requires. Think of it as a senior dev in a box, minus the coffee breaks.

The interesting bit The standout piece is a bundled Python toolchain that wraps Apple’s xctrace. The agent can record an Instruments trace, then parse five lanes — Time Profiler, Hangs, Animation Hitches, SwiftUI updates, and cause graphs — into correlated JSON and markdown. A single derived metric, main_running_coverage_pct, splits hangs into “blocked on I/O” versus “CPU-bound,” which steers the fix in opposite directions. That’s actual diagnostic logic, not just prompt engineering.

Key highlights

  • Covers the full SwiftUI surface: state management, view composition, NavigationStack, Swift Charts, macOS scenes, accessibility, image downsampling, and deprecated-to-modern API migration (iOS 15 through iOS 26+)
  • Reference files load on demand so the agent’s context window isn’t bloated with irrelevant topics
  • Installable via skills.sh, Claude Code plugin, Cursor plugin, Codex/OpenAI manifest, or manual symlink — six different toolchains supported
  • Trace analysis is pure stdlib Python 3; only external dependency is Xcode’s own xctrace
  • Includes a maintenance sub-skill for scanning Apple docs and refreshing the deprecated API reference after new OS releases

Caveats

  • The maintenance skill requires the Sosumi MCP to auto-scan Apple documentation; without it, updates are manual
  • Trace recording only works where xctrace is available (macOS with Xcode installed)
  • The repo is guidance and scripts, not a library you import — value depends entirely on your AI tool’s skill support

Verdict Worth a look if you’re shipping SwiftUI and your AI assistant keeps suggesting @ObservedObject where @Observable belongs. Skip it if you don’t use an agent that supports the Skill format, or if you already have a team wiki your LLM is fine-tuned on.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.