| name | bee:dev-frontend-performance-react-native |
| title | React Native frontend development cycle performance testing (Gate 6) |
| category | development-cycle-frontend-react-native |
| tier | 1 |
| when_to_use | Use after E2E testing (Gate 5) is complete in the React Native frontend dev cycle.
MANDATORY for all React Native frontend development tasks - ensures performance meets mobile thresholds.
|
| description | Gate 6 of the React Native frontend development cycle - ensures JS bundle size within budget,
Hermes engine enabled, FlatList/FlashList correctly used, image optimization applied,
and no unnecessary re-renders detected. Covers React Native-specific optimizations including
memo, useCallback, useMemo, and FlashList for performant list rendering.
|
| trigger | - After E2E testing complete (Gate 5)
- MANDATORY for all React Native frontend development tasks
- Validates performance before code review
|
| NOT_skip_when | - "Performance is fine on my machine/simulator" - Physical devices and low-end Android differ greatly.
- "We'll optimize later" - Performance debt compounds on mobile.
- "It's a small change" - Small changes can cause re-render cascades.
|
| sequence | {"after":["bee:dev-frontend-e2e-react-native"],"before":["bee:requesting-code-review"]} |
| related | {"complementary":["bee:dev-cycle-frontend-react-native","bee:dev-frontend-e2e-react-native","bee:qa-analyst-frontend-react-native"]} |
| input_schema | {"required":[{"name":"unit_id","type":"string","description":"Task or subtask identifier"},{"name":"implementation_files","type":"array","items":"string","description":"Files from Gate 0 implementation"}],"optional":[{"name":"performance_baseline","type":"object","description":"Previous performance metrics for comparison"},{"name":"gate5_handoff","type":"object","description":"Full handoff from Gate 5 (E2E testing)"}]} |
| output_schema | {"format":"markdown","required_sections":[{"name":"Performance Testing Summary","pattern":"^## Performance Testing Summary","required":true},{"name":"Bundle Analysis","pattern":"^## Bundle Analysis","required":true},{"name":"Handoff to Next Gate","pattern":"^## Handoff to Next Gate","required":true}],"metrics":[{"name":"result","type":"enum","values":["PASS","FAIL"]},{"name":"bundle_size_kb","type":"integer"},{"name":"bundle_size_change_percent","type":"float"},{"name":"hermes_enabled","type":"boolean"},{"name":"flashlist_violations","type":"integer"},{"name":"unnecessary_rerender_count","type":"integer"},{"name":"iterations","type":"integer"}]} |
| verification | {"automated":[{"command":"grep -rn 'jsEngine.*hermes\\|\"jsEngine\": \"hermes\"' --include='*.json' --include='*.ts' .","description":"Hermes engine enabled","success_pattern":"hermes"},{"command":"grep -rn 'FlashList\\|FlatList' --include='*.tsx' --include='*.jsx' . | wc -l","description":"List component usage detected","success_pattern":"[0-9]+"},{"command":"grep -rn 'React.memo\\|useMemo\\|useCallback' --include='*.tsx' --include='*.ts' . | wc -l","description":"Memoization usage detected","success_pattern":"[0-9]+"}],"manual":["JS bundle size increase < 10% vs baseline","Hermes enabled in app.json / build.gradle","All lists with > 10 items use FlashList (not FlatList)","Image components use react-native-fast-image or Expo Image","No unnecessary re-renders detected via react-native-performance or Flashlight","UI thread not blocked during animations"]} |
| examples | [{"name":"Performance tests for transaction list screen","input":{"unit_id":"task-001","implementation_files":["src/screens/TransactionListScreen.tsx"]},"expected_output":"## Performance Testing Summary\n**Status:** PASS\n**Bundle Change:** +2.8% (< 10%)\n**Hermes:** Enabled\n**FlashList Violations:** 0\n**Unnecessary Re-renders:** 0\n\n## Bundle Analysis\n| Metric | Current | Baseline | Change | Status |\n|--------|---------|----------|--------|--------|\n| JS Bundle (gzipped) | 2.1MB | 2.04MB | +2.8% | PASS |\n\n## Handoff to Next Gate\n- Ready for Gate 7 (Code Review): YES\n"}] |