react-native-doctor
3
总安装量
3
周安装量
#61087
全站排名
安装命令
npx skills add https://github.com/yousefalwahami/react-native-doctor --skill react-native-doctor
Agent 安装分布
opencode
3
codex
3
gemini-cli
2
claude-code
2
github-copilot
2
kimi-cli
2
Skill 文档
React Native Doctor
Scans your React Native and Expo codebase for performance, accessibility, architecture, correctness, and security issues. Outputs a 0â100 score with actionable diagnostics.
Usage
npx -y react-native-doc@latest . --verbose
For Expo projects:
npx -y react-native-doc@latest . --verbose --expo-only
Workflow
- Run the command above at the project root
- Read every diagnostic with file paths and line numbers
- Fix issues starting with errors (highest severity)
- Re-run to verify the score improved
Rules (70+)
React Native
- Correctness: raw text outside
<Text>, deprecated modules, removed APIs (Dimensions.get) - Performance: inline
renderItemfunctions, missingkeyExtractor,ScrollViewfor long lists, inline style objects, anonymous JSX callbacks, heavy array chains in render, single-element style arrays, missingReact.memoon list items,AnimatedAPI (preferreact-native-reanimated) - Architecture: legacy shadow properties, hardcoded screen dimensions instead of
useWindowDimensions(), excessivePlatform.OSbranching, hardcoded colors, prop drilling, god components, unnecessaryuseEffectfor derived state - Images: missing explicit width/height on
<Image>
Accessibility
- Missing
accessibilityLabelon touchable elements - Missing
accessibilityRoleon interactive components - Non-descriptive labels (“button”, “tap here”, etc.)
- Images without
accessible+accessibilityLabel - Small tap targets without
hitSlop(< 44pt)
Navigation (React Navigation)
- Inline component definitions in
Stack.Screen - Missing
screenOptionsdefaults on navigators
Expo
- Hardcoded colors without
useColorScheme()dark mode support Constants.manifestâConstants.expoConfig_layout.tsxmissingErrorBoundaryexport- Hardcoded API keys in source code
- Missing
app/+not-found.tsxfor Expo Router
React (applies to all projects)
- Security:
eval(), secrets in client bundle - State & Effects: derived state in
useEffect, cascadingsetState, missing deps,fetchin effects, unnecessaryuseEffectfor derived state - Architecture: nested component definitions, giant components (>200 lines)
- Performance: missing
useMemo/useCallback, non-lazy state init, inline objects to memoized components - Bundle Size: barrel imports, full lodash,
moment.js - Dead Code: unused files, exports, types
Score
- 75+: Great
- 50â74: Needs work
- 0â49: Critical
Fix with an AI agent
After scanning, hand off to an agent to fix all issues automatically.
Ami
npx -y react-native-doc@latest . --fix
Cline
npx -y react-native-doc@latest . --cline
If the cline CLI is installed (npm install -g cline), runs it directly. Otherwise copies the fix prompt to clipboard and opens VS Code/Cline extension.