Cards and Games

A unified Swift app combining six game modes under shared infrastructure. The app targets iOS 16+ and macOS 13+, built with SwiftUI + MVVM + Observable pattern. Reference implementations (Poker, Dice, FortuneTeller, Chess, Quest-Forge, Eliza) exist as separate repos and serve as design input only — no code is copied from them.

Game Modes

GameStatusNotes
ChessWKWebView (temporary)Native replacement planned for Phase 7
PokerPlaceholderPhase 2–4 in roadmap
DicePlaceholderPhase 2 (simplest game, proves module pattern)
Fortune TellerPlaceholderPhase 3
Quest ForgePlaceholderPhase 5
ElizaPlaceholderPhase 6

Architecture

Pattern: MVVM with @StateObject injection and ObservableObject throughout.

Shared services:

  • HapticService — generic haptic API (light(), medium(), heavy(), soft(), success(), warning(), error()); macOS no-ops
  • SoundManager — enum-based play(_ effect: SoundEffect) API with effects: .tap, .success, .error, .impact, .chime, .snap, .whoosh

Core app files:

  • CardsAndGamesApp.swift — entry point with service injection
  • GameHubView.swift — NavigationStack hub listing 6 games
  • GameType.swift — enum defining game modes
  • GamePlaceholderView.swift — “Coming Soon” for unimplemented games
  • AppSettings.swift — user preferences

Shared domain types (PlayingCard, Deck, TarotCard, DiceType) are defined in Phase 1 — the shared infrastructure layer.

Tech Stack

LayerTechnologyNotes
LanguageSwift 6.2swift-tools-version: 6.2 — limits developer access
UISwiftUILatest; conditional compilation for iOS/macOS
Web embedWebKit / WKWebViewChess placeholder only
BuildSwift Package ManagerNo external Swift dependencies
TestingXCTestMinimal — GameTypeTests.swift only at Phase 0
PlatformiOS 16+, macOS 13+Declared in Package.swift

History

DateEvent
2026-01-31Unified app design adopted; reference projects designated as design input only
2026-02-06Full audit; chess assets restored; 23 concerns documented
2026-02-17Pre-reset: 6,133 lines copy-pasted from reference repos across Poker, Dice, FortuneTeller modules
2026-02-19Architecture reset: all copy-pasted code deleted (34 source + 8 test files); services refactored; all governance docs rewritten
2026-02-19Phase 0 declared complete; Phase 1 (Shared Infrastructure) next

Architecture Reset (2026-02-19)

Between 2026-02-06 and 2026-02-17, AI sessions copy-pasted 6,133 lines from reference repos directly into the unified app. Root cause: governance docs described current state (“code is copied/adapted”) which was interpreted as instruction. All copy-pasted code was deleted; services were refactored to generic APIs; CLAUDE.md rewritten with explicit copy-paste prohibitions.

Key lesson: governance docs must describe intent, not current state. Self-perpetuating AI errors require simultaneous correction of all governance files. This lesson is captured in copilot-cli-background-tasks as part of the broader multi-agent coordination patterns used in this project’s development.

  • playground — prototype environment where game concepts were first explored
  • copilot-task-claim-protocol — branch-based task claim protocol used for background agent coordination on this project