react-general
Skill627 starsChanged 7 days agoMITView on GitHub
General React and React Native engineering rules for Ledger Live. Read when writing or reviewing any .ts/.tsx file.
In this repository70 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- analyticsSkill
- batch-feature-devSkill
- ci-runnersSkill
- ci-workflow-refsSkill
- cleanupSkill
- client-idsSkill
- cloud-sync-moduleSkill
- codeownershipSkill
- coin-families-contractSkill
- coin-modulesSkill
- commentsSkill
- configurationSkill
- console-logSkill
- create-changesetSkill
- create-prSkill
- data-layer-advancedSkill
- debug-rn-native-crashSkill
- dependency-patchesSkill
- detect-data-leaksSkill
- device-intent-executorSkill
- devtools-import-boundarySkill
- dialogs-sliceSkill
- docs-migrateSkill
- docs-update-or-createSkill
- domain-dataSkill
- e2e-desktop-add-or-updateSkill
- e2e-desktop-onboardSkill
- e2e-earnSkill
- e2e-mobile-add-or-updateSkill
- e2e-mobile-onboardSkill
- e2e-swapSkill
- errorsSkill
- feature-devSkill
- fix-ciSkill
- flow-packageSkill
- get-pr-commentsSkill
- git-conventionsSkill
- i18n-keysSkill
- impacting-prsSkill
- knip-migrationSkill
- ldls-nativeSkill
- ldls-webSkill
- ledger-wallet-cliSkill
- legacy-migrationSkill
- mvvm-architectureSkill
- new-packageSkill
- package-public-apiSkill
- pnpm-resolutionSkill
- prefer-set-hasSkill
- pre-reviewSkill
- rebuild-to-fix-lib-import-errorsSkill
- remove-feature-flagSkill
- run-buildsSkill
- run-e2e-ciSkill
- runner-imagesSkill
- run-testsSkill
- slack-pr-messageSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 11 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Keep components focused and reasonably sized.
- Distinctive: line 15
Use composition for extensibility.
- Very specific: line 20
Use RTK Query (with slices) only when necessary for app-wide state.
- Very specific: line 26
Mobile: use Lumen UI React Native — see ldls-native.
- Very specific: line 27
Desktop: use Lumen UI React — see ldls-web.
- Distinctive: line 28
All styles must support theme switching (dark/light mode).
- Distinctive: line 36
Use lazy loading for large screens or modules.
- Distinctive: line 40
Mobile: use React Navigation; ensure correct deep-link support.
- Distinctive: line 41
Desktop: use React Router; implement route guards when necessary.
- Very specific: line 45
Use RTK Query hooks from a domain/api package.
- Distinctive: line 46
Use consistent loading, retry, and error states.
- Distinctive: line 47
Prefer optimistic UI when appropriate.
- Distinctive: line 53
Desktop: use semantic HTML tags; implement full keyboard navigation.
- Very specific: line 64
React Native: use Platform.select for small iOS/Android variations inside a .native file.
- Distinctive: line 65
Desktop: use environment flags for Electron/Web differences.
- Very specific: line 69
Mobile: use the native driver whenever feasible.
- Distinctive: line 70
Desktop: use CSS transitions for lightweight animations.
- Very specific: line 76
Keep translation keys descriptive and structured.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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.
Files
General React & React Native Patterns
These rules apply to all files, including those inside src/mvvm/. See mvvm-architecture for MVVM-specific structure.
Component Architecture
- Prefer functional components.
- Keep components focused and reasonably sized.
- Decompose large UI into smaller reusable elements.
- Use composition for extensibility.
State Management
- Prioritize local state for UI-only concerns.
- Use RTK Query (with slices) only when necessary for app-wide state. See
domain-data. - Apply optimized selectors to limit re-rendering.
- Connect Redux at the lowest component level when possible.
Styling
- Mobile: use Lumen UI React Native — see
ldls-native. - Desktop: use Lumen UI React — see
ldls-web. - All styles must support theme switching (dark/light mode).
Performance
- Memoize expensive operations with
useMemo. - Stabilize callbacks with
useCallback. - Wrap costly components in
React.memo. - Apply list virtualization where needed.
- Use lazy loading for large screens or modules.
Navigation
- Mobile: use React Navigation; ensure correct deep-link support; keep navigation types strict.
- Desktop: use React Router; implement route guards when necessary; maintain clear history logic.
Data Fetching
- Use RTK Query hooks from a
domain/apipackage. Seedomain-data. - Use consistent loading, retry, and error states.
- Prefer optimistic UI when appropriate.
- Apply caching and stale-time strategies.
Accessibility
- Mobile: provide accessible labels for all interactive elements; support screen reader flows; ensure proper focus transitions.
- Desktop: use semantic HTML tags; implement full keyboard navigation; apply meaningful ARIA attributes when required.
Error Boundaries
- Wrap critical areas in error boundaries.
- Report errors to monitoring services.
- Provide clean, user-friendly fallback UIs.
Platform-Specific Code
- Web vs native (packages under
features/,shared/,domain/): split by file suffix,X.web.tsxfor desktop andX.native.tsxfor mobile, and import the unsuffixed./X. ThemoduleSuffixesinsupport/tsconfig/web.jsonandsupport/tsconfig/native.jsonpick the right file. Both files take one props contract: theX.types.tscontract inuniversal-components. - React Native: use
Platform.selectfor small iOS/Android variations inside a.nativefile; ensure behavior parity across iOS and Android. - Desktop: use environment flags for Electron/Web differences; keep platform abstraction consistent.
Animations
- Mobile: use the native driver whenever feasible; prefer
Animatedand layout animations for performance. - Desktop: use CSS transitions for lightweight animations; use Framer Motion for complex animations; respect reduced-motion system preferences.
Internationalization (i18n)
- In
features/,domain/andshared/, importuseTranslationandTransfrom@shared/i18n, never fromreact-i18next. The app mounts itsI18nProvideronce; seeshared/i18n/README.md. - In
apps/*, keep usingreact-i18next. - Keep translation keys descriptive and structured; features own their keys (see
i18n-keys). - Support pluralization, gender, and variable interpolation.
- Validate components across multiple locales.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

