Communitygithub.com

ComeOnOliver/skillshub

一份高度规范且严格的 SwiftUI iOS 26 / Swift 6.2 动画创作指南,包含 50 条规则,覆盖 8 大类别,按影响程度排列优先级。源自 Airbnb 工程动画模式、Apple WWDC 会议以及 Apple 人机界面指南。要求每个动画视图都使用 @Equatable,所有弹簧/时间值使用动画令牌,布局使用设计系统令牌。

skillshub 是什么?

此技能是一份针对 SwiftUI iOS 26 和 Swift 6.2 应用程序的动画规则集,源自 Airbnb、Apple WWDC 和 HIG 等业界权威。它包含 50 条严格规则,分为 8 个类别,例如弹簧物理、手势连续性和空间转换,并根据影响程度(关键、高、中高)进行优先级排序。该技能与 `swift-ui-architect` 和 `ios-design-system` 等配套技能协同工作,通过强制使用 `@Equatable`、动画令牌和设计系统令牌来确保架构一致性。它专门指导开发者构建流畅、高性能的程序化 SwiftUI 动画,涵盖微交互、编排和内容动画,同时明确指出 Lottie 动画和 UIKit 过渡控件不在其范围之内。使用此技能可以显著提升应用的动画质量和性能。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/pproenca/dot-skills/ios-animations

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

dot-skills — Airbnb iOS SwiftUI 动画最佳实践

一份高度规范且严格的 SwiftUI iOS 26 / Swift 6.2 动画创作指南,包含 50 条规则,覆盖 8 大类别,按影响程度排列优先级。源自 Airbnb 工程动画模式、Apple WWDC 会议以及 Apple 人机界面指南。要求每个动画视图都使用 @Equatable,所有弹簧/时间值使用动画令牌,布局使用设计系统令牌。

强制架构对齐

本技能旨在与 swift-ui-architect 和 ios-design-system 协同工作。所有代码示例均遵循以下不可协商的约束:

  • 每个视图上使用 @Equatable 宏(据 Airbnb 测量,可减少 15% 的滚动卡顿)
  • 对于涉及业务逻辑触发的复杂动画状态,使用 @Observable
  • 对于视图自身拥有的动画状态(如切换布尔值、拖动偏移量),使用 @State
  • 设计系统令牌:Spacing.xs/sm/md/lg,Radius.sm/md/lg — 零硬编码布局数值
  • 动画令牌:Motion.standard/responsive/playful — 零散落的弹簧字面量
  • 语义颜色:.backgroundSurface,.accentPrimary — 视图中不使用原始 Color 字面量
  • 功能动画仅用于展示;数据/网络相关逻辑保留在 Data package 中

范围及与同级技能的关系

本技能是动画层 — 它教授如何构建流畅、高性能的动画。与同级技能配合使用时:

同级技能其专注点本技能专注点
swift-ui-architect架构(模块化 MVVM-C、路由壳、协议边界)动画架构(动画令牌、弹簧选择、编排)
ios-design-system设计系统基础设施(令牌、样式、治理)动画令牌和动画组件模式
ios-higHIG 合规性模式特定于运动的 HIG(减少动画、空间连续性)

超出范围: 设计师创作的矢量动画(请使用 Lottie 处理 After Effects 导出)。复杂的 UIKit 过渡控制器(请参阅 Airbnb 的声明式过渡框架)。本技能仅涵盖程序化 SwiftUI 动画。

诊所架构契约(iOS 26 / Swift 6.2)

本技能的所有指导均假设采用诊所模块化 MVVM-C 架构:

  • Feature 模块仅导入 Domain + DesignSystem(从不导入 Data,也从不导入同级 feature)
  • App target 是汇聚点,拥有 DependencyContainer、具体的协调器和路由壳接线
  • Domain 保持纯 Swift,定义模型、仓库、*Coordinating、ErrorRouting 和 AppError 契约
  • Data 拥有 SwiftData/网络/同步/重试/后台 I/O,并实现 Domain 协议
  • 读/写流程默认采用“过时再验证”读取和乐观排队写入
  • ViewModel 直接调用仓库协议(无需默认的用例/交互器层)

何时应用

在以下情况参考这些指南:

  • 向 SwiftUI 视图或过渡添加动画
  • 构建基于手势的交互(拖拽、滑动、平移)
  • 使用空间过渡连接视图(展开/折叠、导航变形)
  • 设计微交互(按钮按下、切换、加载状态)
  • 使内容变化感觉有物理感(数字滚动、符号替换)
  • 编排多元素动画序列(KeyframeAnimator、PhaseAnimator)
  • 为设计系统定义动画令牌
  • 审查动画代码的性能、可访问性和架构合规性

按优先级划分的规则类别

优先级类别影响前缀规则数
1弹簧物理关键spring-8
2时间与感觉关键feel-6
3手势连续性高gesture-7
4空间过渡高spatial-6
5微交互高micro-6
6编排高orch-5
7工艺与润色高craft-5
8内容动画中-高content-5

快速参考

1. 弹簧物理(关键)

2. 时间与感觉(关键)

3. 手势连续性(高)

4. 空间过渡(高)

5. 微交互(高)

6. 编排(高)

7. 工艺与润色(高)

8. 内容动画(中-高)

使用方法

阅读单独的参考文件以获取详细的解释,其中包含错误/正确的代码示例:

参考文件

文件描述
references/_sections.md类别定义和排序
assets/templates/_template.md新规则模板
metadata.json版本和参考信息

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

相关技能