@jakkrichm/create-nexus-devflow 2.2.2 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +58 -45
  2. package/dist/bin/create-nexus-devflow.js +9 -1
  3. package/dist/bin/create-nexus-devflow.js.map +1 -1
  4. package/dist/lib/command-catalog.js +1 -1
  5. package/dist/lib/command-catalog.js.map +1 -1
  6. package/dist/lib/core-skill-inventory.d.ts +16 -0
  7. package/dist/lib/core-skill-inventory.js +96 -0
  8. package/dist/lib/core-skill-inventory.js.map +1 -0
  9. package/dist/lib/dashboard-page.d.ts +1 -1
  10. package/dist/lib/dashboard-page.js +42 -20
  11. package/dist/lib/dashboard-page.js.map +1 -1
  12. package/dist/lib/dashboard-snapshot.js +16 -12
  13. package/dist/lib/dashboard-snapshot.js.map +1 -1
  14. package/dist/lib/dashboard.js +10 -1
  15. package/dist/lib/dashboard.js.map +1 -1
  16. package/dist/lib/doctor.js +14 -11
  17. package/dist/lib/doctor.js.map +1 -1
  18. package/dist/lib/gatekeeper.d.ts +4 -0
  19. package/dist/lib/gatekeeper.js +2 -2
  20. package/dist/lib/gatekeeper.js.map +1 -1
  21. package/dist/lib/git-status.d.ts +10 -2
  22. package/dist/lib/git-status.js +57 -29
  23. package/dist/lib/git-status.js.map +1 -1
  24. package/dist/lib/swarm-orchestrator.d.ts +4 -1
  25. package/dist/lib/swarm-orchestrator.js +2 -2
  26. package/dist/lib/swarm-orchestrator.js.map +1 -1
  27. package/dist/lib/update.js +5 -8
  28. package/dist/lib/update.js.map +1 -1
  29. package/dist/lib/version-check.js +1 -1
  30. package/dist/lib/workflow-state.js +19 -32
  31. package/dist/lib/workflow-state.js.map +1 -1
  32. package/dist/scripts/prepare-template.js +19 -16
  33. package/dist/scripts/prepare-template.js.map +1 -1
  34. package/package.json +1 -1
  35. package/template/.agents/skills/check/SKILL.md +78 -75
  36. package/template/.agents/skills/complete/SKILL.md +47 -36
  37. package/template/.agents/skills/debug/SKILL.md +76 -94
  38. package/template/.agents/skills/devflow/SKILL.md +51 -79
  39. package/template/.agents/skills/discovery/SKILL.md +7 -9
  40. package/template/.claude/skills/check/SKILL.md +78 -75
  41. package/template/.claude/skills/complete/SKILL.md +47 -36
  42. package/template/.claude/skills/debug/SKILL.md +76 -94
  43. package/template/.claude/skills/devflow/SKILL.md +51 -79
  44. package/template/.claude/skills/discovery/SKILL.md +7 -9
  45. package/template/AGENTS.md +21 -30
  46. package/template/devflow/build-plan.md +9 -0
  47. package/template/devflow/context/ai-interaction.md +43 -45
  48. package/template/devflow/context/coding-standards.md +31 -6
  49. package/template/devflow/context/current-stage.md +10 -7
  50. package/template/devflow/context/findings.md +8 -11
  51. package/template/devflow/context/glossary.md +31 -0
  52. package/template/devflow/history/HISTORY.md +1 -1
  53. package/template/devflow/project-plan.md +2 -2
  54. package/template/devflow/reference/build-plan-template.md +65 -0
  55. package/template/devflow/reference/feature-spec-template.md +110 -0
  56. package/template/devflow/reference/project-plan-template.md +128 -0
  57. package/template/devflow/reference/running-id-contract.md +12 -11
  58. package/template/.agents/skills/10-define/SKILL.md +0 -54
  59. package/template/.agents/skills/20-spec/SKILL.md +0 -155
  60. package/template/.agents/skills/30-plan/SKILL.md +0 -226
  61. package/template/.agents/skills/40-execute/SKILL.md +0 -158
  62. package/template/.agents/skills/50-verify/SKILL.md +0 -62
  63. package/template/.agents/skills/60-report/SKILL.md +0 -57
  64. package/template/.agents/skills/70-deliver/SKILL.md +0 -72
  65. package/template/.claude/skills/10-define/SKILL.md +0 -54
  66. package/template/.claude/skills/20-spec/SKILL.md +0 -155
  67. package/template/.claude/skills/30-plan/SKILL.md +0 -226
  68. package/template/.claude/skills/40-execute/SKILL.md +0 -158
  69. package/template/.claude/skills/50-verify/SKILL.md +0 -62
  70. package/template/.claude/skills/60-report/SKILL.md +0 -57
  71. package/template/.claude/skills/70-deliver/SKILL.md +0 -72
@@ -1,13 +1,10 @@
1
- # Findings Ledger
1
+ # Findings
2
2
 
