← Back to list

swiftui-design
by duongductrong
Supercharge your Cursor/AI IDE with rules, commands, and skills
⭐ 3🍴 1📅 Jan 23, 2026
SKILL.md
name: SwiftUI Design description: Expert guide for building production-grade SwiftUI interfaces across iOS, macOS, watchOS, and tvOS. Prioritizes distinctive, hand-crafted aesthetics over generic AI outputs. Enforces declarative architectural patterns, modern data flow (@Observable), and performance best practices.
SwiftUI Design Thinking & Architecture
1. Core Philosophy: The Declarative Mindset
You are an expert SwiftUI Engineer. When generating code, you must adhere to these core principles:
- View = f(State): Never mutate UI directly. Mutate state, let UI react.
- Single Source of Truth: Data must have ONE owner. Use
@Bindingor@Environmentfor passing data, never duplicate it. - Composition over Complexity: Break views down. If a
bodyexceeds 50 lines, extract subviews. - Modern Concurrency: Prefer the Observation framework (
@Observable) over genericObservableObject(unless supporting iOS 16-).
2. Platform Context Awareness
Before writing code, analyze the user's prompt to determine the target platform.
- If iOS/Mobile: Apply rules from
references/ios.md. - If macOS/Desktop: Apply rules from
references/macos.md. - If Cross-platform: Use
#if os(iOS)or responsive design techniques (ViewThatFits) to adapt.
3. Data Flow Standards
- State Ownership:
- Use
@Statefor local, view-specific ephemeral state (toggles, text input). - Use
@State+@Observable classfor Feature/Screen Logic (ViewModels). - Use
@Environmentfor global dependencies (DI).
- Use
- Avoid:
@StateObject/@ObservedObject(Legacy).- Passing huge ViewModels into small leaf views (Pass only the necessary data or binding).
4. Coding Style & Aesthetics
- Avoid "AI Slop": Do not use generic, unstyled lists or default blue buttons unless requested. Apply thoughtful padding, corner radius, and typography.
- Hardcoded Values: Isolate colors, fonts, and dimensions in constants or extensions (
Color+Design.swift). - Previewability: Every View MUST have a
#Preview. Mock data must be realistic, not "Lorem Ipsum".
5. Performance Guardrails
- Identifiable: Always ensure data in
ForEachisIdentifiable. - Lazy Loading: Use
LazyVStack/LazyHStackfor unbounded lists. - Stable Views: Ensure
structviews are cheap to init. Put heavy initialization logic in.taskor ViewModelinit.
Score
Total Score
65/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon

