opencode-agent-skill 11.0.0 → 13.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +119 -14
  3. package/bin/ocskill.mjs +416 -83
  4. package/docs/DETERMINISTIC-TOOLS.md +1 -1
  5. package/docs/ENGINEERING-DESIGN.md +4 -4
  6. package/docs/EVALS.md +3 -3
  7. package/docs/GITHUB-RULESET.md +50 -0
  8. package/docs/NPM-PUBLISH.md +22 -8
  9. package/docs/OPENCODE-COMPAT.md +14 -4
  10. package/docs/TRACE-SCHEMA.md +1 -1
  11. package/docs/V11-PERCEPTION-ADAPTIVE.md +2 -2
  12. package/docs/V12-WEAK-MODEL-INTELLIGENCE.md +27 -0
  13. package/docs/V13-PARALLEL-WEAK-MODEL-RUNTIME.md +75 -0
  14. package/evals/repo-scale/tasks.json +62 -0
  15. package/global-config/AGENTS.md +4 -0
  16. package/global-config/commands/resume.md +4 -1
  17. package/global-config/commands/run.md +9 -7
  18. package/global-config/plugins/ues-router/capabilities.js +1 -0
  19. package/global-config/plugins/ues-router/command-runtime.js +79 -0
  20. package/global-config/plugins/ues-router/index.js +364 -43
  21. package/global-config/plugins/ues-router/parallel-runtime.js +271 -0
  22. package/global-config/plugins/ues-router/text-runtime.js +115 -0
  23. package/global-config/plugins/ues-router/verifier-runtime.js +33 -0
  24. package/global-config/skills/dynamic-workflow/SKILL.md +7 -6
  25. package/global-config/skills/dynamic-workflow/references/workflow.md +8 -6
  26. package/global-config/skills/engineering-orchestrator/references/long-horizon.md +7 -5
  27. package/lib/cli-utils.mjs +17 -4
  28. package/lib/context-engine-v11.mjs +4 -0
  29. package/lib/context-quality.mjs +59 -0
  30. package/lib/decision-policy.mjs +23 -0
  31. package/lib/installer.mjs +49 -16
  32. package/lib/model-config.mjs +13 -1
  33. package/lib/model-performance.mjs +113 -0
  34. package/lib/model-policy.mjs +9 -2
  35. package/lib/repo-scale-fixture.mjs +45 -0
  36. package/lib/task-engine.mjs +36 -12
  37. package/lib/task-graph.mjs +32 -0
  38. package/lib/text-encoding.mjs +74 -0
  39. package/lib/work-plan-scope.mjs +49 -0
  40. package/lib/worktree-sandbox.mjs +141 -12
  41. package/package.json +8 -4
  42. package/scripts/check-release-consistency.mjs +260 -0
  43. package/scripts/smoke-packed-install.mjs +39 -3
  44. package/scripts/smoke-plain-install.mjs +27 -7
  45. package/scripts/validate-repo-scale-suite.mjs +27 -0
  46. package/scripts/validate-v12-foundation.mjs +24 -0
  47. package/scripts/validate.mjs +18 -1
@@ -1,6 +1,6 @@
1
1
  # Deterministic evidence and execution tools
2
2
 
3
- UES 8 uses dependency-light Node helpers for work that should not rely on a model guessing or remembering it.
3
+ V11 uses dependency-light Node helpers for work that should not rely on a model guessing or remembering it.
4
4
 
5
5
  ## Repository evidence
6
6
 
@@ -1,6 +1,6 @@
1
1
  # UES engineering design
2
2
 
3
- UES 8 evolves the project from an engineering workflow harness into a **long-horizon execution engine** designed to reduce context pressure on coding models.
3
+ V11 evolves the project from an engineering workflow harness into a **perception-aware adaptive execution engine** designed to reduce context pressure on coding models while keeping evidence needed for correctness.
4
4
 
5
5
  The selected model remains the selected model. UES improves orchestration, evidence, task boundaries, state persistence and verification; it does not claim model equivalence.
6
6
 
@@ -44,11 +44,11 @@ Models still reason about semantics and read affected code.
44
44
 
45
45
  ### Progressive disclosure
46
46
 
47
- The catalog remains 39 skills. UES prefers a small active skill set and loads deeper references only when needed.
47
+ The catalog spans 48 skills. UES prefers a small active skill set and loads deeper references only when needed.
48
48
 
49
49
  ### Hard gates, not reminders
50
50
 
51
- V8 machine-enforces the important boundaries:
51
+ V11 machine-enforces the important boundaries:
52
52
 
53
53
  1. long/high-risk plans are not executable until a structured plan-verification receipt matches the current plan hash;
54
54
  2. long/high-risk task completion requires a successful verification receipt for the active run and the current workspace fingerprint;
@@ -133,7 +133,7 @@ Only UES-managed resources are rewritten/removed.
133
133
 
134
134
  UES separates:
135
135
 
