← Back to outline
CodeBuilder Masterclass: From Brief to Running App with @oupi · Lesson 2 of 6

2. Writing an Effective Brief

Learn to structure a project description — purpose, screens, and key behaviors — so the AI produces a first version that is as close to your intent as possible.

Code Builder turns a plain-language description into a running application. You write a brief, the AI generates the code, executes it in an isolated cloud sandbox, and renders a live preview right next to your conversation. The quality of that first generated version depends almost entirely on the quality of your brief. A vague prompt produces a generic skeleton you'll spend many iterations fixing; a well-structured brief gets you 80 % of the way on the first pass. Your brief should cover three pillars: purpose (what the app does and for whom), screens (the distinct views or pages and their layout), and key behaviors (interactions, data flow, business rules). Nailing these three pillars minimizes wasted AI credits and sandbox execution time, because every extra iteration costs both.

Pillar 1 — Purpose. Open with a single sentence that states what the application is and who it serves. This anchors every decision the AI makes downstream. Bad: "Build me a dashboard." Good: "Build a real-time IoT dashboard for facility managers who monitor temperature and humidity sensors across multiple buildings." Include the domain, the primary user role, and the core value proposition. If there are multiple user roles (e.g., admin vs. viewer), list them and their permissions. The purpose block acts as a contract: the AI will refer back to it when generating navigation, data models, and access control.

Pillar 2 — Screens. Enumerate every distinct view. For each screen, specify: its name, what data it displays or collects, and its rough layout (sidebar + main panel, full-width table, card grid, etc.). Order the screens by user flow — the AI uses this sequence to wire up navigation. Example:

  1. Login — email/password form, redirect to Dashboard on success.
  2. Dashboard — grid of building cards showing latest sensor readings; click a card → Building Detail.
  3. Building Detail — line charts for temperature and humidity over the last 24 h, list of alerts.
  4. Settings — manage sensor thresholds that trigger alerts.

This level of specificity lets the AI scaffold correct routes and components on the first pass.

Pillar 3 — Key Behaviors. Behaviors are the dynamic rules that make the app more than static pages. Describe interactions ("clicking a row opens an edit modal"), validations ("email field must be unique"), real-time updates ("new sensor data appears without page reload"), and edge cases ("show an empty-state illustration when no sensors are configured"). Use imperative language the AI can translate directly into code: "When the user submits the form, validate all fields and display inline errors before saving." Each behavior you omit is a behavior you'll have to add later through iterative conversation — one change at a time — which costs additional credits.

Tip

Before submitting your brief, pick the execution profile that matches your project type (e.g., web app, API service). The profile defines the sandbox runtime and capabilities, so choosing the right one avoids environment mismatches that force re-generation. Manage profiles from the builder settings.

Try it now

Open Code Builder and write a brief for a small app you actually need. Structure it into three labeled sections — Purpose, Screens, Key Behaviors — following the patterns above. Submit it, watch the live preview appear, then note which parts the AI got right and which need iteration. This feedback loop is the fastest way to calibrate your brief-writing skill.

Take this course in OUPI → This exercise is done inside the OUPI platform.
Tip

After the first preview renders, resist the urge to rewrite the entire brief. Instead, iterate conversationally — one change at a time ("make the sidebar collapsible", "add pagination to the table"). Each focused request keeps the AI's edits precise and the preview refresh predictable.

Recap

A high-quality Code Builder brief has three sections: Purpose (what the app does, for whom), Screens (each view's name, data, and layout in user-flow order), and Key Behaviors (interactions, validations, real-time rules). Select the right execution profile before you submit. After the first live preview, iterate one change at a time to stay efficient with credits and sandbox time. The generated code is yours — review it in the workspace or download it anytime.