@kisev/skills-opencode 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,100 +2,89 @@
2
2
 
3
3
  [Русский](README.ru.md)
4
4
 
5
- `@kisev/skills-opencode` is the optional npm integration. It does not include
6
- portable skills or mutate configuration on import.
7
- Managed files use exact SHA-256 ownership checks.
8
- It provides the capability router, OpenCode runtime, agent-profile management,
9
- and an opt-in installer for agents, commands, and plugins. It requires Node.js
10
- 22+ and OpenCode 1.18.29+; import, plugin loading, and npm lifecycle do not
11
- write configuration.
5
+ `@kisev/skills-opencode@2.0.4` is the optional OpenCode-specific layer. Portable
6
+ skills have a separate lifecycle and must be installed independently through the
7
+ [root portable flow](../../README.md).
12
8
 
13
- ## Install Skills
9
+ ## Requirements and Ownership
14
10
 
15
- Install portable skills first:
11
+ The package requires Node.js 22+ and OpenCode `>=1.18.29 <1.19.0`.
16
12
 
17
- ```shell
18
- npx --yes skills add kisev/skills --agent opencode --skill '*' --copy --yes
19
- ```
20
-
21
- Use `--skill <name>` for one skill. `npx skills` accepts a reproducible tag URL,
22
- for example `https://github.com/kisev/skills/tree/v2.0.0`; the package never
23
- installs or updates skills and reports the exact `npx skills add` command when a
24
- skill is missing.
13
+ | Component | Project scope | Global scope |
14
+ | ------------------ | ---------------------------- | --------------------------------------------------------- |
15
+ | npm package | project `node_modules` | `node_modules` in the npm project at `~/.config/opencode` |
16
+ | Commands | `.opencode/commands` | `~/.config/opencode/commands` |
17
+ | Agents | `.opencode/agents` | `~/.config/opencode/agents` |
18
+ | Optional wrappers | `.opencode/plugins` | `~/.config/opencode/plugins` |
19
+ | Ownership metadata | `.opencode/.skills-opencode` | `~/.config/opencode/.skills-opencode` |
25
20
 
26
- ## Install Integration
21
+ The package and generated wrappers must remain resolvable after the installer
22
+ exits. Import, plugin loading, and npm lifecycle scripts do not install assets,
23
+ install portable skills, or edit OpenCode configuration.
27
24
 
28
- ```shell
29
- npm install @kisev/skills-opencode@2.0.0
30
- ```
25
+ ## Persistent Package Install
31
26
 
32
- Interactive selection is available only in a TTY. Non-TTY installs require
33
- explicit `--commands`, `--agents`, and `--plugins` flags; selectable plugins
34
- default to an empty set. The wizard shows skill commands, package commands,
35
- fixed agents, and `rules-injector`, `rtk`, `zed-bell`.
27
+ ### Project Scope
36
28
 
37
- Preview before any write:
29
+ Install in the repository's npm project and run the CLI from that project root:
38
30
 
39
31
  ```shell
40
- npm exec -- skills-opencode install --scope global --dry-run
32
+ cd /path/to/project
33
+ npm install --save-exact @kisev/skills-opencode@2.0.4
34
+ npm exec -- skills-opencode install --scope project --dry-run
41
35
  ```
42
36
 
43
- Apply the shown digest only:
37
+ The package remains in project `node_modules`; confirmed assets go under
38
+ `.opencode`.
39
+
40
+ ### Global Scope
41
+
42
+ Use `~/.config/opencode` as the persistent npm project:
44
43
 
45
44
  ```shell
46
- npm exec -- skills-opencode install --scope global --confirm <digest>
45
+ mkdir -p "$HOME/.config/opencode"
46
+ cd "$HOME/.config/opencode"
47
+ test -f package.json || npm init --yes
48
+ npm install --save-exact @kisev/skills-opencode@2.0.4
49
+ npm exec -- skills-opencode install --scope global --dry-run
47
50
  ```
