Reflex: an architecture for building mobile apps with agents
Thiago Magalhaes · 5 November 2026
Read the originalShopify rebuilt its mobile apps so AI agents can test every screen without a phone, and one shared test file keeps the iOS and Android apps in step.
Thiago Magalhaes, writing on the engineering blog of Shopify, the commerce software company, described Reflex, the structure behind its rebuilt iOS and Android apps. AI agents write most of the code, and the slowest step had been proving on an emulator that a screen worked. Reflex lets agents read each screen's state and trigger its actions from a command-line tool, with no phone or emulator.
- Every screen follows one pattern: actions go in, state comes out, and state changes in one place, which AI agents can repeat reliably.
- Each screen publishes its name, its state and its allowed actions as data, so a command-line tool can walk through the whole app.
- The team writes each app twice, in Swift and Kotlin, but writes each behaviour test once and runs it against both apps. A pull request cannot merge if it passes on only one.
- More than 1,700 behaviour tests run in about four minutes, and any test that tries to reach the network fails.
A mobile team whose code is mostly written by AI agents can treat one shared test suite as the thing that keeps two apps the same. The author also advises teaching agents to use the tool through written skills. This is Shopify's account of its own engineering, and a separate visual review still checks each screen.
Publish each screen's state and allowed actions as data, so an AI agent can test the app from a command line without an emulator.
For a mobile app built separately for iOS and Android, write each behaviour test once, run it against both apps, and block any pull request that passes on only one.
Derived by Working Surface from the article; more in the Playbook. Source line: The code is written twice, the tests are written once.
6 November 2026: teams scaling AI agents are replacing case-by-case checking with one repeatable path that every piece of agent work passes through.