一键导入
architecture
Load before designing features, adding services, or touching multiple packages. Compact ownership, dependency, and subsystem rules for Ensemble.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Load before designing features, adding services, or touching multiple packages. Compact ownership, dependency, and subsystem rules for Ensemble.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Build, launch, and capture debug logs from the iOS simulator. Use when you need to verify runtime behavior, measure timing, or diagnose issues without asking the user to manually capture logs.
Use when the user asks to visually test, touch, automate, or walk every Ensemble app surface across iOS/iPadOS and macOS, including agent-run UI sweeps, issue detection, reproduction, log inspection, fix-plan reports, platform parity checks, and repeatable screenshot/accessibility evidence runs.
Canonical Ensemble behavior policy router. Load before changing app behavior, playback, queue, offline/connectivity, downloads, sync/refresh, mutations, platform UI behavior, or verification expectations; update the relevant policy reference when implementation changes or clarifies behavior.
Plex Media Server API reference. Load when implementing or debugging Plex API integration.
Load when locating files, adding files, or checking package ownership. Compact map plus discovery commands; use rg for live file lists.
Load before building or modifying any SwiftUI view. Ensemble UI/UX conventions: navigation behavior, tab management, visual design specs, loading/error states, performance optimization, iOS 15 compatibility, DetailLoader pattern.
基于 SOC 职业分类
| name | architecture |
| description | Load before designing features, adding services, or touching multiple packages. Compact ownership, dependency, and subsystem rules for Ensemble. |
This is the canonical operating map. A long historical inventory was archived to docs/reference/architecture-inventory.md; load it only when a detailed subsystem inventory is useful.
Layer 3: EnsembleUI
Layer 2: EnsembleCore
Layer 1: EnsembleAPI + EnsemblePersistence
Layer 0: EnsembleSupport
Shared: EnsembleSiriShared
Watch: EnsembleDomain + EnsemblePlex + EnsembleWatchCore
Dependency flow is one-way:
EnsembleCore or EnsembleUI.| Package | Canonical ownership |
|---|---|
EnsembleSupport | Pure Foundation shared utilities with no app behavior ownership, currently including privacy-safe log redaction and audio payload validation. |
EnsembleAPI | Plex auth, request building, API models, transport, connection policy, WebSocket transport, endpoint grouping. |
EnsemblePersistence | CoreData model/stack, repositories, download/artwork persistence, SwiftPM compiled model bundle. |
EnsembleSiriShared | Pure Siri/system-media identity, index models, payload codecs, phrase normalization/scoring, query variants, resolver logic, App Group constants. |
EnsembleDomain | Watch-portable account, media, category, and playback-status models. |
EnsemblePlex | Watch-portable Plex discovery/catalog/detail/stream facade using EnsembleAPI. |
EnsembleWatchCore | Watch bootstrap, Plex Link fallback, credential restore, KVS hints, catalog cache, local playback, local/remote Now Playing target state. |
EnsembleCore | ViewModels, services, DI, domain models, sync, playback, offline downloads, metadata mutations, profile/cloud, navigation state. |
EnsembleUI | SwiftUI views/components, platform UI adapters, native table/menu/share/AirPlay/Metal/toast bridges. |
DependencyContainer wires services and ViewModel factories. Keep construction grouped by subsystem bootstrap helpers and cross-subsystem callback wiring in explicit post-construction helpers.AppReadinessCoordinator owns UI-safe launch/source/cache readiness snapshots. Browse ViewModels consume those snapshots instead of independently deriving add-source or empty states from transient account arrays, and library browse screens consume committed LibraryBrowseSnapshot values instead of raw arrays that may be empty mid-refresh.ForegroundWorkScheduler owns foreground interaction budgeting for nonessential CPU/file work. Services route SmartMix analysis, sidecar analysis, offline healing, system media indexing, artwork retries, log export preparation, and expensive progress recomputation through it without making it an app-state singleton.SyncCoordinator is the sync facade. Keep provider lookup, refresh orchestration, playlist refresh, network lifecycle, and endpoint synchronization in focused collaborators instead of growing the facade.PlaybackService is the playback facade. Queue mutation and transport side effects stay there; audio session, queue persistence, launch/recovery policy, file cache, prefetch, now-playing metadata, reporting, settings observation, system-media donations, and transport resolution belong in focused collaborators.OfflineDownloadService remains the target/queue source of truth. Platform events route through the offline background coordinator, not directly from app delegates into queue workers.NavigationCoordinator is scene/window-scoped for user navigation. Do not route user-driven navigation through a shared singleton coordinator that would mirror iPad/macOS windows.PlaybackNowPlayingBridge owns app writes to MPNowPlayingInfoCenter and MPRemoteCommandCenter. Keep MediaPlayer singleton mutation out of PlaybackService, engines, ViewModels, and UI.SystemMediaIntegrationService owns user-initiated playback donations, Core Spotlight indexing/deletion, and media user context refresh. Playback callers pass PlaybackStartContext; Siri, App Shortcuts, remote commands, autoplay, restoration, and background recovery must not donate starts.EnsembleSiriShared.SiriMediaIndexResolver is the shared resolver for SiriKit, App Shortcuts, and Spotlight-backed media identity. Do not duplicate query normalization, kind inference, source matching, ranking, or playlist lookup in the app target or Siri extension.Plex* API models live in EnsembleAPI.CD* models live in EnsemblePersistence.EnsembleCore.SourceCacheCleanupService or the relevant persistence/offline owner, not in UI ViewModels.start.mp3.iOS where required by PMS behavior; general headers may still report the real platform.EnsembleWatch/Views/.EnsembleWatchCore, portable Plex access in EnsemblePlex, and portable models in EnsembleDomain.Update this skill only for new architecture rules, package ownership changes, service boundaries, or major patterns. Do not turn it back into a full file/type inventory; use project-structure, rg, source reads, and docs/reference/architecture-inventory.md for details.