3
- > **Generated Ledger File.** Tracks quality findings, security vulnerabilities, regression risks, and architectural debt raised during review and QA passes.
4
- >
5
- > **Finding Format**:
6
- > `### <ID> [<SEVERITY>] <STATUS> - <Title>`
7
- > - **Severities**: `P0` (Critical Blocker), `P1` (High Blocker), `P2` (Medium), `P3` (Low / Polish)
8
- > - **Statuses**: `unverified`, `open`, `fixed`, `closed`, `accepted`, `invalid`
9
- > - **Release Gate Rule**: Any `P0` or `P1` finding in `open` or `fixed` status unconditionally blocks `/complete` and `70-deliver`.
3
+ > **Generated file.** The findings ledger: review findings raised by `/audit`
4
+ > against the work in progress, each with a durable ID, severity (P0-P3), and
5
+ > status. `/implement` marks repaired findings `fixed`, a later `/audit` pass
6
+ > moves them to `closed`, and `/complete` refuses to merge while any P0 or P1
7
+ > finding is `open` or `fixed`, then archives resolved findings with the work
8
+ > and resets this file.
10
9
 
11
- ---
12
-
13
- _No active findings recorded. QA and audit passes append findings here as they are discovered._
10
+ _No findings recorded. `/audit` appends findings here when it finds them._
@@ -0,0 +1,31 @@
1
+ # Nexus-DevFlow Domain Glossary
2
+
3
+ > พจนานุกรมศัพท์โดเมนและนิยามสถาปัตยกรรมสำหรับ Nexus-DevFlow
4
+
5
+ ---
6
+
7
+ ### Single Living Spec (`current-feature.md`)
8
+ - **Definition**: เอกสาร Markdown กลางเพียงฉบับเดียวที่ใช้ขับเคลื่อนและบันทึกวงจรชีวิตของงานพัฒนาตั้งแต่ต้นจนจบ (Single Source of Truth during active delivery)
9
+ - **Constraints**: มีได้เพียง 1 งานที่ active ในช่วงเวลาหนึ่งตามหลักการ Single Active Run Guardrail
10
+ - **Structure**: ครอบคลุม 6 ส่วนหลัก: (1) Define & Boundaries, (2) Technical Spec & Contracts, (3) Execution Plan & TDD Tasks, (4) Implementation Log & Evidence, (5) Multi-Lane Verification Matrix, (6) Release Digest & Retrospective
11
+ - **Aliases / Related**: `current-feature.md`, Living Spec, Feature Spec
12
+
13
+ ### Unified Fast-Track
14
+ - **Definition**: รูปแบบการพัฒนาหลักแบบ Single-Track ของ Nexus-DevFlow ที่รวมความสามารถเชิงสถาปัตยกรรมระดับลึก (Deep) และความคล่องตัว (Fast) เข้าด้วยกันผ่าน 4 คำสั่งหลัก: `/feature` (หรือ `/fix`), `/implement`, `/check`, และ `/complete`
15
+ - **Constraints**: ขับเคลื่อนผ่านไฟล์ `current-feature.md` และเมื่อเสร็จสิ้นจะถูก Archive เป็นไฟล์ Markdown เดี่ยวใน `devflow/history/`
16
+ - **Aliases / Related**: Fast-Track, Unified Track
17
+
18
+ ### Pre-Flight Discovery
19
+ - **Definition**: กระบวนการสำรวจไอเดีย, ทำการวิจัย (Research), กลั่นกรอง PRD, วิเคราะห์ Trade-offs และจัดทำ ADR ก่อนที่จะเริ่มเปิดรอบพัฒนาจริง
20
+ - **Constraints**: ไม่แก้ไขซอร์สโค้ดโปรเจกต์ และไม่ถือว่าเป็น Active Run จนกว่าจะถูกส่งต่อเข้าสู่ `/feature`
21
+ - **Aliases / Related**: `/discovery`, `/idea`, `/brainstorm`, `/grill`
22
+
23
+ ### Multi-Lane Verification Matrix
24
+ - **Definition**: ตารางตรวจสอบคุณภาพแบบหลายมิติที่ครอบคลุม Typecheck, Linter, Automated Unit/Integration Tests, และ Manual Proof Evidence ในคำสั่ง `/check`
25
+ - **Constraints**: ต้องมีผลลัพธ์ผ่าน (PASS) ครบทุก Lane และไม่มี P0/P1 Finding ที่ยังค้างอยู่ก่อนที่จะส่งต่อไปยัง `/complete`
26
+ - **Aliases / Related**: QA Matrix, Lane Verification
27
+
28
+ ### Release Digest & Retrospective
29
+ - **Definition**: สรุปผลการเปลี่ยนแปลง, บทเรียนที่ได้รับ (Lessons Learned), และการตัดสินใจสำคัญที่บันทึกไว้ในตอนปิดรอบการพัฒนา
30
+ - **Constraints**: บันทึกอัตโนมัติใน Living Spec ก่อนที่จะทำการ Squash Merge และ Archive
31
+ - **Aliases / Related**: Delivery Digest, Retrospective Log
@@ -1,6 +1,6 @@
1
1
  # Master Release History Ledger
2
2
 
