@warnyin/agents 0.18.0 → 0.19.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/CHANGELOG.md +173 -162
  2. package/README.md +160 -160
  3. package/package.json +38 -38
  4. package/src/.claude/agents/warnyin-infra.md +13 -13
  5. package/src/.claude/agents/warnyin-qa.md +13 -13
  6. package/src/.claude/agents/warnyin-sa.md +13 -13
  7. package/src/.claude/agents/warnyin-security.md +13 -13
  8. package/src/.claude/agents/warnyin-tech-lead.md +13 -13
  9. package/src/.claude/agents/warnyin-ux.md +14 -14
  10. package/src/.claude/commands/warnyin/build.md +31 -31
  11. package/src/.claude/commands/warnyin/design.md +27 -27
  12. package/src/.claude/commands/warnyin/discovery.md +22 -22
  13. package/src/.claude/commands/warnyin/explore.md +14 -14
  14. package/src/.claude/commands/warnyin/feedback/issue.md +14 -14
  15. package/src/.claude/commands/warnyin/init.md +12 -12
  16. package/src/.claude/commands/warnyin/install-skill.md +19 -19
  17. package/src/.claude/commands/warnyin/next.md +17 -17
  18. package/src/.claude/commands/warnyin/ship.md +28 -28
  19. package/src/.claude/commands/warnyin/triage.md +14 -14
  20. package/src/.claude/commands/warnyin/update-codemaps.md +12 -12
  21. package/src/.claude/commands/warnyin/verify.md +20 -20
  22. package/src/.claude/skills/explore/SKILL.md +8 -8
  23. package/src/.claude/skills/next/SKILL.md +8 -8
  24. package/src/.claude/skills/update-codemaps/SKILL.md +8 -8
  25. package/src/.warnyin/installer/templates/CLAUDE.global.md +5 -5
  26. package/src/.warnyin/installer/templates/CLAUDE.md +35 -35
  27. package/src/.warnyin/template/docs/codemap/index.md +18 -18
  28. package/src/.warnyin/template/docs/features/[feature-name]/business.md +5 -5
  29. package/src/.warnyin/template/docs/features/[feature-name]/feature.md +5 -5
  30. package/src/.warnyin/template/docs/features/[feature-name]/spec.md +16 -16
  31. package/src/.warnyin/template/docs/infra.md +16 -16
  32. package/src/.warnyin/template/docs/project.md +18 -18
  33. package/src/.warnyin/template/docs/rule.md +7 -7
  34. package/src/.warnyin/template/docs/techstack/[component]/about.md +6 -6
  35. package/src/.warnyin/template/docs/techstack/[component]/rule.md +6 -6
  36. package/src/.warnyin/template/docs/techstack/[component]/standard.md +6 -6
  37. package/src/.warnyin/template/docs/techstack/[component]/structure.md +7 -7
  38. package/src/.warnyin/template/docs/techstack/[component]/test.md +7 -7
  39. package/src/.warnyin/template/docs/troubleshooting.md +32 -32
  40. package/src/.warnyin/template/stages/[topic]/build.md +58 -58
  41. package/src/.warnyin/template/stages/[topic]/business.md +21 -21
  42. package/src/.warnyin/template/stages/[topic]/design.md +63 -63
  43. package/src/.warnyin/template/stages/[topic]/discovery.md +69 -69
  44. package/src/.warnyin/template/stages/[topic]/proposal.md +43 -43
  45. package/src/.warnyin/template/stages/[topic]/research.md +49 -49
  46. package/src/.warnyin/template/stages/[topic]/ship.md +32 -32
  47. package/src/.warnyin/template/stages/[topic]/tasks/[task-name]/issue.md +19 -19
  48. package/src/.warnyin/template/stages/[topic]/tasks/[task-name]/rule.md +13 -13
  49. package/src/.warnyin/template/stages/[topic]/tasks/[task-name]/spec.md +36 -36
  50. package/src/.warnyin/template/stages/[topic]/tasks/[task-name]/standard.md +21 -21
  51. package/src/.warnyin/template/stages/[topic]/tasks/[task-name]/task.md +40 -40
  52. package/src/.warnyin/template/stages/[topic]/test.md +46 -46
  53. package/src/.warnyin/template/stages/[topic]/troubleshooting.md +34 -34
  54. package/src/.warnyin/template/stages/[topic]/verify.md +44 -44
  55. package/src/.warnyin/template/stages/[topic]/wireframe.md +104 -104
  56. package/src/.warnyin/workflow/README.md +107 -106
  57. package/src/.warnyin/workflow/api-doc.md +93 -93
  58. package/src/.warnyin/workflow/codemap.md +91 -91
  59. package/src/.warnyin/workflow/contexts/README.md +51 -51
  60. package/src/.warnyin/workflow/contexts/build.md +26 -25
  61. package/src/.warnyin/workflow/contexts/research.md +25 -25
  62. package/src/.warnyin/workflow/contexts/review.md +29 -25
  63. package/src/.warnyin/workflow/explore.md +32 -32
  64. package/src/.warnyin/workflow/feedback.md +212 -212
  65. package/src/.warnyin/workflow/init.md +136 -136
  66. package/src/.warnyin/workflow/minimalism.md +63 -0
  67. package/src/.warnyin/workflow/next.md +48 -48
  68. package/src/.warnyin/workflow/roles/README.md +52 -52
  69. package/src/.warnyin/workflow/roles/ba.md +25 -25
  70. package/src/.warnyin/workflow/roles/developer.md +32 -31
  71. package/src/.warnyin/workflow/roles/infra.md +24 -24
  72. package/src/.warnyin/workflow/roles/po.md +28 -28
  73. package/src/.warnyin/workflow/roles/qa.md +36 -36
  74. package/src/.warnyin/workflow/roles/sa.md +28 -28
  75. package/src/.warnyin/workflow/roles/security.md +39 -39
  76. package/src/.warnyin/workflow/roles/tech-lead.md +28 -28
  77. package/src/.warnyin/workflow/roles/ux.md +76 -76
  78. package/src/.warnyin/workflow/scripts/build-wave.mjs +145 -145
  79. package/src/.warnyin/workflow/scripts/validate-topic.mjs +378 -378
  80. package/src/.warnyin/workflow/stages/build.md +98 -98
  81. package/src/.warnyin/workflow/stages/design.md +174 -174
  82. package/src/.warnyin/workflow/stages/discovery.md +256 -256
  83. package/src/.warnyin/workflow/stages/ship.md +94 -94
  84. package/src/.warnyin/workflow/stages/verify.md +82 -82
  85. package/src/.warnyin/workflow/triage.md +74 -74
  86. package/src/AGENTS.md +54 -54
  87. package/src/bin/cli.mjs +357 -333
