🐙 AI + GitHub Activities

กิจกรรม AI + GitHub

Practice GitHub Skills with AI While Learning Passive Voice — ฝึกทักษะ GitHub กับ AI พร้อมเรียน Passive Voice

Week 5 · Passive Voice · Hands-On Practice

📁 Tutorial 1: Create Your First GitHub Repo with AI README
บทเรียนที่ 1: สร้าง GitHub Repo แรกด้วย AI README

🎯

Create a Repo with AI-Generated README — สร้าง Repo พร้อม README จาก AI 🌱 Easy

สิ่งที่คุณจะได้เรียนรู้:

  • วิธีสร้าง GitHub repository ใหม่
  • การใช้ AI เพื่อสร้าง README file
  • การใช้ passive voice ในการอธิบายขั้นตอน
  • คำศัพท์ GitHub พื้นฐาน

What You'll Learn:

Create your first GitHub repository with an AI-generated README! You'll learn how repositories are created, how README files are written by AI, and how to describe steps using passive voice.

1สร้าง Repository — Create a Repository

ไปที่ github.com แล้วคลิก "New repository" ตั้งชื่อ repo เช่น "ai-english-project" ติ๊ก "Add a README file" แล้วคลิก "Create repository"

ใน passive voice: "A new repository is created on GitHub."

English: Go to github.com and click "New repository." Name it "ai-english-project", check "Add a README file", and click "Create repository."

In passive voice: "A new repository is created on GitHub."

2ใช้ AI สร้าง README — Ask AI to Generate a README

เปิด ChatGPT หรือ Claude แล้วขอให้สร้าง README ใช้ prompt ด้านล่าง README จะถูกเขียนโดย AI!

English: Open ChatGPT or Claude and ask it to generate a README. Use the prompt below. The README will be written by AI!

// Copy and paste this prompt into AI: // คัดลอกแล้ววางใน AI: "Please write a README.md file for a GitHub project called 'ai-english-project'. The project is used for learning English and AI. Include these sections: - Project Description (in English and Thai) - How to Use - Technologies Used - Author Use passive voice where possible. Example: 'This project was created for learning English.'"

3คัดลอกและ Commit — Copy and Commit

คัดลอก README จาก AI แล้ววางใน GitHub คลิก "Edit" บนไฟล์ README.md วาง content ใหม่ แล้ว commit

English: Copy the README from AI and paste it in GitHub. Click "Edit" on the README.md file, paste the new content, and commit.

// Write a commit message in passive voice: "README was updated with AI-generated content" // Describe what happened: // "The README was written by AI." // "The changes were committed to the repository." // "The file was updated successfully."

💡 Passive Voice Practice — ฝึก Passive Voice

Thai: อธิบายสิ่งที่คุณทำเป็น passive voice:

