{"slug": "your-ai-agent-builds-the-same-mobile-screen-every-time-here-s-the-prompt-that-it", "title": "Your AI Agent Builds the Same Mobile Screen Every Time. Here's the Prompt That Fixes It", "summary": "A developer's hands-on writeup argues that AI coding agents like Claude Code, Cursor and Codex produce generic mobile screens because text prompts leave layout, motion, insets and theming decisions to the model's defaults. The proposed fix is to paste a complete reference screen—with spring animations, safe-area insets and light/dark palettes—into the prompt so the agent adapts concrete code rather than guessing, backed by a five-part prompt checklist.", "body_md": "Try this. Open Claude Code, Cursor or Codex in a fresh Expo project and type:\n\n```\nBuild a sign-in screen.\n```\n\nI'd bet you get this:\n\nIt works. It also looks like every other app the agent has built.\n\n*This post is a hands-on take on [Why your AI agent's mobile screens all look the same](https://gluestack.io/blogs/why-ai-agent-mobile-screens-look-the-same?utm_source=devto&utm_medium=referral&utm_campaign=ai-screens-same&utm_content=intro) by Sanket Sahu on the gluestack blog.*\n\nAn LLM writes the *most likely* code for your request. Give it nothing specific to aim at and the most likely screen is the average of every screen it has seen. On mobile there are a lot of decisions the prompt never mentions: insets, gestures, press feedback, scroll behavior, motion timing, a second color theme. The agent picks the default for each one. Stack enough defaults and you get \"generic.\"\n\n**1. Longer prompts.** Writing \"modern, clean, soft gradient, subtle animations\" just gives the model more adjectives to read in the safest possible way, and none of them pins down spacing, hierarchy or timing.\n\n**2. Screenshots alone.** A screenshot is one frame in one theme. Motion, press states, component structure and dark mode are all lost, so the agent guesses them.\n\n**3. A UI kit on its own.** A component library gives the agent good buttons and inputs, but not a screen. Arrange good parts in an average layout and you still get an average screen.\n\nPaste a complete, finished screen into the prompt: real layout, spacing, animations, insets and both palettes. The agent stops guessing and starts **adapting**, which is what it's actually good at.\n\nHere's the kind of detail a reference carries that a text prompt never does. Compare a typical agent output:\n\n```\n// What you usually get\nexport default function SignIn() {\n  return (\n    <SafeAreaView style={styles.container}>\n      <View style={styles.card}>\n        <Text style={styles.title}>Sign in</Text>\n        {/* inputs */}\n        <TouchableOpacity style={styles.button}>\n          <Text style={styles.buttonText}>Continue</Text>\n        </TouchableOpacity>\n      </View>\n    </SafeAreaView>\n  );\n}\n```\n\n…with a reference-quality version of the same pieces:\n\n``` python\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport Animated, {\n  FadeInDown,\n  useAnimatedStyle,\n  useSharedValue,\n  withSpring,\n} from 'react-native-reanimated';\nimport { Pressable, useColorScheme } from 'react-native';\n\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\nconst SPRING = { damping: 15, stiffness: 300 };\n\nfunction PrimaryButton({ label, onPress }) {\n  const scale = useSharedValue(1);\n  const pressStyle = useAnimatedStyle(() => ({\n    transform: [{ scale: scale.value }],\n  }));\n\n  return (\n    <AnimatedPressable\n      onPressIn={() => (scale.value = withSpring(0.96, SPRING))}\n      onPressOut={() => (scale.value = withSpring(1, SPRING))}\n      onPress={onPress}\n      style={[styles.button, pressStyle]}\n    >\n      <Text style={styles.buttonText}>{label}</Text>\n    </AnimatedPressable>\n  );\n}\n\nexport default function SignIn() {\n  const insets = useSafeAreaInsets();\n  const scheme = useColorScheme();\n  const palette = scheme === 'dark' ? dark : light;\n\n  const containerStyle = [\n    styles.container,\n    { paddingTop: insets.top + 24, paddingBottom: insets.bottom + 16 },\n    { backgroundColor: palette.background },\n  ];\n\n  return (\n    <View style={containerStyle}>\n      <Animated.View entering={FadeInDown.duration(350)}>\n        {/* heading, inputs ... */}\n      </Animated.View>\n      <PrimaryButton label=\"Continue\" onPress={handleSignIn} />\n    </View>\n  );\n}\n```\n\nSpring values, entry timing, the edges that read insets, and a palette per theme are all things an agent will *keep* if they're in the code and *drop* if they're only described in adjectives.\n\nHere's the five-part checklist from the original post, turned into a prompt:\n\n```\nBuild the [screen name] screen.\n\n1. REFERENCE\nUse this screen as the design reference. Keep its layout,\nspacing, hierarchy and animations:\n[paste the reference screen code, or a screenshot plus a\ndescription of the motion]\n\n2. STATES\nHandle: loading, empty, error, success, a very long name,\na missing image.\n\n3. THEMES\nDesign both light and dark. Colors come from [your tokens /\nyour theme hook], not hardcoded values.\n\n4. SAFE AREAS\nThe screen draws edge to edge. Read insets with\nuseSafeAreaInsets instead of wrapping everything in\nSafeAreaView. Respect the notch, the home indicator and\nthe keyboard.\n\n5. MOTION\nContent fades in on mount (~300ms). Buttons spring on\npress. The header [collapses / gains a border] on scroll.\n\nMatch my project's components, theme and conventions.\n```\n\n**Don't skip that last line.** When the gluestack team tested this with Claude Code, the agent kept the reference screen's own styles unless that line was there. The reference tells the agent *what* to build; the last line tells it to make the result *yours*.\n\nThey ran the same reference screen through Claude Code in three projects (November 28–29, 2026):\n\n| Project | What the agent did | \n|---|---|\n| NativeWind app | Rewrote the screen as Tailwind classes on the project's color tokens | \n| Plain Expo app + custom theme | Used the project's `useTheme` hook and`ThemedText` component | \n| gluestack-ui app | Used gluestack's `Input` ,`Button` and`Heading` with the project's tokens | \n\nThe design came from the reference, and the fit came from the agent.\n\nYou can write your own (your best existing screen is a great reference for the rest of your app), or grab one from gluestack's [screen catalog](https://gluestack.io/patterns?utm_source=devto&utm_medium=referral&utm_campaign=ai-screens-same&utm_content=catalog). Each screen is one plain React Native file with Reanimated motion, safe-area insets and its own light/dark palette, plus a ready-made agent prompt. Free screens run live on their pages, so you can see the motion first.\n\n🚀 **gluestack is launching on Product Hunt tomorrow (December 3).** If you've ever fought your agent over a bland screen, look for gluestack on Product Hunt and share your feedback there.\n\nWhat's the most \"AI-looking\" screen your agent has handed you? Drop it in the comments 👇", "url": "https://wpnews.pro/news/your-ai-agent-builds-the-same-mobile-screen-every-time-here-s-the-prompt-that-it", "canonical_source": "https://dev.to/russel_dsouza_bd584a3cb2a/your-ai-agent-builds-the-same-mobile-screen-every-time-heres-the-prompt-that-fixes-it-48d4", "published_at": "2026-12-02 06:01:23+00:00", "updated_at": "2026-12-02 06:13:34.052911+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "large-language-models"], "entities": ["Claude Code", "Cursor", "Codex", "Expo", "gluestack", "Sanket Sahu"], "also_reported_by": [], "takeaway": "Pasting a full reference screen with spring press animations, safe-area insets and per-theme palettes into the prompt makes coding agents preserve those details, while adjective-only prompts cause them to drop them.", "recommendation": {"advice": "Give coding agents a complete reference screen in the prompt—real layout, spring values, insets and both palettes—instead of adjectives, so they adapt concrete code rather than defaulting to generic layouts.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/your-ai-agent-builds-the-same-mobile-screen-every-time-here-s-the-prompt-that-it", "markdown": "https://wpnews.pro/news/your-ai-agent-builds-the-same-mobile-screen-every-time-here-s-the-prompt-that-it.md", "text": "https://wpnews.pro/news/your-ai-agent-builds-the-same-mobile-screen-every-time-here-s-the-prompt-that-it.txt", "jsonld": "https://wpnews.pro/news/your-ai-agent-builds-the-same-mobile-screen-every-time-here-s-the-prompt-that-it.jsonld"}}