136
- 1. **static skill contract** — 34 scenarios covering the 39-skill catalog;
136
+ 1. **static skill contract** — 43 scenarios covering the 48-skill catalog;
137
137
  2. **V2 router precision matrix** — 120 required-route/negative-guard cases;
138
138
  3. **standard live benchmark** — 20 executable hidden-graded tasks;
139
139
  4. **long-horizon benchmark** — 5 tasks, including one 15-source-file integration workload;
package/docs/EVALS.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # UES evaluations
2
2
 
3
- UES 8 separates catalog correctness, routing precision, benchmark integrity, final behavior, long-horizon orchestration and cross-stack coverage.
3
+ V11 separates catalog correctness, routing precision, benchmark integrity, final behavior, long-horizon orchestration and cross-stack coverage.
4
4
 
5
5
  ## 1. Static skill-routing contract
6
6
 
7
- `evals/routing.json` keeps 34 representative scenarios and covers all installed skills.
7
+ `evals/routing.json` keeps 43 representative scenarios and covers all installed skills.
8
8
 
9
9
  ```bash
10
10
  npm run evals
@@ -141,7 +141,7 @@ Compare the same model, variant, prompt, fixture, grader and environment. Report
141
141
  A benchmark result is evidence only for the measured workload. UES does not claim to turn one base model into another.
142
142
 
143
143
 
144
- ## V8 live-run observability and evidence gate
144
+ ## V11 live-run observability and evidence gate
145
145
 
146
146
  Live runs accept:
147
147
 
@@ -0,0 +1,50 @@
1
+ # GitHub Ruleset Readiness
2
+
3
+ This document records the recommended GitHub repository ruleset configuration for the `main` branch, to be activated only after CI Gate and Security Gate have each achieved at least one successful run.
4
+
5
+ ## Recommended ruleset
6
+
7
+ - **Ruleset name:** `main-protection`
8
+ - **Target:** default branch / `main`
9
+ - **Enforcement:** Active
10
+
11
+ ## Rules
12
+
13
+ 1. **Restrict deletions** — block deleting the default branch or force-pushing over it.
14
+ 2. **Block force pushes** — no `git push --force` or `git push -f` to `main`.
15
+ 3. **Require pull request before merge** — all changes must go through a PR.
16
+ 4. **Require conversation resolution** — PR reviewers must resolve all inline comments before merge.
17
+ 5. **Require status checks** — PRs must have passing CI Gate and Security Gate checks before merge.
18
+ 6. **Require branch up to date** — PR branches must be up to date with `main` before merge (applies when there are multiple contributors; can be relaxed for single-maintainer setups).
19
+ 7. **Required check: CI Gate** — the aggregate CI check from `.github/workflows/ci.yml`.
20
+ 8. **Required check: Security Gate** — the aggregate security check from `.github/workflows/security.yml`.
21
+
22
+ ## Approval policy for single-maintainer repo
23
+
24
+ This repository currently has one maintainer. Setting `required approval = 1` would prevent the owner from merging their own PRs (they cannot approve their own PR). Therefore:
25
+
26
+ - **Required approval = 0** for now.
27
+ - When a collaborator or external reviewer is added, raise to `required approval = 1` to restore oversight.
28
+
29
+ ## Classic branch protection vs ruleset
30
+
31
+ GitHub supports both classic branch protection rules and repository rulesets simultaneously. When both are configured:
32
+
33
+ - They can apply independently to different aspects of branch protection.
34
+ - Be cautious of duplicate or conflicting protections (e.g., two rules both requiring status checks but with different required lists).
35
+ - If migrating from classic protection to ruleset, remove the classic rule after confirming the ruleset is active and working.
36
+
37
+ ## Activation prerequisite
38
+
39
+ Do not enable the ruleset until:
40
+
41
+ 1. CI Gate has at least one successful run on `main`.
42
+ 2. Security Gate has at least one successful run on `main` or a PR.
43
+
44
+ Without these prerequisites, the ruleset would block all merges immediately after activation, effectively locking the repository.
45
+
46
+ ## Current status
47
+
48
+ - **CI Gate:** Added in `.github/workflows/ci.yml`. Awaiting first successful run.
49
+ - **Security Gate:** Added in `.github/workflows/security.yml`. Awaiting first successful run.
50
+ - **Ruleset:** NOT YET ACTIVATED. Will be configured via GitHub admin settings after both gates have successful runs.
@@ -17,7 +17,7 @@ opencode-agent-skill
17
17
  npm run ci
18
18
  ```
19
19
 
20
- V9 CI includes syntax validation, resource validation, static skill routing, the 120-case V2 router matrix, standard/long/polyglot hidden-grader integrity checks, unit/integration tests, package dry-run, packed global-install smoke, and a plain global-install compatibility smoke.
20
+ CI includes syntax validation, resource validation, static skill routing, the 129-case V2 router matrix, 13 V11 contract tasks, standard/long/polyglot hidden-grader integrity checks, unit/integration tests, package dry-run, packed global-install smoke, and a plain one-command install/resource sync smoke.
21
21
 
22
22
  ## Manual release-like test
