ios-dev
iOS development skill for Swift, SwiftUI, Live Activities, WidgetKit, and XCTest. Use when implementing iOS features.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
iOS development skill for Swift, SwiftUI, Live Activities, WidgetKit, and XCTest. Use when implementing iOS features.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Orchestrates the async development workflow (design → develop → review → QA). Handles phase transitions when triggered by workflow-continue hook.
Autonomous development workflow that proactively asks questions, verifies implementation with tools, and auto-fixes linter errors. Use when implementing features to ensure quality through self-driven verification.
Backend development skill for Cloudflare Workers, D1 database, and REST API. Use when implementing API features.
Frontend development skill for React, Next.js, Tailwind CSS, and TypeScript. Use when implementing web frontend features.
Core orchestration skill for the Claude Organization. Manages async sub-agents, worktrees, daily logs, and context handoff. This skill defines how the main Claude Code instance operates as Secretary to the CEO.
This skill should be used when the user asks about "refactoring", "code smells", "extract method", "extract class", "rename refactoring", "move method", or when improving code structure without changing behavior. Provides Martin Fowler's refactoring catalog and code smell detection.
| name | ios-dev |
| description | iOS development skill for Swift, SwiftUI, Live Activities, WidgetKit, and XCTest. Use when implementing iOS features. |
Platform-specific knowledge for iOS development.
| Component | Technology |
|---|---|
| Language | Swift 5.9+ |
| UI Framework | SwiftUI |
| Architecture | MVVM or TCA (follow project) |
| Testing | XCTest, XCUITest |
| Live Activities | ActivityKit |
| Widgets | WidgetKit |
lowerCamelCaseUpperCamelCaselowerCamelCase (not SCREAMING_CASE)// 1. Imports
import SwiftUI
import ActivityKit
// 2. Types (protocol, struct, class, enum)
struct ContentView: View {
// 3. Properties (static, @State, let, var)
// 4. Initializer
// 5. Body / Methods
}
// 6. Extensions
extension ContentView {
// ...
}
// 7. Previews
#Preview {
ContentView()
}
// Prefer small, composable views
struct FeatureView: View {
@StateObject private var viewModel = FeatureViewModel()
var body: some View {
VStack {
HeaderSection(title: viewModel.title)
ContentSection(items: viewModel.items)
}
.task {
await viewModel.load()
}
}
}
// MARK: - for sections# Build
xcodebuild -scheme <Scheme> -destination 'generic/platform=iOS' build
# Test
xcodebuild test \
-scheme <Scheme> \
-destination 'platform=iOS Simulator,name=iPhone 15'
# Clean
xcodebuild clean -scheme <Scheme>
NSSupportsLiveActivities to Info.pliststruct MyActivityAttributes: ActivityAttributes {
public struct ContentState: Codable, Hashable {
var value: String
}
var name: String
}
// Start
let attributes = MyActivityAttributes(name: "Example")
let state = MyActivityAttributes.ContentState(value: "Initial")
let activity = try Activity.request(
attributes: attributes,
content: .init(state: state, staleDate: nil)
)
// Update
await activity.update(
ActivityContent(state: newState, staleDate: nil)
)
// End
await activity.end(nil, dismissalPolicy: .immediate)
// Write (main app)
let defaults = UserDefaults(suiteName: "group.com.example.app")
defaults?.set(value, forKey: "sharedKey")
WidgetCenter.shared.reloadAllTimelines()
// Read (widget)
let defaults = UserDefaults(suiteName: "group.com.example.app")
let value = defaults?.string(forKey: "sharedKey")
final class FeatureTests: XCTestCase {
var sut: FeatureViewModel!
override func setUp() {
super.setUp()
sut = FeatureViewModel()
}
override func tearDown() {
sut = nil
super.tearDown()
}
func test_initialState_isEmpty() {
XCTAssertTrue(sut.items.isEmpty)
}
func test_load_populatesItems() async {
await sut.load()
XCTAssertFalse(sut.items.isEmpty)
}
}
xcodebuild cleanWidgetCenter.shared.reloadAllTimelines()