CLAUDE.md ไฟล์เดียว ทุกหลักสูตร
48 กฎจาก 10 หลักสูตร หลักฐาน 9 แบบ และรั้ว 12 แถวที่ย่อมาจากทุกกระดาน ทุกบรรทัดลงท้ายด้วยกระดานที่สอนมัน กดเพื่อดู prompt ตรวจของเรื่องนั้นด้านล่าง คัดลอกทั้งบล็อก หรือ ดาวน์โหลดเป็นไฟล์ แล้ววางที่ root ของ repo
# CLAUDE.md — Agent Dev Thai Academy
กฎ 48 ข้อจาก 10 หลักสูตร 48 กระดาน หลักฐาน 9 แบบที่ต้องอยู่ในคำตอบก่อนคำว่าเสร็จ และรั้ว 12 แถวที่ใส่แล้วปัญหาไม่กลับมา กฎทุกข้อลงท้ายด้วย path ของกระดานที่สอนมันบนเว็บ Agent Dev Thai Academy หลักฐานกับรั้วลงท้ายด้วยชื่อกระดานที่มันย่อมา (หลักสูตร/กระดาน)
วางไฟล์นี้ที่ root ของ repo แล้วตัดบรรทัดที่ไม่เกี่ยวกับงานคุณออกได้ ฉบับยาวของแต่ละกระดาน (อาการ · prompt ตรวจ · หลักฐาน · รั้ว) อยู่ที่ /audit#หลักสูตร-กระดาน และกฎอีก 83 ข้อจากโพสต์ของเพจอยู่ที่ /audit#from-page
## กฎ
### SOLID ในโค้ดจริง — /solid
- Don't refactor or improve code beyond what was asked. Flag it instead. · /solid#S
- A new channel is a new file that implements the existing interface. Don't add a branch to the shared one. · /solid#O
- A new implementation passes the same contract test as the old one. Compiling is not done. · /solid#L
- Rules for some files go in .claude/rules/ with paths:, not in this file. · /solid#I
- Files with business rules never import a vendor SDK directly. · /solid#D
### Clean Architecture ในโค้ดจริง — /clean
- Search for an existing rule before writing a new one. Business rules import nothing from UI or DB. · /clean#rule
- Use cases take plain data. Convert requests, rows and timezones at the edge. · /clean#boundary
- Fetch data in code first. The model only reads the files. Missing data is n/a, never a guess. · /clean#humble
- Read env and create clients only in main. Fail at startup and name the missing variable. · /clean#main
### Design Patterns ในโค้ดจริง — /patterns
- A new pricing rule is a new class behind PricingRule. Don't add a case to the switch. · /patterns#strategy
- Emit an event. Don't call email or analytics directly from the code that raised it. · /patterns#observer
- Each external API gets one adapter file. Nothing else imports its SDK. · /patterns#adapter
- Add logging, caching or retry by wrapping the service, not by editing it. · /patterns#decorator
- Create courses through CourseFactory. Feature code never calls new VideoCourse(). · /patterns#factory
- Feature code calls checkout() on the facade. Don't wire payment, enrollment and email yourself. · /patterns#facade
- Every write command carries an id. An id the server has seen returns the old result. · /patterns#command
- Keep the enrollment steps in the base flow. A new course type overrides only the step that differs. · /patterns#template
### Engineering practice ในงานจริง — /practice
- Work on a feature branch. Never commit or push to main. · /practice#branch
- Before adding a table, service or module, state the smallest fix and why it is not enough. · /practice#small
- Paste the real test output before saying done. If a bug fix changes a test file, say why first. · /practice#ci
- One change per commit. Use feat:, fix: and BREAKING CHANGE: so the version reads from the log. · /practice#commit
- R0 (deploy, migration, push to main) stop and ask. R2 (easy to revert) just do it. · /practice#rollback
### DDD ในงานจริง — /ddd
- This terminal owns billing/ only. Changes that touch learning/ go through a handoff. · /ddd#context
- Use the terms in GLOSSARY.md. If a word could mean Customer or User, ask which. · /ddd#language
- Change an order only through Order methods. Totals are computed inside, never taken from the caller. · /ddd#aggregate
- Map external responses to our types in one translator. Missing fields become explicit nulls. · /ddd#acl
### แผนภาพที่ CI เช็กได้ — /uml
- domain/ never imports from app/ or infra/. CI checks the imports. · /uml#class
- Write the main flow as numbered steps, then one test that runs those steps through the public API. · /uml#sequence
- Status changes go through the transition table. An unknown status throws. It never falls back to a default. · /uml#state
### Agent setup ในงานจริง — /setup
- Hard limits live in hooks, folder rules in .claude/rules/ with paths. Before adding a rule, name the rule it overlaps. · /setup#rules
- On a pattern failure, log it to MEMORY.md: what happened, root cause, correct behavior. Read spec.md first; update it before saying done. · /setup#memory
- A new skill names the failure it prevents. Keep descriptions under two lines; cut skills that were never invoked. · /setup#skills
- Every pipeline with a read and a write side: verify both, not just the side that produces output. · /setup#pipeline
### ชิมก่อนรับ — /taste
- Before generating UI, read the reference notes. No gradient text, no particle hero, no three-column card grid. Run the slop audit before shipping. · /taste#web
- Before a draft ships, run the five taste filters: brag, voice, concrete, position, bloat. If it fails, rewrite it from a new angle; don't patch words. · /taste#post
- AI assists execution. Operator owns architecture. Don't over-automate decision-making. · /taste#gate
### ใช้ kanly ให้ agent มีกติกา — /kanly
- If a change here affects another repo, write a handoff before ending: what changed, what to do next, breaking changes, the new contract. Read pending handoffs before starting. · /kanly#handoff
- Never start an autonomous loop without named, checkable done conditions written first. Close only when every condition passes; a timeout is not done. · /kanly#contract
- The writer is not the approver. Review in a fresh context that sees the spec, the diff and the tests. Answer every flag: fix it or give a one-line reason; silence counts as a dodge. · /kanly#review
- Every terminal reads the same state file at start; whoever changes something writes it there. Never claim a change is complete without running verification. "I edited the file" is not done. · /kanly#receipt
### แผลเป็นจากงานจริง — /scars
- Name a derived fact once in core and call it from every path. A second definition of the same fact is the bug. · /scars#fact
- A replacement makes the old path unreachable in the same change, proven by grep. No soft deprecation; flip the doc too. · /scars#replace
- A why, triage or pushback turn contains zero edits. Report the operator's own change; never reverse it. · /scars#explain
- Put the money unit in the type, never in a comment or a field name. Convert once, at the provider boundary. · /scars#unit
- Name no cause without a receipt: file:line, a live response or a log line. Re-read your own diff first. · /scars#theory
- A catch never returns a value that looks like data. Health checks call the dependency, not the env var. · /scars#catch
- Before a code fix, name where the behaviour lives: repo, vendor dashboard or this deploy's secrets. Verify the runtime store. · /scars#outside
- Read done and deployed from the live endpoint and the running version, never from a handoff, a memory or a commit. · /scars#wire
## ก่อนพูดว่าเสร็จ · หลักฐานที่ต้องอยู่ในคำตอบ
- ทุกคำตอบเรื่องโครงสร้างมาเป็นตารางที่มีไฟล์กับช่วงบรรทัดจริง ไม่ใช่ชื่อไฟล์หรือคำว่า น่าจะ (solid/S · solid/L · clean/boundary · taste/web)
- ตัวเลขดิบ ไม่ใช่ค่าเฉลี่ย: PR ละกี่ไฟล์กี่บรรทัด, commit ที่ขึ้น `main` ตรงกี่ครั้ง, `new PrismaClient()` และ `process.env` อยู่กี่ที่, ใช้จริงต่อที่มีให้ของทุกไฟล์ที่ import (practice/small · practice/branch · clean/main · solid/I)
- ของที่อ้างว่ามี ยกมาทั้งบรรทัดจากไฟล์จริง หรือตอบว่าไม่มี: คำสั่ง rollback, เงื่อนไขจบของ loop, ไฟล์เสียง, บรรทัดที่บอกทุก session ให้อ่านไฟล์สถานะ (practice/rollback · kanly/contract · taste/post · kanly/receipt)
- ตารางจับคู่ที่ช่อง none คือของที่ต้องทำ: กฎ ↔ check ใน CI, cron ที่เขียนไฟล์ ↔ บรรทัดที่อ่านมัน, feature ↔ คนที่เจ็บถ้าไม่มี, commit ที่เปลี่ยนของที่อีก repo ใช้ ↔ handoff (practice/ci · setup/pipeline · taste/gate · kanly/handoff)
- graph ของ import และ sequence ของการเรียก ไล่จากเครื่องมือและโค้ดจริง พร้อมคำสั่งที่ใช้สร้างและไฟล์กับบรรทัดของแต่ละลูกศร ไม่ใช่วาดจากความจำ (uml/class · uml/sequence)
- ทุกทางเข้าของการกระทำเดียวกัน รวม script ที่คนรันมือ และทุกที่ที่เปลี่ยนจำนวนหรือสถานะ พร้อมคำตอบว่าเช็กกับเขียนอยู่ใน transaction เดียวกันไหม (patterns/command · ddd/aggregate · uml/state)
- โซ่การรั่วของ vendor: type หรือสถานะของมันไหลไป signature ไหน ไฟล์ไหน และกฎข้อไหนของเราตัดสินใจจากมัน (solid/D · ddd/acl · patterns/adapter)
- สิ่งที่โมเดลเห็นจริง ไม่ใช่สิ่งที่มีในโฟลเดอร์: ไฟล์ที่ถูกโหลดตอนเปิด session, จำนวน skill กับความยาวคำอธิบายรวม, คำที่ใช้เรียกเรื่องเดียวกันกี่แบบ (setup/memory · setup/skills · ddd/language)
- ของที่อ่านจากระบบจริง ไม่ใช่จากความจำ: ทุกที่ที่คำนวณความจริงเดียวกันเอง, ชื่อทางเก่าที่ค้นแล้วยังเจอ, ไฟล์ที่ถูกแก้ในรอบที่เป็นคำถาม, ที่ที่บอกหน่วยของทุกช่องเงิน, หลักฐานที่แนบกับสาเหตุแรกที่เอ่ย, catch ที่คืนค่าหน้าตาเหมือนข้อมูล, ที่ที่พฤติกรรมถูกตัดสินจริง, และที่มาของคำว่าเสร็จหรือ deploy แล้ว (scars/*)
## รั้ว · ใส่แล้วไม่กลับมาอีก
- โฟลเดอร์ละเจ้าของ ละ context เช่น `report/`, `charge/`, `sales/`, `billing/` แต่ละอันมี type ของตัวเองที่มีแค่ field ที่ใช้ และ port นิยามฝั่งคนใช้ (solid/S · solid/I · ddd/context)
- กฎธุรกิจอยู่ที่เดียวใน `core/` เป็น pure function ที่ test ได้โดยไม่เปิดเบราว์เซอร์ type ของ command อยู่ใน `core/` ชั้นนอกเป็นคนแปลงเข้าและแสดงผล (clean/rule · clean/humble · clean/boundary)
- `main.ts` ที่เดียวสร้าง client และอ่าน env แล้วส่งต่อ และ factory ที่เดียวต่อการตัดสินใจหนึ่งเรื่อง (clean/main · patterns/factory)
- ของนอกเข้าผ่านชั้นแปลเสมอ: adapter ละ vendor คืน type ของเรา, `acl/` แปลงสถานะเป็น enum ของเราก่อนเข้า domain, และ `eslint no-restricted-imports` ห้าม `core/` import SDK ของ vendor (solid/D · patterns/adapter · ddd/acl)
- ของใหม่คือไฟล์ใหม่ ไม่ใช่ if ใหม่: interface หนึ่งไฟล์กับ registry, strategy ละไฟล์, listener ละไฟล์ของ event ชื่อชัด, wrapper ละเรื่อง, command และ facade ละการกระทำ, โครงเดียว `runExport(steps)` ที่แต่ละรายงานส่งมาแค่ส่วนที่ต่าง (solid/O · patterns/*)
- สัญญาที่เครื่องรัน: `*.contract.test.ts` ต่อ interface, กฎของ class diagram เป็น config ของ `dependency-cruiser`, contract test ที่ใช้ fake จดลำดับการเรียกจาก sequence, ตาราง transition ไฟล์เดียวที่ throw เมื่อเส้นไม่อยู่ในตาราง (solid/L · uml/class · uml/sequence · uml/state)
- การเปลี่ยนจำนวนหรือสถานะผ่านทางเข้าเดียว เช่น `Cohort.enroll()` เช็กและเขียนใน transaction เดียว มี `version` หรือ row lock (ddd/aggregate)
- git: branch protection บน `main` ต้องผ่าน PR และ CI, CI เตือนเมื่อ diff เกิน 400 บรรทัด, commit บรรทัดแรกบอกอะไร body บอกทำไมและอะไรที่ตั้งใจไม่แตะ, ย้อนได้ด้วย `git revert` คำสั่งเดียว, กฎที่เครื่องตรวจได้ต้องมี check ใน CI (practice/*)
- ไฟล์ที่ agent อ่านก่อนทำ: `GLOSSARY.md` คำที่ใช้และคำที่ห้าม, `@MEMORY.md` กับกฎพลาดเมื่อไรจดสามช่อง, hook `PreToolUse` ที่ deny ไฟล์รหัสลับ force push และการลบทั้งโฟลเดอร์, skill ละโหมดคำอธิบายไม่เกินสองบรรทัด, cron ที่เขียนไฟล์มีบรรทัดที่อ่านมัน (ddd/language · setup/*)
- ก่อน gen และก่อนสร้าง: โน้ตอ้างอิงสามข้อที่จับต้องได้ใน repo, ห้าคำถามก่อนเขียน draft (โม้มั้ย เสียงเรามั้ย เรื่องจริงมั้ย ยั่วมั้ย บวมมั้ย), ห้าคำถามก่อนสร้าง feature ถ้าบอกไม่ได้ว่าใครเจ็บให้หยุด (taste/*)
- หลาย terminal: เปลี่ยนของที่อีก repo ใช้ต้องเขียน handoff ก่อนจบงาน, ไม่มีเงื่อนไขจบที่เช็กได้ไม่ปล่อย loop, คนเขียนไม่ใช่คนอนุมัติ, ไฟล์สถานะชุดเดียวที่ทุก terminal อ่านตอนเปิดและจดลงเมื่อเปลี่ยน (kanly/*)
- แผลจากงานจริง: ความจริงที่คำนวณได้มีชื่อเดียวใน `core/`, แทนที่แล้วทางเก่าหายใน change เดียวกันพร้อมผลค้น, รอบที่ถามว่าทำไมไม่มีการแก้ไฟล์, หน่วยเงินอยู่ใน type แปลงที่เดียว, ไม่มีหลักฐานไม่เอ่ยชื่อสาเหตุ, catch ไม่คืนค่าที่ดูเหมือนข้อมูล, บอกก่อนว่าพฤติกรรมอยู่ที่ไหนแล้วอ่านค่าจากที่ระบบใช้ตอนรัน, เสร็จอ่านจาก endpoint จริงและ version ที่รันอยู่ (scars/*)
กฎจากโพสต์ของเพจ · 83 ข้อตามเส้นทางอ่าน ไม่อยู่ในไฟล์ แต่ละข้อลิงก์ไปโพสต์ที่ทิ้งมันไว้
## จากเพจ · CLAUDE.md ตั้งแต่ไฟล์ว่าง จนถึงตัดกฎทิ้ง — /series/claude-md
### 1 · เพิ่งลง Claude Code แล้วไม่รู้จะเริ่มลงอะไรดี
- กฎ: Skills teach the agent how to think; MCP servers give it the tools you already use. Install the few used every day, not a list.
### 2 · ถ้าเป็นสาย Backend
- กฎ: Give the agent the tools of your own stack: library docs, the repo, the database you run, error tracking. Four that match is a setup; twelve is a list.
### 3 · CLAUDE.md + Mental Model Extraction
- กฎ: Voice: direct, no filler. Never open with "Great question" or "I'd be happy to help". If you disagree, say so.
### 4 · Rules ที่กัน AI โกหก
- กฎ: All assumptions explicit. If context is missing, state assumptions. Never claim a change is complete without running verification: evidence before assertions, no "should work now".
### 5 · CLAUDE.md Setup — รวมกฎที่ใช้จริงในไฟล์เดียว
- กฎ: Start of session: read spec.md before anything. After a task: update spec.md (current state, decisions, next). Never say done before spec.md is updated.
### 6 · MEMORY.md: ทำไม AI ทำพังซ้ำเดิมทุก session
- กฎ: When you identify a pattern failure or operational mistake: log it to MEMORY.md with what happened, root cause, correct behavior. Make it actionable for next session.
### 7 · บอกไปห้ารอบแล้วมันก็ยังทำผิดเหมือนเดิม
- กฎ: Fix it in the file, not in the chat; the file wins every session. Every "DO NOT" line must come from something tried first-hand, with the date.
### 8 · อธิบายเรื่องเดิมให้ AI ฟังทุก session
- กฎ: Every line in decisions.md carries a date and a reason. Rules get a review date; one past it is deleted, not kept out of fear.
### 9 · เขียนใน CLAUDE.md แล้วมันไม่ทำตาม — ไม่ใช่เขียนไม่ดี แต่เขียนผิดที่
- กฎ: Hard limits (secret files, force push, production config) are hooks, not sentences. Folder-specific rules live in .claude/rules/ with paths. CLAUDE.md keeps only what every task needs.
### 10 · เขียนกฎเพิ่มทุกครั้งที่ AI ทำพลาด สุดท้ายมันไม่ทำตามสักข้อ
- กฎ: Before adding a rule, name the existing rule it overlaps or contradicts. If you cannot, you do not know the file well enough to add to it.
### 11 · CLAUDE.md ยาวขึ้นเรื่อยๆ แล้วมันทำตามน้อยลง
- กฎ: Every rule must answer: what broke that made this line exist. No scar, no rule. Keep each rule under two lines.
### 12 · โมเดลใหม่ไม่ได้โง่ลง setup คุณยังเขียนไว้ให้ตัวเก่า
- กฎ: When the model changes, audit the setup written for the old one: skills never invoked, pressure words (ultrathink, MUST, REPEATEDLY), hardcoded model names, rules that contradict each other. Report only; change nothing until each finding is argued both ways.
## จากเพจ · สั่งงาน agent ให้ได้ของจริง — /series/agents
### 1 · ถ้าผมต้องเริ่มใช้ AI เขียน code ใหม่ตั้งแต่วันแรก
- กฎ: If the approach is wrong, rewrite the whole piece; don't patch over it. No over-engineering, no AI smell, specific over generic, verify before done.
### 2 · ใช้ AI มา 2 ปี — สิ่งที่เปลี่ยน output ไม่ใช่ prompt สวย ๆ
- กฎ: Don't agree with me by default; if I'm wrong, say so directly. When I describe a failure, challenge my root cause before proposing a fix.
### 3 · ผม Prompt ยังไงให้ได้ของจริง — ไม่ใช่ของ AI
- กฎ: Taste Filters: 1. โม้มั้ย — dinner test 2. เสียงเรามั้ย — group chat test 3. เรื่องจริงมั้ย — story not essay 4. ยั่วมั้ย — take a position 5. บวมมั้ย — max 5 sections
### 4 · Judgement Per Hour — ทำไมผมไม่ปล่อยให้ AI ทำงานเอง
- กฎ: AI assists execution. Operator owns architecture. Don't over-automate decision-making.
### 5 · Scope Drift Detection — สั่งให้แก้ bug 1 ตัว กลับมา refactor ทั้ง module
- กฎ: Track stated goals vs actual execution; flag when implementation expands beyond the original request. Don't add features, refactor code, or make improvements beyond what was asked.
### 6 · Spec-Driven Development: ผมไม่เคยกลัว /clear กับ /compact
- กฎ: After completing any task: update spec.md (current state, decisions made, what's next) and data contracts if any interface changed. Never claim "done" without updating spec.md first.
### 7 · AI ไม่ได้โกหก เราแค่ไม่เคยบอกให้มันพิสูจน์
- กฎ: เวลารีวิวโค้ด: ทุกข้อต้องลาก input -> จุดที่ขาดการเช็ค -> บรรทัดที่แก้เงินหรือ state ลากไม่ได้ให้ทิ้ง ไล่ก่อนว่ามีอะไรกันไว้แล้วมั้ย ถ้ามีที่อื่นในโค้ดที่ทำถูกให้ชี้มาด้วย ส่วนละไม่เกินสองข้อ ไม่มีก็บอกว่าไม่มี ห้ามเสนอเรื่องความสวยงามหรือเผื่ออนาคต
### 8 · แล้วจะรู้ได้ไงว่าพร้อมขึ้น Prod? — ผมให้ AI ตัวอื่น Roast โค้ดก่อนขึ้น Production
- กฎ: Before deploying anything that touches user data or money, a model that did not write the code reviews it as a senior engineer signing off. Prototypes skip this.
### 9 · Loop Engineering — incentive setup (Axelrod ledger)
- กฎ: Answer every review flag: fix it, or reject it with a one-line reason. A silent ignore counts as defection. Track reviewer precision over the last 5 rounds.
### 10 · Multi-Agent is Overrated — ทุกคนสร้างทีม AI 5 ตัว ผมใช้ตัวเดียว
- กฎ: One agent, a skill per task, CLAUDE.md as the shared rules. Add an agent only when tools, permissions or state must be separate, or work truly runs in parallel.
### 11 · จัดการ AI agent เหมือนจัดการลูกทีม
- กฎ: Each terminal owns one domain and its folders. Its CLAUDE.md states what it may touch and how it hands work to the others.
### 12 · เคยสั่งให้ AI agent วิ่งทำงานเองแบบ goal mode แล้วเดินไปทำอย่างอื่น พอกลับมามันขึ้น "เสร็จ
- กฎ: Never start an autonomous loop without named, checkable done conditions, each with its check and a pass/fail result. Write them before the run; close only when all pass.
## จากเพจ · Skill ตั้งแต่ใช้ของคนอื่น จนตรวจเองเป็น — /series/skills
### 1 · สกิลที่ผมหยิบใช้บ่อยมากตัวหนึ่งคือ /visual-explainer 📊
- กฎ: When an explanation would run long as text or as an ASCII table or diagram, render it as one self-contained HTML page with /visual-explainer instead.
### 2 · หยุดติดตั้ง Skill Pack คนอื่น — Build Your Own Arsenal
- กฎ: Before extracting a skill, ask: if this step is skipped, does something actually break? Only steps that were skipped once and broke become skills.
### 3 · hold-up skill drop — กัน Claude ทำก่อนเข้าใจ
- กฎ: ก่อน action ที่ไม่เล็ก (แก้ไฟล์/commit/รัน workflow): เช็ค mode ก่อน เจอ cue คุยเล่น ("ว่าจะ/ดีไหม/น่าจะ/คำถามไม่มีคำสั่ง") → อย่าทำ ถามกลับ 1 คำถาม สั่งชัด + ภาพครบ + reversible → ทำเลย ไม่ต้องถาม
### 4 · Occam Skill Drop — หยุดแก้บั๊ก 1 บรรทัด ด้วย service ใหม่ 250 บรรทัด
- กฎ: ก่อน finalize plan ที่มี table, service, หรือ module ใหม่ — รัน Occam audit: (1) บั๊กคืออะไร ประโยคเดียว (2) fix เล็กสุด (3) version ใหญ่ป้องกันอะไรเพิ่ม (4) เคสพังนั้นเกิดจริงมั้ย วันนี้?
### 5 · Product Taste — ก่อน build feature ถามตัวเอง 5 ข้อนี้ก่อน
- กฎ: Before building any feature: who suffers without this? Name a specific person, not "users". If you can't answer, stop. If the current workaround is "fine", stop. If it strengthens no core-loop step, defer.
### 6 · /ct — รู้ว่าควรปักหมุด แต่ตอนห้าทุ่มไม่มีใครทำ
- กฎ: Derive the version bump from commit messages (BREAKING or ! major, feat minor, fix or perf patch; highest wins). Annotated tags only, never move one, never push: print the command.
### 7 · โหลด skill มา 2 ตัว 24 วันยังไม่ได้ใช้
- กฎ: When reviewing the skill folder, count real invocations per skill in the last month of session logs. Install sessions and comparisons do not count. Flag every skill with none.
### 8 · NVIDIA สแกน skill pack ผม แล้วบอกว่าอย่าติดตั้ง
- กฎ: Scan third-party skills before install (skillspector scan <path> --no-llm). Judge by rule name, not severity: exfiltration, undeclared code execution and over-broad permissions matter; AS3 alone does not.
### 9 · ใช้ skill stack พวกนั้นอยู่ อยากรู้มั้ยว่ามันมาจากไหน
- กฎ: A new skill needs an observed failure: what ran, what the skill did, what was expected. If the behaviour composes from existing skills, it does not get a new one.
### 10 · Claude Code Mods มาแล้ว ไทม์ไลน์เต็มไปด้วยคลิป Tetris แต่ของจริงอยู่ในคอมเมนต์ใต้ issue
- กฎ: Before trusting a guard hook, break it on purpose (throw, hang, malformed return) with --debug-file on and check what got through. Point new mods at one repo, not the machine.
### 11 · ลอง Claude Mods มาทั้งวัน กันของได้ดีกว่าที่คิด แล้วพอลองทำให้มันพัง มันก็เงียบไปเฉย ๆ
- กฎ: A guard hook fails open by default. Add .catch() to every hook that blocks something, and confirm it loaded with --debug-file. Silence means unknown, not fine.
## จากเพจ · Copilot OS ให้ AI รันเองทั้งวัน — /series/copilot-os
### 1 · Copilot OS #1: ผม automate ชีวิตด้วย 35 cron jobs
- กฎ: Start with three jobs that send to where you read: morning brief, end of day, weekly review. Housekeeping jobs only log. Add jobs one pain point at a time.
### 2 · Copilot OS #2: เบื้องหลัง Morning Brief — prompt จริง + architecture
- กฎ: Interpretation rules live in the prompt, not the data: name the signal that matters most. Before writing, argue bull and bear silently, then write in one voice.
### 3 · Copilot OS #3 — Accountability Loop ที่ไม่ให้โกหกตัวเอง
- กฎ: Each morning, log three things to ship. Each evening, read that log and mark each SHIPPED, PARTIAL or BLOCKED. Blocked three days running: ask what decision is being avoided.
### 4 · ผมสร้าง AI ที่ไล่ให้ไปนอน — Copilot OS #4
- กฎ: เช็คเวลาปัจจุบัน timezone Asia/Bangkok ทุกครั้งที่เริ่ม session ถ้าหลัง 23:00 ห้ามรับงานใหม่ บอกให้ปิด terminal ไปนอน ไม่ต้องอ้อมค้อม ยกเว้นถ้าบอกว่ามี production incident จริงๆ เท่านั้น
### 5 · Hot Cache — "ผมให้ AI อ่านทุกอย่างก่อนตอบ — แต่ไม่ต้องเปิดเอง"
- กฎ: อ่าน data/hot-cache.md ก่อนตอบคำถามเรื่อง project status, blockers, หรือ decisions
### 6 · สรุปตลาดทุกเช้าด้วย AI แต่ตัวเลขมั่ว — แยก fetch ออกจาก gen
- กฎ: Never fetch data while writing the brief. Read only the files the cron already wrote. If a source is missing, write "n/a"; never guess a number.
### 7 · Claudegram: ทำไมผมถึงคุม Claude Code จาก Telegram
- กฎ: Keep the bot dumb: receive, run, return. A new ability is a new skill file plus a trigger line in CLAUDE.md, never a change to bot code.
### 8 · Loop Engineering — เปลี่ยน workflow ตัวเองให้รันเองตอนกลางคืน
- กฎ: Overnight runs commit only to a new branch. Never push, never deploy, never touch secrets or another repo. If a change can't be proven safe, queue it.
### 9 · ลองเอาโจทย์เดียวกันไปรันกับ loop engineering 3 ค่าย บน bot signal ของตัวเอง
- กฎ: State a goal and a measurable finish line, such as pytest green. With several approaches, try each in a subagent and let a separate verifier pick.
### 10 · อยากปล่อย AI รันข้ามคืน ต้องเลิกกดตัดมันก่อน
- กฎ: Decide what you can, then say what you chose. Ask only when a wrong choice means tearing work out. Anything said three times goes in this file.
### 11 · AI ลืมไปว่าตัวเองเป็น AI
- กฎ: Ask who reads the output. If the model reads it, send text in the prompt. Write code only when a scheduler or the filesystem reads it.
### 12 · รัน Claude Code กับ Codex อยู่หลายเครื่อง เครื่องบ้าน เครื่องออฟฟิศ VPS อีกตัว ทุกครั้งที่
- กฎ: Skills are source code: one git vault for every machine. Sync copies only what is missing; on a mismatch report a conflict and skip. Dry-run unless told to apply.
## จากเพจ · ใช้ token ให้คุ้ม — /series/cost
### 1 · Claude Code / Claude API ใช้ token เร็วมากกว่าที่หลายคนคิด
- กฎ: Terse, filler-free output is for pipeline steps no human reads. Anything a person reads stays in plain full sentences.
### 2 · ผมประหยัด Token ยังไง — คิดกับ GPT สร้างกับ Claude
- กฎ: This session builds; it does not explore. Implement against the given spec. If names, payloads or error handling are missing, stop and ask instead of exploring.
### 3 · ผมจ่าย Claude Max เดือนละ $200 เลยลองรัน Fable 5 ให้หนักที่สุดเท่าที่จะทำได้
- กฎ: When asked about cost, split usage into output, cache write and cache read, and report the cache hit rate before comparing models.
### 4 · prompt เกินแสน token แค่ตัวเดียว ค่าทั้งรอบคูณห้า
- กฎ: On Haiku 5.5, keep every request's prompt, cache reads and writes included, under 100K tokens. Move long work to a subagent and bring back only its summary.
### 5 · ตั้งใจใช้ Fable ให้หมดโควต้าทุกสัปดาห์ จนได้ยินเรื่อง Anthropic จะ IPO
- กฎ: พักเกินประมาณหนึ่งชั่วโมง อย่ากลับไปพิมพ์ต่อในแชทเดิม /wrap แล้ว /clear
### 6 · สมัคร Codex แพลน $100 มา รัน GPT-5.6 Sol Ultra บน fast mode แล้วเผาลิมิตรายสัปดาห์หมดภายใน
- กฎ: Expensive runs go to work that can be re-checked: tests or artifacts. With nothing to verify against, stop and ask for references or context instead of guessing.
### 7 · $10 ต่อเดือน รัน 17 service
- กฎ: Before picking where a service runs, say whether it is idle (bot, cron, prototype) or has real users. Idle goes usage-billed; real traffic gets a fixed-price box.
## จากเพจ · ทำคอนเทนต์ด้วย AI โดยไม่เป็น slop — /series/content
### 1 · Design Taste — เลิก gen แล้วถามว่า "สวยมั้ย" — ผมถาม 4 คำถามนี้แทน
- กฎ: Never take "make it beautiful" as a brief. Start from the brandbook, then check every page: squint, remove until it breaks, copy only, and the named emotional register.
### 2 · AI Slop Detection — ผม gen UI ด้วย AI แล้วมันดูเหมือนทุกคน
- กฎ: Before shipping UI, run the ai-slop audit: check the 15 tells (color, layout, visuals, type, motion), count them, and if more than 3, propose a fix for each.
### 3 · Gradient Text = สัญญาณว่า AI ทำ
- กฎ: No gradient text, no particle animation, no three-column card grid. Design it to look made by a person, not by AI.
### 4 · ทำไม AI เขียนไม่เหมือนเราสักที — AI Brandbook
- กฎ: Run the dinner test on every draft: if it reads like teaching or bragging, cut it. Drop any metaphor from a world I don't live in.
### 5 · ผมสอน AI ให้รู้ว่า "เสียงผม" เป็นยังไง
- กฎ: Read the voice file before drafting. When I correct the same thing twice, add it as a rule with one wrong and one right example.
### 6 · Creator Content-Ops — onboarding-order post
- กฎ: Before producing in batches, check the voice file exists and is built from my own past work. If it doesn't, stop and build it first.
### 7 · gen เว็บมาสิบรอบ หน้าตาออกมาทรงเดียวกันทุกรอบ ปัญหาไม่ได้อยู่ที่ prompt
- กฎ: Before any design task, read the reference notes: the concrete traits my three chosen references share. Follow them; where they say nothing, ask instead of picking the average.
### 8 · ป้อน reference ดีๆ ให้มันดู แล้ว reference ดีๆ มาจากไหน
- กฎ: Never type a raw hex in a component. Use the six roles in tokens.css: --bg, --ink, --accent, --surface, --line, --muted.
### 9 · สั่ง AI ทำปก แล้วมันส่งรูปคนนอนป่วยมาให้
- กฎ: Generate an image using gpt-image-2 image generation. Do NOT draw with code, SVG, HTML, or canvas. Call the image model directly.
### 10 · อยากทำ carousel ลง TikTok วันละหลายใบ แต่พอให้ AI gen ทั้งใบ มันพังทุกที ฟอนต์ไทยแตกเป็นวุ
- กฎ: Never generate text on a card. Generate only backgrounds and characters; the render script draws every card from the JSON with real fonts.
### 11 · ทำคลิปด้วย AI ให้ไม่ห่วย — 7 กฎที่ผมได้มาจาก 15 รอบ
- กฎ: Don't start until every LOCK section is filled: output, exact order, non-negotiables, do not, QA must check, go means. Never say final before every QA check passes.
### 12 · ลูกค้าขอ 30 เวอร์ชัน ไม่ต้องนั่งทำทีละอัน
- กฎ: Build one template and feed it a table, one row per version. A change goes in the template, never in a rendered file.
## จากเพจ · บั๊กที่ลูกค้าเจอ จบที่หลักการบนกระดาน — /series/engineering
### 1 · หยุด Overengineer ตอนลูกค้ายังเป็น 0
- กฎ: Happy flow first, error handling later. Ship the ugly version. R2 (UI, config, feature flag, prompt tweak): just do it. R0 (deploy contract, production DB migration): stop and ask.
### 2 · แก้ให้แล้วนะ แต่มันเปลี่ยนแค่ที่เดียว
- กฎ: Never retype a constant (color, price, shipping fee, url); keep it in one config file. Search for an existing function before writing a new one.
### 3 · ปุ่มมันกดไม่ได้จริง แต่ไม่มีใครบังคับให้ลูกค้าใช้ปุ่ม
- กฎ: Every client-side check is repeated on the server. Read price and permissions from the database and session, never the request. Test by hitting the API directly.
### 4 · รันในเครื่องเราผ่านหมด พอขึ้นจริงพังทันที
- กฎ: Values that change per machine (URL, port, key, secret, path) come from env, never hardcoded. Missing at startup: stop and name the variable. New variables go in .env.example.
### 5 · แอปไม่ได้ไม่มีบั๊ก มันแค่ยังไม่มีคนใช้
- กฎ: Submit flows are idempotent: the server keeps an idempotency key and returns the first result on a repeat, a unique constraint backs it, a test sends it twice.
### 6 · ยอดเงินไม่ได้คำนวณผิด มันแค่ปัดเศษในที่ที่เรามองไม่เห็น
- กฎ: Money is an integer of the smallest unit (satang), never float. Calculate in integers end to end; round once, at display, by one written rule. Test with fractional prices.
### 7 · ระบบไม่ได้เตือนผิดเวลา มันเตือนถูกเวลา แค่คนละที่กับที่คุณอยู่
- กฎ: Store time in UTC with a timezone-aware type. Inputs carry the user's timezone; never guess from the server. Convert in one display layer. Test under TZ=UTC and TZ=Asia/Bangkok.
### 8 · code ตอบว่า True แล้วข้อมูลหาย 26 อัน
- กฎ: Done means read back and found. Any helper that saves and returns True must re-read and assert the item exists. "No error" is not done.
### 9 · สั่งให้แก้ bug แต่มันไปแก้ test
- กฎ: When fixing a bug, do not edit tests without saying why. Prove done by running the real flow and showing its output, not by a green suite.
### 10 · แก้ไปแก้มาทั้งอาทิตย์ ยังตอบไม่ได้ว่าอันไหนทำพัง
- กฎ: Before saying done, run the tests and paste the actual output. Failing tests mean not done. One change per commit; never bundle.
### 11 · ผมทำงานข้าม 3 repos ด้วย Claude Code ยังไงไม่ให้พัง
- กฎ: Never change the API shape on your own; if it does not match the contract, ask first. Never assume backend behavior that is not in the contract.
### 12 · จ้าง agent 1,393 ตัวมารีแฟคเตอร์โค้ดล้านบรรทัดได้ แต่ถ้าไม่มีของอย่างนึงก่อน ก็แค่ได้ขยะเร็วขึ้น
- กฎ: Each time I correct how you work, write the correction to the skill file. Commit every verified step. Before a large change, list what must stay identical.
### 13 · สิ่งที่ไม่มีใน docs #01: Marketplace ก่อน Migration
- กฎ: Label throwaway code as throwaway, with the condition that retires it. When that condition lands, rebuild; do not keep patching v1.
## จากเพจ · kanly กติกาของ agent หลาย terminal — /series/kanly
### 1 · อีกอันที่ผมทำไว้แล้ว useful มากสำหรับคนใช้ Claude Code กับโปรเจกต์ที่แยกเป็นหลาย
- กฎ: ถ้า session A เปลี่ยนอะไรที่กระทบ session B → เขียน handoff file ไว้ให้ B อ่าน
### 2 · kanly HANDOFF — how two people's AI agents hand off work (team mode)
- กฎ: Write cross-repo changes as a handoff: the delta only, read before the next session. Before shipping, run handoff verify; resolve each DRIFT in the code or the handoff.
### 3 · review 3/3
- กฎ: คนเขียนคือคนที่ไม่ควรเป็นคนอนุมัติ
### 4 · ADE Convergence — ทั้งวงการ ship ท่อ แต่ไม่มีใคร ship กติกา
- กฎ: One session, one worktree, one branch. To reject a review flag, write a one-line reason; silence counts as a dodge.
ตรวจ CLAUDE.md ของคุณ · ฟรี
วางไฟล์ CLAUDE.md ของ repo คุณ โมเดลอ่านมันเทียบกับกฎ 40 ข้อข้างบน แล้วบอกว่าข้อไหนมีแล้ว ข้อไหนยังขาด และบรรทัดไหนที่ agent ทำตามไม่ได้ พร้อมประโยคที่เขียนใหม่ให้ ไม่เก็บข้อความที่วาง อย่าวางรหัสลับ ตรวจได้ 3 ไฟล์ต่อชั่วโมง
SOLID ในโค้ดจริง
ไฟล์หนึ่ง เรื่องเดียว
ดูกระดาน →กฎใน CLAUDE.mdDon't refactor or improve code beyond what was asked. Flag it instead.
ไฟล์ service เดียวโตเกิน 400 บรรทัด เพราะ agent เติม method ลงไฟล์ที่เปิดอยู่แล้วทุกครั้ง
Audit this repo for files that answer to more than one owner.
For every file over 150 lines under src/, list each distinct reason someone would ask to change it (pricing, email copy, report format, auth...) and the role that owns that reason.
Output a table: file | reasons | owners | line ranges per reason.
Then take one real request ("marketing changes the welcome email") and list every method that request would pull into the same diff.
For the three worst files, propose a split: new file names, what moves, which imports change.
Report only. Do not edit any file until I reply.- ตารางที่มีช่วงบรรทัดจริงของแต่ละเหตุผล ไม่ใช่แค่ชื่อไฟล์
- งานจริงหนึ่งงาน กับรายชื่อ method ที่จะติดมาใน diff เดียวกัน
- เจ้าของของแต่ละเหตุผล ถ้าคำตอบคือ "ทีม dev" แปลว่ายังแยกไม่ละเอียดพอ
- โฟลเดอร์ละเจ้าของ เช่น
report/,charge/,auth/ - บรรทัดใน
CLAUDE.md: "งานของreport/แตะแค่report/ถ้า diff แตะreport/กับcharge/พร้อมกัน ให้แยกเป็นสอง PR" eslintกฎmax-linesไฟล์ไหนเกิน 300 บรรทัด PR แดง
เพิ่มของใหม่ ไม่แก้ของเก่า
ดูกระดาน →กฎใน CLAUDE.mdA new channel is a new file that implements the existing interface. Don't add a branch to the shared one.
เพิ่ม channel ใหม่ทีไร agent เติม else if ในไฟล์เดิม แล้ว test ของ channel เก่าต้องรันใหม่หมด
Find every if/else-if chain or switch in src/ that branches on a kind, type, plan, channel, provider or status string.
For each: file:line, the value branched on, the number of branches, and how many commits touched it in the last 6 months (git log -L).
For the chain with the most commits, list the files each "add one more case" commit had to touch.
Grep for other files that branch on the same string or union type.
Then propose the slot: the interface, the registry, and the new-file template the next case would use.
Report only. Do not edit any file yet.- ประวัติ commit ของ chain ที่แก้บ่อยที่สุด พร้อมจำนวนไฟล์ต่อ commit
- รายชื่อไฟล์อื่นที่
switchบน string เดียวกัน chain ที่สองคือที่ที่ agent จะลืม - ไฟล์ test ที่ต้องรันใหม่ เมื่อเพิ่มเคสเดียว
interface Channelหนึ่งไฟล์ กับ registry หนึ่งไฟล์ ของใหม่คือไฟล์ใหม่ในchannels/CLAUDE.md: "channel ใหม่คือไฟล์ใหม่ในchannels/กับหนึ่งบรรทัดใน registry ห้ามแก้ตัว dispatch"CODEOWNERSบนไฟล์ dispatcher และไฟล์interfaceการแก้สองไฟล์นี้ต้องมีคนอนุมัติ
ชื่อเหมือน ต้องทำตัวเหมือน
ดูกระดาน →กฎใน CLAUDE.mdA new implementation passes the same contract test as the old one. Compiling is not done.
implementation ตัวใหม่คอมไพล์ผ่าน แต่ตอนล้มมัน throw ขณะที่ตัวเดิมคืน { ok: false }
List every interface or abstract class in src/ with two or more implementations, test fakes included.
For each implementation, compare BEHAVIOUR, not shape: throws where siblings return a result; returns null where siblings return []; retries internally where siblings don't; different units (satang vs baht, ms vs s); different error types.
Table: interface | method | implementation | behaviour | the caller that would break (file:line).
Then write one contract test in a new file that runs the same assertions against every implementation, run it, and paste the output.
Do not change any implementation. Report first.- ตาราง behaviour ที่ระบุ caller ที่จะพัง เป็นไฟล์กับบรรทัด
- ผลรัน contract test กับทุก implementation รวม fake ใน test ไม่ใช่แค่ "น่าจะผ่าน"
- คำตอบตรง ๆ ว่าแต่ละตัวล้มยังไง: throw คืนค่า หรือส่งซ้ำเอง
*.contract.test.tsหนึ่งไฟล์ต่อ interface รันกับทุก implementationCLAUDE.md: "คอมไพล์ผ่านยังไม่เสร็จ implementation ใหม่เสร็จเมื่อ contract test ของ interface นั้นเขียว"- สคริปต์ใน CI ที่หา
implements Notifierทุกตัว แล้ว fail ถ้าตัวไหนไม่อยู่ใน contract test
ใครใช้อะไร เห็นแค่นั้น
ดูกระดาน →กฎใน CLAUDE.mdRules for some files go in .claude/rules/ with paths:, not in this file.
ไฟล์รายงาน import OrdersRepo ทั้งก้อน 30 method แต่ใช้จริงสอง และ fake ใน test ต้อง stub ครบทุกตัว
For each class or interface in src/ with more than 8 public methods, list its importers.
For each importer, list the methods it actually calls (search first, then confirm by reading).
Table: fat type | importer | methods used / methods available.
Flag every importer that uses 3 or fewer. For those, propose a narrow port (name + methods) defined next to the importer.
List the test fakes that stub methods their subject never calls.
Report only. Do not edit any file.- อัตราส่วน ใช้จริงต่อที่มีให้ ของทุกไฟล์ที่ import
- รายชื่อ fake ที่ stub method ที่ไม่มีใครเรียก
- blast radius ของงานจริงหนึ่งงาน เช่น แก้
reverseแล้วมีกี่ไฟล์ต้องทดสอบซ้ำ
- port นิยามฝั่งคนใช้ เช่น
report/ReadTotals.tsที่มีแค่สอง method CLAUDE.md: "port ที่เกินห้า method คือสอง port"eslintกฎno-restricted-importsห้าม importOrdersRepoตัวเต็มนอกinfra/
กฎเป็นคนกำหนด ไม่ใช่ vendor
ดูกระดาน →กฎใน CLAUDE.mdFiles with business rules never import a vendor SDK directly.
กฎธุรกิจเรียก SDK ของ vendor ตรง ๆ พอเปลี่ยน vendor กฎ retry ก็ถูกเขียนใหม่ไปด้วย โดยไม่มีใครเห็น
Grep the folder that holds business rules (core/, domain/, or tell me where they are) for imports of vendors and frameworks: stripe, omise, prisma, pg, axios, nodemailer, aws-sdk, firebase, next, express.
For each hit: file:line, the vendor type that leaks in, and every other file that receives that type through a parameter or return value.
Answer yes or no: can the business rules be tested with the network off? Name the test that proves it.
For the vendor with the most leaks, draft the port (our words, our types), the adapter file name, and the one wiring line that selects it.
Report only. Do not edit any file.- โซ่การรั่ว: type ของ vendor ไปที่ signature ไหน แล้วไหลต่อไปไฟล์ไหน
- คำตอบ ใช่ หรือ ไม่ ว่ารัน test ของกฎได้ตอนปิดเน็ต พร้อมชื่อ test ที่พิสูจน์
- กฎที่อยู่บรรทัดเดียวกับการเรียก SDK เช่น retry หรือการจัดการบัตรถูกปฏิเสธ
eslintกฎno-restricted-importsห้ามcore/import SDK ของ vendor- interface ของเราอยู่ใน
core/ports/vendor แต่ละตัวเป็น adapter ในinfra/ CLAUDE.md: "เปลี่ยน vendor คือไฟล์ใหม่ในinfra/กับหนึ่งบรรทัดในmain.ts"
Clean Architecture ในโค้ดจริง
กฎส่วนลดอยู่ที่เดียว
ดูกระดาน →กฎใน CLAUDE.mdSearch for an existing rule before writing a new one. Business rules import nothing from UI or DB.
กฎส่วนลดเดียวกันมีสามที่ ใน useMemo ของหน้าเว็บ ใน handler ของบอท และใน API แต่ละที่เพี้ยนไม่เท่ากัน
Find every place in this repo that computes a business rule: discounts, caps, prices, eligibility, limits, fees.
For each: file:line, the layer it lives in (UI component, API route, bot handler, DB query, core), and the numbers or conditions it uses.
Group copies of the same rule and list where their numbers or conditions differ.
Then list every import from the core folder that points outward (UI, framework, ORM, bot SDK). If there is no core folder, say so.
Report only. Do not move or fix anything.- กลุ่มกฎที่ซ้ำกัน พร้อมจุดที่ตัวเลขหรือเงื่อนไขไม่ตรงกัน
- ชั้นของแต่ละที่ ถ้ากฎอยู่ใน component หรือ route นั่นคือปัญหา
- รายการ import จากชั้นในออกไปชั้นนอก ถ้าว่าง ขอดูคำสั่งที่ agent ใช้หา
- กฎอยู่ที่เดียวใน
core/เช่นcore/pricing.tsหน้าเว็บ บอท และ API เรียกที่นี่ dependency-cruiserหรือeslint-plugin-boundariesห้ามcore/import จากapp/,bot/,db/CLAUDE.md: "ก่อนเขียนกฎ ให้ค้นในcore/ก่อน ถ้ามีแล้ว เรียกของเดิม"
แปลงของนอกก่อนส่งเข้า
ดูกระดาน →กฎใน CLAUDE.mdUse cases take plain data. Convert requests, rows and timezones at the edge.
use case รับ NextRequest หรือ row ของ Prisma เข้ามาตรง ๆ พอเปลี่ยนชื่อคอลัมน์ ค่าก็กลายเป็น undefined แบบไม่มี error
List every function in the core or use-case layer with the types of its parameters and return values.
Flag each one whose types come from a framework or ORM: NextRequest, Request, Prisma model types, raw DB rows, LINE webhook events, Express req.
For each flag: file:line, the outer type, and the fields the function actually reads.
Then take one change ("rename column tier_code to tier") and list every file that would break, marking which ones break without a compile error.
Report only. Do not edit any file.- field ที่ use case อ่านจริงจาก type ของข้างนอก
- ไฟล์ที่จะพังเงียบ ๆ เมื่อเปลี่ยนชื่อคอลัมน์ ไม่ใช่แค่ไฟล์ที่คอมไพล์ไม่ผ่าน
- จุดที่แปลง request หรือ row เป็นข้อมูลธรรมดา ถ้าไม่มี agent ต้องบอกว่าไม่มี
- type ของ command อยู่ใน
core/เช่นtype BookSeat = { userId: string; tier: Tier }ชั้นนอกเป็นคนแปลง eslintห้ามไฟล์ในcore/importnext/*หรือ@prisma/client- mapper ข้างนอกมี test ที่ใช้ row จริงหนึ่งแถว เปลี่ยนชื่อคอลัมน์เมื่อไร test นี้แดง
เช็กกฎได้โดยไม่เปิดเบราว์เซอร์
ดูกระดาน →กฎใน CLAUDE.mdFetch data in code first. The model only reads the files. Missing data is n/a, never a guess.
กฎสำคัญทดสอบได้ทางเดียวคือ e2e ที่เปิด browser รอ 95 วินาที agent เลยข้ามไม่รัน
List the business rules in this repo and, for each, the fastest test that exercises it: file, kind (unit, integration, e2e), and measured run time.
Flag every rule whose only test needs a browser, a server, a real DB or the network.
For each flagged rule, show the lines of logic that live inside a component, route handler or bot handler, and what a pure function for that logic would take and return.
Run the unit test suite and paste the wall time.
Report only. Do not move any logic.- เวลารันจริงของ test ที่เร็วที่สุดของแต่ละกฎ ไม่ใช่การเดา
- รายชื่อกฎที่มี test แค่แบบ e2e
- บรรทัด logic ที่อยู่ใน component หรือ handler พร้อมไฟล์และบรรทัด
- กฎเป็น pure function ใน
core/ส่วน component กับ handler แค่ส่งค่าเข้าและแสดงผล CLAUDE.md: "แก้กฎเมื่อไร ต้องมี unit test ที่รันเสร็จในไม่กี่ ms ก่อนไปแตะ e2e"- CI รัน unit test ทุก PR และแยก e2e ไปอีก job
สร้างของทุกอย่างที่เดียว
ดูกระดาน →กฎใน CLAUDE.mdRead env and create clients only in main. Fail at startup and name the missing variable.
new PrismaClient() กับ process.env กระจายอยู่ยี่สิบกว่าไฟล์ ย้าย library ทีต้องไล่แก้ทุกที่
Find every place in src/ that constructs an infrastructure client or reads configuration: new PrismaClient, new Stripe, new Resend, createClient, axios.create, new Redis, process.env.
Table: file:line | what is constructed or read | which module uses it.
Put the totals per kind at the top.
Then take one change ("swap Prisma for Drizzle") and list every file the agent would have to open.
Report only. Do not edit any file.- ตัวเลขรวมต่อชนิด เช่น
new PrismaClient()กี่ที่process.envกี่ที่ - รายชื่อไฟล์ที่ต้องเปิดเมื่อเปลี่ยน library
- test ที่ต้อง mock ทั้ง module เพราะ client ถูกสร้างข้างใน ไม่ได้รับเข้ามา
main.tsที่เดียวสร้าง client อ่าน env แล้วส่งต่อให้คนใช้eslintกฎno-restricted-syntaxห้ามnew PrismaClientและprocess.envนอกmain.tsCLAUDE.md: "ห้ามสร้าง client หรืออ่าน env นอกmain.tsถ้าต้องใช้ ให้รับเข้ามาทาง parameter"
Design Patterns ในโค้ดจริง
แคมเปญละไฟล์ ตัวเลือกที่เดียว
ดูกระดาน →กฎใน CLAUDE.mdA new pricing rule is a new class behind PricingRule. Don't add a case to the switch.
วิธีคิดราคาของแต่ละโปรเป็น if ยาวในฟังก์ชันเดียว เพิ่มโปรใหม่ทีต้องแก้ฟังก์ชันที่ทุกโปรใช้
Find functions in src/ that pick between several ways of doing the same job based on a flag or string: price per promo, payment per method, rounding per currency, sorting per mode.
For each: file:line, the selector value, the number of variants, and the variables the variants share.
For the function with the most variants, list the files each new variant touched in git history.
Check whether the same selection happens in more than one place (web and bot, for example).
Propose the strategy interface (one method signature) and the single place that would choose.
Report only. Do not edit any file.- จำนวนแบบ กับประวัติ commit ว่าเพิ่มแบบใหม่แต่ละครั้งแตะกี่ไฟล์
- ตัวแปรที่ทุกแบบใช้ร่วมกัน นี่คือของที่ agent จะทำพังเวลาแก้แบบเดียว
- จุดที่เลือกแบบ ว่ามีที่เดียว หรือเลือกซ้ำทั้งในเว็บและในบอท
interface PricingStrategyหนึ่งไฟล์ แต่ละโปรเป็นไฟล์ของตัวเองในpricing/- เลือก strategy ที่เดียวใน
pricing/index.tsห้ามif (promo === ...)ที่อื่น - test ชุดเดียวที่รันกับทุก strategy เช่น ราคาไม่ติดลบ และไม่เกินราคาเต็ม
เหตุการณ์เดียว คนรอลงชื่อเอง
ดูกระดาน →กฎใน CLAUDE.mdEmit an event. Don't call email or analytics directly from the code that raised it.
จ่ายเงินเสร็จ checkout เรียกส่งอีเมล ส่ง LINE เปิดสิทธิ์เรียน และยิง analytics ต่อกันเอง ตัวไหนล้ม ตัวที่เหลือไม่ทำงาน
Find functions that, after one main action (payment, signup, enrollment), call several unrelated follow-ups in a row: email, LINE message, analytics, CRM, webhooks.
For each: file:line, the main action, the follow-ups in order, and what happens to the later ones if one throws.
Mark which follow-ups must succeed for the main action to count, and which are side effects.
Take one change ("add a Discord ping after payment") and list the files the agent would open.
Report only. Do not edit any file.- ลำดับ follow-up ของแต่ละจุด และสิ่งที่เกิดกับตัวถัดไปเมื่อตัวหนึ่ง throw
- การแยกให้ชัดว่าตัวไหนต้องสำเร็จ ตัวไหนเป็นแค่ผลข้างเคียง
- รายชื่อไฟล์ที่ต้องเปิด เพื่อเพิ่ม follow-up หนึ่งตัว
- event ชื่อชัด เช่น
PaymentSucceededผู้ฟังแต่ละตัวเป็นไฟล์ในlisteners/ CLAUDE.md: "follow-up ใหม่คือ listener ใหม่ ห้ามเติมบรรทัดในcheckout"- test ที่ให้ listener ตัวหนึ่ง throw แล้วเช็กว่าตัวอื่นยังทำงาน และ order ยังถูกบันทึก
คำของเรา ตัวแปลงต่อผู้ให้บริการ
ดูกระดาน →กฎใน CLAUDE.mdEach external API gets one adapter file. Nothing else imports its SDK.
shape ของ LINE webhook หรือ response ของ payment gateway ไหลไปทั่ว repo พอ vendor เปลี่ยน field ต้องแก้หลายสิบไฟล์
For each third-party API or SDK this repo calls (LINE, payment gateway, email, storage), list every file that touches its raw request or response shape: field names like replyToken, source.userId, charge.status, receipt_url.
Table: vendor | file:line | vendor field used.
Put the file count per vendor at the top.
Then take one change ("the gateway renames status to state") and list every file that would break.
Report only. Do not edit any file.- จำนวนไฟล์ต่อ vendor ที่รู้จัก field ดิบของมัน
- รายชื่อไฟล์ที่จะพัง เมื่อ vendor เปลี่ยนชื่อ field หนึ่งตัว
- จุดที่แปลง shape ของ vendor เป็นของเรา ถ้ามีหลายจุด แปลว่ายังไม่มี adapter
- หนึ่ง adapter ต่อ vendor เช่น
adapters/line.ts,adapters/omise.tsคืน type ของเรา eslintกฎno-restricted-importsห้าม import SDK ของ vendor นอกadapters/- test ของ adapter ใช้ payload จริงที่บันทึกไว้ vendor เปลี่ยน field เมื่อไร test แดงที่ไฟล์เดียว
ห่อของเดิม ไม่เปิดของเดิม
ดูกระดาน →กฎใน CLAUDE.mdAdd logging, caching or retry by wrapping the service, not by editing it.
retry, log, cache และการเช็กสิทธิ์ ถูกก๊อปวางในทุก handler แต่ละที่เขียนไม่เหมือนกัน
Find cross-cutting code repeated inside handlers or service methods: logging, timing, retry loops, caching, auth or permission checks, rate limits.
Table: concern | file:line | how this copy differs from the others (retry count, cache TTL, log fields, missing check).
Put the number of copies per concern at the top.
List handlers that are missing a concern their siblings have, especially auth checks.
Take one change ("retry 5 times instead of 3, everywhere") and list every file to open.
Report only. Do not edit any file.- จำนวนก๊อปต่อเรื่อง และจุดที่แต่ละก๊อปไม่เหมือนกัน
- handler ที่ขาดการเช็กที่ตัวอื่นมี โดยเฉพาะเรื่องสิทธิ์
- จำนวนไฟล์ที่ต้องเปิด ถ้าจะเปลี่ยนจำนวน retry ทั้งระบบ
- wrapper หนึ่งตัวต่อเรื่อง เช่น
withRetry(fn),withAuth(fn)ห่อ handler ตอนลงทะเบียน - ห่อที่จุดเดียว เช่น
routes.tsจะเห็นทุก handler กับ wrapper ของมันในหน้าเดียว CLAUDE.md: "ห้ามเขียน retry หรือเช็กสิทธิ์ใน handler ใช้ wrapper ที่มีอยู่"
เลือกแบบเอกสารที่เดียว
ดูกระดาน →กฎใน CLAUDE.mdCreate courses through CourseFactory. Feature code never calls new VideoCourse().
โค้ดที่เลือกว่าจะ new ตัวไหน (Omise หรือ PromptPay, เว็บหรือ LINE) ซ้ำอยู่หลายไฟล์ และแต่ละที่ส่ง config ไม่ครบเท่ากัน
Find every place that decides which concrete class or client to construct based on a value: channel, payment method, environment, plan.
Table: file:line | the deciding value | the classes constructed | the config passed to each.
Group places that make the same decision and list where they disagree (missing case, different config).
Take one change ("add PromptPay") and list every place that would need a new branch.
Report only. Do not edit any file.- กลุ่มจุดที่ตัดสินใจเรื่องเดียวกัน และเคสที่แต่ละจุดขาด
- config ที่ส่งไม่เท่ากัน เช่น ที่หนึ่งใส่ timeout อีกที่ไม่ใส่
- รายชื่อจุดที่ต้องเพิ่ม branch เมื่อเพิ่มตัวใหม่หนึ่งตัว
- factory ที่เดียว เช่น
payments/create.tsคืนPaymentGatewayตามค่าที่ส่งเข้ามา eslintกฎno-restricted-syntaxห้ามnew OmiseGatewayนอก factory- test ของ factory ที่วนทุกค่าใน union type แล้วเช็กว่าได้ตัวที่ถูก ค่าใหม่ที่ลืมใส่จะแดง
ทางเข้าเดียวของการซื้อ
ดูกระดาน →กฎใน CLAUDE.mdFeature code calls checkout() on the facade. Don't wire payment, enrollment and email yourself.
หน้าเว็บกับ LINE bot ต่างเรียกตัดเงิน เปิดสิทธิ์เรียน ออกใบกำกับ และส่งอีเมลเอง ลำดับไม่ตรงกัน
Find callers (pages, API routes, bot handlers, jobs) that call 3 or more internal modules in a row to complete one user action, such as buying a course.
For each: file:line, the action, the modules called in order.
Put the sequences for the same action side by side (web, bot, jobs) and list every step that is missing or in a different order.
Take one change ("issue the tax invoice before the email") and list every caller the agent would edit.
Report only. Do not edit any file.- ลำดับการเรียกของแต่ละช่องทาง วางเทียบกัน
- ขั้นที่หาย หรือสลับลำดับ ในช่องทางใดช่องทางหนึ่ง
- จำนวนไฟล์ที่ต้องแก้ เมื่อเปลี่ยนลำดับหนึ่งครั้ง
- facade หนึ่งตัวต่อการกระทำ เช่น
enrollment/purchaseCourse.tsเว็บกับบอทเรียกตัวนี้ eslintห้ามไฟล์ในapp/และbot/import โมดูลย่อยที่ facade ห่ออยู่- test ของ facade เช็กลำดับขั้นที่เดียว ทุกช่องทางได้ผลเหมือนกัน
ปุ่มหลังบ้านเป็นคำสั่ง
ดูกระดาน →กฎใน CLAUDE.mdEvery write command carries an id. An id the server has seen returns the old result.
การคืนเงินหรือขยายเวลาเรียน ทำได้หลายทาง (หน้า admin, บอท, script) แต่ละทางเขียนเอง และไม่มีบันทึกว่าใครทำ
List every action that changes money or access: refund, grant course, extend access, cancel order, change price.
For each action, list every entry point that performs it (admin page, bot command, API route, script, cron) with file:line.
For each entry point: does it validate input, write an audit record, and stay safe if run twice?
Table: action | entry point | validation | audit | safe to repeat.
Take one change ("refunds now need a reason") and list every entry point to edit.
Report only. Do not edit any file.- ทุกทางเข้าของการกระทำเดียวกัน รวม script ที่คนรันมือ
- ทางไหนไม่ตรวจ input ทางไหนไม่บันทึก ทางไหนกดซ้ำแล้วคืนเงินสองครั้ง
- จำนวนไฟล์ที่ต้องแก้ เมื่อเพิ่มกฎหนึ่งข้อ
- หนึ่ง command ต่อการกระทำ เช่น
commands/refund.tsรับorderId,reason,actorทุกทางเข้าส่งมาที่ handler เดียว - handler บันทึกทุก command ลงตาราง และมี key กันกดซ้ำ
CLAUDE.md: "การกระทำที่แตะเงินหรือสิทธิ์ ต้องผ่านcommands/ห้ามเขียนตรงใน route หรือ script"
ล็อกลำดับขั้นไว้ที่เดียว
ดูกระดาน →กฎใน CLAUDE.mdKeep the enrollment steps in the base flow. A new course type overrides only the step that differs.
flow ที่โครงเหมือนกัน เช่น รายงานรายเดือนสามแบบ ถูกก๊อปทั้งก้อน แก้บั๊กในก๊อปหนึ่ง อีกสองก๊อปยังพัง
Find groups of functions or files in src/ that run the same sequence of steps with small differences: report exports, import jobs, onboarding flows, checkout variants.
For each group: the files, the shared steps in order, and the lines where each copy differs.
Use git log to find bug fixes applied to one copy but not the others; list them with commit hashes.
Propose the skeleton: the fixed steps, and the few hooks each variant fills in.
Report only. Do not edit any file.- ขั้นที่เหมือนกัน กับบรรทัดที่ต่าง แยกให้เห็นชัด
- commit ที่แก้บั๊กแค่ในก๊อปเดียว พร้อม hash
- จำนวน hook ที่แต่ละแบบต้องเติมจริง ถ้าเกินสี่ตัว อาจไม่ใช่ flow เดียวกัน
- ฟังก์ชันโครงหนึ่งตัว เช่น
runExport(steps)แต่ละรายงานส่งมาแค่ส่วนที่ต่าง - test ของโครงหนึ่งชุด กับ test ของแต่ละแบบเฉพาะ hook ของมัน
CLAUDE.md: "รายงานใหม่ใช้runExportห้ามก๊อปไฟล์รายงานเดิมมาแก้"
Engineering practice ในงานจริง
ทำบน branch ส่งเป็น PR
ดูกระดาน →กฎใน CLAUDE.mdWork on a feature branch. Never commit or push to main.
agent commit ลง main ตรง ๆ พอพัง ไม่มี diff เดียวให้ revert
Audit how changes reach main in this repo.
From git log of the last 60 days on main, count commits that came through a merged PR and commits pushed directly. List the direct ones with hash, author and files changed.
Read the branch protection or rulesets for main (gh api) and say whether a PR and passing CI are required.
Check CLAUDE.md and AGENTS.md for any rule about branches.
Report only. Do not change settings or create branches.- ตัวเลขสองตัว: commit ที่ผ่าน PR กับ commit ที่ขึ้น
mainตรง ๆ - ผลจาก
gh apiว่าmainมี branch protection จริง ไม่ใช่แค่ agent บอกว่ามี - commit ตรงที่แตะไฟล์เยอะที่สุด
- branch protection บน
main: ต้องผ่าน PR และ CI ก่อน merge CLAUDE.md: "ทำงานบน branchfeat/*เสมอ ห้าม commit ลงmain"- hook
pre-commitที่ปฏิเสธเมื่อ branch ปัจจุบันคือmain
PR เล็ก รีวิวได้จริง
ดูกระดาน →กฎใน CLAUDE.mdBefore adding a table, service or module, state the smallest fix and why it is not enough.
PR เดียวของ agent มี 60 ไฟล์ feature, refactor และ format ปนกัน คนรีวิวกดผ่านเพราะอ่านไม่ไหว
List the last 30 merged PRs (gh pr list --state merged) with files changed, lines added and deleted, and time from open to merge.
Sort by lines changed. For the 5 largest, split the diff into concerns (feature, refactor, formatting, generated files, dependency bumps) with line counts per concern.
For each of those 5, say how it could have been split into smaller PRs that each pass CI on their own.
List PRs that were reverted or needed a follow-up fix within two days.
Report only. Do not edit anything.- ตาราง PR พร้อมจำนวนไฟล์และบรรทัด ไม่ใช่ค่าเฉลี่ย
- diff ของ PR ใหญ่ แยกเป็นเรื่อง พร้อมจำนวนบรรทัดต่อเรื่อง
- PR ใหญ่ที่ถูก revert หรือมี fix ตามมาภายในสองวัน
- CI เตือนเมื่อ diff เกิน 400 บรรทัด ไม่นับไฟล์ generated
CLAUDE.md: "หนึ่ง PR หนึ่งเรื่อง refactor กับ format แยก PR ไปก่อน feature"- template PR ที่มีหัวข้อ "PR นี้ไม่ได้แก้อะไร"
CI คือด่านที่ AI เถียงไม่ได้
ดูกระดาน →กฎใน CLAUDE.mdPaste the real test output before saying done. If a bug fix changes a test file, say why first.
กฎที่ตกลงกันไว้อยู่ใน CLAUDE.md อย่างเดียว ไม่มี check ไหนรัน agent เลยฝ่าได้เงียบ ๆ
Read the CI config (.github/workflows or equivalent) and list every check that runs on a pull request, which ones are required, and the average run time over the last 20 runs.
Then read CLAUDE.md, AGENTS.md and docs/ for rules the code must follow (import boundaries, no DB in UI, contract tests, file size).
Table: rule | where it is written | the CI check that enforces it, or "none".
List checks that failed and were re-run until green in the last 20 runs.
Report only. Do not change CI.- ตารางที่จับคู่กฎกับ check ที่บังคับจริง ช่องที่เขียน "none" คือของที่ต้องทำ
- check ที่ตั้งเป็น required จริงในการตั้งค่า branch ไม่ใช่แค่มีใน workflow
- check ที่ล้มแล้วถูกรันซ้ำจนผ่าน
- กฎใน
CLAUDE.mdที่เครื่องตรวจได้ ต้องมี check ใน CI เช่นdependency-cruiser,eslint, contract test - ตั้ง check เหล่านั้นเป็น required ใน branch protection
- ถ้า CI เกิน 10 นาที แยก job เร็วกับ job ช้า ให้ job เร็วบอกผลก่อน
commit message คือ context
ดูกระดาน →กฎใน CLAUDE.mdOne change per commit. Use feat:, fix: and BREAKING CHANGE: so the version reads from the log.
commit message ของ agent เขียนว่า "update files" หรือ "fix bug" agent รอบถัดไปอ่าน git log แล้วไม่รู้ว่าทำไม
Read the last 50 commit messages on main, bodies included.
Classify each: says what and why / says what only / says nothing useful ("update", "fix", "wip"). Give the three counts at the top.
Pick the 5 files changed most often in that range. For each, say whether git log alone explains why the file looks the way it does.
Find commits that reverted or redid an earlier commit, and say whether the original message would have warned against it.
Report only. Do not rewrite history.- ตัวเลขสามกลุ่ม: บอกทั้งอะไรและทำไม บอกแค่อะไร ไม่บอกอะไรเลย
- ตัวอย่าง message จริงของแต่ละกลุ่ม พร้อม hash
- คู่ commit ที่ทำไปแล้วถูกทำซ้ำหรือถูก revert
- รูปแบบ commit ใน
CLAUDE.md: บรรทัดแรกบอกอะไร body บอกทำไม และอะไรที่ตั้งใจไม่แตะ commitlintใน hookcommit-msgหรือใน CI- PR description มีหัวข้อ ทำไม ไม่ได้แก้อะไร และย้อนกลับยังไง
ถอยได้ในคำสั่งเดียว
ดูกระดาน →กฎใน CLAUDE.mdR0 (deploy, migration, push to main) stop and ask. R2 (easy to revert) just do it.
deploy แล้วพัง ไม่มีใครรู้ว่าย้อนกลับยังไง เลยสั่ง agent ให้แก้ไปข้างหน้าทั้งที่ระบบล่มอยู่
Explain, with exact commands, how to roll back the last production deploy of this repo. Read the deploy config, scripts and CI; do not guess.
List each step, the command, who or what runs it, and how long it takes.
List what does NOT roll back with the code: DB migrations, queued jobs, env vars, third-party webhooks, feature flags.
For each of the last 5 migrations, say whether it has a down step and whether the previous release can run on the new schema.
Report only. Do not run any deploy or rollback command.- คำสั่งจริงที่อ่านมาจาก config หรือ script พร้อมไฟล์ที่มา
- รายการของที่ไม่ย้อนตามโค้ด โดยเฉพาะ migration
- คำตอบของแต่ละ migration ว่าโค้ดรุ่นก่อนรันกับ schema ใหม่ได้ไหม
- คำสั่งเดียวที่ย้อนได้ เช่น
git revertแล้วให้ CI deploy เอง เขียนไว้ในREADMEและCLAUDE.md - migration แบบเพิ่มก่อน ลบทีหลัง โค้ดรุ่นก่อนต้องรันกับ schema ใหม่ได้
- ซ้อมย้อนกลับบน staging เป็นรอบ ๆ แล้วจดเวลาที่ใช้
DDD ในงานจริง
แต่ละส่วนมีข้อมูลของตัวเอง
ดูกระดาน →กฎใน CLAUDE.mdThis terminal owns billing/ only. Changes that touch learning/ go through a handoff.
Course ตัวเดียวถูกใช้ทั้งหน้าขาย ห้องเรียน และบัญชี มี field ห้าสิบตัว ฝั่งขายแก้ทีห้องเรียนพัง
Find the central entity types used by more than one area of this repo (sales, learning, billing, support, bot): e.g. Course, User, Order.
For each: file:line, its fields, and for every importer, which area it belongs to and which fields it reads.
Table: type | area | fields used.
Flag fields used by only one area, and fields whose meaning differs between areas (e.g. "price" before or after discount).
Take one change ("sales adds a launch price") and list every file in other areas that would need retesting.
Report only. Do not edit any file.- ตารางว่าแต่ละส่วนใช้ field ไหนจริง
- field ที่ความหมายไม่เหมือนกันในแต่ละส่วน
- ไฟล์ในส่วนอื่นที่ต้องทดสอบซ้ำ เมื่อส่วนหนึ่งขอเพิ่ม field
- โฟลเดอร์ต่อ context เช่น
sales/,learning/,billing/แต่ละอันมีCourseของตัวเอง ที่มีแค่ field ที่ใช้ dependency-cruiserห้าม import ข้าม context ยกเว้นผ่านpublic.tsของ context นั้นCLAUDE.mdบอกว่า context ไหนเป็นเจ้าของ table ไหน
หนึ่งเรื่อง หนึ่งคำ ทุกไฟล์
ดูกระดาน →กฎใน CLAUDE.mdUse the terms in GLOSSARY.md. If a word could mean Customer or User, ask which.
เรื่องเดียวกันมีสามชื่อ (student, learner, member) ใน code, DB และ UI agent เลยตั้งชื่อที่สี่
Build a glossary from this repo: collect the domain nouns and verbs in type names, table and column names, API routes, UI strings and bot messages.
Group words that seem to mean the same thing (student/learner/member, cohort/batch/round, enroll/register/join), with a count and a file list for each spelling.
Flag words that mean different things in different places.
List words used in the DB but never in the UI, and the reverse.
Report only. Do not rename anything.- กลุ่มคำที่ความหมายเดียวกัน พร้อมจำนวนและไฟล์ของแต่ละแบบ
- คำเดียวที่ความหมายต่างกันในแต่ละที่
- คำที่มีใน DB แต่ไม่มีใน UI หรือกลับกัน
GLOSSARY.mdหนึ่งไฟล์: คำที่ใช้ ความหมาย คำที่ห้ามใช้ และCLAUDE.mdชี้มาที่ไฟล์นี้- check ใน CI ที่ grep หาคำต้องห้ามในชื่อ type และชื่อคอลัมน์
- เปลี่ยนชื่อทีละคำ หนึ่ง PR ต่อหนึ่งคำ
กฎที่นั่งอยู่ในทางเข้าเดียว
ดูกระดาน →กฎใน CLAUDE.mdChange an order only through Order methods. Totals are computed inside, never taken from the caller.
สองคนกดซื้อที่นั่งสุดท้ายของรุ่นพร้อมกัน ระบบขายเกิน เพราะเช็กที่ว่างกับบันทึกการซื้ออยู่คนละที่
Find every place that changes a cohort's seats or enrollments: purchase, cancel, admin add, bot enroll, refund.
For each: file:line, how it checks capacity, and whether the check and the write happen in one transaction with a lock or a version check.
Describe the exact sequence in which two buyers both get the last seat, using the real function names.
List any code that writes to the seats or enrollments table without going through one shared function.
Report only. Do not edit any file.- ทุกทางที่เปลี่ยนจำนวนที่นั่ง พร้อมคำตอบว่าเช็กกับเขียนอยู่ใน transaction เดียวกันไหม
- ลำดับเหตุการณ์ที่ขายเกิน ด้วยชื่อฟังก์ชันจริง
- test ที่ยิงสองคำขอพร้อมกัน ถ้าไม่มี agent ต้องบอกว่าไม่มี
- ทุกการเปลี่ยนที่นั่งผ่าน
Cohort.enroll()ที่เดียว เช็กและเขียนใน transaction เดียว มีversionหรือ row lock - constraint ใน DB เช่น
CHECK (enrolled <= capacity)เป็นด่านสุดท้าย - test ที่ยิงสองคำขอเข้าที่นั่งสุดท้ายพร้อมกัน ต้องขายได้หนึ่ง ปฏิเสธหนึ่ง
แปลงระบบนอกที่ชายแดน
ดูกระดาน →กฎใน CLAUDE.mdMap external responses to our types in one translator. Missing fields become explicit nulls.
สถานะของ payment gateway อย่าง "successful" ถูกใช้ตัดสินใจในกฎของเราตรง ๆ และ payload ของ vendor ถูกเก็บลง DB ทั้งก้อน
Find where an outside system's model has entered our domain: vendor IDs used as our keys, vendor status values ("successful", "pending_capture") in business logic, raw vendor JSON stored and read back later, vendor field names in our types.
Vendors to check: payment gateway, LINE, email provider, any LMS or CRM.
Table: vendor concept | file:line | which of our modules depends on it.
Take one change ("move from Omise to Stripe") and list every file outside the integration code that would change.
Report only. Do not edit any file.- ทุกที่ที่ค่าสถานะของ vendor ใช้ตัดสินใจในกฎของเรา
- คอลัมน์ JSON ดิบ ที่โค้ดส่วนอื่นอ่านกลับไปใช้
- ไฟล์นอกโค้ดเชื่อมต่อ ที่ต้องแก้ถ้าเปลี่ยน vendor
- ชั้นแปล
acl/omise.tsแปลงสถานะของ vendor เป็น enum ของเรา เช่นPaymentStatus.Paidก่อนเข้า domain - เก็บ id ของ vendor เป็น field แยก ไม่ใช้เป็น key หลักของเรา
eslintหรือ grep ใน CI ห้าม string สถานะของ vendor นอกacl/
แผนภาพที่ CI เช็กได้
แผนภาพโครงสร้างเป็นกฎที่ CI รัน
ดูกระดาน →กฎใน CLAUDE.mddomain/ never imports from app/ or infra/. CI checks the imports.
diagram ในเอกสารบอกว่า domain ไม่รู้จัก db แต่โค้ดจริง import กันไปมา และไม่มีอะไรเช็ก
Generate the real import graph of src/ at folder level (dependency-cruiser, madge, or by reading imports). Show the command you used.
Compare it to every architecture diagram or layering rule in docs/, README, CLAUDE.md. If there is none, say so.
List every edge the diagram forbids or does not show, with file:line of the import.
List every import cycle.
Report only. Do not edit any file.- graph จริงจากเครื่องมือ พร้อมคำสั่งที่ใช้สร้าง
- import ที่ diagram ไม่อนุญาต พร้อมไฟล์และบรรทัด
- วงจร import ทุกวง
- เขียนกฎของ class diagram เป็น config ของ
dependency-cruiserเช่นdomainห้าม importdb - รันใน CI ทุก PR และ fail เมื่อมีเส้นที่ไม่อนุญาต
- สร้างภาพ diagram จาก config เดียวกัน ภาพกับกฎจะไม่เพี้ยนจากกัน
ลำดับตอนจ่ายเงินเป็น test
ดูกระดาน →กฎใน CLAUDE.mdWrite the main flow as numbered steps, then one test that runs those steps through the public API.
ลำดับ ตัดเงิน แล้วเปิดสิทธิ์ แล้วส่งใบเสร็จ อยู่แค่ในหัวคน agent สลับลำดับแล้ว test ยังเขียว
Trace the flow for buying a course, from request to receipt, through the code: every call between modules, in order, with file:line.
Write it as a text sequence (A -> B: call).
For each step, say what happens if it fails: retried, rolled back, or left half-done.
List the tests that would fail if two steps swapped order. If none would, say so.
Report only. Do not edit any file.- sequence ที่ไล่จากโค้ดจริง พร้อมไฟล์และบรรทัดของแต่ละลูกศร
- สิ่งที่เกิดเมื่อแต่ละขั้นล้ม
- test ที่จะแดงถ้าสลับลำดับ ถ้าไม่มี นั่นคือช่องที่ต้องปิด
- contract test ที่ใช้ fake จดการเรียก แล้วเช็กลำดับ เช่น
["charge", "enroll", "sendReceipt"] - sequence diagram ใน
docs/อ้างชื่อ test ตัวนี้ เปลี่ยนลำดับเมื่อไร ต้องแก้ทั้งสองที่ CLAUDE.md: "ห้ามเปลี่ยนลำดับใน flow ซื้อคอร์ส โดยไม่แก้ contract test ใน PR เดียวกัน"
สถานะออเดอร์เป็นตารางเดียว
ดูกระดาน →กฎใน CLAUDE.mdStatus changes go through the transition table. An unknown status throws. It never falls back to a default.
สถานะ order เปลี่ยนด้วย order.status = "paid" กระจายหลายไฟล์ เลยมี order ที่ refunded แล้วกลับมา paid ได้
Find every status-like field in the domain (order, payment, enrollment, cohort) and every place that assigns it.
Table: entity | from-status (if checked) | to-status | file:line.
Build the transition table the code actually allows, and mark assignments that check no from-status (any status to any status).
Read the DB schema and enums for the allowed values, and list values that exist in one place but not the other.
Report only. Do not edit any file.- ตาราง transition ที่โค้ดยอมจริง รวมเส้นที่ไม่มีใครเช็ก
- ทุกบรรทัดที่ตั้งค่าสถานะตรง ๆ
- ค่าสถานะที่มีใน DB แต่ไม่มีในโค้ด หรือกลับกัน
- ตาราง transition หนึ่งไฟล์ เช่น
order/transitions.tsกับtransition(order, to)ที่ throw เมื่อเส้นไม่อยู่ในตาราง - grep ใน CI ห้าม
.status =นอกไฟล์นั้น - test ที่วนทุกคู่สถานะ เส้นที่ไม่อยู่ในตารางต้อง throw
Agent setup ในงานจริง
กฎอยู่ผิดที่
ดูกระดาน →กฎใน CLAUDE.mdHard limits live in hooks, folder rules in .claude/rules/ with paths. Before adding a rule, name the rule it overlaps.
CLAUDE.md ยาวเป็นร้อยบรรทัด ข้อห้ามเด็ดขาดเป็นแค่ข้อความ และ agent ยังทำข้อที่ห้ามไว้
Read CLAUDE.md (and AGENTS.md if present), .claude/settings.json and every file under .claude/rules/.
For every rule, decide where it belongs by the cost of one miss: a hook (a secret leaks or production breaks), a path-scoped rule (it applies to some folders only), or CLAUDE.md (every task needs it).
Table: rule | file:line | where it lives now | where it belongs | why.
Then find pairs of rules that point different ways in the same situation. Quote both lines with their line numbers and give one real request that makes them collide. Drop any pair you cannot quote.
List rules that say a tool cannot do something, and whether that was ever tested.
Report only. Do not edit any file.- ตารางที่มีเลขบรรทัดจริงของทุกข้อ กับที่ที่มันควรอยู่
- คู่กฎที่ขัดกัน พร้อมข้อความจริงทั้งสองฝั่ง และคำสั่งจริงที่ทำให้มันชนกัน
- ข้อห้ามที่ยังเป็นข้อความ ทั้งที่พลาดครั้งเดียวคือรหัสลับหลุดหรือ production พัง
- hook
PreToolUseที่ตอบ deny สำหรับไฟล์รหัสลับ force push และการลบทั้งโฟลเดอร์ - กฎเฉพาะโฟลเดอร์ย้ายไป
.claude/rules/พร้อมpaths:ให้โหลดเมื่อแตะไฟล์ที่ตรงกันเท่านั้น - ก่อนเพิ่มกฎใหม่ ตอบให้ได้ว่ามันทับข้อไหน และถ้าลบข้อนี้ agent จะทำอะไรผิดขึ้นมา
AI ลืมทุก session
ดูกระดาน →กฎใน CLAUDE.mdOn a pattern failure, log it to MEMORY.md: what happened, root cause, correct behavior. Read spec.md first; update it before saying done.
ทุก session ต้องเล่าเรื่องเดิมใหม่ และ agent พลาดท่าเดิมซ้ำ เพราะบทเรียนอยู่ในแชทที่ปิดไปแล้ว
Read CLAUDE.md and every file it imports with @. List exactly what an agent session in this repo loads at start.
Then read the session transcripts or chat exports you can find (if none, the git log of the last 30 days) and list facts I had to repeat: tooling, paths not to touch, decisions, where the work stands.
Table: fact | how many times it was repeated | the file it should live in (MEMORY.md, spec.md, decisions.md, CLAUDE.md) | whether that file exists and is loaded.
Check every MEMORY.md entry for the three fields (what happened, root cause, correct behavior) and every decisions.md line for a date and a reason.
Report only. Do not create or edit any file.- รายชื่อไฟล์ที่ถูกโหลดตอนเปิด session จริง ไม่ใช่แค่ไฟล์ที่มีอยู่ในโฟลเดอร์
- เรื่องที่ต้องเล่าซ้ำ พร้อมจำนวนครั้ง
- entry ใน
MEMORY.mdที่ขาดต้นเหตุ หรือขาดสิ่งที่ต้องทำครั้งหน้า
@MEMORY.mdในCLAUDE.mdกับกฎ: พลาดเมื่อไร จดสามช่อง เกิดอะไร ต้นเหตุ ครั้งหน้าทำยังไงspec.mdที่อ่านตอนเริ่มและอัปเดตหลังทุกงาน ห้ามบอกว่าเสร็จถ้ายังไม่อัปเดตdecisions.mdบรรทัดละการตัดสินใจ มีวันที่กับเหตุผล และมีวันรีวิว
skill ที่โมเดลมองไม่เห็น
ดูกระดาน →กฎใน CLAUDE.mdA new skill names the failure it prevents. Keep descriptions under two lines; cut skills that were never invoked.
skill สะสมเป็นร้อยตัว คำอธิบายรวมเกินงบที่โมเดลเห็น skill ใหม่ไม่เคยถูกหยิบมาใช้
Read every skill (user and project directories), the settings file, the hooks and the global instruction file.
Count the skills and the total characters of their descriptions, and say how much of that the model is actually shown in its skill listing.
Find skills never invoked, duplicated or shadowed copies of the same skill, prompt scaffolding written to push an older model (ultrathink, MANDATORY, REPEATEDLY, you MUST, invented user quotes), and anything that hardcodes a model name or a parameter the current model no longer accepts.
For every finding, argue both sides before you report it: prove it against the actual file, then make the strongest case for leaving it as it is. Report only the findings that survive, and tell me how many you discarded.
Change nothing. Report only.- จำนวน skill กับความยาวคำอธิบายรวม เทียบกับงบที่โมเดลเห็น
- skill ที่ไม่เคยถูกเรียก พร้อมที่มาของตัวเลขว่านับจากอะไร
- จำนวนข้อที่ถูกเถียงตกไป ถ้าไม่มีตัวเลขนี้ แปลว่ามันไม่ได้เถียงตัวเอง
- หนึ่ง skill หนึ่งโหมด คำอธิบายบอกว่าใช้เมื่อไร ไม่เกินสองบรรทัด
- ก่อนเพิ่ม skill ตอบให้ได้ว่ามันกัน failure อะไรที่เคยเกิดจริง
- ทุกครั้งที่เปลี่ยนรุ่นโมเดล
grepหา ultrathink, MANDATORY, you MUST และชื่อรุ่นเก่า
cron ที่เขียนแล้วไม่มีใครอ่าน
ดูกระดาน →กฎใน CLAUDE.mdEvery pipeline with a read and a write side: verify both, not just the side that produces output.
cron เขียนไฟล์ทุกวัน แต่ไม่มี session หรือ cron ตัวไหนอ่าน ไฟล์ค้างก็ไม่มีใครรู้
List every scheduled job for this repo or this machine (crontab -l, CI schedules, launchd or systemd timers) and every file each one writes.
For each written file, find who reads it: a line in CLAUDE.md, a skill, another job, a script. Quote that line.
Table: job | schedule | file written | reader (or "none") | last modified | does the reader check the file's date.
List jobs that fetch the same sources another job already writes to a file.
Report only. Do not edit the crontab or any file.- ไฟล์ที่ cron เขียน คู่กับบรรทัดจริงที่อ่านมัน ช่องที่เป็น none คือของที่ต้องทำ
- เวลาแก้ล่าสุดของแต่ละไฟล์ เทียบกับรอบของ cron ที่เขียน
- cron ที่ดึงต้นทางซ้ำกับที่อีกตัวเขียนเป็นไฟล์ไว้แล้ว
- ทุก cron ที่เขียนไฟล์ มีบรรทัดใน
CLAUDE.mdหรือ skill ที่อ่านมัน - ฝั่งอ่านเช็กวันที่ในไฟล์ก่อนใช้ เก่ากว่ารอบให้บอกว่าค้าง
- เพิ่ม cron ใหม่ ต่อสายฝั่งอ่านในงานเดียวกัน แล้วเปิด session ใหม่ดูว่าอ่านเจอจริง
ชิมก่อนรับ
หน้าเว็บที่ออกมาโหล
ดูกระดาน →กฎใน CLAUDE.mdBefore generating UI, read the reference notes. No gradient text, no particle hero, no three-column card grid. Run the slop audit before shipping.
หน้าที่ AI gen มาดูโปร แต่หน้าตาเหมือนทุกเว็บ หัวข้อ gradient การ์ดสามคอลัมน์ ทุกอย่างอยู่กลาง และไม่มีไฟล์ไหนบอกว่าหน้านี้ควรเป็นแบบไหน
Audit the UI of this repo for the default AI design, before anything ships.
Read the pages, the global styles and the design tokens. Find every instance of: gradient on text or numbers, a particle or animated hero background, identical card grids with an icon on top, everything centred, pure #000 or #fff backgrounds, glassmorphism, one font for the whole page, a CTA that does not say what happens on click.
Table: tell | file:line | what it looks like | what the reference notes say instead (or "no reference notes").
Then look for the reference notes: a file that names what three chosen references share in concrete terms (alignment, background colour, heading scale, one accent). Quote it, or say it does not exist.
Score the page: how many tells from the list it has. Three or more means it is drifting to the default.
Report only. Do not edit any file.- ของโหลแต่ละชิ้นพร้อมไฟล์กับบรรทัดจริง ไม่ใช่แค่บอกว่าดู generic
- โน้ตอ้างอิงที่ยกมาทั้งข้อความ หรือคำตอบว่าไม่มี
- คะแนนของโหล ถ้าเกินสามข้อ หน้านี้ไหลไปทาง default แล้ว
- ไฟล์โน้ตอ้างอิงใน repo ที่ agent อ่านก่อน gen ทุกหน้า สามข้อที่จับต้องได้ เช่น ชิดซ้าย พื้นครีม สีเด่นสีเดียว
- บรรทัดใน
CLAUDE.mdที่ห้ามของโหลด้วยชื่อ: ห้าม gradient text ห้าม particle ห้าม card grid 3 คอลัมน์ - ก่อนปล่อย UI ให้ agent ไล่ของโหลทั้งรายการ นับคะแนน เกินสามข้อเสนอวิธีแก้ทีละข้อ
draft ที่ไม่ใช่เสียงเรา
ดูกระดาน →กฎใน CLAUDE.mdBefore a draft ships, run the five taste filters: brag, voice, concrete, position, bloat. If it fails, rewrite it from a new angle; don't patch words.
draft ที่ AI เขียนไม่ใช่เสียงคุณ เปิดด้วยในยุคที่ AI เปลี่ยนทุกอย่าง มีประโยคโม้ เปรียบเทียบกับโลกที่คุณไม่ได้อยู่ และพอแก้ก็แก้ทีละคำ
Audit the writing workflow in this repo: the drafts, the content folders and the instruction files the agent reads before writing.
Find the voice file: rules for what is not my voice, what I actually say, and samples of past writing. Quote it, or say it does not exist.
Then read the last five drafts and flag every line that fails one of five checks: brag (would it sound like showing off at dinner with friends), voice (would I type it in a group chat; a metaphor from a world I do not live in), concrete (abstract words instead of what actually happened), position (a hook with no stance), bloat (more than five sections).
Table: draft | line | check failed | why.
Count how many flagged lines were later patched word by word, and how many drafts were rewritten from a new angle.
Report only. Do not edit any draft.- ไฟล์เสียงที่ยกมาทั้งข้อความ หรือคำตอบว่าไม่มี
- บรรทัดจริงจาก draft พร้อมข้อที่ไม่ผ่าน
- จำนวนครั้งที่ปะทีละคำ เทียบกับเขียนใหม่ทั้งชิ้น
- ห้าข้อใน
CLAUDE.mdหรือ skill ที่ agent อ่านก่อนเขียนทุก draft: โม้มั้ย เสียงเรามั้ย เรื่องจริงมั้ย ยั่วมั้ย บวมมั้ย - งานเก่าที่ใช่ 5 ถึง 10 ชิ้นในโฟลเดอร์เดียวกับไฟล์เสียง ให้ agent อ่านก่อนเขียน
- draft ไม่ผ่าน สั่งเขียนใหม่ทั้งชิ้นจากมุมใหม่ ไม่สั่งแก้ทีละย่อหน้า
AI ตัดสินแทนคุณ
ดูกระดาน →กฎใน CLAUDE.mdAI assists execution. Operator owns architecture. Don't over-automate decision-making.
agent เริ่มสร้างทุกอย่างที่เข้ามา feature ที่ไม่มีใครขอ flag ที่ถูกเมินเงียบ ผลสแกนที่ถูกตัดสินจากสี และไม่มีที่ไหนจดว่าใครตัดสินเพราะอะไร
Audit how decisions get made in this repo.
List the features built in the last 60 days (git log, PRs, the spec or changelog). For each, find a written answer to: who suffers without it (a named person), what the workaround was, and which step of the core loop it strengthens. Mark each answered, partly answered, or not answered.
Find the review loop, if any: where reviewer flags are recorded, and whether every flag has a fix or a one-line reason for rejecting it. Count the flags that have neither.
Find any security scan output in the repo and say whether its verdict was read by rule name or acted on by severity alone.
Table: decision | who made it (me, the agent, or nobody by default) | where the reason is written.
Report only. Do not edit any file.- feature ที่สร้างแล้ว คู่กับชื่อคนที่เจ็บถ้าไม่มีมัน หรือช่องว่างถ้าไม่มี
- จำนวน flag ที่ไม่มีทั้งการแก้และเหตุผล
- ผลสแกนที่แยกตามชื่อกฎ ไม่ใช่แค่ระดับความรุนแรง
- skill ห้าคำถามก่อนสร้าง feature ถ้าบอกไม่ได้ว่าใครเจ็บ ให้หยุด
- บันทึกรอบรีวิว ทุก flag แก้หรือปัดพร้อมเหตุผลหนึ่งบรรทัด เมินเงียบนับเป็นตัวเลข
- บรรทัดใน
CLAUDE.md: AI assists execution. Operator owns architecture.
ใช้ kanly ให้ agent มีกติกา
อีก terminal ไม่รู้ว่าคุณเปลี่ยน
ดูกระดาน →กฎใน CLAUDE.mdIf a change here affects another repo, write a handoff before ending: what changed, what to do next, breaking changes, the new contract. Read pending handoffs before starting.
terminal หน้าเว็บสร้างของมารับข้อมูลที่หลังบ้านตัดทิ้งไปแล้ว คุณเป็นคนก๊อป context จากหน้าต่างหนึ่งไปแปะอีกหน้าต่าง และไม่มีที่ไหนเขียนว่าสอง repo ตกลงอะไรกันไว้
Audit how changes cross repo boundaries in this repo.
List the commits from the last 30 days that changed something another repo reads: an endpoint, a response shape, an event, a shared type or constant.
For each, find a handoff written for the other side: what changed, what to do next, whether it breaks anything, and the new contract. Quote it, or say none exists.
Then pick the three most recent contracts and compare each against the code that consumes them, if it is in this checkout. Label each MATCH, DRIFT, MISSING or UNDOCUMENTED, with file and line.
Table: change | other side | handoff (yes or no) | verdict.
Report only. Do not edit any file and do not open any other repo.- commit ที่เปลี่ยนของที่อีก repo ใช้ คู่กับ handoff ของมัน หรือช่องว่าง
- contract ที่ยกมาทั้งข้อความ เทียบกับบรรทัดในโค้ดที่ใช้มัน
- จำนวน DRIFT ที่ชี้ไฟล์ ชี้บรรทัดได้
- บรรทัดใน
CLAUDE.md: เปลี่ยนอะไรที่อีก repo ใช้ ต้องเขียน handoff ก่อนจบงาน - เปิด session ใหม่ทุกครั้ง พิมพ์ /handoff check ก่อนเริ่มงาน
- ก่อน ship รัน handoff verify แล้วตัดสินทุก DRIFT ว่าแก้โค้ด หรือแก้ handoff
loop ที่ไม่มีเส้นชัย
ดูกระดาน →กฎใน CLAUDE.mdNever start an autonomous loop without named, checkable done conditions written first. Close only when every condition passes; a timeout is not done.
agent วิ่งเองแล้วกลับมาบอกว่าเสร็จ เปิดดูยังไม่เสร็จ บางรอบชน timeout แล้วนับว่าจบ และเงื่อนไขจบถูกเขียนหลังจากเห็นผลแล้ว
Audit how autonomous runs are declared done in this repo.
Find the last five tasks an agent ran on its own (from the git log, PR descriptions, task notes or run logs).
For each, find the written done conditions: when they were written relative to the first commit of the run, whether each one names a check (a command, a grep, a behaviour), and whether the result is pass or fail.
Mark each task: conditions before the run, conditions after the run, or no conditions. Note any run that ended on a timeout and was reported as done.
Table: task | conditions (count) | written before or after | how it closed.
Report only. Do not edit any file and do not start any run.- เงื่อนไขจบที่ยกมาทั้งข้อ พร้อมวิธีเช็กของแต่ละข้อ
- เวลาที่เขียนเงื่อนไข เทียบกับ commit แรกของงาน
- งานที่จบเพราะหมดเวลา แต่ถูกรายงานว่าเสร็จ
- บรรทัดใน
CLAUDE.md: ไม่มีเงื่อนไขจบที่เช็กได้ ไม่ปล่อย loop - เงื่อนไขเป็นข้อ CONTRACT-1, CONTRACT-2 แต่ละข้อมีชื่อ วิธีเช็ก และผลเป็นผ่านหรือไม่ผ่าน
- ปิดงานด้วยการเช็กไล่ทีละข้อ หมดเวลาแล้วยังไม่ผ่าน รายงานว่ายังไม่เสร็จ
คนเขียนอนุมัติเอง
ดูกระดาน →กฎใน CLAUDE.mdThe writer is not the approver. Review in a fresh context that sees the spec, the diff and the tests. Answer every flag: fix it or give a one-line reason; silence counts as a dodge.
agent ตรวจงานที่ตัวเองเขียนแล้วตอบว่าเรียบร้อยดี diff ถูก merge โดยไม่มีใครตอบว่าไม่ผ่านได้ และ flag ที่ไม่ได้แก้หายไปเงียบ ๆ
Audit who reviews and who approves in this repo.
List the last ten merged changes. For each, find who wrote it and who approved it, and whether the review ran in a context that did not see the writer's conversation.
Find where review flags are recorded. For each flag, say whether it was fixed, rejected with a written reason, or left with neither.
Count the reviews that never returned a fail.
Table: change | writer | approver | same context (yes or no) | flags fixed / rejected with reason / silent.
Report only. Do not edit any file.- change ที่คนเขียนกับคนอนุมัติเป็นตัวเดียวกัน
- flag ที่ไม่มีทั้งการแก้และเหตุผลหนึ่งบรรทัด
- จำนวนรอบรีวิวที่ไม่เคยตอบว่าไม่ผ่าน
- บรรทัดใน
CLAUDE.md: คนเขียนไม่ใช่คนอนุมัติ - คนตรวจเปิด context ใหม่ เห็นแค่ spec diff test
- บันทึกรอบรีวิว ทุก flag แก้ หรือปัดพร้อมเหตุผลหนึ่งบรรทัด เมินเงียบนับเป็นการเบี้ยว
เสร็จแล้ว โดยไม่มีหลักฐาน
ดูกระดาน →กฎใน CLAUDE.mdEvery terminal reads the same state file at start; whoever changes something writes it there. Never claim a change is complete without running verification. "I edited the file" is not done.
สาม terminal ตอบเรื่องเดียวกันไม่ตรงกัน ทุกตัวมั่นใจเท่ากัน และคำว่าเสร็จมาโดยไม่มีคำสั่งที่รัน ไม่มีผลที่ได้
Audit where the agents in this repo get their shared state and how they prove done.
Find the state file every session is told to read at start, if any. Quote the instruction that points to it, or say none exists.
Then read the last ten times an agent reported a change as complete (commit messages, PR descriptions, task notes). For each, say whether it carries a receipt: the command that was run and its output, the file and line changed, or a value read back after the change.
Table: report | receipt (command and output, file and line, value, or none).
Report only. Do not edit any file and do not run any command that changes state.- คำสั่งที่บอกทุก session ให้อ่านไฟล์สถานะ ยกมาทั้งบรรทัด หรือคำตอบว่าไม่มี
- คำว่าเสร็จที่มีหลักฐานแนบ เทียบกับที่ไม่มี
- หลักฐานจริงหนึ่งชิ้น คำสั่งกับผล
- ไฟล์สถานะชุดเดียวที่ทุก terminal อ่านตอนเปิด ใครเปลี่ยนอะไรจดลงไฟล์นั้น
- บรรทัดใน
CLAUDE.md: Never claim a change is complete without running verification. - คำว่าเสร็จทุกครั้งแนบคำสั่งที่รันกับผลที่ได้ ไฟล์กับบรรทัด หรือค่าจริงหลังแก้
แผลเป็นจากงานจริง
ความจริงเดียวกัน เขียนไว้สามที่
ดูกระดาน →กฎใน CLAUDE.mdName a derived fact once in core and call it from every path. A second definition of the same fact is the bug.
หน้าชำระเงิน หน้าคอร์สของฉัน และหน้าคืนเงินของแอดมิน ตอบไม่ตรงกันว่าออเดอร์นี้จ่ายแล้วหรือยัง เพิ่มกฎใหม่ทีไร หน้าเก่าหน้าหนึ่งพังเงียบ ๆ
Audit this repo for facts that are derived in more than one place.
Pick the derived facts the business depends on: is an order paid, is a user enrolled, is a refund allowed, is a course on sale. Add any others you find.
For each fact, grep for every place that computes it inline (status comparisons, date checks, amount checks) instead of calling one named function. Give file:line for each and quote the condition.
Mark where two definitions disagree on an input (a partial refund, a pending payment, an expired coupon).
Table: fact | named function (file:line, or none) | inline definitions (file:line) | disagree on.
Report only. Do not edit any file.- ความจริงที่คำนวณได้หนึ่งข้อ คู่กับทุกไฟล์และบรรทัดที่คำนวณมันเอง พร้อมเงื่อนไขที่ยกมาทั้งบรรทัด
- ข้อมูลเข้าหนึ่งชุดที่สองนิยามตอบไม่ตรงกัน เช่น ออเดอร์ที่คืนเงินไปครึ่งหนึ่ง
- จำนวนที่ที่เรียกฟังก์ชันกลาง เทียบกับจำนวนที่ที่เขียนเงื่อนไขเอง
- ความจริงที่คำนวณได้มีชื่อเดียวใน
core/เช่นisPaid(order)ทุกหน้าเรียกตัวนั้น - บรรทัดใน
CLAUDE.md: ก่อนเขียนเงื่อนไขใหม่ ค้นก่อนว่ามีฟังก์ชันที่ตอบเรื่องนี้อยู่แล้วหรือยัง ตัวที่สองคือบั๊ก - test ของ
isPaidครอบเคสขอบ จ่ายครึ่งเดียว รอยืนยัน คืนเงินแล้ว ไว้ที่เดียว
ของใหม่วางข้างของเก่า ทั้งคู่ยังวิ่ง
ดูกระดาน →กฎใน CLAUDE.mdA replacement makes the old path unreachable in the same change, proven by grep. No soft deprecation; flip the doc too.
สั่งให้เปลี่ยนจากอีเมลเป็น LINE notify ได้ของใหม่มาวางข้างของเก่า ทั้งสองทางยังถูกเรียก บางหน้าส่งอีเมล บางหน้าส่ง LINE และเอกสารยังเล่าถึงทางเก่า
Audit this repo for replacements that left the old path alive.
From the git log of the last 60 days, list the changes that introduced a new implementation of something that already existed: a new sender, client, handler, enum value, table or config key.
For each, name the old path and grep for every caller, import, config entry and doc line that still mentions it. Give file:line for each hit.
Mark each replacement: old path gone, old path reachable, or old path marked deprecated but still called.
Table: replacement | old name | live references (file:line) | docs that still describe the old path.
Report only. Do not edit any file.- ชื่อของทางเก่า กับผลค้นทั้ง repo ที่ยังเจอมัน ทุกไฟล์ทุกบรรทัด หรือคำตอบว่าไม่เจอแล้ว
- คนเรียกที่ยังวิ่งทางเก่า เทียบกับคนเรียกที่ย้ายไปทางใหม่แล้ว
- บรรทัดในเอกสารที่ยังเล่าถึงทางเก่า
- การแทนที่ลบทางเก่าใน change เดียวกัน และแนบผลค้นชื่อเก่าที่ไม่เจอแล้วไว้ใน PR
- บรรทัดใน
CLAUDE.md: ไม่มีการเลิกใช้แบบค่อยเป็นค่อยไป ถ้าต้องเก็บไว้ชั่วคราว ให้เขียนป้ายพร้อมเงื่อนไขที่จะลบ - เอกสารที่เล่าพฤติกรรมนั้นเปลี่ยนใน commit เดียวกับโค้ด
ถามว่าทำไม ได้ diff กลับมา
ดูกระดาน →กฎใน CLAUDE.mdA why, triage or pushback turn contains zero edits. Report the operator's own change; never reverse it.
คุณถามว่าทำไม staging ตอบ 403 หรือบอกว่าแค่คัดแยกก่อน ได้ diff กลับมา agent แก้ตามทฤษฎีแรก และปิด flag ที่คุณเปิดไว้เองโดยไม่บอก
Audit how this repo's agent sessions handle questions.
From the last 20 sessions, commits or PR threads you can read, find the turns where the operator asked why, asked for triage only, or pushed back on a change.
For each, say whether the agent's reply contained an edit, and whether it changed or reverted something the operator had changed by hand (a flag, a config value, a file).
Then check the repo's agent instructions: quote the line that says a question gets an answer and no edit, or say none exists.
Table: turn | kind (why, triage, pushback) | edits in reply (yes or no) | operator change reverted (yes or no).
Report only. Do not edit any file.- รอบที่เป็นคำถามว่าทำไม คัดแยก หรือแย้ง คู่กับจำนวนไฟล์ที่ถูกแก้ในคำตอบ
- ของที่คุณเปลี่ยนเอง เช่น flag หรือค่า config ที่ agent ย้อนกลับ ชี้ commit หรือบรรทัด
- บรรทัดในไฟล์คำสั่งของ agent ที่บอกว่าคำถามได้คำตอบ ไม่ได้ diff หรือคำตอบว่าไม่มี
- บรรทัดใน
CLAUDE.md: รอบที่ถามว่าทำไม คัดแยก หรือแย้ง ไม่มีการแก้ไฟล์ ตอบด้วยข้อสรุปเดียวที่เช็กได้กับหลักฐาน - ของที่คุณเปลี่ยนเองถูกรายงาน ไม่ถูกย้อน ถ้า agent คิดว่าต้องย้อน ให้ถามก่อน
- รอบคัดแยกเปิดในโหมดอ่านอย่างเดียว แก้ไฟล์ไม่ได้จนกว่าคุณจะสั่ง
หน่วยเงินอยู่ในคอมเมนต์ ไม่ได้อยู่ใน type
ดูกระดาน →กฎใน CLAUDE.mdPut the money unit in the type, never in a comment or a field name. Convert once, at the provider boundary.
ช่องเงินเป็น amount: string มีคอมเมนต์บอกหน่วยที่ผิด เลข 100 ฝังอยู่ห้าไฟล์ หน้าจอเคยโชว์ 0.9 บาท เคยโชว์ 90,000 บาท แล้ววันหนึ่งเป็นศูนย์ทั้งร้าน
Audit how money amounts are typed and converted in this repo.
Find every field, parameter and column that holds a money amount. For each, give file:line, its type, and where its unit (baht, satang, provider minor units) is stated: in the type, in the field name, in a comment, or nowhere.
Grep for every hardcoded conversion factor (100, 0.01, / 100, * 100) applied to an amount and list each with file:line.
Mark every place a comment's unit disagrees with how the value is used.
Table: field | type | unit stated where | conversions applied (file:line).
Report only. Do not edit any file.- ทุกช่องเงิน คู่กับ type ของมัน และที่ที่บอกหน่วย ใน type ในชื่อ ในคอมเมนต์ หรือไม่มีเลย
- ทุกที่ที่คูณหรือหารร้อยเอง ชี้ไฟล์ชี้บรรทัด
- คอมเมนต์ที่บอกหน่วยไม่ตรงกับที่โค้ดใช้จริง
- type
BahtกับSatangแยกกัน ส่งผิดหน่วย compiler แดง - ฟังก์ชันแปลงหน่วยที่เดียวตรงรอยต่อกับเจ้าระบบตัดเงิน ที่อื่นห้ามคูณหรือหารร้อยเอง
- บรรทัดใน
CLAUDE.md: หน่วยเงินอยู่ใน type ไม่ใช่ในคอมเมนต์หรือชื่อช่อง
ทฤษฎีมาก่อนหลักฐาน
ดูกระดาน →กฎใน CLAUDE.mdName no cause without a receipt: file:line, a live response or a log line. Re-read your own diff first.
ยอดคงเหลือขึ้นศูนย์ agent ตอบสาเหตุทันที แก้ไปรอบหนึ่ง ถอนคำ โทษ config แล้วยิงทดสอบอีกห้าครั้ง ทั้งที่ยังไม่เคยเปิด diff ของตัวเอง
Audit how causes were named in this repo's recent bug fixes.
List the last ten fixes (commits, PR descriptions, incident notes). For each, find the first message that named a cause.
Say whether that message carried a receipt: a quoted file:line, a live response, or a log line. Say whether the cause was later retracted or replaced.
For each bug, check whether the agent's own most recent diff in that area was read before any other theory.
Table: fix | first cause named | receipt (file:line, response, log line, or none) | retracted (yes or no) | own diff read first (yes or no).
Report only. Do not edit any file.- ข้อความแรกที่เอ่ยชื่อสาเหตุ คู่กับหลักฐานที่แนบ ไฟล์กับบรรทัด คำตอบจริงจากระบบ บรรทัดใน log หรือไม่มี
- สาเหตุที่ถูกถอนทีหลัง กับจำนวนรอบที่แก้ก่อนเจอตัวจริง
- บั๊กที่ต้นเหตุคือ diff ของ agent เอง เทียบกับที่มันไปโทษที่อื่นก่อน
- บรรทัดใน
CLAUDE.md: ห้ามเอ่ยชื่อสาเหตุถ้าไม่มีหลักฐาน ไฟล์กับบรรทัด คำตอบจริงจากระบบ หรือบรรทัดใน log - ไล่ diff ของตัวเองก่อนเสมอ ก่อนไปสงสัย config หรือของคนอื่น
- ทดสอบหนึ่งครั้งต่อหนึ่งสมมติฐานที่เขียนไว้ก่อนยิง ไม่ยิงหว่าน
catch ที่คืนค่าปลอดภัยปลอม
ดูกระดาน →กฎใน CLAUDE.mdA catch never returns a value that looks like data. Health checks call the dependency, not the env var.
เจ้าระบบตัดเงินตอบมาผิดรูป catch แปลงเป็นยอดศูนย์ หน้าจอไม่พังสักหน้า health ยังเขียวตลอดสองชั่วโมงที่ระบบล่ม เพราะมันดูแค่ว่ามี env ครบ
Audit this repo for catch blocks and fallbacks that hide failures.
Find every catch, .catch, try/except and default-value fallback around a network call, a decode or a parse. For each, give file:line and what it returns or swallows.
Mark the ones that return a value shaped like real data (0, an empty list, an empty object, false, a default balance) instead of throwing or logging.
Then read every health or readiness check: say whether it calls the dependency with the real credentials, or only checks that a config value or env var is present.
Table: location | on error returns | looks like data (yes or no) | logged (yes or no).
Report only. Do not edit any file.- catch ที่คืนค่าหน้าตาเหมือนข้อมูล เช่น ศูนย์ รายการว่าง หรือ false ชี้ไฟล์ชี้บรรทัด
- health check ที่ดูแค่ว่ามี env กับตัวที่เรียกของที่มันพึ่งจริง
- error ที่ถูกกลืนโดยไม่มีบรรทัดใน log
- catch throw ต่อหรือ log แล้วแสดงว่าโหลดไม่ได้ ห้ามคืนค่าที่หน้าตาเหมือนข้อมูล
- health check เรียกของที่มันพึ่งจริงด้วยกุญแจจริง ไม่ใช่ดูว่ามี env
- บรรทัดใน
CLAUDE.md: A catch never returns a value that looks like data.
พฤติกรรมอยู่นอก repo
ดูกระดาน →กฎใน CLAUDE.mdBefore a code fix, name where the behaviour lives: repo, vendor dashboard or this deploy's secrets. Verify the runtime store.
ปุ่มจ่ายด้วยบัตรไม่ขึ้น ปล่อยโค้ดไปสี่รอบ ได้ 500 กลับมา ทั้งที่ปุ่มนี้คือสวิตช์ในหน้าตั้งค่าของเจ้าระบบตัดเงิน และ staging คือ deploy อีกตัวที่มีรหัสลับของตัวเอง
Audit where this app's behaviour is decided outside the code.
List every feature whose behaviour depends on something not in this repo: a toggle in a provider dashboard, a key set in a build-only panel, a secret in a deploy's runtime store, a separately named staging or preview deploy.
For each, name where the truth lives, how a person would change it, and whether the repo documents that place.
Then take the last five bug fixes and say whether the real cause was in code or in one of those places, and how many code releases came before the fix.
Table: behaviour | where it lives | documented in repo (yes or no) | releases before the real fix.
Report only. Do not edit any file and do not read any secret value.- พฤติกรรมหนึ่งข้อ คู่กับที่ที่มันถูกตัดสินจริง repo หน้าตั้งค่าของเจ้าระบบ หรือรหัสลับของ deploy ตัวนั้น
- จำนวนรอบที่ปล่อยโค้ดก่อนเจอว่าต้นเหตุอยู่นอก repo
- deploy ที่ชื่อต่างกันและมีรหัสลับของตัวเอง เทียบกับที่เอกสารบอก
- บรรทัดใน
CLAUDE.md: ก่อนแก้โค้ด บอกก่อนว่าพฤติกรรมนี้อยู่ที่ไหน repo หน้าตั้งค่าของเจ้าระบบ หรือรหัสลับของ deploy ตัวนี้ - ไฟล์เดียวใน repo ที่จดว่าพฤติกรรมไหนอยู่นอก repo อยู่ที่ไหน ใครเปลี่ยนได้
- หลังเปลี่ยนค่า อ่านจากที่ระบบใช้จริงตอนรัน ไม่ใช่จากไฟล์ในเครื่อง
เสร็จแล้ว คือคำพูด ของจริงอยู่บนสาย
ดูกระดาน →กฎใน CLAUDE.mdRead done and deployed from the live endpoint and the running version, never from a handoff, a memory or a commit.
handoff บอกว่าช่องข้อมูลนี้เสร็จแล้ว หน้าเว็บต่อเข้ากับมัน ปล่อยขึ้นไป ช่องนั้นไม่มีในคำตอบจริง เพราะ version ที่รันอยู่ยังเป็นตัวเก่า
Audit how this repo decides that something is done and deployed.
List the last ten times work was reported done or deployed (handoffs, commit messages, PR descriptions, session notes).
For each, say what the claim was read from: the live endpoint, the running version, a handoff, a memory or note, or a commit.
For each UI change that consumes an API field, check whether the field was confirmed in a live response before the UI was wired.
Then find the end-of-session record, if any: quote where branch, commits ahead of origin and the deployed version are written down, or say none exists.
Table: claim | read from | confirmed on the wire (yes or no).
Report only. Do not edit any file and do not call any endpoint that changes state.- คำว่าเสร็จหรือ deploy แล้ว คู่กับที่มาของมัน endpoint จริง version ที่รันอยู่ handoff ความจำ หรือ commit
- ช่องข้อมูลที่หน้าเว็บใช้ คู่กับคำตอบจริงที่ยืนยันว่ามีช่องนั้น หรือไม่มี
- บันทึกท้าย session ที่มี branch จำนวน commit ที่ยังไม่ขึ้น และ version ที่ deploy หรือคำตอบว่าไม่มี
- ก่อนต่อหน้าจอ เรียก endpoint จริงหนึ่งครั้ง และอ่าน version ที่รันอยู่
- จบ session ด้วยการจด branch จำนวน commit ที่ยังไม่ขึ้น และ version ที่ deploy ลงไฟล์
- บรรทัดใน
CLAUDE.md: เสร็จกับ deploy แล้วอ่านจากระบบจริง ไม่ใช่จาก handoff ความจำ หรือ commit
