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:
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:
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:
import { GluestackUIProvider } from "@/components/ui/gluestack-ui-provider";
import "@/global.css"; // If using NativeWind or global styles
export default function Layout() {
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.
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.
B. Common Components & Usage
Layout: Use Box, VStack, HStack, Center for layout instead of raw View styles.
Linking: Use Link from expo-router for web-compatible navigation.
6. Coding Best Practices for Agents
File Structure:
Keep screens in app/ (if using Expo Router).
Keep reusable UI components in components/.
Keep business logic/hooks in hooks/ or utils/.
Code Style:
Use functional components.
Use Hooks (useState, useEffect) appropriately.
Type Safety: strict TypeScript usage. Define interfaces for props.
Error Handling:
When running commands (like npx gluestack-ui add), if they fail, analyze the error (e.g., missing peer dependencies) and fix it before proceeding.
Dependency Management:
Expo Compatibility First: Always prioritize installing packages compatible with the latest Expo SDK.
Use npx expo install [package-name] instead of npm install or yarn add when possible, as this ensures the installed version is compatible with the project's Expo SDK version.
Focus: Best practices for building, deploying (EAS), and upgrading Expo applications.
Instruction: Use these skills for:
upgrading-expo: When moving between Expo SDK versions.
expo-deployment: For setting up EAS Build and Submit.
expo-app-design: General Expo app architecture guidance.
1---2name: expo-gluestack3description: Comprehensive instructions for building Expo apps using gluestack-ui.4---56# Agent Skills: Building Beautiful Expo Apps with Gluestack UI
78This 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**.
910## 1. Technology Stack & Environment
1112- **Framework**: React Native (via Expo)
13- **UI Library**: gluestack-ui
14- **Language**: TypeScript (Preferred)
15- **Navigation**: Expo Router (Standard for modern Expo apps)
1617## 2. Project Initialization Skills
1819When starting a new project or setting up the environment, the agent must follow these steps:
2021### A. Create Expo Project
22Use the latest Expo template:
23```bash
24npx create-expo-app@latest my-app --template default
25cd my-app
26```
2728### B. Install gluestack-ui
29Follow the official installation guide to integrate gluestack-ui:
30311. **Initialize gluestack-ui**:
32 ```bash
33 npx gluestack-ui init
34 ```
35 - This command installs dependencies and adds the `GluestackUIProvider`.
36 - It sets up the theme configuration.
37 - It creates a `components` folder for your UI components.
38392. **Wrap Application Root**:
40 Ensure the root layout (e.g., `app/_layout.tsx` or `App.tsx`) is wrapped with the provider:
41 ```tsx
42 import { GluestackUIProvider } from "@/components/ui/gluestack-ui-provider";
43 import "@/global.css"; // If using NativeWind or global styles
4445 export default function Layout() {
46 return (
47 <GluestackUIProvider>
48 <Slot /> {/* or your main app content */}
49 </GluestackUIProvider>
50 );
51 }
52 ```
5354## 3. Component Management Skills
5556gluestack-ui is unstyled by default and headless, meaning you add components as you need them.
5758### A. Adding Components
59**NEVER** try to import a component that hasn't been added to the project. Always check the `components/ui` directory first.
6061To add a new component (e.g., Button, Box, Text):
62```bash
63npx gluestack-ui add [component-name]
64# Example:
65npx gluestack-ui add button box text
66```
67*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.*
6869### B. Common Components & Usage
70- **Layout**: Use `Box`, `VStack`, `HStack`, `Center` for layout instead of raw View styles.
71 ```tsx
72 <VStack space="md" reversed={false}>
73 <Box className="w-20 h-20 bg-primary-500" />
74 </VStack>
75 ```
76- **Typography**: Use `Text` and `Heading` with size props.
77- **Interactivity**: Use `Button`, `Pressable`, `Link`.
7879## 4. UI/UX Design & Styling Skills
8081### A. Theming & Tokens
82- Utilize the gluestack-ui tokens for spacing, colors, and typography to ensure consistency.
83- Avoid hardcoded pixel values for margins/padding; use tokens (e.g., `$2`, `$4`, `md`, `lg`).
8485### B. Responsive Design
86- gluestack-ui supports responsive props.
87- Example: `<Box w="$full" md-w="$1/2">` (Full width on mobile, half width on medium screens/tablets).
8889### C. "Beautiful" UI Principles
90- **Whitespace**: Use ample padding and margin (via `space` prop in stacks or padding props).
91- **Hierarchy**: Use font weights and colors to establish visual hierarchy.
92- **Feedback**: Ensure interactive elements have hover/pressed states (gluestack handles this by default, but customization is possible).
9394## 5. Advanced Development Patterns
9596### A. State Management
97- **Global State**: Use **Zustand** for lightweight global state (e.g., user session, theme settings).
98 - *Why*: Minimal boilerplate, easy to use with hooks.
99- **Server State**: Use **TanStack Query (React Query)** for data fetching.
100 - *Why*: Handles caching, loading states, and refetching automatically.
101102### B. Form Handling
103- Use **React Hook Form** controlled by **Zod** schema validation.
104 - *Why*: Performance (minimizes re-renders) and type safety.
105 ```tsx
106 import { useForm, Controller } from "react-hook-form";
107 import { zodResolver } from "@hookform/resolvers/zod";
108 // ... define z.object schema ...
109 ```
110111### C. Iconography
112- Use **Lucide Icons** (`lucide-react-native`).
113- Gluestack-ui integrates well with Lucide.
114 ```tsx
115 import { Camera } from "lucide-react-native";
116 import { Icon } from "@/components/ui/icon";
117 // Usage: <Icon as={Camera} size="md" />
118 ```
119120### D. Navigation (Expo Router)
121- **Structure**:
122 - `app/_layout.tsx`: Root provider setup (gluestack, query client).
123 - `app/(tabs)`: For tab-based navigation.
124 - `app/[id].tsx`: For dynamic routes.
125- **Linking**: Use `Link` from `expo-router` for web-compatible navigation.
126127## 6. Coding Best Practices for Agents
1281291. **File Structure**:
130 - Keep screens in `app/` (if using Expo Router).
131 - Keep reusable UI components in `components/`.
132 - Keep business logic/hooks in `hooks/` or `utils/`.
1331342. **Code Style**:
135 - Use functional components.
136 - Use Hooks (`useState`, `useEffect`) appropriately.
137 - **Type Safety**: strict TypeScript usage. Define interfaces for props.
1381393. **Error Handling**:
140 - When running commands (like `npx gluestack-ui add`), if they fail, analyze the error (e.g., missing peer dependencies) and fix it before proceeding.
1411424. **Dependency Management**:
143 - **Expo Compatibility First**: Always prioritize installing packages compatible with the latest Expo SDK.
144 - Use `npx expo install [package-name]` instead of `npm install` or `yarn add` when possible, as this ensures the installed version is compatible with the project's Expo SDK version.
145146## 7. Workflow Checklist
147148When assigned a task to build a screen:
1491. [ ] Analyze requirements.
1502. [ ] Identify necessary UI components (e.g., Card, Avatar, Button).
1513. [ ] Check if components exist in `components/ui`; if not, run `npx gluestack-ui add ...`.
1524. [ ] Scaffold the screen using `VStack`/`HStack` for layout.
1535. [ ] Apply styling using theme tokens.
1546. [ ] Verify responsiveness.
155156## 8. External Agent Skills & Resources
157158To enhance capability, the agent should leverage established skill sets from industry leaders:
159160### A. React Native Best Practices (Callstack)
161- **Repository**: [callstackincubator/agent-skills](https://github.com/callstackincubator/agent-skills)
162- **Focus**: Performance optimization (re-renders, startup time), bundling, and native modules.
163- **Instruction**: Consult these skills when optimizing app performance or debugging complex native issues.
164165### B. Expo Official Skills
166- **Repository**: [expo/skills](https://github.com/expo/skills)
167- **Focus**: Best practices for building, deploying (EAS), and upgrading Expo applications.
168- **Instruction**: Use these skills for:
169 - `upgrading-expo`: When moving between Expo SDK versions.
170 - `expo-deployment`: For setting up EAS Build and Submit.
171 - `expo-app-design`: General Expo app architecture guidance.
Run npx skillmds@latest add majiayu000/expo-gluestack in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Comprehensive instructions for building Expo apps using gluestack-ui. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: makes network calls. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
majiayu000 (@majiayu000) published this skill. Their other Agent Skills are listed on their SkillMD profile.