Back to list
fotescodev

swiftui-components

by fotescodev

⌚ Claude Watch The first wearable interface for AI-assisted coding. Approve code changes from your wrist. No phone. No laptop. Just tap.

0🍴 0📅 Jan 24, 2026

SKILL.md


name: swiftui-components description: SwiftUI component expert for building reusable views, custom modifiers, and view compositions. Use when creating new SwiftUI views, refactoring UI code, or building watchOS-specific interfaces. allowed-tools: Read, Write, Edit, Grep, Glob

SwiftUI Components Expert

Instructions

When building SwiftUI components:

  1. Analyze the required component functionality
  2. Check existing components for reuse opportunities
  3. Follow watchOS design guidelines
  4. Ensure accessibility support
  5. Add appropriate previews

watchOS SwiftUI Patterns

Screen Size Considerations

  • Apple Watch screens are small (40-49mm)
  • Use vertical scrolling sparingly
  • Prefer single-tap interactions
  • Keep text concise

Common Patterns

Action Button

struct ActionButton: View {
    let title: String
    let action: () -> Void

    var body: some View {
        Button(action: action) {
            Text(title)
                .frame(maxWidth: .infinity)
        }
        .buttonStyle(.borderedProminent)
    }
}

Status Card

struct StatusCard: View {
    let icon: String
    let title: String
    let value: String

    var body: some View {
        HStack {
            Image(systemName: icon)
                .foregroundStyle(.secondary)
            VStack(alignment: .leading) {
                Text(title)
                    .font(.caption2)
                    .foregroundStyle(.secondary)
                Text(value)
                    .font(.headline)
            }
            Spacer()
        }
        .padding(.vertical, 4)
    }
}

State Management

// Use @Observable for view models (watchOS 10+)
@Observable
final class FeatureViewModel {
    var items: [Item] = []
    var isLoading = false

    func loadItems() async {
        isLoading = true
        defer { isLoading = false }
        // Load items...
    }
}

Haptic Feedback

// Add haptics for important interactions
WKInterfaceDevice.current().play(.success)
WKInterfaceDevice.current().play(.failure)
WKInterfaceDevice.current().play(.notification)

Best Practices

  • Extract reusable components when used 2+ times
  • Use SF Symbols for icons
  • Support Dynamic Type
  • Test on multiple watch sizes
  • Keep view body under 100 lines

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon