cursorrules

A set of coding rules for building React Native mobile apps with Expo, TypeScript, and the listed libraries. React Native lets one codebase target mobile platforms, while Expo provides tools for developing those apps.

In plain words
What is it for?
Use it when adding screens, navigation, forms, data fetching, authentication, storage, or translations to this React Native project.
Why use it?
It gives the coding agent consistent project conventions, such as import paths and styling rules. This reduces mismatched code and avoids breaking the template's expected structure.

Cursor rule for Cursor

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/fouadmagdy01/rncopilot/cursorrules
Clone the repo
git clone --depth 1 https://github.com/FouadMagdy01/RNCopilot

Made for: Cursor.

Per session 2,984 This file is loaded in full into every session.
When invoked 2,984 The same file — it is already loaded in full.
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.02984 $0.02984
Opus 5 $0.01492 $0.01492
Sonnet 5 $0.00597 $0.00597
Haiku 4.5 $0.00298 $0.00298

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

Security

Grade A, and why

cursorrules 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.

.cursorrules · 416 lines

How it starts

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

Cursor Rules - React Native Expo Template

You are an expert React Native developer working in a production-grade Expo template. Follow every rule below exactly. When in doubt, look at an existing file and match its patterns.

Stack

  • React Native 0.83.2 + Expo SDK 55
  • expo-router (file-based routing, typed)
  • TypeScript 5.9 strict mode
  • react-native-unistyles 3.x (styling)
  • @tanstack/react-query (server state)
  • Zustand (client state)
  • Supabase (auth + database, graceful degradation)
  • Axios with auth interceptors
  • react-i18next (EN/AR, RTL support)
  • react-native-mmkv (storage)
  • react-hook-form + Zod (forms)
  • ESLint 9 flat config

Path Aliases

  • @/*src/*
  • ~/*app/*

Always use these aliases. Never use relative paths that climb more than one level.


Styling - THE MOST IMPORTANT RULES

  1. ALWAYS import StyleSheet from react-native-unistyles, NOT from react-native:

    import { StyleSheet } from 'react-native-unistyles';  // CORRECT
    import { StyleSheet } from 'react-native';             // WRONG
    
  2. ALWAYS use the theme callback form:

    const styles = StyleSheet.create((theme) => ({  // CORRECT
      container: { padding: theme.metrics.spacing.p16 }
    }));
    
    const styles = StyleSheet.create({  // WRONG - no theme access
      container: { padding: 16 }
    });
    
  3. NEVER use inline styles:

    <View style={{ padding: 16 }}>           // WRONG
    <View style={styles.container}>          // CORRECT
    
  4. NEVER use color literals:

    color: '#6366F1'                          // WRONG
    color: theme.colors.brand.primary         // CORRECT
    backgroundColor: 'white'                 // WRONG
    backgroundColor: theme.colors.background.surface  // CORRECT
    
  5. NEVER hardcode spacing numbers:

    padding: 16                              // WRONG
    padding: theme.metrics.spacing.p16       // CORRECT
    

Theme Token Reference

Read the full file on GitHub · 416 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 · 416 lines · 2,984 tokens per session scan A ebc27615126b

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository FouadMagdy01/RNCopilot (41 stars, last pushed 5mo ago), licensed MIT. It adds 2,984 tokens to every session, about $0.0149 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.