/dev-flow:rn-write-testsfrom dev-flow
Writes Jest + React Native Testing Library unit/integration tests and Maestro e2e flows for Expo + RN apps. Sets up the testing stack on first call and writes focused tests next to source files.
Ships in dev-flow. 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.
Read when SKILL.md points to them.
See references/contracts.md (vendored from dev-flow). Key facts:
<project-root>/.workflow/meta.json#stack.framework — must be "expo-rn".<project-root>/__tests__/ (Jest convention) for unit/integration.<project-root>/.maestro/ for e2e.meta.json#phase.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.Read .workflow/meta.json. Abort if stack.framework != "expo-rn".
Check if jest, jest-expo, @testing-library/react-native are in package.json. If not:
npx expo install --dev \
jest jest-expo \
@testing-library/react-native@^14 \
test-renderer@^1 \
@types/jest -- --legacy-peer-deps
# jest-expo declares `@react-native/jest-preset` as a peer (58: `^0.88.0`), and that package is
# NOT in the SDK's bundledNativeModules — so `expo install` hands you npm latest, which breaks as
# soon as it is a minor ahead of the project's RN (SDK 57, 2026-09-08: 0.87.1 against RN 0.86).
# Pin it to the React Native version the project actually has:
RN_VERSION="$(node -p "require('react-native/package.json').version")"
npm install --save-dev --legacy-peer-deps "@react-native/jest-preset@${RN_VERSION}"
(Without the @react-native/jest-preset line the very first jest run dies with "The React Native Jest preset that jest-expo relies on has moved to a separate package"; with the wrong minor it dies with "Could not locate module react-native/setup-env" — observed 2026-09-08 on SDK 57 / RN 0.86.3. On SDK 58 the suite also needs "resolver": "react-native-reanimated/jest/resolver" in the jest config, or setUpTests() crashes every suite — re-run 2026-10-17 on a fresh SDK 58 app. test-renderer@^1 is a required peer dep of RNTL v14 — it replaced react-test-renderer. Node ^22.13 || >=24 is also required. Native matchers like toBeOnTheScreen() are built into @testing-library/react-native v12.4+ — no separate @testing-library/jest-native needed. See references/jest-setup.md for the full config.)
⚠️ RNTL v14 is async: render, renderHook, fireEvent and act all return Promises and MUST be awaited, and the UNSAFE_* queries are gone. Read the v14 section of references/rntl-patterns.md before writing a test — a missing await produces a test that passes for the wrong reason. Migrating an existing suite: npx codemod@latest rntl-v14-update-deps --target . then npx codemod@latest rntl-v14-async-functions --target ./src.
For Maestro: detect .maestro/ directory. If missing AND user wants e2e, see references/maestro.md (manual install, not npm — Java 17+, .maestro/ flow layout, testID conventions, and ⚠️ the Expo Go vs dev-build caveat: Expo Go can't launchApp your own appId, use openLink: exp://…).
Ask the user (one round-trip) what to test:
useQuery, useMutation, custom hook) → RNTL await renderHook(...).runFlow sign-ins in one file with clearState between them, against a real test backend — references/maestro.md §Two-user flows. Jest cannot express this; it is the check that finds authorization bugs between identities.On a project whose stack.test carries the e2e layer, the agentic runner (@e2e-dev/mobile,
built on agent-device) is the other way to write an e2e flow — a native accessibility tree the agent
drives, on simulators, emulators and connected phones. There is one copy of that text, in
write-tests/references/e2e-agentic.md: one technique, one authority, whichever platform asks.
Read it before writing one, for the cost rule and for the gates. ⚠️ It does not take the two-user
flow from Maestro: e2e on mobile has no session save/restore, so that check stays where it is.
If the file under test is lib/api.ts, write a Jest test of the function with fetch mocked.
If the file under test is app/(auth)/sign-in.tsx, write an RNTL test of the screen + a Maestro flow of the user journey.
Use the canonical patterns from references/rntl-patterns.md (or references/jest-setup.md for utilities, or references/maestro.md for e2e).
Test files:
__tests__/<mirror-source-path>.test.tsx (or .test.ts for non-JSX)..maestro/<flow-name>.yaml.cd <project-root> && npm test -- --runInBand --bail
(For Maestro: maestro test .maestro/<flow-name>.yaml.)
Test MUST pass. If it doesn't:
git add __tests__/<path>.test.tsx
git commit -m "test(<area>): cover <what>"
jest.fn() without typing the return → tests pass on wrong shape.await new Promise(r => setTimeout(r, 1000)) → use waitFor with explicit assertions.This skill does NOT advance meta.json#phase (see Contract above) — never call set-phase. It only records the artifact and appends history, using the canonical script when available:
# Wherever dev-flow is installed (e.g. ~/.claude/skills/dev-flow/), invoke:
python3 .../dev-flow/scripts/update_meta.py <project-root> record-artifact \
--path <relative-path> --produced-by '<this-skill-name>' [--derived-from <p1> <p2> ...]
python3 .../dev-flow/scripts/update_meta.py <project-root> append-history \
--skill '<this-skill-name>' --inputs '{...}' --outputs '{...}' --phase-after <current_phase>
The script normalizes legacy kebab-case aliases (e.g. module-added → module_added) and writes the canonical sha256 + timestamp into meta.json#artifacts. Fall back to direct JSON editing only if the script is not on PATH (and warn the user).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
expo-testing, react-native-testing, jest-expo, maestro, e2e-testing
npx claudepluginhub lukedj78/dev-flow --plugin dev-flow57 skills in this plugin
/animated-iconsAdd a Motion-animated icon to a Next.js app from a shadcn registry instead of hand-animating an SVG. Two registries, picked from the project's icon set: **heroicons-animated** (316 icons, `shadcn add @heroicons-animated/<name>`) and **hugeicons-animated** (165 icons, `shadcn add @hugeicons-animated/<name>`, which also installs a shared `lib/use-icon-animation.ts`). Both MIT, both on the `motion` runtime, both copied into your repo as source. This skill owns the install plus the two things the raw components lack: a `prefers-reduced-motion` guard and timing aligned to the project motion tokens (`lib/motion/`). Use when the user says "animated icon", "animate this icon", "make the bell/heart/menu icon animate on hover", "aggiungi un'icona animata", or wants an icon micro-interaction. Refuses outside Next.js web — for React Native use `rn-animations-gestures`. Not for: static icons, a whole motion system (`transitions`), or installing the runtime itself (`module-add motion`)./app-securityCheck whether an app's own code can be attacked before it ships — vulnerable dependencies, secrets in the code and in git history, Next.js authorization gaps (Server Actions and route handlers without a session check, queries by id with no owner filter — IDOR), data over-exposure, secrets in public env vars, raw SQL — then read the flagged code against an OWASP checklist, with an opt-in dynamic level (Strix) that proves exploits against the app running locally. The fifth pre-deploy gate, beside compliance-audit, vercel-doctor, shadscan and launch-audit; reports and routes, never blocks. Triggers: "security review", "è sicura l'app?", "controllo di sicurezza prima del deploy", "IDOR", "secrets in the repo", "pentest". Not for: GDPR and legal (compliance-audit), UI quality (shadscan), cost (vercel-doctor), launch readiness (launch-audit), a review of one branch diff (Claude Code's /security-review), third-party registry code (registry-intake)./app-verificationGive a project a manual for proving its features on the real app, written once and kept true: `.claude/skills/verify-<app>/` with how to launch it until it is usable, a read-only doctor check, how to drive it with the repo's real selectors, what counts as proof and where it goes, how to stop only what it started — plus one feature file per PRD story, seeded from the wireframe screen inventory, and a headless-Chrome render probe (overflow, wrapped headings, text hidden under reduced motion). Two modes: create (scaffold, fill from the code, prove it live once, record `meta.json#verification`) and maintain (re-read every feature from source, drive them all live, fix the manual, report real regressions). Web, Expo and eve. Triggers: "verify the app", "prova che funziona", "verification skill", "come si avvia l'app per provarla", "maintain the verify skill", "il manuale di verifica è aggiornato?". Not for: writing tests (write-tests), UI audits (shadscan), security (app-security), deploying (vercel-deploy)./compliance-auditRun a GDPR + EU AI Act compliance audit on an existing dev-flow project (web / mobile / eve agent) and remediate what it finds. Two modes: Audit (scan the codebase and `meta.json#stack` against a 11-point risk register — DSAR, consent/cookies, EU data residency, retention and PII-scrubbing, AI-transparency Art.50, high-risk Annex III, sub-processors — into a report with severity, evidence and article mapping) and Remediate (apply the safe mechanical mitigations, flag the ones needing a legal decision, never deciding legal basis or high-risk for the user). A pre-deploy gate; run it any time. Triggers: "audit GDPR", "compliance check", "AI Act", "siamo conformi?", "DSAR / cancellazione account / cookie consent / data residency". Not for: the other pre-deploy gates (vercel-doctor, shadscan, launch-audit, app-security), legal advice or DPIA sign-off (a DPO confirms), building features, or writing the PRD (use prd-from-idea)./composition-patterns-guideUse when refactoring React or React Native components that suffer from boolean prop proliferation, missing compound structure, prop drilling, or unclear ownership of state. Codifies the 7 Vercel composition-patterns rules for our web + RN stack — composition or explicit variants over boolean props, compound components with shared context, state lifted into providers, children over render props, React 19 (no forwardRef) — plus our colocation rules (Rule of Three, L0/L1/L2, `_components/`). Triggers on: "refactor this component", "questo componente ha troppi prop booleani", "rendi questo componente più componibile", "compound component", "context provider per X", "design del componente". Not for: scaffolding new components (use design-md-to-app, screenshot-to-page, rn-add-screen), or moving components up the hierarchy (use promote-component)./coss-uiSet up or extend a Next.js web app with Coss/UI — the official Cal.com design system, built on Base UI + Tailwind CSS v4 and installed through the shadcn CLI via the namespaced `@coss/*` registry. Two modes: Init (`shadcn init @coss/style` on a new project) and Add (pull `@coss/ui` primitives, single `@coss/<name>` components, or particles into an existing one). Sets `meta.json#stack.ui = "coss"`. Triggers: "usa Coss/UI", "coss.com/ui", "Cal.com design system", "aggiungi un componente Coss", "init @coss/style", "scaffold con Coss UI", or dev-flow routing when `stack.ui = "coss"`. Requires Tailwind CSS v4 and carries a mixed MIT/AGPLv3 license. Not for: writing the DESIGN.md (use figma-to-design-md / image-to-design-md), the generic Next.js scaffold (design-md-to-app owns it), backend modules (module-add), or React Native (RN uses NativeWind, not Coss).