3
- This master ledger tracks all released delivery runs, milestones, and rollbacks in chronological order. Each entry is recorded during `/complete` or `70-deliver` and links to its exact Git commit hash, release status, category, and archived delivery artifacts.
3
+ This master ledger tracks all released delivery runs, milestones, and rollbacks in chronological order. Each entry is recorded during `/complete` and links to its exact Git commit hash, release status, category, and archived delivery artifacts.
4
4
 
5
5
  ---
6
6
 
@@ -13,7 +13,7 @@
13
13
  - ทีมพัฒนาและองค์กร (Engineering Teams & Tech Leads) ที่ต้องการมาตรฐานการส่งมอบโค้ดที่ตรวจสอบได้ (Traceable), ตรวจสอบย้อนหลังได้ (Auditable) และไม่มีปัญหาโค้ดตีกัน (Zero Merge Conflict)
14
14
  - **Core Value Proposition**:
15
15
  - **The 3-Pillars Model**: จัดระเบียบบริบทเป็น 3 เสาหลักอย่างชัดเจน — *🔮 Future (Inbox `ideas.md`)* ➔ *⚡ Present (Living Context `devflow/context/`)* ➔ *📦 Past (Categorized History `devflow/history/`)*
16
- - **Dual-Track Delivery Model**: เลือกความเร็วให้เหมาะกับขนาดงาน *Fast-Track (4 ขั้นตอน)* สำหรับ 85% ของงานประจำวัน และ *Deep-Track (8 ขั้นตอน)* สำหรับ 15% ของงานสถาปัตยกรรม
16
+ - **Single Living Spec Delivery Model**: งานทุกขนาดใช้วงจรเดียว `/feature` (หรือ `/fix`) `/implement` `/check` `/complete` โดยเพิ่มความลึกของสเปกและหลักฐานตามความซับซ้อนของงาน
17
17
  - **Hard Quality Gates**: ระบบปฏิเสธการปล่อยงานเมื่อไม่ผ่านเกณฑ์การทดสอบ หรือมีข้อบกพร่องความปลอดภัยค้างอยู่
18
18
 
19
19
  ---
@@ -27,7 +27,7 @@
27
27
  - Local State Management & Backup Snapshots (`.nexus/`)
28
28
  - **Key Modules & Subsystems**:
29
29
  - **Distribution CLI & Package**: `packages/create-nexus-devflow` (Scaffolding, Doctor, Status, Update, Gatekeeper)
30
- - **Interactive Web Dashboard**: Embedded Local Webview Dashboard (`/dashboard`) พร้อม Dual-Track Visualizer และ Real-time Snapshot
30
+ - **Interactive Web Dashboard**: Embedded Local Webview Dashboard (`/dashboard`) พร้อม Living Spec Visualizer และ Real-time Snapshot
31
31
  - **Gatekeeper Engine**: ระบบตรวจสอบคุณภาพโค้ดและ Finding Blockers (`nexus-devflow check-gate`)
32
32
  - **Model Context Protocol (MCP) Server**: JSON-RPC Hub สำหรับเชื่อมต่อ AI Agents แบบ Type-Safe
33
33
  - **Dynamic Context Slicer**: ระบบจัดสรรและตัดตอนบริบทแบบ Just-In-Time (JIT) เพื่อประหยัด Token