48
51
 
49
- Use `--json` for automation.
50
- The machine-readable plan includes `requires_restart`; a preview uses `--dry-run`
51
- and an apply uses `--confirm <digest>` with identical arguments.
52
+ Keep the dependency in that npm project's `package.json` and lock file.
53
+ Confirmed assets go under `~/.config/opencode`.
52
54
 
53
- `global` manages `.config/opencode/agents`, `.config/opencode/commands`, and
54
- `.config/opencode/plugins`. Project scope manages `.opencode/agents`,
55
- `.opencode/commands`, and `.opencode/plugins`. Profile configuration is kept in
56
- `.config/opencode/.skills-opencode/agent-profiles.json` globally or under
57
- `.opencode/.skills-opencode` for a project.
58
- Project assets are limited to the current working directory. Scope is required;
59
- the installer never changes `opencode.json`, overwrites unknown or modified
60
- files, or records ownership manifests before confirmed apply. The short preview
61
- reports changed paths, conflicts, restart status, digest, and its confirm command.
55
+ ## Select Assets
62
56
 
63
- ## Read-only Doctor
57
+ In a TTY, `install` opens four selection groups: Skill command adapters, Package
58
+ command adapters, Fixed agents, and Selectable plugins. The two command groups
59
+ and six fixed agents start selected; optional plugins start unselected. Skill
60
+ command adapters are OpenCode slash commands that load an already-installed
61
+ same-named portable skill. Package command adapters invoke package tools. A
62
+ command adapter selection never selects or installs a skill.
64
63
 
65
- `doctor` reports facts without writing:
64
+ Outside a TTY, pass all three selection groups. This example selects three
65
+ commands, all fixed agents, and no wrapper:
66
66
 
67
67
  ```shell
68
- npm exec -- skills-opencode doctor --scope project
69
- npm exec -- skills-opencode doctor --scope global --json
68
+ npm exec -- skills-opencode install --scope project \
69
+ --commands doctor,reconcile,agent-profiles \
70
+ --agents manager,architect,mapper,worker,review,critic \
71
+ --plugins none --dry-run
70
72
  ```
71
73
 
72
- It never creates lifecycle state, consumes receipts, recovers journals, starts
73
- plugins, or starts LSP servers. Its versioned JSON report contains stable check
74
- IDs, catalog and installed-manifest versions, ownership/drift/collision classes,
75
- inventory findings, runtime summaries, redacted configuration projections, and
76
- LSP facts. It never serializes secrets, raw configuration, environment values,
77
- receipts, or credentials. Exit status `0` is clean, `1` reports findings, and
78
- `2` means invalid input or an incomplete probe failure.
79
-
80
- ## Reconcile Retired Assets
81
-
82
- `reconcile` previews retirement and preserves conflicts:
74
+ If any selection flag is present outside a TTY, `--commands`, `--agents`, and
75
+ `--plugins` are all required. Query exact current names with:
83
76
 
84
77
  ```shell
85
- npm exec -- skills-opencode reconcile --scope project --dry-run
86
- npm exec -- skills-opencode reconcile --scope project --confirm <digest>
87
- npm exec -- skills-opencode reconcile --scope global --dry-run --json
78
+ npm exec -- skills-opencode capabilities --json
88
79
  ```
89
80
 
90
- It considers only public portable skills, package commands, plugins, agents, and
91
- installation metadata for the selected scope. Retired exact-owned files move to
92
- a private content-addressed XDG archive with an index, never disappear.
93
- Modified-managed, user-owned, unknown, symlink, unsafe-path, worktree, and
94
- ambiguous-source entries remain byte-for-byte conflicts. The journaled target and
95
- archive transaction provides rollback, recovery, and repeatable no-op operation.
96
- Doctor reports archive entries and conflicts read-only.
81
+ The selectable wrappers are `rules-injector`, `rtk`, and `zed-bell`.
82
+
83
+ ## Activate the Core Plugin
97
84
 
