Agent Skills: Building Beautiful Expo Apps with Gluestack UI
This document defines the skill set and operational guidelines for AI agents working on this project. The primary goal is to build high-quality, visually appealing mobile applications using Expo and gluestack-ui.
1. Technology Stack & Environment
Framework: React Native (via Expo)
UI Library: gluestack-ui
Language: TypeScript (Preferred)
Navigation: Expo Router (Standard for modern Expo apps)
2. Project Initialization Skills
When starting a new project or setting up the environment, the agent must follow these steps:
A. Create Expo Project
Use the latest Expo template:
bash
npx create-expo-app@latest my-app --template default
cd my-app
B. Install gluestack-ui
Follow the official installation guide to integrate gluestack-ui:
Initialize gluestack-ui:
bash
npx gluestack-ui init
This command installs dependencies and adds the
GluestackUIProvider
.
It sets up the theme configuration.
It creates a
components
folder for your UI components.
Wrap Application Root:
Ensure the root layout (e.g.,
app/_layout.tsx
or
App.tsx
) is wrapped with the provider:
tsx
import{GluestackUIProvider}from"@/components/ui/gluestack-ui-provider";import"@/global.css";// If using NativeWind or global stylesexportdefaultfunctionLayout(){return(<GluestackUIProvider><Slot/>{/* or your main app content */}</GluestackUIProvider>);}
3. Component Management Skills
gluestack-ui is unstyled by default and headless, meaning you add components as you need them.
A. Adding Components
NEVER try to import a component that hasn't been added to the project. Always check the
components/ui
directory first.
To add a new component (e.g., Button, Box, Text):
bash
npx gluestack-ui add[component-name]# Example:npx gluestack-ui add button box text
Agent Note: If a user asks for a UI element, identify the corresponding gluestack component, run the add command if it's missing, and then implement it.