# Improve SwiftUI Code with Expert Guidance

SwiftUI projects can accumulate state, layout, accessibility, and performance problems. This skill provides focused review guidance and optional Instruments trace analysis to identify practical improvements.

## Install

```bash
npx skillstore add avdlee/swiftui-expert-skill
```

## Metadata

- Status: approved
- Slug: avdlee-swiftui-expert-skill
- Skillstore revision: r4
- Version status: missing
- Tree hash: fd2f1281402b1caddaa6358488539b5548523d1938c669d17dc6516e18650391
- Author: avdlee
- GitHub username: avdlee
- License: MIT
- Repository: https://github.com/avdlee/swiftui-agent-skill/tree/main/swiftui-expert-skill/
- Ref: 08aa966eb58140422f6f05cda226d03f603f4136
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: network, external\_commands, filesystem, scripts
- Quality score: 82
- Quality tier: silver
- Public page: https://skillstore.pages.dev/skills/avdlee-swiftui-expert-skill
- Manifest: https://skillstore.pages.dev/api/skills/avdlee-swiftui-expert-skill/manifest

## Capabilities

- Reviews SwiftUI state ownership, bindings, observable models, and view identity.
- Guides list, layout, navigation, animation, accessibility, localization, and preview improvements.
- Identifies modern API replacements and version-gating requirements from bundled references.
- Explains performance patterns that reduce unnecessary view updates and expensive body work.
- Records or analyzes Xcode Instruments traces when the user explicitly requests profiling.

## Use Cases

- Review a feature screen: Find state, identity, accessibility, and API issues before a SwiftUI feature is merged.
- Modernize an application: Plan focused migrations from soft-deprecated SwiftUI APIs with appropriate availability fallbacks.
- Investigate performance: Interpret an Instruments trace to prioritize hangs, hitches, CPU hotspots, and excessive SwiftUI updates.

## Prompt Templates

### Review a SwiftUI view

```
Review this SwiftUI view for state ownership, accessibility, and view identity. Explain the highest-priority fixes first.
```

### Improve list performance

```
Review this SwiftUI list for stable identity, row structure, filtering, and unnecessary updates. Suggest targeted changes only.
```

### Plan an API migration

```
Find soft-deprecated SwiftUI APIs in this file. Propose modern replacements with availability gates and fallbacks.
```

### Analyze an Instruments trace

```
Analyze this Instruments trace for the largest SwiftUI performance problems. Prioritize findings with trace evidence and recommend source areas to inspect.
```

## Limitations

- Requires project code or trace data to make project-specific recommendations.
- Does not run a profiling session without a user-selected target and recording scope.
- Trace workflows require Xcode Instruments and xctrace on a supported Apple development environment.
- Provides guidance and analysis; it does not replace device testing or Apple platform documentation.

## Best Practices

- Provide the relevant SwiftUI files and the deployment targets before requesting changes.
- Ask for a review before requesting broad refactoring of a production feature.
- Use a narrowly scoped Instruments recording target and confirm the data that may be captured.

## Anti Patterns

- Do not request system-wide recording unless it is necessary and the data scope is approved.
- Do not apply API migrations without testing availability gates on supported platform versions.
- Do not treat trace recommendations as proof without inspecting the related source and reproducing the issue.

## Security Audit

- Audited at: 2026-07-24T09:48:06.729\+00:00
- Summary: All 280 static findings are false positives caused by documentation syntax, SwiftUI terminology, parser metadata, or the intended local xctrace workflow. The trace recorder uses argument vectors instead of a shell, redacts displayed launch environment values, and requires explicit confirmation before system-wide recording. No prompt injection, credential access, network exfiltration, or malicious intent was found.

## Stats

- Views: 171
- Downloads: 12
- Favorites: 1
- Popularity score: 0
