@warnyin/agents 0.1.0 → 0.4.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 (87) hide show
  1. package/.claude/agents/warnyin-infra.md +13 -0
  2. package/.claude/agents/warnyin-qa.md +13 -0
  3. package/.claude/agents/warnyin-sa.md +13 -0
  4. package/.claude/agents/warnyin-security.md +13 -0
  5. package/.claude/agents/warnyin-tech-lead.md +13 -0
  6. package/.claude/commands/warnyin/build.md +9 -9
  7. package/.claude/commands/warnyin/design.md +5 -4
  8. package/.claude/commands/warnyin/discovery.md +3 -3
  9. package/.claude/commands/warnyin/init.md +1 -1
  10. package/.claude/commands/warnyin/install-skill.md +14 -0
  11. package/.claude/commands/warnyin/ship.md +5 -5
  12. package/.claude/commands/warnyin/update-codemaps.md +12 -0
  13. package/.claude/commands/warnyin/verify.md +5 -5
  14. package/AGENTS.md +12 -12
  15. package/CLAUDE.md +16 -13
  16. package/README.md +121 -0
  17. package/bin/cli.mjs +51 -9
  18. package/package.json +5 -7
  19. package/{installer → warnyin/installer}/templates/CLAUDE.md +13 -11
  20. package/warnyin/template/docs/codemap/index.md +18 -0
  21. package/warnyin/template/docs/features/[feature-name]/business.md +5 -0
  22. package/warnyin/template/docs/features/[feature-name]/feature.md +5 -0
  23. package/warnyin/template/docs/infra.md +16 -0
  24. package/warnyin/template/docs/project.md +18 -0
  25. package/warnyin/template/docs/rule.md +7 -0
  26. package/warnyin/template/docs/techstack/[component]/about.md +6 -0
  27. package/warnyin/template/docs/techstack/[component]/rule.md +6 -0
  28. package/warnyin/template/docs/techstack/[component]/standard.md +6 -0
  29. package/warnyin/template/docs/techstack/[component]/structure.md +7 -0
  30. package/warnyin/template/docs/techstack/[component]/test.md +7 -0
  31. package/{docs → warnyin/template/docs}/troubleshooting.md +32 -39
  32. package/{warnyin-stages → warnyin/template/stages}/[topic]/build.md +2 -2
  33. package/{warnyin-stages → warnyin/template/stages}/[topic]/business.md +1 -1
  34. package/{warnyin-stages → warnyin/template/stages}/[topic]/design.md +1 -1
  35. package/{warnyin-stages → warnyin/template/stages}/[topic]/discovery.md +2 -2
  36. package/{warnyin-stages → warnyin/template/stages}/[topic]/proposal.md +1 -1
  37. package/{warnyin-stages → warnyin/template/stages}/[topic]/research.md +1 -1
  38. package/{warnyin-stages → warnyin/template/stages}/[topic]/ship.md +3 -3
  39. package/{warnyin-stages → warnyin/template/stages}/[topic]/tasks/[task-name]/issue.md +1 -1
  40. package/{warnyin-stages → warnyin/template/stages}/[topic]/tasks/[task-name]/rule.md +1 -1
  41. package/{warnyin-stages → warnyin/template/stages}/[topic]/tasks/[task-name]/spec.md +1 -1
  42. package/{warnyin-stages → warnyin/template/stages}/[topic]/tasks/[task-name]/standard.md +1 -1
  43. package/{warnyin-stages → warnyin/template/stages}/[topic]/tasks/[task-name]/task.md +1 -1
  44. package/{warnyin-stages → warnyin/template/stages}/[topic]/test.md +1 -1
  45. package/{warnyin-stages → warnyin/template/stages}/[topic]/verify.md +2 -2
  46. package/warnyin/workflow/README.md +92 -0
  47. package/warnyin/workflow/codemap.md +91 -0
  48. package/{workflow → warnyin/workflow}/init.md +3 -1
  49. package/warnyin/workflow/roles/README.md +46 -0
  50. package/warnyin/workflow/roles/ba.md +25 -0
  51. package/warnyin/workflow/roles/developer.md +28 -0
  52. package/warnyin/workflow/roles/infra.md +24 -0
  53. package/warnyin/workflow/roles/po.md +28 -0
  54. package/warnyin/workflow/roles/qa.md +33 -0
  55. package/warnyin/workflow/roles/sa.md +28 -0
  56. package/warnyin/workflow/roles/security.md +29 -0
  57. package/warnyin/workflow/roles/tech-lead.md +28 -0
  58. package/{workflow → warnyin/workflow}/scripts/build-wave.mjs +5 -4
  59. package/{workflow → warnyin/workflow}/stages/build.md +10 -9
  60. package/{workflow → warnyin/workflow}/stages/design.md +28 -19
  61. package/{workflow → warnyin/workflow}/stages/discovery.md +7 -6
  62. package/{workflow → warnyin/workflow}/stages/ship.md +8 -8
  63. package/{workflow → warnyin/workflow}/stages/verify.md +5 -4
  64. package/docs/features/[feature-name]/business.md +0 -0
  65. package/docs/features/[feature-name]/feature.md +0 -0
  66. package/docs/infra.md +0 -0
  67. package/docs/project.md +0 -0
  68. package/docs/rule.md +0 -0
  69. package/docs/techstack/admin-console/about.md +0 -0
  70. package/docs/techstack/admin-console/rule.md +0 -0
  71. package/docs/techstack/admin-console/standard.md +0 -0
  72. package/docs/techstack/admin-console/structure.md +0 -0
  73. package/docs/techstack/admin-console/test.md +0 -0
  74. package/docs/techstack/api-service/about.md +0 -0
  75. package/docs/techstack/api-service/rule.md +0 -0
  76. package/docs/techstack/api-service/standard.md +0 -0
  77. package/docs/techstack/api-service/structure.md +0 -0
  78. package/docs/techstack/api-service/test.md +0 -0
  79. package/warnyin-stages/achieved/[YYYY-MM-DD-topic]/business.md +0 -0
  80. package/warnyin-stages/achieved/[YYYY-MM-DD-topic]/design.md +0 -0
  81. package/warnyin-stages/achieved/[YYYY-MM-DD-topic]/discovery.md +0 -0
  82. package/warnyin-stages/achieved/[YYYY-MM-DD-topic]/proposal.md +0 -0
  83. package/warnyin-stages/achieved/[YYYY-MM-DD-topic]/research.md +0 -0
  84. package/workflow/README.md +0 -90
  85. /package/{docs/codemap/index.md → warnyin/stages/achieved/.gitkeep} +0 -0
  86. /package/{warnyin-stages → warnyin/stages}/context.md +0 -0
  87. /package/{warnyin-stages → warnyin/template/stages}/[topic]/troubleshooting.md +0 -0