23
23
 
@@ -27,36 +27,50 @@ Use:
27
27
 
28
28
  ```cmd
29
29
  npm pack
30
- npm install -g .\opencode-agent-skill-9.0.0.tgz --allow-scripts=opencode-agent-skill
30
+ npm install -g .\opencode-agent-skill-13.0.0-beta.0.tgz --allow-scripts=opencode-agent-skill
31
+ ocskill install
31
32
  ocskill status
32
33
  ocskill doctor
33
34
  ```
34
35
 
36
+ For the current V13 beta, also open a fresh OpenCode V2 session, check `/plugins`, and call `ues.capabilities`. Native parallel should only be exercised when `freshDispatch` is `true`.
37
+
35
38
  For routine development, the automated `smoke:pack` test uses an isolated npm prefix/OpenCode config so it does not replace the developer's currently installed UES.
36
39
 
37
40
  ## Manual publish
38
41
 
42
+ Before publishing, verify the exact prerelease version is not already present:
43
+
44
+ ```cmd
45
+ npm view opencode-agent-skill@13.0.0-beta.0 version --registry=https://registry.npmjs.org/
46
+ ```
47
+
48
+ If it is not present, a manual prerelease publish uses `next`, not `latest`:
49
+
39
50
  ```cmd
40
51
  npm login
41
52
  npm whoami
42
53
  npm run ci
43
- npm publish --access public
54
+ npm publish --access public --provenance --tag next
44
55
  ```
45
56
 
46
57
  After publication verify:
47
58
 
48
59
  ```cmd
49
60
  npm view opencode-agent-skill versions --json
50
- npm view opencode-agent-skill@9.0.0 version
61
+ npm view opencode-agent-skill@13.0.0-beta.0 version
51
62
  npm dist-tag ls opencode-agent-skill
52
63
  ```
53
64
 
54
- The expected release tag is:
65
+ For V13 beta the expected dist-tags are:
55
66
 
56
67
  ```text
57
- latest: 9.0.0
68
+ latest: 11.0.0
69
+ next: 13.0.0-beta.0
58
70
  ```
59
71
 
72
+ Do not move `latest` to V13 until the prerelease is intentionally promoted stable.
73
+
60
74
  ## GitHub Actions publishing
61
75
 
62
76
  The repository's publish workflow is OIDC/provenance-ready and runs the same package validation before `npm publish`.
@@ -71,7 +85,7 @@ Workflow: publish.yml
71
85
 
72
86
  Then the GitHub-hosted workflow can authenticate through OIDC instead of a long-lived npm publish token. npm Trusted Publishing requires the corresponding publisher relationship to be configured on npm; repository code alone cannot create that account-side trust relationship.
73
87
 
74
- Until the npm-side Trusted Publisher relationship is configured, the workflow can fall back to a valid `NPM_TOKEN`. After OIDC publishing is verified, remove long-lived publish-token access where practical.
88
+ The current `publish.yml` is tag-only. A matching prerelease tag such as `v13.0.0-beta.0` runs the full package gate and publishes with npm dist-tag `next`; a stable version publishes to `latest`. The workflow first checks whether that exact version already exists and skips duplicate publication.
75
89
 
76
90
  ## Release checklist
77
91
 
@@ -84,7 +98,7 @@ Until the npm-side Trusted Publisher relationship is configured, the workflow ca
84
98
  7. Commit and push the release branch.
85
99
  8. Merge only after review/local validation is clean.
86
100
  9. Create/push the matching `vX.Y.Z` tag or run the publish workflow.
87
- 10. Verify registry version and `latest` dist-tag.
101
+ 10. Verify registry version and dist-tags (`next` for prerelease, `latest` for stable).
88
102
  11. Install the published package on a clean environment before announcing it.
89
103
 
90
104
  ## One-command user install
@@ -1,6 +1,6 @@
1
1
  # OpenCode compatibility
2
2
 
3
- UES 8 ships one npm package for OpenCode 1.x and 2.x, while only enabling V2-native runtime features when V2 is detected.
3
+ V13 ships one npm package for OpenCode 1.x and 2.x. CLI/state/verification features remain available on both lines, while V2-native fresh-session and parallel runtime features are enabled only when the required V2 capabilities are detected.
4
4
 
5
5
  ## Detection
6
6
 
@@ -23,14 +23,14 @@ The detected major is recorded in the managed state.
23
23
 
24
24
  UES installs:
25
25
 
26
- - 39 namespaced skills
26
+ - 48 namespaced skills
27
27
  - 11 namespaced commands
28
- - 10 namespaced subagents using compatible V1 `permission` frontmatter
28
+ - 12 namespaced subagents using compatible V1 `permission` frontmatter
29
29
  - managed global `AGENTS.md` block
30
30
 
31
31
  The V2 runtime plugin is not installed.
32
32
 
