Communitygithub.com

ComeOnOliver/skillshub

編寫、審查或改進 SwiftUI 程式碼,遵循狀態管理、檢視組合、效能、macOS 特定 API 以及 iOS 26+ Liquid Glass 採用等最佳實務。在建立新 SwiftUI 功能、重構現有檢視、審查程式碼品質或採用現代 SwiftUI 模式時使用。

skillshub 是什麼?

此技能專為使用 SwiftUI 的開發人員設計,提供在狀態管理、檢視組合、效能最佳化及現代 API 採用等方面的指導。它會優先查閱 `references/latest-apis.md` 以確保不使用已棄用的 API,並鼓勵使用原生的 SwiftUI API,除非必要才橋接 UIKit 或 AppKit。技能涵蓋任務工作流程,包括審查現有程式碼、改進實作與實作新功能,並透過主題路由器引導開發人員參考特定參考文件。它還包含正確性檢查清單,以確保遵循 SwiftUI 的最佳實務,例如正確使用 `@State` 與 `@Binding`、`ForEach` 的穩定識別、以及 iOS 26+ 功能的版本保護。此外,技能支援多個平台,包括 macOS 與 iOS 的特定模式,並在需要時提供 Liquid Glass 效果的最佳實務。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/AvdLee/SwiftUI-Agent-Skill/swiftui-expert-skill

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

SwiftUI 專家技能

操作規則

  • 在每次任務開始時查閱 references/latest-apis.md,以避免使用已棄用的 API
  • 優先使用原生 SwiftUI API,而非 UIKit/AppKit 橋接,除非橋接是必要的
  • 專注於正確性與效能;不要強制特定架構(MVVM、VIPER 等)
  • 鼓勵將商業邏輯與檢視分離以提升可測試性,但不強制規定方式
  • 遵循 Apple 的人機介面指南與 API 設計模式
  • 僅在使用者明確要求時才採用 Liquid Glass(請參閱 references/liquid-glass.md)
  • 將效能最佳化建議作為建議,而非要求
  • 使用 #available 搭配合理的後備方案來處理版本特定 API

任務工作流程

審查現有的 SwiftUI 程式碼

  • 閱讀待審查的程式碼,並識別應用的主題
  • 標記已棄用的 API(與 references/latest-apis.md 比對)
  • 為每個相關主題執行下方的主題路由器
  • 驗證 iOS 26+ 功能的 #available 保護與後備路徑

改進現有的 SwiftUI 程式碼

  • 根據主題路由器的主題稽核現有實作
  • 將已棄用的 API 替換為 references/latest-apis.md 中的現代等效項
  • 重構熱點路徑以減少不必要的狀態更新
  • 將複雜的檢視主體提取為獨立的子檢視
  • 建議在遇到 UIImage(data:) 時進行圖片降採樣(可選最佳化,請參閱 references/image-optimization.md)

實作新的 SwiftUI 功能

  • 首先設計資料流:識別擁有的狀態與注入的狀態
  • 建構最適合差異比較的檢視(及早提取子檢視)
  • 套用正確的動畫模式(隱含與明確動畫、轉場)
  • 對所有可點擊元素使用 Button;加入無障礙分組與標籤
  • 使用 #available 保護版本特定 API,並提供後備方案

主題路由器

針對與目前任務相關的每個主題,查閱對應的參考檔案:

主題參考資料
狀態管理references/state-management.md
檢視組合references/view-structure.md
效能references/performance-patterns.md
列表與 ForEachreferences/list-patterns.md
版面配置references/layout-best-practices.md
Sheet 與導航references/sheet-navigation-patterns.md
ScrollViewreferences/scroll-patterns.md
動畫(基礎)references/animation-basics.md
動畫(轉場)references/animation-transitions.md
動畫(進階)references/animation-advanced.md
無障礙references/accessibility-patterns.md
Swift Chartsreferences/charts.md
圖表無障礙references/charts-accessibility.md
圖片最佳化references/image-optimization.md
Liquid Glass(iOS 26+)references/liquid-glass.md
macOS 場景references/macos-scenes.md
macOS 視窗樣式references/macos-window-styling.md
macOS 檢視references/macos-views.md
已棄用 API 查詢references/latest-apis.md

正確性檢查清單

這些是嚴格規則——違反即視為錯誤:

  • @State 屬性是 private 的
  • 僅在子檢視修改父檢視狀態時使用 @Binding
  • 傳入的值絕不宣告為 @State 或 @StateObject(它們會忽略更新)
  • @StateObject 用於檢視擁有的物件;@ObservedObject 用於注入的物件
  • iOS 17+:@State 搭配 @Observable;@Bindable 用於需要繫結的注入 observable
  • ForEach 使用穩定的識別(動態內容絕不使用 .indices)
  • 每個 ForEach 元素的檢視數量固定
  • .animation(_:value:) 一定包含 value 參數
  • iOS 26+ API 使用 #available 保護並提供後備方案
  • 使用圖表類型的檔案中加入 import Charts

參考資料

  • references/latest-apis.md -- 每個任務都先讀取此檔案。 從已棄用到現代的 API 轉換(iOS 15+ 到 iOS 26+)
  • references/state-management.md -- 屬性包裝器、資料流、@Observable 遷移
  • references/view-structure.md -- 檢視提取、容器模式、@ViewBuilder
  • references/performance-patterns.md -- 熱點路徑最佳化、更新控制、_logChanges()
  • references/list-patterns.md -- ForEach 識別、Table(iOS 16+)、行內篩選陷阱
  • references/layout-best-practices.md -- 版面配置模式、GeometryReader 替代方案
  • references/accessibility-patterns.md -- VoiceOver、Dynamic Type、分組、特質
  • references/animation-basics.md -- 隱含/明確動畫、時序、效能
  • references/animation-transitions.md -- 檢視轉場、matchedGeometryEffect、Animatable
  • references/animation-advanced.md -- 階段/關鍵影格動畫(iOS 17+)、@Animatable 巨集(iOS 26+)
  • references/charts.md -- Swift Charts 標記、座標軸、選取、樣式、Chart3D(iOS 26+)
  • references/charts-accessibility.md -- Charts VoiceOver、Audio Graph、後備策略
  • references/sheet-navigation-patterns.md -- Sheet、NavigationSplitView、Inspector
  • references/scroll-patterns.md -- ScrollViewReader、程式化滾動
  • references/image-optimization.md -- AsyncImage、降採樣、快取
  • references/liquid-glass.md -- iOS 26+ Liquid Glass 效果與後備模式
  • references/macos-scenes.md -- Settings、MenuBarExtra、WindowGroup、多視窗
  • references/macos-window-styling.md -- 工具列樣式、視窗大小、Commands
  • references/macos-views.md -- HSplitView、Table、PasteButton、AppKit 互通

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相關技能