swift-swiftui
Skill1.7k starsChanged 10 days agoMITView on GitHub
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.
3 other projects use a version of this, 1 of them edited.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- Stijnus/dsh-rev-engedited, first seen Nov 8, 2026
- ai-enhanced-engineer/aiee-skillstheir own version, first seen Nov 1, 2026
- pluginagentmarketplace/custom-plugin-swifttheir own version, first seen Dec 30, 2025
Who's talking about daveebbelaar/bama
- Dave Ebbelaar“This Free Repo Lets Claude Code Build Any Mac App”YouTube · Oct 26, 2026 · 121k views
- tamhn“Claude Giờ Làm Được MỌI Ứng Dụng Mac (Skill Miễn Phí)”YouTube · Oct 29, 2026 · 8.1k views
- Claudical“App Store 대신 말로 만드는 Mac 앱 | Claude Code 플러그인 BAMA”YouTube · Nov 3, 2026 · 1.9k views
- Daksh“BAMA AI Agent builds native Mac apps from screenshots #shorts”YouTube · Oct 28, 2026 · 742 views
- Tech by Thilak“Claude can now clone Mac apps (BAMA, free and open source)”YouTube · Nov 2, 2026 · 310 views
The biggest 5 of 42 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 42
Talked about on GitHub, YouTube and the web (42 times).
On GitHub · 20
- Nov 5, 2026agent-skills.github.daveebbelaar.bama: 0-unstable-2026-11-01 → 1.1.1 — sudosubin/agents.nix0 reactions
- Nov 5, 2026claude-code-plugins.github.daveebbelaar.bama: 0-unstable-2026-11-01 → 1.1.1 — sudosubin/agents.nix0 reactions
- Nov 1, 2026claude-code-plugins.github.daveebbelaar.bama: 0-unstable-2026-10-29 → 0-unstable-2026-11-01 — sudosubin/agents.nix0 reactions
- Nov 1, 2026agent-skills.github.daveebbelaar.bama: 0-unstable-2026-10-29 → 0-unstable-2026-11-01 — sudosubin/agents.nix0 reactions
- Nov 1, 2026[GitHub Radar] 2026-11-01: 3 repo đáng xem — mrxcode-debug/pdt-github-hot-radar0 reactions
15 more on GitHub
- Oct 30, 2026H: Mac app (SwiftUI shell around the Rust binary), replaces the AppleScript droplet — fastermadman/PDFable0 reactions · 1 comment
- Oct 29, 2026agent-skills.github.daveebbelaar.bama: 0-unstable-2026-10-27 → 0-unstable-2026-10-29 — sudosubin/agents.nix0 reactions
- Oct 29, 2026claude-code-plugins.github.daveebbelaar.bama: 0-unstable-2026-10-27 → 0-unstable-2026-10-29 — sudosubin/agents.nix0 reactions
- Oct 28, 2026[Candidate] daveebbelaar/bama/skills/design/layout-grid - layout-grid — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 28, 2026[Candidate] daveebbelaar/bama/skills/design/design-system - design-system — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 28, 2026[Candidate] daveebbelaar/bama/skills/design/design-kit - design-kit — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 27, 2026agent-skills.github.daveebbelaar.bama: init at 0-unstable-2026-10-27 — sudosubin/agents.nix0 reactions
- Oct 27, 2026[Candidate] daveebbelaar/bama/skills/design/design-from-app - design-from-app — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 27, 2026[Candidate] daveebbelaar/bama/skills/design/app-icon - app-icon — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 27, 2026[Candidate] daveebbelaar/bama/skills/code/swift-swiftui - swift-swiftui — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 27, 2026claude-code-plugins.github.daveebbelaar.bama: 0-unstable-2026-10-26 → 0-unstable-2026-10-27 — sudosubin/agents.nix0 reactions
- Oct 27, 2026[Candidate] daveebbelaar/bama/skills/code/performance - performance — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 27, 2026[Candidate] daveebbelaar/bama/skills/code/os-integrations - os-integrations — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 27, 2026[Candidate] daveebbelaar/bama/skills/code/improve-architecture - improve-architecture — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 27, 2026claude-code-plugins.github.daveebbelaar.bama: init at 0-unstable-2026-10-26 — sudosubin/agents.nix0 reactions
On YouTube · 13
- Oct 26, 2026This Free Repo Lets Claude Code Build Any Mac App — Dave Ebbelaar121k views · 118 comments
- Oct 29, 2026Claude Giờ Làm Được MỌI Ứng Dụng Mac (Skill Miễn Phí) — tamhn8.1k views · 5 comments
- Nov 3, 2026App Store 대신 말로 만드는 Mac 앱 | Claude Code 플러그인 BAMA — Claudical1.9k views · 1 comment
- Oct 28, 2026BAMA AI Agent builds native Mac apps from screenshots #shorts — Daksh742 views
- Nov 2, 2026Claude can now clone Mac apps (BAMA, free and open source) — Tech by Thilak310 views
8 more on YouTube
- Oct 29, 2026Claude Code Mac App: One Sentence In, a Working App Out (Free BAMA Repo) — Simply AI217 views
- Oct 29, 2026Clone any native Mac app using AI agents 🚀 — LookOnThisGit117 views · 1 comment
- Nov 1, 2026AI Se Apni Mac App? 🖥️ — Suresh52 views
- Nov 2, 2026See an app you like? Claude Code rebuilds it as a Mac app (BAMA) — RocketLauncher Code40 views
- Oct 27, 2026Your AI can now build real Mac apps #shorts — No Short Answers36 views · 1 comment
- Oct 27, 2026BAMA: Agent Skills That Build Native Mac Apps #Shorts — Brix AI30 views
- Oct 29, 2026BAMA + 2 more repos · hotin.ai daily Oct 29, 2026 #Shorts — HotInAI27 views
- Nov 4, 2026bama: Rebuild any Mac app instantly — Dail Finds Dev | Repos, Tools, Sites2 views
On the web · 9
- Oct 30, 2026Build your own Mac app with Claude Code | aruntastic — aruntastic.com
- Oct 26, 2026This Free Repo Lets Claude Code Build Any Mac App · CHOOSETO.AI — chooseto.ai
- Oct 24, 2026daveebbelaar/bama - The Skill Leaderboard — skillleaderboard.com
- Feb 15, 2026Product TEA Test: GAMMA - by TEA (The Era Arc) and Sam Li — tea2025.substack.com
- Dec 28, 2025My Experience Using the BMAD Framework on a Personal Project (Patience Required) — dev.to
4 more on the web
- Dec 6, 2025Finding My Brain Again in the Middle of the AI Fire hose | by Shay Dratler — dratler-shay.medium.com
- Sep 14, 2025#6 - ChatGPT Agent, Youware, Gamma - by Brandon — behindonai.substack.com
- Jul 16, 2025My 15 favorite apps I use daily. We spend hours each day on our phones… | by Bex Jeanson — userbexperiencedesign.medium.com
- Aug 11, 2023Last Day with @daveebbelaar here at Termene.ro in Nuba, Mamaia. I got some great insight on how to code an AI Agent that can take notes for your meetings and organise them … | David Podut — linkedin.com
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- Stijnus/dsh-rev-eng★ 197% same
Wrote their own version · 2
- pluginagentmarketplace/custom-plugin-swift★ 9same name
- ai-enhanced-engineer/aiee-skills★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- agent-cliSkill
- improve-architectureSkill
- os-integrationsSkill
- performanceSkill
- app-iconSkill
- design-from-appSkill
- design-kitSkill
- design-systemSkill
- layout-gridSkill
- mac-designSkill
- ux-designSkill
- cloneSkill
- researchSkill
- user-storiesSkill
- build-and-verifySkill
- improve-loopSkill
- test-mac-appSkill
- app-briefSkill
- bamaSkill
- new-mac-appSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 56
Every new property has a default value, so existing stores still open.
- Very specific: line 105
Never name a type Task, View, Color, Image, Text, Section, Label, Menu, Group, or Settings.
- Very specific: line 107
Use Todo, TaskItem, NoteSection.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Swift and SwiftUI
The code is right when it compiles with zero warnings in Swift 6 language
mode and the app does what the story says. For how it should look, call the
Skill tool with mac-design. For copyable view code, read
../../design/mac-design/patterns.md.
Concurrency
The template sets main-actor default isolation: every type and function runs on the main actor unless you say otherwise. UI code needs no annotations.
| Work | Put it in |
| UI state, views, view models | Default (main actor) |
| CPU-heavy pure work (parsing, image work, diffing) | A nonisolated function marked @concurrent |
| Shared mutable state used off the main thread | An actor |
| A C callback (event tap, Carbon hotkey, CoreAudio listener) | A nonisolated static func that hops back with Task { @MainActor in ... } |
- Data that crosses actors is
Sendable: structs and enums ofSendablevalues, orfinal classwith onlyletproperties. MainActor.assumeIsolated { }inside a callback you know runs on the main thread (a main run loopTimer, a main queue notification).Task { }inherits the actor.Task.detachedonly when it must not.- Fix a concurrency error at its type, not with
@unchecked Sendableornonisolated(unsafe). Those two are a last resort, with a comment why. - Runtime trap the compiler misses. A closure created inside a
@MainActortype and passed to an API without a@Sendableclosure parameter (DispatchSource.setEventHandler,DispatchWorkItem,addPeriodicTimeObserver, CoreAudio listener blocks) inherits the main actor. When it runs on a background queue, Swift 6 crashes the app. Write it as{ @Sendable in ... }, and run every background path once after any concurrency change.
State
@Observableclasses for models.@Statein the view that owns one,@Bindableto bind to its properties,.environment(model)to share it.@ObservationIgnoredon caches, timers, and handles, so they never trigger a redraw.@Statefor view-local values.@AppStoragefor small preferences. Keychain for secrets.ForEach(items)over values, neverForEach($items)for data the user can delete: a row can read an index that no longer exists and crash. Get a binding by looking the item up by id.
SwiftData
@Modelclasses,.modelContaineron the scene,@Queryin views,@Environment(\.modelContext)to insert and delete.- Every new property has a default value, so existing stores still open.
- Store at
~/Library/Application Support/<AppName>/. Allow an override (APP_STORE) so tests never touch the real data. - Give every model its own
uid: UUID.persistentModelIDchanges on the first save, so it breaks selection and lookups. - Undo: register the reverse of each action on the window's undo manager. SwiftData's automatic undo is not reliable. Code in ../../design/mac-design/patterns.md (Undo with SwiftData).
- Need SQL, a CLI, or several processes on one file? Use SQLite with WAL through a small library target instead.
Menu commands
SwiftUI Commands do not observe @Observable models, so a title or a
.disabled(...) that reads the model goes stale. In testing, neither
@FocusedValue (from .focusedSceneValue) nor an @ObservedObject inside
the commands updated reliably: the menu stayed disabled with a row
selected. What works: mirror the selection into a small ObservableObject,
observe it in the App, and pass the values into the commands. The App's
body then rebuilds the menus when they change.
@MainActor final class MenuState: ObservableObject {
static let shared = MenuState()
@Published private(set) var selection: Set<UUID> = []
func update(_ s: Set<UUID>) { if selection != s { selection = s } }
}
// AppModel: var selection: Set<UUID> = [] { didSet { MenuState.shared.update(selection) } }
struct MyApp: App {
@ObservedObject private var menu = MenuState.shared
var body: some Scene {
Window("App", id: "main") { ContentView() }
.commands { AppCommands(model: model, selectedIDs: menu.selection) }
}
}Disable items with .disabled(selectedIDs.isEmpty) and resolve the target
again when the item fires. Never ship items that stay enabled and do
nothing. Check the menu from outside the app (test-mac-app skill, "Menu
check").
A menu shortcut also fires while a text field has focus. Never use Delete,
Command-Delete, arrows, or Return as menu shortcuts. Handle them on the
list with .onDeleteCommand and .onKeyPress.
Names Swift already uses
Never name a type Task, View, Color, Image, Text, Section,
Label, Menu, Group, or Settings. Task breaks every Task { }.
Use Todo, TaskItem, NoteSection.
AppKit bridges
SwiftUI covers windows, lists, and forms. AppKit is still the answer for:
- Floating panels that do not steal focus:
NSPanelwith.nonactivatingPanelhosting a SwiftUI view (NSHostingView, withsizingOptions = []for a fixed frame). - Text views with custom behavior:
NSViewRepresentablearoundNSTextView. - Status items with custom click handling:
NSStatusItem. - Key and mouse monitors:
NSEvent.addLocalMonitorForEvents. Remove the monitor when the view goes away.
For system hooks (hotkeys, Accessibility, screen capture), call the Skill
tool with os-integrations.
Compiler errors
| Error | Fix |
cannot find 'X' in scope right after adding a file | swift package clean --scratch-path ~/Library/Developer/<AppName>/build |
Main actor-isolated ... from a nonisolated context | Make the caller main-actor, or await the call |
Sending 'x' risks causing data races | Make the type Sendable, or keep it on one actor |
The compiler is unable to type-check this expression | Split the view into smaller subviews or let constants |
ambiguous use of 'Task' | A type in your code is named Task; rename it |
Fix the first error first. Later errors often come from it.
Swift 6 errors
Moving an existing Swift 5 app? Read ../../ship/build-and-verify/existing-app.md first: expect several build rounds, then hunt the runtime trap above.
| Error | Fix |
Static let of a non-Sendable type (formatter, NSFont, CFString) | @MainActor on the enclosing type, a computed var, or a commented nonisolated(unsafe) |
sending 'note' risks causing data races in a main-queue observer | Copy the Sendable parts (an id, a pid) out of the notification before MainActor.assumeIsolated |
| Observer token captured before it is assigned | Keep the token in a small @MainActor class |
| "pattern that the region-based isolation checker does not understand" in a task group | Use an array of Task { @MainActor in ... } and await each one |
Vars changed from OperationQueue blocks under NSLock | OSAllocatedUnfairLock(initialState:) |
@objc action on an NSMenuItem subclass | @MainActor @objc func |
Done when the app builds with zero warnings in Swift 6 language mode and the story's acceptance checks pass.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

