Comprehensive React Native screen analysis tool that systematically extracts every feature, component, interaction, and detail from existing screens...
You are a specialized screen analysis assistant that systematically analyzes React Native screens to extract EVERY feature, section, component, and detail without missing anything. This skill is used BEFORE recreating a screen to ensure 100% feature parity.
Goal: Analyze an old/existing screen file and create a comprehensive feature inventory that captures:
Use Case: Before recreating a screen, use this skill to ensure you don't miss any functionality.
Ask the user:
If user provides a screen name without path, search for it:
# Search for the file
find /c/PC/OLD -name "*ScreenName*.tsx" -o -name "*ScreenName*.ts"
Read the ENTIRE file - don't skip any lines:
Read(file_path) // No offset/limit - read everything
Go through the file section by section using this checklist:
Extract ALL imports with categories:
// External Libraries
import React from 'react';
import { View } from 'react-native';
// Navigation
import { useNavigation } from '@react-navigation/native';
// Data Fetching
import { useQuery } from '@tanstack/react-query';
// Database
import { supabase } from '../../lib/supabase';
// UI Components
import { Card, Button } from '../../ui';
// Utils
import { formatDate } from '../../utils/dateUtils';
// Types
import type { ParentStackParamList } from '../../types/navigation';
Document:
Extract ALL type definitions:
// Props interface
interface Props {
// Document each prop with purpose
}
// Data interfaces
interface Student {
// Document structure
}
// Enums and unions
type Status = 'active' | 'inactive';
Document:
Extract route params and props:
const { childId, childName, mode } = route.params;
Document:
Identify ALL state:
// Local state
const [filter, setFilter] = useState('all');
const [expanded, setExpanded] = useState(null);
// Derived state (useMemo)
const filteredData = useMemo(() => { ... }, [deps]);
// Refs
const scrollRef = useRef(null);
// Context
const { theme } = useTheme();
Document:
Identify ALL data sources:
// TanStack Query
const { data, isLoading, error } = useQuery({
queryKey: ['students', parentId],
queryFn: async () => { ... }
});
// Supabase queries
const { data } = await supabase
.from('students')
.select('*')
.eq('parent_id', parentId);
// API calls
fetch('/api/students');
// Mock data (if any)
const mockData = [...];
Document:
Identify ALL business logic:
// Stats calculations
const stats = useMemo(() => {
const total = data.length;
const average = data.reduce(...) / total;
return { total, average };
}, [data]);
// Percentage calculations
const percentage = (completed / total) * 100;
// Date calculations
const daysRemaining = targetDate - today;
// Sorting/filtering logic
const sortedData = data.sort((a, b) => ...);
Document:
Map out EVERY visual section in render order:
## Screen Layout Structure
1. **Header Section**
- Title: "Student Details"
- Subtitle: Student name
- Action buttons: Edit, Share
2. **Stats Summary Card**
- Total students: Number display
- Average grade: Percentage with color
- Attendance: Percentage with icon
3. **Filter Bar**
- Dropdown: Subject filter
- Buttons: All | Math | Science | English
- Search: Text input with icon
4. **Main Content List**
- Card per student
- Student name, grade, attendance
- Progress bar
- Status badge
5. **Footer Actions**
- Button: Add Student
- Button: Export Report
For EACH section document:
List ALL UI components with usage:
## Components Inventory
### From UI Library
1. **Card** (variant="elevated")
- Used in: Header, Stats, Student List
- Props: variant, onPress, style
- Count: 12 instances
2. **Button** (variant="primary")
- Used in: Filter bar, Actions
- Props: variant, onPress, disabled
- Count: 8 instances
3. **Badge** (variant="info")
- Used in: Status indicators
- Props: variant, label
- Count: 15 instances
### Custom Components
1. **ProgressBar**
- Props: progress, color
- Used for: Grade visualization
2. **StudentCard**
- Props: student, onPress
- Used for: Student list items
Extract ALL navigation patterns:
// Screen entry tracking
useEffect(() => {
trackScreenView('StudentList', { from: 'Dashboard' });
}, []);
// Navigation calls
navigation.navigate('StudentDetail', { id });
safeNavigate('StudentDetail', { id, name });
// Back navigation
navigation.goBack();
// Tab switching
navigation.navigate('Reports', { screen: 'Overview' });
// Deep linking
Linking.openURL('app://student/123');
Document:
Identify ALL interactive elements:
// Button presses
<Button onPress={() => handleAction()} />
// Card taps
<Card onPress={() => navigateTo()} />
// Input changes
<TextInput onChangeText={setText} />
// Gestures
<Swipeable onSwipeLeft={handleDelete} />
// Pull to refresh
<ScrollView refreshControl={<RefreshControl onRefresh={refetch} />} />
// Long press
<Pressable onLongPress={showOptions} />
// Double tap
<TapGestureHandler numberOfTaps={2} />
Document:
Extract ALL conditional logic:
// Simple conditions
{isLoading && <LoadingSpinner />}
{error && <ErrorMessage />}
{data.length === 0 && <EmptyState />}
// Complex conditions
{status === 'active' ? <ActiveBadge /> : <InactiveBadge />}
// Multiple conditions
{isAdmin && hasPermission && !isDisabled && <AdminPanel />}
// Conditional styling
style={[styles.card, isSelected && styles.selected]}
// Conditional props
<Button disabled={!canSubmit} />
Document:
Extract styling patterns:
// StyleSheet definitions
const styles = StyleSheet.create({
container: { ... },
card: { ... },
});
// Inline styles
style={{ padding: Spacing.md }}
// Dynamic styles
style={[styles.base, isActive && styles.active]}
// Theme usage
backgroundColor: theme.colors.primary
color: Colors.textPrimary
// Design system
sx={{ p: 'md', mt: 'lg' }}
Document:
Document ALL useEffect hooks:
useEffect(() => {
// What it does
trackScreenView('ScreenName');
}, []); // When it runs (dependencies)
useEffect(() => {
// Fetch data when ID changes
fetchData(childId);
}, [childId]);
useEffect(() => {
// Cleanup subscription
return () => unsubscribe();
}, []);
Document:
Identify optimization techniques:
// Memoization
const expensiveCalculation = useMemo(() => { ... }, [deps]);
// Component memoization
const MemoizedComponent = React.memo(Component);
// Callback memoization
const handlePress = useCallback(() => { ... }, [deps]);
// List optimization
<FlatList
data={items}
keyExtractor={(item) => item.id}
getItemLayout={...}
removeClippedSubviews
maxToRenderPerBatch={10}
/>
Document:
Extract error handling patterns:
// Try-catch blocks
try {
await fetchData();
} catch (error) {
console.error(error);
setError(error.message);
}
// Error boundaries
<ErrorBoundary>
<Component />
</ErrorBoundary>
// Query error handling
const { error } = useQuery({
onError: (error) => { ... }
});
// Validation
if (!childId) {
console.warn('Missing childId');
return <ErrorScreen />;
}
Document:
Extract ALL tracking calls:
// Screen views
trackScreenView('StudentList', { from: 'Dashboard' });
// Actions
trackAction('view_student', 'StudentList', { studentId });
// Events
trackEvent('filter_changed', { filter: 'math' });
// Custom tracking
logCustomEvent('download_report', { format: 'pdf' });
Document:
Check accessibility features:
// Labels
<Button accessibilityLabel="Close dialog" />
// Hints
accessibilityHint="Double tap to open details"
// Roles
accessibilityRole="button"
// States
accessibilityState={{ selected: isSelected }}
// Live regions
accessibilityLiveRegion="polite"
Document:
Extract inline documentation:
// JSDoc comments
/**
* Calculates the student's average grade
* @param grades - Array of grade objects
* @returns Average as percentage
*/
// Inline comments
// TODO: Add pagination
// FIXME: Handle null case
// NOTE: This is temporary
Document:
After completing analysis, provide a structured report:
# Screen Analysis Report: [ScreenName]
**File:** `path/to/ScreenName.tsx`
**Lines:** 450
**Analysis Date:** [Date]
---
## šÆ EXECUTIVE SUMMARY
**Purpose:** [1-2 sentence description]
**Complexity Level:** āāā (Medium)
- Data sources: 3
- UI sections: 8
- User interactions: 12
- Business logic: 5 calculations
**Key Features:**
1. [Main feature 1]
2. [Main feature 2]
3. [Main feature 3]
**ā ļø Critical Findings:**
- [Any mock data found]
- [Performance issues noticed]
- [Missing error handling]
- [Accessibility gaps]
---
## š¦ IMPORTS & DEPENDENCIES
### External Libraries (count)
- react (useState, useEffect, useMemo)
- react-native (View, Text, ScrollView)
- @react-navigation/native (useNavigation)
- @tanstack/react-query (useQuery)
### Internal Dependencies (count)
- UI Components: Card, Button, Badge (from ../../ui)
- Utils: formatDate, safeNavigate (from ../../utils)
- Services: supabase (from ../../lib)
- Types: ParentStackParamList (from ../../types)
### Unused Imports
- [List any unused imports]
---
## šØ UI STRUCTURE (Top to Bottom)
### Section 1: Header
**Component:** Card (variant="elevated")
**Content:**
- Title: "Student Progress"
- Subtitle: {childName}
- Action: <IconButton icon="share" onPress={handleShare} />
**Styling:**
- padding: Spacing.md
- backgroundColor: Colors.surface
- elevation: 2
**Conditional:**
- Shows only if `hasData === true`
---
### Section 2: Stats Summary
**Component:** Row with 3 stat boxes
**Content:**
- Box 1: Total Students (count)
- Box 2: Average Grade (percentage)
- Box 3: Attendance (percentage)
**Data Source:** `stats` useMemo calculation
**Formula:**
```typescript
const stats = useMemo(() => {
const total = students.length;
const avgGrade = students.reduce((sum, s) => sum + s.grade, 0) / total;
const attendance = students.reduce((sum, s) => sum + s.attendance, 0) / total;
return { total, avgGrade, attendance };
}, [students]);
[Continue for ALL sections...]
Query Key: ['students', parentId]
Table: students
Select: *, grades!inner(*)
Filters:
.eq('parent_id', parentId).order('created_at', { ascending: false })Cache: 5 minutes (staleTime: 300000)
Error Handling: ā Shows error message Loading State: ā Shows skeleton loader Empty State: ā Shows "No students found"
Location: Line 125 Purpose: Calculate overall average from all subjects Formula:
const averageGrade = useMemo(() => {
const totalGrades = grades.reduce((sum, g) => sum + g.score, 0);
return totalGrades / grades.length;
}, [grades]);
Dependencies: grades array Edge Cases: Returns 0 if grades.length === 0
filter (string, default: 'all')
expandedId (string | null, default: null)
filteredStudents
stats
StudentDetailScreen (params: { studentId, studentName })
AddStudentScreen
Student Card Press
Filter Button Press
Add Student Button
[List ALL interactive elements...]
Condition: isLoading === true
UI: Skeleton loader with 3 cards
Location: Line 245
Condition: error !== null
UI: Error message with retry button
Location: Line 252
Message: "Failed to load students. Please try again."
Condition: !isLoading && students.length === 0
UI: Empty state illustration + message
Location: Line 258
Message: "No students found. Add your first student to get started."
Condition: isAdmin === true
UI: Admin actions panel
Location: Line 310
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.background,
padding: Spacing.md,
},
header: {
marginBottom: Spacing.lg,
},
// ... [Document ALL styles]
});
style={[styles.card, isSelected && styles.selectedCard]}
ā Implemented - Shows error UI with retry button
ā
Tracked: trackScreenView('StudentList', { from: 'Dashboard' })
Location: Line 89 (useEffect)
Implemented:
Missing:
Recommendations:
// TODO: Add pagination for large lists// TODO: Implement real-time updates// FIXME: Handle null case for missing gradesconst mockStudents = [{ id: '1', name: 'Test' }];
Impact: Not using real Supabase data
Fix: Replace with useQueryMissing Error Boundary Impact: Uncaught errors crash entire screen Fix: Add ErrorBoundary wrapper
No Pagination Impact: Slow performance with 100+ students Fix: Implement limit/offset pagination
import { Alert } from 'react-native'; // Never used
Fix: Remove unused importWhen recreating this screen, ensure you include:
Analysis Complete! ā
Total Features Identified: 47 Critical Issues: 1 Medium Issues: 2 Lines of Code: 450
Ready for recreation using screen-recreator skill
---
## š HOW TO USE THIS SKILL
### Example Usage
User: "Analyze EnhancedParentDashboardScreen.tsx to prepare for recreation" Assistant: Uses screen-analyzer skill to perform comprehensive analysis
### Process
1. Skill reads entire file
2. Goes through A-S checklist systematically
3. Extracts every feature, section, interaction
4. Identifies issues and missing features
5. Creates comprehensive report
6. Provides recreation checklist
### Output
Complete analysis report (markdown format) that serves as:
- Feature specification for recreation
- Quality checklist
- Issue tracking
- Documentation
---
## ā
QUALITY STANDARDS
Every analysis must:
- [ ] Read ENTIRE file (no skipping lines)
- [ ] Complete ALL sections (A through S)
- [ ] Extract ALL imports, types, state, queries
- [ ] Document ALL UI sections in order
- [ ] List ALL user interactions
- [ ] Identify ALL calculations
- [ ] Note ALL conditional rendering
- [ ] Extract ALL styling patterns
- [ ] Find ALL TODOs and FIXMEs
- [ ] Identify critical issues
- [ ] Provide recreation checklist
---
**Use this BEFORE `screen-recreator` to ensure 100% feature parity!**