Skip to content
All posts

Unify web and mobile UI with OTF for smooth AI agent development

DaveOTF Kit
8 min read
Unify web and mobile UI with OTF for smooth AI agent development

Cursor ships a working SaaS scaffold in an afternoon. Claude Code will refactor a thousand-line file before your coffee cools. Lovable and Bolt hand you a deployed app by lunch, and v0 will style a landing page from a single sentence. The agent era is real — it's the most productive thing to happen to solo developers since static site generators, and it's shipping on a weekly cadence. That deserves a moment of appreciation before we talk about what breaks.

What breaks is the second platform.

An agent that scaffolds your web app in a day will need a second day, minimum, to rebuild the same UI for iOS. And a third day for Android. And then a slow quarter of keeping the three in sync as you ship features. The agent didn't fail. It did exactly what it was asked: regenerate the UI for a new platform, from scratch. That is the expensive default.

The fix isn't a smarter agent. It's a UI layer the agent extends instead of regenerates. This post is the companion to our look at consistency in AI-generated codebases — that one covers the three failure modes (visual drift, convention death, silent rewrites), while this one covers the structural fix: shared component names and design tokens for the shared component set, with props and rendering suited to each platform.

The agent era is here, and it compounds

Three things made this year different from the last hype cycle:

  1. Models got cheap enough to run on every keystroke.
  2. Tools got good enough to operate on real codebases, not toy snippets.
  3. The agent loop — read file, edit, run test, read again — actually closed.

Cursor, Claude Code, Lovable, Bolt, v0, Rork — these aren't demos anymore. They ship production code. Cursor describes its agent as able to "understand your codebase, plan and build features... and work with the tools you already use" (Cursor docs). A solo founder with one of these tools can credibly build and ship a SaaS in a week. A two-person team can compete with a twenty-person team on the first three months of a product. That is a legitimate structural shift, not marketing.

The catch is structural too. When the agent rebuilds your UI for a second platform, it has to guess at conventions it didn't invent. It picks a layout library. It picks a styling approach. It picks spacing, radii, color tokens. None of those match what it built on web yesterday.

What the agent actually does on the second platform

Watch what happens when you ask an agent to port a React app to React Native (illustrative — the exact APIs vary by tool, but the shape of the drift is the point):

// What the agent produces on web:
<Button variant="primary" size="md" onClick={handleSubmit}>
  Save changes
</Button>

// What the agent produces on native, a week later:
<TouchableOpacity style={styles.primaryButton} onPress={handleSubmit}>
  <Text style={styles.buttonText}>Save changes</Text>
</TouchableOpacity>

Two buttons. Different API. Different element. Different accessibility surface. The variant prop is gone, replaced by a style lookup. The size prop is gone, replaced by hardcoded padding. The agent didn't do anything wrong — there was no shared contract to extend.

Now multiply this across every component, dozens of screens, and three months of feature work. The web app drifts from the mobile app. The design drifts from both. Every new feature gets implemented twice. Every bug fix gets triaged twice. This is the part of agentic development that doesn't compound.

One codebase. iOS, Android, and web.

The Fitness Kit is a mobile starter with its own API, with sign-in and a database. Live demo at fitness-preview.otf-kit.dev.

See the live demo

Convention beats configuration

The pattern that actually works: give the agent a contract before it starts building.

A cross-platform UI kit can give an agent a familiar component name and shared design tokens where a component exists on both platforms. The APIs still differ: web components use web props and browser events; React Native components use native props and press events. The kit gives the agent a documented starting point, not a single implementation to copy everywhere. This is the same argument for one codebase across three platforms: reuse the conventions that are shared, and follow each platform's implementation where they differ.

Concrete shape:

// On web (React):
import { Button } from "@otfdashkit/ui";

<Button variant="primary" size="md" onClick={handleSubmit}>
  Save changes
</Button>

// On iOS / Android (React Native):
import { Button } from "@otfdashkit/ui-native";

<Button variant="outlined" size="md" onPress={handleSubmit}>
  Save changes
</Button>

The component name is shared for this example, but its props are platform-specific: the web Button uses web variants and onClick; the native Button uses native variants and onPress. Check the relevant package's component documentation before porting a screen. The package import is platform-specific, and each package keeps rendering suited to its platform. The agent can follow the documented API for that platform.

shared component names and tokens with platform-specific props — the agent extends, not regenerates

Tokens flip a theme across every surface

Components are only half the problem. The other half is the design system that surrounds them — which is why the design system as agent context matters as much as the components themselves.

OTF provides a shared design-token package used by both the web and React Native packages. Each platform applies those values through its own styling and rendering system:

