# Swift swiftui

> Swift swiftui is an open-source agent skill for developer tools. Swift 6 and SwiftUI rules for macOS apps: concurrency, state, SwiftData and fixes. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/daveebbelaar/bama/tree/main/skills/code/swift-swiftui
- **Repository:** https://github.com/daveebbelaar/bama
- **GitHub stars:** 2,009
- **License:** MIT
- **Skill name:** swift-swiftui
- **Collection:** https://github.com/daveebbelaar/bama
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill gives an agent a set of coding rules for building macOS apps in Swift 6 language mode with SwiftUI. It covers how to split work between the main actor, actors and background functions, how to keep data Sendable, and how to manage observable state, menus and SwiftData models with stable identifiers and undo handling.

The guidance also covers AppKit bridges for cases SwiftUI does not handle well, such as non-activating floating panels, custom text views, status items and event monitors. A table maps common compiler errors such as unresolved names after adding a file, actor isolation mismatches and type-checking timeouts to their usual fixes, and a second table lists Swift 6 migration errors.

The skill points to other skills for visual design and system integrations, and to reference files in the same repository for copyable view code. It expects a Swift project targeting macOS and uses the Swift package manager for clean builds.

## When your agent uses it

> Swift 6 and SwiftUI code rules for macOS apps, including concurrency, state, SwiftData, AppKit bridges, and fixes for common compiler errors. Use when writing, reviewing, or debugging Swift code in a Mac app, or on concurrency, Sendable, or "not in scope" errors.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/daveebbelaar/bama/tree/HEAD/skills/code/swift-swiftui)
- [License: MIT](https://github.com/daveebbelaar/bama/tree/HEAD/skills/code/swift-swiftui)

## Features

- **Swift 6 concurrency rules:** Guidance on main-actor defaults, actors, Sendable types and when to use detached tasks.
- **SwiftUI state management:** Patterns for observable models, bindings, environment sharing and safe ForEach usage.
- **SwiftData model conventions:** Defaults for new properties, stable UUIDs, store location and undo registration.
- **Menu command handling:** A workaround for SwiftUI commands that do not refresh from observable models, plus keyboard shortcut pitfalls.
- **AppKit bridge patterns:** Use cases for NSPanel, NSTextView, NSStatusItem and event monitors inside SwiftUI apps.
- **Compiler error fixes:** A lookup table of common Swift and SwiftUI compiler errors with suggested fixes.

## Good for

- Review my SwiftUI macOS app for Swift 6 concurrency issues
- Fix a Sendable or main actor isolation error in my Swift code
- Add a SwiftData model with safe defaults and undo support
- Build a non-activating floating panel with SwiftUI content on macOS
- Debug a 'cannot find in scope' error after adding a new Swift file

## Install

### Claude Code

This skill ships in the `bama` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add daveebbelaar/bama
/plugin install bama@bama
```

Or copy only this skill to `~/.claude/skills/swift-swiftui`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/daveebbelaar/bama.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/swift-swiftui &&
cp -R "$tmp/skills/code/swift-swiftui" ~/.claude/skills/swift-swiftui &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/swift-swiftui` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/swift-swiftui` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/daveebbelaar/bama.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/swift-swiftui &&
cp -R "$tmp/skills/code/swift-swiftui" ~/.agents/skills/swift-swiftui &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/swift-swiftui` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/swift-swiftui` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/daveebbelaar/bama.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/swift-swiftui &&
cp -R "$tmp/skills/code/swift-swiftui" ~/.cursor/skills/swift-swiftui &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/swift-swiftui` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/daveebbelaar/bama.git --path skills/code/swift-swiftui
```

Or copy the folder to `~/.gemini/skills/swift-swiftui` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/swift-swiftui`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/daveebbelaar/bama.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/swift-swiftui &&
cp -R "$tmp/skills/code/swift-swiftui" ~/.copilot/skills/swift-swiftui &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/swift-swiftui` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/daveebbelaar/bama.git
```

Then copy `bama/skills/code/swift-swiftui` into your agent's skills folder as `swift-swiftui`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Which tools does Swift swiftui need?

The skill does not set an allowed tools list. It refers to other skills named mac-design, os-integrations and test-mac-app, and to reference files in its repository.

### When does the skill trigger?

It is meant for writing, reviewing or debugging Swift code in a Mac app, and for concurrency, Sendable or 'not in scope' errors.

### Does Swift swiftui run any scripts?

No scripts are included. It gives rules and fixes that the agent applies to the code.

### How do I install Swift swiftui in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/swift-swiftui to use it in all your projects, or to .claude/skills/swift-swiftui in one project. Or install the bama plugin, which includes it: /plugin marketplace add daveebbelaar/bama, then /plugin install bama@bama.

### Does Swift swiftui run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Swift swiftui?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Swift swiftui?

The closest alternatives to Swift swiftui are Mac design, Build swiftui interface, Design kit, Test mac app and New mac app.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Mac design](https://ai-powered.com/skills/mac-design): Mac design is an open-source agent skill for developer tools.
- [Build swiftui interface](https://ai-powered.com/skills/build-swiftui-interface): Build swiftui interface is an open-source agent skill for developer tools.
- [Design kit](https://ai-powered.com/skills/design-kit): Design kit is an open-source agent skill for design and media.
- [Test mac app](https://ai-powered.com/skills/test-mac-app): Test mac app is an open-source agent skill for developer tools.
- [New mac app](https://ai-powered.com/skills/new-mac-app): New mac app is an open-source agent skill for developer tools.
- [Build and verify](https://ai-powered.com/skills/build-and-verify): Build and verify is an open-source agent skill for developer tools.
- [Performance](https://ai-powered.com/skills/performance-daveebbelaar): Performance is an open-source agent skill for developer tools.
- [Os integrations](https://ai-powered.com/skills/os-integrations): Os integrations is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/swift-swiftui
