rn-write-testslisted
Install: claude install-skill lukedj78/dev-flow
# rn-write-tests — Jest + RNTL + Maestro testing for Expo + RN
## Contract
See `references/contracts.md` (vendored from `dev-flow`). Key facts:
- Reads `<project-root>/.workflow/meta.json#stack.framework` — must be `"expo-rn"`.
- Adds dev dependencies + Jest config on first call (idempotent: detects existing setup).
- Writes test files under `<project-root>/__tests__/` (Jest convention) for unit/integration.
- Writes Maestro YAML flows under `<project-root>/.maestro/` for e2e.
- Does NOT modify `meta.json#phase`.
## When this skill applies
- User asks to write a test for a specific source file or flow.
- Orchestrator does NOT route here automatically — test writing is on-demand.
## Knowledge dependencies (read these first)
- `rn-fundamentals/SKILL.md` — TS strict, modern primitives the tests will see.
- `rn-data-fetching/references/patterns.md` — query/mutation patterns the tests must exercise.
## Workflow
### Step 1 — Verify preconditions
Read `.workflow/meta.json`. Abort if `stack.framework != "expo-rn"`.
### Step 2 — Detect / install the test stack
Check if `jest`, `jest-expo`, `@testing-library/react-native` are in `package.json`. If not:
```bash
npx expo install --dev \
jest jest-expo \
@testing-library/react-native \
@testing-library/jest-native \
@types/jest -- --legacy-peer-deps
```
(See `references/jest-setup.md` for the full config.)
For Maestro: detect `.maestro/` directory. If missing AND user wants e2e, see `references/maestro-setup.md` (man