98
- Add the plugin manually:
85
+ The installer records whether the selection needs core integration, but never
86
+ creates or edits `opencode.json`. Add the package to the user-owned `plugin`
87
+ array for the same scope while preserving existing entries:
99
88
 
100
89
  ```json
101
90
  {
@@ -104,104 +93,138 @@ Add the plugin manually:
104
93
  }
105
94
  ```
106
95
 
107
- ## Manage Agents
96
+ For project scope, keep the package in project `node_modules` and configuration
97
+ in the project. For global scope, keep the npm project and user configuration
98
+ under `~/.config/opencode`. Restart OpenCode after activation or asset changes.
108
99
 
109
- The direct CLI manages models without LLM calls:
100
+ ## Preview and Confirm
101
+
102
+ Every mutation begins with `--dry-run`. The preview reports operations,
103
+ conflicts, restart requirements, receipt expiry, separate plan and confirmation
104
+ digests, and the exact confirmation command. If reconcile reports modified
105
+ managed files or ownership conflicts, it is blocked: no receipt or Apply command
106
+ is issued. Install or upgrade the current package first, apply its exact
107
+ installer confirmation, then repeat reconcile; resolve ownership conflicts
108
+ manually.
110
109
 
111
110
  ```shell
112
- npm exec -- skills-opencode agent list --scope global
113
- npm exec -- skills-opencode agent configure manager --scope global --dry-run
114
- npm exec -- skills-opencode agent model-set worker --scope global \
115
- --model openai/gpt-5 --variant high --dry-run
116
- npm exec -- skills-opencode agent reconcile --scope global --dry-run
111
+ npm exec -- skills-opencode install --scope project --dry-run
117
112
  ```
118
113
 
119
- Fixed roles preserve their names and canonical prompts and permissions; only
120
- model and variant change. The interactive configuration wizard selects an agent,
121
- provider, its models, and published variants, showing the current target and
122
- offering keep, change, clear variant, back, and cancel. It does not invoke an
123
- LLM, OpenCode Question, or catalog refresh. If the catalog is unavailable it
124
- does not write and prints the exact model instruction.
114
+ The mandatory OpenCode flow is: persistent npm install, `install --dry-run`, the
115
+ exact confirmation command printed by that preview, add the package to the
116
+ user-owned `plugin` entry, and restart OpenCode. Use the persistent npm project
117
+ at `~/.config/opencode` for global commands. Install or upgrade the package and
118
+ apply its installer plan before every reconcile.
125
119
 
126
- When the catalog is unavailable, use exact `--model <provider/model>` and an
127
- optional `--variant`; `provider/model` identifies the selected model. The
128
- optional `agent_profiles` tool and slash commands adapt the same direct-CLI
129
- plan/apply contract.
120
+ The preview has a deterministic `plan_digest` and a unique
121
+ `confirmation_digest`. A later dry-run in the same scope supersedes any older
122
+ unconsumed preview, including previews from another package or agent operation;
123
+ the older confirmation is rejected.
130
124
 
131
- ```shell
132
- npm exec -- skills-opencode critic add security --scope global \
133
- --model anthropic/claude-sonnet-4-6 --dry-run
134
- npm exec -- skills-opencode critic remove security --scope global --dry-run
135
- ```
125
+ Run the command printed by the preview, including all selection flags. Receipts
126
+ are private, valid for 10 minutes, single-use, and bound to the action, scope,
127
+ root, and current inventory. Apply rejects stale state and unsafe conflicts.
136
128
 
137
- Additional critics use `critic-<safe-suffix>`; fixed roles and the standard
138
- critic cannot be renamed or removed. Every mutation uses a one-time private
139
- receipt valid for 10 minutes, a lifecycle lock, inventory recheck, journaled
140
- all-or-rollback transaction, and final validation. Interrupted mutations recover
141
- before requiring a fresh plan. Global profile configuration and its semantic
142
- deployment manifest are kept together; project scope keeps corresponding files
143
- under its `.opencode` directory. Package updates do not reset selected models,
144
- variants, or additional critics.
129
+ ## Doctor
145
130
 