English: Describe what you did in passive voice:

  • ✅ "A repository was created on GitHub." (ถูก)
  • ✅ "A README file was generated by AI." (ถูก)
  • ✅ "The changes were committed successfully." (ถูก)
  • ❌ "I created a repository." (Active — not what we're practicing!)

💬 Tutorial 2: AI Commit Messages & Code Comments
บทเรียนที่ 2: ใช้ AI เขียน Commit Messages และ Code Comments

📝

AI-Powered Commit Messages — ใช้ AI เขียน Commit Messages 🔍 Medium

สิ่งที่คุณจะได้เรียนรู้:

  • วิธีใช้ AI เขียน commit messages ภาษาอังกฤษ
  • การเขียน code comments ที่ดี
  • การใช้ passive voice ใน commit messages
  • เทคนิคการอธิบายการเปลี่ยนแปลงโค้ด

What You'll Learn:

Use AI to write professional commit messages and code comments in English! Commit messages are written in passive voice in many professional projects.

1เข้าใจ Commit Messages — Understand Commit Messages

Commit message คือข้อความสั้นๆ ที่อธิบายว่าอะไรถูกเปลี่ยนแปลง ในโปรเจกต์มืออาชีพ commit messages ถูกเขียนเป็นภาษาอังกฤษ

English: A commit message is a short text that describes what was changed. In professional projects, commit messages are written in English.

// Good commit messages in passive voice: "Header layout was updated for mobile devices" "Login bug was fixed on the registration page" "New feature was added: dark mode toggle" "Unused code was removed from main.js" "Database connection was improved for performance" // Bad commit messages: // ❌ "fix" // ❌ "changes" // ❌ "update stuff"

2ให้ AI เขียน Commit Messages — Ask AI to Write Commit Messages

บอก AI ว่าคุณเปลี่ยนแปลงอะไร แล้วขอให้เขียน commit message เป็น passive voice

English: Tell AI what you changed and ask it to write the commit message in passive voice.

// Prompt for AI — คำสั่งสำหรับ AI "I made these changes to my code: - Changed the background color from blue to purple - Added a new button for login - Fixed a typo in the footer Please write 3 commit messages in passive voice. Example format: 'Background color was changed from blue to purple'"
AI might respond (ตัวอย่างที่ AI อาจตอบ):

1. "Background color was changed from blue to purple"
2. "A new login button was added to the navigation bar"
3. "A typo in the footer was fixed"

3เขียน Code Comments ด้วย AI — Write Code Comments with AI

Code comments คือข้อความอธิบายในโค้ด ขอให้ AI เขียน comments เป็นภาษาอังกฤษ

English: Code comments are explanations written inside code. Ask AI to write comments in English.

// Ask AI to add comments to this code: "Please add English comments to this code using passive voice: function calculateTotal(items) { let total = 0; for (let item of items) { total += item.price; } return total; }" // AI will add comments like: // The total price is calculated by this function // Each item's price is added to the total // The final total is returned

🔍 Tutorial 3: AI-Assisted Code Review
บทเรียนที่ 3: การตรวจสอบโค้ดด้วย AI

🏆

AI Code Review with Passive Voice — ตรวจโค้ดด้วย AI ใช้ Passive Voice 🏆 Hard

สิ่งที่คุณจะได้เรียนรู้:

  • วิธีให้ AI ตรวจสอบโค้ดของคุณ
  • การใช้ passive voice ในรายงานการตรวจสอบ
  • การอ่าน AI feedback เป็นภาษาอังกฤษ
  • การแก้ไขโค้ดตามคำแนะนำของ AI

What You'll Learn:

Learn how code is reviewed by AI! Practice reading AI feedback in English and describing bugs using passive voice: "The bug was found by AI", "The code has been reviewed."

1เตรียมโค้ดที่มี Bug — Prepare Code with Bugs

คัดลอกโค้ดด้านล่างที่มี bugs ซ่อนอยู่ แล้วส่งให้ AI ตรวจสอบ

English: Copy the code below that has hidden bugs, then send it to AI for review.

// This code has bugs! Send it to AI for review. // โค้ดนี้มี bugs! ส่งให้ AI ตรวจ function greetUser(name) { if (name = "admin") { // Bug 1: should be === return "Welcome, Administrator!" } console.log("Hello, " + Name) // Bug 2: 'Name' should be 'name' return "Hello, " + name } let users = ["Alice", "Bob", "Charlie"] for (let i = 0; i <= users.length; i++) { // Bug 3: should be < greetUser(users[i]) }

2ส่งให้ AI ตรวจ — Send to AI for Review

วางโค้ดลงใน AI chatbot แล้วขอให้ตรวจสอบ บอก AI ให้ใช้ passive voice ในการอธิบาย

English: Paste the code into an AI chatbot and ask it to review. Tell AI to use passive voice in the explanation.

// Prompt for AI code review "Please review this JavaScript code for bugs. Describe each bug using passive voice. For example: 'A bug was found on line 2.' 'The comparison operator should be changed to ===' Also explain in Thai."
AI Review Result (ผลการตรวจจาก AI):

Bug 1: A bug was found on line 2. The assignment operator (=) should be replaced with the comparison operator (===).
บั๊กถูกพบที่บรรทัด 2 ตัวดำเนินการกำหนดค่า (=) ควรถูกเปลี่ยนเป็นตัวดำเนินการเปรียบเทียบ (===)

Bug 2: A typo was detected on line 5. 'Name' should be changed to 'name' (lowercase).
พบตัวพิมพ์ผิดที่บรรทัด 5 'Name' ควรถูกเปลี่ยนเป็น 'name' (ตัวเล็ก)

Bug 3: An off-by-one error was identified on line 9. '<=' should be replaced with '<'.
พบข้อผิดพลาด off-by-one ที่บรรทัด 9 '<=' ควรถูกเปลี่ยนเป็น '<'

3แก้ไขและรายงาน — Fix and Report

แก้ไข bugs ทั้งหมด แล้วเขียนรายงานเป็น passive voice

English: Fix all the bugs and write a report in passive voice.

// Write YOUR code review report — เขียนรายงานการตรวจโค้ด "Code Review Report: - Three bugs were found by AI in the code. - The comparison operator was changed from = to ===. - A variable name was corrected from 'Name' to 'name'. - The loop condition was fixed from <= to <. - All bugs have been fixed successfully. - The code has been reviewed and approved."

4Commit การแก้ไข — Commit Your Fixes

เขียน commit message สำหรับการแก้ไขโดยใช้ passive voice

English: Write a commit message for your fixes using passive voice.

// Commit messages for the fixes: "Three bugs were fixed based on AI code review" "Comparison operator was corrected in greetUser function" "Variable name and loop condition were fixed"

📝 Grammar Checkpoint — ตรวจสอบไวยากรณ์

ก่อนจะจบ ทบทวน Passive Voice อีกครั้ง:

Structure / โครงสร้าง:

Present Passive: is/am/are + V3 → "The code is written by AI."

Past Passive: was/were + V3 → "The bug was found yesterday."

Present Perfect Passive: has/have been + V3 → "The code has been reviewed."

Active → Passive Transformation / การเปลี่ยน Active เป็น Passive:

Active: AI writes the code. → Passive: The code is written by AI.

Active: The developer fixed the bug. → Passive: The bug was fixed by the developer.

Active: They have merged the branch. → Passive: The branch has been merged.

Common V3 for GitHub / V3 ที่ใช้บ่อยกับ GitHub:

write → written | create → created | push → pushed | pull → pulled

merge → merged | fix → fixed | review → reviewed | update → updated

find → found | add → added | remove → removed | commit → committed

Best Practices — เทคนิคการใช้ AI + GitHub

💡 Tips for AI + GitHub Workflow — เคล็ดลับ AI + GitHub

  • Write clear commit messages: "Button color was changed to blue" is better than "fix" — เขียน commit message ชัดเจน
  • Use AI for code review: Paste your code and ask AI to find bugs — ใช้ AI ตรวจโค้ดหาบั๊ก
  • Practice passive voice: Describe changes as "was updated", "has been fixed" — ฝึกใช้ passive voice
  • Ask AI for comments: "Please add English comments to my code" — ขอให้ AI เขียน comment ภาษาอังกฤษ
  • Review AI suggestions: Always check AI code before committing — ตรวจสอบโค้ดจาก AI ก่อน commit เสมอ

⚠️ Things to Watch Out For — สิ่งที่ต้องระวัง

  • AI code may have bugs: AI-generated code should always be tested — โค้ดจาก AI ต้องถูกทดสอบเสมอ
  • Don't share secrets: API keys and passwords should never be committed — อย่า commit รหัสผ่านหรือ API keys
  • Understand before committing: Code should be understood before it is pushed — เข้าใจโค้ดก่อน push
  • Give credit: AI-generated content should be noted — ควรระบุว่า content ถูกสร้างโดย AI

🏆 เก่งมาก! You've Done Great!

กิจกรรมทั้งหมดถูกทำเสร็จแล้ว! คุณได้ฝึก passive voice กับ GitHub แล้ว!

All activities have been completed! Passive voice has been practiced with GitHub!

ตอนนี้คุณพร้อมทำแบบทดสอบแล้ว!

Now you are ready for the exam!