---
title: "Reflex: an architecture for building mobile apps with agents"
description: "Reflex is Shopify's MVVM architecture for native Swift and Kotlin apps built largely by agents."
url: "https://swe.quest/articles/reflex-an-architecture-for-building-mobile-apps-with-agents-9ce6b38f057be33a"
canonical: "https://shopify.engineering/reflex"
source: "Shopify Engineering"
published: "2026-11-05"
difficulty: "medium"
kind: "Case study"
reading_minutes: 17
tags: ["mobile","testing","ai-coding","swift","jvm"]
---

# Reflex: an architecture for building mobile apps with agents

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2026-11-05, 17 min read, Case study. Original: [https://shopify.engineering/reflex](https://shopify.engineering/reflex)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Swift](https://swe.quest/tags/swift.md) (Languages)
- [Java & JVM](https://swe.quest/tags/jvm.md) (Languages)

## Prerequisites

- MVVM pattern
- Elm architecture ([easy posts on System design](https://swe.quest/tags/system-design.md?difficulty=easy))
- SwiftUI or Jetpack Compose
- dependency injection ([easy posts on Application security](https://swe.quest/tags/appsec.md?difficulty=easy))

## Keywords

Reflex, Introspection Kit, Helix, Sidekick, Swift, Kotlin, Elm architecture, Shopify

## Related posts

- [How we rebuilt the Shopify app in 12 weeks](https://swe.quest/articles/how-we-rebuilt-the-shopify-app-in-12-weeks-08ae147088c9e21e.md): Shopify Engineering · 2026-11-10 · Medium · 15 min read · AI for coding, Mobile, Refactoring & migrations, Developer productivity, Code review
  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.
- [Native is now the future of mobile at Shopify](https://swe.quest/articles/native-is-now-the-future-of-mobile-at-shopify-4bc17172ea398962.md): Shopify Engineering · 2026-09-10 · Easy · 10 min read · Mobile, AI for coding, React, Refactoring & migrations, AI agents
  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.
- [Helix: The internal tool powering our Shopify app's native migration](https://swe.quest/articles/helix-the-internal-tool-powering-our-shopify-app-s-native-migration-db9fcd596ae9b1fc.md): Shopify Engineering · 2026-09-21 · Medium · 8 min read · AI for coding, AI agents, Mobile, Refactoring & migrations, React
  Helix is Shopify's internal LLM tooling for rebuilding its 300+ screen React Native app in native Swift and Kotlin.
- [Making AI Write Android Code Our Way: A Practical Guide to Agent Skills](https://swe.quest/articles/making-ai-write-android-code-our-way-a-practical-guide-to-agent-skills-60cf67851cb44c95.md): Medium Engineering · 2026-03-17 · Medium · 9 min read · AI for coding, Mobile, AI agents, Java & JVM, Developer productivity
  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.
- [We gave AI agents a mobile dev environment](https://swe.quest/articles/we-gave-ai-agents-a-mobile-dev-environment-e8b96ac4decaf1a3.md): Shopify Engineering · 2026-10-22 · Medium · 9 min read · AI agents, Mobile, Developer productivity, Virtualization, AI for coding
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