146
- ## Upgrade and Uninstall
131
+ `doctor` reads integration facts without creating receipts, recovering journals,
132
+ starting plugins, or starting LSP servers:
147
133
 
148
134
  ```shell
149
- npm exec -- skills-opencode uninstall --scope global --dry-run
150
- npm exec -- skills-opencode uninstall --scope global --confirm <digest>
135
+ npm exec -- skills-opencode doctor --scope project
136
+ npm exec -- skills-opencode doctor --scope project --json
151
137
  ```
152
138
 
153
- The full JSON install preview is:
139
+ The report includes versions, ownership, drift, collisions, archive counts,
140
+ redacted configuration projections, runtime summaries, and LSP facts. It does
141
+ not serialize raw configuration, environment values, receipts, credentials, or
142
+ secrets. Exit status `0` is clean, `1` reports findings, and `2` reports invalid
143
+ input or an incomplete probe failure.
144
+
145
+ ## Update
146
+
147
+ From the npm project that owns the dependency, install the exact intended
148
+ version, preview and confirm `install` with the same scope and desired selection,
149
+ then restart OpenCode:
154
150
 
155
151
  ```shell
156
- npm exec -- skills-opencode install --scope global --dry-run --json
152
+ npm install --save-exact @kisev/skills-opencode@2.0.4
153
+ npm exec -- skills-opencode install --scope project --dry-run
157
154
  ```
158
155
 
159
- On upgrade, the installer updates only managed files whose SHA-256 still matches.
160
- The one-time `1.0.0` migration transfers the six fixed-agent ownership records
161
- only when package/version, manifest records, and every file hash match exactly.
162
- Uninstall removes only unchanged manifest-owned files; modified files remain
163
- conflicts and profile configuration is retained for a later installation.
156
+ Use the complete confirmation command printed by the preview. The installer
157
+ updates only files whose recorded ownership and SHA-256 still match. User-owned
158
+ or modified managed files remain conflicts. Package update does not reset agent
159
+ model choices, variants, additional critics, or retained profile configuration.
164
160
 
165
- ## Runtime Options
161
+ ## Reconcile
166
162
 
167
- Plugins are independent and selectable ones are opt-in.
163
+ `reconcile` classifies current and historical portable skills, package commands,
164
+ plugins, agents, and installation metadata for one scope:
168
165
 
169
166
  ```shell
170
- npm exec -- skills-opencode agent list --scope global --json
167
+ npm exec -- skills-opencode reconcile --scope project --dry-run
168
+ npm exec -- skills-opencode reconcile --scope project --confirm <digest>
169
+ npm exec -- skills-opencode reconcile --scope global --dry-run --json
171
170
  ```
172
171
 
173
- The package exports the core OpenCode plugin and independent factories for
174
- `rules-injector`, `rtk`, and `zed-bell`. Retired plugin APIs and internal lifecycle
175
- implementations are not public. Rules injection fails soft within a bounded
176
- budget; RTK fails open.
172
+ Before reconcile, first update the package in its owning npm project and apply
173
+ the exact installer plan. Reconcile does not install, update, or remove portable
174
+ skills; use only the pinned `npx --yes skills@1.5.23` flow for those skills.
177
175
 
178
- ## Stage 18 Routing
176
+ Confirmed reconcile archives exact-owned retired assets in a private
177
+ content-addressed XDG archive and removes their deployed copies. Modified,
178
+ user-owned, unknown, symlink, unsafe, or ambiguous entries remain unchanged as
179
+ findings or conflicts. Worktrees and runtime state are preserved. The archive is
180
+ inspectable through `doctor`; no archive restore or purge command is provided.
179
181
 
