react-native-architecture
Skill0 starsChanged 11 days agoMITView on GitHub
Estándar de Screaming Architecture para React Native con Expo Router. Guía la estructuración por features, rutas delgadas en src/app, hooks con TanStack Query, estilos NativeWind y tests con cobertura >= 90%. Incluye scaffolds de feature y componente.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- Samueladewole/claude-skillstheir own version, first seen Oct 13, 2026
- ai4brands-design/claude-skillstheir own version, first seen Mar 22, 2026
- CodeWithBehnam/cc-docstheir own version, first seen Mar 15, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- xfstudio/skills★ 9same name
- ai4brands-design/claude-skills★ 2same name
- CodeWithBehnam/cc-docs★ 2same name
- Samueladewole/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- git-cleanupSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- openspec-update-changeSkill
- skill-creatorSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- openspec-update-changeSkill
- flutter-architectureSkill
- monorepo-architectureSkill
- nestjs-architectureSkill
- nextjs-architectureSkill
- dart-import-organizerSkill
- ssh-connectSkill
- git-cleanupSkill
- gh-cliSkill
- glab-cliSkill
- ts-import-organizerSkill
The file
Files
📱 React Native Screaming Architecture Standard
🎯 Propósito
Estandarizar el diseño y la modularización de apps React Native con Expo Router siguiendo Screaming Architecture (Feature-Driven / Domain-First), el equivalente móvil de nextjs-architecture. Garantiza código desacoplado mediante encapsulación en subcarpetas, rutas delgadas en src/app, separación de UI, hooks, servicios, esquemas y modelos, y tests con cobertura $\ge 90%$.
Stack asumido: Expo + Expo Router, TanStack Query, NativeWind (className), Zod, Jest + @testing-library/react-native, alias @/* → src/*.
⚡ Cuándo Activar esta Skill
- Al crear o refactorizar módulos de negocio en
src/features/<feature-name>/. - Al crear componentes compartidos (
src/components/common/) o específicos de una feature. - Al conectar pantallas con rutas de Expo Router (
src/app/**). - Al implementar flujos de datos con TanStack Query (hooks + servicios).
- Al definir esquemas Zod (
*.schema.ts) o modelos de dominio (models/*.ts). - Al validar nombres, sufijos y la política de barrel files.
Monorepo: si la app vive en
apps/mobile, aplica estas reglas dentro deapps/mobile/src/y usa tambiénmonorepo-architecture. Genera con--target-dir apps/mobile/src/features --app-dir apps/mobile/src/app.
📋 Flujo de Trabajo Paso a Paso
flowchart TD
A["1. Identificar Feature"] --> B["2. Scaffolding\n(scripts/scaffold-feature.mjs)"]
B --> C["3. Modelos\n(models/*.ts)"]
C --> D["4. Servicios\n(services/<verb>-<noun>/)"]
D --> E["5. Esquemas Zod & Hooks\n(schemas/* y hooks/*)"]
E --> F["6. Componentes & Screens\n(components/* y screens/*)"]
F --> G["7. Ruta delgada en Expo Router\n(src/app/**)"]
G --> H["8. Tests >= 90%"]1. Modelado de dominio (models/)
Archivos planos TypeScript en models/<entity>.ts, con models/index.ts que los reexporta. Sin tests.
2. Servicios (services/)
Un servicio por subcarpeta: <verb>-<noun>/<verb>-<noun>.service.ts con su test e index.ts. Usan fetch o el cliente HTTP de src/config/; no hay Server Actions en móvil.
3. Esquemas (schemas/)
Archivos planos <name>.schema.ts con Zod, constante camelCase terminada en Schema, barrel schemas/index.ts. Sin tests.
4. Hooks (hooks/)
hooks/use-<action>/use-<action>.hook.ts con TanStack Query (useQuery / useMutation) y key factories dedicadas. Ver patrón TanStack Query.
5. Componentes y screens (components/, screens/)
- Usar primitivas de RN (
View,Text,Pressable) conclassNamede NativeWind; sindiv/span. - Cada componente o screen vive en su subcarpeta con implementación, test adyacente e
index.ts. - Modales: arquetipo
--type modal. Documentar props con TSDoc. Ver patrones de componentes.
6. Rutas en Expo Router (src/app/)
Cada index.tsx, [id].tsx o _layout.tsx solo importa y reexporta/renderiza la screen de la feature. Sin lógica ni tests en src/app/; si hace falta lógica (parámetros, guardas de acceso), se extrae a src/features/<feature>/utils/. Ver rutas delgadas.
⚠️ Reglas Críticas
- Barrels solo en carpetas hoja (Leaf-Folder Barrel Policy):
index.tsúnicamente en carpetas con archivos de implementación directos (components/invoice-card/,models/,schemas/,utils/). Nunca en la raíz de la feature ni en agrupadores comocomponents/,hooks/,screens/. - Imports directos a la carpeta con
index.ts:// ✅ CORRECTO import { usePetSearch } from '@/features/pets/hooks/use-pet-search'; import { IPet } from '@/features/pets/models'; // ❌ PROHIBIDO: carpetas contenedoras import { usePetSearch, IPet } from '@/features/pets'; import { InvoiceCard } from '@/features/pets/components'; - Encapsulación por subcarpeta en
kebab-case: implementación, test eindex.ts. - Rutas delgadas:
src/app/**no contiene lógica ni tests. - Cobertura $\ge 90%$ con tests adyacentes (
.test.ts(x)). Excluidos:models/,schemas/,src/config/,src/app/y losindex.ts. - Sin web APIs: nada de
div,windownilocalStorage; usar RN yexpo-secure-store/AsyncStorage.
📚 Referencias
- Guía de Screaming Architecture: estructura de directorios, capas y convenciones de nombres.
- Rutas delgadas con Expo Router: cómo conectar screens a
src/app. - Patrón TanStack Query: servicios, key factories, queries y mutaciones.
- Patrones de componentes con NativeWind: primitivas, modales y testing.
🛠️ Scripts
Rutas:
<skill-dir>es el directorio que contiene esteSKILL.md(p. ej..claude/skills/<name>/o.agents/skills/<name>/). Ejecuta los scripts desde la raíz del proyecto del usuario, no desde<skill-dir>.
Seguridad: los scripts abortan sin escribir nada si alguno de los archivos que generan ya existe. Ejecuta primero con
--dry-runpara ver qué se va a crear. Usa--force(sobrescribe esos archivos) solo con confirmación explícita del usuario.
1. Generar una feature completa
node <skill-dir>/scripts/scaffold-feature.mjs <feature-name> [--target-dir <path>] [--app-dir <path>] [--with-starter] [--with-route] [--dry-run] [--force]Ejemplo: node <skill-dir>/scripts/scaffold-feature.mjs billing --with-starter --with-route
Crea las 7 carpetas de la feature. --with-starter añade models/<feature>.ts (+ barrel) y la screen screens/<feature>-home/ con su test. --with-route (requiere --with-starter) añade src/app/<feature>/index.tsx que solo reexporta la screen.
2. Generar un componente encapsulado
node <skill-dir>/scripts/scaffold-component.mjs <component-name> [--target-dir <path>] [--type default|modal|section] [--dry-run] [--force]Ejemplo: node <skill-dir>/scripts/scaffold-component.mjs create-invoice-modal --target-dir src/features/billing/components --type modal
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

