/expo-stack:expo-stack-architecturefrom expo-stack
Defines folder layout, routes-only rule, platform extensions, and workspace wiring for Expo Router apps. Useful for scaffolding, file placement, and Metro resolution.
Ships in expo-stack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Defer to expo/skills → expo-project-structure for the canonical Expo layout. This skill records the stack-specific additions and the workspace wiring that Expo's guidance does not cover.
src/
├── app/ # Expo Router. ROUTES ONLY.
│ ├── _layout.tsx # providers + guards
│ ├── _layout.web.tsx # platform extensions work on layouts too
│ ├── +native-intent.tsx # URL rewrite hook — router config, not a route
│ ├── (onboarding)/
│ ├── (auth)/
│ ├── (app)/(tabs)/
│ └── api/ # +api.ts server routes, grouped
├── screens/ # screen bodies — where the real UI lives
│ └── home/
│ ├── index.tsx # rendered by src/app/(app)/(tabs)/index.tsx
│ └── components/ # used only by Home
│ └── timeline.tsx
├── components/ # reusable UI
│ ├── table/
│ │ ├── index.tsx # the root component
│ │ └── row.tsx # used only by Table
│ ├── bar-chart.tsx
│ ├── bar-chart.web.tsx
│ └── button.tsx
├── hooks/ # reusable hooks — use-app-state.ts, use-theme.ts
├── lib/ # wired singletons — auth-client, convex client, stores
├── utils/ # pure standalone helpers — format-date.ts, pluralize.ts
├── i18n/
├── server/ # server-only helpers used by app/api
├── theme.ts
└── global.css
convex/ # backend (or packages/backend in a workspace)
lib/ vs utils/ is the one distinction worth holding: lib/ holds things that are configured or stateful — a client instance, a store, a provider's setup. utils/ holds pure functions that could be copied into any project unchanged. When a util grows a dependency on app config, it moves.
A screen with one local subcomponent can keep it as a sibling file (screens/home/header.tsx); once there are several, the components/ subfolder stops the folder becoming a list.
src/ over root-level app/ — Expo Router supports both, and src/ is what separates app code from the dozen config files at the root. The default template already aliases @/* → ./src/*.
Filenames are kebab-case. Expo's own default template switched to this in SDK 55; match it. MyComponent lives in my-component.tsx. Consistency matters more than which convention, but this stack has picked one.
A component that needs breaking up becomes a folder with index.tsx — the import path does not change when it grows, and you can tell at a glance which file is the root.
src/app is routes-only — the rule that pays off laterEvery file in src/app creates a route, so nothing but routing belongs there. Each route file is a thin re-export:
// src/app/(app)/(tabs)/index.tsx
export { default } from '@/screens/home'
Why this is worth the extra file: moving a screen to a different URL, presenting it as a sheet as well as a tab, or restructuring the navigation tree becomes a one-line change instead of an import-rewriting exercise. State, data fetching and layout live in src/screens/*, which the router does not care about.
The same reason drives the src/screens folder at all: screen-local subcomponents have nowhere to live in src/app, and dumping them in src/components pollutes the shared namespace with things used exactly once.
A second bonus: a screen rendered as a component can be mounted from more than one route without a shared-route group. Sometimes that is simply more readable than the routing gymnastics.
Two exceptions, both router configuration rather than screens: +api.ts files (below) and +native-intent.tsx (expo-stack-deep-linking). Neither renders anything; both stay thin, with the real logic in src/server/ and src/lib/ respectively.
+api.ts files in src/app/api/ become server routes. Two things differ from the rest of the codebase:
process.env.STRIPE_SECRET). Client code only sees EXPO_PUBLIC_*, which is inlined into the bundle.src/app/api/ prevents collisions — you can have both a /user screen and a /api/user route without thinking about it.Shared server helpers go in src/server/, which signals "different rules apply here" and gives lint config something to target.
In this stack most backend logic belongs in Convex functions, not API routes. Reach for +api.ts when you need a plain HTTP endpoint (a webhook receiver, an OAuth callback that is not Better Auth's, a third-party callback that cannot speak Convex).
Platform.OS === 'ios' is fine for a one-line difference. Past that, split the file:
date-field.tsx # default — REQUIRED, always
date-field.ios.tsx # SwiftUI / Expo UI implementation
date-field.web.tsx
Import as if the extension did not exist (import { DateField } from '@/components/date-field'); Metro picks the right one at bundle time. Supported: .ios, .android, .native (both), .web.
Three rules:
This matters more here than in a generic RN app because Expo UI means .ios.tsx files import SwiftUI modifiers that simply do not exist on Android.
Colocate. Uniwind className covers most of it; where a StyleSheet object is genuinely needed, keep it at the bottom of the same file, not in a sibling styles.ts. Separate style files were a phase; they mean two files open to change one padding.
Colocate: format-date.ts next to format-date.test.ts. A __tests__/ folder works equally well — pick one. Colocation makes untested files visible at a glance.
Two layouts, one scaffold script:
apps/<name>/, shared code in packages/*. Convex lives in apps/<name>/convex by default, or packages/backend when a second client will share it.| bun | pnpm | yarn | |
|---|---|---|---|
| Workspace declaration | workspaces in root package.json | pnpm-workspace.yaml — the workspaces field is ignored | workspaces in root package.json |
| Hoisting | flat by default — fine | node-linker=hoisted in .npmrc | Yarn ≥2: nodeLinker: node-modules in .yarnrc.yml |
| Run one workspace's script | bun run --filter <name> | pnpm --filter <name> | yarn workspace <name> |
| Add to one workspace | bun add --cwd apps/<name> | pnpm --filter <name> add | yarn workspace <name> add |
The hoisting settings are not style preferences. React Native's Metro resolver and the native build systems cannot follow pnpm's isolated symlink layout or Yarn PnP. Without them you get errors that look like missing packages or duplicate React copies, and the real cause is invisible.
// apps/<name>/metro.config.js
const path = require('node:path')
const { getDefaultConfig } = require('expo/metro-config')
const { withUniwindConfig } = require('uniwind/metro')
const projectRoot = __dirname
const workspaceRoot = path.resolve(projectRoot, '../..')
const config = getDefaultConfig(projectRoot)
config.watchFolders = [workspaceRoot]
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(workspaceRoot, 'node_modules'),
]
config.resolver.disableHierarchicalLookup = false
module.exports = withUniwindConfig(config, {
cssEntryFile: './src/global.css',
dtsFile: './src/uniwind-types.d.ts',
})
withUniwindConfig wraps everything else. If you add another with*Config, it goes inside.
Tailwind scans for class names starting from the directory containing the CSS entry file. A component in packages/ui is outside that tree, so its classes are silently never generated — the component renders unstyled with no error. Fix it in global.css:
@import 'tailwindcss';
@import 'uniwind';
@source '../../../packages/ui/src';
@source '../../../packages/features/src';
One @source per package that ships components. Restart Metro after editing.
packages/ui — shared components, consumed as source, not as build output. No build step, no stale dist, and Tailwind can see the class names (given @source).packages/config — shared tsconfig base and lint config.tsconfig paths so @repo/ui resolves in both the editor and Metro.EAS Build needs the monorepo root as build context, not the app folder. Verify with a real eas build --profile development early — a workspace that bundles locally can still fail on EAS over a missing root file. Be careful with .easignore: excluding the workspace root's packages/ breaks the build in a way that is slow to diagnose.
Commit exactly one lockfile. Two lockfiles in a repo means two different dependency graphs depending on who ran install last.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
expo-router, project-structure, monorepo, metro-config, workspace-wiring
npx claudepluginhub flyingwebie/skills --plugin expo-stack14 skills in this plugin
/expo-stackScaffold, configure, diagnose, polish, and ship production Expo applications with the Expo Stack workflow in Codex./expo-stack-asoApp Store Optimization as part of the build loop — the indexed metadata fields, keyword strategy, screenshots that rank as well as convert, review-prompt timing, and store localization matched to the app's locales. Use when preparing a store listing, choosing a title/subtitle/keywords, planning screenshots, adding a rating prompt, or asked why an app is not being found./expo-stack-data-authWiring Convex and Better Auth into an Expo Router app — cloud or self-hosted Convex, the expo/convex client plugins, route guards, and env-var discipline. Use when setting up or debugging auth, adding a Convex function or schema, choosing between cloud and self-hosted, or when sessions, cookies, redirects or convex env vars misbehave.Other plugins' skills for the same job