@warnyin/agents 0.6.0 → 0.8.4

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 (76) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +21 -1
  3. package/package.json +15 -9
  4. package/{.claude → src/.claude}/commands/warnyin/build.md +1 -0
  5. package/{.claude → src/.claude}/commands/warnyin/install-skill.md +1 -1
  6. package/{.claude → src/.claude}/commands/warnyin/ship.md +4 -3
  7. package/src/.claude/skills/explore/SKILL.md +8 -0
  8. package/src/.claude/skills/next/SKILL.md +8 -0
  9. package/src/.claude/skills/update-codemaps/SKILL.md +8 -0
  10. package/{.warnyin → src/.warnyin}/template/stages/[topic]/ship.md +6 -4
  11. package/{.warnyin → src/.warnyin}/workflow/README.md +15 -9
  12. package/src/.warnyin/workflow/contexts/README.md +37 -0
  13. package/src/.warnyin/workflow/contexts/build.md +24 -0
  14. package/src/.warnyin/workflow/contexts/research.md +24 -0
  15. package/src/.warnyin/workflow/contexts/review.md +24 -0
  16. package/{.warnyin → src/.warnyin}/workflow/roles/developer.md +2 -0
  17. package/{.warnyin → src/.warnyin}/workflow/roles/qa.md +2 -0
  18. package/{.warnyin → src/.warnyin}/workflow/roles/security.md +11 -1
  19. package/{.warnyin → src/.warnyin}/workflow/stages/build.md +3 -0
  20. package/{.warnyin → src/.warnyin}/workflow/stages/design.md +1 -0
  21. package/{.warnyin → src/.warnyin}/workflow/stages/discovery.md +1 -0
  22. package/{.warnyin → src/.warnyin}/workflow/stages/ship.md +11 -6
  23. package/{.warnyin → src/.warnyin}/workflow/stages/verify.md +4 -0
  24. package/{bin → src/bin}/cli.mjs +8 -4
  25. package/CLAUDE.md +0 -40
  26. /package/{.claude → src/.claude}/agents/warnyin-infra.md +0 -0
  27. /package/{.claude → src/.claude}/agents/warnyin-qa.md +0 -0
  28. /package/{.claude → src/.claude}/agents/warnyin-sa.md +0 -0
  29. /package/{.claude → src/.claude}/agents/warnyin-security.md +0 -0
  30. /package/{.claude → src/.claude}/agents/warnyin-tech-lead.md +0 -0
  31. /package/{.claude → src/.claude}/commands/warnyin/design.md +0 -0
  32. /package/{.claude → src/.claude}/commands/warnyin/discovery.md +0 -0
  33. /package/{.claude → src/.claude}/commands/warnyin/explore.md +0 -0
  34. /package/{.claude → src/.claude}/commands/warnyin/init.md +0 -0
  35. /package/{.claude → src/.claude}/commands/warnyin/next.md +0 -0
  36. /package/{.claude → src/.claude}/commands/warnyin/update-codemaps.md +0 -0
  37. /package/{.claude → src/.claude}/commands/warnyin/verify.md +0 -0
  38. /package/{.warnyin → src/.warnyin}/installer/templates/CLAUDE.md +0 -0
  39. /package/{.warnyin → src/.warnyin}/template/docs/codemap/index.md +0 -0
  40. /package/{.warnyin → src/.warnyin}/template/docs/features/[feature-name]/business.md +0 -0
  41. /package/{.warnyin → src/.warnyin}/template/docs/features/[feature-name]/feature.md +0 -0
  42. /package/{.warnyin → src/.warnyin}/template/docs/infra.md +0 -0
  43. /package/{.warnyin → src/.warnyin}/template/docs/project.md +0 -0
  44. /package/{.warnyin → src/.warnyin}/template/docs/rule.md +0 -0
  45. /package/{.warnyin → src/.warnyin}/template/docs/techstack/[component]/about.md +0 -0
  46. /package/{.warnyin → src/.warnyin}/template/docs/techstack/[component]/rule.md +0 -0
  47. /package/{.warnyin → src/.warnyin}/template/docs/techstack/[component]/standard.md +0 -0
  48. /package/{.warnyin → src/.warnyin}/template/docs/techstack/[component]/structure.md +0 -0
  49. /package/{.warnyin → src/.warnyin}/template/docs/techstack/[component]/test.md +0 -0
  50. /package/{.warnyin → src/.warnyin}/template/docs/troubleshooting.md +0 -0
  51. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/build.md +0 -0
  52. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/business.md +0 -0
  53. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/design.md +0 -0
  54. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/discovery.md +0 -0
  55. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/proposal.md +0 -0
  56. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/research.md +0 -0
  57. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/tasks/[task-name]/issue.md +0 -0
  58. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/tasks/[task-name]/rule.md +0 -0
  59. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/tasks/[task-name]/spec.md +0 -0
  60. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/tasks/[task-name]/standard.md +0 -0
  61. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/tasks/[task-name]/task.md +0 -0
  62. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/test.md +0 -0
  63. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/troubleshooting.md +0 -0
  64. /package/{.warnyin → src/.warnyin}/template/stages/[topic]/verify.md +0 -0
  65. /package/{.warnyin → src/.warnyin}/workflow/codemap.md +0 -0
  66. /package/{.warnyin → src/.warnyin}/workflow/explore.md +0 -0
  67. /package/{.warnyin → src/.warnyin}/workflow/init.md +0 -0
  68. /package/{.warnyin → src/.warnyin}/workflow/next.md +0 -0
  69. /package/{.warnyin → src/.warnyin}/workflow/roles/README.md +0 -0
  70. /package/{.warnyin → src/.warnyin}/workflow/roles/ba.md +0 -0
  71. /package/{.warnyin → src/.warnyin}/workflow/roles/infra.md +0 -0
  72. /package/{.warnyin → src/.warnyin}/workflow/roles/po.md +0 -0
  73. /package/{.warnyin → src/.warnyin}/workflow/roles/sa.md +0 -0
  74. /package/{.warnyin → src/.warnyin}/workflow/roles/tech-lead.md +0 -0
  75. /package/{.warnyin → src/.warnyin}/workflow/scripts/build-wave.mjs +0 -0
  76. /package/{AGENTS.md → src/AGENTS.md} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,80 @@
