@ngockhoale/ukit 1.5.2 → 1.5.5

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 (33) hide show
  1. package/CHANGELOG.md +57 -5
  2. package/README.md +2 -2
  3. package/manifests/platform.full.yaml +2 -2
  4. package/package.json +1 -1
  5. package/src/cli/commands/doctor.js +14 -2
  6. package/src/cli/commands/install.js +2 -2
  7. package/src/cli/commands/uninstall.js +1 -1
  8. package/src/index/taskRouting.js +117 -1
  9. package/templates/.claude/agents/bug-debugger.md +48 -19
  10. package/templates/.claude/agents/code-reviewer.md +86 -0
  11. package/templates/.claude/agents/feature-implementer.md +59 -18
  12. package/templates/.claude/hooks/skill-router.sh +1 -1
  13. package/templates/.claude/hooks/verification-guard.sh +1 -1
  14. package/templates/.claude/skills/next-step/SKILL.md +1 -1
  15. package/templates/.claude/ukit/index/post-edit-verify.mjs +3 -2
  16. package/templates/.claude/ukit/index/route-task.mjs +8 -4
  17. package/templates/.claude/ukit/runtime/output-compression.mjs +37 -1
  18. package/templates/AGENTS.md +7 -0
  19. package/templates/CLAUDE.md +8 -1
  20. package/templates/docs/AI_HANDOFF/ACTIVE.md +9 -0
  21. package/templates/docs/AI_HANDOFF/HISTORY.md +4 -0
  22. package/templates/docs/AI_HANDOFF/INDEX.md +13 -0
  23. package/templates/docs/AI_HANDOFF/PLAN.md +75 -0
  24. package/templates/docs/AI_HANDOFF/RULES.md +127 -0
  25. package/templates/docs/AI_HANDOFF/archive/.gitkeep +0 -0
  26. package/templates/docs/AI_HANDOFF/tasks/.gitkeep +0 -0
  27. package/templates/docs/AI_HANDOFF/tasks/_TEMPLATE.md +72 -0
  28. package/templates/docs/INSTALL.md +2 -2
  29. package/templates/docs/PROJECT.md +1 -1
  30. package/templates/docs/UKIT_USAGE_GUIDE.md +1 -1
  31. package/templates/docs/WORKLOG.md +11 -0
  32. package/templates/ukit/storage/config.json +93 -1
  33. package/templates/docs/AI_HANDOFF.md +0 -118
@@ -2,6 +2,17 @@
2
2
 
3
3
  Track session-level execution details.
4
4
 
5
+ ## Budget Rules
6
+
7
+ Keep this file compact to save AI context tokens:
8
+
9
+ - **Max 30 entries.** When over, archive the oldest entries to `docs/WORKLOG_ARCHIVE.md`.
10
+ - **Max ~600 lines.** If over, archive oldest entries until under budget.
11
+ - Each entry should be 10-20 lines max (summary, not transcript).
12
+ - On archive: move full entry block to `docs/WORKLOG_ARCHIVE.md` (create if missing).
13
+ - Keep a compaction marker as the last line: `<!-- Entries before YYYY-MM archived to docs/WORKLOG_ARCHIVE.md. Keep this file < 600 lines. -->`
14
+ - If the user says "compact worklog" or "clean worklog", perform the archive pass and report what moved.
15
+
5
16
  For each significant action, append:
6
17
  - Date/time
7
18
  - Action taken
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.2",
2
+ "version": "1.5.5",
3
3
  "agent": "claude-code",
4
4
  "autonomy": {
5
5
  "level": "balanced",
@@ -156,6 +156,45 @@
156
156
  "deltaMaxHunks": 3,
157
157
  "deltaMaxDiffCells": 2000000
158
158
  },
