Skip to content

Block 1 - AI Tools Setup

Block 1: AI Tools Setup

09:00 - 10:30 90 minutes 3 Quests

🎯 Learning Goals

เมื่อจบบล็อกนี้ คุณจะ:

  • ติดตั้งและตั้งค่า GitHub Copilot ใน VS Code
  • ใช้ Claude Code สำหรับ terminal-based AI
  • เปรียบเทียบเครื่องมือ AI ที่แตกต่างกัน

📖 Concept: The AI Toolkit Landscape (30 min)

What is AI-Assisted Development?

AI-assisted development คือการใช้ AI tools เพื่อช่วยเขียนโค้ด เร็วขึ้นและดีขึ้น

The Shift: Manual → AI-Assisted

เดิม: คิด → เขียนโค้ด → Debug → Test
ใหม่: คิด → บอก AI → Review → Refine → Deploy

Key Concepts

Tokens

  • หน่วยย่อยของข้อความที่ AI อ่าน
  • แต่ละ token อาจเป็นคำ หรือส่วนของคำ
  • สำคัญเพราะมีผลต่อ cost และ context window

Context Window

  • จำนวนข้อมูลที่ AI จำได้ในแต่ละครั้ง
  • มากขึ้น = จำได้มากขึ้น = ดีขึ้น

Hallucination

  • เมื่อ AI สร้างสิ่งที่ไม่มีอยู่จริง
  • ต้อง verify ทุกครั้ง

🛠️ Tools Overview

GitHub Copilot

  • What: AI pair programmer ใน VS Code
  • How: Suggests code as you type
  • Best for: Inline code completion

Claude Code

  • What: Terminal-based AI assistant
  • How: Chat in terminal, execute commands
  • Best for: Complex tasks, debugging

CodeRabbit

  • What: AI code review
  • How: Reviews PRs automatically
  • Best for: Quality assurance

🎮 Code Quests

🟢 Quest 1.1: First AI Completion

Goal: Use GitHub Copilot to write a function

  1. Install GitHub Copilot

    • Open VS Code
    • Go to Extensions (Ctrl+Shift+X)
    • Search “GitHub Copilot Chat”
    • Install and sign in
  2. Create a new file

    factorial.js
  3. Write a comment

    // Calculate factorial of n using recursion
  4. Accept Copilot’s suggestion (Tab key)

  5. Test your function

    console.log(factorial(5)); // Should output 120
    console.log(factorial(10)); // What does this output?

Deliverable: Working factorial function + screenshot


🟡 Quest 1.2: Multi-file Generation

Goal: Generate a complete utility library with AI — specify the interface first.

  1. ดึงไฟล์ quest ลงเครื่อง:

    Terminal window
    npx degit Poom5741/ai-sdlc-course/quests/block-1-ai-tools/quest-02-multi-file my-quest
    cd my-quest
  2. เขียน interface ใน problem.js ก่อน (add/subtract/multiply/divide/calculate)

  3. ให้ AI generate แต่ละ file (math.js, validators.js, index.js) ตาม interface

  4. ตรวจสอบ:

    Terminal window
    node test.js

Deliverable: ไลบราตี multi-file ที่ส่ง interface ตรงกับที่กำหนด + ทดสอบผ่าน


🟡 Quest 1.3: Compare Tools

Goal: รัน prompt เดียวกันใน 2+ AI tools และเปรียบเทียบ (calibrate your tools)

  1. ดึงไฟล์ quest ลงเครื่อง:

    Terminal window
    npx degit Poom5741/ai-sdlc-course/quests/block-1-ai-tools/quest-03-compare-tools my-quest
    cd my-quest
  2. รัน prompt เดียวกัน ใน 2+ AI tools เช่น sortByKey(array, key, ascending)

  3. เขียน comparison.md ในโฟลเดอร์ พร้อม sections: Tool, Output, Better, Why

  4. ตรวจสอบ:

    Terminal window
    node test.js

Deliverable: comparison.md ที่ผ่าน checklist validator (sections ครบ + ≥200 ตัวอักษร)


✅ Block 1 Checklist

  • GitHub Copilot installed
  • Quest 1.1 completed
  • Quest 1.2 completed
  • Quest 1.3 completed

🚀 Next Block

Block 2: Prompt Engineering + Loops → Learn to write better prompts and set up iterative workflows.

Continue to Block 2 →