← Back to list

swiftui-components
by fusengine
Redefining development through cognitive automation and collaborative agent systems.
⭐ 0🍴 0📅 Jan 24, 2026
SKILL.md
name: swiftui-components description: Build production SwiftUI views, custom components, layouts, and view modifiers. Use when creating iOS/macOS UI components, implementing responsive layouts, building custom modifiers, or designing reusable view hierarchies with @ViewBuilder. user-invocable: false
SwiftUI Components & Views
Core Principles
- Small, focused views - Extract subviews at 30+ lines
- Composition over inheritance - Use ViewBuilder and modifiers
- Preview-driven development - Always include #Preview
View Structure Pattern
struct FeatureView: View {
// MARK: - State
@State private var isLoading = false
// MARK: - Environment
@Environment(\.dismiss) private var dismiss
// MARK: - Body
var body: some View {
content
.navigationTitle("Feature")
.toolbar { toolbarContent }
}
// MARK: - Subviews
@ViewBuilder
private var content: some View {
if isLoading {
ProgressView()
} else {
mainContent
}
}
}
Custom Modifiers
struct CardModifier: ViewModifier {
func body(content: Content) -> some View {
content
.padding()
.background(.regularMaterial)
.clipShape(RoundedRectangle(cornerRadius: 12))
.shadow(radius: 4)
}
}
extension View {
func cardStyle() -> some View {
modifier(CardModifier())
}
}
Responsive Layouts
struct AdaptiveGrid: View {
@Environment(\.horizontalSizeClass) var sizeClass
var columns: [GridItem] {
Array(repeating: GridItem(.flexible(), spacing: 16),
count: sizeClass == .compact ? 2 : 4)
}
var body: some View {
LazyVGrid(columns: columns, spacing: 16) {
ForEach(items) { ItemCard(item: $0) }
}
}
}
Best Practices
- Use
@ViewBuilderfor conditional content - Prefer
some Viewreturn type - Extract magic numbers to constants
- Use semantic colors:
.primary,.secondary - Add
.accessibilityLabel()to icons
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon