swiftship/internal/skills/data/features/repositories/SKILL.md
Repository pattern: protocol-based data access, DTO-to-domain mapping, and clean layer separation. Use when implementing app features related to repositories.
npx skillsauth add abdullah4ai/apple-dev-docs repositoriesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The repository pattern separates data access from business logic. ViewModels depend on protocol abstractions — never concrete implementations or database types.
Data flow: Supabase API → DTO (Codable) → Repository (maps) → Domain Model → ViewModel → View
Repositories/{Entity}/{Entity}Repository.swift (e.g. Repositories/Users/UserRepository.swift)Models/ — use Swift-native types (enums, URL, Date)Identifiable (NOT Codable — they don't need serialization)static let sample for SwiftUI previewsRepositories/{Entity}/Supabase{Entity}Repository.swift (e.g. Repositories/Users/SupabaseUserRepository.swift)init(dto:) mapping extension, implementationSupabaseService.shared.client for all database callsSupabaseUserRepository, always UserRepositoryfunc getAll() async throws -> [User]The @main App struct is the only place that creates concrete repository instances and passes them down:
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
let userRepo = SupabaseUserRepository()
ContentView(viewModel: UserListViewModel(userRepository: userRepo))
}
}
}
testing
Use for 3D games: racing, 3D sports, board games, marble maze, tower defense, bowling. SceneKit + SceneView architecture, 3D scene hierarchy, physics, game loop, primitives, materials, cameras, particles, audio.
documentation
Game UI patterns: SwiftUI HUD overlays on SpriteKit, menus (main/pause/game-over), virtual joystick/d-pad, score displays, health bars, tutorial onboarding.
tools
Download free game sprites/textures/3D models and generate procedural assets. Covers nw_download_asset tool, texture factories, sprite atlas organization, 3D model loading, and programmatic asset creation.
testing
Use for 2D games: arcade, puzzle, sports, ping pong, platformer, shooter, 2D racing. SpriteKit + SpriteView architecture, scene hierarchy, physics, game loop, audio, particles, game feel.