1
+ # Changelog
2
+
3
+ ทุกการเปลี่ยนแปลงที่สำคัญของโปรเจกต์นี้ถูกบันทึกในไฟล์นี้
4
+
5
+ รูปแบบอ้างอิง [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
6
+ และโปรเจกต์ยึด [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
7
+
8
+ ## Migration guide
9
+
10
+ อัปเกรดจากรุ่นเก่าที่ layout ต่างไป (installer จะ **เตือนให้ย้ายเอง ไม่แตะงานจริงของคุณ**):
11
+
12
+ > **ลำดับที่แนะนำ: ย้ายงานจริงก่อน แล้วค่อยรัน `npx @warnyin/agents`**
13
+ > คำสั่งย้ายด้านล่างใช้รูปแบบ `git mv <เก่า>/* docs/stages/` (ย้าย *เนื้อหา* ไม่ใช่ทั้งโฟลเดอร์) จึงปลอดภัยทั้งกรณีที่ยังไม่มี `docs/stages/` และกรณีที่เผลอรัน installer ไปก่อน (installer สร้าง `docs/stages/` เปล่าให้แล้ว) — กันงานจริงไปซ้อนเป็น `docs/stages/stages/`
14
+
15
+ | จากรุ่น | layout เดิม | ต้องทำเอง (งานจริงปลอดภัย ไม่ถูกแตะ) |
16
+ |---|---|---|
17
+ | **≤0.2.x** | core `workflow/` + งานจริง `warnyin-stages/` ที่ root | `mkdir -p docs/stages && git mv warnyin-stages/* docs/stages/` แล้วลบ core เก่า `rm -rf workflow warnyin-stages` |
18
+ | **0.3–0.5.x** | ทุกอย่างใต้ `warnyin/{workflow,template,installer,stages}` | `mkdir -p docs/stages && git mv warnyin/stages/* docs/stages/` แล้วลบ core เก่า `rm -rf warnyin` |
19
+
20
+ จากนั้นรัน installer อีกครั้ง — installer จะวาง `.warnyin/` (core) ชุดใหม่ + แยกงานจริงไว้ที่ `docs/stages/` ให้
21
+
22
+ > **0.6.0 → 0.7.0:** ผู้ใช้ปลายทาง (`npx @warnyin/agents`) **ไม่ต้องทำอะไร** — payload ที่ติดตั้งคงเดิม การเปลี่ยนแปลงทั้งหมด (bin path → `src/`, dogfood 2-layer) เป็นเรื่องภายใน repo เท่านั้น; ผู้พัฒนา repo เอง (contributor) ดู [`CONTRIBUTING.md`](CONTRIBUTING.md)
23
+
24
+ ## [Unreleased]
25
+
26
+ ## [0.8.4] - 2026-06-07
27
+
28
+ ### Added
29
+ - **Utility skills (Claude adapter, auto-invocable)** — 3 safe utility skill ใหม่ `src/.claude/skills/{update-codemaps,explore,next}/SKILL.md` (`/update-codemaps`, `/explore`, `/next`): Claude project skill ที่ model **auto-invoke ได้เอง (description-driven)** body ชี้ playbook กลางเดิม (`.warnyin/workflow/{codemap,explore,next}.md`) ไม่ duplicate — auto-invoke เฉพาะ utility **read-only safe**; ผู้ใช้ปลายทางรับ skills อัตโนมัติตอน `npx @warnyin/agents` / `--update`. command `/warnyin:*` เดิม **ไม่เปลี่ยน** (non-breaking); build/ship คงเป็น command user-only (irreversible). global `docs/rule.md` §1 skill-adapter convention
30
+
31
+ ### Changed
32
+ - **installer/packaging รองรับ skills** — `cli.mjs` CORE +`.claude/skills`; `package.json files` +`src/.claude/skills` (nested dotfolder ระบุชัด); `verify-pack` ALLOWED_PREFIX +`src/.claude/skills/` + R1 assert `hasSkills` (skills เป็น required payload กันหล่นเงียบ); test suite 18→19 (verify-pack 9→10)
33
+
34
+ ## [0.8.3] - 2026-06-07
35
+
36
+ ### Added
37
+ - **Learned-rule capture ใน SHIP** — `ship.md` playbook (§3 principle 7 ขยาย + §4 step 1/3/5 + §6 gate) + command + template `[topic]/ship.md` (section "Learned rules"): จับ rule ที่ได้จากการทำจริง (planned + emergent จาก build/verify/troubleshooting) ด้วย `rule + evidence(บังคับ) + scope` แล้ว user ยืนยัน per-rule ก่อน promote — unify กับกลไก "รอ SHIP" เดิม; global `docs/rule.md` §1 + continuous-learning discipline + unify-in-place — `.md` ล้วน, ติดมากับ `--update` รอบถัดไป
38
+
39
+ ## [0.8.2] - 2026-06-07
40
+
41
+ ### Added
42
+ - **Security checklist (agent-runtime + supply-chain)** — `roles/security.md` เพิ่ม section "Runtime / operational security" (secret isolation · no-egress · identity separation + Claude adapter note) + checklist item supply-chain/MCP (prompt-injection surface); `verify.md` §2 อ้าง runtime security ตอนรัน local env; `install-skill.md` step 4 เสริม warning prompt-injection; global `docs/rule.md` §3 ขยายเป็น Security baseline 2 มิติ (CI + agent-runtime) — `.md` ล้วน, ติดมากับ `--update` รอบถัดไป
43
+
44
+ ## [0.8.1] - 2026-06-07
45
+
46
+ ### Added
47
+ - **Defensive rules** ใน BUILD/VERIFY playbook (§3) + developer.md/qa.md checklist + global `docs/rule.md` §1 — เวอร์ชัน enforce ของ "ห้ามเดา": (1) **investigate-before-edit** ก่อนแก้ไฟล์ที่มีอยู่ต้องเข้าใจ (ใครใช้/contract/เจตนา), (2) **config-protection** ห้ามแก้ config/test "เพื่อให้ผ่าน" แทนแก้โค้ดจริง — `.md` ล้วน, ติดมากับ `--update` รอบถัดไป
48
+
49
+ ## [0.8.0] - 2026-06-07
50
+
51
+ ### Added
52
+ - **Context profiles** (`.warnyin/workflow/contexts/{research,build,review,README}.md`) — session-level posture 3 โหมด (สำรวจ/สร้าง/ตรวจ) คู่ขนานกับ role card (task-level lens); playbook แต่ละ stage มี callout ชี้ context ที่เข้าคู่ (Discovery→research · DESIGN→research+build · BUILD→build · VERIFY→review · SHIP→review) — `.md` ล้วน, ติดมากับ `--update` รอบถัดไป ไม่ต้องตั้งค่าเพิ่ม
53
+
54
+ ### Fixed
55
+ - โครงสร้าง repo ใน `.warnyin/workflow/README.md` ให้ตรง layout จริงหลัง restructure 0.7.0 (`src/` layer + `.warnyin/`) — เดิมยังเป็น layout เก่า (`warnyin/`, `bin/cli.mjs`)
56
+
57
+ ## [0.7.0] - 2026-06-07
58
+
59
+ ### Added
60
+ - **Bootstrap / self-hosting (2-layer):** แยก source ของ warnyin ทั้งหมดเข้า `src/` (committed/publish layer); repo install release เสถียรไว้ root เป็น dogfood (`.warnyin/`/`.claude/`/`CLAUDE.md`/`AGENTS.md` — gitignored) เพื่อพัฒนา `src/` โดย workflow ที่ใช้ทำงานยังเสถียร
61
+ - `npm run setup:dogfood` — คืน dogfood env ที่ root จาก release (`npx @latest` + fallback `npm pack`→extract→node สำหรับ Windows), append pointer → `CONTRIBUTING.md` แบบ idempotent
62
+ - `npm run setup:sandbox` — install v-next จาก `src/` ลง temp dir (`os.tmpdir()`) เพื่อทดสอบ version skew โดยไม่แตะ dogfood ที่ root
63
+ - `CONTRIBUTING.md` — dev-instructions ของ repo (แยกจาก root `CLAUDE.md` เดิม)
64
+ - pass-count gate (`src/scripts/check-test-count.mjs`) — anti-false-green: fail ถ้า `fail≠0` / `pass<9` / `pass≠tests`
65
+ - Automated installer test suite (`node:test` black-box — spawn `src/bin/cli.mjs` จริงใน temp dir แล้ว assert side-effect) + unit test `checkFiles` รันด้วย `npm test`
66
+ - GitHub Actions CI (`.github/workflows/ci.yml`) — matrix node 20/22/24 + job `pack-verify`
67
+ - npm-pack verify (`src/scripts/verify-pack.mjs`) — testable `checkFiles(files)→errors[]`: allowlist granular + denylist (tooling/`docs/`/dogfood ที่ root) + tripwire (`settings.local.json`/`*.tgz`/`.env*`); assert `src/.warnyin/workflow/` + `src/.claude/commands/warnyin/` ติด tarball
68
+
69
+ ### Changed
70
+ - **bin path** `bin/cli.mjs` → `src/bin/cli.mjs` (restructure source เข้า `src/`) — `pkgRoot` resolve เป็น `src/` อัตโนมัติ, payload คงเดิม
71
+ - `package.json files` เป็น allowlist granular — nested dotfolder ระบุชัด (`src/.warnyin`, `src/.claude/commands`, `src/.claude/agents`); ตัด `src/tests`/`src/scripts` (dev-only)
72
+ - test/scripts ย้ายไป `src/tests/` + `src/scripts/`; `npm test` = `node --test` bare (auto-discover, portable node 20/22/24)
73
+ - `engines.node` `>=18` → `>=20` (node 18 EOL)
74
+ - `.gitignore` เพิ่ม dogfood layer (root-anchored ทุกบรรทัด — กัน match `src/.claude`/`src/.warnyin`)
75
+
76
+ ### Removed
77
+ - รองรับ node 18 (drop ตาม EOL)
78
+
79
+ [Unreleased]: https://github.com/warnyin/warnyin-agents/compare/v0.7.0...HEAD
80
+ [0.7.0]: https://github.com/warnyin/warnyin-agents/compare/v0.6.0...v0.7.0
package/README.md CHANGED
@@ -27,6 +27,8 @@ npx @warnyin/agents --update # อัปเดต playbook กลางเป
27
27
  - โปรเจกต์ที่มี `CLAUDE.md` / `AGENTS.md` อยู่แล้ว → installer **ต่อท้ายเป็น section** ไม่เขียนทับ
28
28
  - `--update` เขียนทับเฉพาะ core (`.warnyin/workflow/`, `.claude/commands/warnyin/`, template ใน `.warnyin/template/`) — ไม่แตะ `docs/` และงานจริง
29
29
 
30
+ > **อัปเกรดจากรุ่นเก่า?** (`workflow/` หรือ `warnyin/` layout) ดู [Migration guide](CHANGELOG.md#migration-guide) ก่อนรัน installer รอบใหม่
31
+
30
32
  ## เริ่มใช้งาน
31
33
 
32
34
  ```bash
@@ -61,7 +63,7 @@ AI แต่ละเครื่องมีแค่ adapter บางๆ ช
61
63
  ## โครงสร้างที่ติดตั้งลงโปรเจกต์
62
64
 
63
65
  ```
64
- warnyin/ # ★ ทุกอย่างของ workflow รวมใต้โฟลเดอร์เดียว
66
+ .warnyin/ # ★ ทุกอย่างของ workflow รวมใต้โฟลเดอร์เดียว
65
67
  workflow/ # playbook กลาง — single source of truth
66
68
  init.md # INIT: วิเคราะห์โปรเจกต์ + เติม docs/ ครั้งแรก
67
69
  roles/ # role card: BA · PO · SA · Tech Lead · Developer · QA · Security · Infra
@@ -108,9 +110,27 @@ role card กลางที่ `.warnyin/workflow/roles/` — แต่ละ
108
110
  - Tech Lead/Security ผูกกับ built-in `/code-review` และ `/security-review` ของ Claude Code
109
111
  - skill เสริมต่อ role ติดตั้งด้วย `/warnyin:install-skill` (รายการกลาง: `.warnyin/workflow/roles/README.md`)
110
112
 
113
+ ## พัฒนา repo นี้ (contributor)
114
+
115
+ repo นี้ใช้ **bootstrap / self-hosting**: source ของ workflow v-next อยู่ใน `src/` (committed/publish) ส่วน root ติดตั้ง release เสถียรไว้ dogfood (gitignored) — **clone แล้วต้อง bootstrap ก่อนใช้**:
116
+
117
+ ```bash
118
+ git clone https://github.com/warnyin/warnyin-agents.git
119
+ cd warnyin-agents
120
+ npm run setup:dogfood # ติดตั้ง release เสถียรลง root (.warnyin/.claude/CLAUDE.md/AGENTS.md — gitignored)
121
+ npm test # black-box test installer (node --test, discover src/tests/)
122
+ npm run setup:sandbox # ทดสอบ v-next จาก src/ ลง temp dir (version skew — dogfood ที่ root ไม่โดนแตะ)
123
+ ```
124
+
125
+ - พัฒนา workflow v-next ที่ `src/` · dogfood ที่ root = release เสถียร (แก้ `src/` ไม่กระทบ session ที่กำลังทำงาน)
126
+ - รายละเอียดเต็ม: [`CONTRIBUTING.md`](CONTRIBUTING.md)
127
+
111
128
  ## Release เวอร์ชันใหม่ (สำหรับผู้ดูแล repo นี้)
112
129
 
130
+ > publish payload มาจาก `src/` (allowlist `package.json files`) — `npm run verify:pack` เป็น gate ก่อน publish (CI ตรวจทุก PR): payload ต้องติด `src/.warnyin/`+`src/.claude/` ครบ ไม่มี tooling/docs รั่ว
131
+
113
132
  ```bash
133
+ npm run verify:pack # ตรวจ payload ก่อน (Windows: npm pack --dry-run --json → checkFiles)
114
134
  npm version patch # bump เวอร์ชัน + git tag
115
135
  npm publish # ขึ้น npm registry (มี OTP)
116
136
  git push --follow-tags
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warnyin/agents",
3
- "version": "0.6.0",
3
+ "version": "0.8.4",
4
4
  "description": "Warnyin Standard Workflow installer — 5-stage ways of work (Discovery/DESIGN/BUILD/VERIFY/SHIP) สำหรับทุกโปรเจกต์",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -8,18 +8,24 @@
8
8
  "access": "public"
9
9
  },
10
10
  "bin": {
11
- "warnyin-agents": "bin/cli.mjs"
11
+ "warnyin-agents": "src/bin/cli.mjs"
12
12
  },
13
13
  "scripts": {
14
- "test": "node --test"
14
+ "test": "node --test",
15
+ "verify:pack": "node src/scripts/verify-pack.mjs",
16
+ "setup:dogfood": "node src/scripts/setup-dogfood.mjs",
17
+ "setup:sandbox": "node src/scripts/setup-sandbox.mjs"
15
18
  },
16
19
  "files": [
17
- "bin",
18
- ".warnyin",
19
- ".claude/commands",
20
- ".claude/agents",
21
- "CLAUDE.md",
22
- "AGENTS.md"
20
+ "src/bin",
21
+ "src/.warnyin",
22
+ "src/.claude/commands",
23
+ "src/.claude/agents",
24
+ "src/.claude/skills",
25
+ "src/AGENTS.md",
26
+ "README.md",
27
+ "CHANGELOG.md",
28
+ "LICENSE"
23
29
  ],
24
30
  "engines": {
25
31
  "node": ">=20"
@@ -27,3 +27,4 @@ argument-hint: "[slug ของ topic]"
27
27
  - ห้ามแก้ rule/standard กลางใน `docs/` (rule ใหม่ที่เสนอถูก note ไว้ใน `tasks/<task>/rule.md` รอ SHIP)
28
28
  - ปัญหายาก/ซ้ำที่แก้ได้ → `docs/stages/<slug>/troubleshooting.md` (SHIP จะยกขึ้น `docs/troubleshooting.md`)
29
29
  - เกณฑ์ปิด BUILD ดู Gate ข้อ 7 ของ playbook
30
+ - คงเป็น command (user-only) โดยตั้งใจ — BUILD เป็น stateful/irreversible (สร้าง branch, fan-out, แก้ไฟล์) ต้องให้ user สั่งชัด ไม่ทำเป็น skill auto-invoke
@@ -8,7 +8,7 @@ argument-hint: "[ชื่อ role เช่น sa, qa — เว้นว่า
8
8
  1. อ่านตาราง **"Skill เสริมต่อ role"** ใน `.warnyin/workflow/roles/README.md` — นั่นคือ single source of truth ของรายการ skill (**ห้าม hardcode รายการในไฟล์นี้** — แก้รายการให้แก้ที่ตารางนั้น)
9
9
  2. **เช็คสถานะก่อน:** ตัวไหนติดตั้งแล้วบ้าง — ดูจาก `npx skills ls -g` (ถ้าไม่มีคำสั่งนี้ให้ดูโฟลเดอร์ `~/.agents/skills/` และ `~/.claude/skills/`) — สรุปเป็นตาราง ติดตั้งแล้ว ✅ / ยังไม่ติดตั้ง ⬜
10
10
  3. ขอบเขต: $ARGUMENTS ระบุ role → เฉพาะ skill ของ role นั้น; เว้นว่าง → ทุกตัวที่ยังไม่ติดตั้ง
11
- 4. **ให้ user เลือกก่อนติดตั้ง:** ใช้ AskUserQuestion (multiSelect) แสดงแต่ละตัวพร้อม ที่มา (`owner/repo@skill`) + คำเตือนว่าเป็น third-party (ไม่ใช่ official, ตรวจเนื้อหาได้ที่ skills.sh)
11
+ 4. **ให้ user เลือกก่อนติดตั้ง:** ใช้ AskUserQuestion (multiSelect) แสดงแต่ละตัวพร้อม ที่มา (`owner/repo@skill`) + คำเตือนว่าเป็น third-party (ไม่ใช่ official, ตรวจเนื้อหาได้ที่ skills.sh) — **third-party skill = instruction ที่ AI execute ต่อ (prompt-injection surface) ตรวจเนื้อหาก่อนติดตั้ง**
12
12
  5. **ติดตั้งทีละตัว:** `npx skills add <owner/repo@skill> -g -y` (global — reference ไม่ vendor เข้า repo) → รายงานผลรวม สำเร็จ/ล้มเหลว พร้อมวิธีแก้ถ้าล้ม
13
13
  6. รายการที่เป็น **Claude Code built-in** (`/code-review`, `/security-review`) ไม่ต้องติดตั้ง — แจ้งว่าพร้อมใช้อยู่แล้ว
14
14
  7. ปิดท้าย: แนะนำว่า role ไหนใน workflow จะหยิบ skill เหล่านี้ใช้ตอนไหน (ตาม section "Skill เสริม" ใน role card)
@@ -7,13 +7,13 @@ argument-hint: "[slug ของ topic]"
7
7
 
8
8
  1. อ่าน `.warnyin/workflow/stages/ship.md` ให้ครบก่อน แล้วทำตามทุกหลักการอย่างเคร่งครัด
9
9
  2. slug: $ARGUMENTS — ถ้าไม่ระบุให้ถามก่อน ว่าจะ ship topic ไหน (ดูโฟลเดอร์ใน `docs/stages/`)
10
- 3. **อ่านทำความเข้าใจ topic:** อ่าน `docs/stages/<slug>/` ทุกไฟล์ (รวม `tasks/*/rule.md` section "รอ SHIP" + `standard.md`) topic นี้ทำอะไร ทำอย่างไร เกิดความรู้ใหม่อะไรบ้าง; เช็คว่า VERIFY ผ่าน Gate แล้ว (`verify.md` สรุปผลผ่าน) ถ้ายังไม่ผ่าน หยุด แจ้ง user
10
+ 3. **อ่านทำความเข้าใจ topic + รวบรวม learned-rule candidate:** อ่าน `docs/stages/<slug>/` ทุกไฟล์ — topic นี้ทำอะไร ทำอย่างไร เกิดความรู้ใหม่อะไรบ้าง; เช็คว่า VERIFY ผ่าน Gate แล้ว (`verify.md` สรุปผลผ่าน) — ถ้ายังไม่ผ่าน → หยุด แจ้ง user. รวบรวม learned-rule candidate เป็นตาราง (`rule + evidence + scope + promote?`): **planned** จาก `tasks/*/rule.md` §2 "รอ SHIP" + `standard.md` · **emergent** สแกนบทเรียนใน `build.md`/`verify.md`/`troubleshooting.md`/diff `rule` ต้อง generalize (ไม่ใช่ incident), `evidence` บังคับ (pointer + ลิงก์ artifact; ไม่มี = ไม่ promote), `scope` = `component:<c>` หรือ `project`
11
11
  4. **จำแนก feature:** feature ใหม่ หรือปรับปรุง feature เดิม (เทียบกับ `docs/features/` ที่มีอยู่)
12
- 5. **ขออนุมัติครั้งเดียว** — ใช้ AskUserQuestion สรุป promotion plan: feature ใหม่/ปรับปรุง, ไฟล์กลางที่จะอัปเดต + สาระที่จะใส่, ชื่อโฟลเดอร์ archive → รอ go/no-go (อย่าแก้ไฟล์ใดก่อนได้ไฟเขียว)
12
+ 5. **ขออนุมัติครั้งเดียว** — ใช้ AskUserQuestion สรุป promotion plan: feature ใหม่/ปรับปรุง, ไฟล์กลางที่จะอัปเดต + สาระที่จะใส่, ชื่อโฟลเดอร์ archive — **fold ตาราง learned-rule (rule + evidence + scope) เข้า approval เดียวกัน ให้ user ยืนยัน per-rule** (✅ promote / ✂️ ตัด + เหตุผล) → รอ go/no-go (อย่าแก้ไฟล์ใดก่อนได้ไฟเขียว)
13
13
  6. **★ Archive ก่อน:** ย้ายทั้งโฟลเดอร์ `docs/stages/<slug>/` → `docs/stages/achieved/<YYYY-MM-DD>-<slug>/` (ใช้ `git mv`; วันที่ = วันที่ ship) แล้วอ่านเนื้อหาจาก path ใหม่ระหว่าง promote
14
14
  7. **อัปเดตเอกสารกลาง** (กลั่นเข้าโครงสร้างไฟล์เดิม ไม่ copy ดิบ, ระวัง duplicate):
15
15
  - `docs/features/<feature-name>/` — ใหม่ → สร้าง (feature.md + business.md); เดิม → อัปเดต โดยใช้ business/proposal/design ของ topic
16
- - `docs/techstack/<component>/{rule,standard}.md` — จาก note "รอ SHIP" (พิจารณาครบทุกข้อ: promote หรือตัดทิ้งพร้อมเหตุผล)
16
+ - `docs/techstack/<component>/{rule,standard}.md` — learned-rule ที่ยืนยันแล้ว scope `component:<c>` + note "รอ SHIP" (พิจารณาครบทุกข้อ: promote หรือตัดทิ้งพร้อมเหตุผล); learned-rule scope `project` → `docs/rule.md`
17
17
  - `docs/techstack/<component>/structure.md` + `test.md` — โครงสร้างที่เปลี่ยน (ดูโค้ดจริง) + merge แผนเทสจาก `test.md` ของ topic
18
18
  - `docs/rule.md` — global rule ใหม่/ที่เปลี่ยน (เฉพาะกฎระดับโปรเจกต์)
19
19
  - `docs/troubleshooting.md` — merge entry จาก `troubleshooting.md` ของ topic
@@ -25,3 +25,4 @@ argument-hint: "[slug ของ topic]"
25
25
  - SHIP เป็นเรื่อง **เอกสาร + archive เท่านั้น** — ไม่ merge โค้ด (build branch → main จัดการเองนอก workflow)
26
26
  - เนื้อหาที่ไม่แน่ใจว่าควร promote/วางไฟล์ไหน → ถามทีละข้อ + เสนอคำตอบที่แนะนำ อย่าเดา
27
27
  - เกณฑ์ปิดดู Gate ข้อ 6 ของ playbook
28
+ - คงเป็น command (user-only) โดยตั้งใจ — SHIP เป็น stateful/irreversible (archive ด้วย git mv, promote เอกสารกลาง) ต้องให้ user สั่งชัด ไม่ทำเป็น skill auto-invoke
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: explore
3
+ description: สำรวจ/ตอบคำถามเกี่ยวกับโปรเจกต์แบบ read-only — ไม่สร้าง artifact ใดๆ จบที่คำตอบในแชท
4
+ when_to_use: เมื่อต้องการเข้าใจ/ตอบคำถามเกี่ยวกับโครงสร้าง โค้ด หรือ logic ของโปรเจกต์ โดยไม่ต้องสร้างหรือแก้ไฟล์
5
+ allowed-tools: Read, Grep, Glob, Bash(find:*), Bash(ls:*), Bash(grep:*)
6
+ ---
7
+
8
+ ทำหน้าที่เป็น explorer ตาม **playbook กลาง** ของ workflow มาตรฐาน — อ่าน `.warnyin/workflow/explore.md` ให้ครบก่อน แล้วทำตามทุกหลักการอย่างเคร่งครัด (**read-only เด็ดขาด — ห้ามสร้าง/แก้/ลบไฟล์ใดๆ**, อ้าง `path:line`; ชี้ playbook ไม่ duplicate) — รับหัวข้อ/คำถามจาก request; ถ้าไม่ระบุ → ถาม user ว่าอยากสำรวจเรื่องอะไร
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: next
3
+ description: เช็คงานค้างทุก topic + แนะนำขั้นตอน/command ถัดไป แบบ read-only — ไม่สร้าง/แก้ไฟล์ใดๆ
4
+ when_to_use: เมื่อต้องการรู้ว่าแต่ละ topic ค้างอยู่ stage ไหน + ควรรัน command อะไรถัดไป
5
+ allowed-tools: Read, Grep, Glob, Bash(find:*), Bash(ls:*), Bash(grep:*)
6
+ ---
7
+
8
+ ทำหน้าที่เป็น status reporter ตาม **playbook กลาง** ของ workflow มาตรฐาน — อ่าน `.warnyin/workflow/next.md` ให้ครบก่อน แล้วทำตามทุกหลักการอย่างเคร่งครัด (**read-only เด็ดขาด — ห้ามสร้าง/แก้/ลบไฟล์ใดๆ**, สรุปจาก evidence ในไฟล์จริง, แนะนำแล้วหยุด; ชี้ playbook ไม่ duplicate) — รับ slug จาก request (ไม่ระบุ = สแกนทุก topic ใน `docs/stages/` ยกเว้น `achieved/`)
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: update-codemaps
3
+ description: Scan project structure and generate token-lean architecture codemaps (docs/codemap/)
4
+ when_to_use: หลังเพิ่ม/ย้าย/ลบไฟล์ หรือเปลี่ยนโครงสร้างโปรเจกต์ → refresh docs/codemap/ ให้ตรงโครงจริง
5
+ allowed-tools: Read, Grep, Glob, Bash(find:*), Bash(ls:*), Bash(grep:*)
6
+ ---
7
+
8
+ ทำหน้าที่เป็น codemap generator ตาม **playbook กลาง** ของ workflow มาตรฐาน — อ่าน `.warnyin/workflow/codemap.md` ให้ครบก่อน แล้วทำตามทุกขั้นอย่างเคร่งครัด (ชี้ playbook ไม่ duplicate ขั้นตอน)
@@ -20,10 +20,12 @@
20
20
  | `docs/infra.md` / `docs/project.md` | <!-- ถ้าเกี่ยวข้อง --> |
21
21
  | `docs/codemap/` | |
22
22
 
23
- ## 3. note "รอ SHIP" ที่ตัดทิ้ง (ไม่ promote)
24
- | note | เหตุผลที่ตัด |
25
- |---|---|
26
- | | |
23
+ ## 3. Learned rules (planned + emergent)
24
+ > กฎ generalize ที่จับจาก topic นี้ — planned (`tasks/*/rule.md` §2) + emergent (บทเรียนตอน build/verify/troubleshooting). evidence บังคับ; ไม่มี evidence = ไม่ promote. ครอบทั้งที่ promote และที่ตัด.
25
+
26
+ | rule (generalize) | evidence (pointer + artifact) | scope (`component:<c>` / `project`) | promote? (✅ / ✂️ + เหตุผล) |
27
+ |---|---|---|---|
28
+ | | | | |
27
29
 
28
30
  ## 4. Archive
29
31
  - ย้ายจาก `docs/stages/<slug>/` → `docs/stages/achieved/<YYYY-MM-DD>-<slug>/` เมื่อ <YYYY-MM-DD>
@@ -30,19 +30,20 @@ Discovery (optional) ──▶ DESIGN ──▶ BUILD ──▶ VERIFY ──▶
30
30
 
31
31
  ## โครงสร้าง repo
32
32
 
33
- ```
34
- bin/cli.mjs # npx installer ติดตั้ง workflow ลงโปรเจกต์อื่น
33
+ > โครงนี้คือสิ่งที่อยู่ใน **โปรเจกต์ที่ติดตั้งแล้ว** (installer วาง `.warnyin/`+`.claude/` ให้)
34
+ > ตัว repo `warnyin-agents` เองเก็บ source ที่จะ publish ไว้ใต้ `src/` (เช่น `src/bin/cli.mjs`, `src/.warnyin/`)ดู `CONTRIBUTING.md`
35
35
 
36
- warnyin/ # ★ ทุกอย่างของ workflow รวมใต้โฟลเดอร์เดียว
37
- installer/templates/ # template CLAUDE.md สำหรับโปรเจกต์ปลายทาง (installer ใช้เองไม่ถูก copy ไป target)
36
+ ```
37
+ .warnyin/ # แก่นกลาง workflow (installer วางให้อัปเดตได้ด้วย --update)
38
38
  workflow/ # playbook กลาง — single source of truth
39
39
  README.md # ไฟล์นี้ — ภาพรวม + วิธีรองรับหลาย AI
40
40
  init.md # playbook: INIT — วิเคราะห์โปรเจกต์ + เติม docs/ ครั้งแรก
41
41
  codemap.md # playbook: CODEMAP — สแกน + สร้าง codemap แบบ token-lean
42
42
  explore.md # playbook: EXPLORE — สำรวจ/ตอบคำถามแบบ read-only ไม่สร้าง artifact
43
43
  next.md # playbook: NEXT — เช็คงานค้าง + แนะนำขั้นตอนถัดไป (read-only)
44
- roles/ # role card กลาง: ba, po, sa, tech-lead, developer, qa, security, infra
45
44
  stages/ # discovery ✅ · design ✅ · build ✅ · verify ✅ · ship ✅
45
+ roles/ # role card กลาง (task-level lens): ba, po, sa, tech-lead, developer, qa, security, infra
46
+ contexts/ # context profile กลาง (session-level posture): research, build, review + README
46
47
  scripts/
47
48
  build-wave.mjs # Workflow script: fan-out sub-agent ต่อ task ใน wave (worktree)
48
49
  template/ # ★ template ทั้งหมดรวมที่เดียว
@@ -56,15 +57,20 @@ warnyin/ # ★ ทุกอย่างของ workflow รว
56
57
  project.md rule.md infra.md troubleshooting.md codemap/index.md
57
58
  techstack/[component]/ # copy เป็น docs/techstack/<component> (โดย /warnyin:init)
58
59
  features/[feature-name]/ # copy เป็น docs/features/<feature-name> (โดย SHIP)
59
- stages/ # พื้นที่ทำงานจริง ตาม topic
60
- context.md
61
- achieved/ # archive หลัง SHIP (<YYYY-MM-DD>-<slug>/)
60
+ installer/templates/ # template CLAUDE.md ของ target (installer ใช้เอง — ไม่ถูก copy ไป target)
62
61
 
63
- docs/ # ความรู้ถาวรระดับโปรเจกต์ ของจริงล้วน (seed จาก .warnyin/template/docs)
62
+ .claude/ # adapter Claude Code (ชี้กลับ playbook กลาง)
63
+ commands/warnyin/ # slash command /warnyin:*
64
+ agents/ # reviewer subagent warnyin-{sa,tech-lead,qa,security,infra}
65
+ CLAUDE.md AGENTS.md # adapter + pointer ของ Claude / Codex·Antigravity
66
+
67
+ docs/ # ความรู้ถาวรระดับโปรเจกต์ + งานจริง — ของจริงล้วน (seed จาก template/docs)
64
68
  project.md # ★ จุดเริ่มของ Discovery — อ่านก่อนเสมอ
65
69
  rule.md infra.md
66
70
  troubleshooting.md # ★ KB ปัญหา-วิธีแก้ (อ่านก่อนเมื่อ build เจอ error; SHIP ป้อนเข้า)
67
71
  codemap/ features/ techstack/
72
+ stages/ # พื้นที่ทำงานจริง ตาม topic (<slug>/) + achieved/<YYYY-MM-DD>-<slug>/ หลัง SHIP
73
+ ```
68
74
  ```
69
75
 
70
76
  ---
@@ -0,0 +1,37 @@
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)
34
+ 4. **ใช้คู่ stage ไหน** — ชี้ playbook stage ที่เข้าคู่ (→ ลิงก์)
35
+
36
+ > เพิ่ม context ใหม่ = เพิ่มไฟล์ที่นี่ + ใส่ callout ใน playbook stage ที่เข้าคู่ + อัปเดตตารางด้านบน
37
+ > (เก็บให้บาง opinionated — 3 context พอ; อย่าให้ไหลเป็น catalog)
@@ -0,0 +1,24 @@
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
+
22
+ ## ใช้คู่ stage ไหน
23
+ - ปลาย DESIGN (แตก task) → [`stages/design.md`](../stages/design.md)
24
+ - BUILD → [`stages/build.md`](../stages/build.md)
@@ -0,0 +1,24 @@
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
+
21
+ ## ใช้คู่ stage ไหน
22
+ - Discovery → [`stages/discovery.md`](../stages/discovery.md)
23
+ - ช่วงต้น DESIGN (เก็บ context ก่อน propose) → [`stages/design.md`](../stages/design.md)
24
+ - เช็คงานค้าง → [`next.md`](../next.md)
@@ -0,0 +1,24 @@
1
+ # Context — review (โหมดตรวจ/ยืนยันก่อนปล่อย)
2
+
3
+ > session-level posture · playbook: `.warnyin/workflow/stages/*`
4
+
5
+ ## Mindset
6
+ หาจุดพลาดก่อนปล่อย — skeptical, ไม่เชื่อว่าผ่านจนกว่าจะรันจริง
7
+ ยืนยันด้วยหลักฐาน (test/verify เขียวจริง) ไม่ใช่คำสัญญาในโค้ด
8
+
9
+ ## Do / Don't
10
+ - ✅ รัน test / verify จริง ดูผลด้วยตา
11
+ - ✅ ไล่ acceptance ทีละข้อ เทียบกับ spec
12
+ - ✅ ตรวจ edge case + security
13
+ - ❌ เชื่อว่าผ่านโดยไม่รัน
14
+ - ❌ ปล่อย issue ระดับ CRITICAL / HIGH
15
+ - ❌ แก้เยอะระหว่าง review (note ไว้ ให้กลับไป BUILD)
16
+
17
+ ## Tool preference
18
+ - **ควรใช้:** Read + Bash (รัน test/verify), reviewer sub-agents, `/code-review` `/security-review`
19
+ - **เลี่ยง:** เขียน feature ใหม่ระหว่าง review, แก้ scope กว้างๆ
20
+
21
+ ## ใช้คู่ stage ไหน
22
+ - VERIFY → [`stages/verify.md`](../stages/verify.md)
23
+ - SHIP (ตรวจความครบก่อนส่งมอบ) → [`stages/ship.md`](../stages/ship.md)
24
+ - DESIGN review panel → [`stages/design.md`](../stages/design.md)
@@ -16,6 +16,8 @@ implement vertical slice ที่รับมอบให้ **เสร็จ
16
16
  - [ ] ทำครบทุก sub-task — acceptance ทุกข้อของ task ผ่าน
17
17
  - [ ] ตาม standard.md (pattern, shared component) + rule.md เคร่งครัด
18
18
  - [ ] ไม่แตะไฟล์นอก scope ของ task — เจอสิ่งควรแก้นอก scope → note ไว้ ไม่ลงมือเอง
19
+ - [ ] เข้าใจไฟล์ก่อนแก้ (ใครใช้/contract/เจตนา) — ไม่แก้แบบไม่เข้าใจ (investigate-before-edit)
20
+ - [ ] ไม่แก้ config/test ให้เขียวแทนแก้โค้ดจริง — config ผิดจริงแก้ได้ + เหตุผล + note (config-protection)
19
21
  - [ ] รัน test-flow ใน spec.md + build/lint **ผ่านจริง** — ห้ามรายงาน passed ทั้งที่ยังแดง
20
22
  - [ ] ไม่ทิ้งขยะ: debug code, commented-out code, TODO ลอยๆ
21
23
  - [ ] เจอปัญหา → อ่าน `docs/troubleshooting.md` ก่อน; ปัญหายาก/ซ้ำที่แก้ได้ → รายงานในฟิลด์ troubleshooting
@@ -18,6 +18,8 @@
18
18
  - [ ] Frontend: layout, state (loading/error/empty), flow, responsive — ตรวจด้วยตาผ่าน e2e
19
19
  - [ ] regression: จุดที่ change กระทบของเดิม ถูกเทสซ้ำ
20
20
  - [ ] ผลเทสบันทึกตรงความจริง + นับจำนวนรอบที่แก้
21
+ - [ ] เข้าใจไฟล์/contract ก่อนแก้ตอน fix loop — ไม่แก้แบบไม่เข้าใจ (investigate-before-edit)
22
+ - [ ] ตอน fix loop — ไม่ลด bar (config/test threshold/disable rule) เพื่อให้ผ่าน; แก้ root cause จริง (config-protection)
21
23
 
22
24
  ## Checklist เพิ่มเมื่อรีวิว design ใน panel
23
25
  - [ ] ทุก slice มี test-flow ที่รันได้จริงใน local env
@@ -9,7 +9,7 @@
9
9
  - ทุก input คือของไม่น่าไว้ใจจนกว่าจะ validate
10
10
  - สิทธิ์: ใครทำอะไรได้ ต้องชัดต่อ endpoint/resource ไม่ใช่เชื่อ frontend
11
11
  - ข้อมูลอ่อนไหวรั่วได้ 3 ทาง: เก็บ, ส่ง, log
12
- - supply chain: dependency ใหม่ = ความเสี่ยงใหม่
12
+ - supply chain: dependency ใหม่ = ความเสี่ยงใหม่ — ครอบ third-party skill / MCP / payload `.md` ที่ AI execute ต่อด้วย
13
13
 
14
14
  ## Checklist
15
15
  - [ ] ทุก input (API, form, file, query param) ถูก validate/sanitize ที่ฝั่ง server
@@ -20,6 +20,16 @@
20
20
  - [ ] error message ไม่ leak ข้อมูลภายใน (stack trace, SQL, path)
21
21
  - [ ] การกระทำสำคัญ (เงิน/สิทธิ์/ข้อมูลส่วนตัว) มี audit log
22
22
  - [ ] injection ทุกรูปแบบที่เกี่ยวข้อง: SQL/NoSQL, XSS, command, path traversal
23
+ - [ ] **supply-chain / MCP:** third-party skill / MCP / payload `.md` = prompt-injection surface → ตรวจเนื้อหาก่อนติดตั้ง (อ่าน source / skills.sh), ติด global ไม่ vendor เข้า repo, จำกัดสิทธิ์ที่มันเข้าถึง
24
+
25
+ ## Runtime / operational security
26
+
27
+ > ความปลอดภัยตอน **รัน AI agent ในเครื่อง** (คู่กับ app-security ข้างบน — คนละมิติ ไม่ทับกัน); principle portable ทุก harness
28
+
29
+ - **P1 · secret isolation:** กัน agent อ่าน/เข้าถึง secret ที่ไม่เกี่ยวกับงาน — `.env`, `~/.ssh`, credential/token, keychain; ให้สิทธิ์อ่านเฉพาะ scope ของงาน (least-privilege ระดับ filesystem)
30
+ - **P2 · no unnecessary egress:** payload/skill ที่ agent execute ต่อ ไม่ควรส่งข้อมูลออกได้อิสระ — รันใน sandbox/network ที่จำกัด egress เท่าที่งานต้องใช้
31
+ - **P3 · identity separation:** แยก identity ของ session agent ออกจาก credential ส่วนตัว/prod — ไม่ใช้ token ส่วนตัว/สิทธิ์ prod ใน session ที่รัน automation/agent (ใช้ scoped credential แยก)
32
+ - **Claude adapter note** (ตัวอย่างเฉพาะ Claude Code — harness อื่นปรับเทียบ): `settings.json` → `permissions.deny`: `Read(**/.env*)`, `Read(~/.ssh/**)`; รัน sandbox no-egress เมื่อไม่ต้องการเครือข่าย
23
33
 
24
34
  ## Output
25
35
  - ความเห็นแบ่ง **blocker** (ช่องโหว่จริงต้องแก้ก่อน BUILD) / **suggestion** (hardening ที่ควรทำ)
@@ -2,6 +2,7 @@
2
2
 
3
3
  > **Playbook กลาง — AI ทุกเจ้าทำตามไฟล์นี้ชุดเดียวกัน** (Claude Code / Codex / Antigravity / อื่นๆ)
4
4
  > เป้าหมาย: ลงมือทำ task ที่ DESIGN เตรียมไว้ โดย **fan-out sub-agent อัตโนมัติต่อ task ตาม dependency**
5
+ > **Context profile:** สวมโหมด `build` (`.warnyin/workflow/contexts/build.md`) — session-level posture ของ stage นี้
5
6
 
6
7
  ---
7
8
 
@@ -36,6 +37,8 @@ BUILD จะ **orchestrate การ implement** โดยกระจายง
36
37
  8. **★ ปิดท้ายด้วย full build + full test เสมอ** — หลัง merge ทุก wave แล้ว ต้องรัน build ทั้งหมด + test suite ทั้งหมด (รวม unit test) บน build branch ที่ integrate; **แก้วนจนเขียวหมด** ก่อนปิด BUILD (กันกรณี task รายเดี่ยวเขียวแต่พอรวมกันแล้วพัง)
37
38
  9. **ทุก build agent สวม role Developer** — ทำตาม role card `.warnyin/workflow/roles/developer.md` (lens + checklist ก่อนส่งงาน) — build-wave.mjs ใส่ให้ใน prompt แล้ว
38
39
  10. **★ ใช้ Troubleshooting KB** — เจอปัญหา/error ระหว่าง build ให้ **อ่าน `docs/troubleshooting.md` ก่อนเสมอ** เผื่อเคยแก้แล้ว; เมื่อแก้ปัญหาที่ **ยาก/เจอซ้ำ** สำเร็จ ให้บันทึก entry ลง `docs/stages/<slug>/troubleshooting.md` (ปัญหา/อาการ/root cause/วิธีแก้/ป้องกันซ้ำ) — ตอน SHIP จะยกขึ้น KB กลาง
40
+ 11. **★ investigate-before-edit** (enforce ของ "ห้ามเดา") — ก่อนแก้ไฟล์ที่มีอยู่ ต้องเข้าใจก่อน — **ใครใช้/อ่านไฟล์นี้, schema/contract/สัญญาของมัน, เจตนาเดิม**; แก้โดยไม่เข้าใจ = เดา (กรณีไม่ชัด → ถาม user / อ่านโค้ดที่อ้างถึง ก่อนแก้)
41
+ 12. **★ config-protection** (enforce ของ "ห้ามเดา") — ห้ามแก้ config (linter/formatter/test threshold) หรือ disable rule **"เพื่อให้ build/test ผ่าน"** แทนการแก้โค้ดจริง — ถ้า config ผิดจริง แก้ได้แต่ต้องมี **เหตุผลชัด + note** (ไม่ใช่เพื่อเลี่ยง finding)
39
42
 
40
43
  ---
41
44
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  > **Playbook กลาง — AI ทุกเจ้าทำตามไฟล์นี้ชุดเดียวกัน** (Claude Code / Codex / Antigravity / อื่นๆ)
4
4
  > เป้าหมาย: เสนอ **change ใหม่** พร้อมผลิต artifact ครบในขั้นเดียว — proposal (what & why) → design (how) → tasks (พร้อม execute)
5
+ > **Context profile:** สวมโหมด `research` (`.warnyin/workflow/contexts/research.md`) ช่วงต้น (proposal/design) · `build` (`.warnyin/workflow/contexts/build.md`) ช่วงแตก task — session-level posture ของ stage นี้
5
6
 
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  > **Playbook กลาง — AI ทุกเจ้าทำตามไฟล์นี้ชุดเดียวกัน** (Claude Code / Codex / Antigravity / อื่นๆ)
4
4
  > เป้าหมาย: เปลี่ยนความต้องการที่ยังคลุมเครือ ให้เป็น **ความเข้าใจร่วมกัน (shared understanding)** ที่ชัดพอจะเข้า DESIGN ได้
5
+ > **Context profile:** สวมโหมด `research` (`.warnyin/workflow/contexts/research.md`) — session-level posture ของ stage นี้
5
6
 
6
7
  ---
7
8
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  > **Playbook กลาง — AI ทุกเจ้าทำตามไฟล์นี้ชุดเดียวกัน** (Claude Code / Codex / Antigravity / อื่นๆ)
4
4
  > เป้าหมาย: **ส่งมอบ** — promote ความรู้ระดับ topic ขึ้นเอกสารกลางใน `docs/` + archive topic เข้า `docs/stages/achieved/`
5
+ > **Context profile:** สวมโหมด `review` (`.warnyin/workflow/contexts/review.md`) — session-level posture ของ stage นี้
5
6
 
6
7
  ---
7
8
 
@@ -34,20 +35,24 @@
34
35
  4. **กลั่น ไม่ใช่ copy ดิบ** — merge สาระเข้าโครงสร้างของไฟล์กลางเดิม ระวัง duplicate/ขัดแย้งกับเนื้อหาที่มีอยู่; เขียนแบบ "ความรู้ถาวร" ไม่ใช่บันทึกรายงาน
35
36
  5. **เอกสารต้องตรงโค้ดจริง** — structure/codemap อัปเดตจากการดูโค้ดจริง ไม่ใช่จากความจำหรือ design เดิม
36
37
  6. **อย่าเดา** — เนื้อหาที่ไม่แน่ใจว่าควร promote หรือควรวางไว้ไฟล์ไหน → ถามทีละข้อ + เสนอคำตอบที่แนะนำ
37
- 7. **เก็บ "รอ SHIP" ให้หมด** — rule/standard ที่ note ค้างไว้ใน tasks ต้องถูกพิจารณาครบทุกข้อ (promote หรือตัดทิ้งพร้อมเหตุผล) ห้ามปล่อยค้าง
38
+ 7. **เก็บ learned-rule ให้หมด — planned + emergent** — รวบรวม rule ที่จะ promote ทุกตัว: ทั้ง **planned** (note "รอ SHIP" ใน `tasks/*/rule.md` §2) และ **emergent** (บทเรียนที่โผล่ตอนลงมือ สแกน `build.md`/`verify.md`/`troubleshooting.md`/diff); ทุกตัวต้องมี **evidence (บังคับ)** + **scope** + **user ยืนยัน** ก่อน promote — ไม่มี evidence ไม่ promote (สอด "ห้ามเดา"); **learned-rule = กฎ generalize ไม่ใช่ incident** (troubleshooting = incident ที่ *อ้าง* เป็น evidence ได้). พิจารณาครบทุกข้อ (promote หรือตัดทิ้งพร้อมเหตุผล) ห้ามปล่อยค้าง
38
39
 
39
40
  ---
40
41
 
41
42
  ## 4. ลำดับขั้นการทำงาน (process)
42
43
 
43
- 1. **อ่านทำความเข้าใจ topic:** อ่าน `docs/stages/<slug>/` ทุกไฟล์ — topic นี้ทำอะไร ทำอย่างไร เกิดความรู้ใหม่อะไรบ้าง (เช็คก่อนว่า VERIFY ผ่าน Gate แล้ว — มี `verify.md` สรุปผลผ่าน)
44
+ 1. **อ่านทำความเข้าใจ topic + รวบรวม learned-rule candidate:** อ่าน `docs/stages/<slug>/` ทุกไฟล์ — topic นี้ทำอะไร ทำอย่างไร เกิดความรู้ใหม่อะไรบ้าง (เช็คก่อนว่า VERIFY ผ่าน Gate แล้ว — มี `verify.md` สรุปผลผ่าน) — พร้อมกันนั้น **รวบรวม learned-rule candidate** เป็นตาราง (ทุกตัว = `rule + evidence + scope + promote?`):
45
+ - **planned:** จาก `tasks/*/rule.md` §2 "เสนอเพิ่ม rule ใหม่ (รอ SHIP)"
46
+ - **emergent:** สแกนบทเรียนที่โผล่ตอนลงมือ — `build.md` (pattern แก้ซ้ำ/integration), `verify.md` (รายการแก้+จำนวนรอบ), `troubleshooting.md` (ปัญหายาก→"กันซ้ำ" = candidate ชัดสุด), diff/commit
47
+ - **entry แต่ละตัว:** `rule` = ข้อความ **generalize** (ถ้าเป็น incident "X พังเพราะ Y" ยกเป็นกฎ "ก่อนแก้ Z เช็ค Y เสมอ") · `evidence` = **บังคับ** concrete pointer 1 บรรทัด + ลิงก์ artifact (`build.md`/`verify.md`/`troubleshooting.md`/diff/commit) — **ไม่มี evidence = ไม่ promote** · `scope` = `component:<c>`→`docs/techstack/<c>/rule.md` หรือ `project`→`docs/rule.md`
44
48
  2. **จำแนก feature:** สิ่งที่ทำเป็น **feature ใหม่** หรือ **ปรับปรุง feature เดิม** (เทียบกับ `docs/features/` ที่มีอยู่)
45
- 3. **สรุป promotion plan + ขออนุมัติ (ครั้งเดียว):** feature ใหม่/ปรับปรุง, รายการไฟล์กลางที่จะอัปเดต + สาระ, ชื่อโฟลเดอร์ archive → รอ user ไฟเขียว
49
+ 3. **สรุป promotion plan + ขออนุมัติ (ครั้งเดียว):** feature ใหม่/ปรับปรุง, รายการไฟล์กลางที่จะอัปเดต + สาระ, ชื่อโฟลเดอร์ archive — **fold ตาราง learned-rule (rule + evidence + scope) เข้า approval เดียวกันนี้ ให้ user ยืนยัน per-rule** (✅ promote / ✂️ ตัด + เหตุผล) → รอ user ไฟเขียว
46
50
  4. **★ Archive:** ย้ายทั้งโฟลเดอร์ → `docs/stages/achieved/<YYYY-MM-DD>-<slug>/` (ใช้ `git mv` ถ้าเป็น git repo)
47
51
  5. **อัปเดตเอกสารกลาง** (อ่านเนื้อหาจาก path ใน achieved):
48
52
  1. **`docs/features/<feature-name>/`** — feature ใหม่ → สร้างโฟลเดอร์ใหม่ (`feature.md` + `business.md`); ปรับปรุง feature เดิม → อัปเดตโฟลเดอร์เดิม โดยใช้เนื้อหาจาก `business.md` / `proposal.md` / `design.md` ของ topic
49
- 2. **`docs/techstack/<component>/`** — `rule.md` / `standard.md` (จาก note "รอ SHIP" ใน tasks), `structure.md` (โครงสร้างที่เปลี่ยน), `test.md` (merge แผนเทสจาก `test.md` ของ topic)
50
- 3. **`docs/rule.md`** — global rule ใหม่/ที่เปลี่ยน (เฉพาะข้อที่เป็นกฎระดับโปรเจกต์ ไม่ผูกกับ component เดียว)
53
+ 2. **`docs/techstack/<component>/`** — `rule.md` / `standard.md` (learned-rule ที่ยืนยันแล้ว scope `component:<c>` + note "รอ SHIP" ใน tasks), `structure.md` (โครงสร้างที่เปลี่ยน), `test.md` (merge แผนเทสจาก `test.md` ของ topic)
54
+ 3. **`docs/rule.md`** — global rule ใหม่/ที่เปลี่ยน (learned-rule ที่ยืนยันแล้ว scope `project` — กฎระดับโปรเจกต์ ไม่ผูกกับ component เดียว)
55
+ > promote learned-rule **เฉพาะตัวที่ user ยืนยัน (step 3)** ตาม scope: `component:<c>` → `docs/techstack/<c>/rule.md` · `project` → `docs/rule.md`
51
56
  4. **`docs/troubleshooting.md`** — merge entry จาก `troubleshooting.md` ของ topic (ปัญหา/อาการ/root cause/วิธีแก้/ป้องกันซ้ำ)
52
57
  5. **`docs/infra.md` + `docs/project.md`** — เฉพาะถ้ามีข้อมูลที่เกี่ยวข้อง (env/service ใหม่, scope/เป้าหมายโปรเจกต์ที่ขยับ)
53
58
  6. **`docs/codemap/` ทั้งหมด** — อัปเดต code map ให้ตรงกับโค้ดจริงปัจจุบัน ทำตาม playbook `.warnyin/workflow/codemap.md` (Claude Code: `/warnyin:update-codemaps`)
@@ -74,7 +79,7 @@
74
79
 
75
80
  - [ ] topic ถูกย้ายไป `docs/stages/achieved/<YYYY-MM-DD>-<slug>/` แล้ว (ไม่เหลือใน `docs/stages/`)
76
81
  - [ ] `docs/features/` สะท้อน feature ใหม่/ที่ปรับปรุงแล้ว
77
- - [ ] note "รอ SHIP" ทุกข้อใน `tasks/*/rule.md` + `standard.md` ถูกพิจารณาครบ promote หรือตัดทิ้งพร้อมเหตุผล
82
+ - [ ] learned-rules (planned + emergent) พิจารณาครบทุกตัว — note "รอ SHIP" ใน `tasks/*/rule.md` + `standard.md` + บทเรียน emergent จาก build/verify/troubleshooting; ทุก promote มี **evidence + user ยืนยัน**, ตัดทิ้งมีเหตุผล
78
83
  - [ ] `docs/troubleshooting.md` รวม entry จาก topic แล้ว
79
84
  - [ ] `docs/techstack/`, `docs/rule.md`, `docs/infra.md`, `docs/project.md` อัปเดตตามที่เกี่ยวข้อง
80
85
  - [ ] `docs/codemap/` ตรงกับโค้ดจริงปัจจุบัน
@@ -2,6 +2,7 @@
2
2
 
3
3
  > **Playbook กลาง — AI ทุกเจ้าทำตามไฟล์นี้ชุดเดียวกัน** (Claude Code / Codex / Antigravity / อื่นๆ)
4
4
  > เป้าหมาย: เป็น **strategy tester** — ยืนยันว่า change ที่ build แล้ว "ทำงานถูกตามจุดประสงค์ของ topic" จริง (functional + UX/UI ถ้าเป็น FE) แก้จนผ่าน
5
+ > **Context profile:** สวมโหมด `review` (`.warnyin/workflow/contexts/review.md`) — session-level posture ของ stage นี้
5
6
 
6
7
  ---
7
8
 
@@ -20,6 +21,7 @@
20
21
  → ถ้า **ไม่มี** guideline → แนะนำว่าควรเทสแบบไหน/วิธีใดได้บ้าง แล้วเขียนแผนลง `test.md`
21
22
  3. **`docs/infra.md`** — local env / service ที่ต้องรันเพื่อเทส
22
23
  4. **`docs/troubleshooting.md`** — เผื่อปัญหาที่จะเจอเคยถูกแก้แล้ว
24
+ 5. **runtime security** (`.warnyin/workflow/roles/security.md` → "Runtime / operational security") — ตอนรันเทส local env ที่มี secret จริง ทบทวน secret isolation / no-egress / identity separation ก่อนปล่อย agent แตะของจริง
23
25
 
24
26
  ---
25
27
 
@@ -34,6 +36,8 @@
34
36
  7. **นาน/หลายรอบเกินไป → พิจารณาถาม user ทีละข้อ + เสนอคำตอบที่แนะนำ** (อย่าวนแก้เงียบๆ ไม่จบ)
35
37
  8. **ห้ามแตะไฟล์กลางใน `docs/`** — แผนเทสเขียนระดับ topic ที่ `test.md` ก่อน รอ SHIP merge เข้า `docs/techstack/<component>/test.md`
36
38
  9. **สวม role QA** — ทำตาม role card `.warnyin/workflow/roles/qa.md` (lens: คิดแบบผู้ใช้จริง + คนหาเรื่อง, edge case, regression; checklist ครบทุกข้อ)
39
+ 10. **★ investigate-before-edit** (enforce ของ "ห้ามเดา") — ก่อนแก้ไฟล์ที่มีอยู่ ต้องเข้าใจก่อน — **ใครใช้/อ่านไฟล์นี้, schema/contract/สัญญาของมัน, เจตนาเดิม**; แก้โดยไม่เข้าใจ = เดา (กรณีไม่ชัด → ถาม user / อ่านโค้ดที่อ้างถึง ก่อนแก้)
40
+ 11. **★ config-protection** (enforce ของ "ห้ามเดา") — ตอน fix loop (ข้อ 5 "แก้จนผ่าน") ห้ามแก้ config (linter/formatter/test threshold) หรือ disable rule **"เพื่อให้ build/test ผ่าน"** แทนการแก้ root cause จริง — "แก้จนผ่าน" ต้องเป็นการแก้ที่ต้นเหตุ ไม่ใช่ลด bar; ถ้า config ผิดจริง แก้ได้แต่ต้องมี **เหตุผลชัด + note** (ไม่ใช่เพื่อเลี่ยง finding)
37
41
 
38
42
  ---
39
43
 
@@ -32,6 +32,9 @@ if (args.has('--help') || args.has('-h')) {
32
32
  process.exit(0)
33
33
  }
34
34
 
35
+ // guard กัน self-install — เก็บไว้แบบ defensive (zero-cost)
36
+ // หลังย้าย source เข้า src/ → pkgRoot = src/ (sibling ของ bin/) จึงแทบไม่มีทาง === target (repo root / temp sandbox)
37
+ // → guard นี้เป็น no-op โดยตั้งใจในเคสปกติ/sandbox; ยังคงดักได้เฉพาะ edge case ที่ install ลงโฟลเดอร์ที่เป็น src/ เอง
35
38
  if (path.resolve(pkgRoot) === path.resolve(target)) {
36
39
  console.error('✖ กำลังรันอยู่ใน repo ของ warnyin-agents เอง — ให้ cd ไปที่โปรเจกต์ปลายทางก่อน')
37
40
  process.exit(1)
@@ -42,8 +45,8 @@ const legacyV2 = ['workflow', 'warnyin-stages'].filter((d) => fs.existsSync(path
42
45
  if (legacyV2.length) {
43
46
  console.warn(`⚠ พบโครงเลย์เอาต์เก่า (≤0.2.x): ${legacyV2.join(', ')}
44
47
  เวอร์ชันนี้ย้าย core ไปใต้ .warnyin/ และงานจริงไป docs/stages/ — แนะนำย้ายด้วยตัวเองก่อน:
45
- 1. git mv warnyin-stages docs/stages # งานจริงของคุณ (ปลอดภัย ไม่ถูกแตะโดย installer)
46
- 2. git rm -r workflow # playbook เก่า (เวอร์ชันใหม่จะอยู่ที่ .warnyin/workflow)
48
+ 1. mkdir -p docs/stages && git mv warnyin-stages/* docs/stages/ # งานจริงของคุณ (ปลอดภัย ไม่ถูกแตะโดย installer)
49
+ 2. rm -rf workflow warnyin-stages # core เก่า + โฟลเดอร์ที่ย้ายของออกแล้ว
47
50
  แล้วรันคำสั่งนี้อีกครั้ง\n`)
48
51
  }
49
52
 
@@ -54,8 +57,8 @@ const legacyV5 = ['workflow', 'template', 'installer', 'stages'].filter((d) =>
54
57
  if (legacyV5.length) {
55
58
  console.warn(`⚠ พบโครงเลย์เอาต์เก่า (0.3–0.5.x): warnyin/{${legacyV5.join(', ')}}
56
59
  เวอร์ชันนี้ย้าย core ไป .warnyin/ และงานจริงไป docs/stages/ — แนะนำย้ายด้วยตัวเองก่อน:
57
- 1. git mv warnyin/stages docs/stages # งานจริงของคุณ (active + achieved) — ปลอดภัย ไม่ถูกแตะ
58
- 2. git rm -r warnyin/workflow warnyin/template # core เก่า (เวอร์ชันใหม่ installer จะวางที่ .warnyin/)
60
+ 1. mkdir -p docs/stages && git mv warnyin/stages/* docs/stages/ # งานจริงของคุณ (active + achieved) — ปลอดภัย ไม่ถูกแตะ
61
+ 2. rm -rf warnyin # core เก่าทั้งหมด (เวอร์ชันใหม่ installer จะวางที่ .warnyin/)
59
62
  แล้วรันคำสั่งนี้อีกครั้ง — installer จะวาง .warnyin/ ชุดใหม่ให้\n`)
60
63
  }
61
64
 
@@ -65,6 +68,7 @@ const CORE = [
65
68
  path.join('.warnyin', 'template'),
66
69
  path.join('.claude', 'commands', 'warnyin'),
67
70
  path.join('.claude', 'agents'),
71
+ path.join('.claude', 'skills'),
68
72
  ]
69
73
  // scaffold = พื้นที่ทำงานเปล่าของโปรเจกต์ — installer "สร้างเอง" ไม่ copy tree จาก package
70
74
  // (สำคัญ: ถ้า copy docs/stages จาก pkgRoot งานจริงของ repo ต้นทางจะรั่วไป target ทุกครั้ง — ดู verify installer-test-ci)
package/CLAUDE.md DELETED
@@ -1,40 +0,0 @@
1
- # CLAUDE.md
2
-
3
- repo มาตรฐานกลางของ **ways of work** สำหรับทุกโปรเจกต์ เดินงานผ่าน 5 stage:
4
- `Discovery (optional) ▶ DESIGN ▶ BUILD ▶ VERIFY ▶ SHIP`
5
-
6
- ## กฎหลัก
7
- - แก่นของแต่ละ stage เป็น single source of truth ที่ `.warnyin/workflow/stages/` — **ทำตาม playbook นั้นเสมอ** ก่อนเริ่มงานใน stage
8
- - อย่า duplicate logic ของ workflow ลงที่อื่น ถ้าต้องแก้พฤติกรรมให้แก้ที่ `.warnyin/workflow/stages/`
9
- - output ของงานจริงเก็บใน `docs/stages/<slug>/` (copy จาก template `.warnyin/template/stages/[topic]/`)
10
- - ความรู้ถาวรระดับโปรเจกต์อยู่ใน `docs/` — เริ่มอ่าน `docs/project.md` เสมอใน Discovery
11
- - role card กลางอยู่ที่ `.warnyin/workflow/roles/` (BA/PO/SA/Tech Lead/Developer/QA/Security/Infra) — stage ไหนใช้ role ไหนดูใน playbook; reviewer subagent ของ Claude Code อยู่ที่ `.claude/agents/warnyin-*`
12
-
13
- ## Slash commands (namespace `warnyin:`)
14
- - `/warnyin:init` → วิเคราะห์โปรเจกต์ + เติม `docs/` ครั้งแรกหลังติดตั้ง (`.claude/commands/warnyin/init.md` → `.warnyin/workflow/init.md`)
15
- - `/warnyin:install-skill [role]` → ติดตั้ง skill เสริมประจำ role (รายการอยู่ที่ตารางใน `.warnyin/workflow/roles/README.md`)
16
- - `/warnyin:update-codemaps` → สแกนโครงสร้าง + สร้าง/อัปเดต codemap แบบ token-lean ใน `docs/codemap/` (`.warnyin/workflow/codemap.md`)
17
- - `/warnyin:explore [คำถาม]` → สำรวจ/ตอบคำถามแบบ read-only — ไม่สร้าง artifact ใดๆ จบที่คำตอบในแชท (`.warnyin/workflow/explore.md`)
18
- - `/warnyin:next [slug]` → เช็คงานค้างทุก topic + แนะนำ command ถัดไป แบบ read-only (`.warnyin/workflow/next.md`)
19
- - `/warnyin:discovery [topic]` → Discovery stage (`.claude/commands/warnyin/discovery.md` → `.warnyin/workflow/stages/discovery.md`)
20
- - `/warnyin:design [slug] [change]` → DESIGN stage (`.claude/commands/warnyin/design.md` → `.warnyin/workflow/stages/design.md`)
21
- - `/warnyin:build [slug]` → BUILD stage — fan-out sub-agent ตาม dependency (`.warnyin/workflow/stages/build.md` + `.warnyin/workflow/scripts/build-wave.mjs`)
22
- - `/warnyin:verify [slug]` → VERIFY stage — strategy tester เทส local env + UXUI แก้จนผ่าน (`.warnyin/workflow/stages/verify.md`)
23
- - `/warnyin:ship [slug]` → SHIP stage — ส่งมอบ: promote ความรู้ขึ้น `docs/` + archive topic (`.warnyin/workflow/stages/ship.md`)
24
-
25
- ## การติดตั้งไปโปรเจกต์อื่น (npx installer)
26
- - `npx @warnyin/agents` (หรือสำรอง `npx github:warnyin/warnyin-agents`) → copy โครงทั้งหมดลงโปรเจกต์ปลายทาง (ข้ามไฟล์ที่มีอยู่, CLAUDE.md/AGENTS.md ที่มีอยู่จะต่อท้ายเป็น section)
27
- - `--update` → เขียนทับเฉพาะ core (`.warnyin/workflow/`, `.claude/commands/warnyin/`, template ใน `.warnyin/template/`) ไม่แตะ `docs/`/งานจริง
28
- - ตัว installer: `bin/cli.mjs` + template CLAUDE.md ของโปรเจกต์ปลายทางที่ `.warnyin/installer/templates/CLAUDE.md` (แก้ commands list ที่ไหน ให้แก้ template นี้ด้วย; โฟลเดอร์นี้ไม่ถูก copy ไป target)
29
- - หลังติดตั้ง → รัน `/warnyin:init` เพื่อเติม `docs/`
30
-
31
- ## รองรับหลาย AI
32
- repo นี้ tool-agnostic: Claude Code อ่าน `.claude/` + ไฟล์นี้, ส่วน Codex/Antigravity อ่าน `AGENTS.md`
33
- ทุกเครื่องชี้กลับมาที่ playbook กลางชุดเดียวกันใน `.warnyin/workflow/stages/` — ดูภาพรวมที่ `.warnyin/workflow/README.md`
34
-
35
- ## สถานะการสร้าง workflow (อัปเดต 2026-06-04)
36
- ครบทั้ง 5 stage: Discovery ✅ · DESIGN ✅ · BUILD ✅ · VERIFY ✅ · SHIP ✅
37
- (playbook + command + template + build-wave.mjs ครบทุก stage)
38
-
39
- แพทเทิร์นการเติม/แก้ stage: playbook `.warnyin/workflow/stages/<stage>.md` + command `.claude/commands/warnyin/<stage>.md` + อัปเดตตาราง stage ใน `AGENTS.md`/`CLAUDE.md`/`.warnyin/workflow/README.md` + output template ใน `.warnyin/template/stages/[topic]/`
40
- **สำคัญ: การเปลี่ยนพฤติกรรม stage ใดๆ ให้ user เป็นคนอธิบาย/ยืนยันก่อน อย่าเดาเอง**
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes