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
| Game | Status | Notes |
|---|---|---|
| Chess | WKWebView (temporary) | Native replacement planned for Phase 7 |
| Poker | Placeholder | Phase 2–4 in roadmap |
| Dice | Placeholder | Phase 2 (simplest game, proves module pattern) |
| Fortune Teller | Placeholder | Phase 3 |
| Quest Forge | Placeholder | Phase 5 |
| Eliza | Placeholder | Phase 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-opsSoundManager— enum-basedplay(_ effect: SoundEffect)API with effects:.tap,.success,.error,.impact,.chime,.snap,.whoosh
Core app files:
CardsAndGamesApp.swift— entry point with service injectionGameHubView.swift— NavigationStack hub listing 6 gamesGameType.swift— enum defining game modesGamePlaceholderView.swift— “Coming Soon” for unimplemented gamesAppSettings.swift— user preferences
Shared domain types (PlayingCard, Deck, TarotCard, DiceType) are defined in Phase 1 — the shared infrastructure layer.
Tech Stack
| Layer | Technology | Notes |
|---|---|---|
| Language | Swift 6.2 | swift-tools-version: 6.2 — limits developer access |
| UI | SwiftUI | Latest; conditional compilation for iOS/macOS |
| Web embed | WebKit / WKWebView | Chess placeholder only |
| Build | Swift Package Manager | No external Swift dependencies |
| Testing | XCTest | Minimal — GameTypeTests.swift only at Phase 0 |
| Platform | iOS 16+, macOS 13+ | Declared in Package.swift |
History
| Date | Event |
|---|---|
| 2026-01-31 | Unified app design adopted; reference projects designated as design input only |
| 2026-02-06 | Full audit; chess assets restored; 23 concerns documented |
| 2026-02-17 | Pre-reset: 6,133 lines copy-pasted from reference repos across Poker, Dice, FortuneTeller modules |
| 2026-02-19 | Architecture reset: all copy-pasted code deleted (34 source + 8 test files); services refactored; all governance docs rewritten |
| 2026-02-19 | Phase 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.
Related
- 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