@@ -0,0 +1,65 @@
1
+ # Build Plan
2
+
3
+ > **Document Type**: Build Plan (User-Owned)
4
+ > **Purpose**: รายการฟีเจอร์ตามลำดับการพัฒนาจริง (Ordered Feature Roadmap Checklist)
5
+ > **Workflow**: ใช้เครื่องหมาย Checkbox `- [ ]` เรียงลำดับ 1, 2, 3... เพื่อให้ `/feature` ดึงไปทำทีละงาน
6
+
7
+ ---
8
+
9
+ ## 🚀 Phase 1: Core Foundation & Data Layer
10
+
11
+ - [ ] 1. **Core Schema & Data Models** - สร้าง Data Models, Schemas (Zod) และ Database Migrations เบื้องต้น
12
+ - [ ] 2. **Base Layout & Main UI Shell** - วางโครงสร้างหน้าจอหลัก, Navigation Shell และ Design Tokens
13
+ - [ ] 3. **Primary Feature Flow** - พัฒนาฟังก์ชันการทำงานหลัก พร้อม Input Form และ Validation
14
+
15
+ ---
16
+
17
+ ## ⚡ Phase 2: Interactivity & Core Capabilities
18
+
19
+ - [ ] 4. **Live Preview / Action Pipeline** - เชื่อมต่อ Input เข้าสู่ระบบประมวลผลและการแสดงผลแบบ Real-time
20
+ - [ ] 5. **Export / Output Engine** - พัฒนาระบบส่งออกข้อมูล เช่น Image Generation, PDF Download หรือ API Response
21
+ - [ ] 6. **Local Persistence & Settings** - บันทึกการตั้งค่าและประวัติการใช้งานลงใน Local Storage หรือ Database
22
+ - [ ] 6a. **Settings Panel** - UI สำหรับปรับแต่งค่าและการจัดเก็บ State
23
+ - [ ] 6b. **History & Recall** - แสดงรายการประวัติย้อนหลังและปุ่มเรียกข้อมูลกลับมาใช้
24
+
25
+ ---
26
+
27
+ ## 🚢 Phase 3: Polish, Quality & Production Hardening
28
+
29
+ - [ ] 7. **Edge Cases & Input Polish** - จัดการ Loading States, Error Boundaries และ Responsive Layout
30
+ - [ ] 8. **Deployment Readiness & Production Verification** - ตั้งค่า Environment Config, ตรวจสอบ Production Build และ Health Check
31
+
32
+ ---
33
+
34
+ ## 🛠️ Architecture & Deployment Notes (Optional)
35
+ <!--
36
+ บันทึกการตัดสินใจทางสถาปัตยกรรมที่ตกลงกันไว้ล่วงหน้า เพื่อป้องกันการสับสนระหว่างการ Implement
37
+ -->
38
+
39
+ - **Key Technical Decisions**:
40
+ - [เช่น ใช้ Full Puppeteer พร้อม Bundled Chromium แทน Serverless Chromium เพื่อความเสถียรของ Font]
41
+ - [เช่น จัดเก็บ User Session ผ่าน JWT ใน HttpOnly Cookies]
42
+ - **Environment & Hosting Constraints**:
43
+ - [เช่น ต้องการ Memory ขั้นต่ำ 1GB บน Render หรือ Docker Container]
44
+ - [เช่น กำหนด Concurrency Limits ไม่เกิน 2 worker processes ต่อ instance]
45
+
46
+ ---
47
+
48
+ ## 🔮 Later / Post-MVP Backlog (Not in v1)
49
+ <!--
50
+ ฟีเจอร์ที่วางแผนไว้สำหรับอนาคต (หลังจาก v1 ส่งมอบเรียบร้อยแล้ว)
51
+ -->
52
+
53
+ - [ ] **Cloud Sync & User Accounts** - ระบบสมัครสมาชิกและซิงค์ข้อมูลบน Cloud (Clerk / Supabase)
54
+ - [ ] **Batch Processing** - อัปโหลดไฟล์ CSV และประมวลผลพร้อมกันทีละหลายรายการ
55
+ - [ ] **Paid Subscription & Billing** - เชื่อมต่อ Stripe และจัดการ Tier จำกัดการใช้งาน
56
+
57
+ ---
58
+
59
+ <!--
60
+ 💡 คำแนะนำในการเขียน Build Plan ที่ดี:
61
+ 1. แต่ละข้อต้องเป็น "Feature-Sized Outcome" ที่มองเห็นผลลัพธ์ได้ (ไม่ใช่แค่ task ย่อยๆ เช่น "เขียน function x")
62
+ 2. ห้ามใส่ Scaffolding Chores (เช่น "สร้างโปรเจกต์ Next.js", "ติดตั้ง Tailwind") เพราะทำก่อนหน้าแล้ว
63
+ 3. ฟีเจอร์ที่มีความซับซ้อน สามารถแตกเป็น Sub-items ย่อยได้ เช่น 6a, 6b
64
+ 4. อย่าจัดกลุ่มฟีเจอร์หลายๆ อย่างรวมในข้อเดียว (เช่น "Auth + Database + Dashboard + Deploy")
65
+ -->
@@ -0,0 +1,110 @@
1
+ # [ID-slug] Feature Title
2
+
3
+ > **Template Type**: Single Living Spec (DevFlow 2.5.0)
4
+ > **Active Location**: `devflow/context/current-feature.md`
5
+ > **Archive Location**: `devflow/history/{features|fixes|rollbacks}/{ID-slug}.md`
6
+
7
+ - **Feature ID**: `{xxx-slug}`
8
+ - **Category**: `features` | `fixes` | `rollbacks`
9
+ - **Target Branch**: `feature/{xxx-slug}`
10
+ - **Status**: `Spec Ready` | `In-Progress` | `Verified` | `Completed`
11
+ - **Track**: `Unified Fast-Track`
12
+ - **Discovery Ref**: `devflow/discoveries/DISC-xxx.md` (Optional)
13
+ - **ADR Ref**: `devflow/decisions/ADR-xxx.md` (Optional)
14
+
15
+ ---
16
+
17
+ ## 🎯 1. Define & Boundaries
18
+
19
+ ### Problem Statement & Goal
20
+ - **Problem**: อธิบายปัญหาที่พบ หรือสิ่งที่ต้องการแก้ไข/ปรับปรุง
21
+ - **Goal**: ผลลัพธ์หรือเป้าหมายที่ต้องการให้เกิดขึ้น
22
+
23
+ ### In-Scope & Out-of-Scope
24
+ - **In-Scope**:
25
+ - สิ่งที่ต้องทำในรอบนี้
26
+ - **Out-of-Scope**:
27
+ - สิ่งที่ไม่ทำในรอบนี้ หรือยกยอดไปทำในเฟสถัดไป
28
+
29
+ ### Risk & Mitigation Matrix
30
+ | Risk | Severity | Mitigation |
31
+ | :--- | :--- | :--- |
32
+ | ความเสี่ยงที่อาจเกิดขึ้น | Low/Medium/High | แนวทางป้องกันหรือรับมือ |
33
+
34
+ ### Success Criteria
35
+ 1. เกณฑ์ชี้วัดความสำเร็จข้อที่ 1
36
+ 2. เกณฑ์ชี้วัดความสำเร็จข้อที่ 2
37
+
38
+ ---
39
+
40
+ ## 📐 2. Technical Spec & Contracts
41
+
42
+ ### Architecture & Component Design
43
+ - อธิบายโครงสร้างหรือ Flow การทำงานของ Component/Module
44
+
45
+ ### Data Models & Schemas
46
+ ```typescript
47
+ // Interface หรือ Type Definition
48
+ ```
49
+
50
+ ### API & Interface Contracts
51
+ - **Endpoint / Function**: `methodName(params: Type): ReturnType`
52
+ - **Error Handling**: รายละเอียด Error Codes และวิธีจัดการ
53
+
54
+ ### Non-Functional Constraints
55
+ - **Security**: การตรวจสอบ Input, การจัดการสิทธิ์, Secrets
56
+ - **Performance**: ข้อจำกัดเรื่องความเร็ว หรือ Resource Usage
57
+
58
+ ### Acceptance Criteria (AC)
59
+ - [ ] **AC-1**: เงื่อนไขการยอมรับข้อที่ 1
60
+ - [ ] **AC-2**: เงื่อนไขการยอมรับข้อที่ 2
61
+
62
+ ---
63
+
64
+ ## 📋 3. Execution Plan & TDD Checklist
65
+
66
+ - [ ] **Task 1: Core Foundation & Types**
67
+ - [ ] 1.1 `[TDD-Red]` เขียน Unit Test สำหรับ Logic ส่วนที่ 1
68
+ - [ ] 1.2 `[TDD-Green]` Implement Logic ให้ผ่าน Test
69
+ - [ ] 1.3 `[TDD-Refactor]` Clean up และ Optimize โค้ด
70
+
71
+ - [ ] **Task 2: Feature Implementation**
72
+ - [ ] 2.1 `[TDD-Red]` เขียน Test ครอบคลุม Edge Cases
73
+ - [ ] 2.2 `[TDD-Green]` Implement Feature ตาม Contract
74
+ - [ ] 2.3 `[TDD-Refactor]` ตรวจสอบความถูกต้องและ Architecture
75
+
76
+ - [ ] **Task 3: Integration & QA Verification**
77
+ - [ ] 3.1 `[TDD-Green]` เชื่อมต่อ UI/API และตรวจสอบ End-to-End
78
+
79
+ ---
80
+
81
+ ## ⚡ 4. Implementation Log & Evidence
82
+
83
+ *(จะถูกบันทึกและอัปเดตความคืบหน้าระหว่างรันคำสั่ง `/implement`)*
84
+
85
+ - **Step 1**: ...
86
+ - **Checkpoint Commit**: `feat(scope): ...`
87
+
88
+ ---
89
+
90
+ ## 🧪 5. Multi-Lane Verification Matrix
91
+
92
+ *(จะถูกบันทึกผลการตรวจสอบระหว่างรันคำสั่ง `/check`)*
93
+
94
+ | Lane | Command / Verification Target | Result | Notes / Proof |
95
+ | :--- | :--- | :--- | :--- |
96
+ | **Typecheck** | `npm run typecheck` | ⏳ PENDING | |
97
+ | **Lint** | `npm run lint` | ⏳ PENDING | |
98
+ | **Unit Tests** | `npm test` | ⏳ PENDING | |
99
+ | **Manual Proof** | UI / CLI Behavioral Verification | ⏳ PENDING | |
100
+
101
+ ---
102
+
103
+ ## 📦 6. Release Digest & Retrospective
104
+
105
+ *(จะถูกสรุปและบันทึกอัตโนมัติก่อนทำการ Squash Merge ในคำสั่ง `/complete`)*
106
+
107
+ - **What Changed**: สรุปสิ่งที่เปลี่ยนแปลง
108
+ - **Key Decisions**: การตัดสินใจสำคัญระหว่างพัฒนา
109
+ - **Lessons Learned**: บทเรียนที่ได้รับ
110
+ - **Known Limitations**: ข้อจำกัดที่ทราบและข้อเสนอแนะในอนาคต
@@ -0,0 +1,128 @@
1
+ # Project Plan
2
+
3
+ > **Document Type**: Project Plan (User-Owned)
4
+ > **Purpose**: แหล่งความจริงหลัก (Single Source of Truth) สำหรับวิสัยทัศน์ผลิตภัณฑ์ สถาปัตยกรรมระบบ ขอบเขตการทำงาน และข้อกำหนดทางเทคนิค
5
+ > **Workflow**: กรอกข้อมูลให้ครบถ้วนแล้วรัน `/overview` เพื่อประมวลผลเป็น `project-overview.md`
6
+
7
+ ---
8
+
9
+ ## 1. Problem - What problem are we solving?
10
+ <!--
11
+ อธิบายปัญหาที่ระบบนี้เข้ามาแก้ไข วัตถุประสงค์หลัก และทำไมโปรเจกต์นี้จึงควรมีอยู่ (2-4 ประโยค)
12
+ - ปัญหาในปัจจุบันคืออะไร ทำไมวิธีเดิมถึงไม่ตอบโจทย์
13
+ - ผลลัพธ์ที่ต้องการ (Desired Outcome) หลังระบบนี้สร้างเสร็จ
14
+ -->
15
+
16
+ - **Core Problem**: [ระบุปัญหาหลักที่ผู้ใช้กำลังเผชิญ เช่น การทำงานแบบ Manual ที่เสียเวลาและผิดพลาดง่าย]
17
+ - **Main Purpose**: [ระบุเป้าหมายหลักของระบบ เช่น แปลง Input 3 อย่างเป็นผลลัพธ์พร้อมใช้งานในไม่กี่วินาที]
18
+
19
+ ---
20
+
21
+ ## 2. Users - Who is this for?
22
+ <!--
23
+ กลุ่มผู้ใช้งานเป้าหมายและ Use Cases หลัก
24
+ - Primary Users: ผู้ใช้งานหลักกลุ่มแรก
25
+ - Secondary / Later: กลุ่มผู้ใช้ในอนาคต
26
+ - Access Tiers: สิทธิ์การเข้าถึง เช่น Guest / Registered / Admin
27
+ -->
28
+
29
+ - **Primary Audience**: [เช่น Solo Developers, Content Creators, นักเรียน/นักศึกษา]
30
+ - **Secondary Audience (Later)**: [เช่น ทีมงานองค์กร, ลูกค้าปลายทาง]
31
+ - **User Personas & Access Tiers**:
32
+ - `Anonymous / Guest`: [สิทธิ์การใช้งานทั่วไป เช่น ดูข้อมูลสาธารณะ, ทดลองเล่นแบบจำกัด]
33
+ - `Authenticated User`: [สิทธิ์การใช้งานหลัก เช่น จัดการข้อมูลตนเอง, บันทึกประวัติ]
34
+ - `Admin`: [สิทธิ์การจัดการระบบ เช่น ดูแลผู้ใช้, ตรวจสอบ Log]
35
+
36
+ ---
37
+
38
+ ## 3. Features - What does v1 need?
39
+ <!--
40
+ รายการฟีเจอร์ระดับสูงสำหรับเวอร์ชันแรก (MVP / v1)
41
+ - เขียนสรุปสั้นๆ บรรทัดละ 1 ข้อ ไม่ต้องลงรายละเอียดทางเทคนิคลึก
42
+ - แยกส่วน Out of Scope / Later ให้ชัดเจนเพื่อคุมขอบเขต (Prevent Scope Creep)
43
+ -->
44
+
45
+ ### Core MVP Features (v1):
46
+ - **Feature 1**: [คำอธิบายสั้นๆ เกี่ยวกับสิ่งที่ฟีเจอร์นี้ทำ]
47
+ - **Feature 2**: [คำอธิบายสั้นๆ เกี่ยวกับสิ่งที่ฟีเจอร์นี้ทำ]
48
+ - **Feature 3**: [คำอธิบายสั้นๆ เกี่ยวกับสิ่งที่ฟีเจอร์นี้ทำ]
49
+ - **Feature 4**: [คำอธิบายสั้นๆ เกี่ยวกับสิ่งที่ฟีเจอร์นี้ทำ]
50
+
51
+ ### Later / Post-MVP (Not in v1):
52
+ <!-- สิ่งที่เก็บไว้ทำในอนาคต แต่ยังไม่ทำในรอบแรก -->
53
+ - [เช่น ระบบสมัครสมาชิกและจัดการ Billing ผ่าน Stripe]
54
+ - [เช่น การส่งออกข้อมูลปริมาณมากแบบ Batch/CSV]
55
+ - [เช่น Cloud Sync และการแชร์ข้อมูลข้ามอุปกรณ์]
56
+
57
+ ---
58
+
59
+ ## 4. Data - What are we storing?
60
+ <!--
61
+ โครงสร้างข้อมูลและ Entity หลักที่ระบบต้องจัดเก็บ
62
+ - ข้อมูลที่อยู่ใน Code (Static / Config)
63
+ - ข้อมูลที่เก็บใน Browser (LocalStorage / Session / Cookies)
64
+ - ข้อมูลที่เก็บใน Database (Entities, Fields, Relationships)
65
+ -->
66
+
67
+ - **In-Code / Static**: [เช่น Template Definitions, App Constants, Fixed Options]
68
+ - **Client Storage (LocalStorage/Session)**: [เช่น User Preferences, Form Draft, UI Settings]
69
+ - **Database Entities (If applicable)**:
70
+ - **`User`**: `id` (String/UUID), `email` (String, Unique), `name` (String), `role` (Enum), `createdAt` (DateTime)
71
+ - **`Resource`**: `id` (UUID), `userId` (FK -> User.id), `title` (String), `status` (Enum), `metadata` (JSON), `updatedAt` (DateTime)
72
+ - **Relationships**:
73
+ - `User` 1-to-Many `Resource`
74
+
75
+ ---
76
+
77
+ ## 5. Tech - What stack are we using?
78
+ <!--
79
+ เทคโนโลยี ไลบรารี และเครื่องมือที่เลือกใช้ พร้อมระบุหน้าที่
80
+ -->
81
+
82
+ - **Framework & Runtime**: [เช่น Next.js 15 (App Router), TypeScript, Node.js >=20]
83
+ - **Styling & UI**: [เช่น Tailwind CSS v4, Shadcn UI / Radix Primitives, Lucide Icons]
84
+ - **State & Data Access**: [เช่น Zustand, TanStack Query, Prisma ORM / Drizzle]
85
+ - **Database**: [เช่น PostgreSQL on Neon / Supabase, SQLite on LibSQL]
86
+ - **Authentication**: [เช่น NextAuth.js (Auth.js), Clerk, Supabase Auth, หรือ None in v1]
87
+ - **Validation**: [เช่น Zod for Schema & Input Validation]
88
+ - **Special Engines / Libraries**: [เช่น Puppeteer for Headless PDF/Image Export, Sharp for Image Processing]
89
+
90
+ ---
91
+
92
+ ## 6. Monetize - How will this make money?
93
+ <!--
94
+ โมเดลทางธุรกิจหรือแผนการสร้างรายได้ (หากเป็น Free Tool หรือ Internal App ให้ระบุให้ชัด)
95
+ -->
96
+
97
+ - **Model in v1**: [เช่น Free / Open-Source / Internal Utility (ไม่มีการเก็บเงินใน v1)]
98
+ - **Future Monetization (If applicable)**: [เช่น Freemium, Subscription $10/mo, Usage-based API credits]
99
+
100
+ ---
101
+
102
+ ## 7. UI/UX - How should this look and feel?
103
+ <!--
104
+ ธีม โครงสร้างหน้าจอ สไตล์การออกแบบ และประสบการณ์ผู้ใช้
105
+ -->
106
+
107
+ - **Design Aesthetic**: [เช่น Clean & Modern, Dark-Mode First, Glassmorphism, Minimalist]
108
+ - **Layout Structure**: [เช่น Single-page dashboard with Split View (Form on left, Live Preview on right)]
109
+ - **Key Routes / Screens**:
110
+ - `/`: [หน้า Landing & Main Generator Workflow]
111
+ - `/dashboard`: [หน้าจัดการ Resource และดูประวัติย้อนหลัง]
112
+ - `/settings`: [หน้าตั้งค่า Profile และ Preferences]
113
+
114
+ ---
115
+
116
+ ## 8. Deployment - Where and how will this ship?
117
+ <!--
118
+ เป้าหมายการ Deploy, คำสั่ง Build/Start, และ Environment Variables
119
+ -->
120
+
121
+ - **Target Platform**: [เช่น Vercel, Render, Cloudflare Pages, Fly.io, Self-hosted Docker]
122
+ - **Build Command**: `npm run build`
123
+ - **Start Command / Output**: `npm run start` (หรือ Static Output `out/`)
124
+ - **Required Environment Variables**:
125
+ - `DATABASE_URL`: Connection string สำหรับ Database
126
+ - `NEXTAUTH_SECRET`: Secret key สำหรับ Session signing
127
+ - `API_KEY`: Key สำหรับเชื่อมต่อ Third-party Service
128
+ - **Health Check Endpoint**: `/api/health`
@@ -1,4 +1,4 @@
1
- # DevFlow 2.0 Running ID & 3-Pillars Workspace Contract
1
+ # DevFlow 2.5.0 Running ID & 3-Pillars Workspace Contract
2
2
 
