跳到主要内容

Vibe Coding

定义

Vibe coding 是一种软件开发风格,通过 AI 辅助进行迭代工作: you describe intent in natural language, get code or edits from an LLM or coding tool, then refine by feedback and context rather than writing every line from scratch. The “vibe” is the loose, exploratory flow—you steer by intent and feel, and the model fills in implementation details.

It contrasts with fully spec-first or plan-then-code approaches (例如 spec-driven development): you often start with a rough idea and let prompt engineering, agents, and tools (例如 Cursor, Claude Code) suggest and edit code. Useful for prototypes, scripting, and tasks where speed and iteration matter more than upfront 设计.

工作原理

You give the model (or IDE tool) context: open files, cursor position, or a short prompt (“add a test for this”, “refactor to use async”). The model returns suggested code or diffs; you accept, edit, or reject and optionally add feedback (“use a different library”, “make it shorter”). The loop repeats until the result matches what you want. Tools often provide project-aware context (indexed codebase, RAG-style 检索) so suggestions stay relevant. Success depends on clear intent, good tooling, and knowing when to take over or refine the output.

应用场景

Vibe coding 适用于想要借助 AI 快速推进、愿意在循环中迭代而非先确定规范的场景.

  • Prototyping and scripting (例如 one-off scripts, small tools)
  • Boilerplate, tests, and refactors where the intent is easy to state
  • Learning or exploring a codebase by asking the AI to implement or explain
  • 代理自主代理配合,根据描述编写和编辑代码riptions

优缺点

ProsCons
Fast iteration and less typingCan obscure understanding if you never read the code
Good for exploration and learningMay produce brittle or overfitted code without review
Low friction for small tasksHard to scale to large, consistent systems without specs
Works well with agents and IDEsDepends on model quality and context

外部文档

另请参阅