opencode-agent-skill 9.0.0 → 10.0.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.
package/README.md CHANGED
@@ -1,675 +1,696 @@
1
- # OpenCode Universal Engineering System (UES)
2
-
3
- > **Bản hiện tại: 9.0.0**
4
- > UES là bộ công cụ hỗ trợ OpenCode xử lý dự án lớn, tác vụ dài và quy trình kỹ thuật cần kiểm chứng bằng bằng chứng thực tế.
5
-
6
- [![npm version](https://img.shields.io/npm/v/opencode-agent-skill.svg)](https://www.npmjs.com/package/opencode-agent-skill)
7
- [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
-
9
- ## Giới thiệu
10
-
11
- **OpenCode Universal Engineering System (UES)** là một engineering harness dành cho OpenCode. UES không thay đổi năng lực nền tảng của model, mà tổ chức cách model làm việc để:
12
-
13
- - giảm lượng thông tin phải giữ trong một context dài;
14
- - chia tác vụ lớn thành các bước rõ ràng;
15
- - lưu trạng thái ra filesystem để có thể tiếp tục sau khi session bị ngắt;
16
- - chạy executor bằng context mới cho từng tác vụ;
17
- - yêu cầu bằng chứng kiểm thử trước khi đánh dấu hoàn tất;
18
- - kiểm tra thay đổi ở mức task và mức tích hợp toàn hệ thống;
19
- - hỗ trợ routing skill, model tier, task policy và recovery theo trạng thái thực tế của repository.
20
-
21
- Mục tiêu của UES là giúp quá trình làm việc với coding agent **ổn định hơn, có thể kiểm chứng hơn và phù hợp hơn với repository lớn**.
22
-
23
- ---
24
-
25
- ## Cài đặt
26
-
27
- Yêu cầu:
28
-
29
- - Node.js 20 trở lên;
30
- - npm;
31
- - OpenCode.
32
-
33
- Cài đặt toàn cục từ npm:
34
-
35
- ```cmd
36
- npm install -g opencode-agent-skill
37
- ```
38
-
39
- Kiểm tra:
40
-
41
- ```cmd
42
- ocskill version
43
- ocskill status
44
- ocskill doctor
45
- ```
46
-
47
- Nếu npm không chạy lifecycle script trong lúc cài đặt, chạy thêm:
48
-
49
- ```cmd
50
- ocskill install
51
- ```
52
-
53
- Sau khi cài hoặc cập nhật UES, nên mở một OpenCode session mới để các skill, command, subagent và plugin được nạp lại đầy đủ.
54
-
55
- ---
56
-
57
- ## Bắt đầu nhanh
58
-
59
- Với tác vụ lớn, dùng:
60
-
61
- ```text
62
- /ues-run <yêu cầu>
63
- ```
64
-
65
- Nếu session bị ngắt hoặc context bị compact:
66
-
67
- ```text
68
- /ues-resume <slug>
69
- ```
70
-
71
- Một số lệnh hữu ích:
72
-
73
- ```cmd
74
- ocskill inspect .
75
- ocskill repo-graph .
76
- ocskill verification-plan .
77
- ocskill task-policy "refactor auth across the whole repository"
78
- ocskill dashboard . --serve
79
- ```
80
-
81
- ---
82
-
83
- ## UES 9.0.0 có gì?
84
-
85
- UES 9.0.0 cung cấp các khả năng sau (kế thừa từ 8.0.0):
86
-
87
- - **39 engineering skills**;
88
- - **11 slash commands**;
89
- - **10 subagents**;
90
- - long-task engine bền vững dưới `.ues-work/<slug>/`;
91
- - `PLAN.json`, `STATE.json`, `EVIDENCE.json` và append-only `EVENTS.jsonl`;
92
- - structured plan/integration receipts gắn với plan hash hoặc workspace fingerprint;
93
- - task lease với `runId`, heartbeat, session owner, lease expiry và task-scoped stale recovery;
94
- - strict verification cho long/high-risk task: receipt phải PASS đúng active run và đúng workspace hiện tại;
95
- - context manifest v3 với Git-change awareness, symbol hits, TF-IDF-style relevance, tests/instructions và centered excerpts;
96
- - task policy `inline / standard / long-horizon` cùng model tier `light / standard / heavy`;
97
- - bounded fresh executor với hard timeout, interrupt/cancel và recovery;
98
- - safe-wave scheduling cùng Git worktree isolation/integration có conflict detection;
99
- - learning v2: failure clustering, explicit acceptance và shadow-benchmark promotion;
100
- - benchmark matrix standard + long-horizon + polyglot;
101
- - optional Hermes adapter;
102
- - UES Control Center hiển thị runtime events, receipts và stale recovery;
103
- - OpenCode V2 router plugin với multilingual routing, safety gate, cancel/recover tools và fresh-session dispatch.
104
-
105
- V9 bổ sung:
106
-
107
- - persistent incremental source index dưới `.ues-cache/semantic-index-v1.json` cùng ACI search/refs/view/text;
108
- - FAST / STANDARD / DEEP execution profiles với bounded context budget, skill cap và verification depth;
109
- - context manifest v4 tiêu thụ incremental evidence index trước khi mở rộng graph;
110
- - redacted operational trajectory dưới `.ues-traces/*.jsonl` để replay/debug mà không lưu hidden chain-of-thought;
111
- - optional container verification sandbox (Docker/Podman) với network-off, dropped capabilities và resource bounds;
112
- - paired baseline-vs-UES confidence gate qua `npm run evals:matrix:gate`.
113
-
114
- ---
115
-
116
- ## Kiến trúc tác vụ dài
117
-
118
- Luồng long-horizon chính:
119
-
120
- ```text
121
- Yêu cầu
122
- ↓
123
- Khảo sát repository / bằng chứng
124
- ↓
125
- SPEC.md
126
- ↓
127
- PLAN.json
128
- ↓
129
- ues-plan-checker
130
- ↓
131
- Phê duyệt kế hoạch
132
- ↓
133
- Các task theo dependency graph
134
- ↓
135
- Fresh ues-executor session cho từng task
136
- ↓
137
- Task evidence + durable state
138
- ↓
139
- ues-integration-verifier
140
- ↓
141
- Integration PASS
142
- ↓
143
- Kiểm tra workspace không thay đổi
144
- ↓
145
- Finalize
146
- ```
147
-
148
- Mỗi work item dùng cấu trúc:
149
-
150
- ```text
151
- .ues-work/<slug>/
152
- ├── SPEC.md
153
- ├── PLAN.json
154
- ├── STATE.json
155
- ├── EVIDENCE.json
156
- ├── EVENTS.jsonl
157
- ├── tasks/
158
- └── reports/
159
- ```
160
-
161
- `.ues-work/` là trạng thái thực thi của workflow, không phải hidden chain-of-thought.
162
-
163
- ### Gate 1 — Phê duyệt kế hoạch
164
-
165
- Sau khi tạo plan, task chưa được chạy ngay. Trạng thái sẽ ở:
166
-
167
- ```text
168
- awaiting-plan-approval
169
- ```
170
-
171
- Sau khi `ues-plan-checker` trả PASS, với long/high-risk work hãy tạo receipt gắn với đúng plan hiện tại rồi mới approve:
172
-
173
- ```cmd
174
- ocskill work gate-receipt <slug> plan . --verifier ues-plan-checker --evidence "plan checker PASS" --out .ues-work/<slug>/reports/plan-receipt.json
175
- ocskill work approve-plan <slug> . --evidence "plan checker PASS" --receipt-file .ues-work/<slug>/reports/plan-receipt.json
176
- ```
177
-
178
- Nếu thiếu structured receipt ở workflow strict, `ocskill work start` sẽ không được mở gate.
179
-
180
- ### Gate 2 — Bằng chứng cho từng task
181
-
182
- Có thể ghi verification receipt trực tiếp từ command:
183
-
184
- ```cmd
185
- ocskill work verify-command <slug> <task-id> . --run-id <run-id> -- npm test
186
- ```
187
-
188
- Receipt gắn kết kết quả command với đúng task run. Với long/high-risk work, receipt PASS còn phải khớp workspace fingerprint hiện tại; nếu code thay đổi sau khi test thì phải verify lại.
189
-
190
- ### Gate 3 — Kiểm tra tích hợp
191
-
192
- Sau khi toàn bộ task hoàn tất, tạo integration receipt gắn với workspace hiện tại rồi ghi PASS:
193
-
194
- ```cmd
195
- ocskill work gate-receipt <slug> integration . --verifier ues-integration-verifier --verdict PASS --evidence "integration PASS" --out .ues-work/<slug>/reports/integration-receipt.json
196
- ocskill work verify-integration <slug> . --verdict PASS --evidence "integration PASS" --receipt-file .ues-work/<slug>/reports/integration-receipt.json
197
- ```
198
-
199
- Sau đó:
200
-
201
- ```cmd
202
- ocskill work finalize <slug> . --evidence "final acceptance verified"
203
- ```
204
-
205
- `finalize` sẽ bị từ chối nếu còn task chưa hoàn tất, còn blocker, chưa có integration PASS hoặc workspace đã thay đổi sau lần kiểm tra tích hợp.
206
-
207
- ---
208
-
209
- ## Fresh-context executor trên OpenCode V2
210
-
211
- OpenCode V2 plugin cung cấp tool:
212
-
213
- ```text
214
- ues.dispatch_task
215
- ```
216
-
217
- Luồng thực thi:
218
-
219
- ```text
220
- work start
221
- ↓
222
- đọc bounded context pack
223
- ↓
224
- chọn model tier theo task + attempt
225
- ↓
226
- tạo OpenCode session mới
227
- ↓
228
- switchAgent(ues-executor)
229
- ↓
230
- switchModel(...) nếu đã cấu hình
231
- ↓
232
- gửi đúng một task
233
- ↓
234
- heartbeat + bounded wait
235
- ↓
236
- interrupt nếu timeout/cancel
237
- ↓
238
- isolate writer khi cần
239
- ↓
240
- trả child-session report
241
- ```
242
-
243
- Parent session vẫn chịu trách nhiệm kiểm tra diff, evidence và quyết định gọi `work complete` hoặc `work fail`.
244
-
245
- Child session không được tự động merge, push, publish hoặc deploy.
246
-
247
- ---
248
-
249
- ## Subagents
250
-
251
- | Subagent | Vai trò |
252
- |---|---|
253
- | `ues-codebase-mapper` | Lập bản đồ repository, entry point, boundary, hotspot, contract và test surface |
254
- | `ues-architect` | Phân tích kiến trúc và phạm vi ảnh hưởng |
255
- | `ues-plan-checker` | Kiểm tra SPEC/PLAN trước khi cho phép thực thi |
256
- | `ues-executor` | Thực hiện một task đã được phê duyệt trong context mới |
257
- | `ues-debugger` | Điều tra nguyên nhân gốc của lỗi |
258
- | `ues-researcher` | Kiểm tra tài liệu, API và phiên bản hiện hành |
259
- | `ues-reviewer` | Review correctness, regression, security và compatibility |
260
- | `ues-critic` | Tìm giả định sai, counterexample và điểm yếu trong phương án |
261
- | `ues-verifier` | Xác minh độc lập theo acceptance criteria |
262
- | `ues-integration-verifier` | Kiểm tra tích hợp giữa nhiều task và luồng end-to-end |
263
-
264
- `ues-executor` là subagent chính có quyền sửa code theo scope được giao. Các agent còn lại chủ yếu phục vụ phân tích, review và xác minh.
265
-
266
- ---
267
-
268
- ## Slash commands
269
-
270
- | Lệnh | Công dụng |
271
- |---|---|
272
- | `/ues-feature` | Triển khai feature theo workflow UES |
273
- | `/ues-fix` | Điều tra nguyên nhân rồi sửa bug |
274
- | `/ues-plan` | Lập kế hoạch triển khai có thể thực thi |
275
- | `/ues-debug` | Điều tra lỗi build, runtime hoặc test |
276
- | `/ues-research` | Kiểm tra docs, API, package hoặc version |
277
- | `/ues-review` | Review code hoặc diff |
278
- | `/ues-verify` | Xác minh bằng evidence mới |
279
- | `/ues-critique` | Tìm assumption sai và counterexample |
280
- | `/ues-audit` | Audit repository hoặc một khu vực |
281
- | `/ues-run` | Chạy workflow long-horizon với durable state |
282
- | `/ues-resume` | Tiếp tục work item từ `.ues-work` |
283
-
284
- ---
285
-
286
- ## Task policy và model policy
287
-
288
- Phân loại yêu cầu kỹ thuật:
289
-
290
- ```cmd
291
- ocskill task-policy "your engineering request"
292
- ```
293
-
294
- Kiểm tra model policy:
295
-
296
- ```cmd
297
- ocskill model-policy executor --attempt 1 --text "your engineering request"
298
- ```
299
-
300
- UES dùng ba model tier:
301
-
302
- ```text
303
- light
304
- standard
305
- heavy
306
- ```
307
-
308
- Xem cấu hình:
309
-
310
- ```cmd
311
- ocskill models status
312
- ```
313
-
314
- Bật model policy:
315
-
316
- ```cmd
317
- ocskill models on
318
- ```
319
-
320
- Gán model cho từng tier:
321
-
322
- ```cmd
323
- ocskill models set light provider/cheap
324
- ocskill models set standard provider/mid
325
- ocskill models set heavy provider/strong
326
- ```
327
-
328
- Gán tier theo role:
329
-
330
- ```cmd
331
- ocskill models role executor standard
332
- ocskill models role plan-checker heavy
333
- ```
334
-
335
- Model ID do người dùng cấu hình vẫn là nguồn quyết định cuối cùng; UES không tự đoán provider/model ID.
336
-
337
- ---
338
-
339
- ## Công cụ CLI
340
-
341
- | Lệnh | Công dụng |
342
- |---|---|
343
- | `ocskill inspect [dir]` | Phát hiện stack, package manager, root và test command |
344
- | `ocskill repo-graph [dir]` | Lập import graph có giới hạn và tìm hotspot |
345
- | `ocskill impact <query> [dir]` | Tìm phạm vi ảnh hưởng theo symbol hoặc từ khóa |
346
- | `ocskill evidence [dir]` | Thu thập snapshot về repository, verification và Git |
347
- | `ocskill working-tree [dir]` | Kiểm tra branch, HEAD và working tree |
348
- | `ocskill review-scope [base] [dir]` | Phân tích changed-file coverage và risk hint |
349
- | `ocskill verification-plan [dir]` | Đề xuất verification phù hợp với project |
350
- | `ocskill task-graph <PLAN.json>` | Kiểm tra DAG và tính safe waves |
351
- | `ocskill context-pack <slug> <task> [dir]` | Tạo bounded handoff cho executor |
352
- | `ocskill work ...` | Điều khiển durable long-task state machine |
353
-
354
- Ví dụ:
355
-
356
- ```cmd
357
- ocskill repo-graph .
358
- ocskill review-scope main .
359
- ocskill verification-plan .
360
- ocskill task-graph .ues-work/checkout/PLAN.json
361
- ocskill work status checkout .
362
- ```
363
-
364
- ---
365
-
366
- ## Skills
367
-
368
- UES hiện có **39 skills**. Router chỉ chọn các skill phù hợp thay vì nạp toàn bộ catalog vào mỗi task.
369
-
370
- Một số process skill quan trọng:
371
-
372
- - `ues-engineering-orchestrator`
373
- - `ues-repo-explorer`
374
- - `ues-context-engineering`
375
- - `ues-task-planner`
376
- - `ues-change-impact-analysis`
377
- - `ues-bug-diagnosis`
378
- - `ues-test-driven-development`
379
- - `ues-test-verification`
380
- - `ues-code-review`
381
- - `ues-research-verification`
382
- - `ues-long-task-state`
383
- - `ues-git-safety`
384
-
385
- Nhóm domain/framework hiện bao gồm React, Next.js, React Native, Node.js, NestJS, Python, Django, FastAPI, .NET, Java/Spring, Flutter, database, REST/API contract, authentication/security, payment, ecommerce, file upload, DevOps, UI/UX, accessibility và performance.
386
-
387
- ---
388
-
389
- ## Tương thích OpenCode
390
-
391
- ### OpenCode 1.x
392
-
393
- - cài skill, command và subagent;
394
- - dùng frontmatter tương thích V1;
395
- - không cài V2 runtime plugin;
396
- - durable long-task CLI vẫn dùng được;
397
- - không có V2 `ues.dispatch_task`.
398
-
399
- ### OpenCode 2.x
400
-
401
- Ngoài resource file, UES cài managed plugin tại:
402
-
403
- ```text
404
- ~/.config/opencode/plugins/ues-router/
405
- ```
406
-
407
- Plugin cung cấp:
408
-
409
- - automatic skill routing;
410
- - context guardrail;
411
- - permission safety gate;
412
- - read-only long-task helpers;
413
- - fresh-session executor runtime qua `ues.dispatch_task`.
414
-
415
- Điều khiển router:
416
-
417
- ```cmd
418
- ocskill router status
419
- ocskill router on --max 4
420
- ocskill router off
421
- ```
422
-
423
- ---
424
-
425
- ## Safety
426
-
427
- OpenCode V2 permission gate yêu cầu xác nhận rõ ràng trước các thao tác có tác động lớn, ví dụ:
428
-
429
- - `git push --force` hoặc `git push -f`;
430
- - `git reset --hard`;
431
- - destructive `git clean`;
432
- - `npm publish`;
433
- - recursive forced deletion;
434
- - `DROP` hoặc `TRUNCATE`;
435
- - Terraform, Kubernetes hoặc Helm action có tác động lớn.
436
-
437
- Safety hook là lớp bảo vệ deterministic bổ sung, không thay thế review của người dùng.
438
-
439
- ---
440
-
441
- ## Learning loop
442
-
443
- Phân tích eval trace:
444
-
445
- ```cmd
446
- ocskill learn analyze . --eval-dir .ues-evals
447
- ```
448
-
449
- Xem trạng thái:
450
-
451
- ```cmd
452
- ocskill learn status .
453
- ```
454
-
455
- Chấp nhận một proposal trước khi thử nghiệm:
456
-
457
- ```cmd
458
- ocskill learn accept <proposal-id> .
459
- ```
460
-
461
- Sau khi shadow benchmark chứng minh candidate tốt hơn baseline:
462
-
463
- ```cmd
464
- ocskill learn promote <proposal-id> . --baseline 0.50 --candidate 0.75 --samples 4
465
- ```
466
-
467
- Proposal có `shadowRequired` chỉ được đưa trở lại context sau khi vừa được chấp nhận rõ ràng vừa có benchmark improvement đo được.
468
-
469
- ---
470
-
471
- ## Hermes adapter
472
-
473
- UES hỗ trợ Hermes theo dạng adapter tùy chọn, không nhúng Hermes runtime vào core:
474
-
475
- ```cmd
476
- ocskill hermes status
477
- ocskill hermes prompt <slug> <task> .
478
- ocskill hermes exec <slug> <task> .
479
- ```
480
-
481
- Nếu máy không có Hermes CLI, các tính năng Hermes chỉ báo unavailable và không ảnh hưởng đến core UES.
482
-
483
- ---
484
-
485
- ## UES Control Center
486
-
487
- Tạo dashboard tĩnh:
488
-
489
- ```cmd
490
- ocskill dashboard .
491
- ```
492
-
493
- Chạy dashboard có tự refresh:
494
-
495
- ```cmd
496
- ocskill dashboard . --serve --port 4177
497
- ```
498
-
499
- Control Center hiển thị work state, verification receipts, runtime events, learning proposals và eval summary; server mode có safe stale-recovery action.
500
-
501
- ---
502
-
503
- ## Sandbox cho tác vụ ghi song song
504
-
505
- Tạo isolated Git worktree:
506
-
507
- ```cmd
508
- ocskill sandbox create <slug> <task-id> .
509
- ```
510
-
511
- Tích hợp sandbox sau khi đã inspect/verify:
512
-
513
- ```cmd
514
- ocskill sandbox integrate <worktree-path> .
515
- ```
516
-
517
- Liệt kê sandbox:
518
-
519
- ```cmd
520
- ocskill sandbox list .
521
- ```
522
-
523
- Integration sẽ từ chối ghi đè lên file đang dirty ở root. Safe-wave scheduling chỉ bảo vệ declared file scope. Generated file, lockfile hoặc shared write surface ngầm định vẫn nên được serialize khi cần.
524
-
525
- ---
526
-
527
- ## Evaluation
528
-
529
- UES 9.0.0 hiện có:
530
-
531
- - **34 static skill-routing scenarios** phủ 39 skills;
532
- - **120 V2 router cases** với required routes và negative guards;
533
- - **20 standard live tasks**;
534
- - **5 long-horizon tasks**;
535
- - **8 polyglot tasks** cho Python, Java, .NET, Next.js, React Native, SQL migration, monorepo và generated contract;
536
- - benchmark matrix baseline-vs-UES nhiều trial;
537
- - một long task tích hợp tới **15 source modules**.
538
-
539
- Kiểm tra static routing:
540
-
541
- ```cmd
542
- npm run evals
543
- ```
544
-
545
- Kiểm tra V2 router:
546
-
547
- ```cmd
548
- npm run evals:router
549
- ```
550
-
551
- Kiểm tra standard hidden graders:
552
-
553
- ```cmd
554
- npm run evals:live:validate
555
- ```
556
-
557
- Kiểm tra long-horizon và polyglot suite:
558
-
559
- ```cmd
560
- npm run evals:long:validate
561
- npm run evals:polyglot:validate
562
- ```
563
-
564
- Chạy benchmark với model thật:
565
-
566
- ```cmd
567
- ocskill eval-live --model provider/model --trials 3
568
- ocskill eval-live --suite long --model provider/model --trials 3
569
- npm run evals:matrix -- --model provider/model --trials 3
570
- ```
571
-
572
- Live eval hỗ trợ heartbeat, hard timeout, idle timeout và Ctrl+C process-tree cancellation.
573
-
574
- Với long suite, một run UES chỉ được tính PASS khi hidden grader PASS, durable work state tồn tại, plan approval hợp lệ, toàn bộ task hoàn tất, integration verification PASS và finalization hoàn tất.
575
-
576
- ---
577
-
578
- ## Phát triển và CI
579
-
580
- Yêu cầu:
581
-
582
- - Node.js 20+;
583
- - npm;
584
- - Git.
585
-
586
- Cài dependency mà không chạy lifecycle script:
587
-
588
- ```cmd
589
- npm ci --ignore-scripts
590
- ```
591
-
592
- Chạy toàn bộ CI:
593
-
594
- ```cmd
595
- npm run ci
596
- ```
597
-
598
- Pipeline hiện kiểm tra:
599
-
600
- ```text
601
- syntax
602
- → resource validation
603
- → static skill routing
604
- → V2 router matrix
605
- → standard hidden-grader integrity
606
- → long hidden-grader integrity
607
- → polyglot hidden-grader integrity
608
- → Node tests
609
- → npm pack --dry-run
610
- → packed global-install smoke
611
- → plain one-command install compatibility smoke
612
- ```
613
-
614
- Packed smoke xác minh package cài được từ tarball và kiểm tra OpenCode V2 path, skills, commands, subagents, router plugin, task graph, durable state và model config.
615
-
616
- ---
617
-
618
- ## Cập nhật và gỡ cài đặt
619
-
620
- Cập nhật lên bản npm mới nhất:
621
-
622
- ```cmd
623
- ocskill update
624
- ```
625
-
626
- Gỡ UES:
627
-
628
- ```cmd
629
- ocskill remove
630
- ```
631
-
632
- UES chỉ quản lý resource có namespace/marker của chính nó và cố gắng giữ nguyên resource không thuộc quyền quản lý của UES.
633
-
634
- ---
635
-
636
- ## Tài liệu
637
-
638
- - [Thiết kế hệ thống](docs/ENGINEERING-DESIGN.md)
639
- - [Tương thích OpenCode](docs/OPENCODE-COMPAT.md)
640
- - [Công cụ deterministic](docs/DETERMINISTIC-TOOLS.md)
641
- - [Evaluation](docs/EVALS.md)
642
- - [Trace schema](docs/TRACE-SCHEMA.md)
643
- - [Hướng dẫn publish npm](docs/NPM-PUBLISH.md)
644
- - [Nguồn nghiên cứu](docs/RESEARCH-SOURCES.md)
645
- - [V7 Intelligence Runtime](docs/V7-INTELLIGENCE-RUNTIME.md)
646
- - [V8 Intelligence & Reliability](docs/V8-INTELLIGENCE-RELIABILITY.md)
647
- - [V9 Speed & Intelligence](docs/V9-SPEED-INTELLIGENCE.md)
648
-
649
- ---
650
-
651
- ## npm
652
-
653
- Package:
654
-
655
- ```text
656
- opencode-agent-skill
657
- ```
658
-
659
- Cài đặt:
660
-
661
- ```cmd
662
- npm install -g opencode-agent-skill
663
- ```
664
-
665
- Phiên bản hiện tại:
666
-
667
- ```text
668
- 9.0.0
669
- ```
670
-
671
- ---
672
-
673
- ## License
674
-
675
- MIT
1
+ # OpenCode Universal Engineering System (UES)
2
+
3
+ > **V10 stable: 10.0.0** — bản phát hành chính thức của V10, dùng trực tiếp qua npm `latest`.
4
+ > UES là bộ công cụ hỗ trợ OpenCode xử lý dự án lớn, tác vụ dài và quy trình kỹ thuật cần kiểm chứng bằng bằng chứng thực tế.
5
+
6
+ [![npm version](https://img.shields.io/npm/v/opencode-agent-skill.svg)](https://www.npmjs.com/package/opencode-agent-skill)
7
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
+
9
+ ## Giới thiệu
10
+
11
+ **OpenCode Universal Engineering System (UES)** là một engineering harness dành cho OpenCode. UES không thay đổi năng lực nền tảng của model, mà tổ chức cách model làm việc để:
12
+
13
+ - giảm lượng thông tin phải giữ trong một context dài;
14
+ - chia tác vụ lớn thành các bước rõ ràng;
15
+ - lưu trạng thái ra filesystem để có thể tiếp tục sau khi session bị ngắt;
16
+ - chạy executor bằng context mới cho từng tác vụ;
17
+ - yêu cầu bằng chứng kiểm thử trước khi đánh dấu hoàn tất;
18
+ - kiểm tra thay đổi ở mức task và mức tích hợp toàn hệ thống;
19
+ - hỗ trợ routing skill, model tier, task policy và recovery theo trạng thái thực tế của repository.
20
+
21
+ Mục tiêu của UES là giúp quá trình làm việc với coding agent **ổn định hơn, có thể kiểm chứng hơn và phù hợp hơn với repository lớn**.
22
+
23
+ ---
24
+
25
+ ## Cài đặt
26
+
27
+ Yêu cầu:
28
+
29
+ - Node.js 20 trở lên;
30
+ - npm;
31
+ - OpenCode.
32
+
33
+ Cài đặt toàn cục từ npm:
34
+
35
+ ```cmd
36
+ npm install -g opencode-agent-skill
37
+ ```
38
+
39
+ Kiểm tra:
40
+
41
+ ```cmd
42
+ ocskill version
43
+ ocskill status
44
+ ocskill doctor
45
+ ```
46
+
47
+ Nếu npm không chạy lifecycle script trong lúc cài đặt, chạy thêm:
48
+
49
+ ```cmd
50
+ ocskill install
51
+ ```
52
+
53
+ Sau khi cài hoặc cập nhật UES, nên mở một OpenCode session mới để các skill, command, subagent và plugin được nạp lại đầy đủ.
54
+
55
+ ---
56
+
57
+ ## Bắt đầu nhanh
58
+
59
+ Với tác vụ lớn, dùng:
60
+
61
+ ```text
62
+ /ues-run <yêu cầu>
63
+ ```
64
+
65
+ Nếu session bị ngắt hoặc context bị compact:
66
+
67
+ ```text
68
+ /ues-resume <slug>
69
+ ```
70
+
71
+ Một số lệnh hữu ích:
72
+
73
+ ```cmd
74
+ ocskill inspect .
75
+ ocskill repo-graph .
76
+ ocskill verification-plan .
77
+ ocskill task-policy "refactor auth across the whole repository"
78
+ ocskill dashboard . --serve
79
+ ```
80
+
81
+ ---
82
+
83
+ ## V10 có gì?
84
+
85
+ V10 tập trung vào **minimum context necessary for maximum task success**: giảm context luôn nạp nhưng không cắt các lớp correctness, verification hay recovery.
86
+
87
+ - telemetry đo riêng **initial input tokens** bên cạnh total tokens, tool calls, latency và cost;
88
+ - global `AGENTS.md` được nén đáng kể, giữ lại contract, evidence, verification, safety và long-horizon invariants;
89
+ - FAST context budget giảm từ 12k xuống **8k**, STANDARD từ 24k xuống **20k**, còn DEEP vẫn giữ **48k** cho task rủi ro/lớn;
90
+ - OpenCode V2 runtime dùng policy-aware selective routing: FAST ưu tiên domain/debug/review skill trực tiếp thay vì tự động nạp generic orchestrator;
91
+ - failed attempt tự mở rộng context theo tầng `initial -> diagnose -> deep-recovery`; retry tăng evidence, graph/critic và model tier khi cấu hình cho phép;
92
+ - FAST không tự hạ executor thấp hơn tier đã cấu hình, nên tối ưu context không đồng nghĩa hạ năng lực model;
93
+ - benchmark confidence gate kiểm tra thêm initial-input ratio và total-token ratio;
94
+ - `npm run evals:ablation -- <reference> <candidate> --require-gate` so V10 với một reference run và từ chối candidate giảm pass-rate dù token có thấp hơn;
95
+ - runtime reliability guard phát hiện no-progress/stall, chặn duplicate `read/grep/glob`, phát hiện loop và cắt output exploration quá lớn trước khi nó làm ngập context;
96
+ - pre-compaction checkpoint lưu `currentTaskId`, `runId`, plan hash, workspace fingerprint, evidence pointers và structured `nextAction`; post-compaction bắt buộc thực thi action trước khi session được coi là hoàn tất;
97
+ - provider recovery thử fresh session cùng model một lần, sau lỗi lặp lại dùng configured escalation model/provider nếu có;
98
+ - lease supervisor tự thu hồi executor lease hết hạn sang trạng thái `retryable`, và explicit `long/high-risk` hard-override FAST thành DEEP/heavy.
99
+
100
+ V10 stable kế thừa toàn bộ RC.2 reliability hardening. Local full gate trên Windows/Node 24 đã PASS với 182 test pass, 0 fail, 2 skip cùng package/install smoke PASS trước khi promote.
101
+
102
+ ---
103
+
104
+ ## UES 9.0.0 có gì?
105
+
106
+ UES 9.0.0 cung cấp các khả năng sau (kế thừa từ 8.0.0):
107
+
108
+ - **39 engineering skills**;
109
+ - **11 slash commands**;
110
+ - **10 subagents**;
111
+ - long-task engine bền vững dưới `.ues-work/<slug>/`;
112
+ - `PLAN.json`, `STATE.json`, `EVIDENCE.json` và append-only `EVENTS.jsonl`;
113
+ - structured plan/integration receipts gắn với plan hash hoặc workspace fingerprint;
114
+ - task lease với `runId`, heartbeat, session owner, lease expiry và task-scoped stale recovery;
115
+ - strict verification cho long/high-risk task: receipt phải PASS đúng active run và đúng workspace hiện tại;
116
+ - context manifest v3 với Git-change awareness, symbol hits, TF-IDF-style relevance, tests/instructions và centered excerpts;
117
+ - task policy `inline / standard / long-horizon` cùng model tier `light / standard / heavy`;
118
+ - bounded fresh executor với hard timeout, interrupt/cancel và recovery;
119
+ - safe-wave scheduling cùng Git worktree isolation/integration có conflict detection;
120
+ - learning v2: failure clustering, explicit acceptance và shadow-benchmark promotion;
121
+ - benchmark matrix standard + long-horizon + polyglot;
122
+ - optional Hermes adapter;
123
+ - UES Control Center hiển thị runtime events, receipts và stale recovery;
124
+ - OpenCode V2 router plugin với multilingual routing, safety gate, cancel/recover tools và fresh-session dispatch.
125
+
126
+ V9 bổ sung:
127
+
128
+ - persistent incremental source index dưới `.ues-cache/semantic-index-v1.json` cùng ACI search/refs/view/text;
129
+ - FAST / STANDARD / DEEP execution profiles với bounded context budget, skill cap và verification depth;
130
+ - context manifest v4 tiêu thụ incremental evidence index trước khi mở rộng graph;
131
+ - redacted operational trajectory dưới `.ues-traces/*.jsonl` để replay/debug mà không lưu hidden chain-of-thought;
132
+ - optional container verification sandbox (Docker/Podman) với network-off, dropped capabilities và resource bounds;
133
+ - paired baseline-vs-UES confidence gate qua `npm run evals:matrix:gate`.
134
+
135
+ ---
136
+
137
+ ## Kiến trúc tác vụ dài
138
+
139
+ Luồng long-horizon chính:
140
+
141
+ ```text
142
+ Yêu cầu
143
+ ↓
144
+ Khảo sát repository / bằng chứng
145
+ ↓
146
+ SPEC.md
147
+ ↓
148
+ PLAN.json
149
+ ↓
150
+ ues-plan-checker
151
+ ↓
152
+ Phê duyệt kế hoạch
153
+ ↓
154
+ Các task theo dependency graph
155
+ ↓
156
+ Fresh ues-executor session cho từng task
157
+ ↓
158
+ Task evidence + durable state
159
+ ↓
160
+ ues-integration-verifier
161
+ ↓
162
+ Integration PASS
163
+ ↓
164
+ Kiểm tra workspace không thay đổi
165
+ ↓
166
+ Finalize
167
+ ```
168
+
169
+ Mỗi work item dùng cấu trúc:
170
+
171
+ ```text
172
+ .ues-work/<slug>/
173
+ ├── SPEC.md
174
+ ├── PLAN.json
175
+ ├── STATE.json
176
+ ├── EVIDENCE.json
177
+ ├── EVENTS.jsonl
178
+ ├── tasks/
179
+ └── reports/
180
+ ```
181
+
182
+ `.ues-work/` là trạng thái thực thi của workflow, không phải hidden chain-of-thought.
183
+
184
+ ### Gate 1 — Phê duyệt kế hoạch
185
+
186
+ Sau khi tạo plan, task chưa được chạy ngay. Trạng thái sẽ ở:
187
+
188
+ ```text
189
+ awaiting-plan-approval
190
+ ```
191
+
192
+ Sau khi `ues-plan-checker` trả PASS, với long/high-risk work hãy tạo receipt gắn với đúng plan hiện tại rồi mới approve:
193
+
194
+ ```cmd
195
+ ocskill work gate-receipt <slug> plan . --verifier ues-plan-checker --evidence "plan checker PASS" --out .ues-work/<slug>/reports/plan-receipt.json
196
+ ocskill work approve-plan <slug> . --evidence "plan checker PASS" --receipt-file .ues-work/<slug>/reports/plan-receipt.json
197
+ ```
198
+
199
+ Nếu thiếu structured receipt ở workflow strict, `ocskill work start` sẽ không được mở gate.
200
+
201
+ ### Gate 2 — Bằng chứng cho từng task
202
+
203
+ Có thể ghi verification receipt trực tiếp từ command:
204
+
205
+ ```cmd
206
+ ocskill work verify-command <slug> <task-id> . --run-id <run-id> -- npm test
207
+ ```
208
+
209
+ Receipt gắn kết kết quả command với đúng task run. Với long/high-risk work, receipt PASS còn phải khớp workspace fingerprint hiện tại; nếu code thay đổi sau khi test thì phải verify lại.
210
+
211
+ ### Gate 3 — Kiểm tra tích hợp
212
+
213
+ Sau khi toàn bộ task hoàn tất, tạo integration receipt gắn với workspace hiện tại rồi ghi PASS:
214
+
215
+ ```cmd
216
+ ocskill work gate-receipt <slug> integration . --verifier ues-integration-verifier --verdict PASS --evidence "integration PASS" --out .ues-work/<slug>/reports/integration-receipt.json
217
+ ocskill work verify-integration <slug> . --verdict PASS --evidence "integration PASS" --receipt-file .ues-work/<slug>/reports/integration-receipt.json
218
+ ```
219
+
220
+ Sau đó:
221
+
222
+ ```cmd
223
+ ocskill work finalize <slug> . --evidence "final acceptance verified"
224
+ ```
225
+
226
+ `finalize` sẽ bị từ chối nếu còn task chưa hoàn tất, còn blocker, chưa có integration PASS hoặc workspace đã thay đổi sau lần kiểm tra tích hợp.
227
+
228
+ ---
229
+
230
+ ## Fresh-context executor trên OpenCode V2
231
+
232
+ OpenCode V2 plugin cung cấp tool:
233
+
234
+ ```text
235
+ ues.dispatch_task
236
+ ```
237
+
238
+ Luồng thực thi:
239
+
240
+ ```text
241
+ work start
242
+ ↓
243
+ đọc bounded context pack
244
+ ↓
245
+ chọn model tier theo task + attempt
246
+ ↓
247
+ tạo OpenCode session mới
248
+ ↓
249
+ switchAgent(ues-executor)
250
+ ↓
251
+ switchModel(...) nếu đã cấu hình
252
+ ↓
253
+ gửi đúng một task
254
+ ↓
255
+ heartbeat + bounded wait
256
+ ↓
257
+ interrupt nếu timeout/cancel
258
+ ↓
259
+ isolate writer khi cần
260
+ ↓
261
+ trả child-session report
262
+ ```
263
+
264
+ Parent session vẫn chịu trách nhiệm kiểm tra diff, evidence và quyết định gọi `work complete` hoặc `work fail`.
265
+
266
+ Child session không được tự động merge, push, publish hoặc deploy.
267
+
268
+ ---
269
+
270
+ ## Subagents
271
+
272
+ | Subagent | Vai trò |
273
+ |---|---|
274
+ | `ues-codebase-mapper` | Lập bản đồ repository, entry point, boundary, hotspot, contract và test surface |
275
+ | `ues-architect` | Phân tích kiến trúc và phạm vi ảnh hưởng |
276
+ | `ues-plan-checker` | Kiểm tra SPEC/PLAN trước khi cho phép thực thi |
277
+ | `ues-executor` | Thực hiện một task đã được phê duyệt trong context mới |
278
+ | `ues-debugger` | Điều tra nguyên nhân gốc của lỗi |
279
+ | `ues-researcher` | Kiểm tra tài liệu, API và phiên bản hiện hành |
280
+ | `ues-reviewer` | Review correctness, regression, security và compatibility |
281
+ | `ues-critic` | Tìm giả định sai, counterexample và điểm yếu trong phương án |
282
+ | `ues-verifier` | Xác minh độc lập theo acceptance criteria |
283
+ | `ues-integration-verifier` | Kiểm tra tích hợp giữa nhiều task và luồng end-to-end |
284
+
285
+ `ues-executor` là subagent chính có quyền sửa code theo scope được giao. Các agent còn lại chủ yếu phục vụ phân tích, review và xác minh.
286
+
287
+ ---
288
+
289
+ ## Slash commands
290
+
291
+ | Lệnh | Công dụng |
292
+ |---|---|
293
+ | `/ues-feature` | Triển khai feature theo workflow UES |
294
+ | `/ues-fix` | Điều tra nguyên nhân rồi sửa bug |
295
+ | `/ues-plan` | Lập kế hoạch triển khai có thể thực thi |
296
+ | `/ues-debug` | Điều tra lỗi build, runtime hoặc test |
297
+ | `/ues-research` | Kiểm tra docs, API, package hoặc version |
298
+ | `/ues-review` | Review code hoặc diff |
299
+ | `/ues-verify` | Xác minh bằng evidence mới |
300
+ | `/ues-critique` | Tìm assumption sai và counterexample |
301
+ | `/ues-audit` | Audit repository hoặc một khu vực |
302
+ | `/ues-run` | Chạy workflow long-horizon với durable state |
303
+ | `/ues-resume` | Tiếp tục work item từ `.ues-work` |
304
+
305
+ ---
306
+
307
+ ## Task policy và model policy
308
+
309
+ Phân loại yêu cầu kỹ thuật:
310
+
311
+ ```cmd
312
+ ocskill task-policy "your engineering request"
313
+ ```
314
+
315
+ Kiểm tra model policy:
316
+
317
+ ```cmd
318
+ ocskill model-policy executor --attempt 1 --text "your engineering request"
319
+ ```
320
+
321
+ UES dùng ba model tier:
322
+
323
+ ```text
324
+ light
325
+ standard
326
+ heavy
327
+ ```
328
+
329
+ Xem cấu hình:
330
+
331
+ ```cmd
332
+ ocskill models status
333
+ ```
334
+
335
+ Bật model policy:
336
+
337
+ ```cmd
338
+ ocskill models on
339
+ ```
340
+
341
+ Gán model cho từng tier:
342
+
343
+ ```cmd
344
+ ocskill models set light provider/cheap
345
+ ocskill models set standard provider/mid
346
+ ocskill models set heavy provider/strong
347
+ ```
348
+
349
+ Gán tier theo role:
350
+
351
+ ```cmd
352
+ ocskill models role executor standard
353
+ ocskill models role plan-checker heavy
354
+ ```
355
+
356
+ Model ID do người dùng cấu hình vẫn là nguồn quyết định cuối cùng; UES không tự đoán provider/model ID.
357
+
358
+ ---
359
+
360
+ ## Công cụ CLI
361
+
362
+ | Lệnh | Công dụng |
363
+ |---|---|
364
+ | `ocskill inspect [dir]` | Phát hiện stack, package manager, root và test command |
365
+ | `ocskill repo-graph [dir]` | Lập import graph có giới hạn và tìm hotspot |
366
+ | `ocskill impact <query> [dir]` | Tìm phạm vi ảnh hưởng theo symbol hoặc từ khóa |
367
+ | `ocskill evidence [dir]` | Thu thập snapshot về repository, verification và Git |
368
+ | `ocskill working-tree [dir]` | Kiểm tra branch, HEAD và working tree |
369
+ | `ocskill review-scope [base] [dir]` | Phân tích changed-file coverage và risk hint |
370
+ | `ocskill verification-plan [dir]` | Đề xuất verification phù hợp với project |
371
+ | `ocskill task-graph <PLAN.json>` | Kiểm tra DAG và tính safe waves |
372
+ | `ocskill context-pack <slug> <task> [dir]` | Tạo bounded handoff cho executor |
373
+ | `ocskill work ...` | Điều khiển durable long-task state machine |
374
+
375
+ Ví dụ:
376
+
377
+ ```cmd
378
+ ocskill repo-graph .
379
+ ocskill review-scope main .
380
+ ocskill verification-plan .
381
+ ocskill task-graph .ues-work/checkout/PLAN.json
382
+ ocskill work status checkout .
383
+ ```
384
+
385
+ ---
386
+
387
+ ## Skills
388
+
389
+ UES hiện có **39 skills**. Router chỉ chọn các skill phù hợp thay vì nạp toàn bộ catalog vào mỗi task.
390
+
391
+ Một số process skill quan trọng:
392
+
393
+ - `ues-engineering-orchestrator`
394
+ - `ues-repo-explorer`
395
+ - `ues-context-engineering`
396
+ - `ues-task-planner`
397
+ - `ues-change-impact-analysis`
398
+ - `ues-bug-diagnosis`
399
+ - `ues-test-driven-development`
400
+ - `ues-test-verification`
401
+ - `ues-code-review`
402
+ - `ues-research-verification`
403
+ - `ues-long-task-state`
404
+ - `ues-git-safety`
405
+
406
+ Nhóm domain/framework hiện bao gồm React, Next.js, React Native, Node.js, NestJS, Python, Django, FastAPI, .NET, Java/Spring, Flutter, database, REST/API contract, authentication/security, payment, ecommerce, file upload, DevOps, UI/UX, accessibility và performance.
407
+
408
+ ---
409
+
410
+ ## Tương thích OpenCode
411
+
412
+ ### OpenCode 1.x
413
+
414
+ - cài skill, command và subagent;
415
+ - dùng frontmatter tương thích V1;
416
+ - không cài V2 runtime plugin;
417
+ - durable long-task CLI vẫn dùng được;
418
+ - không có V2 `ues.dispatch_task`.
419
+
420
+ ### OpenCode 2.x
421
+
422
+ Ngoài resource file, UES cài managed plugin tại:
423
+
424
+ ```text
425
+ ~/.config/opencode/plugins/ues-router/
426
+ ```
427
+
428
+ Plugin cung cấp:
429
+
430
+ - automatic skill routing;
431
+ - context guardrail;
432
+ - permission safety gate;
433
+ - read-only long-task helpers;
434
+ - fresh-session executor runtime qua `ues.dispatch_task`.
435
+
436
+ Điều khiển router:
437
+
438
+ ```cmd
439
+ ocskill router status
440
+ ocskill router on --max 4
441
+ ocskill router off
442
+ ```
443
+
444
+ ---
445
+
446
+ ## Safety
447
+
448
+ OpenCode V2 permission gate yêu cầu xác nhận rõ ràng trước các thao tác có tác động lớn, ví dụ:
449
+
450
+ - `git push --force` hoặc `git push -f`;
451
+ - `git reset --hard`;
452
+ - destructive `git clean`;
453
+ - `npm publish`;
454
+ - recursive forced deletion;
455
+ - `DROP` hoặc `TRUNCATE`;
456
+ - Terraform, Kubernetes hoặc Helm action có tác động lớn.
457
+
458
+ Safety hook là lớp bảo vệ deterministic bổ sung, không thay thế review của người dùng.
459
+
460
+ ---
461
+
462
+ ## Learning loop
463
+
464
+ Phân tích eval trace:
465
+
466
+ ```cmd
467
+ ocskill learn analyze . --eval-dir .ues-evals
468
+ ```
469
+
470
+ Xem trạng thái:
471
+
472
+ ```cmd
473
+ ocskill learn status .
474
+ ```
475
+
476
+ Chấp nhận một proposal trước khi thử nghiệm:
477
+
478
+ ```cmd
479
+ ocskill learn accept <proposal-id> .
480
+ ```
481
+
482
+ Sau khi shadow benchmark chứng minh candidate tốt hơn baseline:
483
+
484
+ ```cmd
485
+ ocskill learn promote <proposal-id> . --baseline 0.50 --candidate 0.75 --samples 4
486
+ ```
487
+
488
+ Proposal có `shadowRequired` chỉ được đưa trở lại context sau khi vừa được chấp nhận rõ ràng vừa có benchmark improvement đo được.
489
+
490
+ ---
491
+
492
+ ## Hermes adapter
493
+
494
+ UES hỗ trợ Hermes theo dạng adapter tùy chọn, không nhúng Hermes runtime vào core:
495
+
496
+ ```cmd
497
+ ocskill hermes status
498
+ ocskill hermes prompt <slug> <task> .
499
+ ocskill hermes exec <slug> <task> .
500
+ ```
501
+
502
+ Nếu máy không có Hermes CLI, các tính năng Hermes chỉ báo unavailable và không ảnh hưởng đến core UES.
503
+
504
+ ---
505
+
506
+ ## UES Control Center
507
+
508
+ Tạo dashboard tĩnh:
509
+
510
+ ```cmd
511
+ ocskill dashboard .
512
+ ```
513
+
514
+ Chạy dashboard có tự refresh:
515
+
516
+ ```cmd
517
+ ocskill dashboard . --serve --port 4177
518
+ ```
519
+
520
+ Control Center hiển thị work state, verification receipts, runtime events, learning proposals và eval summary; server mode có safe stale-recovery action.
521
+
522
+ ---
523
+
524
+ ## Sandbox cho tác vụ ghi song song
525
+
526
+ Tạo isolated Git worktree:
527
+
528
+ ```cmd
529
+ ocskill sandbox create <slug> <task-id> .
530
+ ```
531
+
532
+ Tích hợp sandbox sau khi đã inspect/verify:
533
+
534
+ ```cmd
535
+ ocskill sandbox integrate <worktree-path> .
536
+ ```
537
+
538
+ Liệt kê sandbox:
539
+
540
+ ```cmd
541
+ ocskill sandbox list .
542
+ ```
543
+
544
+ Integration sẽ từ chối ghi đè lên file đang dirty ở root. Safe-wave scheduling chỉ bảo vệ declared file scope. Generated file, lockfile hoặc shared write surface ngầm định vẫn nên được serialize khi cần.
545
+
546
+ ---
547
+
548
+ ## Evaluation
549
+
550
+ UES 9.0.0 hiện có:
551
+
552
+ - **34 static skill-routing scenarios** phủ 39 skills;
553
+ - **120 V2 router cases** với required routes và negative guards;
554
+ - **20 standard live tasks**;
555
+ - **5 long-horizon tasks**;
556
+ - **8 polyglot tasks** cho Python, Java, .NET, Next.js, React Native, SQL migration, monorepo và generated contract;
557
+ - benchmark matrix baseline-vs-UES nhiều trial;
558
+ - một long task tích hợp tới **15 source modules**.
559
+
560
+ Kiểm tra static routing:
561
+
562
+ ```cmd
563
+ npm run evals
564
+ ```
565
+
566
+ Kiểm tra V2 router:
567
+
568
+ ```cmd
569
+ npm run evals:router
570
+ ```
571
+
572
+ Kiểm tra standard hidden graders:
573
+
574
+ ```cmd
575
+ npm run evals:live:validate
576
+ ```
577
+
578
+ Kiểm tra long-horizon và polyglot suite:
579
+
580
+ ```cmd
581
+ npm run evals:long:validate
582
+ npm run evals:polyglot:validate
583
+ ```
584
+
585
+ Chạy benchmark với model thật:
586
+
587
+ ```cmd
588
+ ocskill eval-live --model provider/model --trials 3
589
+ ocskill eval-live --suite long --model provider/model --trials 3
590
+ npm run evals:matrix -- --model provider/model --trials 3
591
+ ```
592
+
593
+ Live eval hỗ trợ heartbeat, hard timeout, idle timeout và Ctrl+C process-tree cancellation.
594
+
595
+ Với long suite, một run UES chỉ được tính PASS khi hidden grader PASS, durable work state tồn tại, plan approval hợp lệ, toàn bộ task hoàn tất, integration verification PASS và finalization hoàn tất.
596
+
597
+ ---
598
+
599
+ ## Phát triển và CI
600
+
601
+ Yêu cầu:
602
+
603
+ - Node.js 20+;
604
+ - npm;
605
+ - Git.
606
+
607
+ Cài dependency mà không chạy lifecycle script:
608
+
609
+ ```cmd
610
+ npm ci --ignore-scripts
611
+ ```
612
+
613
+ Chạy toàn bộ CI:
614
+
615
+ ```cmd
616
+ npm run ci
617
+ ```
618
+
619
+ Pipeline hiện kiểm tra:
620
+
621
+ ```text
622
+ syntax
623
+ → resource validation
624
+ → static skill routing
625
+ → V2 router matrix
626
+ → standard hidden-grader integrity
627
+ → long hidden-grader integrity
628
+ → polyglot hidden-grader integrity
629
+ → Node tests
630
+ → npm pack --dry-run
631
+ → packed global-install smoke
632
+ → plain one-command install compatibility smoke
633
+ ```
634
+
635
+ Packed smoke xác minh package cài được từ tarball và kiểm tra OpenCode V2 path, skills, commands, subagents, router plugin, task graph, durable state và model config.
636
+
637
+ ---
638
+
639
+ ## Cập nhật và gỡ cài đặt
640
+
641
+ Cập nhật lên bản npm mới nhất:
642
+
643
+ ```cmd
644
+ ocskill update
645
+ ```
646
+
647
+ Gỡ UES:
648
+
649
+ ```cmd
650
+ ocskill remove
651
+ ```
652
+
653
+ UES chỉ quản lý resource có namespace/marker của chính nó và cố gắng giữ nguyên resource không thuộc quyền quản lý của UES.
654
+
655
+ ---
656
+
657
+ ## Tài liệu
658
+
659
+ - [Thiết kế hệ thống](docs/ENGINEERING-DESIGN.md)
660
+ - [Tương thích OpenCode](docs/OPENCODE-COMPAT.md)
661
+ - [Công cụ deterministic](docs/DETERMINISTIC-TOOLS.md)
662
+ - [Evaluation](docs/EVALS.md)
663
+ - [Trace schema](docs/TRACE-SCHEMA.md)
664
+ - [Hướng dẫn publish npm](docs/NPM-PUBLISH.md)
665
+ - [Nguồn nghiên cứu](docs/RESEARCH-SOURCES.md)
666
+ - [V7 Intelligence Runtime](docs/V7-INTELLIGENCE-RUNTIME.md)
667
+ - [V8 Intelligence & Reliability](docs/V8-INTELLIGENCE-RELIABILITY.md)
668
+ - [V9 Speed & Intelligence](docs/V9-SPEED-INTELLIGENCE.md)
669
+
670
+ ---
671
+
672
+ ## npm
673
+
674
+ Package:
675
+
676
+ ```text
677
+ opencode-agent-skill
678
+ ```
679
+
680
+ Cài đặt:
681
+
682
+ ```cmd
683
+ npm install -g opencode-agent-skill
684
+ ```
685
+
686
+ Phiên bản hiện tại:
687
+
688
+ ```text
689
+ 9.0.0
690
+ ```
691
+
692
+ ---
693
+
694
+ ## License
695
+
696
+ MIT