用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/a5c-ai/babysitter --skill swift-swiftui-development命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | Swift/SwiftUI Development |
| description | Expert skill for native iOS development with Swift and SwiftUI |
| version | 1.0.0 |
| category | Native iOS Development |
| slug | swift-swiftui |
| status | active |
| graph | {"domains":["domain:mobile"],"specializations":["specialization:mobile-development"],"skillAreas":["skill-area:ios-native","skill-area:mobile-state-management"],"roles":["role:mobile-engineer"],"workflows":["workflow:feature-development","workflow:release-management"],"topics":["topic:accessibility"]} |
This skill provides expert capabilities for native iOS development using Swift and SwiftUI. It enables generation of SwiftUI views, implementation of state management patterns, Combine reactive programming, and comprehensive Xcode build operations.
bash - Execute xcodebuild, swift, and xcrun commandsread - Analyze Swift source files and Xcode project configurationswrite - Generate and modify Swift code and SwiftUI viewsedit - Update existing Swift code and configurationsglob - Search for Swift files and Xcode project filesgrep - Search for patterns in Swift codebaseView Generation
State Management
Navigation
Reactive Patterns
Data Flow
Build Operations
Code Signing
XCTest Framework
Performance Testing
This skill integrates with the following processes:
swiftui-app-development.js - SwiftUI app architectureios-core-data-implementation.js - Core Data integrationios-push-notifications.js - APNs configurationios-appstore-submission.js - App Store submissionmobile-accessibility-implementation.js - Accessibility featuresMyApp/
├── MyApp/
│ ├── App/
│ │ ├── MyAppApp.swift
│ │ └── ContentView.swift
│ ├── Features/
│ │ └── FeatureName/
│ │ ├── Views/
│ │ ├── ViewModels/
│ │ └── Models/
│ ├── Core/
│ │ ├── Extensions/
│ │ ├── Utilities/
│ │ └── Services/
│ ├── Resources/
│ │ └── Assets.xcassets
│ └── Info.plist
├── MyAppTests/
├── MyAppUITests/
└── MyApp.xcodeproj
// MyAppApp.swift
import SwiftUI
@main
struct MyAppApp: App {
@StateObject private var appState = AppState()
var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(appState)
}
}
}
// Features/Home/Views/HomeView.swift
import SwiftUI
struct HomeView: View {
@StateObject private var viewModel = HomeViewModel()
@State private var searchText = ""
var body: some View {
NavigationStack {
List {
ForEach(viewModel.filteredItems) { item in
NavigationLink(value: item) {
ItemRowView(item: item)
}
}
}
.navigationTitle("Home")
.searchable(text: $searchText)
.onChange(of: searchText) { _, newValue in
viewModel.search(query: newValue)
}
.navigationDestination(for: Item.self) { item in
ItemDetailView(item: item)
}
.refreshable {
await viewModel.refresh()
}
}
}
}
#Preview {
HomeView()
}
// Features/Home/ViewModels/HomeViewModel.swift
import Foundation
import Combine
@MainActor
final class HomeViewModel: ObservableObject {
@Published private(set) var items: [Item] = []
@Published private(set) var filteredItems: [Item] = []
@Published private(set) var isLoading = false
@Published private(set) var error: Error?
private let itemService: ItemServiceProtocol
private var cancellables = Set<AnyCancellable>()
init(itemService: ItemServiceProtocol = ItemService()) {
self.itemService = itemService
setupBindings()
Task { await loadItems() }
}
private func setupBindings() {
$items
.assign(to: &$filteredItems)
}
func () {
isLoading
error
{
items itemService.fetchItems()
} {
.error error
}
isLoading
}
(: ) {
query.isEmpty {
filteredItems items
} {
filteredItems items.filter { .title.localizedCaseInsensitiveContains(query) }
}
}
() {
loadItems()
}
}
// Core/ViewModifiers/CardStyle.swift
import SwiftUI
struct CardStyle: ViewModifier {
var cornerRadius: CGFloat = 12
var shadowRadius: CGFloat = 4
func body(content: Content) -> some View {
content
.background(Color(.systemBackground))
.cornerRadius(cornerRadius)
.shadow(color: .black.opacity(0.1), radius: shadowRadius, x: 0, y: 2)
}
}
extension View {
func cardStyle(cornerRadius: CGFloat = 12, shadowRadius: CGFloat = 4) -> some View {
modifier(CardStyle(cornerRadius: cornerRadius, shadowRadius: shadowRadius))
}
}
// App/Router.swift
import SwiftUI
enum Route: Hashable {
case home
case detail(id: String)
case settings
case profile(userId: String)
}
final class Router: ObservableObject {
@Published var path = NavigationPath()
func navigate(to route: Route) {
path.append(route)
}
func navigateBack() {
path.removeLast()
}
func navigateToRoot() {
path.removeLast(path.count)
}
func handle(url: URL) -> Bool {
guard let components = URLComponents(url: url, resolvingAgainstBaseURL: true),
let host = components.host else {
return false
}
switch host {
case "detail":
if let id = components.queryItems?.first(where: { .name }).value {
navigate(to: .detail(id: id))
}
:
userId components.queryItems.first(where: { .name }).value {
navigate(to: .profile(userId: userId))
}
:
}
}
}
# Build for simulator
xcodebuild -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15 Pro' build
# Build for device
xcodebuild -scheme MyApp -destination 'generic/platform=iOS' build
# Archive for distribution
xcodebuild -scheme MyApp -archivePath ./build/MyApp.xcarchive archive
# Export IPA
xcodebuild -exportArchive -archivePath ./build/MyApp.xcarchive -exportPath ./build -exportOptionsPlist ExportOptions.plist
# Run tests
xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15 Pro'
Xcode build cache issues
rm -rf ~/Library/Developer/Xcode/DerivedData
Code signing issues
security find-identity -v -p codesigning
Swift Package resolution
swift package resolve
# Or in Xcode: File > Packages > Reset Package Caches
Simulator issues
xcrun simctl erase all
ios-persistence - Core Data and Realm integrationpush-notifications - APNs configurationmobile-security - iOS security implementationapp-store-connect - App Store submission