From rn-dev-agent
Guides building new features in React Native or Expo apps through an 8-phase pipeline: discovery, codebase exploration, architecture, implementation, verification, review, and proof capture.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rn-dev-agent:rn-feature-developmentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are helping a developer implement a new feature in a React Native app.
You are helping a developer implement a new feature in a React Native app. Follow this systematic approach: understand the codebase deeply, ask about all ambiguities, design an elegant architecture, implement, verify live on the simulator, review quality, and produce E2E proof with screenshots.
dev/evaluator.md exists in the plugin root, log
every phase's events per its matching Phase section there (it defines what
each phase records; re-verification logs as Phase 5.5-retry); Phase 7
finalizes the report and appends high-confidence bugs to docs/BUGS.md.Goal: Understand what needs to be built.
Actions:
Goal: Understand relevant existing code and patterns.
Actions:
rn-code-explorer agents in parallel. Each should:
Goal: Fill in all gaps before designing.
CRITICAL: This is the most important phase. DO NOT SKIP.
Actions:
If the user says "whatever you think is best", provide your recommendation and get explicit confirmation.
Goal: Design the implementation approach.
Actions:
rn-code-architect agents with the feature spec, explorer
findings, and user answers. Ask for a complete blueprint including the
mandatory Verification Parameters and E2E Proof Flow sections.Rules consulted block listing rule
IDs from skills/rn-best-practices/rules.index.json derived from the
feature's keyword set.[CRITICAL|HIGH] <rule-id> one per line.Goal: Build the feature.
Actions:
__DEV__ Zustand exposure (if Zustand project)requiresFullReload is true: call cdp_reload(full=true) and wait
for reconnectionGoal: Prove the feature works on the running simulator/emulator.
This is what separates rn-feature-dev from generic feature development. After implementation, verify the feature live using CDP tools and screenshots.
Actions:
Run this verification sequence in order. Stop and fix if any step fails.
Before ANY verification, confirm the environment is functional.
Call cdp_status. If it fails to connect:
xcrun simctl, adb, or xcodebuild as substitutes for
CDP tools. These bypass the plugin's connection management and error
recovery, and produce a degraded experience.npx expo start
or npx react-native start) and the app is loaded on a simulator."/rn-dev-agent:check-env to diagnose missing dependencies."cdp_connect(platform="ios"))Only proceed to Step 0 after cdp_status returns ok: true.
First, verify the simulator is running and CDP is connected:
device_list to check for booted simulators/emulatorsrn-ensure-running <platform>cdp_status to confirm connection/rn-dev-agent:setup to verify all dependencies are installed.
Do not skip verification without user consent.cdp_status to confirm CDP connection before proceeding.Then, ensure a device session is open for device_* tools:
4. Check if /tmp/rn-dev-agent-session.json exists (via bash cat).
If absent or stale (older than 30 minutes), open a fresh session:
device_snapshot(action="open", platform="<platform from cdp_status>")
Auto-detect appId — the tool resolves it from app.json if omitted.
This enables device_screenshot, device_find, device_press, and
device_scroll for the rest of the verification and proof phases.
NEVER skip this step — without a session, all device_* calls fail
and verification falls back to bash commands, defeating the plugin's
purpose.
Then, if the blueprint's entryRoute is not "none", navigate to the feature
screen using cdp_navigate or cdp_evaluate:
cdp_navigate(screen="<screen>", params={...})
Or if cdp_navigate is unavailable:
cdp_evaluate(expression="globalThis.__NAV_REF__?.navigate('<screen>', <params>)")
If navigation ref is not available, use device_deeplink as a last resort:
device_deeplink(url="<entryRoute from blueprint>")
After navigation, call cdp_navigation_state to confirm you are on the
correct screen. Wait 1-2 seconds for the screen to settle.
First, clear the error buffer to establish a baseline:
cdp_error_log(clear=true)
Then capture the current screen state:
device_screenshot(path="/tmp/rn-feature-verify.jpg")
Call cdp_status. Gate on:
metro.running = truecdp.connected = trueapp.dev = true (not false)app.hasRedBox = falseapp.isPaused = falseapp.errorCount = 0If app.dev is false: CDP is connected to the wrong JS context (common in
RN 0.76+ Bridgeless mode with multiple Hermes targets). Call
cdp_reload(full=true) to force reconnection — the target selection now
probes __DEV__ on each candidate. If still false after reload, ask the
user to restart Metro.
If isPaused is true: call cdp_reload(full=true) to recover, then
restart Phase 5.5 from Step 0.
If RedBox is showing: read cdp_error_log, fix the error in source,
save, wait for Fast Refresh, then restart Phase 5.5 from Step 0.
Call cdp_component_tree(filter="<primaryComponent from blueprint>", depth=3).
Gate on:
If the component is not found, call cdp_navigation_state to check if you
are on the wrong screen before diagnosing a render issue.
If the blueprint specifies interactive elements (buttons, pressables, inputs), exercise at least ONE primary interaction to verify the feature works end-to-end, not just renders:
device_find(text="<button text>", action="click") or
device_press(ref="@<ref>") to trigger the main user action.
Prefer cdp_interact(testID="<testID>", action="press") when a reliable testID exists (JS-level, deterministic)device_snapshot to verify UI changed)cdp_store_state to confirmcdp_navigation_state to confirmcdp_error_log for handler errorsThis step proves the feature is functional, not just rendered. Skip only if the feature has no interactive elements (e.g., display-only screens).
If the blueprint's storeQueryPath is not "none":
Call cdp_store_state(path="<storeQueryPath from blueprint>").
Gate on:
__agent_error key in the responseSkip this step if the feature has no store involvement.
Call cdp_error_log. Gate on:
If new errors are present: read the stack trace, fix the source, save, wait for Fast Refresh, then restart Phase 5.5 from Step 0.
Maximum 3 fix-and-retry loops before escalating to the user with a full state dump.
Present results as a table (use the actual screenshot path for the platform):
| Check | Result | Evidence |
|---|---|---|
| Navigation (cdp_navigation_state) | PASS/SKIP | current route |
| Screenshot | PASS/FAIL | actual file path |
| Health (cdp_status) | PASS/FAIL | errorCount, hasRedBox, isPaused |
| Component (cdp_component_tree) | PASS/FAIL | component found, props summary |
| Interaction (device_find/device_press) | PASS/FAIL/SKIP | action + side effect verified |
| State (cdp_store_state) | PASS/FAIL/SKIP | state shape summary |
| Errors (cdp_error_log) | PASS/FAIL | error count since baseline |
Gate: All checks must be PASS (or SKIP where not applicable) before proceeding to Phase 6.
If both iOS and Android are available, run this check BEFORE marking verification as complete. This catches platform-specific rendering failures (e.g., missing icon fonts, layout differences, invisible elements).
| Element | testID | iOS | Android |
|---|---|---|---|
| Like icon | feed-like-1 | visible | visible/MISSING |
| Like count | feed-like-count-1 | "1" | "1" |
| Avatar image | profile-avatar-image | visible | visible/MISSING |
docs/BUGS.md and note it in the verification report.
Verification can proceed with the working platform, but the MISSING
elements must be documented and the Android column in the results log
must show the actual status, not a false "PASS".Never mark a platform as "PASS" if UI elements are invisible or missing. A screen that loads without crashing but has missing icons is a FAIL, not a PASS.
Goal: Ensure code is clean, correct, and follows RN conventions.
Actions:
rn-code-reviewer agents in parallel:
__DEV__ guards on debug code, Zustand
exposure, selector memoization. Scope: [list of files changed]"node scripts/check-vercel-rules.mjs --changed --format hook -- <changed file paths>
rn-code-reviewer Pass 4 also runs an index-driven lookup, but this
standalone check is faster (~50ms) and catches the 3 deterministic rules
even when the reviewer agent skips Pass 4.node scripts/check-vercel-rules.mjs --ci.Goal: Document what was accomplished.
Actions:
Goal: A permanent proof artifact — docs/proof/<feature-slug>/ with
numbered screenshots, PROOF.md, PR-BODY.md, and the rehearsed flow
persisted as a replayable action.
Protocol — single source of truth: execute the /rn-dev-agent:proof-capture
protocol (read ${CLAUDE_PLUGIN_ROOT}/commands/proof-capture.md and run its
Protocol steps with <feature-slug>). The pipeline adds these deltas:
<project-root>/.rn-agent/actions/<feature-slug>.yaml (the RN app's root —
written <test-app> in the command docs) — follow the creating-actions
skill Steps 3–6 (flow diagram, M7 header, pre-replay validation,
replay-to-promote; the architect's proof-flow table maps nearly 1:1 onto
the diagram). maestro_generate and cdp_record_test_generate emit the
YAML body but NOT the M7 header — prepend it per creating-actions.cdp_run_action({actionId: "<feature-slug>", params: {...}}) — it records
the RunRecord and a clean pass auto-promotes experimental → active,
which the Gate below requires. Plain maestro_run(flowPath=..., params={KEY: "VALUE"}) is for the ON-CAMERA replay only (no auto-repair
mid-recording — a repair would mutate the flow on camera).Hard gates (from the protocol — enforced here too):
cdp_navigation_state
and cdp_store_state snapshots.cdp_set_shared_value, JS introspection mid-flow)
may the rehearsed device_*/cdp_* sequence be the on-camera artifact —
and the missing Maestro primitive MUST be named in PROOF.md "Deviations".mutates: true flow) — never "fix it on camera."cdp_error_log clean, every
numbered screenshot non-zero). Report invalid proof — never present it as
complete.Gate: PROOF.md exists with screenshots for ALL steps of the architect's flow, all state assertions match, PR-BODY.md is generated, and the action file exists and has replayed clean at least once. If screenshot capture fails (e.g., no simulator), log it in PROOF.md and note it in the Phase 7 summary. If a state assertion doesn't match, that is a bug — fix it before completing. Mark all todos complete.
npx expo start or npx react-native start)if (__DEV__) global.__ZUSTAND_STORES__ = { ... } in app entrygit checkout, git stash,
git reset. Agents read and verify, they don't manage branches.expo_ensure_running.sh is
attempted in Phase 5.5 Step 0. If that fails, ask the user to boot it.
Verification can be skipped with explicit user consent, but must be noted
in the Phase 7 summary.cdp_error_log, fix source, reload,
restart Phase 5.5.cdp_status which auto-connects. If that
fails, check Metro is running (curl http://localhost:8081/status).cdp_reload(full=true) to resume.Each phase has shortcuts agents reach for. Don't.
| Excuse | Reality |
|---|---|
| "I read the explorer's report — skip reading the actual files" | Explorer reports are summaries. Read 2-3 key files the explorer flagged before designing. |
| "The blueprint is detailed enough — implement directly, skip questions" | Phase 3 (Questions) catches the 5 assumptions that would waste 2 hours of rework. Ask them. |
| "Phase 5.5 verification is slow — skip it and trust the review" | Code review ≠ runtime verification. A component can look correct and render wrong. cdp_component_tree + cdp_store_state takes 10 seconds. |
| "I tested iOS — Android works the same" | Wrong ~40% of the time. Keyboard, permissions, back button, text input, safe-area all differ. cross_platform_verify is mandatory unless explicitly single-platform. |
| "Phase 6 found 1 issue — ship it" | Review agents already filter by confidence. If ONE flags an issue, read it fully. |
| "Phase 8 (E2E Proof) is just for PR theater" | Proof flows become the permanent Maestro test file. Skip them and you pay in manual testing every sprint. |
| "I'll record while I figure out the flow — saves a pass" | The video then shows you stuck on a wrong testID for 90 seconds. The rehearsal pass is the cheap one; re-recording is the expensive one. Discovery happens off camera, replay happens on camera. |
cdp_error_log to confirm zero new errorsrn-record-proof start before the rehearsed flow has replayed clean (proof-capture protocol Step 2.5)device_* exploratory calls during recording to "find the right testID"device_* / cdp_* fallback path for the on-camera replay without naming the specific Maestro primitive that cannot express the step in PROOF.md "Deviations"cdp_status before Phase 5.5 startsmaestro-runner CLI for env-substituted flows or maestro_run MCP tool for env-free flows) when expressible, step-by-step device_* / cdp_* only when Maestro genuinely cannot capture it AND the inexpressibility is documented in PROOF.md Deviationscdp_run_action) BEFORE starting any video recordingxcrun simctl or adb for app interaction (use MCP tools)xcrun simctl io screenshot or bash for screenshots — use device_screenshot(path=...) exclusivelysleep N for settling — use device_snapshot to verify UI state change insteadconsole.log calls and leave them in committed codecdp_error_log showing new errorsrn-record-proof start while still discovering testIDs, navigation paths, or state shapes — recording is for verified replay, not explorationcdp_status returns ok:true at end of Phase 5.5 and Phase 8cdp_error_log shows 0 new errors at end of Phase 8docs/proof/<feature>/PROOF.md written with the architect's steps and actual resultscross_platform_verify run OR single-platform noted in Phase 7 summarynpx claudepluginhub lykhoyda/rn-dev-agent --plugin rn-dev-agentProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.