> loading_
# Walkthrough: How React Native support integrates into Shipli AI
# This follows the same pattern used for Flutter support.
# 1. Project detection — Shipli AI recognizes React Native projects
# by checking for signature files and dependencies.
# Updated in the detection/configuration module:
#
# def detect_project_type(project_root):
# package_json = load_json(project_root / 'package.json')
# dependencies = {
# **package_json.get('dependencies', {}),
# **package_json.get('devDependencies', {})
# }
# if 'react-native' in dependencies:
# return 'react-native'
# if 'app.json' exists and contains 'expo':
# return 'react-native-expo'
# # ... existing Flutter/web detection
# 2. Rule sets — New files under rules/react-native/ define
# platform-specific auditing rules:
#
# rules/react-native/
# ├── navigation.yaml # React Navigation / Expo Router patterns
# ├── state-management.yaml # Redux, Zustand, Context anti-patterns
# ├── native-modules.yaml # Bridge call validation, turbo modules
# ├── performance.yaml # FlatList vs ScrollView, memo usage, re-render detection
# └── project-structure.yaml # Expected directory layout, index registration
# 3. Guidelines module — Best-practice guidelines loaded when
# project type is 'react-native':
#
# guidelines/react-native/
# ├── styling.md # StyleSheet.create vs inline styles
# ├── async-storage.md # Secure storage patterns
# └── platform-specific.md # Platform.OS checks, .ios.js/.android.js splits
# 4. Auditor integration — The core auditor loads the correct
# rule set based on detected project type:
#
# class Auditor:
# def load_rules(self, project_type):
# rules_dir = Path(f'rules/{project_type}')
# self.rules = [parse_rule(f) for f in rules_dir.glob('*.yaml')]
#
# def audit(self, project_root):
# project_type = detect_project_type(project_root)
# self.load_rules(project_type)
# # Run each rule against the project files
# for rule in self.rules:
# violations = rule.evaluate(project_root)
# self.report(violations)
# 5. MCP server workflow — The MCP server exposes React Native
# auditing as a tool alongside web and Flutter:
#
# @mcp_tool(name='audit_react_native')
# def audit_react_native(repo_url: str, branch: str = 'main'):
# project = clone_and_detect(repo_url, branch)
# assert project.type in ('react-native', 'react-native-expo')
# auditor = Auditor()
# return auditor.audit(project.root)
# Try it: point Shipli AI at any React Native repo and run an audit.
# The platform detection is automatic — no configuration needed.