# react native view architecture

> Standardize React Native screens by separating JSX, logic, styling, and types into a strict four-file folder structure.

react native view architecture is a free AI agent skill on Agensi by Bruno Da Silva, in Frontend & Web Apps. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Bruno Da Silva](https://www.agensi.io/creators/bruno-gustavo-da-silva)
- Category: [Frontend & Web Apps](https://www.agensi.io/skills/frontend-web-apps)
- Uses: 2
- Version: 1.0
- Last updated: 2026-10-16
- Security: scan passed (2026-10-16); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/react-native-view-architecture
- Tags: web-design, mobile, react-native, typescript, software-architecture, react, architecture, clean-code

## About this skill

Stop your agent from writing 400-line React Native screens that mix state, effects, decisions and inline styles in one file.

This skill structures every screen as a folder of up to four files, each with one job:
- index.tsx: JSX only. It renders what the viewmodel returns and decides nothing
- styles.ts: styling only, with theme tokens and no inline styles anywhere else
- viewmodel.ts: a useViewModel() hook with the state, effects and every decision
- types.ts: the view's own types, only when there are any

Where each line goes is a question, not a judgement call: does it decide WHAT the user sees, or HOW it looks?

What's included
- The rules for each file, with the reasoning behind them
- A "where does this line go?" table for the cases that are easy to get wrong
- "Actions, not setters": viewmodels expose onIncrement, never setQuantity, so the view can't write invalid state
- A complete example view, all four files, that compiles under strict TypeScript
- A step-by-step guide to split an existing large component into the four files without changing behavior
- Rules for reusable components and a checklist before delivering

Works with styled-components, StyleSheet or NativeWind. If your project already follows this pattern, the agent copies your exact conventions; if it doesn't, it asks before restructuring anything.

Pairs with react-native-design: one decides how a screen looks, the other where each line of code lives.

Free and open source (MIT): github.com/brunoviews/agent-skills

## Known limitations

Focuses only on view-layer organization. Does not handle navigation setup, global services, or shared state logic. Only creates types.ts if necessary.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the react native view architecture skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill improve my existing React Native codebase?

This skill fixes 'mega-file' bloat by automatically refactoring your React Native screens into a strict four-file structure: Index (UI), ViewModel (Logic), Styles (Layout), and Types (Definitions).

### Which AI agents and styling libraries are supported?

It is fully compatible with any AI agent that has file-system access, and it supports all major styling libraries including StyleSheet, NativeWind, and styled-components.

### What files are generated when I use this skill to scaffold a new screen?

The skill generates a standardized screen folder containing the UI component, a custom hook for business logic, a dedicated style sheet, and a TypeScript contract file.

### Can I use this to refactor older components, or is it only for new screens?

Yes, the skill is designed to analyze existing 'spaghetti code' components and extract the logic and styles into the new architecture without breaking your existing functionality.

### Does this skill handle my app's navigation and global state management?

This skill focuses exclusively on the View layer architecture; it does not manage global state (like Redux or Zustand) or handle React Navigation configurations.

### How much manual configuration is required to get started?

Simply provide the skill to your AI agent and point it toward a component or a folder; it will automatically detect your project's naming conventions and apply the architecture.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
