Where prompts live
Vibra Code stores prompts in two places:vibracode-backend/lib/prompts.ts— contains thegetSystemPrompt()function, which returns the global system prompt used by the AI agent inside every sandbox. This is the detailed prompt covering TypeScript rules, routing patterns, animation guidance, web compatibility, and more.vibracode-backend/config.ts— eachTemplateobject has asystemPromptfield. This is the per-template prompt that describes the template’s stack and sets the AI’s goal for that specific sandbox type.
The FILE: reference
The Expo React Native template uses a special syntax for its systemPrompt:
systemPrompt value that starts with FILE:, it reads the referenced file from the backend root directory (vibracode-backend/system-prompt.md) and uses its contents as the prompt. This makes the Expo template’s prompt easier to edit — it’s a plain Markdown file rather than a TypeScript string.
Other templates (Next.js, Shopify, FastAPI, etc.) use inline strings concatenated directly in config.ts.
How AGENT_TYPE affects prompts
The AGENT_TYPE environment variable controls which AI agent runs inside the sandbox:
AGENT_TYPE | Agent | Billing mode |
|---|---|---|
claude (default) | Claude Code via Anthropic Agent SDK | Credit-based (2× multiplier) |
cursor | Cursor AI agent | Token-based (fixed messages per plan) |
gemini | Gemini CLI | Credit-based (2× multiplier) |
AGENT_TYPE, consider updating the relevant prompts accordingly.
How to modify the system prompt
Edit the Expo template prompt
Open
vibracode-backend/system-prompt.md and make your changes. This file is loaded at runtime, so no recompilation is needed — changes take effect on the next sandbox creation.Edit a non-Expo template prompt
Open
vibracode-backend/config.ts and find the systemPrompt field for the template you want to change. Edit the inline string directly.Convert an inline prompt to a file reference
For long prompts, switch any template to file-based loading by replacing the inline string with Then create
FILE:your-prompt.md:vibracode-backend/nextjs-prompt.md with the full prompt content.The systemPrompt field in config.ts
Here is the full Template interface showing the systemPrompt field in context:
FILE: reference:
What makes a good system prompt for mobile app generation
A strong system prompt for mobile code generation covers six areas:Identity and goal
Identity and goal
Tell the agent who it is and what its primary job is. Be specific about the stack: Expo SDK version, React Native version, and any package manager conventions.
Environment constraints
Environment constraints
The sandbox has real restrictions. Document them so the agent doesn’t waste tool calls on impossible actions:
- Git is not available inside the sandbox
- EAS CLI is not available
- Custom native packages cannot be installed (only those bundled with Expo Go)
- Xcode and Android emulators are not running
TypeScript and code quality rules
TypeScript and code quality rules
Include concrete rules about typing, imports, and patterns you want enforced. For example: always use explicit generics with
useState<Type[]>([]), always use optional chaining, never hardcode secrets.UI and design guidance
UI and design guidance
Describe the visual quality bar: “production-quality, not cookie-cutter.” Reference iOS Human Interface Guidelines if relevant. Specify your icon library (
lucide-react-native, @expo/vector-icons), and mention styling approach (StyleSheet, NativeWind, etc.).Routing and state management
Routing and state management
Expo Router, React Navigation, and Zustand each have patterns that cause bugs when misused. Spell out which router to use, how to handle tabs vs. stacks, and how to manage global state.
Web compatibility
Web compatibility
If users preview apps on web (React Native Web), list the APIs with partial or no web support and provide workaround patterns using
Platform.select() or conditional imports.The
getSystemPrompt() function in lib/prompts.ts is used by the Cursor agent path. The FILE:system-prompt.md reference is used by the Claude agent path. If you run both AGENT_TYPE values, make sure both prompts are updated.