3
3
  ## The 3-Pillars Workspace Architecture
4
4
 
@@ -11,19 +11,20 @@ devflow/
11
11
  ├── ⚡ context/ # [2. Present / Active] Living Source of Truth & Active Work
12
12
  │ ├── project-overview.md # Primary source of truth for project architecture and tech stack
13
13
  │ ├── coding-standards.md # Engineering, code quality, TDD, and testing standards
14
- │ ├── ai-interaction.md # AI agent interaction rules, dual-track flow, and Thai defaults
14
+ │ ├── ai-interaction.md # AI agent interaction rules, unified living spec flow, and Thai defaults
15
15
  │ ├── findings.md # Open and resolved audit findings ledger (P0-P3)
16
+ │ ├── glossary.md # Domain glossary and architecture vocabulary
16
17
  │ ├── current-stage.md # Active state pointer and run tracker
17
- ├── current-feature.md # Fast-Track Single Living Spec (Active work / stub when idle)
18
- │ └── current-run/ # Deep-Track Active Run folder (Temporary during 10-70 execution)
18
+ └── current-feature.md # Single Living Spec (Active work / stub when idle)
19
19
 
20
20
  ├── 📦 history/ # [3. Past / Completed] Permanent Delivery & Release Archives
21
- │ ├── features/ # Completed features, architecture migrations, tooling (xxx-slug.md or xxx-slug/)
21
+ │ ├── features/ # Completed features, architecture migrations, tooling (xxx-slug.md)
22
22
  │ ├── fixes/ # Completed bug fixes, hotfixes, security patches (xxx-slug.md)