159
+ "handoff": {
160
+ "enabled": true,
161
+ "crossTool": true,
162
+ "plan": {
163
+ "requireTestPlan": true,
164
+ "minTestsHappyPath": 1,
165
+ "minTestsEdgeCase": 1,
166
+ "regressionTestRequiredForBugfix": true,
167
+ "smartModelHint": "claude-opus-4-6"
168
+ },
169
+ "executor": {
170
+ "testFirstRequired": true,
171
+ "mustRunVerificationInTurn": true,
172
+ "blockDoneWithoutFreshPass": true,
173
+ "cheapSmartModelHint": "unic-code",
174
+ "appendReportToTaskFile": true
175
+ },
176
+ "reviewer": {
177
+ "enabled": true,
178
+ "model": "unic-smart",
179
+ "agent": "code-reviewer",
180
+ "mustDifferFromExecutor": true,
181
+ "blockOnCritical": true,
182
+ "blockOnChangesRequested": true,
183
+ "rerunVerificationCommands": true,
184
+ "appendVerdictToTaskFile": true
185
+ },
186
+ "statusFlow": [
187
+ "ready",
188
+ "in_progress",
189
+ "pending_review",
190
+ "changes_requested",
191
+ "critical_block",
192
+ "approved",
193
+ "approved_minor",
194
+ "blocked",
195
+ "done"
196
+ ]
197
+ },
159
198
  "subagents": {
160
199
  "enabled": true,
161
200
  "smallTaskModel": "unic-lite",
@@ -259,6 +298,30 @@
259
298
  "field": "compact.codexContext.autoCompact",
260
299
  "mac_dinh": true,
261
300
  "y_nghia": "Chỉ set false khi đang debug hành vi compact của UKit."
301
+ },
302
+ "doi_reviewer_model": {
303
+ "field": "handoff.reviewer.model",
304
+ "mac_dinh": "unic-smart",
305
+ "y_nghia": "Model dùng cho reviewer agent ở Phase 3. BẮT BUỘC khác model executor để bắt được lỗi mà executor miss. Có thể dùng claude-opus-4-6, unic-smart, hoặc bất kỳ model reasoning mạnh nào.",
306
+ "vi_du": "Nếu executor là unic-code (Kilo Code), set reviewer.model=unic-smart hoặc claude-opus-4-6. Nếu executor là claude-sonnet, set reviewer thành claude-opus."
307
+ },
308
+ "tat_reviewer_phase": {
309
+ "field": "handoff.reviewer.enabled",
310
+ "mac_dinh": true,
311
+ "y_nghia": "Tắt Phase 3 review nếu muốn chạy nhanh prototype. KHÔNG khuyến nghị cho code production — bỏ review là bỏ lưới an toàn cuối cùng.",
312
+ "khi_nao_tat": "Chỉ tắt cho throw-away prototype hoặc khi anh tự review thủ công."
313
+ },
314
+ "block_handoff_khi_critical": {
315
+ "field": "handoff.reviewer.blockOnCritical",
316
+ "mac_dinh": true,
317
+ "y_nghia": "Nếu reviewer báo CRITICAL → task không được phép done; executor phải fix và review lại. Set false chỉ khi muốn cảnh báo mềm.",
318
+ "khuyen_nghi": "Giữ true. Đây là rào chắn chống ship lỗi nghiêm trọng."
319
+ },
320
+ "bat_test_plan_bat_buoc": {
321
+ "field": "handoff.plan.requireTestPlan",
322
+ "mac_dinh": true,
323
+ "y_nghia": "Planner phải hoàn thành PLAN.md §4 (Test Plan) trước khi task chuyển ready. Tắt sẽ làm UKit cho phép skip TDD — kéo theo executor dễ làm sót.",
324
+ "khuyen_nghi": "Giữ true."
262
325
  }
263
326
  },
264
327
  "version": "Phiên bản config runtime đi kèm package UKit.",
@@ -374,6 +437,35 @@
374
437
  "deltaMaxChangedLines": "Ngân sách dòng đổi mặc định cho kiểm tra delta sau này.",
375
438
  "deltaMaxHunks": "Ngân sách hunk đổi mặc định cho kiểm tra delta sau này.",
376
439
  "deltaMaxDiffCells": "Giới hạn cell LCS khi tính delta; quá ngưỡng này UKit dùng fallback tuyến tính để tránh chậm trên file rất lớn."
