Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 17 min read Case study mediumAdept

Reflex: an architecture for building mobile apps with agents

Reflex is Shopify's MVVM architecture for native Swift and Kotlin apps built largely by agents. App logic lives in a UI-free Core module that runs headlessly on macOS or the JVM. Every screen's ViewModel follows an Elm-style action-in, state-out contract and exposes its name, state and actions as JSON through an Introspection Kit node. A platform-agnostic CLI walks that node tree, so one behavior test file drives both iOS and Android without a simulator, and over 1,700 such tests run in about four minutes on CI. The guiding principle is "share the test, not the code": real reducers, services and navigation run with fixtures injected via constructors, and the same contract also lets Shopify's Sidekick assistant act inside the app.

Assumes: MVVM patternElm architectureSwiftUI or Jetpack Composedependency injection

Related posts

  • How we rebuilt the Shopify app in 12 weeks

    Shopify Engineering mediumAdept

    Thirty engineers rebuilt the 300+ screen Shopify mobile app from React Native to native Swift and Kotlin in 12 weeks, with agents writing most of the code. The key work was building a system around the agents: a shared Reflex architecture for iOS and Android that lets ViewModels run headless from a CLI in milliseconds, CI checks that fail on cross-platform drift, and Helix verifying small checkpoints against the legacy app, which served as the spec instead of written documents. As code generation got faster, the bottlenecks moved to laptops, code review, merging and coordination. Shopify answered with remote dev environments, agent-first adversarial review on small dual-platform PRs, a daily loop that turns review comments into rules, agent-driven merge queues, and pod ownership by product area. Launch time dropped about 50% on Android and 14% on iOS, and the Android binary shrank by 40%.

  • Native is now the future of mobile at Shopify

    Shopify Engineering easyNovice

    Shopify is moving its mobile apps from React Native back to native Swift and Kotlin because coding agents have cut the cost of building and keeping features in parity across two platforms, while native still gives closer access to platform capabilities and first-party tooling. The apps are being rebuilt greenfield rather than migrated gradually. The Shop app went from proof of concept to a published native app in 12 weeks, and the 300+ screen Shopify app is in progress. To avoid unmaintainable one-shot LLM output, a system called Helix splits each screen into small checkpoints, and each one must pass tests, visual comparison, two adversarial AI reviewers and human approval. Business logic is being decoupled from the UI so it runs headlessly behind a CLI, letting agents iterate in milliseconds instead of waiting minutes on simulators. Shopify's open-source libraries are also changing hands: Skia moves to a fork maintained by William Candillon, FlashList is seeking a new steward, and Restyle is being archived.

  • Helix: The internal tool powering our Shopify app's native migration

    Shopify Engineering mediumAdept

    Helix is Shopify's internal LLM tooling for rebuilding its 300+ screen React Native app in native Swift and Kotlin. Instead of one-shot generation, it splits each screen into small ordered checkpoints, each gated by CLI-driven behavior tests, a Gemini-based visual comparison against screenshots of the reference app, two context-isolated adversarial code reviews against documented architecture guidelines, and engineer approval. Reviewer feedback is stored in memory so later checkpoints need less oversight, enabling autonomous and parallel runs that produce committed, evidence-backed checkpoints instead of one large diff. The core lesson is to optimize for reliable convergence rather than a perfect first attempt.

  • Making AI Write Android Code Our Way: A Practical Guide to Agent Skills

    Medium Engineering mediumAdept

    Medium's small Android team encodes its Kotlin/Compose conventions into an AGENTS.md project context file plus 13 Markdown "skills" in .agents/skills/ that act as step-by-step runbooks for Cursor's agent. The skills cover scaffolding (new Compose screens with ViewModel-injecting and @VisibleForTesting overloads, feature modules, use cases, repositories), migrations (a 60+ entry Material 2 to 3 mapping, ViewModel injection), pattern enforcement (feature flags checked once at ViewModel init, referrer tracking, analytics events) and repetitive workflows such as deeplinks and translations. The main payoff is consistency across the codebase, and new-screen setup drops from most of a morning to a prompt plus a review pass. The team recommends writing AGENTS.md first, starting with boilerplate-heavy tasks, turning repeated PR comments into skills, and having agents draft skills from example PRs. Next steps are splitting AGENTS.md into file-scoped rules and adding commands.

  • We gave AI agents a mobile dev environment

    Shopify Engineering mediumAdept

    Shopify built Remote Dev so its Slack-based coding agent River can build and test iOS and Android apps in parallel on a fleet of remote Macs instead of developers' laptops. Each agent claims a warm Mac (monorepo checked out, apps prebuilt, caches warm) over SSH, plus an Android emulator running on a separate Linux VM because macOS lacks nested virtualization; this cut setup from 30+ minutes to a few minutes. A skill, a CLI wrapping SSH, and observable tmux panes taught River to use the remote machine. Live Preview streams simulators to the browser over WebSockets, and internal evangelism plus a classifier-driven feedback loop raised River's share of merged mobile PRs from 6% to 61%.

The quest for software engineering knowledge.

Look:
Layout: