เขียน Architecture Decision Record (ADR) สำหรับการตัดสินใจทางเทคนิค
สร้าง ADR ที่ครบถ้วนและอ่านง่าย บันทึกบริบท ตัวเลือกที่พิจารณา เหตุผลการตัดสินใจ และ trade-off ที่ยอมรับ ช่วยให้ทีมปัจจุบันและนักพัฒนารุ่นต่อไปเข้าใจว่าทำไมจึงตัดสินใจเช่นนั้น
**Input:**
- ADR number: 0012
- Decision title: Use PostgreSQL instead of MongoDB for User and Order Data
- Project/system context: Mid-size e-commerce platform, ~100,000 MAU, team of 5 engineers, targeting production launch in Q3 2026
- Problem being solved: Need a primary database for users, orders, and inventory that supports multi-table ACID transactions and complex relational queries
- Options that were evaluated: 1. PostgreSQL — mature relational DB with JSONB support
2. MongoDB — document-oriented with flexible schema
3. MySQL — familiar relational option with weaker JSONB support
- Decision made: PostgreSQL
- Known consequences and trade-offs: Gains: full ACID guarantee across multi-table transactions, team already has SQL expertise, JSONB covers flexible product attributes. Trade-offs: schema migrations require planning and versioning with a tool like Flyway; horizontal read scaling needs read replicas configured separately
**Output — use this exact structure, no extra sections:**
---
# ADR-0012: [Decision Title]
**Date:** [today's date]
**Status:** Accepted
**Deciders:** Engineering Team
## Context
[2–4 sentences describing the situation, constraints, and why a decision was required. Be specific: mention scale, team size, or system boundaries where relevant.]
## Decision Drivers
- [Driver 1 — technical, business, or operational]
- [Driver 2]
- [Driver 3]
## Options Considered
### Option 1: [Name]
**Pros:** [specific advantages]
**Cons:** [specific disadvantages]
### Option 2: [Name]
**Pros:** ...
**Cons:** ...
[Repeat for all options provided]
## Decision
[2–3 sentences stating the chosen option and the primary reasoning. Reference the decision drivers explicitly. Do not use vague justifications like 'it's simpler' — explain *why* it is simpler in this specific context.]
## Consequences
### Positive
- [Concrete benefit 1]
- [Concrete benefit 2]
### Negative / Trade-offs Accepted
- [Trade-off 1 — be honest and specific]
- [Trade-off 2]
### Risks & Mitigations
| Risk | Mitigation |
|------|------------|
| [Risk 1] | [Concrete action to address it] |
| [Risk 2] | [Concrete action to address it] |
## Links & References
- [Related ADRs, tickets, RFCs, or documentation]
---
**Constraints:**
- Write entirely in English. ADRs are engineering documents intended for long-term archival; English maximises readability across future team members.
- Do NOT omit the "Negative / Trade-offs Accepted" section. Honest documentation of trade-offs is the most valuable part of an ADR.
- Do NOT use vague qualitative claims. Every advantage or disadvantage must reference a specific technical property, constraint, or measurable outcome.
- Keep tone neutral and factual. Do not retroactively advocate for the decision — document it objectively.
- Do not add sections beyond those listed in the format above.
ถ้าคำตอบยังกว้างไป พิมพ์บอกมันตรงๆ ว่าขอเจาะจงกว่านี้ ไม่ต้องเริ่มพรอมต์ใหม่
ปรับ 7 ช่องให้ตรงกับงานของคุณ
หมายเลข ADR ตามลำดับในโปรเจกต์ เช่น 0001, 0012, 0043
ชื่อการตัดสินใจ เขียนเป็น English กระชับได้ใจความ เช่น 'Adopt GraphQL over REST for Mobile API'
บริบทของโปรเจกต์และทีม เช่น ขนาดระบบ จำนวนทีม ช่วงเวลา และ tech stack หลัก
ปัญหาหรือ requirement ที่ทำให้ต้องตัดสินใจ ระบุให้ชัดว่าต้องการอะไรและทำไม
รายชื่อตัวเลือกที่ประเมิน อย่างน้อย 2 ตัวเลือก พร้อมคำอธิบายสั้นๆ แต่ละตัว
ตัวเลือกที่ทีมตัดสินใจเลือก ระบุชื่อตรงกับที่ปรากฏใน options_considered
ผลที่ตามมาทั้งด้านดีและ trade-off ที่ยอมรับ ต้องระบุทั้งสองด้านอย่างซื่อสัตย์
ผลลัพธ์ที่จะได้
ADR-0012: Use PostgreSQL instead of MongoDB for User and Order Data
Date: 2026-05-01 Status: Accepted Deciders: Engineering Team
Context
ลองพรอมต์อื่นในแนวเดียวกัน
ดูพรอมต์ทั้งหมด
อธิบาย Legacy Code ให้ทีมใหม่เข้าใจเร็ว พร้อม Flag จุดเสี่ยงและ Tech Debt
ให้ AI วิเคราะห์โค้ดเก่าที่ซับซ้อน สรุปการทำงาน ชี้จุดเสี่ยง และจัดทำ tech debt log พร้อม effort estimate เพื่อให้ทีมใหม่เริ่มต้นได้อย่างปลอดภัยและมีทิศทางชัดเจน

สร้าง Test Cases ครอบคลุมจาก Function Spec
สร้าง test suite จาก function specification ที่ครอบคลุมทั้ง happy path, edge cases และ adversarial inputs พร้อม rationale ของแต่ละ test และ runnable code ในภาษาและ framework ที่เลือก ช่วย developer เขียน test อย่างเป็นระบบและตรวจจับ bug ที่ซ่อนอยู่ได้อย่างมีประสิทธิภาพ

Code Review Checklist 5 มิติ: Correctness, Security, Performance, Style, Test Coverage
พรอมต์สำหรับ developer ที่ต้องการ code review เชิงลึก ครอบคลุม 5 มิติหลัก พร้อมระบบ status icon และ verdict สรุป ช่วยให้ review ได้ครบถ้วนและสม่ำเสมอทุกครั้ง