Vibe Coding Beginner Tutorial
Vibe Coding Introduction Tutorial
Vibe Coding is a brand new programming paradigm; instead of writing code line by line, we describe what we want in natural language, and the AI writes the code, while we are responsible for reviewing and controlling the direction.
Vibe Coding Tutorial Reference:https://www.runoob.com/vibe-coding/vibe-coding-tutorial.html
What is Vibe Coding
The term Vibe Coding was first proposed by Andrej Karpathy, former Director of AI at Tesla and co-founder of OpenAI, in February 2025.
He summarized this new programming method in one sentence:
"I just vibe. I don't even touch the keyboard sometimes. I just talk to the AI, it writes the code, I review it, and we iterate."
Translated, this means: you just describe your "feeling," the AI writes the code, you review it, and you iterate back and forth.
Simply put, Vibe Coding is: you tell the AI what functionality you want in plain language, the AI writes the code for you, you don't need to worry about syntax details, you don't need to memorize API parameters, and you don't need to manually debug every error—the AI handles all of that.
Our role shifts from "the coder" to "the requirement describer," or rather—from programmer to product manager + architect.

Vibe Coding is not about letting the AI replace your thinking, but about letting the AI handle low-value repetitive labor, allowing you to focus on more creative parts: understanding the problem, designing the architecture, and verifying the results.
Vibe Coding vs Traditional Programming
Understanding the difference between Vibe Coding and traditional programming methods helps you use it better.
| Dimension | Traditional programming | Vibe Coding |
|---|---|---|
| Input method | Line-by-line manual coding | Describing requirements in natural language |
| Focus | Syntax, API, implementation details | Requirements, architecture, verification |
| Debugging methods | Manual breakpoint/log debugging | Throwing error messages to AI for fixing |
| Speed | Depends on typing speed and proficiency | Depends on the clarity of the requirement description |
| Applicable scenarios | All programming tasks | Prototype development, CRUD, scripting tools, UI pages |
| Core skills | Proficiency in programming languages | Requirement decomposition + result verification capability |
Why Vibe Coding is possible now
Vibe Coding became possible in 2025 due to the maturity of several key conditions.
Leap in large model coding capabilities
Significant improvement in the accuracy of code generation by models such as GPT-5.5, Claude 5, and Gemini.
They can not only write syntactically correct code but also understand project context, follow best practices, and handle edge cases.
More importantly, they can handle ultra-long contexts—reading the entire project at once and understanding your codebase structure.
The explosion of AI programming tools
Tools like Cursor, Claude Code, GitHub Copilot, and Windsurf deeply integrate AI capabilities into the development workflow.
These tools can not only complete code but also directly modify files, run terminal commands, and search codebases—working like a real developer.
The emergence of Agent mode
Tools in Agent mode can autonomously execute multi-step tasks: reading files, writing code, running tests, and fixing errors based on test results.
You only need to issue an initial instruction, and the Agent will iterate on its own until the task is complete.
Introduction to Mainstream Tools
Below are the most mainstream Vibe Coding tools currently available, each with its own focus.
| Tool | Type | Core Features | Suitable Scenarios |
|---|---|---|---|
| Qoder | Agent IDE | Deep codebase understanding, Quest auto-tasks, multi-Agent, Repo Wiki, CLI/IDE dual mode | Medium to large-scale engineering, long-term project maintenance |
| Trae | AI native IDE | Conversation-driven development, automatic code generation and modification | Vibe Coding, rapid new project setup |
| Cursor | AI editor | Project-level understanding, multi-file modification, Agent mode | Full-stack development, large projects |
| Claude Code | CLI Agent | Executing complex tasks in the terminal, automatic project modification | Backend, automated development |
| GitHub Copilot | AI programming assistant | Intelligent completion, chat, Agent | Daily development assistance |
| Windsurf | AI editor | Cascade workflow, automatic multi-file modification | Rapid development, small to medium-sized projects |
| OpenAI Codex | AI programming Agent | Understand tasks and execute the complete development process | Automated development |
| Bolt.new | Online AI development platform | Generate a complete application in one sentence | MVP, prototype validation |
| v0 by Vercel | UI generation tool | Automatic React page generation | Page design and component development |
| Replit AI | Online IDE | Cloud development + AI collaboration | Teaching and quick testing |
| Lovable | AI application generator | Generate SaaS directly from description | Entrepreneurship, product validation |
| Firebase Studio | AI application platform | AI + backend service integration | App / Web development |
If this is your first time using Vibe Coding, you can start with Qoder or Trae in China; the operation is similar to VS Code, has the gentlest learning curve, and will not change your familiar editor environment.
Quick start
Below, using Claude Code (Terminal CLI) as an example, we show a typical Vibe Coding workflow.
Claude Code complete tutorial reference:https://www.runoob.com/claude-code/claude-code-tutorial.html
First project: Hello, Vibe World!
**Goal:** Create a personal business card webpage with Claude Code in 5 minutes using only natural language.
**Step 1: Create the project folder**
mkdir my-card && cd my-card
claude