440
+ },
441
+ "handoff": {
442
+ "enabled": "Bật Quality Gate cho handoff: plan có Test Plan, executor test-first, reviewer model khác. Tắt = quay về flow cũ (dễ lọt lỗi vặt).",
443
+ "crossTool": "true nghĩa là handoff truyền qua file (PLAN/INDEX/tasks) chứ không qua in-process subagent — cho phép plan ở Claude Code, execute ở Kilo Code, review ở Claude Code khác model.",
444
+ "plan": {
445
+ "requireTestPlan": "Bắt buộc PLAN.md §4 phải có Test Plan trước khi task chuyển ready.",
446
+ "minTestsHappyPath": "Tối thiểu test cho happy path.",
447
+ "minTestsEdgeCase": "Tối thiểu test cho edge case (null/empty/boundary/concurrent…).",
448
+ "regressionTestRequiredForBugfix": "Bug fix phải có regression test fail-trước-fix.",
449
+ "smartModelHint": "Gợi ý model mạnh nhất cho phase plan (ví dụ claude-opus-4-6). UKit không tự ép, chỉ ghi hint vào task."
450
+ },
451
+ "executor": {
452
+ "testFirstRequired": "Executor phải viết test trước khi implement (RED → GREEN).",
453
+ "mustRunVerificationInTurn": "Phải chạy Verification Commands trong cùng turn báo DONE; không tin output cũ.",
454
+ "blockDoneWithoutFreshPass": "Không cho phép STATUS:DONE nếu chưa có PASS fresh trong turn này.",
455
+ "cheapSmartModelHint": "Gợi ý model rẻ-mà-vẫn-thông-minh cho executor (ví dụ unic-code). UKit chỉ ghi hint.",
456
+ "appendReportToTaskFile": "Executor append `## Executor Report` vào cuối task file để reviewer (tool khác) đọc được."
457
+ },
458
+ "reviewer": {
459
+ "enabled": "Bật Phase 3 review độc lập. Tắt = bỏ lưới an toàn cuối cùng, không khuyến nghị.",
460
+ "model": "Model reviewer. BẮT BUỘC khác executor model. Mặc định unic-smart; có thể dùng claude-opus-4-6 hoặc bất kỳ model reasoning mạnh nào.",
461
+ "agent": "Tên reviewer agent (xem .claude/agents/code-reviewer.md).",
462
+ "mustDifferFromExecutor": "Nếu true, reviewer tự refuse khi phát hiện cùng model với executor.",
463
+ "blockOnCritical": "CRITICAL → block handoff cứng. Set false chỉ khi muốn warning mềm.",
464
+ "blockOnChangesRequested": "CHANGES-REQUESTED → block handoff đến khi fix. Set false sẽ cho phép done với issue Important.",
465
+ "rerunVerificationCommands": "Reviewer phải tự chạy lại Verification Commands, không tin output executor.",
466
+ "appendVerdictToTaskFile": "Reviewer append `## Reviewer Verdict` vào task file để khép vòng handoff."
467
+ },
468
+ "statusFlow": "Danh sách status hợp lệ trong INDEX.md. Đổi tên trong này = đổi state machine handoff."
377
469
  }
378
470
  }
379
471
  }
