0Pricing
Vibe Coding · 课时

迭代提示词

逐步改进,不要重新开始——一步一步引导人工智能。

迭代提示词 是 CoddyKit 上的免费 Vibe Coding 课时。 这是第 4 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 Vibe Coding 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 Vibe Coding 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

The First Answer Is a Draft

Beginners often delete everything and start over when the AI's first try isn't perfect. Pros do the opposite: they iterate. They treat the first output as a draft and steer it with follow-up messages.

This is the rhythm of real vibe coding — refine, don't restart. This lesson teaches you how to nudge the AI toward exactly what you want, step by step.

The Iteration Loop

Every build follows a simple loop:

  • Prompt — ask for something
  • Run — preview the result in Bolt, v0, or your editor
  • React — note what's right and what's off
  • Refine — give a focused follow-up

You repeat this loop a few times per feature. Each pass gets you closer.

Refine, Don't Restart

The AI remembers the conversation. So you don't re-describe the whole app — you just say what to change. This keeps everything you already liked.

Restarting (wasteful):
  "Build the whole todo app again but with bigger buttons."

Refining (smart):
  "Make the Add button bigger and move it to the right of
   the input."

Change One Thing at a Time

When you ask for five changes at once, it's hard to tell which fix helped and which broke something. Iterate in small steps so you can see the effect of each one.

Step 1: "Change the theme color to purple (#7c3aed)."
   (check it looks right)
Step 2: "Now add a subtle hover effect to the buttons."
   (check again)
Step 3: "Now make it work on mobile widths."

Point to What's Wrong

Good iteration feedback names the specific thing that's off and what you want instead. 'It's bad' gives the AI nothing to work with.

Weak feedback:  "That's not right, try again."

Strong feedback: "The list items are cramped. Add more vertical
                  space between them and a thin divider line."

Keep What Works

When part of the output is great, say so and protect it. Telling the AI what to keep stops it from rewriting code you already liked during the next change.

"The layout and colors are perfect — keep those exactly.
 Only change this: when the list is empty, show the text
 'No tasks yet. Add one above!' centered in gray."

Iterating on Logic, Step by Step

Iteration works for behavior too. Start with a basic version, then layer on rules. Here's a greeting function after one refinement step — try running it.

// Step 1 result: a simple greeting
// Step 2 refinement: "also handle an empty name"
function greet(name) {
  if (!name) return 'Hello there!';
  return 'Hello, ' + name + '!';
}

console.log(greet('Sam'));
console.log(greet(''));

When to Restart Instead

Iteration is the default — but sometimes a fresh start is faster. Restart when:

  • The code has become a tangled mess after many edits
  • You realize the approach is fundamentally wrong
  • The AI is stuck in a loop, re-breaking the same thing

In that case, write a clean new prompt that includes everything you learned.

Roll Back Bad Steps

Sometimes a refinement makes things worse. Don't try to patch a patch — go back. Most tools let you undo: Cursor and Claude Code track edits, and Git lets you revert to a known-good version.

A clean rollback plus a sharper prompt beats five rounds of damage control.

"That last change broke the layout. Undo it and go back
 to how the page looked before. Then instead, just
 increase the font size of the headings to 24px."

Give Feedback in the AI's Language

Speed up iteration by reacting to concrete things: the live preview, an error message, or a screenshot. Many builders like v0 and Lovable let you click an element and say 'change this'.

The more precisely you point, the fewer rounds you need.

Fast iteration cues:
- "See the red error in the console? Fix that."
- "The button I just clicked — make it full-width."
- "Match the spacing to the screenshot I shared."

A Real Iteration Session

Here's how a few turns of refinement feel in practice. Each message is short because the AI remembers the rest.

You: "Build a tip calculator: bill input, tip % buttons, total."
AI:  (produces it)
You: "Add a 'split between N people' field."
You: "Round each person's share to 2 decimals."
You: "Keep all that — just make the total bold and bigger."

Quick Check

The AI's first version of your app is 90% right — the layout is great but one button is the wrong color. What's the best next move?

Recap: Steer, Don't Restart

Great vibe coding is a conversation, not a single command:

  • Treat the first answer as a draft
  • Run the prompt → run → react → refine loop
  • Change one thing at a time, point to what's wrong
  • Keep what works; roll back bad steps
  • Restart only when the approach is truly wrong

You've now mastered the core of prompting: structure, specificity, context and iteration. You're ready to build your first real app by talking to AI!

常见问题解答

「迭代提示词」课时是免费的吗?

是的 — 「迭代提示词」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 Vibe Coding 课程的其余内容,请升级到 CoddyKit PRO。 Vibe Coding 课程共包含 4 节课。

「迭代提示词」这节课中我会学到什么?

逐步改进,不要重新开始——一步一步引导人工智能。 你通过在浏览器中直接运行的动手代码来练习 Vibe Coding,全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 Vibe Coding 需要有经验吗?

无需任何先前经验。CoddyKit 上的 Vibe Coding 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 4 节课,共 4 节。

「迭代提示词」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 Vibe Coding 课中编写并运行代码吗?

能。每节 Vibe Coding 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. 优秀构建提示词的结构
  2. 明确具体
  3. 为人工智能提供上下文
  4. 迭代提示词
← 返回 Vibe Coding