KRIT.JUNSREE PERSONAL WEBSITE
MEDIUM

Subagent My Beloved Minions — สร้าง Specialist Agent จริงจากงาน iOS

แปลบทความ Yee Fei — เปลี่ยนจาก parallel task launcher ใน CLAUDE.md เป็น specialist subagent 4 ตัว (Kevin the Architect, Bob the Debugger, Stuart the Code-Reviewer, Dave the Test-Writer) ที่ใช้ MCP tool ต่างกัน (Zen, Context7, Supabase) — pattern ที่ apply กับทีมจริงได้

By krit.junsree@gmail.com ◆ Jul 10, 2026 ◆ 5 MIN READ Beginner

☰ ON THIS PAGE

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

  1. รัน /agents ใน Claude Code
  2. เลือก “Create New Agent”
  3. เลือก scope: project-level หรือ user-level
  4. นิยาม 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 · อ่านต้นฉบับ

Leave a Reply

Your email address will not be published. Required fields are marked *