关于
This skill provides a standardized folder structure for new Expo apps using Expo Router, helping developers scaffold projects and decide where files should go. It includes organized directories for routes, components, utilities, and assets following modern conventions. Only use this for new projects—never restructure existing apps to match this layout.
快速安装
Claude Code
推荐npx skills add expo/skills -a claude-code/plugin add https://github.com/expo/skillsgit clone https://github.com/expo/skills.git ~/.claude/skills/expo-project-structure在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Expo Project Structure
A starting skeleton for a new Expo app — one with no committed folder structure yet.
Apply only to new projects. If the app already has a layout, follow its existing conventions and leave files where they are — a default to start from, never a standard to enforce or migrate toward. When unsure whether a project is new, ask before moving anything.
The whole layout, assembled from the rules below:
├── assets/
├── scripts/
├── src/
│ ├── app/ # Expo Router routes ONLY — every file is a route
│ │ ├── api/ # server API routes, grouped here
│ │ │ ├── user+api.ts
│ │ │ └── settings+api.ts
│ │ ├── _layout.tsx
│ │ ├── _layout.web.tsx # platform-specific layout
│ │ ├── index.tsx
│ │ └── settings.tsx
│ ├── components/ # reusable UI: button, card, table…
│ │ ├── table/ # complex component → folder + index.tsx
│ │ │ ├── cell.tsx
│ │ │ └── index.tsx
│ │ ├── bar-chart.tsx
│ │ ├── bar-chart.web.tsx # platform-specific variant
│ │ └── button.tsx
│ ├── screens/ # screen bodies that route files render
│ │ ├── home/
│ │ │ ├── card.tsx # used only by Home — not shared
│ │ │ └── index.tsx # rendered by src/app/index.tsx
│ │ └── settings.tsx
│ ├── server/ # server-only helpers used by app/api
│ │ ├── auth.ts
│ │ └── db.ts
│ ├── utils/ # standalone helpers + colocated tests
│ │ ├── format-date.ts
│ │ └── format-date.test.ts
│ ├── hooks/ # reusable hooks: use-theme.ts…
│ ├── constants.ts
│ └── theme.ts
├── app.json
├── eas.json
└── package.json
src/ and src/app
Keep app code under src/ to separate it from config files. Expo Router supports both app/ and src/app/ out of the box — to switch, move the folder and restart the bundler. The default template aliases @/* to ./src/* in tsconfig.json.
src/app is routes-only: every file there becomes a route, so nothing else belongs in it. Everything below lives in sibling folders.
components/ — reusable UI
Generic, reused UI (button, card, table) with one named export each. Name files in kebab-case (bar-chart.tsx), matching the default create-expo-app template. When a component grows, give it its own folder with the root in index.tsx and colocate its private sub-components beside it — the import path (@/components/table) stays unchanged.
screens/ — screen bodies
Because app/ files must be routes, complex screen UI that isn't reused has no home there. Once a screen grows big enough to need breaking out to separate components, put it in screens/ and let each route just render its screen:
import { Home } from "@/screens/home";
export default function HomeScreen() {
// route-specific concerns only — e.g. read url params here
return <Home />;
}
Colocate a screen's private components inside its folder (screens/home/components/). A bonus: the same screen can render under multiple routes.
server/ + app/api/ — separate server code
Appending +api to a file in app/ makes it a server API route. Server code is different from frontend code — it runs in a Node-like server environment (deployed with EAS Hosting or on third-party services) and can read secret env vars (process.env.X, not just EXPO_PUBLIC_*). Keep it apart:
- Group all routes under
app/api/→/api/user,/api/settings. This colocates them and avoids collisions (e.g. a/userscreen and a/userroute). - Put shared server-only helpers in
src/server/. - Consider ESLint rules that fence
+apifiles andserver/off from frontend-only checks.
Platform-specific code
Small differences: use Platform.select / Platform.OS. For larger ones, split into platform files instead of inline if/else — bar-chart.tsx + bar-chart.web.tsx, imported extension-free (@/components/bar-chart); Metro picks the right file per target.
- Props must be identical across variants.
- A default file (no platform extension) is always required — make it a no-op if the component is single-platform.
- Supported extensions:
.ios,.android,.native,.web.
Colocate styles and tests
- Styles: keep the
StyleSheet.create({ ... })object at the bottom of the component file rather than in a separate.stylesfile. - Tests: put
format-date.test.tsnext toformat-date.ts(preferred over a separate__tests__/folder) so tested files are obvious at a glance.
AI and config files
Agent instructions live at the repo root — AGENTS.md / CLAUDE.md, with project skills under .claude/. Other config and assets stay outside src/: app.json / app.config.ts, eas.json, package.json, assets/, and scripts/.
Based on Expo app folder structure best practices by Kadi Kraman. For src/ precedence and alias mechanics, see the Expo docs.
GitHub 仓库
Frequently asked questions
What is the expo-project-structure skill?
expo-project-structure is a Claude Skill by expo. Skills package instructions and resources that Claude loads on demand, so Claude can perform expo-project-structure-related tasks without extra prompting.
How do I install expo-project-structure?
Use the install commands on this page: add expo-project-structure to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does expo-project-structure belong to?
expo-project-structure is in the Other category, tagged api.
Is expo-project-structure free to use?
Yes. expo-project-structure is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.
相关推荐技能
LlamaGuard是Meta推出的7-8B参数内容审核模型,专门用于过滤LLM的输入和输出内容。它能检测六大安全风险类别(暴力/仇恨、性内容、武器、违禁品、自残、犯罪计划),准确率达94-95%。开发者可通过HuggingFace、vLLM或Sagemaker快速部署,并能与NeMo Guardrails集成实现自动化安全防护。
这个Claude Skill帮助开发者优化云成本,通过资源调整、标记策略和预留实例来降低AWS、Azure和GCP的开支。它适用于减少云支出、分析基础设施成本或实施成本治理策略的场景。关键功能包括提供成本可视化、资源规模调整指导和定价模型优化建议。
该Skill为开发者提供体育博彩数据分析工具,可分析盘口、大小球和特殊投注,识别价值投注机会。它整合历史数据和情景统计,生成包含时间戳的结构化Markdown报告。适用于需要快速获取博彩市场洞察的娱乐或教育类应用开发。
这个Skill使用bitsandbytes库量化大语言模型,能在GPU内存有限时通过8位或4位量化减少50-75%内存占用,同时保持精度损失最小。它支持INT8、NF4、FP4等多种量化格式,可与HuggingFace Transformers无缝集成,适用于需要部署更大模型或加速推理的场景。还提供QLoRA训练和8位优化器支持,让开发者能轻松实现高效模型压缩。