@@ -1,118 +0,0 @@
1
- # AI Handoff — {{project.name}}
2
-
3
- Dùng file này làm active handoff duy nhất cho project.
4
- Source code và test vẫn là sự thật cuối cùng.
5
-
6
- ---
7
-
8
- ## 1. Current Cycle Snapshot
9
-
10
- - Handoff status: `draft | ready_for_planning | ready_for_breakdown | ready_for_implementation | blocked | ready_for_next_cycle | done`
11
- - Current phase: `planning | breakdown | implementation | verification | wrap_up | cleared`
12
- - Updated at:
13
- - Updated by AI:
14
- - Human decision needed: `yes | no`
15
- - Human decision summary:
16
-
17
- ---
18
-
19
- ## 2. Handoff Rules
20
-
21
- ### How human should submit ideas
22
- - Có thể nói tự nhiên: `ukit:handoff`, `đưa vào handoff`, `gom các ý tưởng này thành task`, `chia việc cho AI làm tiếp`.
23
- - Nếu request đã là task cụ thể, rõ file/logic/đầu ra hoặc đủ nhỏ để làm ngay, bypass handoff và thực hiện trực tiếp.
24
- - Nếu request là ý tưởng rộng, nhiều tính năng, cải tiến mơ hồ, brainstorming, nhiều plan/task, hoặc cần chia cho AI kế tiếp, dùng handoff.
25
-
26
- ### Default handoff flow
27
- 1. Capture ideas/request.
28
- 2. Write a concrete plan.
29
- 3. Split the plan into ordered tasks.
30
- 4. Add target files, verification, dependencies, acceptance criteria, and stop conditions.
31
- 5. Resolve `ready` tasks in order.
32
- 6. Update this file with results.
33
- 7. Clear active handoff by keeping summary + carry-forward backlog only.
34
-
35
- ### Fast-AI task gate
36
- Một task chỉ được là `ready` khi có:
37
- - target file/folder rõ;
38
- - action cụ thể;
39
- - dependency/blocker rõ;
40
- - verification rõ;
41
- - acceptance criteria rõ;
42
- - stop condition rõ;
43
- - không cần đoán product decision.
44
-
45
- Nếu thiếu, để `needs_breakdown`, `blocked`, hoặc `needs_human`.
46
-
47
- ### Clear rule
48
- - `clear handoff` không bao giờ là wipe mù.
49
- - Trước khi clear, AI phải resolve hoặc triage task còn lại.
50
- - Completed work thành summary ngắn.
51
- - Unfinished work thành carry-forward backlog ngắn.
52
- - Sau clear, file phải ngắn, sẵn sàng cho cycle tiếp theo.
53
-
54
- ### Docs sync rule
55
- - Handoff không thay thế docs.
56
- - Sau khi xong cycle, update các file docs trực tiếp bị ảnh hưởng như `docs/WORKLOG.md`, `docs/PROJECT.md`, `docs/CODE_MAP.md`, `CHANGELOG.md` nếu có liên quan.
57
- - Không cần update toàn bộ `docs/` nếu không bị ảnh hưởng.
58
-
59
- ---
60
-
61
- ## 3. Completed Cycle Summary
62
-
63
- ### Cycle summary
64
- - completed:
65
- - verification:
66
- - important decisions:
67
- - carry-forward needed:
68
-
69
- ---
70
-
71
- ## 4. Carry-Forward Backlog
72
-
73
- ### TASK-001
74
- - Title:
75
- - Priority: `P0-now | P1-next | P2-later | blocked | needs_human`
76
- - Size: `S | M | L`
77
- - AI capability: `fast_ai_ok | needs_smart_ai | needs_human`
78
- - Goal:
79
- - Target files:
80
- - Dependencies:
81
- - Must do:
82
- - Must not do:
83
- - Acceptance criteria:
84
- - Verification:
85
- - Stop condition:
86
- - Status: `ready | blocked | in_progress | done | needs_breakdown | needs_human`
87
- - Owner AI:
88
-
89
- ### TASK-002
90
- - Title:
91
- - Priority: `P0-now | P1-next | P2-later | blocked | needs_human`
92
- - Size: `S | M | L`
93
- - AI capability: `fast_ai_ok | needs_smart_ai | needs_human`
94
- - Goal:
95
- - Target files:
96
- - Dependencies:
97
- - Must do:
98
- - Must not do:
99
- - Acceptance criteria:
100
- - Verification:
101
- - Stop condition:
102
- - Status: `ready | blocked | in_progress | done | needs_breakdown | needs_human`
103
- - Owner AI:
104
-
105
- ---
106
-
107
- ## 5. Decisions Made By Human
108
-
109
- -
110
- -
111
-
112
- ---
113
-
114
- ## 6. Do Not Lose This Context
115
-
116
- -
117
- -
118
- -