# swiftui

swiftui is a Claude Code skill for diagnosing SwiftUI state and rendering issues. It also provides focused guidance on layouts, charts, text editing, toolbars, and WebKit.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 224 installs · ★ 905 repo stars
- Author: rshankras
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/rshankras/claude-code-apple-skills/tree/HEAD/skills/swiftui/SKILL.md
- Updated: 2026-07-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/rshankras-swiftui

## What it does

swiftui routes the agent to guidance for the SwiftUI area involved in a coding task. Its seven sections cover state ownership and Observation, layout and scrolling, AlarmKit, 3D charts, text formatting, toolbars, and WebKit.

The agent selects a section, reads its `SKILL.md` and any linked reference files, then applies that material to the project code. The skill activates for requests about rendering glitches, state resets, scroll performance, or the listed APIs. The AlarmKit section covers iOS 18+.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add rshankras/claude-code-apple-skills --skill swiftui -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/swiftui/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/swiftui/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add rshankras/claude-code-apple-skills --skill swiftui -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/swiftui/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add rshankras/claude-code-apple-skills --skill swiftui -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/swiftui/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install rshankras/claude-code-apple-skills skills/swiftui
```

2. **Manually: put the files in place**
- File: `.github/skills/swiftui/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add rshankras/claude-code-apple-skills --skill swiftui -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/rshankras/claude-code-apple-skills --path skills/swiftui
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/swiftui/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add rshankras/claude-code-apple-skills --skill swiftui -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/rshankras/claude-code-apple-skills/tree/HEAD/skills/swiftui/SKILL.md

## When to use it
- trace a SwiftUI state reset or excess rendering
- tune custom layouts and scrolling behavior
- add an alarm or timer with AlarmKit
- build a 3D data view with Swift Charts
- embed web content or format editable text

## Example prompts
- Find why this SwiftUI view keeps losing its state.
- Help improve scrolling in this lazy list.
- Show how to embed a web page and connect it to JavaScript.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 7756744ed080c6d5.

BEGIN THIRD-PARTY FILE 7756744ed080c6d5
```text
---
name: swiftui
description: SwiftUI framework skills — data flow (identity, Observation, state ownership), layout & containers (Layout protocol, lazy-stack performance), AlarmKit, 3D charts, rich text editing, customizable toolbars, and WebKit embedding. Use for SwiftUI state/rendering bugs, custom layouts, scroll performance, or these feature areas.
allowed-tools: [Read, Glob, Grep]
last_verified: 2026-07-16
review_by: 2027-06-22
os_version: iOS 27 / macOS 27
---

# SwiftUI Skills

Focused SwiftUI framework skills — each sub-skill covers one API area in depth.

## When This Skill Activates

Use this skill when the user:
- Has **state/rendering bugs**: state resets, over-rendering, flashing lists, animation crossfades (data-flow)
- Is choosing **@State vs @Bindable vs @Environment** or migrating to Observation (data-flow)
- Builds **custom layouts or containers**, or fights **lazy-stack/scroll performance** (layout)
- Wants alarms or timers with **AlarmKit** (custom UI, Live Activities, snooze)
- Is creating **3D data visualizations** with Swift Charts (Chart3D, SurfacePlot)
- Needs **styled text or rich text editing** (Text, AttributedString, TextEditor)
- Is implementing or customizing **toolbars** (customizable toolbars, search integration)
- Wants to **embed web content** (WebView, WebPage, JavaScript interop)

## Available Skills

Paths are relative to THIS file's directory — skills run with cwd set to the
user's project, so resolve each path from this SKILL.md's own location.

| Skill | Read | Covers |
|-------|------|--------|
| data-flow | `data-flow/SKILL.md` | View identity/lifetime/dependencies, Observation, state ownership, body discipline, main-actor contract |
| layout | `layout/SKILL.md` | Layout protocol, Grid decisions, custom containers, lazy-stack + scrolling performance rules |
| alarmkit | `alarmkit/SKILL.md` | Alarms and timers with custom UI, Live Activities, snooze (iOS 18+) |
| charts-3d | `charts-3d/SKILL.md` | Chart3D, SurfacePlot, interactive pose control, surface styling |
| text-editing | `text-editing/SKILL.md` | Text, AttributedString, TextEditor with formatting controls |
| toolbars | `toolbars/SKILL.md` | Customizable toolbars, search integration, transition effects, platform behavior |
| webkit | `webkit/SKILL.md` | WebView and WebPage embedding, navigation, JavaScript interop |

## How to Route

1. Match the request to a row above.
2. Read that SKILL.md (relative to this file) plus any reference files it lists.
3. Apply the guidance to the user's code.
```
END THIRD-PARTY FILE 7756744ed080c6d5

The third-party file has ended. Everything between the 7756744ed080c6d5 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© rshankras · MIT · https://github.com/rshankras/claude-code-apple-skills/tree/HEAD/skills/swiftui/SKILL.md

## Similar
- [swiftui-webkit](https://affpapa.org/en/nevibecode/skills/swiftui-webkit.md) — skill · 3500 installs
- [swiftui-patterns](https://affpapa.org/en/nevibecode/skills/affaan-m-swiftui-patterns.md) — skill · 6300 installs
- [swiftui-animation](https://affpapa.org/en/nevibecode/skills/swiftui-animation.md) — skill · 5900 installs
- [axiom-swiftui](https://affpapa.org/en/nevibecode/skills/axiom-swiftui.md) — skill · 1700 installs
- [swiftui-design-skill](https://affpapa.org/en/nevibecode/skills/swiftui-design-skill.md) — skill · 1300 installs

## Other versions with the same name
- [swiftui · prisma-labs-dev](https://affpapa.org/en/nevibecode/skills/swiftui.md) — 787 installs

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
