### Install Agent Skills via GitHub CLI Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/README.md Commands to install all or specific skills using the GitHub CLI. ```bash gh skill install AmazonAppDev/devices-agent-skills --all ``` ```bash gh skill install AmazonAppDev/devices-agent-skills vega-multi-tv-migration --agent --scope project ``` -------------------------------- ### Install Agent Skills via skills.sh CLI Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/README.md Commands to install skills using the npx-based skills.sh CLI. ```bash npx skills add AmazonAppDev/devices-agent-skills ``` ```bash npx skills add AmazonAppDev/devices-agent-skills --skill vega-multi-tv-migration npx skills add AmazonAppDev/devices-agent-skills --skill rn-tv-ui-best-practices ``` -------------------------------- ### Configure Vega Package Dependencies Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE2_IMPLEMENTATION.md Example configuration for adding the local shared workspace as a dependency in the Vega package. ```json { "name": "@myapp/vega", "dependencies": { "@myapp/shared": "*" } } ``` -------------------------------- ### SelectUserProfile Screen Component Extraction Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE1_ANALYSIS.md Example breakdown of shared and platform-specific components for the SelectUserProfile screen. ```text SelectUserProfile Screen: ├── Shared: Layout, styling, props interface (profiles[], onSelect, onAdd) ├── Vega: from kepler-ui-components ├── Android: + Pressable with onFocus/onBlur └── Use SelectUserProfile.kepler.tsx / .android.tsx ``` -------------------------------- ### Set initial focus with hasTVPreferredFocus Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/rn-tv-ui-best-practices/references/navigation-and-focus.md Use hasTVPreferredFocus to define the starting focus point when a screen renders. Ensure only one element per screen scope has this prop to avoid unpredictable behavior. ```jsx Start Watching ``` -------------------------------- ### Build Android TV Application Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE3_PLATFORM_SUPPORT.md Execute prebuild and build commands for the Android TV platform. ```bash yarn expotv:prebuild yarn expotv:android ``` -------------------------------- ### Run Expo TV Build Commands Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE3_PLATFORM_SUPPORT.md Commands for generating native projects and running the application on Android TV or Apple TV. ```bash yarn expotv:prebuild # Generate native projects yarn expotv:android # Run on Android TV yarn expotv:ios # Run on Apple TV ``` -------------------------------- ### Execute tvOS Build Fix and Build Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE3_PLATFORM_SUPPORT.md Apply execution permissions to the fix script and run the build process for Apple TV. ```bash chmod +x packages/expotv/scripts/fix-tvos-deployment.sh yarn expotv:prebuild yarn expotv:ios ``` -------------------------------- ### Implement a permanent drawer navigator Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/rn-tv-ui-best-practices/references/layout-patterns.md Configures a drawer navigator for global navigation, using permanent display and a fixed width suitable for 10ft viewing. ```jsx import { createDrawerNavigator } from "@react-navigation/drawer"; import { NavigationContainer } from "@react-navigation/native"; const Drawer = createDrawerNavigator(); export function App() { return ( ); } ``` -------------------------------- ### Scaffold Expo TV Directory Structure Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE3_PLATFORM_SUPPORT.md Create the necessary directory structure for the Expo TV package within the monorepo. ```bash mkdir -p packages/expotv/{assets,components,constants,hooks,layouts} mkdir -p packages/expotv/app/\(tabs\) mkdir -p packages/expotv/assets/{fonts,images,tv_icons} mkdir -p packages/expotv/components/navigation mkdir -p packages/expotv/scripts ``` -------------------------------- ### Configure Expo TV app.json Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE2_IMPLEMENTATION.md Sets up the Expo configuration, including plugins for TV-specific build properties and routing. ```json { "expo": { "name": "MyAppTV", "slug": "myapp-tv", "orientation": "landscape", "platforms": ["android", "ios"], "scheme": "myapp-tv", "plugins": [ "@react-native-tvos/config-tv", ["expo-build-properties", { "android": { "kotlinVersion": "1.9.25" }, "ios": { "deploymentTarget": "15.1" } }], "expo-router" ] } } ``` -------------------------------- ### Scaffold Monorepo Directory Structure Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE2_IMPLEMENTATION.md Commands to initialize a Yarn workspace and create the required directory hierarchy for shared, Vega, and Expo TV packages. ```bash mkdir myapp cd myapp yarn init -2 yarn set version stable mkdir -p packages/shared/src/{assets,components,hooks,providers,reactquery,services,utils} mkdir -p packages/vega/src/{assets,components,navigation,screens} mkdir -p packages/expotv/{app,assets,components,constants,hooks,layouts} mkdir -p packages/expotv/app/\(tabs\) mkdir -p packages/expotv/assets/{fonts,images,tv_icons} mkdir -p packages/expotv/components/navigation mkdir -p packages/expotv/scripts ``` -------------------------------- ### Add VMRP-Compatible Library Versions Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE2_IMPLEMENTATION.md Define both standard and Vega-specific versions in the dependencies section of packages/vega/package.json. ```json { "dependencies": { "react-native-reanimated": "3.5.4", "@amazon-devices/react-native-reanimated": "~2.0.0", "react-native-gesture-handler": "2.13.0", "@amazon-devices/react-native-gesture-handler": "2.0.0+2.13.0", "@react-navigation/native": "6.1.9", "@amazon-devices/react-navigation__native": "^2.0.0" } } ``` -------------------------------- ### Import TVFocusGuideView on Vega Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/rn-tv-ui-best-practices/references/vega-specifics.md Use the specific Vega package import path instead of the standard react-native package. ```javascript import { TVFocusGuideView } from '@amazon-devices/react-native-kepler'; ``` -------------------------------- ### Configure Root Package Scripts Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE3_PLATFORM_SUPPORT.md Define workspace scripts in the root package.json to manage the Expo TV package. ```json { "scripts": { "expotv": "yarn workspace mytvproject", "expotv:prebuild": "yarn workspace mytvproject run prebuild", "expotv:android": "yarn workspace mytvproject run android", "expotv:ios": "yarn workspace mytvproject run ios", "expotv:web": "yarn workspace mytvproject run web" } } ``` -------------------------------- ### Initialize Yarn Workspace Source: https://github.com/amazonappdev/devices-agent-skills/blob/main/skills/vega-multi-tv-migration/references/PHASE2_IMPLEMENTATION.md Commands to initialize a Yarn 4 workspace and execute package-specific scripts. ```bash yarn init -2 # Initialize yarn 4 yarn set version stable # Set to latest stable yarn install # Install dependencies yarn workspace @myapp/vega run