agentleFS
FaridSafiFaridSafi/react-native-gifted-chat/.github/copilot-instructions.md

react-native-gifted-chat

Copilot instructions14k starsChanged 5 months agoMITView on GitHub

The most complete chat UI for React Native & Web. This is a TypeScript React Native component library with example applications demonstrating usage across React Native, React Native Web, and Expo platforms. Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.

  • Installs packages

We split this copilot-instructions.md into the rules it gives an agent

16 rules. About 0 are common, 7 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does …

    line 5
  2. Very specific:

    If tests fail due to snapshot mismatches after fresh dependency install, run yarn test -u to update snapshots

    line 19
  3. Distinctive:

    After making code changes, you should test basic functionality by:

    line 52
  4. Distinctive:

    ALWAYS test that the TypeScript declarations in /lib are correctly generated

    line 56
  5. Very specific:

    All tests are located in src/__tests__/ directory

    line 59
  6. Very specific:

    Test coverage can be viewed with yarn test:coverage

    line 61
  7. Very specific:

    Run yarn lint to check style

    line 88
  8. Very specific:

    Run yarn build to compile TypeScript

    line 89
  9. Very specific:

    Run yarn test to verify tests pass

    line 90
  10. Distinctive:

    Test manually with example app if UI changes

    line 91
  11. Distinctive:

    Follow existing test patterns using React Test Renderer

    line 95
  12. Very specific:

    Update snapshots if needed with yarn test -u

    line 96
  13. Very specific:

    Ensure all tests pass with yarn test

    line 97
  14. Very specific:

    Start development server: npx expo start

    line 102
  15. Distinctive:

    Always ensure your changes pass the full validation pipeline locally before pushing.

    line 112
  16. Distinctive:

    Always set timeouts to at least double these times to account for system variations.

    line 141

≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

React Native Gifted Chat

The most complete chat UI for React Native & Web. This is a TypeScript React Native component library with example applications demonstrating usage across React Native, React Native Web, and Expo platforms.

Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.

Working Effectively

Bootstrap and build the repository:

  • yarn install -- NEVER CANCEL: takes 58 seconds. Set timeout to 120+ seconds.
  • yarn build -- builds TypeScript library, takes 3 seconds. Set timeout to 30+ seconds.
  • yarn lint -- lints source code, takes 3 seconds. Currently has warnings but no errors. Set timeout to 30+ seconds.
  • yarn test -- NEVER CANCEL: runs Jest test suite, takes 9 seconds. Set timeout to 60+ seconds.

Full validation before publishing:

  • yarn prepublishOnly -- NEVER CANCEL: runs lint + test + build, takes 11 seconds total. Set timeout to 60+ seconds.

Known Issues:

  • If tests fail due to snapshot mismatches after fresh dependency install, run yarn test -u to update snapshots
  • Snapshot tests may need updates when React Native or dependency versions change

Example app development:

  • cd example && yarn install -- NEVER CANCEL: takes 38 seconds. Set timeout to 90+ seconds.
  • Install Expo CLI globally: npm install -g @expo/cli or use npx expo commands
  • Native development: cd example && npx expo start
  • Web development: cd example && npx expo start --web (requires additional dependencies)
  • The example app starts Metro bundler on http://localhost:8081
  • Expect dependency version warnings in offline/CI mode - these are normal

Type checking and development:

  • yarn tsc:watch -- runs TypeScript compiler in watch mode for development
  • yarn typecheck -- runs TypeScript compiler to check for TS errors

Requirements and Setup

System Requirements:

  • Node.js >= 18 (tested with 20.19.4)
  • Yarn package manager 1.22.22+ (do NOT use npm for this project)
  • TypeScript compiler (included in devDependencies)

Dependencies are already installed if yarn.lock exists

The repository includes both package-lock.json and yarn.lock but ALWAYS use yarn commands, never npm commands.

Validation

