4.0 KiB
4.0 KiB
Task A: Template Audit + Convention Freeze
ALLA OS CRM vNext / Organization-based
คุณคือ Senior Full-stack Engineer + System Architect ให้สำรวจ template project ปัจจุบันก่อนเริ่ม production code สำหรับ ALLA OS CRM vNext
Context สำคัญ
ระบบนี้ต้องยึด organization-based / workspace-based เป็นแกนหลัก
organizationId = tenant / workspace / company group scope
membership = user role + permissions ภายใน organization
branchId = business branch / document scope ภายใน organization
ห้ามตีความ branchId เป็น tenant หลัก
ห้ามออกแบบแบบ branch-first
ไฟล์/Skill ที่ต้องอ่านก่อน
ก่อนสรุป convention ต้องอ่าน:
.agents/skills/kiranism-shadcn-dashboard
Layout.md
AGENTS.md
README.md
package.json
src/db/schema.ts
src/lib/auth
src/app/dashboard
src/features
src/components
ถ้า path บางรายการไม่มี ให้ระบุใน audit ว่า “not found” ห้ามเดา
เป้าหมาย
สร้างเอกสาร audit เพื่อ freeze convention ก่อนทำ Task B
สิ่งที่ต้องตรวจ
- Project structure
- App Router structure
- Dashboard layout
- Layout rule จาก
Layout.md - Skill rule จาก
.agents/skills/kiranism-shadcn-dashboard - Sidebar / navigation pattern
- PageContainer pattern
- Server component / client component pattern
- Data fetching pattern
- TanStack Query / Hydration pattern
- Form pattern
- DataTable pattern
- Sheet / Dialog / Drawer pattern
- Drizzle schema convention
- API route / server action convention
- Feature folder convention
- Auth convention
- Organization context
- Membership / permission / RBAC pattern
- Active organization handling
- Existing dashboard visual tone
- Design token / theme usage
- Files that should not be touched
- Risk before Task B
ข้อกำหนดสำคัญ
- ห้าม implement feature
- ห้าม refactor
- ห้ามเปลี่ยน config
- ห้ามเพิ่ม dependency
- ห้าม run build/test/lint จนกว่าจะได้รับคำสั่ง
- ห้ามสร้าง design system ใหม่
- ห้ามสร้าง layout ใหม่ถ้า template มีอยู่แล้ว
- ต้องยึด
Layout.mdและ dashboard skill เป็น source of truth ด้าน UI
Output
สร้างไฟล์:
docs/implementation/task-a-template-audit.md
โครงสร้างเอกสาร:
# Task A Template Audit
## 1. Executive Summary
## 2. Project Structure
## 3. Layout.md Findings
## 4. kiranism-shadcn-dashboard Skill Findings
## 5. Routing Convention
## 6. Dashboard Layout Convention
## 7. Feature Folder Convention
## 8. Component Convention
## 9. Form Convention
## 10. Table Convention
## 11. API / Server Action Convention
## 12. Drizzle / Database Convention
## 13. Auth Convention
## 14. Organization / Membership / Permission Convention
## 15. Branch Scope Convention
## 16. UI / Design Token Convention
## 17. CRM vNext Recommended Convention
## 18. Files That Should Not Be Touched
## 19. Risks / Concerns
## 20. Task B Implementation Plan
Definition of Done
Task A ถือว่าเสร็จเมื่อ:
- มี audit document ครบ
- ยืนยันว่า organization-based เป็นแกนหลัก
- ยืนยันว่า branch เป็น sub-scope ภายใน organization
- ระบุ path สำหรับวาง Task B ได้ชัดเจน
- ระบุ convention UI จาก Layout.md และ dashboard skill แล้ว
- ยังไม่มี production feature ถูก implement