@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,93 +1,93 @@
1
- # API-DOC — เอกสาร REST API (OpenAPI 3.1) แบบ adaptive
2
-
3
- > **Playbook กลาง — AI ทุกเจ้าทำตามไฟล์นี้ชุดเดียวกัน** (Claude Code / Codex / Antigravity / อื่นๆ)
4
- > เป้าหมาย: ถ้า topic **แตะ backend/REST API จริง** → ผลิต + ยืนยัน + ส่งมอบ **OpenAPI 3.1 contract** ให้อัตโนมัติ ตลอด lifecycle (DESIGN → VERIFY → SHIP)
5
-
6
- ---
7
-
8
- ## 1. คืออะไร / ใช้เมื่อไหร่
9
-
10
- API-DOC ไม่ใช่ stage แยก และ **ไม่มี slash command** — เป็น **capability เสริมที่ stage เรียกใช้เอง** เมื่อ auto-detect พบว่า topic เกี่ยวกับ REST API
11
-
12
- - ทำงานเป็นส่วนหนึ่งของ DESIGN / VERIFY / SHIP — stage playbook ชี้มาที่ไฟล์นี้
13
- - **adaptive:** ตรวจ signal ทุก topic — ถ้า **ไม่ใช่** backend/REST API → **ข้ามทั้งหมดเงียบๆ** (ไม่ยัดเยียด ไม่สร้างไฟล์เปล่า)
14
- - tool-agnostic: เป็นมาตรฐาน OpenAPI 3.1 ล้วน ไม่ผูกกับ AI เจ้าใดหรือเฟรมเวิร์กใด
15
-
16
- ---
17
-
18
- ## 2. Auto-detect — topic นี้แตะ REST API ไหม?
19
-
20
- ดูสัญญาณต่อไปนี้ (เจอ **อย่างน้อยหนึ่ง** ที่ชัดเจน = ใช่):
21
-
22
- 1. **techstack** — `docs/techstack/<component>/about.md` ระบุว่าเป็น backend/HTTP service / REST / web API
23
- 2. **route ในโค้ด** — มี handler/controller ที่ผูก HTTP route เช่น Express/Fastify/NestJS/Koa/Hapi, FastAPI/Flask/Django REST, Spring/Gin/Echo, ASP.NET ฯลฯ
24
- 3. **annotation/decorator** ที่ gen spec ได้อยู่แล้ว — tsoa, springdoc, drf-spectacular, FastAPI (Pydantic)
25
- 4. **task ถูกจัดเป็น "API task"** ตอนแตก spec (design.md §6)
26
- 5. **change เพิ่ม/แก้ HTTP endpoint** — request/response/error/auth/status code เปลี่ยน
27
-
28
- > สัญญาณคลุมเครือ (เช่น มีแค่ internal function ไม่ใช่ HTTP, RPC/gRPC ที่ไม่ใช่ REST, CLI/library ล้วน) → **ไม่ใช่** → ข้าม
29
- > ไม่แน่ใจจริง → ถาม user ทีละข้อ + เสนอคำตอบที่แนะนำ (ตามหลัก "ห้ามเดา" ของทุก stage)
30
-
31
- ---
32
-
33
- ## 3. เลือกโหมด (เลือกตาม signal + ระยะของงาน)
34
-
35
- | โหมด | เมื่อไหร่ | วิธี |
36
- |---|---|---|
37
- | **Design-first** | endpoint **ใหม่** ยังไม่มีโค้ด | เขียน `openapi.yaml` ก่อน (ตอน DESIGN) = contract ที่ BUILD จะ implement ตาม |
38
- | **Code-first** | API **มีอยู่แล้ว** + เฟรมเวิร์ก gen spec ได้ (FastAPI/tsoa ฯลฯ) | generate spec จากโค้ด แล้วตรวจ/เก็บเป็น artifact |
39
- | **Hybrid** | โค้ดมี annotation/decorator แต่ยังไม่ครบ | gen จาก annotation + เติม schema/example ที่ขาดด้วยมือ |
40
-
41
- โปรเจกต์เดียวกันใช้คนละโหมดต่อ topic ได้ — เลือกตามจริง
42
-
43
- ---
44
-
45
- ## 4. บทบาทต่อ stage
46
-
47
- ### DESIGN — ผลิต contract
48
- - detect (ข้อ 2) → ถ้าใช่: ผลิต/อัปเดต `docs/stages/<slug>/openapi.yaml` (OpenAPI 3.1)
49
- - endpoint ใหม่ → **design-first** เขียน contract ก่อน; API เดิม → **code-first/hybrid** gen จากโค้ดแล้วเติม
50
- - `tasks/<api-task>/spec.md` (API SPEC) **ชี้มาที่ `openapi.yaml`** — ไม่เขียน schema ซ้ำสองที่ (single source)
51
- - ถ้ามีเครื่องมือ lint ในโปรเจกต์ → รัน (ดูข้อ 5); ไม่มีก็ข้าม ไม่บังคับติดตั้ง
52
-
53
- ### VERIFY — ยืนยันว่าโค้ดจริงตรง contract
54
- - topic มี `openapi.yaml` → **contract validation**: ยืนยันว่า implementation จริง = contract
55
- - code-first: regen spec จากโค้ด → diff กับ `openapi.yaml` (ต้องไม่ต่าง)
56
- - หรือยิง request จริงใน local env → ตรวจ response ตรง schema/status/error ที่ระบุ
57
- - **★ runtime security:** การ regen (boot app จริง — FastAPI/tsoa) หรือยิง request จริง อยู่ใต้ runtime-security ของ `verify.md` §2 (local-only, scoped credential, no prod, no unnecessary egress) — ทบทวนก่อนปล่อย agent แตะของจริง
58
- - mismatch = **ไม่ผ่าน** → แก้ (โค้ด หรือ contract ตามต้นเหตุจริง) วนจนตรง — นับเป็นส่วนหนึ่งของ fix loop ใน verify.md §4
59
-
60
- ### SHIP — promote contract ขึ้นเอกสารกลาง
61
- - ยก `openapi.yaml` → **`docs/techstack/<component>/openapi.yaml`** = living API contract ถาวร (เทียบเท่า `spec.md` ที่เป็น living behavior spec)
62
- - มี contract เดิมอยู่แล้ว → **merge ตาม delta** (เพิ่ม/แก้/ลบ path·schema ที่ topic แตะ) ไม่ทับทั้งไฟล์
63
- - อ้างถึงจาก `docs/features/<name>/spec.md` ของ feature ที่ใช้ endpoint นั้น
64
-
65
- ---
66
-
67
- ## 5. มาตรฐาน + เครื่องมือ (reference ไม่ vendor)
68
-
69
- - **มาตรฐาน:** OpenAPI **3.1.0** — `info`/`servers`/`paths`/`components.schemas`/`components.securitySchemes`; ใช้ `$ref` reuse, ใส่ `examples`, ระบุ error + status code + auth scheme ครบ, อย่า hardcode URL (ใช้ server variable)
70
- - **★ secret hygiene (บังคับ — `openapi.yaml` ถูก commit ถาวร):** ก่อน commit/promote ต้อง **scrub** — `servers.url` ใช้ placeholder/variable (ไม่ใช่ internal/staging host จริง), `examples`/`example`/default ใช้ค่า dummy (`user@example.com`, `<token>`) **ห้าม secret/credential/PII จริง**, `securitySchemes` ระบุแค่รูปแบบ ไม่ใส่ค่า token จริง — โดยเฉพาะตอน code-first gen จากโค้ด ที่ค่าจริงมักหลุดติดมา (สอด `docs/rule.md` §3.2 + spec convention "ค่าสังเคราะห์เท่านั้น")
71
- - **เครื่องมือ (ติดตั้งเองเมื่ออยากใช้ — ไม่ผูกใน workflow):**
72
-
73
- | งาน | เครื่องมือ | คำสั่งตัวอย่าง |
74
- |---|---|---|
75
- | lint spec | Spectral | `spectral lint openapi.yaml` |
76
- | lint/bundle/preview | Redocly CLI | `redocly lint openapi.yaml` |
77
- | gen client SDK | OpenAPI Generator | `openapi-generator-cli generate -i openapi.yaml -g typescript-fetch -o ./gen/ts` |
78
- | gen จากโค้ด | FastAPI (auto), tsoa (`@Route`/`@Get`) | ตามเฟรมเวิร์ก |
79
-
80
- - **Skill อ้างอิง (optional):** `openapi-spec-generation` — template library เต็ม (full API spec, FastAPI, tsoa, Spectral ruleset, SDK gen)
81
- ที่มา: `wshobson/agents` → `plugins/documentation-generation/skills/openapi-spec-generation/`
82
- (`SKILL.md` + `references/details.md` + `references/code-first-and-tooling.md`) — โปรเจกต์ไหนอยากได้ template สำเร็จรูปค่อยติดตั้ง
83
-
84
- ---
85
-
86
- ## 6. ที่อยู่ของ artifact
87
-
88
- | ระยะ | ที่ | หมายเหตุ |
89
- |---|---|---|
90
- | ระหว่างงาน | `docs/stages/<slug>/openapi.yaml` | optional — เฉพาะ topic ที่แตะ REST API |
91
- | ถาวร (หลัง SHIP) | `docs/techstack/<component>/openapi.yaml` | living API contract — SHIP merge ตาม delta |
92
-
93
- > **`<component>` resolution (ห้ามเดา):** topic แตะ **หลาย component** หรือ component ที่ **ยังไม่มีใน `docs/techstack/`** → ถาม user ว่าจะวาง contract ที่ component ไหน / สร้าง techstack entry ก่อนไหม — ไม่เดาเอง
1
+ # API-DOC — เอกสาร REST API (OpenAPI 3.1) แบบ adaptive
2
+
3
+ > **Playbook กลาง — AI ทุกเจ้าทำตามไฟล์นี้ชุดเดียวกัน** (Claude Code / Codex / Antigravity / อื่นๆ)
4
+ > เป้าหมาย: ถ้า topic **แตะ backend/REST API จริง** → ผลิต + ยืนยัน + ส่งมอบ **OpenAPI 3.1 contract** ให้อัตโนมัติ ตลอด lifecycle (DESIGN → VERIFY → SHIP)
5
+
6
+ ---
7
+
8
+ ## 1. คืออะไร / ใช้เมื่อไหร่
9
+
10
+ API-DOC ไม่ใช่ stage แยก และ **ไม่มี slash command** — เป็น **capability เสริมที่ stage เรียกใช้เอง** เมื่อ auto-detect พบว่า topic เกี่ยวกับ REST API
11
+
12
+ - ทำงานเป็นส่วนหนึ่งของ DESIGN / VERIFY / SHIP — stage playbook ชี้มาที่ไฟล์นี้
13
+ - **adaptive:** ตรวจ signal ทุก topic — ถ้า **ไม่ใช่** backend/REST API → **ข้ามทั้งหมดเงียบๆ** (ไม่ยัดเยียด ไม่สร้างไฟล์เปล่า)
14
+ - tool-agnostic: เป็นมาตรฐาน OpenAPI 3.1 ล้วน ไม่ผูกกับ AI เจ้าใดหรือเฟรมเวิร์กใด
15
+
16
+ ---
17
+
18
+ ## 2. Auto-detect — topic นี้แตะ REST API ไหม?
19
+
20
+ ดูสัญญาณต่อไปนี้ (เจอ **อย่างน้อยหนึ่ง** ที่ชัดเจน = ใช่):
21
+
22
+ 1. **techstack** — `docs/techstack/<component>/about.md` ระบุว่าเป็น backend/HTTP service / REST / web API
23
+ 2. **route ในโค้ด** — มี handler/controller ที่ผูก HTTP route เช่น Express/Fastify/NestJS/Koa/Hapi, FastAPI/Flask/Django REST, Spring/Gin/Echo, ASP.NET ฯลฯ
24
+ 3. **annotation/decorator** ที่ gen spec ได้อยู่แล้ว — tsoa, springdoc, drf-spectacular, FastAPI (Pydantic)
25
+ 4. **task ถูกจัดเป็น "API task"** ตอนแตก spec (design.md §6)
26
+ 5. **change เพิ่ม/แก้ HTTP endpoint** — request/response/error/auth/status code เปลี่ยน
27
+
28
+ > สัญญาณคลุมเครือ (เช่น มีแค่ internal function ไม่ใช่ HTTP, RPC/gRPC ที่ไม่ใช่ REST, CLI/library ล้วน) → **ไม่ใช่** → ข้าม
29
+ > ไม่แน่ใจจริง → ถาม user ทีละข้อ + เสนอคำตอบที่แนะนำ (ตามหลัก "ห้ามเดา" ของทุก stage)
30
+
31
+ ---
32
+
33
+ ## 3. เลือกโหมด (เลือกตาม signal + ระยะของงาน)
34
+
35
+ | โหมด | เมื่อไหร่ | วิธี |
36
+ |---|---|---|
37
+ | **Design-first** | endpoint **ใหม่** ยังไม่มีโค้ด | เขียน `openapi.yaml` ก่อน (ตอน DESIGN) = contract ที่ BUILD จะ implement ตาม |
38
+ | **Code-first** | API **มีอยู่แล้ว** + เฟรมเวิร์ก gen spec ได้ (FastAPI/tsoa ฯลฯ) | generate spec จากโค้ด แล้วตรวจ/เก็บเป็น artifact |
39
+ | **Hybrid** | โค้ดมี annotation/decorator แต่ยังไม่ครบ | gen จาก annotation + เติม schema/example ที่ขาดด้วยมือ |
40
+
41
+ โปรเจกต์เดียวกันใช้คนละโหมดต่อ topic ได้ — เลือกตามจริง
42
+
43
+ ---
44
+
45
+ ## 4. บทบาทต่อ stage
46
+
47
+ ### DESIGN — ผลิต contract
48
+ - detect (ข้อ 2) → ถ้าใช่: ผลิต/อัปเดต `docs/stages/<slug>/openapi.yaml` (OpenAPI 3.1)
49
+ - endpoint ใหม่ → **design-first** เขียน contract ก่อน; API เดิม → **code-first/hybrid** gen จากโค้ดแล้วเติม
50
+ - `tasks/<api-task>/spec.md` (API SPEC) **ชี้มาที่ `openapi.yaml`** — ไม่เขียน schema ซ้ำสองที่ (single source)
51
+ - ถ้ามีเครื่องมือ lint ในโปรเจกต์ → รัน (ดูข้อ 5); ไม่มีก็ข้าม ไม่บังคับติดตั้ง
52
+
53
+ ### VERIFY — ยืนยันว่าโค้ดจริงตรง contract
54
+ - topic มี `openapi.yaml` → **contract validation**: ยืนยันว่า implementation จริง = contract
55
+ - code-first: regen spec จากโค้ด → diff กับ `openapi.yaml` (ต้องไม่ต่าง)
56
+ - หรือยิง request จริงใน local env → ตรวจ response ตรง schema/status/error ที่ระบุ
57
+ - **★ runtime security:** การ regen (boot app จริง — FastAPI/tsoa) หรือยิง request จริง อยู่ใต้ runtime-security ของ `verify.md` §2 (local-only, scoped credential, no prod, no unnecessary egress) — ทบทวนก่อนปล่อย agent แตะของจริง
58
+ - mismatch = **ไม่ผ่าน** → แก้ (โค้ด หรือ contract ตามต้นเหตุจริง) วนจนตรง — นับเป็นส่วนหนึ่งของ fix loop ใน verify.md §4
59
+
60
+ ### SHIP — promote contract ขึ้นเอกสารกลาง
61
+ - ยก `openapi.yaml` → **`docs/techstack/<component>/openapi.yaml`** = living API contract ถาวร (เทียบเท่า `spec.md` ที่เป็น living behavior spec)
62
+ - มี contract เดิมอยู่แล้ว → **merge ตาม delta** (เพิ่ม/แก้/ลบ path·schema ที่ topic แตะ) ไม่ทับทั้งไฟล์
63
+ - อ้างถึงจาก `docs/features/<name>/spec.md` ของ feature ที่ใช้ endpoint นั้น
64
+
65
+ ---
66
+
67
+ ## 5. มาตรฐาน + เครื่องมือ (reference ไม่ vendor)
68
+
69
+ - **มาตรฐาน:** OpenAPI **3.1.0** — `info`/`servers`/`paths`/`components.schemas`/`components.securitySchemes`; ใช้ `$ref` reuse, ใส่ `examples`, ระบุ error + status code + auth scheme ครบ, อย่า hardcode URL (ใช้ server variable)
70
+ - **★ secret hygiene (บังคับ — `openapi.yaml` ถูก commit ถาวร):** ก่อน commit/promote ต้อง **scrub** — `servers.url` ใช้ placeholder/variable (ไม่ใช่ internal/staging host จริง), `examples`/`example`/default ใช้ค่า dummy (`user@example.com`, `<token>`) **ห้าม secret/credential/PII จริง**, `securitySchemes` ระบุแค่รูปแบบ ไม่ใส่ค่า token จริง — โดยเฉพาะตอน code-first gen จากโค้ด ที่ค่าจริงมักหลุดติดมา (สอด `docs/rule.md` §3.2 + spec convention "ค่าสังเคราะห์เท่านั้น")
71
+ - **เครื่องมือ (ติดตั้งเองเมื่ออยากใช้ — ไม่ผูกใน workflow):**
72
+
73
+ | งาน | เครื่องมือ | คำสั่งตัวอย่าง |
74
+ |---|---|---|
75
+ | lint spec | Spectral | `spectral lint openapi.yaml` |
76
+ | lint/bundle/preview | Redocly CLI | `redocly lint openapi.yaml` |
77
+ | gen client SDK | OpenAPI Generator | `openapi-generator-cli generate -i openapi.yaml -g typescript-fetch -o ./gen/ts` |
78
+ | gen จากโค้ด | FastAPI (auto), tsoa (`@Route`/`@Get`) | ตามเฟรมเวิร์ก |
79
+
80
+ - **Skill อ้างอิง (optional):** `openapi-spec-generation` — template library เต็ม (full API spec, FastAPI, tsoa, Spectral ruleset, SDK gen)
81
+ ที่มา: `wshobson/agents` → `plugins/documentation-generation/skills/openapi-spec-generation/`
82
+ (`SKILL.md` + `references/details.md` + `references/code-first-and-tooling.md`) — โปรเจกต์ไหนอยากได้ template สำเร็จรูปค่อยติดตั้ง
83
+
84
+ ---
85
+
86
+ ## 6. ที่อยู่ของ artifact
87
+
88
+ | ระยะ | ที่ | หมายเหตุ |
89
+ |---|---|---|
90
+ | ระหว่างงาน | `docs/stages/<slug>/openapi.yaml` | optional — เฉพาะ topic ที่แตะ REST API |
91
+ | ถาวร (หลัง SHIP) | `docs/techstack/<component>/openapi.yaml` | living API contract — SHIP merge ตาม delta |
92
+
93
+ > **`<component>` resolution (ห้ามเดา):** topic แตะ **หลาย component** หรือ component ที่ **ยังไม่มีใน `docs/techstack/`** → ถาม user ว่าจะวาง contract ที่ component ไหน / สร้าง techstack entry ก่อนไหม — ไม่เดาเอง
@@ -1,91 +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` เขียนแล้ว
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` เขียนแล้ว
@@ -1,51 +1,51 @@
1
- # Contexts — context profile กลางของ workflow
2
-
3
- > **แก่นกลาง tool-agnostic** — context card แต่ละใบคือ "posture ของทั้ง session" ในโหมดหนึ่ง
4
- > AI ทุกเจ้าใช้ไฟล์ชุดเดียวกัน: อ่านตอนเริ่ม stage เพื่อ set โหมดของ session แล้วทำงานตาม playbook เดิม
5
-
6
- ## หลักการ
7
-
8
- - **context = session-level posture** — วิธีคิด/ท่าทีรวมของ "ทั้ง session": ตอนนี้กำลังสำรวจ, กำลังสร้าง, หรือกำลังตรวจ
9
- - **role = task-level lens** ([`roles/`](../roles/README.md)) — มุมมอง/checklist ของ "หนึ่งบทบาทต่อหนึ่งงาน" (BA, Developer, QA, ...)
10
- - คนละมิติ ใช้คู่กันได้: เช่น session อยู่โหมด `build` (posture) + sub-agent สวม role `Developer` (lens ของงานนั้น)
11
- - context **ไม่ duplicate** checklist ของ stage playbook/role card — ชี้กลับ playbook เสมอ (single source of truth)
12
-
13
- ## ตาราง context ↔ stage
14
-
15
- | Stage playbook | Context ที่เข้าคู่ | เหตุผล |
16
- |---|---|---|
17
- | [`discovery.md`](../stages/discovery.md) | `research` | สำรวจ/เข้าใจก่อนตัดสิน |
18
- | [`design.md`](../stages/design.md) | `research` + `build` | ต้น = research (propose), ปลาย = build (แตก task) |
19
- | [`build.md`](../stages/build.md) | `build` | ลงมือสร้าง vertical slice |
20
- | [`verify.md`](../stages/verify.md) | `review` | ตรวจ/ยืนยันด้วยการรันจริง |
21
- | [`ship.md`](../stages/ship.md) | `review` | ตรวจความครบก่อนส่งมอบ/promote |
22
-
23
- ## วิธี activate (manual)
24
-
25
- - **AI หลัก:** ตอนเริ่ม stage → เปิด playbook stage นั้น เจอ callout "Context profile" ชี้มา → อ่าน context card → สวม posture แล้วทำงานตาม playbook
26
- - **User สั่งตรง:** บอกโหมดได้ชัดๆ เช่น "อยู่โหมด research" / "สวม build context" → AI อ่าน card ที่ตรง
27
- - playbook ทุก stage มี callout ชี้กลับมาที่ context ที่เข้าคู่ (reference graph วนกลับ ไม่ duplicate)
28
-
29
- ## โครงของ context card ทุกใบ
30
-
31
- 1. **Mindset** — วิธีคิดรวมของ session โหมดนี้ (2–4 บรรทัด)
32
- 2. **Do / Don't** — bullet สั้น 2 ฝั่ง: ทำ vs ห้าม
33
- 3. **Tool preference** — เครื่องมือที่ควรใช้ / เลี่ยง (read-only vs edit vs run) + **Model tier** (generic: deepest/balanced/cheap)
34
- 4. **ใช้คู่ stage ไหน** — ชี้ playbook stage ที่เข้าคู่ (→ ลิงก์)
35
-
36
- > เพิ่ม context ใหม่ = เพิ่มไฟล์ที่นี่ + ใส่ callout ใน playbook stage ที่เข้าคู่ + อัปเดตตารางด้านบน
37
- > (เก็บให้บาง opinionated — 3 context พอ; อย่าให้ไหลเป็น catalog)
38
-
39
- ## Model tier (generic — harness ตีเป็นรุ่นจริงเอง)
40
-
41
- แต่ละ context แนะนำ **model tier** ใน section "Tool preference" เพื่อคุม token/cost ตาม posture:
42
-
43
- | Context | Tier | งาน |
44
- |---|---|---|
45
- | `research` | `deepest reasoning` | สำรวจ / architecture / ตัดสินใจ trade-off |
46
- | `build` | `balanced` (worker เชิงกลไก → `cheap`) | implement vertical slice ตาม spec |
47
- | `review` | `balanced+` | ตรวจ/จับ bug — ไม่ลด (พลาดแพงกว่า token) |
48
-
49
- > **tool-agnostic:** ใช้ vocab generic **ไม่ผูกชื่อรุ่น/ผลิตภัณฑ์ของ harness ใด ๆ** — แต่ละ harness map tier → รุ่นเอง (เทียบแนวทาง model selection ของ harness เช่นไฟล์ rules ฝั่ง performance); เป็น **guidance** ไม่ใช่ enforce
50
-
51
- > **per-task ใน BUILD (เพิ่มจาก per-context):** นอกจาก tier ระดับ context ด้านบน BUILD ยังกำหนด **model tier ต่อ task** ได้ผ่าน field `Model tier` ใน `task.md` — ใช้ subset `{cheap, balanced, deepest}` (ไม่ระบุ = `balanced` ตาม context build); mapping: mechanical/scaffold/config → `cheap` · implement ตาม spec ปกติ → `balanced` · logic หนัก/security/algorithm/ไม่เคยทำ → `deepest`. orchestrator ใน command (adapter) map tier→รุ่นจริง แล้วส่งเข้า `build-wave` per task — payload คง generic ตามเดิม
1
+ # Contexts — context profile กลางของ workflow
2
+
3
+ > **แก่นกลาง tool-agnostic** — context card แต่ละใบคือ "posture ของทั้ง session" ในโหมดหนึ่ง
4
+ > AI ทุกเจ้าใช้ไฟล์ชุดเดียวกัน: อ่านตอนเริ่ม stage เพื่อ set โหมดของ session แล้วทำงานตาม playbook เดิม
5
+
6
+ ## หลักการ
7
+
8
+ - **context = session-level posture** — วิธีคิด/ท่าทีรวมของ "ทั้ง session": ตอนนี้กำลังสำรวจ, กำลังสร้าง, หรือกำลังตรวจ
9
+ - **role = task-level lens** ([`roles/`](../roles/README.md)) — มุมมอง/checklist ของ "หนึ่งบทบาทต่อหนึ่งงาน" (BA, Developer, QA, ...)
10
+ - คนละมิติ ใช้คู่กันได้: เช่น session อยู่โหมด `build` (posture) + sub-agent สวม role `Developer` (lens ของงานนั้น)
11
+ - context **ไม่ duplicate** checklist ของ stage playbook/role card — ชี้กลับ playbook เสมอ (single source of truth)
12
+
13
+ ## ตาราง context ↔ stage
14
+
15
+ | Stage playbook | Context ที่เข้าคู่ | เหตุผล |
16
+ |---|---|---|
17
+ | [`discovery.md`](../stages/discovery.md) | `research` | สำรวจ/เข้าใจก่อนตัดสิน |
18
+ | [`design.md`](../stages/design.md) | `research` + `build` | ต้น = research (propose), ปลาย = build (แตก task) |
19
+ | [`build.md`](../stages/build.md) | `build` | ลงมือสร้าง vertical slice |
20
+ | [`verify.md`](../stages/verify.md) | `review` | ตรวจ/ยืนยันด้วยการรันจริง |
21
+ | [`ship.md`](../stages/ship.md) | `review` | ตรวจความครบก่อนส่งมอบ/promote |
22
+
23
+ ## วิธี activate (manual)
24
+
25
+ - **AI หลัก:** ตอนเริ่ม stage → เปิด playbook stage นั้น เจอ callout "Context profile" ชี้มา → อ่าน context card → สวม posture แล้วทำงานตาม playbook
26
+ - **User สั่งตรง:** บอกโหมดได้ชัดๆ เช่น "อยู่โหมด research" / "สวม build context" → AI อ่าน card ที่ตรง
27
+ - playbook ทุก stage มี callout ชี้กลับมาที่ context ที่เข้าคู่ (reference graph วนกลับ ไม่ duplicate)
28
+
29
+ ## โครงของ context card ทุกใบ
30
+
31
+ 1. **Mindset** — วิธีคิดรวมของ session โหมดนี้ (2–4 บรรทัด)
32
+ 2. **Do / Don't** — bullet สั้น 2 ฝั่ง: ทำ vs ห้าม
33
+ 3. **Tool preference** — เครื่องมือที่ควรใช้ / เลี่ยง (read-only vs edit vs run) + **Model tier** (generic: deepest/balanced/cheap)
34
+ 4. **ใช้คู่ stage ไหน** — ชี้ playbook stage ที่เข้าคู่ (→ ลิงก์)
35
+
36
+ > เพิ่ม context ใหม่ = เพิ่มไฟล์ที่นี่ + ใส่ callout ใน playbook stage ที่เข้าคู่ + อัปเดตตารางด้านบน
37
+ > (เก็บให้บาง opinionated — 3 context พอ; อย่าให้ไหลเป็น catalog)
38
+
39
+ ## Model tier (generic — harness ตีเป็นรุ่นจริงเอง)
40
+
41
+ แต่ละ context แนะนำ **model tier** ใน section "Tool preference" เพื่อคุม token/cost ตาม posture:
42
+
43
+ | Context | Tier | งาน |
44
+ |---|---|---|
45
+ | `research` | `deepest reasoning` | สำรวจ / architecture / ตัดสินใจ trade-off |
46
+ | `build` | `balanced` (worker เชิงกลไก → `cheap`) | implement vertical slice ตาม spec |
47
+ | `review` | `balanced+` | ตรวจ/จับ bug — ไม่ลด (พลาดแพงกว่า token) |
48
+
49
+ > **tool-agnostic:** ใช้ vocab generic **ไม่ผูกชื่อรุ่น/ผลิตภัณฑ์ของ harness ใด ๆ** — แต่ละ harness map tier → รุ่นเอง (เทียบแนวทาง model selection ของ harness เช่นไฟล์ rules ฝั่ง performance); เป็น **guidance** ไม่ใช่ enforce
50
+
51
+ > **per-task ใน BUILD (เพิ่มจาก per-context):** นอกจาก tier ระดับ context ด้านบน BUILD ยังกำหนด **model tier ต่อ task** ได้ผ่าน field `Model tier` ใน `task.md` — ใช้ subset `{cheap, balanced, deepest}` (ไม่ระบุ = `balanced` ตาม context build); mapping: mechanical/scaffold/config → `cheap` · implement ตาม spec ปกติ → `balanced` · logic หนัก/security/algorithm/ไม่เคยทำ → `deepest`. orchestrator ใน command (adapter) map tier→รุ่นจริง แล้วส่งเข้า `build-wave` per task — payload คง generic ตามเดิม
@@ -1,25 +1,26 @@
1
- # Context — build (โหมดลงมือสร้าง vertical slice)
2
-
3
- > session-level posture · playbook: `.warnyin/workflow/stages/*`
4
-
5
- ## Mindset
6
- ส่งมอบ vertical slice ที่ทำงานจริง end-to-end — ทำตาม spec/standard/rule ของ task
7
- slice เล็กจบในตัว, "เขียว" ต้องเขียวจริงจากการรัน ไม่ใช่คาดว่าเขียว
8
-
9
- ## Do / Don't
10
- - ทำตาม task spec ครบทุกข้อ ไม่เกิน/ไม่ต่ำ
11
- - ✅ อ่าน `troubleshooting.md` ก่อนแก้ error
12
- - ✅ reuse shared component ใน standard ก่อนเขียนใหม่
13
- - ✅ commit เล็ก โฟกัสทีละ slice
14
- - หลุด scope ของ task
15
- - ❌ เดา spec กลับไปอ่าน design / ถาม
16
- - ❌ แก้ rule กลาง (note ไว้ รอ SHIP)
17
-
18
- ## Tool preference
19
- - **ควรใช้:** Edit / Write / Bash, sub-agent fan-out, `build-wave`
20
- - **เลี่ยง:** แก้นอก scope task, แตะ rule/standard กลางใน `docs/`
21
- - **Model tier:** `balanced` (orchestrator/main loop ที่ตัดสินใจ integrate); **fan-out worker per task** ตาม field `Model tier` ใน `task.md` (subset `{cheap, balanced, deepest}`; ไม่ระบุ = `balanced`): mechanical/scaffold/config `cheap` · implement ตาม spec ปกติ → `balanced` · logic หนัก/security/algorithm/ไม่เคยทำ → `deepest` (คุม token/cost ต่อ agent — ดู `contexts/README.md` §"Model tier")
22
-
23
- ## ใช้คู่ stage ไหน
24
- - ปลาย DESIGN (แตก task) → [`stages/design.md`](../stages/design.md)
25
- - BUILD → [`stages/build.md`](../stages/build.md)
1
+ # Context — build (โหมดลงมือสร้าง vertical slice)
2
+
3
+ > session-level posture · playbook: `.warnyin/workflow/stages/*`
4
+
5
+ ## Mindset
6
+ ส่งมอบ vertical slice ที่ทำงานจริง end-to-end — ทำตาม spec/standard/rule ของ task
7
+ slice เล็กจบในตัว, "เขียว" ต้องเขียวจริงจากการรัน ไม่ใช่คาดว่าเขียว
8
+ เขียนน้อยที่สุด: เดิน decision hierarchy (YAGNI→stdlib→native→dep→one-liner→ขั้นต่ำ) ก่อนเขียนทุกบรรทัด — ดู [`minimalism`](../minimalism.md)
9
+
10
+ ## Do / Don't
11
+ - ✅ ทำตาม task spec ครบทุกข้อ ไม่เกิน/ไม่ต่ำ
12
+ - ✅ อ่าน `troubleshooting.md` ก่อนแก้ error
13
+ - ✅ reuse shared component ใน standard ก่อนเขียนใหม่
14
+ - commit เล็ก โฟกัสทีละ slice
15
+ - ❌ หลุด scope ของ task
16
+ - ❌ เดา spec กลับไปอ่าน design / ถาม
17
+ - ❌ แก้ rule กลาง (note ไว้ รอ SHIP)
18
+
19
+ ## Tool preference
20
+ - **ควรใช้:** Edit / Write / Bash, sub-agent fan-out, `build-wave`
21
+ - **เลี่ยง:** แก้นอก scope task, แตะ rule/standard กลางใน `docs/`
22
+ - **Model tier:** `balanced` (orchestrator/main loop ที่ตัดสินใจ integrate); **fan-out worker per task** ตาม field `Model tier` ใน `task.md` (subset `{cheap, balanced, deepest}`; ไม่ระบุ = `balanced`): mechanical/scaffold/config → `cheap` · implement ตาม spec ปกติ → `balanced` · logic หนัก/security/algorithm/ไม่เคยทำ → `deepest` (คุม token/cost ต่อ agent — ดู `contexts/README.md` §"Model tier")
23
+
24
+ ## ใช้คู่ stage ไหน
25
+ - ปลาย DESIGN (แตก task) → [`stages/design.md`](../stages/design.md)
26
+ - BUILD → [`stages/build.md`](../stages/build.md)
@@ -1,25 +1,25 @@
1
- # Context — research (โหมดสำรวจ/เข้าใจก่อนตัดสิน)
2
-
3
- > session-level posture · playbook: `.warnyin/workflow/stages/*`
4
-
5
- ## Mindset
6
- เข้าใจก่อนตัดสิน — กว้างก่อนลึก ตั้งคำถาม > รีบสรุป
7
- สำรวจของจริง (โค้ด/เอกสาร) ไม่เดาจากความเคยชิน; สะสม evidence ให้พอก่อนเสนอทางเลือก
8
-
9
- ## Do / Don't
10
- - ✅ อ่านโค้ด/เอกสารจริง ก่อนสรุปทุกครั้ง
11
- - ✅ ถามทีละข้อ + เสนอคำตอบให้ user ยืนยัน
12
- - ✅ บันทึก evidence (path/บรรทัด) ที่อ้างอิง
13
- - ❌ เดา/สรุปจากความเคยชินโดยไม่ยืนยัน
14
- - ❌ แก้ไฟล์ production ระหว่างสำรวจ
15
- - ❌ รีบสรุปก่อน scope ชัด
16
-
17
- ## Tool preference
18
- - **ควรใช้:** read-only — Read / Grep / Glob / fast-context, `/warnyin:explore`
19
- - **เลี่ยง:** Edit / Write โค้ดจริง, คำสั่งที่เปลี่ยน state
20
- - **Model tier:** `deepest reasoning` — สำรวจ/architecture/ตัดสินใจ trade-off = งานคิดหนัก คุ้มใช้ตัวลึกสุด
21
-
22
- ## ใช้คู่ stage ไหน
23
- - Discovery → [`stages/discovery.md`](../stages/discovery.md)
24
- - ช่วงต้น DESIGN (เก็บ context ก่อน propose) → [`stages/design.md`](../stages/design.md)
25
- - เช็คงานค้าง → [`next.md`](../next.md)
1
+ # Context — research (โหมดสำรวจ/เข้าใจก่อนตัดสิน)
2
+
3
+ > session-level posture · playbook: `.warnyin/workflow/stages/*`
4
+
5
+ ## Mindset
6
+ เข้าใจก่อนตัดสิน — กว้างก่อนลึก ตั้งคำถาม > รีบสรุป
7
+ สำรวจของจริง (โค้ด/เอกสาร) ไม่เดาจากความเคยชิน; สะสม evidence ให้พอก่อนเสนอทางเลือก
8
+
9
+ ## Do / Don't
10
+ - ✅ อ่านโค้ด/เอกสารจริง ก่อนสรุปทุกครั้ง
11
+ - ✅ ถามทีละข้อ + เสนอคำตอบให้ user ยืนยัน
12
+ - ✅ บันทึก evidence (path/บรรทัด) ที่อ้างอิง
13
+ - ❌ เดา/สรุปจากความเคยชินโดยไม่ยืนยัน
14
+ - ❌ แก้ไฟล์ production ระหว่างสำรวจ
15
+ - ❌ รีบสรุปก่อน scope ชัด
16
+
17
+ ## Tool preference
18
+ - **ควรใช้:** read-only — Read / Grep / Glob / fast-context, `/warnyin:explore`
19
+ - **เลี่ยง:** Edit / Write โค้ดจริง, คำสั่งที่เปลี่ยน state
20
+ - **Model tier:** `deepest reasoning` — สำรวจ/architecture/ตัดสินใจ trade-off = งานคิดหนัก คุ้มใช้ตัวลึกสุด
21
+
22
+ ## ใช้คู่ stage ไหน
23
+ - Discovery → [`stages/discovery.md`](../stages/discovery.md)
24
+ - ช่วงต้น DESIGN (เก็บ context ก่อน propose) → [`stages/design.md`](../stages/design.md)
25
+ - เช็คงานค้าง → [`next.md`](../next.md)