**Step 2: Describe what you want to Claude**
In the Claude Code interaction interface, enter:
Original prompt (Chinese, left untranslated)
帮我创建一个个人名片网页,要求:
- 显示我的名字(张三)和职业(前端开发者)
- 有一个简短的个人简介区域
- 列出3个技能标签(React、Python、设计)
- 设计风格:简洁现代,深色背景,有轻微的渐变效果
- 单个 HTML 文件,不需要外部依赖
Step 3: Observe Claude working
You will see Claude Code automatically:
Original prompt (Chinese, left untranslated)
分析你的需求
创建 index.html 文件
写入完整的 HTML、CSS 和少量 JavaScript
**Step 4: View the results**
Original prompt (Chinese, left untranslated)
open index.html # macOS
# 或
xdg-open index.html # Linux
Step five: Iterative modification
If you are not satisfied, continue the conversation:
Original prompt (Chinese, left untranslated)
把背景色改成深蓝色渐变,字体换成更现代的 sans-serif,
技能标签加上悬停动画效果
Claude Code will modify the files directly, so you do not need to touch any code.
Vibe Coding core workflow
The core workflow of Vibe Coding can be summarized in four steps: Describe, Review, Iterate, and Deliver.
Complete workflow diagram
Original prompt (Chinese, left untranslated)
描述需求
↓
AI 生成代码
↓
你审查 Diff
↓
┌─ 不满意 → 描述修改意见 → AI 重新生成
│
└─ 满意 → 运行测试
↓
┌─ 测试失败 → 把报错贴给 AI → 修复
│
└─ 测试通过 → 提交代码
Step one: Describe the requirements
Tell Claude Code what you want using natural language.
No need to write code or discuss technical details, just clearly state "what to do."
A simple requirement description example:
Original prompt (Chinese, left untranslated)
帮我创建一个 Python Flask 项目,有一个 /api/tasks 接口,
支持 GET 获取任务列表和 POST 创建新任务,
任务数据用 JSON 文件存储。
After receiving it, Claude Code will plan the file structure, generate code, install dependencies, and run tests automatically.
Step 2: Review Diff
After generating the code, Claude Code will display all changes (Diff) for you to review.
This is the most important step in Vibe Coding—you must understand what the AI changed.
When reviewing, focus on:
| Check items | What to look at specifically |
|---|---|
| Logical correctness | Whether the conditional judgment is reasonable and boundary cases are handled |
| Security | Whether there are security vulnerabilities such as SQL injection or XSS |
| Data flow direction | Whether the input, processing, and output of data meet expectations |
| Naming conventions | Are variable and function names clear and easy to understand |
| Redundant code | Are there unnecessary duplicate or unused imports |
Reviewing is not about nitpicking, but about ensuring you understand what every line of code does. If you don't understand a piece of code, just ask Claude Code: "What does this code mean? Why is it written this way?"
Step 3: Iterative Modification
After the review finds issues, describe the desired modifications in natural language.
Examples of common iterative instructions:
Original prompt (Chinese, left untranslated)
把 JSON 文件存储改成 SQLite,用 SQLAlchemy 做 ORM。
Original prompt (Chinese, left untranslated)
给 POST 接口加个验证:title 必填,不能为空字符串。
Original prompt (Chinese, left untranslated)
It reported an error, take a look:
Traceback (most recent call last):
File "app.py", line 42, in create_task
db.session.add(task)
AttributeError: 'NoneType' object has no attribute 'session'
After each iteration, Claude Code will regenerate the code and show the Diff; you review it again until you are satisfied.
Step four: Delivery
Once all features meet expectations and pass testing, submit the code.
Claude Code will help you write the commit message and submit:
$ git log --oneline
a1b2c3d feat: add task CRUD API with SQLite storage
Practical demonstration: Building a Todo application from scratch with Claude Code
Below, we demonstrate the entire Vibe Coding process through a complete practical case study.
We will use Claude Code to build a Todo application from scratch, including a frontend page and a backend API.
Project goals
| Features | Description |
|---|---|
| Add Task | Enter task title and add to list |
| Complete Task | Click the checkbox to mark as complete |
| Delete Task | Delete unnecessary tasks |
| Filter | Filter by All/In Progress/Completed |
| Persistence | Data is saved to SQLite, so it is not lost upon refresh |
Step 1: Initialize the project
Create the project directory in the terminal and start Claude Code:
$ mkdir vibe-todo && cd vibe-todo
$ claude
Then describe your requirements to Claude Code:
Original prompt (Chinese, left untranslated)
Help me create a Todo application, requirements:
1. 后端用 Python Flask + SQLAlchemy + SQLite
2. 前端用纯 HTML/CSS/JS,风格简约现代
3. 支持添加、完成、删除、筛选任务
4. 所有 API 返回 JSON,前端用 fetch 调用
5. 代码注释用中文
Step 2: What Claude Code did
After receiving the requirements, Claude Code automatically completed the following steps:
First, create the project structure:
Original prompt (Chinese, left untranslated)
vibe-todo/
├── app.py # Flask 主应用
├── models.py # 数据库模型
├── requirements.txt # 依赖清单
├── static/
│ ├── style.css # 样式文件
│ └── script.js # 前端逻辑
└── templates/
└── index.html # 页面模板
Then generate the backend code, the core content of app.py is as follows:
Instance
File path: app.py
Flask main application, defines API routes and page entry points
from
flask
import
Flask
,
render_template
,
request
,
jsonify
from
models
import
db
,
Task
app
=
Flask
(
name
)
Configure SQLite database path
app.
config
[
'SQLALCHEMY_DATABASE_URI'
]
=
'sqlite:///todo.db'
app.
config
[
'SQLALCHEMY_TRACK_MODIFICATIONS'
]
=
False
Initialize database extension
db.
init_app
(
app
)
Automatically create table structure when the application starts
with
app.
app_context
(
)
:
db.
create_all
(
)
@
app.
route
(
'/'
)
def
index
(
)
:
"""Returns the main page"""
return
render_template
(
'index.html'
)
@
app.
route
(
'/api/tasks'
,
methods
=
[
'GET'
]
)
def
get_tasks
(
)
:
"""Get all task lists, supports filtering by status"""
Get filtering conditions from query parameters, defaults to 'all'
status
=
request.
args
.
get
(
'status'
,
'all'
)
Filter tasks by status
if
status
==
'completed'
:
tasks
=
Task.
query
.
filter_by
(
completed
=
True
)
.
all
(
)
elif
status
==
'active'
:
tasks
=
Task.
query
.
filter_by
(
completed
=
False
)
.
all
(
)
else
:
tasks
=
Task.
query
.
all
(
)
Convert task objects to a list of dictionaries for easy JSON serialization
return
jsonify
(
[
t.
to_dict
(
)
for
t
in
tasks
]
)
@
app.
route
(
'/api/tasks'
,
methods
=
[
'POST'
]
)
def
create_task
(
)
:
"""Create a new task"""
data
=
request.
get_json
(
)
Validate required field title
title
=
data.
get
(
'title'
,
''
)
.
strip
(
)
if
not
title:
return
jsonify
(
{
'error'
:
'Task title cannot be empty'
}
)
,
400
Create task object and save to database
task
=
Task
(
title
=
title
)
db.
session
.
add
(
task
)
db.
session
.
commit
(
)
return
jsonify
(
task.
to_dict
(
)
)
,
201
@
app.
route
(
'/api/tasks/int:task_id'
,
methods
=
[
'PUT'
]
)
def
update_task
(
task_id
)
:
"""Update task status (completed/cancelled)"""
task
=
Task.
query
.
get_or_404
(
task_id
)
data
=
request.
get_json
(
)
If the request contains the completed field, update the status
if
'completed'
in
data:
task.
completed
=
data
[
'completed'
]
db.
session
.
commit
(
)
return
jsonify
(
task.
to_dict
(
)
)
@
app.
route
(
'/api/tasks/int:task_id'
,
methods
=
[
'DELETE'
]
)
def
delete_task
(
task_id
)
:
"""Delete specified task"""
task
=
Task.
query
.
get_or_404
(
task_id
)
db.
session
.
delete
(
task
)
db.
session
.
commit
(
)
return
jsonify
(
{
'message'
:
'Deletion successful'
}
)
,
200
if
name
==
'main'
:
app.
run
(
debug
=
True
)
There is also the database model models.py:
Instance
File path: models.py
Database model definition, using SQLAlchemy ORM
from
flask_sqlalchemy
import
SQLAlchemy
from
datetime
import
datetime
Create the database instance, which will be initialized in app.py later
db
=
SQLAlchemy
(
)
class
Task
(
db.
Model
)
:
"""Task model, corresponding to the tasks table in the database"""
tablename
=
'tasks'
Primary key, auto-increment integer
id
=
db.
Column
(
db.
Integer
,
primary_key
=
True
)
Task title, required, cannot be empty
title
=
db.
Column
(
db.
String
(
200
)
,
nullable
=
False
)
Completion status, defaults to False
completed
=
db.
Column
(
db.
Boolean
,
default
=
False
)
Creation time, automatically recorded
created_at
=
db.
Column
(
db.
DateTime
,
default
=
datetime
.
utcnow
)
def
to_dict
(
self
)
:
"""Converts the task object to a dictionary for convenient JSON serialization"""
return
{
'id'
:
self
.
id
,
'title'
:
self
.
title
,
'completed'
:
self
.
completed
,
'created_at'
:
self
.
created_at
.
isoformat
(
)
}
Step 3: Review Code
After Claude Code displays the Diff, you review it line by line.
You might find some issues and suggest modifications.
For example, you notice that the API routes do not have a unified prefix and suggest the modification:
Original prompt (Chinese, left untranslated)
把所有 API 路由加上 /api/v1 前缀,方便以后版本管理。
Claude Code will automatically modify all routes, and you can review and approve them again.
Step 4: Run tests
After review approval, let Claude Code start the application and test:
$ python app.py
* Running on http://127.0.0.1:5000
Open a browser and access http://127.0.0.1:5000 to see the complete Todo application interface.
Test the task addition function:
Original prompt (Chinese, left untranslated)
$ curl -X POST http://127.0.0.1:5000/api/v1/tasks \
-H "Content-Type: application/json" \
-d '{"title": "学习 Vibe Coding"}'
Results:
Original prompt (Chinese, left untranslated)
{
"completed": false,
"created_at": "2026-06-24T10:30:00",
"id": 1,
"title": "学习 Vibe Coding"
}
Step 5: Submit code
After all functions are verified, submit the code:
Original prompt (Chinese, left untranslated)
$ git add .
$ git commit -m "feat: 完成 Todo 应用基础功能"
Throughout the entire practical process, you didn't write a single line of code manually. What you did was: describe the requirements, review the Diff, describe the modifications, run tests, and submit the code. This is the core experience of Vibe Coding.
Tips for writing prompts
The effectiveness of Vibe Coding largely depends on how you describe the requirements.
A good prompt allows the AI to generate code close to expectations in one go, reducing the number of iterations.
Four-element model
A high-quality prompt should contain four elements:
| Element | Description | Example |
|---|---|---|
| What to do | Clearly describe the functionality to be implemented | "Create a user registration interface" |
| What to use | Specify the technology stack and tools | "Using Flask + SQLAlchemy + SQLite" |
| How to constrain | Provide constraints and boundaries | "Email is required and needs format validation" |
| Expected format | Specify output preferences | "Code comments in Chinese, add docstring to each function" |
Good prompt vs bad prompt
| Bad prompt | Good prompt |
|---|---|
| Help me create a login function | Help me implement a login API using Flask that accepts email and password, encrypts the password using bcrypt, returns a token using JWT, and the token is valid for 24 hours. Return specific error messages upon login failure. |
| This button is too ugly | Change this submit button to have 8px rounded corners, a blue background of #2563eb, white text, and darken the color by 10% on hover, adding a 0.2s transition animation. |
| It's throwing an error, please help me fix it | When running python app.py, it throws an error: AttributeError: 'NoneType' object has no attribute 'session'. It looks like a database initialization issue, please investigate and fix it. |
The core principle of prompts: the more specific, the better the result. Vague requirements will only yield vague code.
Common pitfalls and notes
Misconception 1: AI can replace all programming knowledge
Vibe Coding lowers the barrier to entry for programming, but it does not eliminate it.
We still need to understand basic concepts such as variables, functions, APIs, databases, HTTP, asynchronous, etc., otherwise, we cannot judge whether the code generated by AI is correct, nor can we effectively describe the requirements.
Misconception 2: Describing all features at once
Do not copy the entire product's PRD document to the AI and expect it to generate perfect code in one go.
AI has a limited attention span, and the more requirements there are, the easier it is to make mistakes.
A more effective approach is: core functionality → verification → add features → verification → continue iteration.
Misconception 3: Not reading the code written by AI
It is very dangerous for some developers to merge AI-generated code directly.
AI may introduce security vulnerabilities, performance issues, or completely unreasonable architectures.
We at least need to quickly review the key logic to ensure there are no obvious problems.
Notes
- Do not write sensitive information (API keys, database passwords) directly in the conversation—first use environment variables as placeholders in the code, then fill them in manually.
- Commit to Git after every key modification to facilitate rollback if issues arise.
- AI-generated code may not comply with your team's coding standards and requires manual adjustment.
- For code requiring high reliability (payments, authentication, data processing), manual review is mandatory after AI generation.
Scenarios suitable for Vibe Coding
Vibe Coding is not a panacea; understanding which scenarios it suits can help you allocate your energy better.
| Scenario | Suitability | Description |
|---|---|---|
| Prototype/MVP Development | Extremely high | Quickly validate ideas, produce a usable demo in a few hours |
| CRUD interface | Extremely high | Clear repetitive pattern, high AI completion |
| Frontend page/component | Very high | HTML/CSS/React component, AI is very proficient |
| Script/automation tool | High | One-off scripts, data processing, file operations |
| Writing unit tests | Very high | Generating test cases based on function signatures |
| Complex algorithm implementation | Medium | Requires a clear algorithm description and manual verification of correctness |
| Low-level system optimization | Low | Involves memory layout, cache lines, hardware characteristics, AI is prone to subtle errors |
| Code with high security requirements | Cautious | Code related to encryption, authentication, or payment must be reviewed by an expert after AI generation |