opencode-agent-skill 7.7.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/CHANGELOG.md +163 -0
- package/LICENSE +9 -0
- package/README.md +581 -0
- package/bin/ocskill.mjs +975 -0
- package/docs/DETERMINISTIC-TOOLS.md +88 -0
- package/docs/ENGINEERING-DESIGN.md +176 -0
- package/docs/EVALS.md +136 -0
- package/docs/NPM-PUBLISH.md +102 -0
- package/docs/OPENCODE-COMPAT.md +109 -0
- package/docs/RESEARCH-SOURCES.md +37 -0
- package/docs/TRACE-SCHEMA.md +109 -0
- package/docs/V7-INTELLIGENCE-RUNTIME.md +166 -0
- package/evals/live/fixtures/engineering-bench/package.json +1 -0
- package/evals/live/fixtures/engineering-bench/src/api-errors.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/authz.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/cache-tags.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/config.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/contract-consumer.mjs +6 -0
- package/evals/live/fixtures/engineering-bench/src/contract-producer.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/dedupe.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/dependency.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/discount.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/inventory.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/migration.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/money.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/pagination.mjs +5 -0
- package/evals/live/fixtures/engineering-bench/src/path-safe.mjs +5 -0
- package/evals/live/fixtures/engineering-bench/src/payment.mjs +5 -0
- package/evals/live/fixtures/engineering-bench/src/query-sort.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/react-state.mjs +8 -0
- package/evals/live/fixtures/engineering-bench/src/retry.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/rn-platform.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/upload.mjs +3 -0
- package/evals/live/fixtures/engineering-bench/src/webhook.mjs +3 -0
- package/evals/live/graders/engineering-bench.mjs +239 -0
- package/evals/live/tasks.json +126 -0
- package/evals/long/fixtures/long-horizon/package.json +1 -0
- package/evals/long/fixtures/long-horizon/src/auth.mjs +5 -0
- package/evals/long/fixtures/long-horizon/src/checkout.mjs +9 -0
- package/evals/long/fixtures/long-horizon/src/inventory.mjs +5 -0
- package/evals/long/fixtures/long-horizon/src/money.mjs +3 -0
- package/evals/long/fixtures/long-horizon/src/payment.mjs +7 -0
- package/evals/long/fixtures/long-horizon/src/product-api.mjs +10 -0
- package/evals/long/fixtures/long-horizon/src/product-cache.mjs +3 -0
- package/evals/long/fixtures/long-horizon/src/product-service.mjs +6 -0
- package/evals/long/fixtures/long-horizon/src/product-state.mjs +8 -0
- package/evals/long/fixtures/long-horizon/src/project-api.mjs +9 -0
- package/evals/long/fixtures/long-horizon/src/project-service.mjs +7 -0
- package/evals/long/fixtures/long-horizon/src/user-consumer.mjs +3 -0
- package/evals/long/fixtures/long-horizon/src/user-migration.mjs +7 -0
- package/evals/long/fixtures/long-horizon/src/user-serializer.mjs +3 -0
- package/evals/long/fixtures/long-horizon/src/user-validation.mjs +3 -0
- package/evals/long/graders/long-horizon.mjs +209 -0
- package/evals/long/tasks.json +36 -0
- package/evals/router-triggers.json +1238 -0
- package/evals/routing.json +321 -0
- package/global-config/AGENTS.md +212 -0
- package/global-config/agents/architect.md +38 -0
- package/global-config/agents/codebase-mapper.md +41 -0
- package/global-config/agents/critic.md +37 -0
- package/global-config/agents/debugger.md +36 -0
- package/global-config/agents/executor.md +48 -0
- package/global-config/agents/integration-verifier.md +43 -0
- package/global-config/agents/plan-checker.md +43 -0
- package/global-config/agents/researcher.md +30 -0
- package/global-config/agents/reviewer.md +30 -0
- package/global-config/agents/verifier.md +33 -0
- package/global-config/commands/audit.md +8 -0
- package/global-config/commands/critique.md +8 -0
- package/global-config/commands/debug.md +8 -0
- package/global-config/commands/feature.md +8 -0
- package/global-config/commands/fix.md +8 -0
- package/global-config/commands/plan.md +8 -0
- package/global-config/commands/research.md +8 -0
- package/global-config/commands/resume.md +22 -0
- package/global-config/commands/review.md +8 -0
- package/global-config/commands/run.md +29 -0
- package/global-config/commands/verify.md +8 -0
- package/global-config/plugins/ues-router/capabilities.js +20 -0
- package/global-config/plugins/ues-router/index.js +277 -0
- package/global-config/plugins/ues-router/router.js +74 -0
- package/global-config/plugins/ues-router/safety.js +16 -0
- package/global-config/skills/accessibility/SKILL.md +10 -0
- package/global-config/skills/accessibility/references/workflow.md +17 -0
- package/global-config/skills/api-contract/SKILL.md +12 -0
- package/global-config/skills/api-contract/references/workflow.md +17 -0
- package/global-config/skills/auth-security/SKILL.md +12 -0
- package/global-config/skills/auth-security/references/workflow.md +15 -0
- package/global-config/skills/bug-diagnosis/SKILL.md +28 -0
- package/global-config/skills/change-impact-analysis/SKILL.md +23 -0
- package/global-config/skills/code-review/SKILL.md +19 -0
- package/global-config/skills/context-engineering/SKILL.md +18 -0
- package/global-config/skills/context-engineering/references/large-repo.md +16 -0
- package/global-config/skills/database-engineering/SKILL.md +12 -0
- package/global-config/skills/database-engineering/references/workflow.md +15 -0
- package/global-config/skills/dependency-management/SKILL.md +12 -0
- package/global-config/skills/dependency-management/references/workflow.md +14 -0
- package/global-config/skills/devops-engineering/SKILL.md +10 -0
- package/global-config/skills/devops-engineering/references/workflow.md +11 -0
- package/global-config/skills/django-engineering/SKILL.md +10 -0
- package/global-config/skills/django-engineering/references/workflow.md +11 -0
- package/global-config/skills/documentation-engineering/SKILL.md +10 -0
- package/global-config/skills/documentation-engineering/references/workflow.md +15 -0
- package/global-config/skills/dotnet-engineering/SKILL.md +10 -0
- package/global-config/skills/dotnet-engineering/references/workflow.md +11 -0
- package/global-config/skills/ecommerce-engineering/SKILL.md +10 -0
- package/global-config/skills/ecommerce-engineering/references/workflow.md +17 -0
- package/global-config/skills/engineering-orchestrator/SKILL.md +29 -0
- package/global-config/skills/engineering-orchestrator/references/delegation.md +22 -0
- package/global-config/skills/engineering-orchestrator/references/evaluator-loop.md +18 -0
- package/global-config/skills/engineering-orchestrator/references/long-horizon.md +57 -0
- package/global-config/skills/engineering-orchestrator/references/model-escalation.md +19 -0
- package/global-config/skills/engineering-orchestrator/references/retry-policy.md +12 -0
- package/global-config/skills/engineering-orchestrator/references/routing.md +39 -0
- package/global-config/skills/engineering-orchestrator/references/verification-matrix.md +18 -0
- package/global-config/skills/fastapi-engineering/SKILL.md +10 -0
- package/global-config/skills/fastapi-engineering/references/workflow.md +13 -0
- package/global-config/skills/file-upload-engineering/SKILL.md +10 -0
- package/global-config/skills/file-upload-engineering/references/workflow.md +17 -0
- package/global-config/skills/flutter-engineering/SKILL.md +10 -0
- package/global-config/skills/flutter-engineering/references/workflow.md +13 -0
- package/global-config/skills/git-safety/SKILL.md +10 -0
- package/global-config/skills/git-safety/references/workflow.md +15 -0
- package/global-config/skills/implementation-engineer/SKILL.md +10 -0
- package/global-config/skills/implementation-engineer/references/workflow.md +14 -0
- package/global-config/skills/java-spring-engineering/SKILL.md +10 -0
- package/global-config/skills/java-spring-engineering/references/workflow.md +13 -0
- package/global-config/skills/long-task-state/SKILL.md +28 -0
- package/global-config/skills/long-task-state/references/context-ledger.md +27 -0
- package/global-config/skills/long-task-state/templates/STATE.md +48 -0
- package/global-config/skills/nestjs-engineering/SKILL.md +10 -0
- package/global-config/skills/nestjs-engineering/references/workflow.md +11 -0
- package/global-config/skills/nextjs-engineering/SKILL.md +12 -0
- package/global-config/skills/nextjs-engineering/references/workflow.md +15 -0
- package/global-config/skills/nodejs-engineering/SKILL.md +12 -0
- package/global-config/skills/nodejs-engineering/references/workflow.md +11 -0
- package/global-config/skills/payment-engineering/SKILL.md +12 -0
- package/global-config/skills/payment-engineering/references/workflow.md +19 -0
- package/global-config/skills/performance-engineering/SKILL.md +10 -0
- package/global-config/skills/performance-engineering/references/workflow.md +17 -0
- package/global-config/skills/python-engineering/SKILL.md +10 -0
- package/global-config/skills/python-engineering/references/workflow.md +11 -0
- package/global-config/skills/react-engineering/SKILL.md +14 -0
- package/global-config/skills/react-engineering/references/workflow.md +16 -0
- package/global-config/skills/react-native-engineering/SKILL.md +14 -0
- package/global-config/skills/react-native-engineering/references/workflow.md +16 -0
- package/global-config/skills/repo-explorer/SKILL.md +17 -0
- package/global-config/skills/research-verification/SKILL.md +18 -0
- package/global-config/skills/research-verification/references/source-hierarchy.md +12 -0
- package/global-config/skills/rest-api-design/SKILL.md +10 -0
- package/global-config/skills/rest-api-design/references/workflow.md +18 -0
- package/global-config/skills/software-architect/SKILL.md +10 -0
- package/global-config/skills/software-architect/references/workflow.md +18 -0
- package/global-config/skills/task-planner/SKILL.md +21 -0
- package/global-config/skills/task-planner/references/plan-schema.md +56 -0
- package/global-config/skills/test-driven-development/SKILL.md +22 -0
- package/global-config/skills/test-driven-development/references/writing-good-tests.md +21 -0
- package/global-config/skills/test-verification/SKILL.md +20 -0
- package/global-config/skills/ui-ux-engineering/SKILL.md +10 -0
- package/global-config/skills/ui-ux-engineering/references/workflow.md +17 -0
- package/global-config/skills/web-security-review/SKILL.md +10 -0
- package/global-config/skills/web-security-review/references/workflow.md +22 -0
- package/lib/context-manifest.mjs +101 -0
- package/lib/control-center.mjs +148 -0
- package/lib/eval-auth.mjs +21 -0
- package/lib/eval-report.mjs +72 -0
- package/lib/eval-telemetry.mjs +155 -0
- package/lib/evidence-receipt.mjs +50 -0
- package/lib/hermes-bridge.mjs +28 -0
- package/lib/ids.mjs +21 -0
- package/lib/installer.mjs +636 -0
- package/lib/learning-engine.mjs +161 -0
- package/lib/model-config.mjs +88 -0
- package/lib/model-policy.mjs +71 -0
- package/lib/opencode-compat.mjs +86 -0
- package/lib/orchestrator-policy.mjs +35 -0
- package/lib/process-runner.mjs +117 -0
- package/lib/repo-graph.mjs +135 -0
- package/lib/repo-inspect.mjs +264 -0
- package/lib/review-scope.mjs +98 -0
- package/lib/router-config.mjs +40 -0
- package/lib/task-engine.mjs +777 -0
- package/lib/task-graph.mjs +262 -0
- package/lib/update-resolver.mjs +43 -0
- package/lib/verification-plan.mjs +52 -0
- package/lib/version.mjs +47 -0
- package/lib/workspace-snapshot.mjs +45 -0
- package/lib/worktree-sandbox.mjs +59 -0
- package/package.json +69 -0
- package/scripts/check-working-tree.mjs +2 -0
- package/scripts/collect-evidence.mjs +2 -0
- package/scripts/control-center.mjs +37 -0
- package/scripts/detect-stack.mjs +2 -0
- package/scripts/detect-test-commands.mjs +2 -0
- package/scripts/eval-live.mjs +437 -0
- package/scripts/eval-report.mjs +49 -0
- package/scripts/eval-router.mjs +45 -0
- package/scripts/eval-skills.mjs +71 -0
- package/scripts/impact-map.mjs +4 -0
- package/scripts/install.mjs +61 -0
- package/scripts/repo-map.mjs +2 -0
- package/scripts/smoke-packed-install.mjs +326 -0
- package/scripts/syntax-check.mjs +35 -0
- package/scripts/uninstall.mjs +21 -0
- package/scripts/validate-live-suite.mjs +65 -0
- package/scripts/validate.mjs +133 -0
package/README.md
ADDED
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
# OpenCode Universal Engineering System (UES)
|
|
2
|
+
|
|
3
|
+
**UES 7.7.0** là engineering harness cho OpenCode, tập trung vào việc giúp model hiện có xử lý repository lớn và task dài theo quy trình có trạng thái bền vững, fresh-context execution, deterministic evidence và verification gate.
|
|
4
|
+
|
|
5
|
+
UES không tuyên bố biến một model yếu thành model mạnh hơn về bản chất. Mục tiêu là giảm lượng reasoning mà model phải tự giữ trong một context: chia task rõ, lưu state ra filesystem, dùng code cho các việc có thể xác định được, chạy subagent với context mới, và chỉ cho phép hoàn tất khi có evidence.
|
|
6
|
+
|
|
7
|
+
## UES 7.7.0 có gì?
|
|
8
|
+
|
|
9
|
+
Ngoài nền V6 (durable PLAN/STATE/EVIDENCE, fresh executors, plan/integration gates), V7.7 thêm:
|
|
10
|
+
|
|
11
|
+
- crash-safe task lease với `runId`, heartbeat, stale-task recovery
|
|
12
|
+
- live benchmark heartbeat + hard/idle timeout + Ctrl+C process-tree cancellation
|
|
13
|
+
- structured verification receipts gắn command/exit code/output hash/workspace fingerprint vào task run
|
|
14
|
+
- context manifest tự chọn declared files, import neighbors, likely tests, manifests và accepted lessons
|
|
15
|
+
- adaptive task policy: inline/standard/long-horizon + risk/model/context/retry guidance
|
|
16
|
+
- read/write-aware safe waves và isolated Git worktree sandbox primitives cho parallel writers
|
|
17
|
+
- evidence-gated learning loop từ `.ues-evals` → proposal → explicit accept → future context retrieval
|
|
18
|
+
- optional Hermes bridge theo kiểu adapter, không nhúng Hermes runtime vào core
|
|
19
|
+
- zero-dependency local **UES Control Center** cho work state, evidence, learning và eval summaries; chế độ `--serve` tự refresh dữ liệu
|
|
20
|
+
|
|
21
|
+
Xem chi tiết: [V7 Intelligence Runtime](docs/V7-INTELLIGENCE-RUNTIME.md)
|
|
22
|
+
|
|
23
|
+
### Lệnh V7 nhanh
|
|
24
|
+
|
|
25
|
+
```cmd
|
|
26
|
+
ocskill task-policy "refactor auth across the whole repository"
|
|
27
|
+
ocskill work recover <slug> .
|
|
28
|
+
ocskill work verify-command <slug> <task> . -- npm test
|
|
29
|
+
ocskill sandbox create <slug> <task> .
|
|
30
|
+
ocskill learn analyze . --eval-dir .ues-evals
|
|
31
|
+
ocskill hermes status
|
|
32
|
+
ocskill dashboard . --serve
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
- **39 engineering skills**
|
|
38
|
+
- **11 slash commands**
|
|
39
|
+
- **10 subagents**
|
|
40
|
+
- durable long-task engine dưới `.ues-work/<slug>/`
|
|
41
|
+
- machine-checkable `PLAN.json` + dependency DAG + safe execution waves
|
|
42
|
+
- hard plan approval gate và integration verification gate
|
|
43
|
+
- atomic/locked `STATE.json` + `EVIDENCE.json` để tránh mất state khi task độc lập hoàn tất đồng thời
|
|
44
|
+
- OpenCode V2 runtime plugin với automatic skill routing, safety permission gate và fresh-session task dispatch
|
|
45
|
+
- configurable `light / standard / heavy` model tiers với attempt-based escalation
|
|
46
|
+
- deterministic repository tools: repo graph, impact, review scope, verification plan, task graph, context pack
|
|
47
|
+
- **34 static skill-routing scenarios** phủ đủ 39 skill
|
|
48
|
+
- **120 V2 router trigger cases** có positive/negative guards
|
|
49
|
+
- **20 standard live hidden-graded tasks**
|
|
50
|
+
- **5 long-horizon tasks**, gồm một bài tích hợp **15 source files**
|
|
51
|
+
- hỗ trợ **OpenCode 1.x và 2.x**
|
|
52
|
+
|
|
53
|
+
Luồng long-horizon chính:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
request
|
|
57
|
+
↓
|
|
58
|
+
repo evidence / codebase map
|
|
59
|
+
↓
|
|
60
|
+
SPEC.md
|
|
61
|
+
↓
|
|
62
|
+
PLAN.json
|
|
63
|
+
↓
|
|
64
|
+
ues-plan-checker
|
|
65
|
+
↓
|
|
66
|
+
machine approval gate
|
|
67
|
+
↓
|
|
68
|
+
dependency-safe tasks
|
|
69
|
+
↓
|
|
70
|
+
fresh ues-executor session / task
|
|
71
|
+
↓
|
|
72
|
+
task evidence + durable state
|
|
73
|
+
↓
|
|
74
|
+
ues-integration-verifier
|
|
75
|
+
↓
|
|
76
|
+
machine integration PASS gate
|
|
77
|
+
↓
|
|
78
|
+
workspace fingerprint unchanged
|
|
79
|
+
↓
|
|
80
|
+
finalize
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Cài đặt
|
|
86
|
+
|
|
87
|
+
```cmd
|
|
88
|
+
npm install -g opencode-agent-skill
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Kiểm tra:
|
|
92
|
+
|
|
93
|
+
```cmd
|
|
94
|
+
ocskill status
|
|
95
|
+
ocskill doctor
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Nếu npm không chạy lifecycle script:
|
|
99
|
+
|
|
100
|
+
```cmd
|
|
101
|
+
ocskill install
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Khi đồng bộ V7.7 đầy đủ, status sẽ phản ánh khoảng:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
Package version: 7.7.0
|
|
108
|
+
Resource version: 7.7.0
|
|
109
|
+
Skills: 39/39
|
|
110
|
+
Commands: 11/11
|
|
111
|
+
Subagents: 10/10
|
|
112
|
+
Workflow: OK
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Sau khi cài/cập nhật, nên mở OpenCode session mới để resource mới được nạp.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
# 1. Subagents
|
|
120
|
+
|
|
121
|
+
| Subagent | Vai trò |
|
|
122
|
+
|---|---|
|
|
123
|
+
| `ues-codebase-mapper` | Map repository, entry point, boundary, hotspot, contract và test surface |
|
|
124
|
+
| `ues-architect` | Architecture/change-impact analysis |
|
|
125
|
+
| `ues-plan-checker` | Fresh-context gate kiểm tra SPEC/PLAN trước khi code |
|
|
126
|
+
| `ues-executor` | Fresh-context implementation cho đúng một approved task |
|
|
127
|
+
| `ues-debugger` | Root-cause debugging |
|
|
128
|
+
| `ues-researcher` | Kiểm tra docs/API/version hiện hành |
|
|
129
|
+
| `ues-reviewer` | Review correctness/regression/security/compatibility |
|
|
130
|
+
| `ues-critic` | Adversarial falsification/counterexample |
|
|
131
|
+
| `ues-verifier` | Verification độc lập theo acceptance criteria |
|
|
132
|
+
| `ues-integration-verifier` | Cross-task/end-to-end integration verification |
|
|
133
|
+
|
|
134
|
+
`ues-executor` là subagent 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/kiểm chứng và không được dùng để âm thầm mở rộng implementation.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
# 2. Slash commands
|
|
139
|
+
|
|
140
|
+
| Lệnh | Công dụng |
|
|
141
|
+
|---|---|
|
|
142
|
+
| `/ues-feature` | Làm feature theo workflow UES |
|
|
143
|
+
| `/ues-fix` | Điều tra root cause rồi sửa bug |
|
|
144
|
+
| `/ues-plan` | Lập implementation-ready plan |
|
|
145
|
+
| `/ues-debug` | Điều tra bug/build/test failure |
|
|
146
|
+
| `/ues-research` | Kiểm tra docs/API/package/version |
|
|
147
|
+
| `/ues-review` | Review diff/code |
|
|
148
|
+
| `/ues-verify` | Verification bằng evidence mới |
|
|
149
|
+
| `/ues-critique` | Tìm assumption sai/counterexample |
|
|
150
|
+
| `/ues-audit` | Audit repository/khu vực |
|
|
151
|
+
| `/ues-run` | Chạy long-horizon workflow với durable state + fresh executors |
|
|
152
|
+
| `/ues-resume` | Resume work item từ `.ues-work` thay vì dựa vào chat history |
|
|
153
|
+
|
|
154
|
+
Với task lớn, ưu tiên:
|
|
155
|
+
|
|
156
|
+
```text
|
|
157
|
+
/ues-run <yêu cầu>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Nếu session bị ngắt/compact:
|
|
161
|
+
|
|
162
|
+
```text
|
|
163
|
+
/ues-resume <slug>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
# 3. Long-horizon engine
|
|
169
|
+
|
|
170
|
+
V7 task records additionally track `runId`, executor owner, heartbeat, lease expiry and evidence strength. `ocskill work resume` can recover stale running tasks, while the V2 dispatcher refreshes leases during fresh-session execution.
|
|
171
|
+
|
|
172
|
+
Structured verification can be recorded with:
|
|
173
|
+
|
|
174
|
+
```cmd
|
|
175
|
+
ocskill work verify-command <slug> <task> . --run-id <run-id> -- npm test
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
Mỗi work item dùng:
|
|
181
|
+
|
|
182
|
+
```text
|
|
183
|
+
.ues-work/<slug>/
|
|
184
|
+
├── SPEC.md
|
|
185
|
+
├── PLAN.json
|
|
186
|
+
├── STATE.json
|
|
187
|
+
├── EVIDENCE.json
|
|
188
|
+
├── tasks/
|
|
189
|
+
└── reports/
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
`.ues-work/` được git-ignore. Đây là execution state, không phải hidden chain-of-thought.
|
|
193
|
+
|
|
194
|
+
## Hard gate 1 — Plan approval
|
|
195
|
+
|
|
196
|
+
`ocskill work plan` không đưa task thẳng sang executable state. Nó để state ở:
|
|
197
|
+
|
|
198
|
+
```text
|
|
199
|
+
awaiting-plan-approval
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Sau khi `ues-plan-checker` trả PASS:
|
|
203
|
+
|
|
204
|
+
```cmd
|
|
205
|
+
ocskill work approve-plan <slug> . --evidence "plan checker PASS: ..."
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Nếu chưa có approval hợp lệ, `ocskill work start` sẽ từ chối.
|
|
209
|
+
|
|
210
|
+
## Hard gate 2 — Concurrent durable state
|
|
211
|
+
|
|
212
|
+
Mọi mutation của `STATE.json` và `EVIDENCE.json` dùng per-work-item lock + atomic replacement. Hai task độc lập có thể hoàn tất gần nhau mà không được phép ghi đè state/evidence của nhau.
|
|
213
|
+
|
|
214
|
+
Safe-wave chỉ bảo vệ declared file overlap. Nếu task có implicit shared write surface như generated files/lockfiles, hãy serialize.
|
|
215
|
+
|
|
216
|
+
## Hard gate 3 — Integration completion
|
|
217
|
+
|
|
218
|
+
Sau khi mọi task hoàn tất:
|
|
219
|
+
|
|
220
|
+
```cmd
|
|
221
|
+
ocskill work verify-integration <slug> . --verdict PASS --evidence "..."
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
PASS lưu workspace fingerprint. `finalize` sẽ bị từ chối nếu:
|
|
225
|
+
|
|
226
|
+
- còn task incomplete
|
|
227
|
+
- còn blocker
|
|
228
|
+
- chưa có integration PASS
|
|
229
|
+
- workspace đã thay đổi sau PASS
|
|
230
|
+
|
|
231
|
+
Sau đó:
|
|
232
|
+
|
|
233
|
+
```cmd
|
|
234
|
+
ocskill work finalize <slug> . --evidence "final acceptance verified"
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
# 4. Fresh-context executor trên OpenCode V2
|
|
240
|
+
|
|
241
|
+
V2 plugin expose tool:
|
|
242
|
+
|
|
243
|
+
```text
|
|
244
|
+
ues.dispatch_task
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Nó thực hiện:
|
|
248
|
+
|
|
249
|
+
```text
|
|
250
|
+
work start
|
|
251
|
+
↓
|
|
252
|
+
read bounded context pack
|
|
253
|
+
↓
|
|
254
|
+
resolve model tier theo attempt
|
|
255
|
+
↓
|
|
256
|
+
create fresh OpenCode session
|
|
257
|
+
↓
|
|
258
|
+
switchAgent(ues-executor)
|
|
259
|
+
↓
|
|
260
|
+
switchModel(...) nếu được cấu hình
|
|
261
|
+
↓
|
|
262
|
+
prompt đúng 1 task
|
|
263
|
+
↓
|
|
264
|
+
wait
|
|
265
|
+
↓
|
|
266
|
+
return child-session report
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Parent vẫn phải inspect diff/evidence và gọi `work complete` hoặc `work fail`. Child session không được tự merge/push/publish/deploy.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
# 5. Adaptive task + model policy
|
|
274
|
+
|
|
275
|
+
V7 adds deterministic task classification:
|
|
276
|
+
|
|
277
|
+
```cmd
|
|
278
|
+
ocskill task-policy "your engineering request"
|
|
279
|
+
ocskill model-policy executor --attempt 1 --text "your engineering request"
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Task risk/complexity can raise the base model tier before attempt-based escalation. User-configured provider/model IDs remain authoritative.
|
|
283
|
+
|
|
284
|
+
## Model tiers
|
|
285
|
+
|
|
286
|
+
Xem cấu hình:
|
|
287
|
+
|
|
288
|
+
```cmd
|
|
289
|
+
ocskill models status
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Bật:
|
|
293
|
+
|
|
294
|
+
```cmd
|
|
295
|
+
ocskill models on
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Gán model:
|
|
299
|
+
|
|
300
|
+
```cmd
|
|
301
|
+
ocskill models set light provider/cheap
|
|
302
|
+
ocskill models set standard provider/mid
|
|
303
|
+
ocskill models set heavy provider/strong
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Gán tier theo role:
|
|
307
|
+
|
|
308
|
+
```cmd
|
|
309
|
+
ocskill models role executor standard
|
|
310
|
+
ocskill models role plan-checker heavy
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Kiểm tra attempt:
|
|
314
|
+
|
|
315
|
+
```cmd
|
|
316
|
+
ocskill model-policy executor --attempt 1
|
|
317
|
+
ocskill model-policy executor --attempt 2
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Mặc định role quan trọng như architect, plan-checker, critic và integration-verifier ưu tiên `heavy`; executor/debugger/reviewer thường bắt đầu ở `standard`. Retry có thể escalate lên tier cao hơn nếu đã cấu hình.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
# 6. Deterministic CLI tools
|
|
325
|
+
|
|
326
|
+
| Lệnh | Công dụng |
|
|
327
|
+
|---|---|
|
|
328
|
+
| `ocskill inspect [dir]` | Stack/package manager/root map/test commands |
|
|
329
|
+
| `ocskill repo-graph [dir]` | Bounded import graph + coupling hotspots |
|
|
330
|
+
| `ocskill impact <query> [dir]` | Bounded symbol/term impact search |
|
|
331
|
+
| `ocskill evidence [dir]` | Repository + verification + Git evidence snapshot |
|
|
332
|
+
| `ocskill working-tree [dir]` | Branch/HEAD/dirty state |
|
|
333
|
+
| `ocskill review-scope [base] [dir]` | Changed-file coverage + deterministic risk hints |
|
|
334
|
+
| `ocskill verification-plan [dir]` | Project-native verification recommendations |
|
|
335
|
+
| `ocskill task-graph <PLAN.json>` | Validate DAG + compute safe waves |
|
|
336
|
+
| `ocskill context-pack <slug> <task> [dir]` | Bounded handoff cho fresh executor |
|
|
337
|
+
| `ocskill work ...` | Durable long-task state machine |
|
|
338
|
+
|
|
339
|
+
Ví dụ:
|
|
340
|
+
|
|
341
|
+
```cmd
|
|
342
|
+
ocskill repo-graph .
|
|
343
|
+
ocskill review-scope main .
|
|
344
|
+
ocskill verification-plan .
|
|
345
|
+
ocskill task-graph .ues-work/checkout/PLAN.json
|
|
346
|
+
ocskill work status checkout .
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
# 7. Skills
|
|
352
|
+
|
|
353
|
+
UES giữ **39 skills**, không tăng catalog chỉ để tăng số lượng. Thông thường router chỉ cần 2–4 skill phù hợp.
|
|
354
|
+
|
|
355
|
+
Các process skill quan trọng:
|
|
356
|
+
|
|
357
|
+
- `ues-engineering-orchestrator`
|
|
358
|
+
- `ues-repo-explorer`
|
|
359
|
+
- `ues-context-engineering`
|
|
360
|
+
- `ues-task-planner`
|
|
361
|
+
- `ues-change-impact-analysis`
|
|
362
|
+
- `ues-bug-diagnosis`
|
|
363
|
+
- `ues-test-driven-development`
|
|
364
|
+
- `ues-test-verification`
|
|
365
|
+
- `ues-code-review`
|
|
366
|
+
- `ues-research-verification`
|
|
367
|
+
- `ues-long-task-state`
|
|
368
|
+
- `ues-git-safety`
|
|
369
|
+
|
|
370
|
+
Domain/framework skills bao gồm React, Next.js, React Native, Node.js, NestJS, Python, Django, FastAPI, .NET, Java/Spring, Flutter, database, REST/API contract, auth/security, payment, ecommerce, file upload, DevOps, UI/UX, accessibility và performance.
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
# 8. OpenCode 1.x và 2.x
|
|
375
|
+
|
|
376
|
+
## OpenCode 1.x
|
|
377
|
+
|
|
378
|
+
- skill/command/subagent file vẫn được cài
|
|
379
|
+
- dùng permission frontmatter tương thích V1
|
|
380
|
+
- không cài V2 runtime plugin
|
|
381
|
+
- long-task CLI/durable state vẫn dùng được
|
|
382
|
+
- fresh child-session dispatch phụ thuộc khả năng subagent của runtime V1; không có V2 `ues.dispatch_task`
|
|
383
|
+
|
|
384
|
+
## OpenCode 2.x
|
|
385
|
+
|
|
386
|
+
Ngoài resource file, UES cài managed plugin:
|
|
387
|
+
|
|
388
|
+
```text
|
|
389
|
+
~/.config/opencode/plugins/ues-router/
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Plugin cung cấp:
|
|
393
|
+
|
|
394
|
+
- prompt-time skill routing
|
|
395
|
+
- context guardrail
|
|
396
|
+
- permission safety gate cho destructive/high-impact shell action
|
|
397
|
+
- read-only long-task helpers
|
|
398
|
+
- `ues.dispatch_task` fresh-session executor runtime
|
|
399
|
+
|
|
400
|
+
Router:
|
|
401
|
+
|
|
402
|
+
```cmd
|
|
403
|
+
ocskill router status
|
|
404
|
+
ocskill router on --max 4
|
|
405
|
+
ocskill router off
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
# 9. Safety
|
|
411
|
+
|
|
412
|
+
V2 permission gate nâng các thao tác nguy hiểm lên explicit confirmation, gồm nhóm như:
|
|
413
|
+
|
|
414
|
+
- `git push --force` / `git push -f`
|
|
415
|
+
- `git reset --hard`
|
|
416
|
+
- destructive `git clean`
|
|
417
|
+
- `npm publish`
|
|
418
|
+
- recursive forced deletion
|
|
419
|
+
- `DROP/TRUNCATE`
|
|
420
|
+
- Terraform/Kubernetes/Helm high-impact deployment actions
|
|
421
|
+
|
|
422
|
+
Instruction vẫn yêu cầu confirmation cho destructive/external side effects. Hook là lớp deterministic bổ sung, không thay thế review của người dùng.
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
# 10. Evaluation
|
|
427
|
+
|
|
428
|
+
Live evals now print heartbeats and support `--heartbeat-ms`, `--idle-timeout-ms`, and `--timeout-ms`. Ctrl+C asks the harness to terminate the active OpenCode process tree cleanly.
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
## Static skill contract
|
|
433
|
+
|
|
434
|
+
```cmd
|
|
435
|
+
npm run evals
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
Giữ **34 scenarios** để kiểm catalog và phủ đủ 39 skill.
|
|
439
|
+
|
|
440
|
+
## V2 router precision matrix
|
|
441
|
+
|
|
442
|
+
```cmd
|
|
443
|
+
npm run evals:router
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
V7.7 giữ **120 cases** với required routes và negative guards, cộng regression tests riêng cho cap-priority/capability runtime.
|
|
447
|
+
|
|
448
|
+
## Standard hidden graders
|
|
449
|
+
|
|
450
|
+
```cmd
|
|
451
|
+
npm run evals:live:validate
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
Có **20 standard live tasks**.
|
|
455
|
+
|
|
456
|
+
## Long-horizon integrity
|
|
457
|
+
|
|
458
|
+
```cmd
|
|
459
|
+
npm run evals:long:validate
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
Có **5 long tasks**, trong đó một task yêu cầu phối hợp **15 source modules**.
|
|
463
|
+
|
|
464
|
+
## Baseline vs UES model thật
|
|
465
|
+
|
|
466
|
+
```cmd
|
|
467
|
+
ocskill eval-live --model provider/model --trials 3
|
|
468
|
+
ocskill eval-live --suite long --model provider/model --trials 3
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
Với suite `long`, UES mode chỉ được tính PASS khi:
|
|
472
|
+
|
|
473
|
+
- hidden grader PASS
|
|
474
|
+
- có durable `.ues-work`
|
|
475
|
+
- plan approval PASS
|
|
476
|
+
- plan có ít nhất 2 task
|
|
477
|
+
- mọi task đã được attempt + completed
|
|
478
|
+
- integration verification PASS
|
|
479
|
+
- integration evidence tồn tại
|
|
480
|
+
- finalization evidence tồn tại
|
|
481
|
+
- state cuối là `completed`
|
|
482
|
+
|
|
483
|
+
Vì vậy model giải code trực tiếp trong một context nhưng bỏ qua long-horizon engine sẽ không được tính là UES long PASS.
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
# 11. CI / package release
|
|
488
|
+
|
|
489
|
+
Yêu cầu phát triển:
|
|
490
|
+
|
|
491
|
+
- Node.js 20+
|
|
492
|
+
- npm
|
|
493
|
+
- Git
|
|
494
|
+
|
|
495
|
+
```cmd
|
|
496
|
+
npm ci --ignore-scripts
|
|
497
|
+
npm run ci
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
Pipeline gồm:
|
|
501
|
+
|
|
502
|
+
```text
|
|
503
|
+
syntax
|
|
504
|
+
→ resource validation
|
|
505
|
+
→ static skill routing
|
|
506
|
+
→ 120-case router eval
|
|
507
|
+
→ standard hidden-grader integrity
|
|
508
|
+
→ long hidden-grader integrity
|
|
509
|
+
→ Node tests
|
|
510
|
+
→ npm pack --dry-run
|
|
511
|
+
→ packed global-install smoke
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
Packed smoke kiểm tra OpenCode V2 path, 39 skills, 11 commands, 10 subagents, router plugin, task graph, durable work state và model config.
|
|
515
|
+
|
|
516
|
+
---
|
|
517
|
+
|
|
518
|
+
# 12. Update / remove
|
|
519
|
+
|
|
520
|
+
Update:
|
|
521
|
+
|
|
522
|
+
```cmd
|
|
523
|
+
ocskill update
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
Remove:
|
|
527
|
+
|
|
528
|
+
```cmd
|
|
529
|
+
ocskill remove
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
UES chỉ quản lý resource có namespace/marker của chính nó, giữ unmanaged collisions và chống accidental downgrade.
|
|
533
|
+
|
|
534
|
+
---
|
|
535
|
+
|
|
536
|
+
# Tài liệu
|
|
537
|
+
|
|
538
|
+
- [Engineering design](docs/ENGINEERING-DESIGN.md)
|
|
539
|
+
- [OpenCode compatibility](docs/OPENCODE-COMPAT.md)
|
|
540
|
+
- [Deterministic tools](docs/DETERMINISTIC-TOOLS.md)
|
|
541
|
+
- [Evaluation](docs/EVALS.md)
|
|
542
|
+
- [Trace schema](docs/TRACE-SCHEMA.md)
|
|
543
|
+
- [npm publish](docs/NPM-PUBLISH.md)
|
|
544
|
+
- [Research sources](docs/RESEARCH-SOURCES.md)
|
|
545
|
+
|
|
546
|
+
# License
|
|
547
|
+
|
|
548
|
+
MIT
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
# 13. Learning, Hermes và Control Center
|
|
552
|
+
|
|
553
|
+
Evidence-gated learning:
|
|
554
|
+
|
|
555
|
+
```cmd
|
|
556
|
+
ocskill learn analyze . --eval-dir .ues-evals
|
|
557
|
+
ocskill learn status .
|
|
558
|
+
ocskill learn accept <proposal-id> .
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
Optional Hermes adapter:
|
|
562
|
+
|
|
563
|
+
```cmd
|
|
564
|
+
ocskill hermes status
|
|
565
|
+
ocskill hermes prompt <slug> <task> .
|
|
566
|
+
ocskill hermes exec <slug> <task> .
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
Local Control Center:
|
|
570
|
+
|
|
571
|
+
```cmd
|
|
572
|
+
ocskill dashboard .
|
|
573
|
+
ocskill dashboard . --serve --port 4177
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
Parallel write isolation primitives:
|
|
577
|
+
|
|
578
|
+
```cmd
|
|
579
|
+
ocskill sandbox create <slug> <task> .
|
|
580
|
+
ocskill sandbox list .
|
|
581
|
+
```
|