// tokens.ts — written once
export const tokens = {
  color: {
    bg:      { base: "#FFFFFF", dark: "#0B0B0C" },
    fg:      { base: "#0B0B0C", dark: "#FFFFFF" },
    primary: { base: "#2563EB", dark: "#3B82F6" },
    muted:   { base: "#6B7280", dark: "#9CA3AF" },
    border:  { base: "#E5E7EB", dark: "#1F2937" },
  },
  radius: { sm: 6, md: 10, lg: 16 },
  space:  { 1: 4, 2: 8, 3: 12, 4: 16, 6: 24, 8: 32 },
};

The example above illustrates token organization; it is not an OTF export shape. OTF's web and native packages consume the shared token package, while each package renders with platform-specific components. Changing a shared token can help keep the visual system aligned, but it does not make web and native props or implementations identical. Check each package's theming documentation for setup details.

This is the part that survives a model change. New model next quarter, new agent tool next year — the token file is still there, still canonical, still the source of truth.

How to actually wire this today

Two install paths. Pick one.

# Path 1: copy-paste CLI (recommended for starting fresh)
npx otfdashkit@latest init my-app
cd my-app
npm install

# Path 2: drop into an existing project
npm install @otfdashkit/ui @otfdashkit/ui-native @otfdashkit/tokens

For a project using OTF packages, give the coding agent the exact package imports and component documentation for that platform. For example:

# CLAUDE.md — auto-generated, lives in the kit

## UI components
Always import from @otfdashkit/ui (web) or @otfdashkit/ui-native (mobile).
Never write a raw <button>, <TouchableOpacity>, or styled-component from scratch.
If a component you need isn't in the kit, add it to the kit first, then use it.

## Design tokens
Never hardcode colors, spacing, or radii. Import from @otfdashkit/tokens.
A new theme = a new entry in tokens.ts. No per-component overrides.

The SDK also includes agent-oriented guidance and prompts; use the files present in the package or kit you have installed rather than assuming every kit contains the same setup. Before deployment, inspect that kit's repository for its actual scripts, configuration, and hosting instructions. A component library can establish UI conventions, but it does not prove that a kit has a particular backend, deployment file, or release process.

What this enables

Three concrete cases where the math flips:

Solo founder shipping a SaaS. Web ships in week 1. iOS and Android ship in week 3 — shared component names and tokens, with platform-specific props. Total time to three-platform beta: three weeks, not three months.

Two-person team adding mobile to a web product. Keep the existing web app in its web package and build the mobile screen with the native package. Shared component names and tokens can reduce translation work for components present in both, while native props, layout, and interaction still need to be implemented and checked for React Native.

Agency shipping for a client who later wants an app. Treat the web screen as a design and behavior reference, then compose its React Native counterpart from native components. Reusing names and design tokens can keep the experience recognizable; web components themselves do not drop into a React Native app.

The time savings come from reducing repeated design decisions, not eliminating platform work. A feature can reuse shared naming and token conventions, but it still needs platform-appropriate components, event handling, and verification. Fixes may need corresponding changes in both packages.

The part that doesn't change when the model does

Every three months a new model ships. Every month a new agent tool launches. Cursor ships a new mode, Claude Code gets a feature, Lovable adds a tier — the velocity is real and worth using.

The thing that survives all of it is the UI layer underneath. A component is a contract: name, props, behavior, accessibility surface. A token is a value: color, space, radius. These don't change when the model does. They don't change when the tool does. They change when you decide to change them — and that's the only pace that matters.

Use the agent. Use the new model. Use whatever ships next week. The agent can use the kit's documented conventions while you verify the web and native experiences separately.

Browse the kits at OTF templates — the free MIT SDK is on npm today, and every kit ships the agent configs above. You own the code. Give the agent the right package documentation, then review and test each platform's implementation.

That's the durable layer. It doesn't care which model is hot this quarter.

Sources

  • Cursor documentation — agent capabilities baseline ("understand your codebase, plan and build features... work with the tools you already use").
  • OTF templates — kit surface and agent-config offering referenced in the CTA above.
agentscross-platformdesign-system
OTF Fitness Kit

Stop wiring. Start shipping.

  • Sign-in and a database wired in, with its own API
  • iOS + Android + web from one codebase
  • AI configs pre-tuned + 20+ task prompts per kit included
Free starter

Ship your first screen tonight — free starter in your inbox

The quickstart, the SDK repo and the live kit demos, on this screen and in your inbox.

No spam. Unsubscribe any time.

Free with your email

Get the free AI configs pack

The AI files every kit ships with. Drop them in and your AI tool knows your project.

  • CLAUDE.mdProject context
  • .cursorrulesRules for Cursor
  • prompts/Task prompts

No spam. Unsubscribe any time.