swiftui-expert-skill
Fungsinya
Agent ini membantu menulis, meninjau, dan memperbaiki kode SwiftUI untuk aplikasi iPhone atau Mac. Agent ini bisa mengoptimalkan performa, memperbaiki bug, dan memastikan kode mengikuti praktik terbaik.
Kapan dipakai
- βSaat membuat layar atau fitur baru di SwiftUI.
- βSaat kode SwiftUI yang sudah ada perlu dioptimalkan atau diperbaiki.
- βUntuk memastikan kode SwiftUI tetap mutakhir dan bebas dari error.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/swiftui-expert-skill/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTolong tinjau kode SwiftUI ini dan optimalkan performanya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent ini menganalisis kode SwiftUI Anda, membandingkannya dengan praktik terbaik dan API terbaru, lalu memberikan saran atau langsung menerapkan perbaikan agar aplikasi Anda lebih cepat dan lebih efisien.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
SwiftUI Expert Skill
When to Use
Use when writing, reviewing, or refactoring SwiftUI code for iOS or macOS, including state management and @Observable data flow, view composition and invalidation/performance, lists and ForEach identity, environment usage, localization, animations, Liquid Glass adoption, migrating...
Operating Rules
- Consult
references/latest-apis.mdat the start of every task to avoid deprecated APIs - Prefer native SwiftUI APIs over UIKit/AppKit bridging unless bridging is necessary
- Focus on correctness and performance; do not enforce specific architectures (MVVM, VIPER, etc.)
- Encourage separating business logic from views for testability without mandating how
- Follow Apple's Human Interface Guidelines and API design patterns
- Only adopt Liquid Glass when explicitly requested by the user (see
references/liquid-glass.md) - Present performance optimizations as suggestions, not requirements
- Use
#availablegating with sensible fallbacks for version-specific APIs
Task Workflow
Review existing SwiftUI code
- Read the code under review and identify which topics apply
- Flag deprecated APIs (compare against
references/latest-apis.md) - Run the Topic Router below for each relevant topic
- Validate
#availablegating and fallback paths for iOS 26+ features
Improve existing SwiftUI code
- Audit current implementation against the Topic Router topics
- Replace deprecated APIs with modern equivalents from
references/latest-apis.md - Refactor hot paths to reduce unnecessary state updates
- Extract complex view bodies into separate subviews
- Suggest image downsampling when
UIImage(data:)is encountered (optional optimization, seereferences/image-optimization.md)
Implement new SwiftUI feature
- Design data flow first: identify owned vs injected state
- Structure views for optimal diffing (extract subviews early)
- Apply correct animation patterns (implicit vs explicit, transitions)
- Use
Buttonfor all tappable elements; add accessibility grouping and labels - Gate version-specific APIs with
#availableand provide fallbacks
Record a new Instruments trace
Trigger when the user asks to "record a trace", "profile the app", "capture a session", etc. Full reference: references/trace-recording.md.
- Confirm target β attach to a running app, launch an app, or record all processes? If the user didn't say, ask. List connected devices when useful:
python3 "${SKILL_DIR}/scripts/record_trace.py" --list-devices - Pick a template based on target kind β the
SwiftUItemplate populates the SwiftUI lane on any real device: a physical iOS/iPadOS device or the host Mac. The only exception is the iOS Simulator, where the SwiftUI lane comes back empty β switch to--template "Time Profiler"in that case (still gives Time Profiler + Hangs + Animation Hitches). Always check--list-devices:simulatorskind βTime Profiler;deviceskind (real devices and the host Mac) β defaultSwiftUI. Full decision table inreferences/trace-recording.md. - Start the recording. For agent-driven sessions where the user says "I'll tell you when I'm done", start in the background and use a stop-file:
For interactive sessions, just tell the user to press Ctrl+C when done.python3 "${SKILL_DIR}/scripts/record_trace.py" \ --device "<name|udid>" --attach "<AppName>" \ --stop-file /tmp/stop-trace --output ~/Desktop/session.trace - Signal stop β when the user says they've finished exercising the app,
touch /tmp/stop-trace. The script cleanly SIGINTs xctrace and waits up to 60s for finalisation. - Analyse the resulting trace (flow into the "Trace-driven improvement" workflow below).
Trace-driven improvement (Instruments .trace provided)
Trigger whenever the user's request references a .trace file. A target SwiftUI source file is optional β if given, cite specific lines; if not, recommend where to look based on view names and symbols the trace already reveals.
Full reference: references/trace-analysis.md. Summary of the composition pattern:
- Scope the analysis. Ask yourself: does the user want the whole trace, or a slice?
- "focus on X / after X / between X and Y / during X" β resolve to a window first (see step 2).
- No scoping cue β analyse the whole trace.
- Resolve a window (only if the user scoped). The parser exposes two discovery modes:
β¦
Pertanyaan umum
Apa itu SwiftUI?
SwiftUI adalah cara modern dan deklaratif untuk membangun antarmuka pengguna untuk semua perangkat Apple menggunakan bahasa pemrograman Swift.
Apa maksud 'optimalkan performa'?
Artinya membuat aplikasi berjalan lebih cepat dan menggunakan sumber daya yang lebih sedikit (seperti baterai dan memori) dengan memastikan kode dijalankan secara seefisien mungkin.
Apa itu 'API yang deprecated'?
Ini adalah bagian dari kode yang sudah digantikan oleh versi yang lebih baru dan lebih baik. Menggunakan API yang deprecated bisa menimbulkan masalah atau ketidakcocokan.
Detail
Deskripsi asli dari pembuat
Write, review, and refactor SwiftUI for iOS or macOS, covering data flow, view composition, performance, identity, environment, localization, animation, API migration, and Instruments traces.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #5911
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
00-andruia-consultant
48kMembantu agent Anda memulai atau meningkatkan proyek AI. Agent menganalisis kode, menyarankan tools, dan membuat rencana aksi dalam bahasa Spanyol.
007
48kMemungkinkan agent Anda melakukan audit keamanan dan threat modeling. Berguna untuk melindungi proyek dari serangan dan celah keamanan.
10-andruia-skill-smith
48kMembantu agent Anda membuat atau meningkatkan tools AI. Agent mendefinisikan cara kerja tools, menulis dokumentasi, dan memvalidasi strukturnya.
20-andruia-niche-intelligence
48kMemungkinkan agent Anda membuat ringkasan industri tertentu. Berguna untuk memahami konteks, aturan, pola penggunaan, dan risiko proyek dengan sumber terpercaya.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.