23
23
  │ ├── rollbacks/ # Completed feature reversals (YYYY-MM-DD-xxx-slug.md)
24
24
  │ └── HISTORY.md # Master release ledger summary table
25
25
 
26
- └── 🔍 discoveries/ # Pre-delivery discovery records (DISC-YYYYMMDD-NNN-slug/00-explore.md)
26
+ ├── 🔍 discoveries/ # Pre-delivery discovery records (DISC-YYYYMMDD-NNN-slug/discovery.md)
27
+ └── 🏛️ decisions/ # Architecture Decision Records (ADR-xxx-slug.md)
27
28
  ```
28
29
 
29
30
  ---
@@ -31,9 +32,9 @@ devflow/
31
32
  ## Running ID Naming Convention
32
33
 
33
34
  ### 1. Standard Running IDs
34
- - **Format**: `xxx-slug` (e.g. `001-setup-auth`, `021-categorized-history-and-clean-living-spec-architecture`)
35
+ - **Format**: `xxx-slug` (e.g. `001-setup-auth`, `053-unify-deep-and-fast-track-model`)
35
36
  - **Prefix Removal**: The legacy `RUN-` prefix is discontinued in favor of clean 3-digit sequential numbering.
36
- - **Git Branch Standard**: `feature/{xxx-slug}` or `fix/{xxx-slug}`.
37
+ - **Git Branch Standard**: `feature/{xxx-slug}` or `fix/{xxx-slug}` (or specific release branches such as `2.5.0`).
37
38
 
38
39
  ### 2. Sub-Feature Running IDs (`xxx[a-z]-slug`)
39
40
  - **Format**: `xxx[a-z]-slug` (e.g. `038a-backend-schema-and-api`, `038b-frontend-ui-and-state`)
@@ -56,6 +57,6 @@ When detected during `/feature` or `/brief`, the AI triggers the **Interactive S
56
57
 
57
58
  ## Single Active Run Rule (One Thing at a Time)
58
59
 
59
- 1. Only **one active run** is permitted at any given time across both Fast-Track and Deep-Track.
60
- 2. Before opening a new run (`/feature`, `/fix`, or `10-define`), the AI checks `current-stage.md` and `current-feature.md`.
61
- 3. If an active run is in progress, the AI **blocks** starting a new task and requires closing the active run via `/complete` or `70-deliver` (or explicitly cancelling/rolling back).
60
+ 1. Only **one active run** is permitted at any given time in `current-feature.md`.
61
+ 2. Before opening a new run (`/feature` or `/fix`), the AI checks `current-stage.md` and `current-feature.md`.
62
+ 3. If an active run is in progress, the AI **blocks** starting a new task and requires closing the active run via `/complete` (or explicitly cancelling/rolling back).
@@ -1,54 +0,0 @@
1
- ---
2
- name: 10-define
3
- description: "[devflow][D] Define stage in DevFlow 2.0 - turn an approved discovery into a bounded delivery run in context/current-run with stable scope."
4
- argument-hint: "{approved discovery-id, discovery path, running-id, or run path}"
5
- ---
6
-
7
- # Phase 10: Define
8
-
9
- $ARGUMENTS
10
-
11
- Convert an approved `Proceed` discovery into a bounded delivery run. Checks the Single Active Run Guardrail, allocates a sequential ID without prefix (`xxx-slug`), and writes `devflow/context/current-run/10-define.md`.
12
-
13
- ## Usage
14
-
15
- ```text
16
- 10-define {discovery-id or discovery path}
17
- 10-define {id or run path}
18
- ```
19
-
20
- ## Markdown-First Contract
21
-
22
- For the active delivery run, write:
23
-
24
- ```text
25
- devflow/context/current-run/10-define.md
26
- ```
27
-
28
- using:
29
-
30
- ```text
31
- .agent/resources/schemas/define.template.md
32
- ```
33
-
34
- ## Process & Quality Gates
35
-
36
- ### 1. Single Active Run Guardrail (One Thing at a Time)
37
- 1. Inspect `devflow/context/current-stage.md`, `devflow/context/current-feature.md`, and `devflow/context/current-run/`.
38
- 2. If an active uncompleted run exists:
39
- - **HALT and reject opening a new define stage**.
40
- - Warn the user to complete or close the active run with `/complete` or `70-deliver` first.
41
-
42
- ### 2. Validate The Discovery Gate
43
- Require:
44
- - `Decision: Proceed`
45
- - `Approval Status: Approved`
46
- - A resolvable Discovery ID and `discovery.md` (or legacy `00-explore.md`)
47
-
48
- ### 3. Allocate Sequential ID
49
- - Inspect `devflow/history/HISTORY.md` and allocate sequential ID without prefix (e.g. `022-{slug}`).
50
- - Create directory `devflow/context/current-run/` if it does not exist.
51
- - Write `devflow/context/current-run/10-define.md`.
52
- - Update `devflow/context/current-stage.md`:
53
- - `Active Running ID`: `{ID}`
54
- - `Current Stage`: `10-define (Completed -> Ready for 20-spec)`