@@ -1,104 +1,104 @@
1
- # Wireframe — <ชื่อ change / กลุ่มหน้าจอ>
2
-
3
- > Output ของ DESIGN stage · playbook: `.warnyin/workflow/stages/design.md`
4
- > **low-fidelity wireframe** ของ change ที่มี UI surface — วาดก่อนเขียน technical design (`design.md` §5 UI layer) แล้วแตก task
5
- > วาดโดย role/agent `warnyin-ux` (read-only generator) หรือ AI หลักสวม lens `.warnyin/workflow/roles/ux.md` (fallback) — main loop เขียนไฟล์นี้
6
-
7
- | | |
8
- |---|---|
9
- | **Slug** | `<kebab-case ของ topic — ตรงกับ docs/stages/<slug>/>` |
10
- | **วันที่** | `YYYY-MM-DD` |
11
- | **Status** | `draft` / `approved` _(★ approve gate — user ต้องยืนยันให้เป็น `approved` ก่อนแตก task)_ |
12
-
13
- <!--
14
- วิธีกรอกไฟล์นี้ (อ่านก่อนเริ่ม):
15
- - wireframe เป็น low-fidelity เท่านั้น — กล่อง/label generic พอให้เห็นโครงหน้าจอ ไม่ต้องสวย ไม่ใช่ pixel-perfect
16
- - ★ privacy: ใช้ placeholder generic — ห้ามใส่ secret/token/credential/internal path/PII จริงลงในภาพ (ไฟล์นี้ commit ลง repo)
17
- - แทนที่ทุก <...> และ [LABEL] ด้วยของจริงของ change นี้ แล้วลบ comment <!-- ... --> ที่เป็นคำสั่งกรอกออก
18
- - 4 section ด้านล่าง (§1-§4) ชื่อตายตัวตาม contract — design.md/task อ้างชื่อนี้ ห้ามเปลี่ยนชื่อ/ลบ section
19
- -->
20
-
21
- ## 1. User flow
22
-
23
- > เส้นทาง screen-to-screen — ผู้ใช้เดินจากจอไหนไปจอไหน (ทำอะไร → เห็นอะไร)
24
- > วาดเป็น ASCII arrow flow; แตกแขนง (branch) ได้ตาม action/เงื่อนไข
25
-
26
- ```
27
- <!-- ตัวอย่าง — แทนที่ด้วย flow จริงของ change นี้ -->
28
- [Entry / Landing]
29
- │ กดปุ่มหลัก
30
-
31
- [Form / Input screen] ──ใส่ข้อมูลไม่ครบ──▶ [Validation error inline]
32
- │ submit สำเร็จ
33
-
34
- [Result / Success screen]
35
- │ กดย้อนกลับ
36
-
37
- [Entry / Landing]
38
- ```
39
-
40
- ## 2. Wireframe ต่อ screen
41
-
42
- > ASCII box หนึ่งกล่องต่อหนึ่ง screen — low-fidelity (กล่อง + label generic)
43
- > ★ **ทำซ้ำ block "### Screen: ..." ด้านล่างได้หลายอัน** — หนึ่ง block ต่อหนึ่งหน้าจอใน user flow §1
44
-
45
- ### Screen: <ชื่อจอ A — เช่น Landing>
46
-
47
- ```
48
- ┌─────────────────────────────────────────┐
49
- │ [LOGO] [User menu] │ <- header / nav
50
- ├─────────────────────────────────────────┤
51
- │ │
52
- │ <หัวข้อจอ / คำอธิบายสั้น> │
53
- │ │
54
- │ ┌─────────────────────────────────┐ │
55
- │ │ [Primary content / list item] │ │
56
- │ │ [Primary content / list item] │ │
57
- │ └─────────────────────────────────┘ │
58
- │ │
59
- │ [ ปุ่มหลัก / CTA ] │ <- action
60
- │ │
61
- └─────────────────────────────────────────┘
62
- ```
63
-
64
- ### Screen: <ชื่อจอ B — เช่น Form>
65
-
66
- <!-- ทำซ้ำ block นี้ต่อหนึ่งหน้าจอ; ลบ block ตัวอย่างที่ไม่ใช้ออก -->
67
-
68
- ```
69
- ┌─────────────────────────────────────────┐
70
- │ ◀ กลับ <หัวข้อจอ> │
71
- ├─────────────────────────────────────────┤
72
- │ │
73
- │ <Field 1 label> │
74
- │ [____________________________] │ <- input
75
- │ │
76
- │ <Field 2 label> │
77
- │ [____________________________] │
78
- │ ( ) ตัวเลือก A ( ) ตัวเลือก B │ <- radio/option
79
- │ │
80
- │ [ ยกเลิก ] [ ยืนยัน ] │
81
- │ │
82
- └─────────────────────────────────────────┘
83
- ```
84
-
85
- ## 3. Screen states
86
-
87
- > ต่อหนึ่ง screen ใน §2 ระบุหน้าตาแต่ละ state — empty / loading / error / success
88
- > state ไหนไม่มีจริงสำหรับจอนั้น ใส่ `N/A` พร้อมเหตุผลสั้น
89
-
90
- | Screen | empty | loading | error | success |
91
- |---|---|---|---|---|
92
- | `<ชื่อจอ A>` | `<ไม่มี item — แสดงอะไร>` | `<skeleton / spinner>` | `<โหลด list ไม่ได้ — แสดงอะไร>` | `<มี item — แสดงอะไร>` |
93
- | `<ชื่อจอ B>` | `N/A (form ไม่มี empty)` | `<ขณะ submit — disable ปุ่ม>` | `<validation/server error inline>` | `<submit สำเร็จ → ไปจอไหน>` |
94
-
95
- ## 4. Design-honor note
96
-
97
- > สิ่งที่ `design.md` (§5 UI layer) + task ใน BUILD **ต้องทำตาม** wireframe นี้ — กัน implementation หลุดจากที่ user approve
98
- > เขียนเป็นข้อผูกมัด (constraint) ที่ตรวจได้ ไม่ใช่คำอธิบายลอย ๆ
99
-
100
- - [ ] design.md §5 (UI layer) **อ้าง wireframe นี้** + ทุก screen ใน §2 มี task รองรับ
101
- - [ ] ลำดับ screen ใน task ตรงกับ user flow §1 (entry → ... → result)
102
- - [ ] ทุก screen implement ครบ 4 state ตาม §3 (ไม่ข้าม error/empty)
103
- - [ ] `<constraint เฉพาะ change นี้ — เช่น "ปุ่ม CTA ต้องอยู่ขวาล่างเสมอ", "field บังคับมี inline validation">`
104
- - [ ] เปลี่ยน layout/flow จาก wireframe นี้ → ต้อง rerun approve gate (กลับ status เป็น `draft` แล้วให้ user ยืนยันใหม่)
1
+ # Wireframe — <ชื่อ change / กลุ่มหน้าจอ>
2
+
3
+ > Output ของ DESIGN stage · playbook: `.warnyin/workflow/stages/design.md`
4
+ > **low-fidelity wireframe** ของ change ที่มี UI surface — วาดก่อนเขียน technical design (`design.md` §5 UI layer) แล้วแตก task
5
+ > วาดโดย role/agent `warnyin-ux` (read-only generator) หรือ AI หลักสวม lens `.warnyin/workflow/roles/ux.md` (fallback) — main loop เขียนไฟล์นี้
6
+
7
+ | | |
8
+ |---|---|
9
+ | **Slug** | `<kebab-case ของ topic — ตรงกับ docs/stages/<slug>/>` |
10
+ | **วันที่** | `YYYY-MM-DD` |
11
+ | **Status** | `draft` / `approved` _(★ approve gate — user ต้องยืนยันให้เป็น `approved` ก่อนแตก task)_ |
12
+
13
+ <!--
14
+ วิธีกรอกไฟล์นี้ (อ่านก่อนเริ่ม):
15
+ - wireframe เป็น low-fidelity เท่านั้น — กล่อง/label generic พอให้เห็นโครงหน้าจอ ไม่ต้องสวย ไม่ใช่ pixel-perfect
16
+ - ★ privacy: ใช้ placeholder generic — ห้ามใส่ secret/token/credential/internal path/PII จริงลงในภาพ (ไฟล์นี้ commit ลง repo)
17
+ - แทนที่ทุก <...> และ [LABEL] ด้วยของจริงของ change นี้ แล้วลบ comment <!-- ... --> ที่เป็นคำสั่งกรอกออก
18
+ - 4 section ด้านล่าง (§1-§4) ชื่อตายตัวตาม contract — design.md/task อ้างชื่อนี้ ห้ามเปลี่ยนชื่อ/ลบ section
19
+ -->
20
+
21
+ ## 1. User flow
22
+
23
+ > เส้นทาง screen-to-screen — ผู้ใช้เดินจากจอไหนไปจอไหน (ทำอะไร → เห็นอะไร)
24
+ > วาดเป็น ASCII arrow flow; แตกแขนง (branch) ได้ตาม action/เงื่อนไข
25
+
26
+ ```
27
+ <!-- ตัวอย่าง — แทนที่ด้วย flow จริงของ change นี้ -->
28
+ [Entry / Landing]
29
+ │ กดปุ่มหลัก
30
+
31
+ [Form / Input screen] ──ใส่ข้อมูลไม่ครบ──▶ [Validation error inline]
32
+ │ submit สำเร็จ
33
+
34
+ [Result / Success screen]
35
+ │ กดย้อนกลับ
36
+
37
+ [Entry / Landing]
38
+ ```
39
+
40
+ ## 2. Wireframe ต่อ screen
41
+
42
+ > ASCII box หนึ่งกล่องต่อหนึ่ง screen — low-fidelity (กล่อง + label generic)
43
+ > ★ **ทำซ้ำ block "### Screen: ..." ด้านล่างได้หลายอัน** — หนึ่ง block ต่อหนึ่งหน้าจอใน user flow §1
44
+
45
+ ### Screen: <ชื่อจอ A — เช่น Landing>
46
+
47
+ ```
48
+ ┌─────────────────────────────────────────┐
49
+ │ [LOGO] [User menu] │ <- header / nav
50
+ ├─────────────────────────────────────────┤
51
+ │ │
52
+ │ <หัวข้อจอ / คำอธิบายสั้น> │
53
+ │ │
54
+ │ ┌─────────────────────────────────┐ │
55
+ │ │ [Primary content / list item] │ │
56
+ │ │ [Primary content / list item] │ │
57
+ │ └─────────────────────────────────┘ │
58
+ │ │
59
+ │ [ ปุ่มหลัก / CTA ] │ <- action
60
+ │ │
61
+ └─────────────────────────────────────────┘
62
+ ```
63
+
64
+ ### Screen: <ชื่อจอ B — เช่น Form>
65
+
66
+ <!-- ทำซ้ำ block นี้ต่อหนึ่งหน้าจอ; ลบ block ตัวอย่างที่ไม่ใช้ออก -->
67
+
68
+ ```
69
+ ┌─────────────────────────────────────────┐
70
+ │ ◀ กลับ <หัวข้อจอ> │
71
+ ├─────────────────────────────────────────┤
72
+ │ │
73
+ │ <Field 1 label> │
74
+ │ [____________________________] │ <- input
75
+ │ │
76
+ │ <Field 2 label> │
77
+ │ [____________________________] │
78
+ │ ( ) ตัวเลือก A ( ) ตัวเลือก B │ <- radio/option
79
+ │ │
80
+ │ [ ยกเลิก ] [ ยืนยัน ] │
81
+ │ │
82
+ └─────────────────────────────────────────┘
83
+ ```
84
+
85
+ ## 3. Screen states
86
+
87
+ > ต่อหนึ่ง screen ใน §2 ระบุหน้าตาแต่ละ state — empty / loading / error / success
88
+ > state ไหนไม่มีจริงสำหรับจอนั้น ใส่ `N/A` พร้อมเหตุผลสั้น
89
+
90
+ | Screen | empty | loading | error | success |
91
+ |---|---|---|---|---|
92
+ | `<ชื่อจอ A>` | `<ไม่มี item — แสดงอะไร>` | `<skeleton / spinner>` | `<โหลด list ไม่ได้ — แสดงอะไร>` | `<มี item — แสดงอะไร>` |
93
+ | `<ชื่อจอ B>` | `N/A (form ไม่มี empty)` | `<ขณะ submit — disable ปุ่ม>` | `<validation/server error inline>` | `<submit สำเร็จ → ไปจอไหน>` |
94
+
95
+ ## 4. Design-honor note
96
+
97
+ > สิ่งที่ `design.md` (§5 UI layer) + task ใน BUILD **ต้องทำตาม** wireframe นี้ — กัน implementation หลุดจากที่ user approve
98
+ > เขียนเป็นข้อผูกมัด (constraint) ที่ตรวจได้ ไม่ใช่คำอธิบายลอย ๆ
99
+
100
+ - [ ] design.md §5 (UI layer) **อ้าง wireframe นี้** + ทุก screen ใน §2 มี task รองรับ
101
+ - [ ] ลำดับ screen ใน task ตรงกับ user flow §1 (entry → ... → result)
102
+ - [ ] ทุก screen implement ครบ 4 state ตาม §3 (ไม่ข้าม error/empty)
103
+ - [ ] `<constraint เฉพาะ change นี้ — เช่น "ปุ่ม CTA ต้องอยู่ขวาล่างเสมอ", "field บังคับมี inline validation">`
104
+ - [ ] เปลี่ยน layout/flow จาก wireframe นี้ → ต้อง rerun approve gate (กลับ status เป็น `draft` แล้วให้ user ยืนยันใหม่)
@@ -1,106 +1,107 @@
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
- > โครงนี้คือสิ่งที่อยู่ใน **โปรเจกต์ที่ติดตั้งแล้ว** (installer วาง `.warnyin/`+`.claude/` ให้)
34
- > ตัว repo `warnyin-agents` เองเก็บ source ที่จะ publish ไว้ใต้ `src/` (เช่น `src/bin/cli.mjs`, `src/.warnyin/`) — ดู `CONTRIBUTING.md`
35
-
36
- ```
37
- .warnyin/ # ★ แก่นกลาง workflow (installer วางให้ — อัปเดตได้ด้วย --update)
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
- explore.md # playbook: EXPLORE — สำรวจ/ตอบคำถามแบบ read-only ไม่สร้าง artifact
43
- next.md # playbook: NEXT — เช็คงานค้าง + แนะนำขั้นตอนถัดไป (read-only)
44
- triage.md # capability: TRIAGE — ประเมินขนาด change → tier + route (read-only)
45
- api-doc.md # capability: API-DOC — adaptive OpenAPI 3.1 contract (DESIGN/VERIFY/SHIP เรียกเอง)
46
- feedback.md # capability: FEEDBACKเปิด GitHub issue แจ้ง feedback (gh + fallback URL)
47
- stages/ # discovery · design · build · verify · ship ✅
48
- # discovery: mode ปรับความเข้ม {ไว|สมดุล|ละเอียด|โต้วาที|ไต่สวน} + auto-suggest + debate
49
- # taxonomy + behavior + auto-suggest signal อยู่ใน section "Discovery modes (ความเข้มของ Discovery)" ของ discovery.md
50
- roles/ # role card กลาง (task-level lens): ba, po, sa, tech-lead, developer, qa, security, infra
51
- contexts/ # context profile กลาง (session-level posture): research, build, review + README
52
- scripts/
53
- build-wave.mjs # Workflow script: fan-out sub-agent ต่อ task ใน wave (worktree)
54
- template/ # template ทั้งหมดรวมที่เดียว
55
- stages/[topic]/ # หนึ่งหน่วยงาน copy เป็น docs/stages/<slug>
56
- discovery.md research.md # output ของ Discovery
57
- business.md proposal.md design.md # output ของ DESIGN
58
- tasks/[task-name]/... build.md # output ของ DESIGN (tasks) + BUILD
59
- test.md verify.md # output ของ VERIFY
60
- troubleshooting.md ship.md # KB ระหว่างงาน + สรุปส่งมอบของ SHIP
61
- docs/ # โครง docs installer seed เข้า docs/ ตอนติดตั้ง
62
- project.md rule.md infra.md troubleshooting.md codemap/index.md
63
- techstack/[component]/ # copy เป็น docs/techstack/<component> (โดย /warnyin:init)
64
- features/[feature-name]/ # copy เป็น docs/features/<feature-name> (โดย SHIP) — มี spec.md (living behavior spec)
65
- installer/templates/ # template CLAUDE.md ของ target (installer ใช้เองไม่ถูก copy ไป target)
66
-
67
- .claude/ # adapter Claude Code (ชี้กลับ playbook กลาง)
68
- commands/warnyin/ # slash command /warnyin:*
69
- agents/ # reviewer subagent warnyin-{sa,tech-lead,qa,security,infra} + warnyin-ux (generator — วาด wireframe ที่ step 4.5; แยกจาก reviewer 5 ตัว ไม่ใช่ reviewer ที่ 6)
70
- CLAUDE.md AGENTS.md # adapter + pointer ของ Claude / Codex·Antigravity
71
-
72
- docs/ # ความรู้ถาวรระดับโปรเจกต์ + งานจริง — ของจริงล้วน (seed จาก template/docs)
73
- project.md # จุดเริ่มของ Discoveryอ่านก่อนเสมอ
74
- rule.md infra.md
75
- troubleshooting.md # ★ KB ปัญหา-วิธีแก้ (อ่านก่อนเมื่อ build เจอ error; SHIP ป้อนเข้า)
76
- codemap/ features/ techstack/
77
- stages/ # พื้นที่ทำงานจริง ตาม topic (<slug>/) + achieved/<YYYY-MM-DD>-<slug>/ หลัง SHIP
78
- ```
79
- ```
80
-
81
- ---
82
-
83
- ## การติดตั้งไปโปรเจกต์อื่น
84
-
85
- ```bash
86
- cd my-project
87
- npx @warnyin/agents # ติดตั้ง (ข้ามไฟล์ที่มีอยู่ ไม่เขียนทับ)
88
- npx @warnyin/agents --update # อัปเดต playbook กลางเป็นเวอร์ชันล่าสุด
89
- npx @warnyin/agents --dry-run # ดูก่อนว่าจะสร้าง/อัปเดตอะไร
90
- # ทางสำรอง (ไม่ผ่าน npm): npx github:warnyin/warnyin-agents
91
- ```
92
-
93
- - โปรเจกต์ที่มี `CLAUDE.md`/`AGENTS.md` อยู่แล้ว → installer ต่อท้ายเป็น section ไม่เขียนทับ
94
- - `--update` เขียนทับเฉพาะ core (`.warnyin/workflow/`, `.claude/commands/warnyin/`, template ใน `.warnyin/template/`) — ไม่แตะ `docs/` และงานจริง
95
- - หลังติดตั้ง เปิด Claude Code แล้วรัน `/warnyin:init` ให้ agent วิเคราะห์โปรเจกต์ + เติม `docs/` (playbook: `.warnyin/workflow/init.md`)
96
-
97
- ## วิธีใช้
98
-
99
- 1. เริ่มงานใหม่ → copy `.warnyin/template/stages/[topic]/` เป็น `docs/stages/<ชื่อ-งาน-kebab-case>/`
100
- 2. รัน stage ตามลำดับ (Discovery ข้ามได้ถ้าเข้าใจ scope ชัดแล้ว)
101
- - Claude Code: `/warnyin:discovery <topic> [mode]`, `/warnyin:design <slug> <change>`
102
- - mode (ความเข้ม Discovery): `ไว` | `สมดุล` | `ละเอียด` | `โต้วาที` | `ไต่สวน` — ไม่ระบุ → auto-suggest (ดู playbook `discovery.md` section "Discovery modes (ความเข้มของ Discovery)")
103
- - Codex / Antigravity: บอกให้ทำตาม `.warnyin/workflow/stages/<stage>.md`
104
- 3. ผ่าน "gate" ของแต่ละ stage แล้วจึงไป stage ถัดไป
105
- 4. เมื่อ SHIP (`/warnyin:ship <slug>`) promote ความรู้ของ topic ขึ้นเอกสารกลางใน `docs/`
106
- แล้วย้าย topic ไป `docs/stages/achieved/<YYYY-MM-DD>-<topic>/`
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
+ > โครงนี้คือสิ่งที่อยู่ใน **โปรเจกต์ที่ติดตั้งแล้ว** (installer วาง `.warnyin/`+`.claude/` ให้)
34
+ > ตัว repo `warnyin-agents` เองเก็บ source ที่จะ publish ไว้ใต้ `src/` (เช่น `src/bin/cli.mjs`, `src/.warnyin/`) — ดู `CONTRIBUTING.md`
35
+
36
+ ```
37
+ .warnyin/ # ★ แก่นกลาง workflow (installer วางให้ — อัปเดตได้ด้วย --update)
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
+ explore.md # playbook: EXPLORE — สำรวจ/ตอบคำถามแบบ read-only ไม่สร้าง artifact
43
+ next.md # playbook: NEXT — เช็คงานค้าง + แนะนำขั้นตอนถัดไป (read-only)
44
+ triage.md # capability: TRIAGE — ประเมินขนาด change → tier + route (read-only)
45
+ api-doc.md # capability: API-DOC — adaptive OpenAPI 3.1 contract (DESIGN/VERIFY/SHIP เรียกเอง)
46
+ minimalism.md # principle: MINIMALISMdecision hierarchy "เขียนน้อยที่สุด" + guardrail lazy-not-negligent (single source; surface ทั้งหมด pointer กลับมาที่นี่)
47
+ feedback.md # capability: FEEDBACK เปิด GitHub issue แจ้ง feedback (gh + fallback URL)
48
+ stages/ # discovery · design · build ✅ · verify ✅ · ship ✅
49
+ # discovery: mode ปรับความเข้ม {ไว|สมดุล|ละเอียด|โต้วาที|ไต่สวน} + auto-suggest + debate
50
+ # taxonomy + behavior + auto-suggest signal อยู่ใน section "Discovery modes (ความเข้มของ Discovery)" ของ discovery.md
51
+ roles/ # role card กลาง (task-level lens): ba, po, sa, tech-lead, developer, qa, security, infra
52
+ contexts/ # context profile กลาง (session-level posture): research, build, review + README
53
+ scripts/
54
+ build-wave.mjs # Workflow script: fan-out sub-agent ต่อ task ใน wave (worktree)
55
+ template/ # template ทั้งหมดรวมที่เดียว
56
+ stages/[topic]/ # หนึ่งหน่วยงาน copy เป็น docs/stages/<slug>
57
+ discovery.md research.md # output ของ Discovery
58
+ business.md proposal.md design.md # output ของ DESIGN
59
+ tasks/[task-name]/... build.md # output ของ DESIGN (tasks) + BUILD
60
+ test.md verify.md # output ของ VERIFY
61
+ troubleshooting.md ship.md # KB ระหว่างงาน + สรุปส่งมอบของ SHIP
62
+ docs/ # โครง docs — installer seed เข้า docs/ ตอนติดตั้ง
63
+ project.md rule.md infra.md troubleshooting.md codemap/index.md
64
+ techstack/[component]/ # copy เป็น docs/techstack/<component> (โดย /warnyin:init)
65
+ features/[feature-name]/ # copy เป็น docs/features/<feature-name> (โดย SHIP)มี spec.md (living behavior spec)
66
+ installer/templates/ # template CLAUDE.md ของ target (installer ใช้เอง — ไม่ถูก copy ไป target)
67
+
68
+ .claude/ # adapter Claude Code (ชี้กลับ playbook กลาง)
69
+ commands/warnyin/ # slash command /warnyin:*
70
+ agents/ # reviewer subagent warnyin-{sa,tech-lead,qa,security,infra} + warnyin-ux (generator วาด wireframe ที่ step 4.5; แยกจาก reviewer 5 ตัว ไม่ใช่ reviewer ที่ 6)
71
+ CLAUDE.md AGENTS.md # adapter + pointer ของ Claude / Codex·Antigravity
72
+
73
+ docs/ # ความรู้ถาวรระดับโปรเจกต์ + งานจริงของจริงล้วน (seed จาก template/docs)
74
+ project.md # ★ จุดเริ่มของ Discovery — อ่านก่อนเสมอ
75
+ rule.md infra.md
76
+ troubleshooting.md # ★ KB ปัญหา-วิธีแก้ (อ่านก่อนเมื่อ build เจอ error; SHIP ป้อนเข้า)
77
+ codemap/ features/ techstack/
78
+ stages/ # พื้นที่ทำงานจริง ตาม topic (<slug>/) + achieved/<YYYY-MM-DD>-<slug>/ หลัง SHIP
79
+ ```
80
+ ```
81
+
82
+ ---
83
+
84
+ ## การติดตั้งไปโปรเจกต์อื่น
85
+
86
+ ```bash
87
+ cd my-project
88
+ npx @warnyin/agents # ติดตั้ง (ข้ามไฟล์ที่มีอยู่ ไม่เขียนทับ)
89
+ npx @warnyin/agents --update # อัปเดต playbook กลางเป็นเวอร์ชันล่าสุด
90
+ npx @warnyin/agents --dry-run # ดูก่อนว่าจะสร้าง/อัปเดตอะไร
91
+ # ทางสำรอง (ไม่ผ่าน npm): npx github:warnyin/warnyin-agents
92
+ ```
93
+
94
+ - โปรเจกต์ที่มี `CLAUDE.md`/`AGENTS.md` อยู่แล้ว installer ต่อท้ายเป็น section ไม่เขียนทับ
95
+ - `--update` เขียนทับเฉพาะ core (`.warnyin/workflow/`, `.claude/commands/warnyin/`, template ใน `.warnyin/template/`) ไม่แตะ `docs/` และงานจริง
96
+ - หลังติดตั้ง → เปิด Claude Code แล้วรัน `/warnyin:init` ให้ agent วิเคราะห์โปรเจกต์ + เติม `docs/` (playbook: `.warnyin/workflow/init.md`)
97
+
98
+ ## วิธีใช้
99
+
100
+ 1. เริ่มงานใหม่ copy `.warnyin/template/stages/[topic]/` เป็น `docs/stages/<ชื่อ-งาน-kebab-case>/`
101
+ 2. รัน stage ตามลำดับ (Discovery ข้ามได้ถ้าเข้าใจ scope ชัดแล้ว)
102
+ - Claude Code: `/warnyin:discovery <topic> [mode]`, `/warnyin:design <slug> <change>`
103
+ - mode (ความเข้ม Discovery): `ไว` | `สมดุล` | `ละเอียด` | `โต้วาที` | `ไต่สวน` — ไม่ระบุ → auto-suggest (ดู playbook `discovery.md` section "Discovery modes (ความเข้มของ Discovery)")
104
+ - Codex / Antigravity: บอกให้ทำตาม `.warnyin/workflow/stages/<stage>.md`
105
+ 3. ผ่าน "gate" ของแต่ละ stage แล้วจึงไป stage ถัดไป
106
+ 4. เมื่อ SHIP (`/warnyin:ship <slug>`) → promote ความรู้ของ topic ขึ้นเอกสารกลางใน `docs/`
107
+ แล้วย้าย topic ไป `docs/stages/achieved/<YYYY-MM-DD>-<topic>/`