swiftui-performance-audit

swiftui-performance-audit is a skill for Claude Code, Codex from patrickserrano/lacquer. It costs 45 tokens per session (1,860 once invoked), scanned A, original, MIT.

A review guide for finding and fixing slow SwiftUI rendering, scrolling, layout, or view updates.

In plain words
What is it for?
Use it to audit SwiftUI code and decide when to profile it with Instruments, Apple's performance-analysis tool.
Why use it?
It helps locate common causes of lag, such as repeated heavy work, unstable list identity, oversized images, unnecessary state changes, and inefficient layouts.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to audit SwiftUI code and decide when to profile it with Instruments, Apple's performance-analysis tool.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/patrickserrano/lacquer/swiftui-performance-audit
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.

Any agent
npx skills add patrickserrano/lacquer --skill swiftui-performance-audit
Clone the repo
git clone --depth 1 https://github.com/patrickserrano/lacquer

Made for: Claude Code, Codex.

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-performance-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/patrickserrano/lacquer/swiftui-performance-audit/github.svg)](https://agentmods.dev/skills/patrickserrano/lacquer/swiftui-performance-audit)
Your own site
<a href="https://agentmods.dev/skills/patrickserrano/lacquer/swiftui-performance-audit"><img src="https://agentmods.dev/badge/skills/patrickserrano/lacquer/swiftui-performance-audit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for swiftui-performance-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/patrickserrano/lacquer/swiftui-performance-audit"><img src="https://agentmods.dev/badge/skills/patrickserrano/lacquer/swiftui-performance-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,860 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00045 $0.01860
Opus 5.5 $0.00018 $0.00744
Sonnet 5.5 $0.00009 $0.00372
Haiku 4.5 $0.00005 $0.00186

Measured 2mo ago against content hash 2be6a9888590, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

swiftui-performance-audit 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 2mo 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.

profiles/ios/skills/swiftui-performance-audit/SKILL.md · 268 lines

How it starts

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

SwiftUI Performance Audit

Overview

Audit SwiftUI view performance from instrumentation and baselining to root-cause analysis and concrete remediation steps.

Workflow Decision Tree

  1. If user provides code: Start with Code-First Review
  2. If user only describes symptoms: Ask for minimal code/context, then Code-First Review
  3. If code review is inconclusive: Guide user to profile with Instruments

1. Code-First Review

Collect

  • Target view/feature code
  • Data flow: state, environment, observable models
  • Symptoms and reproduction steps

Focus On

  • View invalidation storms from broad state changes
  • Unstable identity in lists (id churn, UUID() per render)
  • Heavy work in body (formatting, sorting, image decoding)
  • Layout thrash (deep stacks, GeometryReader, preference chains)
  • Large images without downsampling
  • Over-animated hierarchies (implicit animations on large trees)
  • Non-lazy containers (VStack/HStack) holding large collections instead of LazyVStack/LazyHStack
  • Async work in .task without relying on its automatic cancellation when the view disappears
  • Closures that may run off the main thread (Shape.path(in:), visualEffect, Layout protocol methods, onGeometryChange) touching @MainActor state directly instead of capturing values

Provide

  • Likely root causes with code references
  • Suggested fixes and refactors
  • Minimal repro or instrumentation suggestion if needed

2. Guide User to Profile

Before reaching for Instruments, a cheaper first step: ask the user to add Self._printChanges() (prints to stdout) or Self._logChanges() (iOS 17+, logs to the com.apple.SwiftUI subsystem under "Changed Body Properties") as the first line of the suspect view's body. Both print @self when the view value itself changed and @identity when the view's persistent data was recycled -- this often narrows down the offending state before a trace is needed. Remove these calls before shipping.

If code review is inconclusive, explain how to collect data:

Read the full file on GitHub · 268 lines

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. 2mo ago First seen · 268 lines · 45 tokens per session scan A 2be6a9888590

Subscribe to this mod's changes

swiftui-performance-audit is a skill published in the GitHub repository patrickserrano/lacquer (5 stars, last pushed yesterday), licensed MIT. It adds 45 tokens to every session and 1,860 once invoked, about $0.0002 per session on Opus 5.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

swiftui-performance-audit compared with skills from other repositories

swiftui-performance-audit next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
swiftui-performance-auditpatrickserrano/lacquerSkill5yesterdayMITA45Claude Code, Codex
printing-press-amendmvanhorn/cli-printing-pressSkill5.1ktodayMITA222Claude Code
printing-press-output-reviewmvanhorn/cli-printing-pressSkill5.1ktodayMITA102Claude Code
pi-loop-forensicsdimetron/pi-goSkill232todayMITA65Claude Code, Codex
verify-goal-loopdimetron/pi-goSkill232todayMITA88Claude Code, Codex
verify-history-rewritedimetron/pi-goSkill232todayMITA130Claude Code, Codex
nightly-session-watchdimetron/pi-goSkill232todayMITA78Claude Code, Codex