Always run full validation before completing changes:

  1. yarn lint -- check for code style issues (warnings are acceptable, errors are not)
  2. yarn build -- verify TypeScript compilation succeeds
  3. yarn test -- NEVER CANCEL: ensure all 19 test suites and 29 tests pass. Takes 31 seconds.

Manual validation scenarios:

After making code changes, you should test basic functionality by:

  1. Building the library: yarn build
  2. Running the test suite: yarn test
  3. For UI changes: Start the example app with cd example && npx expo start --web (if web dependencies are installed) or npx expo start for native development
  4. ALWAYS test that the TypeScript declarations in /lib are correctly generated

Testing approach:

  • All tests are located in src/__tests__/ directory
  • Tests use Jest with React Test Renderer
  • Test coverage can be viewed with yarn test:coverage
  • Snapshot tests are used extensively (27 snapshots)

Project Structure

Key directories:

  • /src -- main library source code (TypeScript)
  • /lib -- compiled JavaScript output (generated by yarn build, do not edit manually)
  • /example -- example React Native app demonstrating library usage
  • /src/__tests__ -- Jest test files
  • /.github/workflows/main.yml -- CI/CD pipeline (tests Node 18 and 20)

Important files:

  • package.json -- main project configuration and scripts
  • tsconfig.json -- TypeScript compiler configuration
  • jest.config.cjs -- Jest test configuration
  • .eslintrc.cjs -- ESLint linting rules
  • babel.config.cjs -- Babel transformation configuration
  • example/package.json -- example app dependencies

Build output:

The yarn build command generates JavaScript files and TypeScript declaration files in the /lib directory. This directory should not be edited manually and is ignored by git but included in npm package.

Common Tasks

Making code changes:

  1. Edit source files in /src directory
  2. Run yarn lint to check style
  3. Run yarn build to compile TypeScript
  4. Run yarn test to verify tests pass
  5. Test manually with example app if UI changes

Adding or modifying tests:

  • Tests are in src/__tests__/ directory
  • Follow existing test patterns using React Test Renderer
  • Update snapshots if needed with yarn test -u
  • Ensure all tests pass with yarn test

Working with the example app:

  • Example app uses Expo and demonstrates library functionality
  • Install dependencies: cd example && yarn install
  • Start development server: npx expo start
  • For web: npx expo start --web (requires react-native-web and @expo/metro-runtime)

CI/CD Integration

The repository uses GitHub Actions (.github/workflows/main.yml) that:

  • Tests on Node.js versions 18 and 20
  • Runs yarn install and yarn build
  • Build typically takes 1-2 minutes on CI

Always ensure your changes pass the full validation pipeline locally before pushing.

Common Command Reference

Root directory (library development):

yarn install        # Install dependencies (58 seconds)
yarn build         # Build TypeScript library (3 seconds)  
yarn lint          # Lint source code (3 seconds)
yarn test          # Run test suite (9 seconds)
yarn prepublishOnly # Full validation pipeline (11 seconds)
yarn tsc:watch     # TypeScript watch mode

Example directory (app development):

cd example
yarn install       # Install example dependencies (38 seconds)
npx expo start     # Start native development server
npx expo start --web # Start web development server

Time expectations (NEVER CANCEL these operations):

  • yarn install: 58 seconds (root), 41 seconds (example)
  • yarn build: 3 seconds
  • yarn lint: 3 seconds
  • yarn test: 9 seconds (after fresh install and snapshot updates)
  • yarn prepublishOnly: 11 seconds total

Always set timeouts to at least double these times to account for system variations.

Download now (ZIP)

Trending

More talk lately.about the whole repository

Dec 2025: 1 mentionJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 1 mentionMay 2026: 3 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 1 mentionSep 2026: 24 mentionsOct 2026: 3 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the FaridSafi/react-native-gifted-chat repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about FaridSafi/react-native-gifted-chat

The biggest 5 of 99 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 99

Talked about on GitHub, Stack Overflow, YouTube and the web (99 times).

On GitHub · 50

45 more on GitHub

On Stack Overflow · 30

25 more on Stack Overflow

On YouTube · 15

10 more on YouTube
  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.