[00:00] (0.08s)
I have seen a huge range of success and
[00:02] (2.88s)
failure of people using prompts to build
[00:05] (5.84s)
UIs. Whether you're vibe coding or
[00:08] (8.40s)
building with tools like cursor or
[00:09] (9.92s)
claude code, a few simple tricks can
[00:11] (11.92s)
give you way better results for using AI
[00:14] (14.48s)
to generate and edit user interfaces
[00:17] (17.68s)
from everything from small to very large
[00:20] (20.32s)
and complex projects. I've got 11 tips
[00:22] (22.64s)
for you. So, let's start with number
[00:23] (23.84s)
one. Remember one important thing. AI
[00:26] (26.08s)
does not have eyes. It doesn't know what
[00:28] (28.48s)
you're looking at. For instance, I
[00:30] (30.32s)
generated this whole material UI
[00:31] (31.92s)
dashboard, but there's not perfect
[00:33] (33.68s)
alignment. Here, this placeholder text
[00:36] (36.00s)
isn't quite aligned right. And here,
[00:37] (37.76s)
these avatars aren't either. So, what
[00:39] (39.52s)
I'm going to do is I'm just going to
[00:40] (40.40s)
grab a screenshot here. I like to use
[00:42] (42.00s)
command shift 4 on a Mac. And then just
[00:44] (44.32s)
paste it over. And I can just say fix
[00:46] (46.80s)
the vertical alignment of the avatars
[00:49] (49.52s)
and search customers placeholder text
[00:52] (52.40s)
and submit it. Now the AI doesn't just
[00:54] (54.24s)
see the code that was rendered, which is
[00:56] (56.24s)
cool about products with a visualization
[00:58] (58.40s)
layer like Fusion or in products like
[01:00] (60.00s)
Cloud Code and Cursor. They see nothing.
[01:02] (62.00s)
They have no idea what you're looking at
[01:03] (63.36s)
what codes on screen at all. But it also
[01:05] (65.36s)
will see the pixels. So it can see, oh,
[01:07] (67.44s)
you're right. That's totally not
[01:08] (68.48s)
vertically centered. And it could see
[01:10] (70.64s)
things that you don't have to bother
[01:11] (71.92s)
typing like, oh, the avatar is aligned
[01:14] (74.08s)
to the top. And search customers has
[01:16] (76.32s)
some excessive padding top and is
[01:18] (78.00s)
actually more aligned towards the
[01:19] (79.04s)
bottom. Great. The agent here has
[01:20] (80.80s)
updated my avatars to be vertically
[01:22] (82.48s)
aligned. It's much better. There we go.
[01:24] (84.48s)
After another update, it got my
[01:26] (86.00s)
placeholder exactly the way I wanted it.
[01:27] (87.76s)
Now, let's jump into tip number two.
[01:29] (89.36s)
Provide the right context for the AI.
[01:31] (91.52s)
So, here over in cursor, these are some
[01:33] (93.52s)
of our rules for doing development on
[01:35] (95.28s)
the Fusion product. You just saw here we
[01:37] (97.76s)
give an overview of the project
[01:39] (99.36s)
structure key components and now every
[01:42] (102.08s)
time we prompt saying update the chat
[01:43] (103.84s)
update the visual editor guidelines
[01:46] (106.72s)
areas to look and other things are
[01:48] (108.08s)
distilled down. In products like Fusion
[01:49] (109.76s)
itself you can add custom instructions
[01:51] (111.36s)
as files or in the UI too. Good rules
[01:53] (113.76s)
are things like say use the design
[01:55] (115.20s)
system very strictly adapt screenshots
[01:57] (117.84s)
and prompts to always prefer design
[02:00] (120.24s)
system components as opposed to divs and
[02:02] (122.64s)
HTML soup. Now, products like Fusion,
[02:04] (124.56s)
Cursor, Claw Code, they're very good at
[02:06] (126.24s)
looking at your code by default. So, you
[02:08] (128.08s)
don't usually have to say things like,
[02:09] (129.68s)
"Here's the libraries we use. Here's how
[02:11] (131.28s)
we like to code." It'll see that and it
[02:13] (133.12s)
has that context when it's generating.
[02:14] (134.88s)
And models like Cloud 4 in particular
[02:16] (136.48s)
are really good at outputting code just
[02:18] (138.32s)
like other code it sees. But there can
[02:20] (140.32s)
be examples of a legacy codebase where
[02:22] (142.48s)
you have more older components and newer
[02:24] (144.56s)
and you prefer the AI to use the newer
[02:26] (146.24s)
style. That's another great thing to
[02:27] (147.92s)
include in the instructions. Notice in
[02:29] (149.76s)
these instructions you can also point
[02:31] (151.28s)
out files, folders and packages which
[02:33] (153.52s)
great is in any modern agentic system
[02:35] (155.68s)
like cursors agents, cloud code or
[02:38] (158.48s)
fusion. Just having the paths the agents
[02:41] (161.20s)
can go and look up information.
[02:43] (163.12s)
Something we actually just added to
[02:44] (164.24s)
fusion 2 is the ability to have multiple
[02:46] (166.32s)
agents who run automatically. So a
[02:48] (168.16s)
prompt goes to a primary agent which
[02:50] (170.00s)
delegates additional agents which might
[02:51] (171.68s)
spot multiple to swarm and look up tons
[02:53] (173.68s)
of information for your codebase.
[02:55] (175.28s)
compact it down and then provide that to
[02:57] (177.68s)
the top level agent to then update code.
[03:00] (180.72s)
Soon we're planning on doing writing
[03:02] (182.08s)
code in parallel 2 which is kind of cool
[03:03] (183.44s)
which all brings me to my third tip
[03:04] (184.88s)
which is provide additional context. A
[03:07] (187.36s)
really cool thing you can do in cursor
[03:08] (188.80s)
and fusion etc is provide additional
[03:10] (190.80s)
repositories as context. So in cursor
[03:13] (193.20s)
you can hit command shiftp and add
[03:15] (195.44s)
folder to workspace. This can then pull
[03:17] (197.76s)
in folders from other repositories or
[03:19] (199.68s)
other places on your system that the
[03:21] (201.36s)
agent can then access. So while this is
[03:23] (203.76s)
a monor repo I'm in now, we have another
[03:25] (205.84s)
more backendcentric monor repo that I
[03:27] (207.60s)
want to pull information from. So I'm
[03:29] (209.20s)
going to add this air layout folder to
[03:31] (211.20s)
my workspace. And now I have both of
[03:33] (213.36s)
them and I can reference both and the
[03:34] (214.80s)
agent can look up both and it can find
[03:36] (216.56s)
both from my instructions. This can be
[03:38] (218.64s)
really handy in Fusion. You can do the
[03:40] (220.40s)
same. You can go over to your project
[03:42] (222.00s)
settings. You can pick any project and
[03:44] (224.08s)
go to the settings and just scroll down
[03:46] (226.16s)
to workspace settings. You can add
[03:48] (228.24s)
additional repositories like our design
[03:50] (230.56s)
system and give additional instructions
[03:52] (232.64s)
for the agent across the workspace for
[03:55] (235.04s)
things like look up our design system
[03:56] (236.80s)
information in the design system repo.
[03:59] (239.28s)
Look up how our internal APIs work over
[04:01] (241.36s)
in the API repository. In fact, that's
[04:03] (243.92s)
how I did this demo. I actually
[04:05] (245.52s)
generated this table with all the
[04:07] (247.36s)
functionality like search and the
[04:09] (249.20s)
ability to edit customers and details.
[04:11] (251.52s)
You are now Miss Steve Smith. Just by
[04:14] (254.00s)
attaching the API repo as a workspace,
[04:15] (255.92s)
the agent can look up markdown files,
[04:17] (257.52s)
swagger specs, even source code to infer
[04:20] (260.08s)
how the API works and generate full cred
[04:22] (262.24s)
apps and updates from that. Now,
[04:24] (264.24s)
speaking of agents are smart, but they
[04:26] (266.00s)
don't have infinite eyes and knowledge.
[04:28] (268.40s)
Now, the key thing to remember to do is
[04:30] (270.08s)
pass errors to the AI. So, here I notice
[04:32] (272.48s)
when I click to see this dropown, oh, I
[04:34] (274.72s)
get an error. If I expand it, I see
[04:36] (276.40s)
menuless can't take fragments as a
[04:38] (278.08s)
child. Oops. So, in a tool like Fusion,
[04:40] (280.24s)
I can just say attempt to fix. This is
[04:42] (282.32s)
going to capture that error as well as
[04:44] (284.24s)
others network logs the current state of
[04:46] (286.64s)
the DOM and what components are rendered
[04:48] (288.24s)
with what props. Pass it to the AI to
[04:50] (290.16s)
make a fix. Alternatively, if you're
[04:51] (291.92s)
using cloud or cursor, just pop open
[04:53] (293.92s)
your JavaScript console and the dev
[04:55] (295.44s)
tools. Copy those errors. And honestly,
[04:58] (298.32s)
in most cases, you can just paste and
[05:00] (300.80s)
submit. In this case, I pass it to cloud
[05:02] (302.64s)
code. You can do the same thing pasting
[05:04] (304.64s)
to cursor too. As a side note, one thing
[05:06] (306.24s)
I would not recommend is having Claude
[05:07] (307.76s)
and cursor trying to fix the same bug at
[05:09] (309.52s)
the same time. What you can do though is
[05:11] (311.68s)
you can run multiple agents in parallel
[05:13] (313.68s)
working on different things. So cursor
[05:15] (315.68s)
now supports different tabs where you
[05:17] (317.60s)
can have multiple prompts and agents
[05:19] (319.60s)
running in parallel. Just make sure to
[05:21] (321.04s)
focus them on different parts of the
[05:22] (322.24s)
codebase. Cloud code you can open up in
[05:24] (324.40s)
separate tabs as well. And in Fusion the
[05:26] (326.32s)
same thing. You can open as many browser
[05:28] (328.32s)
tabs which creates as many fresh
[05:29] (329.84s)
branches as you want. One cool thing
[05:31] (331.28s)
about Fusion is each browser tab
[05:33] (333.36s)
actually is a completely fresh branch.
[05:35] (335.60s)
So you can actually have conflicting
[05:37] (337.12s)
changes in parallel trying like
[05:38] (338.64s)
different ideas like a let's try a table
[05:41] (341.12s)
UI versus a card UI versus any other
[05:43] (343.12s)
sort of brainstorm sessions we have and
[05:45] (345.04s)
actually experience those and then send
[05:46] (346.40s)
a pull request for which one you like
[05:47] (347.68s)
best or if you prefer to work off your
[05:49] (349.44s)
local branch. You can run Fusion and
[05:51] (351.36s)
Fusion's visual editor right inside
[05:53] (353.28s)
Cursor as well where my changes affect
[05:55] (355.44s)
my local files just like anything else
[05:57] (357.28s)
in Cursor on my local branch pushing it
[05:59] (359.36s)
up how I normally would. The next tip I
[06:01] (361.20s)
have is connect your design tools. Don't
[06:03] (363.36s)
just give screenshots from a design. For
[06:05] (365.28s)
a simple solution of using cursor, you
[06:07] (367.04s)
can use the Figma MCP, paste Figma
[06:09] (369.12s)
links, and at least get some degree more
[06:11] (371.44s)
detail than just a screenshot. Like what
[06:13] (373.28s)
are the exact fonts and colors and stuff
[06:14] (374.88s)
like that used for something that works
[06:16] (376.72s)
right in the browser, has a deeper
[06:18] (378.40s)
understanding of your design systems,
[06:20] (380.08s)
design tokens, and other details of your
[06:22] (382.16s)
code and how it renders to be a bit more
[06:24] (384.00s)
accurate, you can use the build with.io
[06:25] (385.92s)
Figma plugin. We can grab various Figma
[06:28] (388.32s)
frames. Let's grab these two. I'll do a
[06:30] (390.56s)
smart export. And then over in design
[06:32] (392.64s)
mode, I can select something and say add
[06:34] (394.96s)
a carousel with these two slides. Base
[06:37] (397.92s)
my design below this. This works really
[06:40] (400.32s)
well for design iteration too. So, first
[06:42] (402.48s)
let's let the AI generate my carousel.
[06:44] (404.16s)
There we go. Here I've got my nice
[06:45] (405.44s)
carousel. It's got the interactivity and
[06:47] (407.12s)
the slides from Figma. But let's say I
[06:48] (408.72s)
generated something from scratch. Let's
[06:50] (410.40s)
go over here and just generate something
[06:52] (412.00s)
like add a new contact us page and
[06:54] (414.64s)
submit. And now my page is generated.
[06:56] (416.64s)
Let's look at it. There we go. contact
[06:58] (418.48s)
us page using my components icons
[07:00] (420.40s)
typography. But now if I want to edit
[07:02] (422.08s)
this in Figma, which is not in there
[07:03] (423.52s)
now, I could pop to design modes. I can
[07:05] (425.92s)
select and make edits inside of design
[07:07] (427.52s)
mode if I want. But if I want to edit in
[07:09] (429.44s)
Figma with tools like the builder
[07:10] (430.96s)
plugin, I can have a birectional sync.
[07:13] (433.12s)
So let's copy this. Let's paste into the
[07:15] (435.04s)
builder plugin. We got our output right
[07:16] (436.88s)
here. Let's change the color scheme
[07:18] (438.32s)
here. Let's go with a more dark scheme
[07:20] (440.24s)
here with a light accented icon. Maybe I
[07:23] (443.12s)
don't want the subtext at all. Then I
[07:24] (444.88s)
can grab this, copy it back to my
[07:27] (447.04s)
clipboard, paste in here and say apply
[07:29] (449.76s)
my design changes from Figma and paste
[07:32] (452.56s)
Figma design. And now I go back and
[07:34] (454.48s)
forth from code to design, modify back
[07:37] (457.20s)
to code pretty seamlessly, which can be
[07:38] (458.80s)
really cool. And all the while the AI is
[07:40] (460.72s)
using my components, design tokens,
[07:43] (463.12s)
conventions, all of that. There we go.
[07:44] (464.88s)
We've got our design updates, which we
[07:46] (466.40s)
took from Figma. He used our design
[07:47] (467.92s)
tokens at Figma, and now it translated
[07:49] (469.76s)
to the right tokens in code. A related
[07:51] (471.76s)
suggestion for tools that have a visual
[07:53] (473.68s)
interface. That would be tools like
[07:55] (475.44s)
Windsurf or Fusion or some of the vibe
[07:58] (478.24s)
coding tools is when you want to change
[08:00] (480.16s)
a specific part of the UI, use the
[08:02] (482.24s)
visual selection tool to narrow in the
[08:04] (484.64s)
AI on the right area. So if you know you
[08:06] (486.96s)
want to add a new tab up here, a page
[08:09] (489.60s)
with lots of tabs and complexity might
[08:11] (491.52s)
not be clear what tabs are talking
[08:12] (492.96s)
about, but here now that I've selected,
[08:14] (494.72s)
I'll say add a new tab here for our help
[08:17] (497.68s)
center. And then here becomes a lot more
[08:19] (499.76s)
clear. And great, we've got our help
[08:21] (501.20s)
center link in the right spot because I
[08:23] (503.12s)
was more clear. Now, something I glossed
[08:24] (504.72s)
over earlier but don't want to skip is
[08:26] (506.72s)
connect your tools directly using MCP
[08:29] (509.44s)
servers. All the tools I've mentioned
[08:31] (511.28s)
support MCP servers. Fusion now has a
[08:33] (513.68s)
bunch of one-click integrations. Cursor
[08:35] (515.84s)
has a similar feature set. And when you
[08:37] (517.52s)
connect your other services,
[08:38] (518.88s)
implementing things could be as simple
[08:40] (520.32s)
as saying do this and paste a ticket
[08:42] (522.48s)
from the ticket link. The AI can pull
[08:44] (524.64s)
the description, files, comments, etc.
[08:47] (527.28s)
In my case, that customer dashboard I
[08:48] (528.96s)
built earlier was just from the simple
[08:50] (530.72s)
ticket, but I didn't have to rehash any
[08:52] (532.40s)
of it. If it had more information, it
[08:54] (534.24s)
would easily be gathered. And you can
[08:55] (535.92s)
use this for connecting docs and files
[08:58] (538.40s)
and Google Drive or whatever else. Now,
[09:00] (540.48s)
one common mistake I see people making
[09:02] (542.08s)
in the use case of prototyping where
[09:04] (544.00s)
they want their design team or PMs to
[09:05] (545.92s)
create prototypes of new ideas, just
[09:07] (547.60s)
type to AI, see something generated.
[09:09] (549.44s)
They use generic off-the-shelf tools
[09:12] (552.16s)
that don't at all use your brand design
[09:14] (554.24s)
system components, your tech stack or
[09:16] (556.24s)
coding style or anything. Something that
[09:17] (557.84s)
can make prototyping a lot more
[09:19] (559.20s)
effective and a lot more efficient for
[09:21] (561.04s)
your teams is prototype within your
[09:23] (563.04s)
actual stack. So here, if I want to
[09:24] (564.88s)
prototype a weather dashboard powered by
[09:27] (567.04s)
the open media API, in this case I have
[09:30] (570.48s)
a simple project using the cloudscape
[09:32] (572.16s)
design system. So I'm prototyping with
[09:34] (574.00s)
the correct design system with other
[09:35] (575.76s)
example code that shows the patterns,
[09:37] (577.68s)
the way we write these React components
[09:39] (579.36s)
with TypeScripts, the way we do props
[09:41] (581.04s)
and composition and example and abundant
[09:43] (583.76s)
examples throughout. This will make sure
[09:45] (585.44s)
our prototypes, even if they're made in
[09:47] (587.44s)
the browser by people not in the
[09:49] (589.44s)
development team, are following the
[09:51] (591.04s)
correct standards. So if we want to
[09:52] (592.40s)
upgrade that prototype to production
[09:53] (593.92s)
code, it's generally as simple as just
[09:55] (595.68s)
copying and pasting some code across
[09:57] (597.28s)
from one repo to another. So here when I
[09:59] (599.52s)
ask for this dashboard when I open it up
[10:02] (602.00s)
we'll see that I didn't get something
[10:03] (603.28s)
generic. I got something using our
[10:05] (605.36s)
actual design system. Everything uses
[10:07] (607.20s)
our tokens components etc. These are our
[10:09] (609.84s)
chart components with our overlays and
[10:13] (613.04s)
our search and autocomplete components.
[10:15] (615.20s)
Very nice. And then if we send a pull
[10:16] (616.80s)
request we'll see that it used the code
[10:18] (618.80s)
as we've demonstrated throughout this
[10:20] (620.16s)
codebase. You generally don't need any
[10:21] (621.76s)
setup. Just connecting it to a codebase
[10:24] (624.24s)
will give you nicely structured files
[10:26] (626.48s)
using both your design system components
[10:28] (628.40s)
and internal components and reusing
[10:30] (630.40s)
components when you need which is a lot
[10:32] (632.16s)
better than vibe coding for something
[10:33] (633.52s)
from scratch which gives you a bunch of
[10:35] (635.36s)
random divs in HTML but what are you
[10:37] (637.12s)
going to do with that? This we can bring
[10:38] (638.72s)
to production the others we can't.
[10:40] (640.72s)
Another really cool use case for
[10:42] (642.72s)
prototyping is just to do it in your
[10:44] (644.80s)
main codebase directly like create a
[10:46] (646.96s)
prototype right here such as we added
[10:49] (649.20s)
this pinning feature which was
[10:50] (650.72s)
originally a prototype from our product
[10:52] (652.64s)
manager to manage when you have very big
[10:54] (654.64s)
lists of repositories that some you want
[10:56] (656.40s)
to pin to the top and we're able to test
[10:58] (658.24s)
it in production using our real users in
[11:00] (660.08s)
our internal use cases. So now that
[11:02] (662.00s)
prototype became production code in like
[11:04] (664.08s)
a little bit of feedback in a couple
[11:05] (665.44s)
clicks. Anyway, I hope these are
[11:07] (667.20s)
helpful. all or most of these tips in
[11:09] (669.44s)
tools like Fusion, Cursor, Claude Code,
[11:12] (672.48s)
and others. I added some more tips over
[11:14] (674.56s)
in the blog post over at
[11:15] (675.92s)
builder.io/blog/prompting
[11:18] (678.16s)
tips. And tell me, what did I miss? What
[11:20] (680.40s)
are your most impactful tips for
[11:22] (682.48s)
development, for production work,
[11:24] (684.16s)
prototyping, design, iterations, etc.
[11:26] (686.88s)
that I missed? I'd love to learn from
[11:28] (688.48s)
your experience and maybe I'll do a
[11:30] (690.32s)
follow-up with more tips