coding-guidelines

Project-specific coding rules for a React Native mobile app built with Expo, TypeScript, Expo Router, and Redux Toolkit. They define how configuration, themes, device data, hooks, and shared state should be used.

In plain words
What is it for?
Guiding feature development and code review in this React Native project, especially configuration, themes, device handling, and state management.
Why use it?
They prevent inconsistent patterns, hardcoded settings, and mismatched app behavior across the codebase.

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/wataru-maeda/react-native-boilerplate/coding-guidelines
Clone the repo
git clone --depth 1 https://github.com/wataru-maeda/react-native-boilerplate

Made for: Cursor.

Per session 1,305 This file is loaded in full into every session.
When invoked 1,305 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.01305 $0.01305
Opus 5 $0.00652 $0.00652
Sonnet 5 $0.00261 $0.00261
Haiku 4.5 $0.00130 $0.00130

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

Security

Grade A, and why

coding-guidelines 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.

.cursor/rules/coding-guidelines.mdc · 198 lines

How it starts

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

React Native Expo Project - Coding Guidelines

Project Overview

React Native Expo SDK 54 project with TypeScript, Expo Router v6, Redux Toolkit, and modern development practices.

Built-in Features to Always Use

Configuration Management

  • Use utils/config.ts for all environment variables and app configuration
  • Use utils/deviceInfo.ts for platform detection and device dimensions
  • Never hardcode environment values, always go through config

Theme System

  • Always import from @/theme for colors, fonts, and images
  • Use @/theme/colors instead of hardcoded color values
  • Use theme system for consistent dark/light mode support
  • Load assets through @/theme/images and @/theme/fonts

Custom Hooks

  • Use useColorScheme from @/hooks for theme detection
  • Use useDataPersist from @/hooks for local storage operations
  • Use useKeyboard from @/hooks for keyboard state management
  • Use useAppSlice from @/slices for global state management

State Management

  • Use Redux Toolkit slices in @/slices for global state
  • Import from @/slices for all state operations
  • Keep local state minimal, prefer global state for shared data

Services Layer

  • Use @/services for all API calls and external integrations
  • Never make direct API calls from components
  • Use the services layer for data transformation

Type Safety

  • Use types from @/types for all interfaces
  • Define component props interfaces for all components
  • Use TypeScript strict mode - project is configured for it

Directory Structure Rules

Component Organization

  • components/elements - Reusable UI components (Button, Image, etc.)
  • components/layouts - Layout-specific components (headers, navigation)
  • scenes - Screen components (renamed from pages)
  • app - Expo Router routes only, delegate to scenes

File Naming

  • Components: PascalCase (Button.tsx, NavigationHeader.tsx)
  • Hooks: camelCase with "use" prefix (useColorScheme.ts)
  • Utils: camelCase (deviceInfo.ts, config.ts)
  • Types: PascalCase (User.ts, ApiResponse.ts)

Read the full file on GitHub · 198 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 · 198 lines · 1,305 tokens per session scan A 1b97c3f9130a

Subscribe to this mod's changes

coding-guidelines is a cursor rule published in the GitHub repository wataru-maeda/react-native-boilerplate (513 stars, last pushed 20d ago), licensed MIT. It adds 1,305 tokens to every session, about $0.0065 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.