การพัฒนาซอฟต์แวร์ด้วย Claude Code
Dani Zysman
AI Curriculum Manager @ DataCamp

เอเจนต์คือผู้ช่วย AI เฉพาะทางภายใน Claude Code:
| เอเจนต์ | วัตถุประสงค์ | เมื่อใช้ |
|---|---|---|
| Explore | ตรวจสอบโค้ดเบสแบบอ่านอย่างเดียว | "วาดแผนผังสถาปัตยกรรมนี้" |
| Plan | ค้นคว้าและวางกลยุทธ์ | "เราควรจัดการเรื่องนี้อย่างไร" |
| General | ดำเนินการงานด้วยเครื่องมือครบชุด | ค่าเริ่มต้นสำหรับงานส่วนใหญ่ |
ใช้ /agents เพื่อแสดงรายการเอเจนต์ทั้งหมดที่มี

.claude/agents/code-reviewer.mdname: ตัวระบุเอเจนต์description: สิ่งที่ทำให้ทำงาน___
# code-reviewer.md
name: code-reviewer
description: Reviews code for
best practices
___
Check for:
1. Clear naming conventions
2. Proper error handling
3. Performance concerns
> /agents> [Select] Create new agent> [Select] Project level (.claude/agents)> [Select] Generate with Claude (recommended)> Create a code reviewer agent that reviews code for naming, error handling, and performance.
ตรวจสอบและอนุมัติไฟล์ที่สร้างขึ้น
music-analytics-api/
app.py
routes.py # <- We'll review this file
models.py
analytics.py
CLAUDE.md
.claude/
agents/
code-reviewer.md # <- Our custom agent
ไม่มีซับเอเจนต์ (ทำงานโดยตรง):
"Fix the bug in routes.py"
-> Claude handles it
"Add validation here"
-> Claude handles it
สร้างซับเอเจนต์:
"Map the architecture"
-> Explore agent
"How should we refactor?"
-> Plan agent
> @code-reviewer review @routes.py
Review Complete
Quick Fixes:
- Remove unused `session` import (line 3)
- Replace hardcoded `* 5` popularity metric with a named constant
Structural Issues:
- Album dictionaries built twice in get_album_stats() and
get_average_tracks() extract to a shared helper
- get_artist_albums() returns empty list if artist doesn't exist;
validate artist first
- No range validation on artist_id parameter
Would you like me to fix any of these?

| ประเภทคำถาม | สิ่งที่เกิดขึ้น |
|---|---|
| "ฟังก์ชันนี้ทำอะไร" | Claude ตอบโดยตรง |
| "ระบบยืนยันตัวตนทำงานอย่างไรในโค้ดเบสนี้" | Explore agent ทำการตรวจสอบ |
| "วิธีที่ดีที่สุดในการ refactor ส่วนนี้คืออะไร" | Plan agent ทำการค้นคว้า |
| "code review @routes.py" | จัดการโดยเอเจนต์แบบกำหนดเอง |
การพัฒนาซอฟต์แวร์ด้วย Claude Code