Skip to content

AI usage

RNUI includes machine-readable metadata and agent instructions so tools like Codex, Claude Code, Cursor, and Gemini CLI can generate React Native screens that use the design system correctly — not ad-hoc custom UI.

  • Structured component catalog — .ai/component-registry.json
  • Design rules — .ai/design-rules.md
  • Screen workflows — .ai/screen-generation.md
  • Copyable prompts — .ai/prompts/
  • Reference screens — .ai/examples/
  • Agent entrypoint — .ai/rnui.manifest.json

Human docs (this site) and AI metadata (.ai/) work together: docs explain components; .ai/ tells agents which components to pick and how to compose them.

  1. Read .ai/rnui.manifest.json
  2. Pick components from .ai/component-registry.json
  3. Follow .ai/design-rules.md
  4. Use a prompt from .ai/prompts/

Repository-wide instructions also live in AGENTS.md.

.ai/component-registry.json lists exported @truongdq01/ui components with:

FieldPurpose
nameExport name
categoryforms, layout, navigation, feedback, …
statusstable, beta, or experimental
commonPropsFrequently used props (detailed entries)
usageHints / avoidDo’s and don’ts for agents

Prefer stable components for production-like generation. Check Component status for human-readable maturity notes.

.ai/design-rules.md covers:

  • Layout-first composition (Stack, Box, Grid)
  • Surface components (Card, GlassCard, Paper)
  • Forms (Input, FormField, Select)
  • Feedback (Alert, Toast, EmptyState)
  • Token usage — no random hex colors
  • Anti-patterns agents must avoid
TemplateUse for
build-screen.mdSingle screen
build-app-flow.mdMulti-screen flow
add-component-doc.mdDocument an existing component
review-rnui-usage.mdAudit RNUI usage
refactor-to-rnui.mdMigrate custom UI to RNUI

Copy the prompt body from .ai/prompts/ into your agent.

Build a clean mobile settings screen using only RNUI components.
Read .ai/rnui.manifest.json first, follow .ai/design-rules.md, and pick
components from .ai/component-registry.json. Do not create custom Button,
Card, Input, Typography, or layout primitives.

TypeScript reference screens in .ai/examples/:

  • Login, settings, profile, dashboard
  • List/detail, form

These are learning references for agents — not published app routes.

Maintainers can verify AI files exist:

Terminal window
bun run ai:check
  • Import from @truongdq01/ui (and hooks from @truongdq01/headless when needed).
  • Use ThemeProvider once at app root.
  • Respect package boundaries — see .ai/package-map.json.
  • Do not add new UI libraries or duplicate RNUI primitives.
  • Generated code should be TypeScript-safe for React Native ≥ 0.83.