@@ -0,0 +1,92 @@
1
+ # Warnyin Standard Workflow
2
+
3
+ มาตรฐานกลางของ "วิธีทำงาน" (ways of work) สำหรับทุกโปรเจกต์ — สร้างทีม ผลิตผลงานคุณภาพ และเร็ว
4
+ โดยเดินผ่าน 5 stage:
5
+
6
+ ```
7
+ Discovery (optional) ──▶ DESIGN ──▶ BUILD ──▶ VERIFY ──▶ SHIP
8
+ ```
9
+
10
+ แต่ละ stage มี **playbook กลางหนึ่งชุด** เป็น single source of truth ที่ AI ทุกเจ้าอ่านเหมือนกัน
11
+
12
+ ---
13
+
14
+ ## หลักการออกแบบ: Tool-agnostic, single source of truth
15
+
16
+ แก่นของ workflow (กฎ / ขั้นตอน / เกณฑ์ผ่าน) เขียน **ครั้งเดียว** เป็น markdown ใน `warnyin/workflow/stages/`
17
+ ส่วน AI แต่ละเครื่องมีแค่ **adapter บางๆ** ที่ "ชี้กลับ" มาที่ playbook กลางชุดเดียวกัน
18
+
19
+ | AI tool | Adapter (จุดเชื่อม) | อ่าน playbook จาก |
20
+ |---|---|---|
21
+ | **Claude Code** | `.claude/commands/*.md` + `CLAUDE.md` | `warnyin/workflow/stages/*.md` |
22
+ | **Codex** | `AGENTS.md` | `warnyin/workflow/stages/*.md` |
23
+ | **Antigravity** | `AGENTS.md` | `warnyin/workflow/stages/*.md` |
24
+ | เครื่องอื่นๆ | ชี้มาที่ `warnyin/workflow/stages/` ได้ทันที | `warnyin/workflow/stages/*.md` |
25
+
26
+ > แก้กฎที่ `warnyin/workflow/stages/` ที่เดียว → ทุกเครื่องได้เหมือนกันทันที
27
+ > เพิ่ม AI เจ้าใหม่ = เพิ่ม adapter บางๆ อีกหนึ่งไฟล์ ไม่ต้องแตะ logic
28
+
29
+ ---
30
+
31
+ ## โครงสร้าง repo
32
+
33
+ ```
34
+ bin/cli.mjs # npx installer — ติดตั้ง workflow ลงโปรเจกต์อื่น
35
+
36
+ warnyin/ # ★ ทุกอย่างของ workflow รวมใต้โฟลเดอร์เดียว
37
+ installer/templates/ # template CLAUDE.md สำหรับโปรเจกต์ปลายทาง (installer ใช้เอง — ไม่ถูก copy ไป target)
38
+ workflow/ # playbook กลาง — single source of truth
39
+ README.md # ไฟล์นี้ — ภาพรวม + วิธีรองรับหลาย AI
40
+ init.md # playbook: INIT — วิเคราะห์โปรเจกต์ + เติม docs/ ครั้งแรก
41
+ codemap.md # playbook: CODEMAP — สแกน + สร้าง codemap แบบ token-lean
42
+ roles/ # role card กลาง: ba, po, sa, tech-lead, developer, qa, security, infra
43
+ stages/ # discovery ✅ · design ✅ · build ✅ · verify ✅ · ship ✅
44
+ scripts/
45
+ build-wave.mjs # Workflow script: fan-out sub-agent ต่อ task ใน wave (worktree)
46
+ template/ # ★ template ทั้งหมดรวมที่เดียว
47
+ stages/[topic]/ # หนึ่งหน่วยงาน — copy เป็น warnyin/stages/<slug>
48
+ discovery.md research.md # output ของ Discovery
49
+ business.md proposal.md design.md # output ของ DESIGN
50
+ tasks/[task-name]/... build.md # output ของ DESIGN (tasks) + BUILD
51
+ test.md verify.md # output ของ VERIFY
52
+ troubleshooting.md ship.md # KB ระหว่างงาน + สรุปส่งมอบของ SHIP
53
+ docs/ # โครง docs — installer seed เข้า docs/ ตอนติดตั้ง
54
+ project.md rule.md infra.md troubleshooting.md codemap/index.md
55
+ techstack/[component]/ # copy เป็น docs/techstack/<component> (โดย /warnyin:init)
56
+ features/[feature-name]/ # copy เป็น docs/features/<feature-name> (โดย SHIP)
57
+ stages/ # พื้นที่ทำงานจริง ตาม topic
58
+ context.md
59
+ achieved/ # archive หลัง SHIP (<YYYY-MM-DD>-<slug>/)
60
+
61
+ docs/ # ความรู้ถาวรระดับโปรเจกต์ — ของจริงล้วน (seed จาก warnyin/template/docs)
62
+ project.md # ★ จุดเริ่มของ Discovery — อ่านก่อนเสมอ
63
+ rule.md infra.md
64
+ troubleshooting.md # ★ KB ปัญหา-วิธีแก้ (อ่านก่อนเมื่อ build เจอ error; SHIP ป้อนเข้า)
65
+ codemap/ features/ techstack/
66
+ ```
67
+
68
+ ---
69
+
70
+ ## การติดตั้งไปโปรเจกต์อื่น
71
+
72
+ ```bash
73
+ cd my-project
74
+ npx @warnyin/agents # ติดตั้ง (ข้ามไฟล์ที่มีอยู่ ไม่เขียนทับ)
75
+ npx @warnyin/agents --update # อัปเดต playbook กลางเป็นเวอร์ชันล่าสุด
76
+ npx @warnyin/agents --dry-run # ดูก่อนว่าจะสร้าง/อัปเดตอะไร
77
+ # ทางสำรอง (ไม่ผ่าน npm): npx github:warnyin/warnyin-agents
78
+ ```
79
+
80
+ - โปรเจกต์ที่มี `CLAUDE.md`/`AGENTS.md` อยู่แล้ว → installer ต่อท้ายเป็น section ไม่เขียนทับ
81
+ - `--update` เขียนทับเฉพาะ core (`warnyin/workflow/`, `.claude/commands/warnyin/`, template ใน `warnyin/template/`) — ไม่แตะ `docs/` และงานจริง
82
+ - หลังติดตั้ง → เปิด Claude Code แล้วรัน `/warnyin:init` ให้ agent วิเคราะห์โปรเจกต์ + เติม `docs/` (playbook: `warnyin/workflow/init.md`)
83
+
84
+ ## วิธีใช้
85
+
86
+ 1. เริ่มงานใหม่ → copy `warnyin/template/stages/[topic]/` เป็น `warnyin/stages/<ชื่อ-งาน-kebab-case>/`
87
+ 2. รัน stage ตามลำดับ (Discovery ข้ามได้ถ้าเข้าใจ scope ชัดแล้ว)
88
+ - Claude Code: `/warnyin:discovery <topic>`, `/warnyin:design <slug> <change>`
89
+ - Codex / Antigravity: บอกให้ทำตาม `warnyin/workflow/stages/<stage>.md`
90
+ 3. ผ่าน "gate" ของแต่ละ stage แล้วจึงไป stage ถัดไป
91
+ 4. เมื่อ SHIP (`/warnyin:ship <slug>`) → promote ความรู้ของ topic ขึ้นเอกสารกลางใน `docs/`
92
+ แล้วย้าย topic ไป `warnyin/stages/achieved/<YYYY-MM-DD>-<topic>/`
@@ -0,0 +1,91 @@
1
+ # CODEMAP — สแกนโครงสร้างโปรเจกต์ + สร้าง architecture codemap แบบ token-lean
2
+
3
+ > **Playbook กลาง — AI ทุกเจ้าทำตามไฟล์นี้ชุดเดียวกัน** (Claude Code / Codex / Antigravity / อื่นๆ)
4
+ > เป้าหมาย: `docs/codemap/` ที่ **ประหยัด token** สำหรับให้ AI โหลดเข้า context — โครงสร้างระดับสูง ไม่ใช่ implementation detail
5
+
6
+ ---
7
+
8
+ ## 1. ใช้เมื่อไหร่
9
+
10
+ - หลังเพิ่ม feature ใหญ่ / refactor ครั้งสำคัญ
11
+ - `/warnyin:init` ใช้ playbook นี้ตอนสร้าง codemap ครั้งแรก
12
+ - **SHIP** ใช้ตอนขั้น "อัปเดต code map ทั้งหมด"
13
+
14
+ ---
15
+
16
+ ## 2. ขั้นตอน
17
+
18
+ ### Step 1: สแกนโครงสร้างโปรเจกต์
19
+ - ระบุชนิดโปรเจกต์: monorepo / single app / library / microservice
20
+ - หา source directory ทั้งหมด (`src/`, `lib/`, `app/`, `packages/`, ...)
21
+ - map entry points (`main.ts`, `index.ts`, `app.py`, `main.go`, ...)
22
+ - สแกนขนานได้: fan-out sub-agent (read-only) ต่อ component/พื้นที่ — เครื่องที่ไม่มี sub-agent → ไล่ทีละส่วน
23
+
24
+ ### Step 2: สร้าง/อัปเดต codemap ใน `docs/codemap/`
25
+
26
+ | ไฟล์ | เนื้อหา |
27
+ |---|---|
28
+ | `index.md` | สารบัญทั้งชุด + ภาพรวม component + จุดเข้า |
29
+ | `architecture.md` | system diagram ระดับสูง, service boundary, data flow |
30
+ | `backend.md` | API routes, middleware chain, service → repository mapping |
31
+ | `frontend.md` | page tree, component hierarchy, state management flow |
32
+ | `data.md` | ตาราง DB, relationship, migration history |
33
+ | `dependencies.md` | external service, third-party integration, shared library |
34
+
35
+ **สร้างเฉพาะไฟล์ที่ relevant** — โปรเจกต์ไม่มี frontend → ไม่ต้องมี `frontend.md`
36
+
37
+ #### รูปแบบ codemap (token-lean)
38
+
39
+ ```markdown
40
+ # Backend Architecture
41
+
42
+ ## Routes
43
+ POST /api/users → UserController.create → UserService.create → UserRepo.insert
44
+ GET /api/users/:id → UserController.get → UserService.findById → UserRepo.findById
45
+
46
+ ## Key Files
47
+ src/services/user.ts (business logic, 120 lines)
48
+ src/repos/user.ts (database access, 80 lines)
49
+
50
+ ## Dependencies
51
+ - PostgreSQL (primary data store)
52
+ - Redis (session cache, rate limiting)
53
+ - Stripe (payment processing)
54
+ ```
55
+
56
+ ### Step 3: Diff detection
57
+ - มี codemap เดิมอยู่ → คำนวณ % การเปลี่ยนแปลง
58
+ - เปลี่ยน **> 30%** → แสดง diff + **ขอ user อนุมัติก่อนเขียนทับ**
59
+ - เปลี่ยน **≤ 30%** → อัปเดต in place ได้เลย
60
+
61
+ ### Step 4: Metadata
62
+ ใส่ freshness header บนสุดของทุกไฟล์:
63
+ ```html
64
+ <!-- Generated: YYYY-MM-DD | Files scanned: N | Token estimate: ~X -->
65
+ ```
66
+
67
+ ### Step 5: Analysis report → `.reports/codemap-diff.txt`
68
+ - ไฟล์ added / removed / modified ตั้งแต่สแกนครั้งล่าสุด
69
+ - dependency ใหม่ที่ตรวจพบ
70
+ - architecture changes (route ใหม่, service ใหม่ ฯลฯ)
71
+ - คำเตือน staleness: doc ที่ไม่ถูกอัปเดต 90+ วัน
72
+
73
+ ---
74
+
75
+ ## 3. หลักการ (tips)
76
+
77
+ - โฟกัสโครงสร้างระดับสูง — **ไม่ใช่** implementation detail
78
+ - ใช้ file path + function signature แทน code block เต็ม
79
+ - แต่ละ codemap **< 1000 tokens** เพื่อโหลดเข้า context ได้ถูก
80
+ - ใช้ ASCII diagram แทนคำบรรยาย data flow ยืดยาว
81
+ - **ทุกอย่างต้องมาจากโค้ดจริง ณ วันสแกน — ห้ามเดา/ห้ามเขียนจากความจำ**
82
+
83
+ ---
84
+
85
+ ## 4. Gate — จบเมื่อ
86
+
87
+ - [ ] codemap ทุกไฟล์ตรงโค้ดจริง + มี freshness header
88
+ - [ ] `index.md` ลิงก์ครบทุกไฟล์ codemap ที่มี
89
+ - [ ] ทุกไฟล์ token-lean (< 1000 tokens)
90
+ - [ ] diff > 30% ผ่านการอนุมัติจาก user แล้ว
91
+ - [ ] `.reports/codemap-diff.txt` เขียนแล้ว
@@ -36,6 +36,8 @@
36
36
 
