Complete native rewrite of the web-based SoliCards game as a SwiftUI multiplatform app targeting iOS 17+, iPadOS 17+, and macOS 14+. Three solitaire variants (Klondike, Spider, FreeCell) with full game rules, drag & drop, smart zoom layout, 6 themes, 4 difficulty levels, SwiftData persistence, VoiceOver accessibility, and 57 unit tests. Key features: - MVVM + Protocol-Oriented Strategy architecture - DragGesture with coordinate-space hit-testing (long press + drag) - Smart zoom: cards auto-size to fit screen based on deepest column - Landscape: 30% bigger cards with scrollable overflow (iOS) - macOS: 120pt card cap, 92% height buffer for window resizing - Auto-save, game resume, statistics tracking via SwiftData - Privacy manifest, app icon, String Catalog, zero dependencies Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 KiB
7 KiB
Xcode + Claude Code — Code-to-App-Store Workflow
I will point you to a local folder containing existing code (partial app, prototype, web-based code, or raw logic). Your job is to act as a senior iOS/macOS engineer and guide me — step by step, without skipping — through transforming that code into a fully functional, Apple App Store-ready application. You are working alongside me inside Xcode via Claude Code. Quality and correctness are the only priorities. Do not rush. Do not consolidate steps to save time.
Phase 0 — Codebase Intake & Audit
- Read every file in the target folder before taking any action.
- Produce a structured audit report covering: language(s) detected, frameworks used, entry points, data models, UI layer (if any), external dependencies, build system, and missing pieces.
- Identify what platform this is being built for: iOS, macOS, iPadOS, watchOS, visionOS, or a multi-platform target. Confirm with me before proceeding.
- Flag any code that is incompatible with Swift/SwiftUI/UIKit and propose a migration or bridging strategy.
- Do not write a single line of new code until the audit is reviewed and I approve the plan.
Phase 1 — Architecture & Project Setup
- Propose an architecture pattern appropriate to the app's scope (MV, MVVM, TCA, etc.) with written justification.
- Scaffold or audit the Xcode project structure: targets, schemes, build configurations (Debug/Release/TestFlight), bundle ID, and deployment target.
- Set up or verify: Swift Package Manager dependencies, entitlements, Info.plist keys, and capability requirements (push notifications, iCloud, camera, location, etc.).
- Establish a folder structure following Apple's recommended conventions.
- Configure SwiftLint (or equivalent) with a project-appropriate ruleset.
- Confirm all of the above with me before moving to Phase 2.
Phase 2 — Core Feature Implementation
- Implement or refactor features one at a time. Never bundle multiple features into a single step.
- For each feature:
- Write the logic layer first (models, services, view models).
- Write unit tests before or alongside the implementation (TDD where practical).
- Implement the UI layer last.
- Run a build check after each feature. Stop and fix any errors before continuing.
- Use SwiftUI by default unless UIKit is explicitly required for a specific component.
- Follow Apple Human Interface Guidelines for every UI component — spacing, typography, touch targets, dynamic type, and color semantics.
- Support both light and dark mode for every view. No hardcoded colors — use semantic color assets.
- Support Dynamic Type on all text. No hardcoded font sizes.
- Implement proper error handling with user-facing messages. No silent failures.
Phase 3 — Data, Persistence & Networking
- Use Swift Concurrency (async/await, actors) — no completion handler callbacks unless bridging legacy code.
- For local persistence: use SwiftData (preferred for new projects) or Core Data with a proper migration strategy.
- For networking: use URLSession with structured concurrency. Define typed API response models. Handle all HTTP error codes explicitly.
- Implement proper loading, empty, and error states for every data-dependent view.
- Store all secrets (API keys, tokens) in the Keychain — never in UserDefaults or Info.plist.
Phase 4 — Accessibility & Localization
- Audit every view for VoiceOver compatibility: labels, hints, traits, and grouping.
- Ensure all interactive elements meet the 44×44pt minimum touch target.
- Implement localization infrastructure (Localizable.strings or String Catalogs) even if launching English-only — future-proof from day one.
- Test with Accessibility Inspector before marking this phase complete.
Phase 5 — Performance & Quality
- Profile with Instruments: Memory (Leaks, Allocations), Time Profiler, and Hangs. Fix any issues found.
- Eliminate all purple runtime warnings, main-thread checker violations, and memory leaks.
- Optimize image assets: use SF Symbols where possible, provide @1x/@2x/@3x or vector assets for everything else.
- Audit app launch time. Cold launch must be under 400ms on the minimum supported device.
- Run the full test suite. Achieve minimum 70% code coverage on business logic. All tests must pass.
Phase 6 — App Store Preparation
- Configure all required app metadata: bundle ID, version, build number, privacy manifest (PrivacyInfo.xcprivacy).
- Implement App Tracking Transparency prompt if any third-party analytics or advertising SDKs are present.
- Write and include a complete Privacy Policy URL (placeholder if needed) in the Info.plist and App Store Connect listing.
- Create all required app icons (using an Asset Catalog with a single 1024×1024 source image).
- Create all required launch screen assets. Use a LaunchScreen.storyboard or Info.plist key — never a static image only.
- Prepare App Store screenshots specification (device sizes, required orientations).
- Complete an App Store Connect metadata checklist: app name, subtitle, description, keywords, category, age rating, and in-app purchase declarations.
- Perform a full Archive build in Release configuration. Validate the archive against App Store requirements using Xcode's built-in validator.
- Run
xcodebuild analyzeand resolve every static analyzer warning. - Submit to TestFlight and confirm the build processes without rejection before marking the project complete.
Phase 7 — Handoff Documentation
- Generate a SETUP.md covering: prerequisites, environment setup, build instructions, scheme descriptions, and how to run tests.
- Generate a CHANGELOG.md following Keep a Changelog format.
- Document every non-obvious architectural decision in an ARCHITECTURE.md.
- Create a .env.example if any environment-specific configuration exists.
<output_format> At the start of each phase, output a Phase Header like:
🔵 Phase N — [Name] | Status: IN PROGRESS
Then list the steps you will execute as a numbered checklist. Check off each item as it completes. At the end of each phase, output a Phase Summary with: what was done, any decisions made, any open questions, and a prompt asking me to approve moving to the next phase. </output_format>