swiftui-debugging

swiftui-debugging is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 44 tokens per session (3,530 once invoked), scanned A, original, MIT.

A debugging guide for finding performance problems in SwiftUI, Apple's framework for building app interfaces.

In plain words
What is it for?
It helps investigate unnecessary screen updates, view identity problems, expensive view calculations, and scrolling issues.
Why use it?
It helps explain slow, stuttering, or repeatedly updating screens instead of relying on guesswork.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the apple-skills plugin — 147 skills shipped together , and of apple-skills

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/swiftui-debugging
Any agent
npx skills add rshankras/claude-code-apple-skills --skill swiftui-debugging
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

Or install apple-skills, the plugin that ships this one along with the rest of its 147 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for swiftui-debugging

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/swiftui-debugging.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/swiftui-debugging)
Your own site
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/swiftui-debugging"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/swiftui-debugging.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,530 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.03530
Opus 5 $0.00022 $0.01765
Sonnet 5 $0.00009 $0.00706
Haiku 4.5 $0.00004 $0.00353

Measured 3d ago against content hash 0e9b0ad9b8b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

swiftui-debugging scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/performance/swiftui-debugging/SKILL.md · 251 lines

How it starts

The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SwiftUI Performance Debugging

Systematic guide for diagnosing and fixing SwiftUI performance problems: unnecessary view re-evaluations, identity issues, expensive body computations, and lazy loading mistakes.

When This Skill Activates

Use this skill when the user:

  • Reports slow or janky SwiftUI views
  • Sees excessive view re-renders or body re-evaluations
  • Asks about Self._printChanges() or view debugging
  • Has scrolling performance issues with lists or grids
  • Asks why a view keeps updating when nothing changed
  • Mentions @Observable or ObservableObject performance differences
  • Wants to understand SwiftUI view identity or diffing
  • Uses AnyView and asks about performance implications
  • Has a hang or stutter traced to SwiftUI rendering

The Performance Loop

Every investigation follows the same loop: symptom -> measure -> identify -> optimize -> RE-MEASURE. The last step is the one people skip -- an "optimization" that was never re-measured is a guess, and SwiftUI guesses are wrong often enough (a fix can shift cost elsewhere) that the loop is not optional. Never close a performance issue on the strength of the diff alone.

Decision Tree

What SwiftUI performance problem are you seeing?
|
+- Views re-render when they should not
|  +- Read body-reevaluation.md
|     +- Self._printChanges() to identify which property changed
|     +- @Observable vs ObservableObject observation differences
|     +- Splitting views to narrow observation scope
|
+- Scrolling is slow / choppy (lists, grids)
|  +- Read lazy-loading.md
|     +- VStack vs LazyVStack, ForEach without lazy container
|     +- List prefetching, grid cell reuse
|
+- Views lose state unexpectedly / animate when they should not
|  +- Read view-identity.md
|     +- Structural vs explicit identity
|     +- .id() misuse, conditional view branching
|
+- Known pitfall (AnyView, DateFormatter in body, etc.)
|  +- Read common-pitfalls.md
|     +- AnyView type erasure, object creation in body
|     +- Over-observation, expensive computations
|
+- General "my SwiftUI app is slow" (unknown cause)
|  +- Start with body-reevaluation.md, then common-pitfalls.md
|  +- Use Instruments SwiftUI template (see Debugging Tools below)

Read the full file on GitHub · 251 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 251 lines · 44 tokens per session scan A 0e9b0ad9b8b4

Subscribe to this mod's changes

swiftui-debugging is a skill published in the GitHub repository rshankras/claude-code-apple-skills (701 stars, last pushed 1mo ago), licensed MIT. It adds 44 tokens to every session and 3,530 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

swift-performance-pro

Use when diagnosing or fixing performance — SwiftUI render cost, memory and retain cycles, slow lists, launch time, and using Instruments.

laxrajpurohit/swift-skills-pro · 31 tokens

swiftui-performance

Audit and improve SwiftUI runtime performance. Use when diagnosing slow rendering, janky scrolling, high CPU, memory usage, excessive view updates, layout thrash, body evaluation cost, identity churn, view lifetime issues, lazy loading, Instruments profiling guidance, and performance audit requests.

JordanCoin/ios-skills-collection · 59 tokens

motioneyes-animation-debug

Diagnose, fix, or validate SwiftUI animation and scroll behavior by temporarily instrumenting views with MotionEyes, capturing console traces over time, and comparing motion data to user intent or test expectations. Use when users report bugs such as wrong direction, premature fade, timing or easing mismatch…

JordanCoin/ios-skills-collection · 126 tokens

iOS Performance

Memory management, profiling, optimization techniques, and Instruments usage for high-performance iOS apps.

JordanCoin/ios-skills-collection · 21 tokens

swiftui-performance-audit

Audit and improve SwiftUI runtime performance from code review and architecture. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps, and to provide guidance for user-run Instruments profiling when code review alone is…

JordanCoin/ios-skills-collection · 66 tokens

ios-debugger-agent

Use XcodeBuildMCP to build, run, launch, and debug the current iOS project on a booted simulator. Trigger when asked to run an iOS app, interact with the simulator UI, inspect on-screen state, capture logs/console output, or diagnose runtime behavior using XcodeBuildMCP tools.

JordanCoin/ios-skills-collection · 70 tokens