# Agent instructions: src Parent: [AGENTS.md](../AGENTS.md). Owns: application sources, layered core > net > model/api/store > ui > screens > app. - [hard] Follow the root rules; keep this directory within its stated purpose. Enforcer: review. Children: [api](api/AGENTS.md), [app](app/AGENTS.md), [core](core/AGENTS.md), [model](model/AGENTS.md), [net](net/AGENTS.md), [screens](screens/AGENTS.md), [store](store/AGENTS.md), [ui](ui/AGENTS.md). ## Layering and ownership - Dependency direction: `app` > `screens` > `ui` and `api`/`store` > `model` > `net` > `core`. Lower layers never include upper ones. Enforcer: review. - Header includes are relative to `src/` (`#include "ui/View.hpp"`), constants come from `spec/` (`#include "spec/Theme.hpp"`). - [hard] UI thread rule (NFR-THR-01): everything except `net/` internals runs on the SDL main thread. - UI code is SwiftUI-shaped: a `Screen` builds a `ViewPtr` tree every frame (`ui/Views.hpp` factories plus fluent modifiers), state lives in the Screen object, persistent interaction state lives in `UiState` keyed by view id. - Screens file layout: `screens/Screen.hpp/.cpp` (one Screen per iOS View plus its ViewModel logic), shared components in `screens/components/`.