Yee Fei เล่าเรื่องเปลี่ยนจาก workflow เดิม (parallel task launcher ใน CLAUDE.md) ไปเป็น specialist subagent แต่ละตัวมี role + tool เฉพาะ — พร้อมตัวอย่าง “Minions” 4 ตัวที่ใช้จริง
Workflow เดิม: Generic Task Launcher
เดิมใช้แค่ rule ทั่วไปใน CLAUDE.md อนุญาต parallel task “min 2, max 5 agents as applicable” ใช้ได้แต่ไม่มี specialization + custom context ต่อ agent — ใช้ system prompt เดียวกันหมด เหมาะกับงานพื้นฐานเท่านั้น
Claude Code Subagent คืออะไร
Subagent = AI agent เฉพาะทางใน Claude Code แทนที่จะ deploy generalist ตัวเดียว configure แต่ละตัวมี role + toolset ต่างกันได้
Feature หลัก:
- Custom Role — นิยาม behavior ผ่าน system prompt
- Dedicated Context — context window แยก ป้องกัน information bleed
- Specialized Tool — ให้ tool เฉพาะที่จำเป็น รวม MCP server integration
ประโยชน์ที่ไม่คาดคิด: เรียนไปด้วยกัน
ทำงานกับ subagent ได้ educational value ไม่คาดคิด — agent แนะนำ framework + pattern ใหม่ที่ขยายความรู้ (บางครั้งข้อมูล overload)
Activate agent ด้วยการอ้างชื่อใน prompt · description guide ว่า Claude ควรใช้ตัวไหน
วิธี Setup Subagent
- รัน
/agentsใน Claude Code - เลือก “Create New Agent”
- เลือก scope: project-level หรือ user-level
- นิยาม name, description, system prompt, tool
Minions ในการทำงานจริง
Kevin the Architect
รับงาน refactor ซับซ้อน มี systematic plan:
- สร้าง detailed plan ต้อง approve ก่อนแก้ code
- ใช้ Zen MCP tool สำหรับ critical thinking + perspective
- ใช้ Context7 MCP review documentation
- Priority: security + backward compatibility
Bob the Debugger
เชี่ยวชาญ root-cause analysis:
- ถามคำถาม clarifying isolate issue
- ใช้ Zen MCP debug + tracer tool
- Access Supabase MCP ดู database schema
- เสนอ fix เจาะจง + validation test
Stuart the Code-Reviewer
ดูแล code quality + standard:
- อ่าน project
CLAUDE.mdดู architectural pattern - เช็ค framework usage + security
- ค้น tool ที่เกี่ยวข้องเอง (เช่น Zen MCP secaudit)
Dave the Test-Writer
จัดการ QA automation:
- Design test plan ครอบคลุม UI + database layer
- เขียน Playwright script simulate user interaction
- Generate screenshot อัตโนมัติสำหรับ functional test
- Deliver pass/fail report ละเอียด
Agent เฉพาะเพิ่มเติมที่คิดจะทำ
- Security-focused agent รัน secaudit + related test
- UX/UI specialist ดู accessibility + design evaluation
ผู้เขียนวางแผนพัฒนา workflow ที่ structured กว่านี้ ครอบคลุม phase + workstream — โพสต์ถัดไปจะเล่า success + บทเรียน
แหล่งที่มา: “Building with Claude Code Subagents (My Beloved Minions)” โดย Yee Fei ตีพิมพ์ 3 ส.ค. 2025 บน Medium · อ่านต้นฉบับ