重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
ios-navigation by pproenca/dot-skills
npx skills add https://github.com/pproenca/dot-skills --skill ios-navigation基于诊所模块化架构,为 SwiftUI 应用提供一套有明确主张的导航规范。专注于协调器 + 路由外壳的连线、功能隔离以及稳健的推送/表单/深度链接流程。
@Equatable 宏,永远不要使用 AnyView@Observable,永远不要使用 ObservableObject / @PublishedNavigationPath;路由外壳拥有 .navigationDestination 映射@State 布尔值来控制表单广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
本技能中的所有指导均假设采用诊所模块化 MVVM-C 架构:
Domain 和 DesignSystem(绝不导入 Data,也绝不导入同级功能模块)DependencyContainer、具体协调器以及路由外壳连线Domain 保持纯 Swift,定义模型以及仓库、*Coordinating、ErrorRouting 和 AppError 契约Data 拥有 SwiftData/网络/同步/重试/后台 I/O,并实现 Domain 协议在以下情况下参考这些指南:
| 优先级 | 类别 | 影响 | 前缀 |
|---|---|---|---|
| 1 | 导航架构 | 关键 | arch- |
| 2 | 导航反模式 | 关键 | anti- |
| 3 | 过渡与动画 | 高 | anim- |
| 4 | 模态呈现 | 高 | modal- |
| 5 | 流程编排 | 高 | flow- |
| 6 | 导航性能 | 中高 | perf- |
| 7 | 导航可访问性 | 中 | ally- |
| 8 | 状态与恢复 | 中 | state- |
arch-navigation-stack - 使用 NavigationStack 替代已弃用的 NavigationViewarch-value-based-links - 使用基于值的 NavigationLink 替代目标闭包arch-destination-registration - 在堆栈根节点注册 navigationDestinationarch-destination-item - 使用 navigationDestination(item:) 进行基于可选值的导航(iOS 26 / Swift 6.2)arch-route-enum - 将路由定义为 Hashable 枚举arch-split-view - 使用 NavigationSplitView 实现多列布局arch-coordinator - 将导航逻辑提取到 Observable 协调器中arch-observable-environment - 使用 @Environment 配合 @Observable 和 @Bindable 来共享状态arch-deep-linking - 通过追加到 NavigationPath 来处理深度链接arch-navigation-path - 使用 NavigationPath 进行异构类型擦除导航arch-equatable-views - 对每个导航视图应用 @Equatable 宏arch-observable-only - 仅使用 @Observable — 永远不要使用 ObservableObject 或 @Publishedarch-no-anyview - 在导航中永远不要使用 AnyView — 使用 @ViewBuilder 或泛型arch-coordinator-modals - 通过协调器呈现所有模态视图 — 永远不要使用内联的 @Stateanti-mixed-link-styles - 避免混合使用 NavigationLink(destination:) 和 NavigationLink(value:)anti-scattered-destinations - 避免将 navigationDestination 分散在各个视图中anti-shared-stack - 避免跨标签页共享 NavigationStackanti-hidden-back-button - 避免隐藏返回按钮而不保留滑动手势anti-navigation-in-init - 避免在视图初始化器中执行繁重工作anti-hamburger-menu - 避免使用汉堡菜单导航anti-programmatic-tab-switch - 避免以编程方式更改标签页选择anim-zoom-transition - 使用缩放导航过渡实现英雄动画(iOS 18+)anim-matched-geometry-same-view - 仅在同一个视图层次结构中使用 matchedGeometryEffectanim-spring-config - 使用现代弹簧动画语法(iOS 26 / Swift 6.2)anim-gesture-driven - 使用交互式弹簧动画实现手势驱动的过渡anim-transition-source-styling - 使用形状和背景样式化过渡源anim-reduce-motion-transitions - 尊重减少动画设置,适配所有导航动画anim-scroll-driven - 使用 onScrollGeometryChange 实现滚动驱动的过渡(iOS 18+)modal-sheet-vs-push - 使用推送进行深入导航,使用表单呈现补充内容modal-detents - 使用呈现锚点实现上下文相关的表单尺寸调整modal-fullscreen-cover - 仅对沉浸式独立体验使用 fullScreenCovermodal-sheet-placement - 将 .sheet 放置在容器视图上,而不是 NavigationLink 上modal-interactive-dismiss - 使用 interactiveDismissDisabled 保护未保存的更改modal-nested-navigation - 在模态视图中使用独立的 NavigationStackflow-tab-independence - 为每个标签页提供独立的 NavigationStackflow-multi-step - 使用带有路由数组的 NavigationStack 处理多步骤流程flow-sidebar-navigation - 使用带有选择绑定的 NavigationSplitView 实现侧边栏flow-tab-sidebar-adaptive - 使用 sidebarAdaptable TabView 实现 iPad 标签页到侧边栏的适配(iOS 18+)flow-pop-to-root - 通过清空 NavigationPath 实现返回根视图flow-screen-independence - 保持屏幕独立于父级导航上下文perf-lazy-destinations - 使用基于值的 NavigationLink 实现延迟目标视图构建perf-task-modifier - 使用 .task 修饰符在导航时进行异步数据加载perf-state-object-ownership - 使用 @State 拥有 @Observable 状态,并将其作为普通属性传递perf-avoid-body-side-effects - 避免在视图 body 中产生副作用ally-rotor-headers - 为 VoiceOver 转子标记导航区域标题ally-focus-after-navigation - 在程序化导航事件后管理焦点ally-group-navigation-elements - 将相关的导航元素分组以减少滑动次数ally-hide-decorative-navigation - 将装饰性导航元素对 VoiceOver 隐藏ally-keyboard-focus - 在表单中使用 @FocusState 实现键盘导航state-codable-routes - 使路由枚举遵循 Codable 协议以实现导航持久化state-scene-storage - 使用 SceneStorage 实现每个场景的导航持久化state-tab-persistence - 使用 SceneStorage 持久化选中的标签页state-deep-link-urls - 将深度链接 URL 解析为路由枚举state-avoid-app-level-path - 避免在 App 级别定义 NavigationPath阅读单独的参考文件以获取详细解释和代码示例:
| 文件 | 描述 |
|---|---|
| references/_sections.md | 类别定义和排序 |
| assets/templates/_template.md | 新规则模板 |
| metadata.json | 版本和参考信息 |
每周安装次数
58
代码仓库
GitHub 星标数
97
首次出现
2026年2月13日
安全审计
已安装于
codex54
github-copilot53
gemini-cli53
kimi-cli52
opencode52
amp51
Opinionated navigation enforcement for SwiftUI apps using the clinic modular architecture. Focus on coordinator + route shell wiring, feature isolation, and resilient push/sheet/deep-link flows.
@Equatable macro on every navigation view, AnyView never@Observable everywhere, ObservableObject / @Published neverNavigationPath; route shells own .navigationDestination mappings@State booleans for sheets neverAll guidance in this skill assumes the clinic modular MVVM-C architecture:
Domain + DesignSystem only (never Data, never sibling features)DependencyContainer, concrete coordinators, and Route Shell wiringDomain stays pure Swift and defines models plus repository, *Coordinating, ErrorRouting, and AppError contractsData owns SwiftData/network/sync/retry/background I/O and implements Domain protocolsReference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Navigation Architecture | CRITICAL | arch- |
| 2 | Navigation Anti-Patterns | CRITICAL | anti- |
| 3 | Transition & Animation | HIGH | anim- | | 4 | Modal Presentation | HIGH | modal- | | 5 | Flow Orchestration | HIGH | flow- | | 6 | Navigation Performance | MEDIUM-HIGH | perf- | | 7 | Navigation Accessibility | MEDIUM | ally- | | 8 | State & Restoration | MEDIUM | state- |
arch-navigation-stack - Use NavigationStack over deprecated NavigationViewarch-value-based-links - Use value-based NavigationLink over destination closuresarch-destination-registration - Register navigationDestination at stack rootarch-destination-item - Use navigationDestination(item:) for optional-based navigation (iOS 26 / Swift 6.2)arch-route-enum - Define routes as Hashable enumsanti-mixed-link-styles - Avoid mixing NavigationLink(destination:) with NavigationLink(value:)anti-scattered-destinations - Avoid scattering navigationDestination across viewsanti-shared-stack - Avoid sharing NavigationStack across tabsanti-hidden-back-button - Avoid hiding back button without preserving swipe gestureanti-navigation-in-init - Avoid heavy work in view initializersanim-zoom-transition - Use zoom navigation transition for hero animations (iOS 18+)anim-matched-geometry-same-view - Use matchedGeometryEffect only within same view hierarchyanim-spring-config - Use modern spring animation syntax (iOS 26 / Swift 6.2)anim-gesture-driven - Use interactive spring animations for gesture-driven transitionsanim-transition-source-styling - Style transition sources with shape and backgroundmodal-sheet-vs-push - Use push for drill-down, sheet for supplementary contentmodal-detents - Use presentation detents for contextual sheet sizingmodal-fullscreen-cover - Use fullScreenCover only for immersive standalone experiencesmodal-sheet-placement - Place .sheet on container view, not on NavigationLinkmodal-interactive-dismiss - Guard unsaved changes with interactiveDismissDisabledflow-tab-independence - Give each tab its own NavigationStackflow-multi-step - Use NavigationStack with route array for multi-step flowsflow-sidebar-navigation - Use NavigationSplitView with selection binding for sidebarflow-tab-sidebar-adaptive - Use sidebarAdaptable TabView for iPad tab-to-sidebar (iOS 18+)flow-pop-to-root - Implement pop-to-root by clearing NavigationPathperf-lazy-destinations - Use value-based NavigationLink for lazy destination constructionperf-task-modifier - Use .task for async data loading on navigationperf-state-object-ownership - Own @Observable state with @State, pass as plain propertyperf-avoid-body-side-effects - Avoid side effects in view bodyally-rotor-headers - Mark navigation section headers for VoiceOver rotorally-focus-after-navigation - Manage focus after programmatic navigation eventsally-group-navigation-elements - Group related navigation elements to reduce swipe countally-hide-decorative-navigation - Hide decorative navigation elements from VoiceOverally-keyboard-focus - Use @FocusState for keyboard navigation in formsstate-codable-routes - Make route enums Codable for navigation persistencestate-scene-storage - Use SceneStorage for per-scene navigation persistencestate-tab-persistence - Persist selected tab with SceneStoragestate-deep-link-urls - Parse deep link URLs into route enumsstate-avoid-app-level-path - Avoid defining NavigationPath at App levelRead individual reference files for detailed explanations and code examples:
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
Weekly Installs
58
Repository
GitHub Stars
97
First Seen
Feb 13, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex54
github-copilot53
gemini-cli53
kimi-cli52
opencode52
amp51
Laravel架构模式指南:生产级开发模式与最佳实践
1,400 周安装
3D网页开发指南:Three.js、React Three Fiber与WebGL性能优化实战
1,300 周安装
Sanity内容建模最佳实践:结构化内容设计原则与无头CMS指南
1,400 周安装
Chrome CDP 命令行工具:轻量级浏览器自动化,支持截图、执行JS、无障碍快照
1,300 周安装
template-skill 技能模板:快速构建AI技能,含触发词、输入输出与工作流
1,300 周安装
TanStack Start 全栈开发:基于 Cloudflare 的 React 19 + D1 数据库应用构建指南
1,300 周安装
Doublecheck AI 内容验证工具 - GitHub Copilot 三层事实核查流程,自动识别幻觉风险
1,400 周安装
arch-split-viewarch-coordinator - Extract navigation logic into Observable coordinatorarch-observable-environment - Use @Environment with @Observable and @Bindable for shared statearch-deep-linking - Handle deep links by appending to NavigationPatharch-navigation-path - Use NavigationPath for heterogeneous type-erased navigationarch-equatable-views - Apply @Equatable macro to every navigation viewarch-observable-only - Use @Observable only — never ObservableObject or @Publishedarch-no-anyview - Never use AnyView in navigation — use @ViewBuilder or genericsarch-coordinator-modals - Present all modals via coordinator — never inline @Stateanti-hamburger-menuanti-programmatic-tab-switch - Avoid programmatic tab selection changesanim-reduce-motion-transitionsanim-scroll-driven - Use onScrollGeometryChange for scroll-driven transitions (iOS 18+)modal-nested-navigationflow-screen-independence