37
37
  ## 4. Output (เขียน/เติมที่ `docs/`)
38
38
 
39
+ > โฟลเดอร์ component จริงให้ copy จาก template `warnyin/template/docs/techstack/[component]/` เป็นชื่อจริง (เช่น `api-service/`) — ห้ามทิ้งโฟลเดอร์ `[component]` ว่างไว้เฉยๆ โดยไม่สร้างของจริง
40
+
39
41
  | ไฟล์ | เนื้อหา | แหล่งข้อมูล |
40
42
  |---|---|---|
41
43
  | `docs/project.md` | โปรเจกต์คืออะไร เป้าหมาย ลูกค้า ขอบเขต | สัมภาษณ์ user (+ README เดิมเป็น recommended) |
@@ -44,7 +46,7 @@
44
46
  | `docs/techstack/<component>/standard.md` | pattern/convention ที่พบจริงในโค้ด (ยืนยันกับ user) | โค้ดจริง + user |
45
47
  | `docs/techstack/<component>/rule.md` | กฎที่ user ต้องการบังคับ (ถามก่อน ห้ามเดา) | user |
46
48
  | `docs/techstack/<component>/test.md` | วิธีเทสที่ใช้อยู่ (framework, คำสั่ง, e2e) | โค้ด/config จริง |
47
- | `docs/codemap/index.md` | แผนที่โค้ดภาพรวม: component, จุดเข้า, โฟลเดอร์สำคัญ | โค้ดจริง |
49
+ | `docs/codemap/` | แผนที่โค้ดทั้งชุด สร้างตาม playbook `warnyin/workflow/codemap.md` (token-lean) | โค้ดจริง |
48
50
  | `docs/infra.md` | local env: service ที่ต้องรัน, วิธีรัน, env vars | config จริง |
49
51
  | `docs/rule.md`, `docs/troubleshooting.md` | วางโครงหัวข้อ รอเติมระหว่างใช้งานจริง | — |