33
- Durable CLI state, task DAG, plan/integration gates and model-policy configuration remain available. V2-specific automatic fresh-session dispatch is unavailable.
33
+ Durable CLI state, task DAG, plan/integration gates, Windows UTF text recovery and model-policy configuration remain available. `ues.dispatch_task` and `ues.dispatch_parallel` are unavailable because those tools live in the V2 router plugin.
34
34
 
35
35
  ## OpenCode 2.x
36
36
 
@@ -40,6 +40,8 @@ UES converts managed agent permission frontmatter to V2 ordered `permissions` an
40
40
  <global-config>/plugins/ues-router/
41
41
  ```
42
42
 
43
+ V13 also installs the 11 UES slash-command templates inside the managed router as V2 **prompt aliases** instead of registering them as native global custom commands. Typing `/ues-run ...`, `/ues-fix ...`, and the other `/ues-*` aliases therefore travels through `session.prompt`; the router expands the same bundled command contract before routing skills. This is a compatibility workaround for V2 custom-command transport failures such as `UnsupportedContentType` from the `session.command` path. Re-syncing with `ocskill install` removes stale UES-managed native command files from older installs.
44
+
43
45
  The plugin provides:
44
46
 
45
47
  - prompt-admission skill routing
@@ -48,6 +50,7 @@ The plugin provides:
48
50
  - durable-state/task-graph/context-pack tools
49
51
  - `ues.dispatch_task` bounded fresh executor runtime
50
52
  - `ues.cancel_task` and `ues.recover_task` when session interruption is supported
53
+ - `ues.dispatch_parallel` when the full fresh-dispatch surface is present; it runs independent approved tasks in isolated same-model sessions, verifies each task independently, and serializes integration
51
54
 
52
55
  `ues.dispatch_task` uses V2 session APIs to create a fresh session rooted at the selected execution directory, bind its session ID to the task lease, select `ues-executor`, optionally switch model tier, prompt one approved task, heartbeat while waiting, and interrupt on timeout. Concurrent writing tasks can be isolated in Git worktrees.
53
56
 
@@ -110,3 +113,10 @@ The managed V2 plugin probes for:
110
113
  - permission hooks
111
114
 
112
115
  `ues.capabilities` exposes the observed surface. Fresh dispatch fails closed when the minimum create/prompt/wait/interrupt/context/switch-agent surface is unavailable. Optional context/prompt/permission hooks degrade safely instead of preventing the plugin from loading.
116
+
117
+
118
+ ## V13 parallel compatibility
119
+
120
+ `ues.dispatch_parallel` is capability-gated, not version-string-gated. It requires the complete fresh-dispatch surface reported by `ues.capabilities`: session create, prompt, wait, interrupt, context retrieval and agent switching. If any required API is missing, V13 fails closed and the durable CLI workflow remains usable in serial mode.
121
+
122
+ OpenCode 1.x users can still use V13 CLI hardening, durable `.ues-work/<slug>/` state, receipts, task graphs and Windows text normalization. To use native multi-session parallel execution, use a runtime that exposes the V2 fresh-session APIs.
@@ -75,7 +75,7 @@ Keep constant:
75
75
  Compare observable success, regressions, elapsed time, tool behavior and cost rather than narrative confidence.
76
76
 
77
77
 
78
- ## V8 runtime and evidence fields
78
+ ## V11 runtime and evidence fields
79
79
 
80
80
  Each live result may additionally contain:
81
81
 
@@ -1,6 +1,6 @@
1
1
  # UES V11 — Perception & Adaptive Execution
2
2
 
3
- Status: development (`11.0.0-dev.1`). V10 remains npm `latest` until the V11 release gates pass.
3
+ Status: stable (`11.0.0`). V11 is npm `latest`.
4
4
 
5
5
  ## Goal
6
6
 
@@ -211,7 +211,7 @@ Do not promote V11 to stable until all are satisfied:
211
211
  7. Packed and plain npm-install smoke tests pass.
212
212
  8. Real weak-model evaluation shows no suite regression.
213
213
  9. Any configured cache/evidence target has sufficient telemetry and passes.
214
- 10. npm `latest` remains V10 until the V11 candidate completes these gates.
214
+ 10. npm `latest` is V11 stable; no release gate prevents promotion.
215
215
 
216
216
  ## Compatibility
217
217
 
@@ -0,0 +1,27 @@
1
+ # V12 Weak-Model Intelligence Foundation
2
+
3
+ Status: beta prerelease (`12.0.0-beta.0`, npm dist-tag `next`). V11 (`11.0.0`) remains the stable `latest` release until V12 earns stable-release evidence.
4
+
5
+ ## Goal
6
+
7
+ V12 focuses on making weaker coding models more reliable on large repositories by improving measured context quality, empirical model routing, plan identity, bounded autonomous decisions, and repo-scale evaluation. It does not claim that orchestration makes one base model equivalent to a stronger model.
8
+
9
+ ## Foundations
10
+
11
+ - Empirical model performance: observed pass rate, retries, token use and latency can rerank capability-eligible models by task class.
12
+ - Context quality receipts: adaptive context reports required-file recall and irrelevant-context ratio.
13
+ - Plan-scoped snapshots: every imported plan gets a SHA-256 keyed snapshot and active-plan fence before execution.
14
+ - Decision policy: reversible local engineering choices can be auto-resolvable; publish/deploy/destructive/product decisions remain human-gated.
15
+ - Repo-scale contract suite: deterministic generation of a 300-module monorepo fixture for larger-repository validation.
16
+
17
+ ## Release policy
18
+
19
+ V12 is not stable merely because unit tests pass. Promotion requires healthy GitHub CI/Security gates, repo-scale validation, real weak-model baseline-vs-UES trials, no regression in existing suites, measured context recall, sufficient empirical routing samples, and Windows/Linux package/install smoke evidence.
20
+
21
+ ## Beta install
22
+
23
+ ```cmd
24
+ npm install -g opencode-agent-skill@next
25
+ ocskill install
26
+ ocskill doctor
27
+ ```
@@ -0,0 +1,75 @@
1
+ # V13 Parallel Weak-Model Runtime
2
+
3
+ Status: beta prerelease (`13.0.0-beta.0`).
4
+
5
+ ## Goal
6
+
7
+ V13 reduces wall-clock time for large engineering work by letting multiple fresh sessions of the **same configured model** execute independent approved tasks concurrently without sharing mutable context.
8
+
9
+ ## Runtime contract
10
+
11
+ - `ues.dispatch_parallel` defaults to one shared model for every worker and verifier.
12
+ - The root must be a Git repository. A pre-existing dirty working tree is allowed: V13 snapshots that baseline into each sandbox and integrates only the task delta, so valid inherited/user changes are preserved.
13
+ - Writers execute in isolated Git worktrees.
14
+ - Resource leases serialize overlapping files, unknown scope and shared configuration surfaces.
15
+ - The scheduler is event-driven: when one task is independently verified, transactionally integrated and completed, newly unblocked dependencies may start immediately.
16
+ - Initial and downstream sandboxes inherit the current dirty root through an internal snapshot commit on the sandbox branch; the user's root branch is never auto-committed.
17
+ - A fresh `ues-verifier` session using the same model must return PASS before integration.
18
+ - Integration is serialized. If receipt/completion fails after patch application, V13 reverses that task patch before marking the run failed.
19
+ - No parallel worker pushes, publishes or deploys.
20
+
21
+ ## Same-model execution
22
+
23
+ One model is sufficient. Parallelism means multiple isolated sessions, not multiple model families:
24
+
25
+ ```text
26
+ provider/weak-model
27
+ ├─ fresh session A
28
+ ├─ fresh session B
29
+ ├─ fresh session C
30
+ └─ fresh verifier sessions
31
+ ```
32
+
33
+ If no explicit model is supplied, the configured executor model is shared. If no configured model is selected, all sessions keep the OpenCode default model.
34
+
35
+ ## Runtime compatibility
36
+
37
+ V13 keeps CLI, durable state, receipts, task graphs and Windows text hardening available on OpenCode 1.x. Native `ues.dispatch_task` and `ues.dispatch_parallel` require the V2 router plugin plus the fresh-session capability surface. The router checks capabilities at runtime and fails closed if create/prompt/wait/interrupt/context/switch-agent are incomplete.
38
+
39
+ When npm blocks lifecycle scripts (common with stricter npm 11+ `allowScripts` policy), install still leaves the CLI available; run `ocskill install` to perform the documented resource sync explicitly.
40
+
41
+ ## CLI hardening
42
+
43
+ V13 parses `--help` before positional arguments, so commands such as these are safe:
44
+
45
+ ```cmd
46
+ ocskill work init --help
47
+ ocskill work status --help
48
+ ocskill work gate-receipt --help
49
+ ```
50
+
51
+ `ocskill work status .` now lists durable workspaces instead of treating `.` as a slug.
52
+
53
+ For machine callers, append `--json` to receive structured errors.
54
+
55
+ On Windows, prefer:
56
+
57
+ ```cmd
58
+ ocskill diff . --out dirty.diff
59
+ ```
60
+
61
+ This writes UTF-8 directly and avoids PowerShell 5 redirection producing UTF-16 text that generic readers may classify as binary. On OpenCode 1.x, where the V2 `ues.text_read` tool is unavailable, read known text safely without creating a converted copy:
62
+
63
+ ```cmd
64
+ ocskill text-read .ues-work/<slug>/PLAN.json --json
65
+ ```
66
+
67
+ Existing UTF-8/UTF-16 text can be normalized with:
68
+
69
+ ```cmd
70
+ ocskill normalize-text dirty.diff
71
+ ```
72
+
73
+ ## Release evidence
74
+
75
+ V13 remains beta until parallel execution demonstrates measurable wall-clock improvement without reducing correctness, and Windows/Linux CI proves help parsing, encoding, dirty-baseline worktree inheritance, rollback, verifier receipts and package installation.
@@ -0,0 +1,62 @@
1
+ {
2
+ "version": 1,
3
+ "kind": "repo-scale-contract-suite",
4
+ "description": "Deterministic large-repository contract tasks used to validate V12 weak-model context/routing foundations before live model runs.",
5
+ "minimumGeneratedModules": 300,
6
+ "tasks": [
7
+ {
8
+ "id": "cross-package-regression",
9
+ "category": "repo-scale",
10
+ "objective": "Trace a regression across package boundaries without loading the entire generated monorepo into context.",
11
+ "requiredFiles": [
12
+ "packages/pkg-0/src/mod049.mjs",
13
+ "packages/pkg-1/src/mod049.mjs"
14
+ ],
15
+ "acceptance": [
16
+ "Required-file context recall is measurable",
17
+ "Unrelated packages stay bounded"
18
+ ]
19
+ },
20
+ {
21
+ "id": "public-contract-ripple",
22
+ "category": "contract",
23
+ "objective": "Change a public API field and identify the API producer and web consumer that must move together.",
24
+ "requiredFiles": [
25
+ "contracts/public-api.json",
26
+ "apps/api/src/service.mjs",
27
+ "apps/web/src/consumer.mjs"
28
+ ],
29
+ "acceptance": [
30
+ "Contract producer and consumer are both discovered",
31
+ "Change-impact evidence is explicit"
32
+ ]
33
+ },
34
+ {
35
+ "id": "deep-chain-debug",
36
+ "category": "debugging",
37
+ "objective": "Diagnose a defect near the end of a fifty-module import chain using bounded evidence expansion.",
38
+ "requiredFiles": [
39
+ "packages/pkg-2/src/mod048.mjs",
40
+ "packages/pkg-2/src/mod049.mjs"
41
+ ],
42
+ "acceptance": [
43
+ "Initial context remains bounded",
44
+ "Recovery can expand around the failing chain"
45
+ ]
46
+ },
47
+ {
48
+ "id": "multi-package-refactor",
49
+ "category": "refactor",
50
+ "objective": "Coordinate a refactor touching several package endpoints while serializing shared contract writes.",
51
+ "requiredFiles": [
52
+ "packages/pkg-3/src/index.mjs",
53
+ "packages/pkg-4/src/index.mjs",
54
+ "contracts/public-api.json"
55
+ ],
56
+ "acceptance": [
57
+ "Cross-package scope is explicit",
58
+ "Shared contract changes are treated as a write-conflict surface"
59
+ ]
60
+ }
61
+ ]
62
+ }
@@ -34,8 +34,10 @@ Useful deterministic helpers include:
34
34
 
35
35
  - `ocskill inspect [dir]`
36
36
  - `ocskill impact <symbol-or-term> [dir]`
37
+ - `ocskill repo-graph [dir] --compact` for an initial hotspot summary; request the full graph only when exact edge detail is needed
37
38
  - `ocskill aci search|refs|view|text ...`
38
39
  - `ocskill working-tree [dir]`
40
+ - `ocskill text-read <file> --json` when OpenCode/generic readers classify known UTF text as binary
39
41
  - `ocskill verification-plan [dir]`
40
42
  - `ocskill context-pack <slug> <task> [dir]`
41
43
  - `ocskill work verify-command ... -- <command>`
@@ -111,6 +113,8 @@ Never claim a test, build, migration, deployment, push or release succeeded unle
111
113
 
112
114
  For interruption-prone or dependent multi-task work, use durable `.ues-work/<slug>/` state instead of relying on conversation memory.
113
115
 
116
+ `.ues-work/<slug>/` is the only UES durable-state location. Never create or treat a top-level `ues-work/` directory (without the leading dot) as official UES state, even if an older/manual run left files there. On resume, prefer the initialized `.ues-work/<slug>/` item plus current Git evidence.
117
+
114
118
  The required sequence is:
115
119
 
116
120
  `SPEC -> PLAN -> plan check/receipt -> approved tasks -> fresh executor per task -> task verification receipts -> integration verification/receipt -> finalize`
@@ -7,10 +7,13 @@ Resume this UES work item: $ARGUMENTS
7
7
 
8
8
  Read the matching `.ues-work/<slug>/SPEC.md`, `PLAN.json`, `STATE.json`, `EVIDENCE.json`, task reports and current Git status. Run `ocskill work resume <slug> .` and revalidate assumptions that may have gone stale.
9
9
 
10
+ Ignore a top-level `ues-work/` directory as official workflow state. Only `.ues-work/<slug>/` created/managed by `ocskill work` is canonical durable state.
11
+
10
12
  Trust durable task state and Git evidence over conversational recollection. Respect the machine gates:
11
13
  - if the plan is awaiting approval, run `ues-plan-checker` and record PASS with `ocskill work approve-plan`;
12
14
  - resume failed/pending work from the last verified boundary;
13
- - on OpenCode V2 prefer `ues.dispatch_task` for a fresh executor and configured model escalation;
15
+ - on OpenCode V2, prefer `ues.dispatch_parallel` when two or more dependency-ready tasks have independent declared write/resource scopes; otherwise use `ues.dispatch_task` for a fresh executor. Keep one shared model for parallel worker/verifier sessions unless the user explicitly changes the design;
16
+ - do not force-clean inherited user changes just to enable parallel resume; V13 snapshots an existing dirty Git baseline into isolated worktrees and integrates only each task delta;
14
17
  - do not repeat completed tasks unless fresh evidence invalidates them;
15
18
  - after all tasks complete, run `ues-integration-verifier`, record its verdict with `ocskill work verify-integration`, then finalize only after PASS and an unchanged workspace fingerprint.
16
19
 
@@ -7,20 +7,22 @@ Run this task using the UES long-horizon workflow: $ARGUMENTS
7
7
 
8
8
  Treat this command as permission to create a repository-local, git-ignored `.ues-work/<slug>/` execution workspace for durable non-secret planning state.
9
9
 
10
+ Never create or use `ues-work/` (without the leading dot) as durable UES state. If such a directory exists from an older/manual run, treat it as ordinary repository content unless the user explicitly asks to migrate it; official state must come from `ocskill work init` under `.ues-work/<slug>/`.
11
+
10
12
  Required workflow:
11
- 1. Classify the request with `ocskill task-policy "$ARGUMENTS"`. Use the returned risk/mode/context guidance rather than assuming every non-trivial task needs the same workflow.
12
- 2. Inspect repository instructions and deterministic evidence with `ocskill inspect`, `ocskill repo-graph`, and targeted impact searches.
13
+ 1. Classify the request with `ocskill task-policy "<concise task summary>"`. Do not duplicate the full user prompt into shell arguments; use the returned risk/mode/context guidance rather than assuming every non-trivial task needs the same workflow.
14
+ 2. Inspect repository instructions and deterministic evidence with `ocskill inspect`, `ocskill repo-graph . --compact`, and targeted impact searches. Expand to the full graph only when exact edge detail is needed.
13
15
  3. Create a concise SPEC with observable acceptance criteria.
14
16
  4. Initialize persistent state with `ocskill work init`.
15
17
  5. Produce a file-aware `PLAN.json` using the UES plan schema, then import it with `ocskill work plan`.
16
18
  6. Dispatch `ues-plan-checker` in fresh context. For long/high-risk work, bind the PASS to the current plan with a structured receipt, then approve it:
17
19
  `ocskill work gate-receipt <slug> plan . --verifier ues-plan-checker --evidence "<summary>" --out .ues-work/<slug>/reports/plan-receipt.json`
18
20
  followed by `ocskill work approve-plan <slug> . --evidence "<summary>" --receipt-file .ues-work/<slug>/reports/plan-receipt.json`.
19
- 7. Use `ocskill task-graph` and execute only ready dependency-safe tasks. On OpenCode V2 prefer `ues.dispatch_task`: it starts the task, creates a fresh `ues-executor` session, applies configured attempt-based model escalation, waits for that executor, and returns its report. Inspect the diff and evidence, then record `ocskill work complete` or `ocskill work fail`.
20
- 8. Independent tasks may run concurrently only when safe-wave analysis reports no write/read conflict. V8 can isolate concurrent writers in Git worktrees and integrate them with conflict detection; manual fallback is `ocskill sandbox create ...` followed by `ocskill sandbox integrate <worktree> .`. Never integrate over overlapping dirty root files.
21
- 9. During long execution keep the task lease alive with `ocskill work heartbeat` (the V2 dispatcher does this automatically). On resume, `ocskill work recover` or `ocskill work resume` recovers expired leases instead of leaving tasks stuck in `running`.
22
- 10. Run declared checks through `ocskill work verify-command <slug> <task> . --run-id <run-id> -- <command> [args...]`. For long/high-risk plans, a successful receipt for the active run is mandatory before `work complete`; narrative-only completion is rejected.
23
- 11. On executor failure, diagnose from fresh evidence and retry in a fresh executor. Adaptive model policy may raise the model tier based on risk/complexity plus attempt count; do not escalate blindly.
21
+ 7. Use `ocskill task-graph` and execute only dependency-ready tasks. On OpenCode V2, when two or more independent tasks are ready, prefer `ues.dispatch_parallel`. V13 uses multiple fresh sessions of one shared model, not multiple model families. For a single task or a deliberately serial path, use `ues.dispatch_task`.
22
+ 8. `ues.dispatch_parallel` is event-driven rather than wave-barrier driven: as soon as a task is independently verified, transactionally integrated and durably completed, newly unblocked dependencies may start in the next free worker slot. Resource leases serialize overlapping writers, unknown scopes and shared configuration surfaces.
23
+ 9. Each parallel writer gets an isolated Git worktree. A pre-existing dirty root is treated as an inherited baseline, and downstream worktrees also inherit already integrated root changes through an internal sandbox snapshot; only task-local deltas are integrated and the user's root branch is not auto-committed. Integration is serialized and rolled back if post-integration verification/receipt/completion fails.
24
+ 10. For machine-checkable verification, add `verificationCommands` to the approved task, for example `{"command":"node","args":["--test","test/foo.test.mjs"]}`. V13 runs these exact commands after integration via `ocskill work verify-command`, records deterministic receipts, then also records the fresh independent verifier verdict. For long/high-risk plans, current-fingerprint receipt evidence remains mandatory.
25
+ 11. During long execution keep task leases alive (the V2 dispatcher does this automatically). On resume, `ocskill work recover` or `ocskill work resume` recovers expired leases instead of leaving tasks stuck in `running`. In parallel mode, keep one shared model for all worker/verifier sessions unless the user explicitly changes the run design.
24
26
  12. After all tasks complete, dispatch `ues-integration-verifier`. For PASS on long/high-risk work, create an integration receipt bound to the current workspace fingerprint:
25
27
  `ocskill work gate-receipt <slug> integration . --verifier ues-integration-verifier --verdict PASS --evidence "<summary>" --out .ues-work/<slug>/reports/integration-receipt.json`
26
28
  then record it with `ocskill work verify-integration <slug> . --verdict PASS --evidence "<summary>" --receipt-file .ues-work/<slug>/reports/integration-receipt.json`.
@@ -11,6 +11,7 @@ export function runtimeCapabilities(ctx) {
11
11
  sessionSwitchModel: typeof session.switchModel === "function",
12
12
  sessionHook: typeof session.hook === "function",
13
13
  permissionHook: typeof permission.hook === "function",
14
+ permissionRules: typeof permission.rules === "function",
14
15
  }
15
16
  capabilities.freshDispatch =
16
17
  capabilities.sessionCreate &&
@@ -0,0 +1,79 @@
1
+ import { existsSync, readFileSync } from "node:fs"
2
+ import path from "node:path"
3
+
4
+ export const UES_PROMPT_ALIASES = Object.freeze([
5
+ "ues-audit",
6
+ "ues-critique",
7
+ "ues-debug",
8
+ "ues-feature",
9
+ "ues-fix",
10
+ "ues-plan",
11
+ "ues-research",
12
+ "ues-resume",
13
+ "ues-review",
14
+ "ues-run",
15
+ "ues-verify",
16
+ ])
17
+
18
+ const ALIAS_SET = new Set(UES_PROMPT_ALIASES)
19
+
20
+ function parseFrontmatter(source) {
21
+ const text = String(source || "")
22
+ if (!text.startsWith("---")) return { metadata: {}, body: text }
23
+ const end = text.indexOf("\n---", 3)
24
+ if (end < 0) return { metadata: {}, body: text }
25
+
26
+ const block = text.slice(3, end).trim()
27
+ const metadata = {}
28
+ for (const line of block.split(/\r?\n/)) {
29
+ const match = line.match(/^([A-Za-z0-9_-]+):\s*(.*)$/)
30
+ if (!match) continue
31
+ metadata[match[1]] = match[2].trim()
32
+ }
33
+
34
+ return {
35
+ metadata,
36
+ body: text.slice(end + 4).replace(/^\r?\n/, ""),
37
+ }
38
+ }
39
+
40
+ function splitArgs(input) {
41
+ const value = String(input || "")
42
+ const matches = value.match(/"[^"]*"|'[^']*'|\S+/g) || []
43
+ return matches.map((item) => item.replace(/^(['"])([\s\S]*)\1$/, "$2"))
44
+ }
45
+
46
+ export function expandUesPromptAlias(text, templateDir) {
47
+ const raw = String(text || "")
48
+ const match = raw.match(/^\s*\/(ues-[a-z0-9]+(?:-[a-z0-9]+)*)(?:\s+([\s\S]*?))?\s*$/i)
49
+ if (!match) return null
50
+
51
+ const alias = match[1].toLowerCase()
52
+ if (!ALIAS_SET.has(alias)) return null
53
+
54
+ const args = String(match[2] || "").trim()
55
+ const sourceName = alias.slice("ues-".length) + ".md"
56
+ const file = path.join(templateDir, sourceName)
57
+ if (!existsSync(file)) return null
58
+
59
+ const { metadata, body } = parseFrontmatter(readFileSync(file, "utf8"))
60
+ const positional = splitArgs(args)
61
+ let expanded = body.replaceAll("$ARGUMENTS", args)
62
+ expanded = expanded.replace(/\$(\d+)/g, (_, value) => positional[Number(value) - 1] || "")
63
+
64
+ const agent = metadata.agent || null
65
+ const prelude = [
66
+ `UES V2 prompt alias: /${alias}. Preserve the command contract below while using the normal session.prompt path.`,
67
+ agent && agent !== "build"
68
+ ? `Preferred specialist: ${agent}. When fresh subagent dispatch is available, delegate to that specialist and preserve the command's read/write restrictions.`
69
+ : null,
70
+ ].filter(Boolean).join("\n")
71
+
72
+ return {
73
+ alias,
74
+ arguments: args,
75
+ agent,
76
+ sourceName,
77
+ text: `${prelude}\n\n${expanded.trim()}`,
78
+ }
79
+ }