Skip to Content
GuidesAI-Powered Development

AI-Powered Development

RNCopilot ships with 6+ AI configuration files that give AI coding assistants deep understanding of the project’s architecture, patterns, and conventions from the very first prompt. This is not a gimmick — it is a core design decision that makes every AI tool significantly more productive in this codebase.

The Problem

When you open a React Native project with an AI assistant, the assistant has to guess at:

  • Which StyleSheet to import (React Native’s or Unistyles?)
  • How auth state is managed (Context? Zustand? Redux?)
  • Where files should go (flat? feature folders?)
  • What patterns to follow (inline styles? theme tokens?)

Every wrong guess creates code that needs to be manually fixed. Multiply this across dozens of interactions per day and the productivity gains of AI disappear.

The Solution

RNCopilot includes instruction files for every major AI coding tool. Each file contains the same core information — project architecture, code patterns, theme tokens, do’s and don’ts — formatted for the specific tool’s conventions.

FileAI ToolFormat
CLAUDE.mdClaude Code (Anthropic CLI)Markdown with commands, structure, rules
.cursorrulesCursorProject rules format
.windsurfrulesWindsurf (Codeium)Project rules format
.clinerulesClineProject rules format
copilot-instructions.mdGitHub CopilotMarkdown instructions
AGENTS.mdOpenAI Codex / multi-agent systemsUniversal agent format
docs/AI-GUIDE.mdAny AI tool (copy-paste reference)Detailed cookbook with 10+ recipes
llms.txtLLM-friendly project summaryStructured plain text

You do not need to configure anything. These files are already in the repository. When you open the project with any supported AI tool, it automatically reads the relevant file and understands the codebase.

What the AI Learns

Every configuration file teaches the AI the same critical information:

Architecture and File Locations

  • Feature modules live in src/features/<name>/ with a standard subdirectory structure
  • Shared components live in src/common/components/ with the 4-file pattern
  • Screens live in app/ and must use export default
  • Path aliases: @/* maps to src/*, ~/* maps to app/*

Code Patterns

  • StyleSheet.create((theme) => ({...})) from react-native-unistyles, not from react-native
  • Text from @/common/components/Text, not from react-native
  • import { z } from 'zod/v4', not from zod
  • Auth via useAuthStore with selectors, not React Context
  • All user-facing strings through useTranslation() with keys in both en.json and ar.json

Theme Tokens

The complete semantic token reference so the AI uses theme.colors.brand.primary instead of '#6366F1', and theme.metrics.spacing.p16 instead of 16.

Anti-Patterns

12 specific mistakes that AI agents commonly make in this codebase, with wrong/correct examples for each. These include:

  1. Importing StyleSheet from react-native instead of react-native-unistyles
  2. Writing StyleSheet.create({...}) without the theme callback
  3. Importing Text from react-native instead of the project’s Text component
  4. Using useAuthStore() without a selector function
  5. Forgetting to update both locale files
  6. Creating screens without export default
  7. Importing from zod instead of zod/v4
  8. Putting business logic directly in components
  9. Using numeric spacing literals instead of theme tokens
  10. Skipping accessibility props on interactive elements
  11. Using console.log in production code
  12. Calling useAuthStore.getState() inside React components

The Recipes

The docs/AI-GUIDE.md file provides 10+ complete recipes that AI agents can follow step by step. Each recipe is a self-contained pattern with all the code needed:

RecipeWhat It Covers
Feature with API dataTypes, service, React Query hooks, screen with FlatList
Form with validationZod schema, react-hook-form, FormField, mutation
Zustand storeClient state with typed actions and selectors
Protected routeAuth check with redirect
MMKV storagePersistent key-value storage with typed hooks
Custom hookQuery + local state composition
Dialog confirmationDelete confirmation with Dialog component
Loading and empty statesSkeleton, Loading, EmptyState, ErrorBoundary
Snackbar notificationsSuccess/error feedback after mutations
Adding a new tabScreen file + layout registration + i18n

These recipes are not documentation — they are executable templates. An AI agent can read Recipe 1, follow the steps, and produce a working feature module that passes npm run validate on the first try.

File Templates

Beyond recipes, the AI-GUIDE includes complete file templates for:

  • New shared component (types, styles, implementation, barrel export)
  • New screen (tab, stack, or auth)
  • New custom hook
  • New Zustand store
  • New API service
  • New Zod schema

Each template follows every convention in the project — correct imports, theme tokens, i18n, accessibility, and type safety.

How It Works in Practice

Claude Code automatically reads CLAUDE.md when you open the project. It also picks up AGENTS.md and docs/AI-GUIDE.md when relevant.

# Claude Code reads CLAUDE.md on startup claude # Then you can immediately ask: > "Create a notifications feature with list screen and mark-as-read"

Claude Code will generate files in the correct locations with the correct patterns because CLAUDE.md told it exactly how.

Keeping Files in Sync

All AI configuration files share the same source of truth. If you change a pattern (for example, adding a new path alias or changing the auth approach), update these files:

  1. CLAUDE.md — primary reference
  2. docs/AI-GUIDE.md — detailed recipes and templates
  3. .cursorrules, .windsurfrules, .clinerules — tool-specific rules
  4. copilot-instructions.md — Copilot instructions
  5. AGENTS.md — universal agent instructions

If you modify a project convention and do not update the AI configuration files, AI assistants will generate code using the old patterns. Treat these files as part of your codebase, not as optional documentation.

Customizing for Your Project

When you migrate the template for your app, the AI configuration files should be updated to reflect your changes:

  • App name and purpose — Replace references to “RNCopilot” with your app name
  • Feature list — Update the feature module descriptions to match your features
  • API endpoints — If you have specific API patterns, document them
  • Additional conventions — Add any project-specific rules your team follows

The existing structure of each file makes this straightforward — find the relevant section and update it.

Last updated on