50
52
 
@@ -0,0 +1,46 @@
1
+ # Roles — role card กลางของ workflow
2
+
3
+ > **แก่นกลาง tool-agnostic** — role card แต่ละใบคือ "วิธีคิด + checklist" ของหนึ่งบทบาท
4
+ > AI ทุกเจ้าใช้ไฟล์ชุดเดียวกัน: เป็น **lens** ของ AI หลัก หรือเป็น **system prompt** ของ sub-agent
5
+
6
+ ## หลักการ
7
+
8
+ - **lens** = AI หลักอ่าน role card แล้วใช้มุมมอง/checklist นั้นทำงานเอง (role ที่ต้องคุยกับ user เป็น lens เสมอ — sub-agent คุยกับ user ไม่ได้)
9
+ - **sub-agent (reviewer)** = fan-out ตัวแทน role ไปวิเคราะห์/รีวิวแบบอิสระขนานกัน (read-only) — ได้หลายมุมพร้อมกันโดยไม่ bias
10
+ - Claude Code มี adapter ที่ `.claude/agents/warnyin-<role>.md`; เครื่องอื่นใช้ role card เป็น prompt ตรงๆ ได้
11
+
12
+ ## ตาราง role ↔ stage
13
+
14
+ | Role | ไฟล์ | ใช้ใน stage | รูปแบบ |
15
+ |---|---|---|---|
16
+ | BA (Business Analyst) | `ba.md` | Discovery | lens ตอนสัมภาษณ์/ตี scope |
17
+ | PO (Product Owner) | `po.md` | Discovery | lens ตอนจัด priority/ตัด scope |
18
+ | SA (Solution Architect) | `sa.md` | DESIGN | lens ตอนออกแบบ + reviewer ใน panel |
19
+ | Tech Lead | `tech-lead.md` | DESIGN | lens ตอนแตก task + reviewer ใน panel |
20
+ | Developer | `developer.md` | BUILD | system prompt ของ build agent ทุกตัว |
21
+ | QA | `qa.md` | VERIFY + DESIGN panel | lens ของ strategy tester + reviewer |
22
+ | Security (DevSecOps) | `security.md` | DESIGN panel | reviewer |
23
+ | Infra | `infra.md` | DESIGN panel | reviewer |
24
+
25
+ ## โครงของ role card ทุกใบ
26
+
27
+ 1. **Mission** — บทบาทนี้มีไว้ทำอะไร
28
+ 2. **Lens** — มองงานผ่านมุมไหน
29
+ 3. **Checklist** — สิ่งที่ต้องไล่เช็คทุกครั้ง
30
+ 4. **Output** — ต้องส่งมอบอะไร รูปแบบไหน
31
+
32
+ > เพิ่ม role ใหม่ = เพิ่มไฟล์ที่นี่ + adapter `.claude/agents/warnyin-<role>.md` (ถ้าใช้เป็น sub-agent) + ระบุจุดใช้ใน playbook
33
+
34
+ ## Skill เสริมต่อ role (optional)
35
+
36
+ แต่ละ role card มี section "Skill เสริม" — แนวทางคือ **reference ไม่ vendor**: โปรเจกต์ไหนอยากใช้ค่อยติดตั้งเอง
37
+
38
+ | Role | Skill | ที่มา |
39
+ |---|---|---|
40
+ | SA | `architect-review` | `npx skills add sickn33/antigravity-awesome-skills@architect-review -g` |
41
+ | PO | `product-management` | `npx skills add vasilyu1983/ai-agents-public@product-management -g` |
42
+ | Developer | `tdd-orchestrator` | `npx skills add sickn33/antigravity-awesome-skills@tdd-orchestrator -g` |
43
+ | QA | `browser-test` | `npx skills add ruvnet/ruflo@browser-test -g` |
44
+ | Tech Lead | `/code-review` | Claude Code built-in |
45
+ | Security | `/security-review` | Claude Code built-in |
46
+ | BA, Infra | — | ยังไม่มี skill ภายนอกที่ผ่านเกณฑ์คุณภาพ (ใช้ role card พอ) |
@@ -0,0 +1,25 @@
1
+ # Role: BA (Business Analyst)
2
+
3
+ > ใช้ใน: **Discovery** — เป็น lens ของ AI หลักตอนสัมภาษณ์/ตี scope (ไม่ใช่ sub-agent เพราะต้องคุยกับ user)
4
+
5
+ ## Mission
6
+ เปลี่ยนความต้องการที่คลุมเครือให้เป็น requirement ที่ชัด ตรวจสอบได้ และสะท้อน business process จริง
7
+
8
+ ## Lens
9
+ - business process จริง: ผู้ใช้/ระบบทำอะไร ก่อน-หลัง อย่างไร (as-is → to-be)
10
+ - ข้อมูลที่ไหลในกระบวนการ: มาจากไหน ใครแก้ ไปไหนต่อ
11
+ - ข้อยกเว้นและ edge case ของ process — จุดที่ requirement มักพัง
12
+ - ผู้เกี่ยวข้องทุกฝ่าย ไม่ใช่แค่ผู้ใช้หลัก
13
+
14
+ ## Checklist (ใช้ตั้งคำถามสัมภาษณ์ — ทีละข้อ + recommended answer)
15
+ - [ ] ปัญหาจริงคืออะไร ใครเจ็บ เจ็บตอนไหน บ่อยแค่ไหน
16
+ - [ ] as-is ทำงานยังไงวันนี้ (ถ้าโค้ด/เอกสารตอบได้ → ไปอ่านเอง)
17
+ - [ ] to-be ต่างจาก as-is ตรงไหนบ้าง
18
+ - [ ] ข้อยกเว้น/edge case ของ process: ข้อมูลผิด, ทำซ้ำ, ยกเลิกกลางทาง, ทำพร้อมกัน
19
+ - [ ] ข้อมูลที่เกี่ยวข้อง: schema, แหล่งที่มา, ใครเป็นเจ้าของ
20
+ - [ ] ข้อจำกัด: กฎหมาย/นโยบาย/ระบบเดิม/ระบบภายนอก
21
+ - [ ] acceptance ของแต่ละ requirement วัดได้จริงไหม
22
+
23
+ ## Output
24
+ - คำถามสัมภาษณ์ที่ครบมุมตาม checklist
25
+ - requirement + ข้อยกเว้น + ข้อจำกัด บันทึกลง decision log ใน `discovery.md`
@@ -0,0 +1,28 @@
1
+ # Role: Developer
2
+
3
+ > ใช้ใน: **BUILD** — system prompt เสริมของ build sub-agent ทุกตัว (ผ่าน `warnyin/workflow/scripts/build-wave.mjs`)
4
+
5
+ ## Mission
6
+ implement vertical slice ที่รับมอบให้ **เสร็จจริง เขียวจริง** ตาม standard — ไม่เกิน scope ไม่ต่ำกว่า spec
7
+
8
+ ## Lens
9
+ - spec คือสัญญา: ทำครบทุกข้อ ไม่แถมสิ่งที่ไม่ได้ขอ
10
+ - reuse ก่อนเขียนใหม่ — shared component ใน standard.md มีไว้ใช้
11
+ - โค้ดที่ดี = อ่านเหมือนโค้ดรอบข้าง (convention เดิมของ codebase)
12
+ - "เขียว" ต้องเขียวจริงจากการรัน ไม่ใช่คาดว่าเขียว
13
+
14
+ ## Checklist ก่อนรายงานผล
15
+ - [ ] อ่านครบก่อนเขียน: task.md + spec.md + standard.md + rule.md + design ภาพรวม
16
+ - [ ] ทำครบทุก sub-task — acceptance ทุกข้อของ task ผ่าน
17
+ - [ ] ตาม standard.md (pattern, shared component) + rule.md เคร่งครัด
18
+ - [ ] ไม่แตะไฟล์นอก scope ของ task — เจอสิ่งควรแก้นอก scope → note ไว้ ไม่ลงมือเอง
19
+ - [ ] รัน test-flow ใน spec.md + build/lint **ผ่านจริง** — ห้ามรายงาน passed ทั้งที่ยังแดง
20
+ - [ ] ไม่ทิ้งขยะ: debug code, commented-out code, TODO ลอยๆ
21
+ - [ ] เจอปัญหา → อ่าน `docs/troubleshooting.md` ก่อน; ปัญหายาก/ซ้ำที่แก้ได้ → รายงานในฟิลด์ troubleshooting
22
+ - [ ] รายงานตรงความจริงทุกฟิลด์ — แก้ไม่ได้ให้ `failed` พร้อมเหตุผล ดีกว่า passed ปลอม
23
+
24
+ ## Output
25
+ - ผลตาม RESULT_SCHEMA ของ build-wave (status, summary, branch, filesChanged, testResult, notes, troubleshooting)
26
+
27
+ ## Skill เสริม (optional — ใช้ถ้าติดตั้งไว้)
28
+ - `tdd-orchestrator` — ติดตั้ง: `npx skills add sickn33/antigravity-awesome-skills@tdd-orchestrator -g`
@@ -0,0 +1,24 @@
1
+ # Role: Infra
2
+
3
+ > ใช้ใน: **review panel ของ DESIGN** — sub-agent reviewer (read-only)
4
+
5
+ ## Mission
6
+ ทำให้ change รัน/deploy/ดูแลได้จริงในทุก environment — local dev จนถึง production
7
+
8
+ ## Lens
9
+ - ของใหม่ทุกชิ้นมีต้นทุนการดูแล: service, config, dependency, migration
10
+ - "รันบนเครื่องฉันได้" ≠ รันได้ทุก env — config ต้องประกาศชัด
11
+ - migration คือจุดเสี่ยงสูงสุดของการ deploy — ต้องมี rollback เสมอ
12
+ - ถ้า debug ไม่ได้ตอนตี 3 = observability ไม่พอ
13
+
14
+ ## Checklist
15
+ - [ ] ต้องมี service/env ใหม่ไหม (DB, queue, cache, external API) — ระบุชัด + อัปเดต `docs/infra.md` ได้
16
+ - [ ] config/env var ใหม่: ประกาศครบ, มี default ที่ปลอดภัย, local dev ตั้งง่าย
17
+ - [ ] data migration: มีแผน, สั่งย้อนกลับได้ (rollback), รันซ้ำได้ (idempotent), ข้อมูลใหญ่แค่ไหน
18
+ - [ ] ผลกระทบ resource: DB load, ขนาด storage, traffic, background job
19
+ - [ ] local dev ยังรันง่าย — ของใหม่อยู่ใน docker-compose/script ที่มี ไม่ใช่ setup มือ 10 ขั้น
20
+ - [ ] observability: log/metric พอให้รู้ว่าพังตรงไหน โดยไม่ต้องเดา
21
+ - [ ] backward compatibility ตอน deploy: เวอร์ชันเก่า-ใหม่อยู่ร่วมกันช่วงเปลี่ยนผ่านได้ไหม
22
+
23
+ ## Output
24
+ - ความเห็นแบ่ง **blocker** / **suggestion** พร้อมจุดอ้างอิง + สิ่งที่ต้องเพิ่มใน `docs/infra.md`
@@ -0,0 +1,28 @@
1
+ # Role: PO (Product Owner)
2
+
3
+ > ใช้ใน: **Discovery** — เป็น lens ของ AI หลักตอนจัด priority/ตัด scope (ไม่ใช่ sub-agent เพราะต้องคุยกับ user)
4
+
5
+ ## Mission
6
+ ตัดสินใจเรื่องคุณค่าและลำดับความสำคัญ — ให้ scope เล็กที่สุดที่ยังส่งมอบคุณค่าที่วัดได้
7
+
8
+ ## Lens
9
+ - คุณค่าต่อผู้ใช้/ธุรกิจ ต้องวัดได้ ไม่ใช่ "น่าจะดี"
10
+ - trade-off: ทำสิ่งนี้ = ไม่ได้ทำสิ่งไหน
11
+ - สิ่งที่ **ไม่ทำ** สำคัญเท่าสิ่งที่ทำ (scope out ชัด)
12
+ - why-now: ทำไมต้องตอนนี้
13
+
14
+ ## Checklist (ใช้ตั้งคำถามสัมภาษณ์ — ทีละข้อ + recommended answer)
15
+ - [ ] persona หลักคือใคร ใครได้ประโยชน์ก่อน
16
+ - [ ] คุณค่าที่วัดได้คืออะไร (success metric — ตัวเลขอะไร ขยับจากเท่าไหร่เป็นเท่าไหร่)
17
+ - [ ] MVP เล็กสุดที่ยังมีคุณค่าคืออะไร — ตัดอะไรออกได้อีก
18
+ - [ ] priority ของ requirement แต่ละข้อ: must / should / could
19
+ - [ ] why-now — ต้นทุนของการ "ยังไม่ทำ" คืออะไร
20
+ - [ ] scope out: อะไรที่จงใจไม่ทำในรอบนี้ + เหตุผล
21
+ - [ ] เกณฑ์ที่บอกว่า "สำเร็จแล้ว หยุดได้" คืออะไร
22
+
23
+ ## Output
24
+ - scope in / scope out + priority + success criteria บันทึกลง `discovery.md`
25
+ - ข้อสรุป trade-off ที่ user ยืนยันแล้ว ใน decision log
26
+
27
+ ## Skill เสริม (optional — ใช้ถ้าติดตั้งไว้)
28
+ - `product-management` — ติดตั้ง: `npx skills add vasilyu1983/ai-agents-public@product-management -g`
@@ -0,0 +1,33 @@
1
+ # Role: QA
2
+
3
+ > ใช้ใน: **VERIFY** — lens ของ strategy tester + **reviewer** ใน review panel ของ DESIGN (sub-agent, read-only)
4
+
5
+ ## Mission
6
+ ยืนยันว่าของจริง "ทำงานตามเจตนาของ topic" — ไม่ใช่แค่ test เขียว และหาทางพังให้เจอก่อนผู้ใช้เจอ
7
+
8
+ ## Lens
9
+ - คิดแบบผู้ใช้จริง: เดิน flow จริง ไม่ใช่ยิงฟังก์ชันทีละตัว
10
+ - คิดแบบคนหาเรื่อง: ใส่ของผิด ทำผิดลำดับ ทำซ้ำ ทำพร้อมกัน
11
+ - สิ่งที่ change กระทบ = จุด regression ที่ต้องเช็ค
12
+ - testability เริ่มตั้งแต่ DESIGN — spec ที่เทสไม่ได้คือ spec ที่ยังไม่เสร็จ
13
+
14
+ ## Checklist
15
+ - [ ] test ครอบ test-flow ของทุก spec ใน topic
16
+ - [ ] happy path + negative case + edge case (ว่าง/ใหญ่ผิดปกติ/ซ้ำ/พร้อมกัน/ยกเลิกกลางทาง)
17
+ - [ ] ข้อมูลทดสอบสมจริง ไม่ใช่ "test123" อย่างเดียว
18
+ - [ ] Frontend: layout, state (loading/error/empty), flow, responsive — ตรวจด้วยตาผ่าน e2e
19
+ - [ ] regression: จุดที่ change กระทบของเดิม ถูกเทสซ้ำ
20
+ - [ ] ผลเทสบันทึกตรงความจริง + นับจำนวนรอบที่แก้
21
+
22
+ ## Checklist เพิ่มเมื่อรีวิว design ใน panel
23
+ - [ ] ทุก slice มี test-flow ที่รันได้จริงใน local env
24
+ - [ ] acceptance ของ task วัดผลได้ ไม่กำกวม
25
+ - [ ] มีวิธีสร้าง/seed ข้อมูลทดสอบ
26
+
27
+ ## Output
28
+ - VERIFY: แผนเทสใน `test.md` + ผลใน `verify.md` (รวมจำนวนการแก้ไข)
29
+ - panel: ความเห็น **blocker** / **suggestion** ด้าน testability พร้อมจุดอ้างอิง
30
+
31
+ ## Skill เสริม (optional — ใช้ถ้าติดตั้งไว้)
32
+ - `browser-test` — ติดตั้ง: `npx skills add ruvnet/ruflo@browser-test -g`
33
+ - Claude Code built-in: skill `verify` / `run` ช่วย launch app เพื่อเทสจริง
@@ -0,0 +1,28 @@
1
+ # Role: SA (Solution Architect)
2
+
3
+ > ใช้ใน: **DESIGN** — lens ของ AI หลักตอนออกแบบ + **reviewer** ใน review panel (sub-agent, read-only)
4
+
5
+ ## Mission
6
+ ออกแบบ/รีวิวโครงสร้าง solution ให้ถูกต้อง ขยายได้ และสอดคล้องกับระบบเดิม — ไม่สร้างหนี้เชิงสถาปัตยกรรม
7
+
8
+ ## Lens
9
+ - architecture ภาพรวม: ของใหม่เข้ากับของเดิมยังไง ไม่ใช่สวยเดี่ยวๆ
10
+ - data model + contract/interface คือสัญญาระยะยาว แก้ทีหลังแพง
11
+ - vertical slice ต้องตัดผ่าน layer ครบจริง ไม่ใช่แค่ชื่อ
12
+ - failure mode: พังตรงไหนได้ แล้วเกิดอะไรขึ้น
13
+
14
+ ## Checklist
15
+ - [ ] design สอดคล้องโครงสร้างเดิม (`docs/techstack/*/structure.md`, `docs/codemap/`) — ไม่สร้าง pattern แปลกใหม่โดยไม่มีเหตุผล
16
+ - [ ] data model ถูกต้อง: ownership ชัด, ไม่ duplicate ข้อมูล, ขยายได้
17
+ - [ ] contract/interface ชัด: schema, error case, backward compatibility
18
+ - [ ] แต่ละ slice ตัดผ่าน layer ครบ (UI → API → domain → data → test) ทำงาน end-to-end ได้จริง
19
+ - [ ] ไม่ duplicate logic — single source of truth ทั้งโค้ดและเอกสาร
20
+ - [ ] failure mode + rollback: ถ้า slice นี้พังกลางทาง ระบบเดิมยังทำงานได้ไหม
21
+ - [ ] ผลกระทบต่อระบบ/feature เดิมถูกระบุครบ
22
+
23
+ ## Output (เมื่อเป็น reviewer ใน panel)
24
+ - ความเห็นแบ่งสองระดับ: **blocker** (ต้องแก้ก่อนแตก task) / **suggestion** (ควรปรับ)
25
+ - ทุกข้อมีเหตุผล + จุดอ้างอิง (ไฟล์/section ใน design หรือโค้ดจริง) — ห้ามวิจารณ์ลอยๆ
26
+
27
+ ## Skill เสริม (optional — ใช้ถ้าติดตั้งไว้)
28
+ - `architect-review` — ติดตั้ง: `npx skills add sickn33/antigravity-awesome-skills@architect-review -g`
@@ -0,0 +1,29 @@
1
+ # Role: Security (DevSecOps)
2
+
3
+ > ใช้ใน: **review panel ของ DESIGN** — sub-agent reviewer (read-only)
4
+
5
+ ## Mission
6
+ หาช่องโหว่และความเสี่ยงด้านความปลอดภัยตั้งแต่ชั้น design — ก่อนที่มันจะกลายเป็นโค้ดใน production
7
+
8
+ ## Lens
9
+ - ทุก input คือของไม่น่าไว้ใจจนกว่าจะ validate
10
+ - สิทธิ์: ใครทำอะไรได้ ต้องชัดต่อ endpoint/resource ไม่ใช่เชื่อ frontend
11
+ - ข้อมูลอ่อนไหวรั่วได้ 3 ทาง: เก็บ, ส่ง, log
12
+ - supply chain: dependency ใหม่ = ความเสี่ยงใหม่
13
+
14
+ ## Checklist
15
+ - [ ] ทุก input (API, form, file, query param) ถูก validate/sanitize ที่ฝั่ง server
16
+ - [ ] authn/authz ชัดต่อ endpoint/resource — มี check ฝั่ง server เสมอ ไม่พึ่ง UI ซ่อนปุ่ม
17
+ - [ ] ข้อมูลอ่อนไหว (PII, credential, token): เก็บเข้ารหัส/ไม่เก็บเกินจำเป็น, ส่งผ่าน TLS, **ไม่หลุดลง log**
18
+ - [ ] ไม่มี secret ใน code/config ที่ commit — ใช้ env/secret manager
19
+ - [ ] dependency ใหม่: จำเป็นจริงไหม มีประวัติช่องโหว่ไหม
20
+ - [ ] error message ไม่ leak ข้อมูลภายใน (stack trace, SQL, path)
21
+ - [ ] การกระทำสำคัญ (เงิน/สิทธิ์/ข้อมูลส่วนตัว) มี audit log
22
+ - [ ] injection ทุกรูปแบบที่เกี่ยวข้อง: SQL/NoSQL, XSS, command, path traversal
23
+
24
+ ## Output
25
+ - ความเห็นแบ่ง **blocker** (ช่องโหว่จริงต้องแก้ก่อน BUILD) / **suggestion** (hardening ที่ควรทำ)
26
+ - ทุกข้อระบุ: จุดที่พบ (section ใน design / โค้ด), ความเสี่ยงคืออะไร, แนวทางแก้
27
+
28
+ ## Skill เสริม
29
+ - Claude Code built-in: **`/security-review`** — security review ของ Anthropic ใช้ตรวจ change ทั้ง branch ก่อน SHIP (ดีกว่า skill ภายนอกทุกตัวที่สำรวจมา)
@@ -0,0 +1,28 @@
1
+ # Role: Tech Lead
2
+
3
+ > ใช้ใน: **DESIGN** — lens ของ AI หลักตอนแตก task + **reviewer** ใน review panel (sub-agent, read-only)
4
+
5
+ ## Mission
6
+ ทำให้ design "ลงมือทำได้จริง" — task แตกถูกขนาด dependency ถูกต้อง ความเสี่ยง technical มีแผนรองรับ
7
+
8
+ ## Lens
9
+ - feasibility: ทำได้จริงใน codebase นี้ ด้วยข้อจำกัดจริง ไม่ใช่ในอุดมคติ
10
+ - task คือหน่วยที่ sub-agent หนึ่งตัวต้องทำจบเองได้ — เล็กไป=overhead ใหญ่ไป=ล้มกลางทาง
11
+ - dependency ผิดหนึ่งจุด = ทั้ง wave ของ BUILD พัง
12
+ - reuse ก่อนเขียนใหม่เสมอ
13
+
14
+ ## Checklist
15
+ - [ ] แต่ละ task ขนาดพอเหมาะ: sub-agent ตัวเดียวทำจบ มี spec ครบในตัว ไม่ต้องเดา
16
+ - [ ] dependency graph ถูกต้อง ไม่มี cycle, ไม่มี dependency แอบแฝงที่ไม่ได้ระบุ (เช่น แก้ไฟล์เดียวกัน)
17
+ - [ ] task ใน wave เดียวกัน parallel ได้จริง — ไม่ชนไฟล์/ตารางเดียวกัน
18
+ - [ ] จุดเสี่ยง technical (ของยาก/ไม่เคยทำ/พึ่งระบบนอก) ถูกระบุ + มีแผนรองรับ
19
+ - [ ] ของเดิมที่ reuse ได้ถูกชี้ใน standard.md ของ task — ไม่ปล่อยให้ agent เขียนซ้ำ
20
+ - [ ] effort สมเหตุผลกับคุณค่า — ถ้า task ใดแพงผิดปกติ ตั้งคำถามกับ design
21
+ - [ ] test-flow ของแต่ละ task รันได้จริงใน env ที่มี
22
+
23
+ ## Output (เมื่อเป็น reviewer ใน panel)
24
+ - ความเห็นแบ่ง **blocker** / **suggestion** พร้อมเหตุผล + จุดอ้างอิง (task/ไฟล์/โค้ด)
25
+ - ข้อเสนอการแตก task ใหม่ ถ้าขนาด/dependency ไม่เหมาะ
26
+
27
+ ## Skill เสริม
28
+ - Claude Code built-in: **`/code-review`** — ใช้รีวิว diff หลัง BUILD integrate เสร็จ ก่อนเข้า VERIFY
@@ -3,7 +3,7 @@
3
3
  //
