做产品 PMaker
空格的键盘
跟 AI 写页面,三步走,顺序别乱 ① 静态页 占位内容 · 确认样子 字段够不够、层级对不对 改起来只要几秒钟 ② 接数据 真实样本 · 确认形状 字段长度、空值、格式现形 结构撑不撑得住,这里见分晓 ③ 补边界 异常状态 · 确认兜底 空态、超长、加载失败 这一遍补完,才交给 AI 写码 为什么是这个顺序 每一步都便宜,才能每一步都敢改 —— 反过来:先写整个应用,改一处要动全身 让 AI 一次写完「页面 + 数据 + 逻辑」,是协作里最贵的一种浪费

静态页是最便宜的规格确认。先确认样子,再确认形状,最后确认兜底——顺序反了,代价按数量级放大。

Prototype to Code

When building pages with AI, the most common waste is asking it to generate a "complete app" all at once: page, data, and logic in one go. The order should be reversed — static page first to confirm the look, then wire real data, then cover the edge cases. Only when every step is cheap can you afford to change it at every step.

What you'll run into
  • 让 AI 一次生成整个页面加数据加逻辑,改起来牵一发动全身
  • 样子还没确认,接口和状态已经写了一大堆
  • 「看起来挺对」的页面,真接了数据才发现结构撑不住

Static page first: confirm the look

First step, one job: have AI output the static structure of this screen. Title, list, card, button — all content is placeholder text. This version wires no data and writes no logic; its only reason to exist is for someone to confirm — does the look work?

Then wire data: confirm the shape

Second step: swap real samples in for the placeholders. What this step verifies isn't the "look", it's the "shape" — once real data flows in, does the structure still hold?

Finally cover edges: confirm the fallbacks

Third step: cover the edge cases. Loading, load failure, empty data, oversized content — look at each of the four states once. Only after this pass is the screen really ready to hand to AI for the full code.

Remember the payoff of this order: every step costs almost nothing to roll back. Static page wrong? Edit a few placeholder lines. Data comes in and the shape breaks? Swap the structure. An edge case leaks through? Add two states. The other way around — build the whole app first — and any change means cutting into a tangle of interdependent code.

这个顺序的回报,全在「改错了要付多少代价」上 ① 静态页 确认样子 ② 接真实数据 确认形状 ③ 补边界 确认兜底 每一步改错了要付的代价 静态页错了 改几行占位,几秒钟 形状撑不住 换结构,还没写逻辑 边界没兜住 补两个状态 先写整个应用 任何一处要改,都是在一片互相纠缠的代码里动刀。
顺序上「边界必须排在数据之后」不是习惯问题:你根本不知道真实数据会怎么撑爆布局,提前补边界只是在空想。样例数据永远是「刚刚好」的,真实数据不是。