test-feature

A protocol for testing a React Native feature on a running simulator or emulator. It checks existing Maestro test flows, verifies the interface and user journey, checks internal state, and saves a persistent test file.

In plain words
What is it for?
Use it to test a requested mobile feature, replay or find matching saved actions, verify UI and user flows, inspect state, and create a reusable Maestro test.
Why use it?
It turns a manual feature check into repeatable evidence, while checking both what appears on screen and what the app is doing internally.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/lykhoyda/rn-dev-agent/test-feature
Clone the repo
git clone --depth 1 https://github.com/Lykhoyda/rn-dev-agent
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,693 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00030 $0.01693
Opus 5 $0.00015 $0.00847
Sonnet 5 $0.00006 $0.00339
Haiku 4.5 $0.00003 $0.00169

Measured 2d ago against content hash 597284e26af7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-feature scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/claude-plugin/commands/test-feature.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test this React Native feature: $ARGUMENTS

Run the rn-tester protocol INLINE (parent session)

Important (GH #31): Do NOT spawn the rn-tester agent via the Task tool. MCP tools (cdp_*, device_*) are not available in spawned subagents. Execute the rn-tester protocol directly in this parent session using the rn-testing and rn-device-control skills as your reference.

Load the rn-testing skill and follow this 8-step protocol in this session:

  1. Artifact-first scan (MANDATORY before any device_ call).* Glob **/test-app/.rn-agent/actions/*.yaml (and .rn-agent/skeleton.yaml) within the current project AND the sibling workspace at ../rn-dev-agent-workspace/test-app/.rn-agent/actions/. For each candidate, read the file header / appId and decide if it matches the requested feature by:

    • filename keyword overlap with $ARGUMENTS
    • first-comment-block intent overlap with $ARGUMENTS
    • produces: overlap with the goal state (D1209) — an action whose produces includes the state your task requires (e.g. authenticated: true when the task needs an authenticated session) is a useful prologue even if its intent doesn't match the full task. See "Hybrid composition" in CLAUDE-MD-TEMPLATE for the loop. If a full match exists, REPLAY IT FIRST — but call cdp_status once before any replay (the environment gate applies to replays too, not just manual walks; if it fails, route to /rn-dev-agent:setup instead of running a doomed flow). Replay with cdp_run_action({ actionId, params }); the tool preflights the exact runner and action pin before any UI mutation. If the replay passes, you have your evidence — proceed to step 7 (verification + generate-or-refresh artifact). If the replay fails with a concrete error (Element not found, assertion failed), fix the flow rather than abandoning to manual primitives.

    If only a partial match exists (an action whose produces covers part of your task's required state — e.g. login → authenticated, but the rest of the task is novel), use the action as a prologue: replay it via cdp_run_action({ actionId, params }), re-verify state with cdp_navigation_state + cdp_store_state, then continue with steps 1–7 below for the novel part. Save the new action covering the full task at step 7. This is the hybrid-composition path — it's the default, not an escape hatch.

    Falling back to device_* walks WITHOUT having tried existing flows (full or partial) is a captured anti-pattern (see feedback_execute_artifacts_before_manual.md in auto-memory). Run /rn-dev-agent:list-learned-actions if you want to inspect the inventory — the Produces column shows what state each action establishes.

  2. Environment check — call cdp_status. If it fails, stop and tell the user to run /rn-dev-agent:setup.

  3. Understand the feature — read implementation files, find testIDs, routes, store slices.

  4. Plan the test — write test steps and expected outcomes BEFORE executing.

  5. Navigate to start — use cdp_navigate or device_deeplink to reach the starting screen.

  6. Execute and verify — for each step:

    • Act (device_press, device_fill, device_find)
    • Wait (assertVisible or 1-2s settle)
    • Verify UI (cdp_component_tree(filter=...))
    • Verify data (cdp_store_state(path=...) + cdp_network_log)
  7. Edge cases — test empty state, error state, back navigation, rapid taps.

  8. Generate or refresh persistent test (MANDATORY). Always end the run by ensuring a Maestro flow exists for the tested feature:

    • If step 0 found and replayed an existing flow: re-validate it still covers the new edge cases; if you discovered a gap, ADD steps to the existing flow (don't fork a new file).
    • If step 0 found NO matching flow: prefer auto-emission over hand- authoring. Wrap the manual walk between cdp_record_test_start and cdp_record_test_stop, then cdp_record_test_save_as_action to write <test-app>/.rn-agent/actions/<feature-slug>.yaml with the metadata header pre-populated (id, intent, tags, mutates, status, enginePin — see skills/rn-testing/SKILL.md "Reusable Action Metadata Schema"). Hand-edit the result to parameterise input strings via ${VAR} placeholders and add a when: visible: id: tab-X self-bootstrap if the flow assumes a starting screen. If <test-app>/.rn-agent/skeleton.yaml exists, add any new testIDs the flow references there too.
    • If step 0 found a flow that doesn't cleanly extend (different feature overlap), still add a NEW flow. Two short flows beat one tangled flow.

Read the full file on GitHub · 124 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 124 lines · 30 tokens per session scan A 597284e26af7

Subscribe to this mod's changes

test-feature is a command published in the GitHub repository Lykhoyda/rn-dev-agent (11 stars, last pushed 2d ago), licensed MIT. It adds 30 tokens to every session and 1,693 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.