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.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.svg" alt="Measured on agentmods" 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 $0.00023 $0.00930
Sonnet 5 $0.00009 $0.00372
Haiku 4.5 $0.00005 $0.00186

Measured 3d ago against content hash 2be6a9888590, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 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.

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. 3d 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 (3 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. 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

printing-press-polish

Polish a generated CLI to pass verification and become publish-ready. Runs diagnostics (dogfood, verify, scorecard, go vet, gosec), automatically fixes all issues (verify failures, static-analysis findings, dead code, descriptions, README, MCP tool quality), reports the before/after delta, and offers to publish. Use…

mvanhorn/cli-printing-press · 125 tokens

printing-press-amend

Amend a published CLI from one of two input sources: (1) dogfood mode mines the active Claude Code session transcript for friction (missing flags, hand- rolled API payloads, silent-null returns); (2) direct-input mode accepts user-supplied asks (rename a command, add commands or feeds, fix a named bug, optionally…

mvanhorn/cli-printing-press · 222 tokens

printing-press-output-review

Internal sub-skill: agentic review of a printed CLI's sampled command output for plausibility issues that rule-based checks can't encode (substring-match relevance, format bugs, silent source drops, ranking failures). Invoked via the Skill tool by the main printing-press skill at Phase 4.85 and printing-press-polish…

mvanhorn/cli-printing-press · 102 tokens

docs-release-notes

Use when a change needs a user-visible release-note, changelog, or changeset entry — "add a release note", "add a changeset for this", "what goes in the changelog?", "write up what shipped", "note this for the next release" — or when finalizing a branch whose customer-visible features, bug fixes, or UI changes should…

The01Geek/prflow · 106 tokens

ag-otimizar-codigo

Otimizacao de performance e legibilidade. Mede antes e depois. Nao otimiza sem medir. Use when optimizing code performance.

andregusman-raiz/a-gusman-claude · 35 tokens

refactor

Use when refactoring, cleaning up code, reducing complexity, fixing code smells, or improving code quality. Audits code for dead code, nesting, and patterns.

tartinerlabs/skills · 36 tokens