690514:2019 204-rfa-approval-refactor #01
CI / CD Pipeline / build (push) Successful in 6m1s
CI / CD Pipeline / deploy (push) Failing after 6m42s

This commit is contained in:
2026-05-14 20:19:21 +07:00
parent 07cc6d47b1
commit 0240d80da5
183 changed files with 20050 additions and 1017 deletions
@@ -0,0 +1,28 @@
// File: docs/ai-knowledge-base/prompts/codex/codex-bugfix.md
# Bug Fix Prompt (Windsurf/Codex)
## ⭐ Role: Debugging Specialist
## 🎯 Objective
วิเคราะห์และแก้ไข Bug ในระบบ DMS โดยเน้นความถูกต้องและไม่ส่งผลกระทบต่อส่วนอื่น (No Regressions)
## 🚀 Prompt Template
```
[DEBUG]
Issue: <อธิบายอาการของ Bug และผลกระทบ>
File: <path/to/file>
Error Log: <error message จาก terminal หรือ browser>
Steps to Reproduce: <ขั้นตอนในการทำให้เกิด bug>
Request: วิเคราะห์หาสาเหตุตามลำดับความสำคัญ (Root Cause Analysis) และเสนอแนวทางการแก้ไขที่สอดคล้องกับ ADRs
```
## 🔍 Instructions for AI
1. ค้นหาจุดที่เกิด Error ใน Codebase
2. ตรวจสอบความเกี่ยวข้องกับ Database Schema หรือ Permissions
3. สร้าง Unit Test เพื่อจำลอง Bug (Red Test)
4. แก้ไขโค้ดเพื่อให้ Test ผ่าน (Green Test)
5. ตรวจสอบผลกระทบข้างเคียง (Side Effects)
---
// Change Log:
// - 2026-05-14: Initial bugfix prompt
@@ -0,0 +1,28 @@
// File: docs/ai-knowledge-base/prompts/codex/codex-feature.md
# Feature Implementation Prompt (Windsurf/Codex)
## ⭐ Role: Senior Full Stack Developer (DMS Specialist)
## 🎯 Context
ใช้เมื่อต้องการให้ AI เริ่มเขียนโค้ดสำหรับฟีเจอร์ใหม่ หลังจากที่มี Spec และ Plan แล้ว
## 🚀 Prompt Template
```
[IMPLEMENT FEATURE]
Feature Name: <ชื่อฟีเจอร์>
Spec Reference: <path/to/spec.md>
Plan Reference: <path/to/plan.md>
Current Task: <ระบุ Task จาก tasks.md>
Request: เขียนโค้ดตามมาตรฐานที่กำหนดใน AGENTS.md โดยเน้นความถูกต้องของ Type Safety และการจัดการ Error
```
## 🔍 Instructions for AI
1. อ่าน Spec และ Plan ให้เข้าใจถ่องแท้
2. ตรวจสอบ Schema ของ Database ก่อนเริ่มเขียน Entity/Service
3. เขียน Logic ให้สอดคล้องกับ ADRs (UUIDv7, Idempotency, etc.)
4. เขียน Unit Test ควบคู่ไปด้วยเสมอ
5. ตรวจสอบ Forbidden Actions ก่อนส่งงาน
---
// Change Log:
// - 2026-05-14: Initial feature implementation prompt
@@ -0,0 +1,26 @@
// File: docs/ai-knowledge-base/prompts/codex/codex-review.md
# Code Review Prompt (Windsurf/Codex)
## ⭐ Role: Senior Code Reviewer (DMS Specialist)
## 🎯 Context
ตรวจสอบโค้ดในโครงการ LCBP3-DMS เพื่อความปลอดภัย, คุณภาพ และความถูกต้องตามมาตรฐานสถาปัตยกรรม
## 📝 Focus Areas
1. **Security**: ตรวจสอบ CASL Guard, RBAC Check และการทำ Input Sanitization
2. **UUID Strategy (ADR-019)**: มั่นใจว่าใช้ `publicId` และไม่มีการใช้ `parseInt()`
3. **Database Consistency (ADR-009)**: ตรวจสอบว่าไม่มีการใช้ TypeORM Migrations
4. **Performance**: ตรวจสอบ Query Optimization และการใช้ Cache
5. **Forbidden Patterns**: ค้นหา `any`, `console.log` หรือการข้าม StorageService
## 🚀 Prompt Template
```
[CODE REVIEW]
Files: <รายการไฟล์>
Focus: <เลือก: security/performance/uuid/logic>
Request: ตรวจสอบโค้ดตามมาตรฐานใน AGENTS.md และ ADRs ที่เกี่ยวข้อง พร้อมเสนอวิธี Refactor หากพบจุดบกพร่อง
```
---
// Change Log:
// - 2026-05-14: Initial code review prompt