180
- `doit` owns the complete evidence -> plan -> confirmation -> execution -> checks
181
- -> report lifecycle; `manager` only adapts it to OpenCode. The route tool has four
182
- destinations: exploration to `mapper`, architecture to `architect`, implementation
183
- to `worker`, and review to `review` or one selected `critic`. Documentation and
184
- quick work remain in `doit`.
182
+ ## Manage Agents
185
183
 
186
- The route inventory comes only from resolved host configuration. Callers cannot
187
- inject agents, capabilities, tools, models, or availability. Versioned receipts,
188
- cards, and mapper/worker/review/critic reports are checked at real Task dispatch
189
- and result hooks. Cards bind paths, checks, explicit VCS operations, and separate
190
- execution, publication, and history-rewrite confirmations.
184
+ The direct CLI manages fixed-agent models and additional critics without an LLM
185
+ call:
191
186
 
192
- ## Boundaries
187
+ ```shell
188
+ npm exec -- skills-opencode agent list --scope global
189
+ npm exec -- skills-opencode agent configure manager --scope global --dry-run
190
+ npm exec -- skills-opencode agent model-set worker --scope global --model openai/gpt-5 --variant high --dry-run
191
+ npm exec -- skills-opencode critic add security --scope global --model anthropic/claude-sonnet-4-6 --dry-run
192
+ npm exec -- skills-opencode agent reconcile --scope global --dry-run
193
+ ```
194
+
195
+ Fixed roles keep their names, prompts, and permissions; only model and variant
196
+ change. Additional critics use `critic-<safe-suffix>`. Every mutation uses the
197
+ same preview and one-time confirmation contract.
193
198
 
194
- Portable skills and package assets install independently.
199
+ ## Uninstall
200
+
201
+ Keep the package resolvable until its assets are removed:
202
+
203
+ 1. Preview and confirm package-owned asset removal.
204
+ 2. Remove `@kisev/skills-opencode` from the user-owned `plugin` array.
205
+ 3. Uninstall the dependency from the same npm project.
206
+ 4. Restart OpenCode.
195
207
 
196
208
  ```shell
197
- npm exec -- skills-opencode install --scope project --dry-run
198
- npm exec -- skills-opencode install --scope project --confirm <digest>
209
+ npm exec -- skills-opencode uninstall --scope project --dry-run
210
+ npm exec -- skills-opencode uninstall --scope project --confirm <digest>
211
+ npm uninstall @kisev/skills-opencode
199
212
  ```
200
213
 
201
- Commands are thin adapters that pass untrusted arguments to the native Skill
202
- tool; validation, confirmation, batch/review rules, and result format remain the
203
- skill or runner responsibility. `capabilities`, `route`, and `doctor` are package
204
- tools and commands for catalog, routing, and health. `agent_profiles` and the
205
- four agent slash commands are optional UX adapters, not a separate skill.
214
+ For global scope, run the same flow from `~/.config/opencode` with
215
+ `--scope global`. Uninstall archives exact manifest-owned assets and preserves
216
+ modified files as conflicts, along with worktrees, runtime state, and retained
217
+ profile configuration. It does not remove portable skills or edit
218
+ `opencode.json`. No archive restore or purge command is provided.
219
+
220
+ ## Boundaries
206
221
 
207
- The package is MIT-licensed; the repository root README has full instructions.
222
+ - Portable skills and package assets install, update, and uninstall independently.
223
+ - Commands corresponding to skills are thin adapters; the portable skill remains
224
+ authoritative and must be installed separately.
225
+ - Package tools are `capabilities`, `route`, `doctor`, `agent_profiles`, and
226
+ `reconcile`; `route` has no slash command.
227
+ - The installer owns only files proved by manifests and exact hashes.
228
+ - The package is MIT-licensed. Current inventory and checks are in
229
+ [Migration Inventory](../../docs/migration-inventory.md) and
230
+ [Verification](../../docs/verification.md).