xcode-swift-dev
Skill12 starsChanged 6 days agoMITView on GitHub
Expert in Swift/SwiftUI development for macOS menu bar apps, iOS apps, widgets, and Xcode project configuration. Use for Swift architecture, SwiftUI patterns, App Intents, WidgetKit, and native Apple platform development.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-providerSkill
- macos-menubar-appSkill
- verify-meterbarSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 6 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Use MVVM with @Observable (iOS 17+) or ObservableObject
- Distinctive: line 26
Prefer composition over inheritance
- Distinctive: line 27
Keep views small and focused
- Very specific: line 78
Use TimelineProvider for data updates
- Distinctive: line 79
Keep widget views lightweight
- Very specific: line 81
Use @Environment(\.widgetFamily) for adaptive layouts
- Very specific: line 86
Use kSecClassGenericPassword for API keys
- Very specific: line 93
Use async/await for asynchronous operations
- Very specific: line 95
Use Task for launching async work from sync contexts
- Very specific: line 96
Prefer AsyncStream for continuous data
- Distinctive: line 179
Use XCTest for unit tests
- Distinctive: line 180
Test business logic in Services
- Very specific: line 181
Use @testable import for internal access
- Very specific: line 189
Use #if DEBUG for debug-only code
- Very specific: line 191
Use .xcconfig files for build settings
- Distinctive: line 192
Keep secrets out of source (use Keychain or secure config)
≈ “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
Xcode Swift Developer
Expert guidance for native Apple platform development with Swift and SwiftUI.
When to Use
- Building macOS menu bar apps
- Creating iOS/macOS widgets (WidgetKit)
- Implementing App Intents and Shortcuts
- SwiftUI component architecture
- Xcode project configuration
- Swift Package Manager setup
- Code signing and entitlements
- App Store / TestFlight preparation
Core Principles
SwiftUI Architecture
- Use MVVM with
@Observable(iOS 17+) orObservableObject - Prefer composition over inheritance
- Keep views small and focused
- Extract reusable components to separate files
Project Structure (macOS Menu Bar App)
AppName/
├── App/
│ └── AppNameApp.swift # @main entry point
├── Models/
│ ├── ServiceType.swift # Enums and data models
│ └── UsageMetrics.swift # Core data structures
├── Services/
│ ├── ServiceManager.swift # Business logic
│ ├── KeychainManager.swift # Secure storage
│ └── APIClient.swift # Network layer
├── Views/
│ ├── MenuBarView.swift # Main menu bar content
│ ├── SettingsView.swift # Preferences window
│ └── Components/ # Reusable UI components
└── Info.plist
AppNameWidget/
├── AppNameWidgetBundle.swift # Widget bundle entry
├── UsageWidget.swift # Widget implementation
├── Assets.xcassets/
└── Info.plistMenu Bar App Pattern
@main
struct AppNameApp: App {
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
MenuBarExtra("App Name", systemImage: "chart.bar") {
MenuBarView()
}
.menuBarExtraStyle(.window)
Settings {
SettingsView()
}
}
}Widget Development
- Use
TimelineProviderfor data updates - Keep widget views lightweight
- Support multiple widget families (small, medium, large)
- Use
@Environment(\.widgetFamily)for adaptive layouts - Share data via App Groups
Keychain Best Practices
- Use
kSecClassGenericPasswordfor API keys - Set
kSecAttrAccessibleappropriately - Group related items with
kSecAttrService - Handle errors gracefully (item not found, access denied)
Swift Concurrency
- Use
async/awaitfor asynchronous operations - Mark main-thread-bound code with
@MainActor - Use
Taskfor launching async work from sync contexts - Prefer
AsyncStreamfor continuous data
Code Signing & Entitlements
Common entitlements for menu bar apps:
com.apple.security.app-sandboxcom.apple.security.network.clientcom.apple.security.keychain-access-groupscom.apple.security.application-groups(for widget data sharing)
SwiftLint Configuration
disabled_rules:
- line_length
- trailing_whitespace
opt_in_rules:
- empty_count
- closure_spacing
- force_unwrapping
excluded:
- .build
- .swiftpmCommon Patterns
API Client
actor APIClient {
private let session = URLSession.shared
private let baseURL: URL
func fetch<T: Decodable>(_ endpoint: String) async throws -> T {
let url = baseURL.appendingPathComponent(endpoint)
let (data, response) = try await session.data(from: url)
guard let httpResponse = response as? HTTPURLResponse,
(200...299).contains(httpResponse.statusCode) else {
throw APIError.invalidResponse
}
return try JSONDecoder().decode(T.self, from: data)
}
}Shared Data Store (App Groups)
final class SharedDataStore {
static let shared = SharedDataStore()
private let defaults: UserDefaults
init() {
defaults = UserDefaults(suiteName: "group.com.company.appname")!
}
var usageData: UsageData? {
get {
guard let data = defaults.data(forKey: "usageData") else { return nil }
return try? JSONDecoder().decode(UsageData.self, from: data)
}
set {
let data = try? JSONEncoder().encode(newValue)
defaults.set(data, forKey: "usageData")
}
}
}File Naming Conventions
- Views:
*View.swift(e.g.,SettingsView.swift) - Models: Descriptive nouns (e.g.,
UsageMetrics.swift) - Services:
*Manager.swiftor*Service.swift - Extensions:
Type+Extension.swift - Protocols:
*Protocol.swiftor*able.swift
Testing
- Use XCTest for unit tests
- Test business logic in Services
- Use
@testable importfor internal access - Mock network with URLProtocol
- Snapshot test SwiftUI views with swift-snapshot-testing
Build Configuration
Debug vs Release
- Use
#if DEBUGfor debug-only code - Configure schemes for different environments
- Use
.xcconfigfiles for build settings - Keep secrets out of source (use Keychain or secure config)
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.