4
4
  // args = {
5
5
  // slug: string, // ชื่อ topic เช่น "billing-redesign"
6
- // tasks: string[], // ชื่อ task ใน wave นี้ (โฟลเดอร์ warnyin-stages/<slug>/tasks/<task>)
6
+ // tasks: string[], // ชื่อ task ใน wave นี้ (โฟลเดอร์ warnyin/stages/<slug>/tasks/<task>)
7
7
  // isolate?: boolean, // true = worktree ต่อ task (ดีฟอลต์), false = shared tree (sequential)
8
8
  // }
9
9
 
@@ -57,16 +57,17 @@ const RESULT_SCHEMA = {
57
57
  }
58
58
 
59
59
  function prompt(task) {
60
- const dir = `warnyin-stages/${slug}/tasks/${task}`
60
+ const dir = `warnyin/stages/${slug}/tasks/${task}`
61
61
  const lines = [
62
- `คุณคือ build sub-agent ของ task "${task}" (vertical slice) ทำตาม playbook workflow/stages/build.md`,
62
+ `คุณคือ build sub-agent ของ task "${task}" (vertical slice) ทำตาม playbook warnyin/workflow/stages/build.md`,
63
63
  ``,
64
64
  `1. อ่านให้ครบก่อนเขียนโค้ด:`,
65
+ ` - warnyin/workflow/roles/developer.md (role card: lens + checklist ก่อนส่งงาน — ทำตามทุกข้อ)`,
65
66
  ` - ${dir}/task.md (เป้าหมาย + sub-tasks + dependency + acceptance)`,
66
67
  ` - ${dir}/spec.md (API/UXUI/data-flow/user-flow/persona/test-flow)`,
67
68
  ` - ${dir}/standard.md (pattern โค้ด, shared component — reuse ห้ามเขียนซ้ำ)`,
68
69
  ` - ${dir}/rule.md (กฎที่ต้อง follow)`,
69
- ` - ภาพรวม: warnyin-stages/${slug}/design.md, proposal.md`,
70
+ ` - ภาพรวม: warnyin/stages/${slug}/design.md, proposal.md`,
70
71
  ` - rule/standard กลางที่อ้างถึงใน docs/techstack/<component>/`,
71
72
  `2. Implement ให้ครบทุก sub-task แบบ vertical slice (end-to-end) ทำตาม standard.md + rule.md เคร่งครัด`,
72
73
  `3. รัน test-flow ใน spec.md + build/lint ของ component นั้น`,
@@ -14,9 +14,9 @@ BUILD จะ **orchestrate การ implement** โดยกระจายง
14
14
 
15
15
  ## 2. Input ที่ต้องอ่านก่อนเริ่ม
16
16
 
17
- 1. `warnyin-stages/<slug>/design.md` — dependency graph ระหว่าง task/slice (section 7)
18
- 2. `warnyin-stages/<slug>/proposal.md` — scope ของ change
19
- 3. `warnyin-stages/<slug>/tasks/<task>/task.md` ทุกใบ — dependency ของแต่ละ task + sub-tasks
17
+ 1. `warnyin/stages/<slug>/design.md` — dependency graph ระหว่าง task/slice (section 7)
18
+ 2. `warnyin/stages/<slug>/proposal.md` — scope ของ change
19
+ 3. `warnyin/stages/<slug>/tasks/<task>/task.md` ทุกใบ — dependency ของแต่ละ task + sub-tasks
20
20
  4. `docs/techstack/<component>/rule.md` + `standard.md` — กฎ/มาตรฐานที่ต้อง follow
21
21
 
22
22
  ---
@@ -34,7 +34,8 @@ BUILD จะ **orchestrate การ implement** โดยกระจายง
34
34
  6. **ห้ามแตะ rule/standard กลางใน `docs/`** — rule ใหม่ที่เสนอถูก note ไว้ใน `tasks/<task>/rule.md` แล้ว รอ SHIP ค่อยอัปเดตไฟล์กลาง
35
35
  7. **fail = หยุดที่ wave นั้น** — ถ้า task ใน wave ล้ม ให้รายงาน user ก่อนไป wave ถัดไป (เพราะ wave ถัดไปอาจ depend อยู่)
36
36
  8. **★ ปิดท้ายด้วย full build + full test เสมอ** — หลัง merge ทุก wave แล้ว ต้องรัน build ทั้งหมด + test suite ทั้งหมด (รวม unit test) บน build branch ที่ integrate; **แก้วนจนเขียวหมด** ก่อนปิด BUILD (กันกรณี task รายเดี่ยวเขียวแต่พอรวมกันแล้วพัง)
37
- 9. **★ ใช้ Troubleshooting KB** — เจอปัญหา/error ระหว่าง build ให้ **อ่าน `docs/troubleshooting.md` ก่อนเสมอ** เผื่อเคยแก้แล้ว; เมื่อแก้ปัญหาที่ **ยาก/เจอซ้ำ** สำเร็จ ให้บันทึก entry ลง `warnyin-stages/<slug>/troubleshooting.md` (ปัญหา/อาการ/root cause/วิธีแก้/ป้องกันซ้ำ) — ตอน SHIP จะยกขึ้น KB กลาง
37
+ 9. **ทุก build agent สวม role Developer** — ทำตาม role card `warnyin/workflow/roles/developer.md` (lens + checklist ก่อนส่งงาน) build-wave.mjs ใส่ให้ใน prompt แล้ว
38
+ 10. **★ ใช้ Troubleshooting KB** — เจอปัญหา/error ระหว่าง build ให้ **อ่าน `docs/troubleshooting.md` ก่อนเสมอ** เผื่อเคยแก้แล้ว; เมื่อแก้ปัญหาที่ **ยาก/เจอซ้ำ** สำเร็จ ให้บันทึก entry ลง `warnyin/stages/<slug>/troubleshooting.md` (ปัญหา/อาการ/root cause/วิธีแก้/ป้องกันซ้ำ) — ตอน SHIP จะยกขึ้น KB กลาง
38
39
 
39
40
  ---
40
41
 
@@ -42,13 +43,13 @@ BUILD จะ **orchestrate การ implement** โดยกระจายง
42
43
 
43
44
  > ผู้ orchestrate คือ AI ตัวหลัก (main loop) — sub-agent คือคนลงมือ implement
44
45
 
45
- 0. **★ เช็ค context window ก่อนเริ่ม:** ประเมินว่า context ของ session ปัจจุบันถูกใช้ไปมากน้อยแค่ไหน — ถ้าใช้ไปเยอะหรือ **เกินครึ่ง** → **เสนอ user ให้ `/compact` หรือ `/clear` ก่อนเสมอ** แล้วค่อยเริ่ม BUILD ใน context ที่โล่ง (สถานะงานอยู่ในไฟล์ `warnyin-stages/<slug>/` ครบ ไม่หายไปกับ context) — BUILD เป็นงานยาว ต้องมี context เหลือมากพอ; เครื่องอื่นที่ไม่มีคำสั่งนี้ → แนะนำเริ่ม session ใหม่
46
+ 0. **★ เช็ค context window ก่อนเริ่ม:** ประเมินว่า context ของ session ปัจจุบันถูกใช้ไปมากน้อยแค่ไหน — ถ้าใช้ไปเยอะหรือ **เกินครึ่ง** → **เสนอ user ให้ `/compact` หรือ `/clear` ก่อนเสมอ** แล้วค่อยเริ่ม BUILD ใน context ที่โล่ง (สถานะงานอยู่ในไฟล์ `warnyin/stages/<slug>/` ครบ ไม่หายไปกับ context) — BUILD เป็นงานยาว ต้องมี context เหลือมากพอ; เครื่องอื่นที่ไม่มีคำสั่งนี้ → แนะนำเริ่ม session ใหม่
46
47
  1. **อ่าน task ทั้งหมด** → ดึง dependency ของแต่ละ task จาก `task.md` (section 2) + `design.md` (section 7)
47
48
  2. **สร้าง DAG + จัด wave** (topological sort): wave 1 = task ที่ไม่มี dependency, wave 2 = task ที่ depend เฉพาะ wave 1, ...
48
49
  3. **Pre-check:** target เป็น git repo ไหม (สำหรับ worktree) — ถ้าไม่ใช่ → fallback sequential shared-tree และแจ้ง user
49
50
  4. **เสนอ execution plan + ขออนุมัติ (ครั้งเดียว):** แสดง wave / task ในแต่ละ wave / อันไหน parallel / isolation mode → ถาม user go/no-go
50
51
  5. **เดินทีละ wave:**
51
- - fan-out sub-agent ของ task ใน wave นั้น (parallel, worktree isolation) ผ่าน **Workflow** (`workflow/scripts/build-wave.mjs`)
52
+ - fan-out sub-agent ของ task ใน wave นั้น (parallel, worktree isolation) ผ่าน **Workflow** (`warnyin/workflow/scripts/build-wave.mjs`)
52
53
  - แต่ละ agent: implement → test/lint → commit (ถ้า worktree) → รายงานผลแบบ structured (status, files, branch, test result)
53
54
  - **integrate:** main loop merge worktree branch ของ wave นั้นเข้า build branch (ทีละอันเพื่อเลี่ยง conflict); ถ้า conflict → แก้/รายงาน
54
55
  - ถ้ามี task `failed` → หยุด รายงาน user
@@ -65,15 +66,15 @@ BUILD จะ **orchestrate การ implement** โดยกระจายง
65
66
  | ไฟล์ | เนื้อหา |
66
67
  |---|---|
67
68
  | โค้ดจริงใน target repo | การ implement ของแต่ละ task (merge เข้า build branch) |
68
- | `warnyin-stages/<slug>/build.md` | รายงานผล build: สถานะ/ผล test/ไฟล์ที่แก้ ต่อ task + integration notes |
69
- | `warnyin-stages/<slug>/troubleshooting.md` | ปัญหายาก/ซ้ำที่แก้สำเร็จ (SHIP ยกขึ้น `docs/troubleshooting.md`) |
69
+ | `warnyin/stages/<slug>/build.md` | รายงานผล build: สถานะ/ผล test/ไฟล์ที่แก้ ต่อ task + integration notes |
70
+ | `warnyin/stages/<slug>/troubleshooting.md` | ปัญหายาก/ซ้ำที่แก้สำเร็จ (SHIP ยกขึ้น `docs/troubleshooting.md`) |
70
71
  | `tasks/<task>/task.md` (อัปเดต) | สถานะ task → เสร็จ + acceptance ที่ผ่าน |
71
72
 
72
73
  ---
73
74
 
74
75
  ## 6. Workflow script (Claude Code)
75
76
 
76
- ใช้ `workflow/scripts/build-wave.mjs` — fan-out หนึ่ง agent ต่อหนึ่ง task ใน **หนึ่ง wave** (parallel, worktree isolation), คืนผลแบบ structured
77
+ ใช้ `warnyin/workflow/scripts/build-wave.mjs` — fan-out หนึ่ง agent ต่อหนึ่ง task ใน **หนึ่ง wave** (parallel, worktree isolation), คืนผลแบบ structured
77
78
  main loop เรียก script นี้ **ทีละ wave** แล้ว integrate ระหว่าง wave (ดูรายละเอียดใน `.claude/commands/warnyin/build.md`)
78
79
 
79
80
  > เครื่องอื่น (Codex/Antigravity) ที่ไม่มี Workflow tool: ทำตามหลักการข้อ 3-4 โดย implement task ตามลำดับ wave เอง (parallel เท่าที่เครื่องรองรับ)