react-native-js

react-native-js is a cursor rule for coding agents from kensaurus/cursor-kenji. It costs 0 tokens per session (655 once invoked), scanned A, original, MIT.

Coding rules for the shared React Native JavaScript and TypeScript layer that runs on both Android and iOS. They cover folders, components, hooks, navigation, state, networking, styling, and platform-specific files.

In plain words
What is it for?
They help structure screens and components, write reusable hooks, handle small or large platform differences, and choose patterns that match the existing project.
Why use it?
They keep shared mobile code organized and reduce bugs caused by mixing JavaScript code with native Android or iOS implementation details.

Cursor rule

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 rules/kensaurus/cursor-kenji/react-native-js
Clone the repo
git clone --depth 1 https://github.com/kensaurus/cursor-kenji

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for react-native-js

README.md
[![agentmods](https://agentmods.dev/badge/rules/kensaurus/cursor-kenji/react-native-js.svg)](https://agentmods.dev/rules/kensaurus/cursor-kenji/react-native-js)
Your own site
<a href="https://agentmods.dev/rules/kensaurus/cursor-kenji/react-native-js"><img src="https://agentmods.dev/badge/rules/kensaurus/cursor-kenji/react-native-js.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 655 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.00000 $0.00655
Opus 5 $0.00000 $0.00328
Sonnet 5 $0.00000 $0.00131
Haiku 4.5 $0.00000 $0.00065

Measured yesterday against content hash 937064a54f30, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

react-native-js 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 yesterday.

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.

rules/native-rn-monorepo/react-native-js.mdc · 79 lines

How it starts

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

React Native (JS/TS layer)

Shared code that runs on both Android and iOS. Does NOT include native module code (that lives in android/ or ios/).

Adjust src/ to your repo's actual path (e.g. apps/mobile/src/).

Stack assumptions (verify against package.json before assuming)

  • React Native — version per package.json
  • TypeScript strict
  • Navigation: React Navigation
  • State: <FILL IN — Zustand / Redux Toolkit / Jotai / React Query / Context>
  • Networking: <FILL IN — fetch / axios / ky>
  • Styling: <FILL IN — StyleSheet.create / styled-components / NativeWind>

If unsure, grep the codebase before introducing a new pattern.

Conventions

  • Components in src/components/, screens in src/screens/, hooks in src/hooks/, utils in src/utils/.
  • One component per file. Named export. File name matches the component name (PascalCase.tsx).
  • Hooks prefix use; custom hook files start with lowercase use.
  • Platform-specific code:
    • Small divergence: Platform.OS === 'ios' / 'android' checks at the top of a function
    • Large divergence: *.ios.tsx / *.android.tsx files with shared interface
  • Persistence: @react-native-async-storage/async-storage. Never localStorage.
  • Environment vars: via react-native-config or react-native-dotenv (whichever the repo uses). Never hardcoded.
  • Imports: absolute imports if tsconfig.json paths is set up; otherwise relative within a feature module.

Hard exclusions

  • Never import from react-native-web in this layer.
  • Never use browser globals (window, document, navigator.geolocation directly — use the RN APIs).
  • Never bypass the bridge with raw native calls; if you need native behavior, add a typed native module under android/ and ios/.

Verification

npx tsc --noEmit
npm run lint  # if a lint script exists

For runtime sanity:

npx react-native start --reset-cache

What NOT to do

  • Do not commit .env* files unless they are the example/template (.env.example).
  • Do not pin RN to a non-stable version (0.x.0-rc.x) without explicit instruction.
  • Do not add new dependencies without checking they support both iOS and Android and the current RN version.
  • Do not run codegen scripts (pod install, gradle sync) silently — flag them as side effects. Note: pod install is CI-only here.

Read the full file on GitHub · 79 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. yesterday First seen · 79 lines · 0 tokens per session scan A 937064a54f30

Subscribe to this mod's changes

react-native-js is a cursor rule published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 655 tokens. 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-09-03.