# One folder per mobile feature, and the API aliases are gone

apps/mobile moves from components, hooks and lib to feature and platform folders that mirror the backend, routes only return screens, and the four legacy API subpaths are removed.

**Breaking for imports of `@template-cloudflare/api`.** The four aliases the native app still used, `./routers/{todo,integrations,billing,notifications}.schema`, are no longer exported. Import `@template-cloudflare/api/<feature>/contract` instead; the [api package reference](/docs/packages/api#renamed-subpaths) lists the pairs. The web app already used the canonical subpaths, and the app's screens and behaviour do not change.

- **Feature folders in the native app.** `apps/mobile/src/components`, `hooks` and `lib` are gone. Each feature lives in one flat `src/features/<feature>/` folder with the backend's names (`todo`, `notifications`, `billing`, `integrations`, `app-config`, and `organizations`, `settings`, `auth`, `app-shell`, `dashboard`, `app-lock`, `onboarding`), and cross-cutting code in `src/platform/` (rpc, auth session, i18n, feedback, review, theme, runtime). Files are named `<feature>.<role>`: `screen`, `hooks`, components and models. [Mobile app](/docs/features/mobile), [ADR-0013](/docs/adr/0013-mobile-features-mirror-the-backend-shape).
- **Routes only return screens.** The 27 expo-router routes stay at the same paths, with the same scheme and deep links. Each route now renders a feature screen, and the root providers moved to `src/platform/app/root-providers.tsx`. No route or screen reads data directly any more: queries and mutations live in hooks. The root layout keeps its module-scope splash and theme calls.
- **Checked in `pnpm test`.** `scripts/mobile-feature-boundaries.test.mjs` holds the layers, cross-feature edges, platform variants, the route list, the API subpaths and Vitest's coverage of every test file; the import cycle test covers `apps/mobile/src`; the mobile lint warns on long files. The client boundary from ADR-0002 is unchanged.
- **Removal recipes follow.** `optional-features.json` and the task, MCP and billing removal scripts target the new files; removing the task demo deletes `features/todo` and `features/notifications` whole.
- **The `domain-feature` skill covers mobile.** `references/mobile.md` and three templates describe a native screen over a contract and its device-free gates.

Measurements ([report](https://github.com/CarlosZiegler/template-cloudflare/blob/main/docs/measurements/2026-10-17-mobile-structure.md)): after the moves, the iOS and Android sourcemaps of `expo export` listed the same modules under the new names; the screen extraction adds 35 files and removes none. The JavaScript bundle grows by 11.5 KB raw and 2 KB gzip, the module wrappers of those files. The Hermes bytecode is 55 KB smaller on iOS and 13.8 KB larger on Android, both within 1 %. `expo config` is unchanged. Nothing was run on a simulator or device; a device check before the next release is recommended.

