@kisev/skills-opencode 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -112
- package/README.ru.md +242 -0
- package/dist/agent-profiles.d.ts +1 -1
- package/dist/agent-profiles.js +18 -9
- package/dist/assets/agents/architect.md +67 -0
- package/{assets → dist/assets}/agents/critic.md +17 -2
- package/dist/assets/agents/manager.md +36 -0
- package/{assets → dist/assets}/agents/mapper.md +2 -2
- package/dist/assets/agents/review.md +25 -0
- package/{assets → dist/assets}/agents/worker.md +7 -5
- package/dist/assets/commands/agent-profiles.md +9 -0
- package/dist/assets/commands/agents-md.md +10 -0
- package/dist/assets/commands/askme.md +10 -0
- package/dist/assets/commands/ast-grep.md +10 -0
- package/dist/assets/commands/capabilities.md +9 -0
- package/dist/assets/commands/code-explain.md +10 -0
- package/dist/assets/commands/code-review.md +10 -0
- package/dist/assets/commands/commit-msg.md +10 -0
- package/dist/assets/commands/docs-prepare.md +10 -0
- package/dist/assets/commands/docs-review.md +10 -0
- package/dist/assets/commands/doctor.md +9 -0
- package/dist/assets/commands/doit.md +10 -0
- package/dist/assets/commands/goal.md +10 -0
- package/dist/assets/commands/humanize.md +10 -0
- package/dist/assets/commands/lsp-report.md +10 -0
- package/dist/assets/commands/mattermost.md +10 -0
- package/dist/assets/commands/mr-prepare.md +10 -0
- package/dist/assets/commands/reconcile.md +9 -0
- package/dist/assets/commands/release-prepare.md +10 -0
- package/dist/assets/commands/release-review.md +10 -0
- package/dist/assets/commands/rtk.md +10 -0
- package/dist/assets/commands/skill-improve.md +10 -0
- package/dist/assets/commands/slides-prompts-prepare.md +10 -0
- package/dist/assets/commands/spec-manage.md +10 -0
- package/dist/assets/commands/stopit.md +10 -0
- package/dist/assets/commands/summary.md +10 -0
- package/dist/assets/commands/task-prepare.md +10 -0
- package/dist/assets/commands/task-review.md +10 -0
- package/dist/assets/commands/task-triage.md +10 -0
- package/dist/assets/commands/team-retro.md +10 -0
- package/dist/assets/commands/team-roadmap.md +10 -0
- package/dist/assets/commands/team-sprint-close.md +10 -0
- package/dist/assets/commands/team-sprint-start.md +10 -0
- package/dist/assets/lsp-catalog.json +30 -0
- package/dist/assets/migration-inventory.json +294 -0
- package/dist/catalog.d.ts +8 -0
- package/dist/catalog.js +38 -0
- package/dist/cli-output.d.ts +7 -0
- package/dist/cli-output.js +68 -1
- package/dist/cli.js +136 -10
- package/dist/contracts.d.ts +52 -0
- package/dist/contracts.js +98 -0
- package/dist/doctor.d.ts +44 -0
- package/dist/doctor.js +595 -0
- package/dist/generate-assets.js +17 -2
- package/dist/index.d.ts +80 -56
- package/dist/index.js +162 -37
- package/dist/installer.d.ts +33 -5
- package/dist/installer.js +252 -28
- package/dist/lifecycle.d.ts +3 -0
- package/dist/lifecycle.js +49 -17
- package/dist/plugins/rtk.js +4 -1
- package/dist/reconcile.d.ts +43 -0
- package/dist/reconcile.js +507 -0
- package/dist/registry.d.ts +7 -4
- package/dist/registry.js +28 -88
- package/dist/routing.d.ts +39 -2
- package/dist/routing.js +339 -27
- package/dist/runtime/worktree.d.ts +33 -0
- package/dist/runtime/worktree.js +220 -0
- package/package.json +10 -26
- package/assets/agents/architect.md +0 -33
- package/assets/agents/manager.md +0 -82
- package/assets/agents/review.md +0 -25
- package/assets/commands/agent-list.md +0 -9
- package/assets/commands/agent-model-set.md +0 -9
- package/assets/commands/askme.md +0 -10
- package/assets/commands/ast-grep-rewrite.md +0 -10
- package/assets/commands/ast-grep-search.md +0 -10
- package/assets/commands/attempt-cancel.md +0 -10
- package/assets/commands/attempt-list.md +0 -10
- package/assets/commands/attempt-result.md +0 -10
- package/assets/commands/attempt-show.md +0 -10
- package/assets/commands/capabilities.md +0 -9
- package/assets/commands/code-review.md +0 -10
- package/assets/commands/commit-msg.md +0 -10
- package/assets/commands/critic-add.md +0 -9
- package/assets/commands/critic-remove.md +0 -9
- package/assets/commands/docs-prepare.md +0 -10
- package/assets/commands/docs-review.md +0 -10
- package/assets/commands/doctor.md +0 -9
- package/assets/commands/doit.md +0 -10
- package/assets/commands/goal-list.md +0 -10
- package/assets/commands/goal-pause.md +0 -10
- package/assets/commands/goal-prepare.md +0 -10
- package/assets/commands/goal-remove.md +0 -10
- package/assets/commands/goal-show.md +0 -10
- package/assets/commands/goal-start.md +0 -10
- package/assets/commands/lsp-report.md +0 -10
- package/assets/commands/mattermost.md +0 -10
- package/assets/commands/mr-prepare.md +0 -10
- package/assets/commands/mr-review.md +0 -10
- package/assets/commands/multi-run-cancel.md +0 -10
- package/assets/commands/multi-run-compare.md +0 -10
- package/assets/commands/multi-run-fusion.md +0 -10
- package/assets/commands/multi-run-start.md +0 -10
- package/assets/commands/multi-run-status.md +0 -10
- package/assets/commands/overview.md +0 -10
- package/assets/commands/release-prepare.md +0 -10
- package/assets/commands/release-review.md +0 -10
- package/assets/commands/route.md +0 -9
- package/assets/commands/schedule-add.md +0 -10
- package/assets/commands/schedule-disable.md +0 -10
- package/assets/commands/schedule-enable.md +0 -10
- package/assets/commands/schedule-list.md +0 -10
- package/assets/commands/schedule-remove.md +0 -10
- package/assets/commands/schedule-status.md +0 -10
- package/assets/commands/skill-improver.md +0 -10
- package/assets/commands/spec-audit.md +0 -10
- package/assets/commands/spec-init.md +0 -10
- package/assets/commands/spec-onboard.md +0 -10
- package/assets/commands/spec-update.md +0 -10
- package/assets/commands/stopit.md +0 -10
- package/assets/commands/summary.md +0 -10
- package/assets/commands/task-prepare-batch.md +0 -10
- package/assets/commands/task-prepare.md +0 -10
- package/assets/commands/task-review.md +0 -10
- package/assets/commands/task-triage.md +0 -10
- package/assets/commands/team-planning.md +0 -10
- package/assets/commands/team-retro.md +0 -10
- package/assets/commands/team-roadmap.md +0 -10
- package/assets/commands/team-slides-prompts.md +0 -10
- package/assets/commands/team-sprint-close.md +0 -10
- package/assets/commands/team-sprint-status.md +0 -10
- package/assets/commands/walkthrough.md +0 -10
- package/assets/plugins/autonomy-policy.js +0 -3
- package/assets/plugins/background-attempts.js +0 -3
- package/assets/plugins/goal-loop.js +0 -3
- package/assets/plugins/schedule.js +0 -3
- package/assets/plugins/zed-clickable-paths.js +0 -3
- package/dist/plugins/autonomy-policy.d.ts +0 -21
- package/dist/plugins/autonomy-policy.js +0 -71
- package/dist/plugins/background-attempts.d.ts +0 -76
- package/dist/plugins/background-attempts.js +0 -124
- package/dist/plugins/goal-loop.d.ts +0 -62
- package/dist/plugins/goal-loop.js +0 -99
- package/dist/plugins/schedule.d.ts +0 -36
- package/dist/plugins/schedule.js +0 -100
- package/dist/plugins/zed-clickable-paths.d.ts +0 -11
- package/dist/plugins/zed-clickable-paths.js +0 -10
- /package/{assets → dist/assets}/plugins/rtk.js +0 -0
- /package/{assets → dist/assets}/plugins/rules-injector.js +0 -0
- /package/{assets → dist/assets}/plugins/zed-bell.js +0 -0
package/README.md
CHANGED
|
@@ -1,70 +1,101 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OpenCode Integration
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
управлением agent profiles и opt-in installer для agents, commands и plugins. Он
|
|
5
|
-
не включает portable skills и не меняет конфигурацию при import, plugin load или
|
|
6
|
-
npm lifecycle. Package требует Node.js 22+ и OpenCode 1.18.29+.
|
|
3
|
+
[Русский](README.ru.md)
|
|
7
4
|
|
|
8
|
-
|
|
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.
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
## Install Skills
|
|
14
|
+
|
|
15
|
+
Install portable skills first:
|
|
12
16
|
|
|
13
17
|
```shell
|
|
14
18
|
npx --yes skills add kisev/skills --agent opencode --skill '*' --copy --yes
|
|
15
19
|
```
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`
|
|
20
|
-
|
|
21
|
-
`npx skills add` для его установки.
|
|
22
|
-
|
|
23
|
-
## Установка integration
|
|
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.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
## Install Integration
|
|
26
27
|
|
|
27
28
|
```shell
|
|
28
|
-
npm install @kisev/skills-opencode@
|
|
29
|
+
npm install @kisev/skills-opencode@2.0.0
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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`.
|
|
36
|
+
|
|
37
|
+
Preview before any write:
|
|
34
38
|
|
|
35
39
|
```shell
|
|
36
40
|
npm exec -- skills-opencode install --scope global --dry-run
|
|
37
41
|
```
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
Apply the shown digest only:
|
|
40
44
|
|
|
41
45
|
```shell
|
|
42
46
|
npm exec -- skills-opencode install --scope global --confirm <digest>
|
|
43
47
|
```
|
|
44
48
|
|
|
45
|
-
`
|
|
46
|
-
|
|
47
|
-
|
|
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
|
+
|
|
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.
|
|
62
|
+
|
|
63
|
+
## Read-only Doctor
|
|
64
|
+
|
|
65
|
+
`doctor` reports facts without writing:
|
|
48
66
|
|
|
49
67
|
```shell
|
|
50
|
-
npm exec -- skills-opencode
|
|
51
|
-
npm exec -- skills-opencode
|
|
68
|
+
npm exec -- skills-opencode doctor --scope project
|
|
69
|
+
npm exec -- skills-opencode doctor --scope global --json
|
|
52
70
|
```
|
|
53
71
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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.
|
|
58
79
|
|
|
59
|
-
|
|
60
|
-
|
|
80
|
+
## Reconcile Retired Assets
|
|
81
|
+
|
|
82
|
+
`reconcile` previews retirement and preserves conflicts:
|
|
61
83
|
|
|
62
84
|
```shell
|
|
63
|
-
npm exec -- skills-opencode
|
|
64
|
-
npm exec -- skills-opencode
|
|
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
|
|
65
88
|
```
|
|
66
89
|
|
|
67
|
-
|
|
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.
|
|
97
|
+
|
|
98
|
+
Add the plugin manually:
|
|
68
99
|
|
|
69
100
|
```json
|
|
70
101
|
{
|
|
@@ -73,15 +104,9 @@ npm exec -- skills-opencode agent list --scope global --json
|
|
|
73
104
|
}
|
|
74
105
|
```
|
|
75
106
|
|
|
76
|
-
|
|
77
|
-
agents и commands строится до plugin hooks.
|
|
107
|
+
## Manage Agents
|
|
78
108
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Рекомендуемый интерфейс - прямой terminal CLI: он не вызывает LLM и не расходует
|
|
82
|
-
токены. Fixed roles `manager`, `architect`, `mapper`, `worker`, `review` и
|
|
83
|
-
стандартный `critic` всегда сохраняют имена и canonical prompts/permissions.
|
|
84
|
-
Меняются только `model` и `variant`:
|
|
109
|
+
The direct CLI manages models without LLM calls:
|
|
85
110
|
|
|
86
111
|
```shell
|
|
87
112
|
npm exec -- skills-opencode agent list --scope global
|
|
@@ -91,17 +116,17 @@ npm exec -- skills-opencode agent model-set worker --scope global \
|
|
|
91
116
|
npm exec -- skills-opencode agent reconcile --scope global --dry-run
|
|
92
117
|
```
|
|
93
118
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
`--model <provider/model>` с optional `--variant`. Для модели без variants
|
|
101
|
-
дополнительный selector не показывается.
|
|
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.
|
|
102
125
|
|
|
103
|
-
|
|
104
|
-
|
|
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.
|
|
105
130
|
|
|
106
131
|
```shell
|
|
107
132
|
npm exec -- skills-opencode critic add security --scope global \
|
|
@@ -109,77 +134,74 @@ npm exec -- skills-opencode critic add security --scope global \
|
|
|
109
134
|
npm exec -- skills-opencode critic remove security --scope global --dry-run
|
|
110
135
|
```
|
|
111
136
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
находятся под `.opencode/.skills-opencode/`. Configuration хранит выбранные
|
|
123
|
-
model/variant и additional critics; package update её не сбрасывает. Manifest
|
|
124
|
-
хранит package version, exact critic pool и hashes canonical configuration и
|
|
125
|
-
rendered files.
|
|
126
|
-
|
|
127
|
-
Inventory различает `package-owned`, `managed`, `user-owned`, `drift` и exact-name
|
|
128
|
-
`collision`. User-owned и неизвестные agents не изменяются. Collision блокирует
|
|
129
|
-
apply; drift исправляется только явным `agent reconcile`. Все mutations проходят
|
|
130
|
-
под lifecycle lock, повторно проверяют inventory, используют journaled
|
|
131
|
-
all-or-rollback transaction и выполняют final validation. После прерывания
|
|
132
|
-
следующая mutation безопасно восстанавливает before-images и требует свежий plan.
|
|
133
|
-
|
|
134
|
-
## Upgrade и uninstall
|
|
135
|
-
|
|
136
|
-
После обновления npm package снова выполните dry-run и подтвердите новый digest.
|
|
137
|
-
Installer обновляет только files с совпадающим managed SHA-256.
|
|
138
|
-
|
|
139
|
-
При первом upgrade с `1.0.0` installer передаёт ownership шести fixed agents из
|
|
140
|
-
generic manifest в profile domain только при точном совпадении package/version,
|
|
141
|
-
manifest records и SHA-256 каждого файла. Любое отличие остаётся конфликтом.
|
|
142
|
-
Commands и plugins продолжают принадлежать generic installer. Uninstall удаляет
|
|
143
|
-
неизменённые deployments, но сохраняет profile configuration для последующей
|
|
144
|
-
установки.
|
|
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.
|
|
145
|
+
|
|
146
|
+
## Upgrade and Uninstall
|
|
145
147
|
|
|
146
148
|
```shell
|
|
147
149
|
npm exec -- skills-opencode uninstall --scope global --dry-run
|
|
148
150
|
npm exec -- skills-opencode uninstall --scope global --confirm <digest>
|
|
149
151
|
```
|
|
150
152
|
|
|
151
|
-
|
|
152
|
-
изменился. Изменённые пользователем files остаются как `conflict`.
|
|
153
|
+
The full JSON install preview is:
|
|
153
154
|
|
|
154
|
-
|
|
155
|
+
```shell
|
|
156
|
+
npm exec -- skills-opencode install --scope global --dry-run --json
|
|
157
|
+
```
|
|
155
158
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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.
|
|
161
164
|
|
|
162
|
-
|
|
163
|
-
import goalLoop from "@kisev/skills-opencode/plugins/goal-loop";
|
|
165
|
+
## Runtime Options
|
|
164
166
|
|
|
165
|
-
|
|
167
|
+
Plugins are independent and selectable ones are opt-in.
|
|
168
|
+
|
|
169
|
+
```shell
|
|
170
|
+
npm exec -- skills-opencode agent list --scope global --json
|
|
166
171
|
```
|
|
167
172
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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.
|
|
177
|
+
|
|
178
|
+
## Stage 18 Routing
|
|
179
|
+
|
|
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`.
|
|
171
185
|
|
|
172
|
-
|
|
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.
|
|
191
|
+
|
|
192
|
+
## Boundaries
|
|
193
|
+
|
|
194
|
+
Portable skills and package assets install independently.
|
|
195
|
+
|
|
196
|
+
```shell
|
|
197
|
+
npm exec -- skills-opencode install --scope project --dry-run
|
|
198
|
+
npm exec -- skills-opencode install --scope project --confirm <digest>
|
|
199
|
+
```
|
|
173
200
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
`capabilities`, `route` и `doctor` - package tools/commands для catalog, routing и
|
|
180
|
-
health. Tool `agent_profiles` и четыре slash-команды `agent-list`,
|
|
181
|
-
`agent-model-set`, `critic-add`, `critic-remove` - optional thin UX над теми же
|
|
182
|
-
plan/apply contracts. Отдельного skill `agent-profiles` нет.
|
|
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.
|
|
183
206
|
|
|
184
|
-
|
|
185
|
-
upgrade и security boundaries находятся в корневом README репозитория.
|
|
207
|
+
The package is MIT-licensed; the repository root README has full instructions.
|
package/README.ru.md
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Интеграция OpenCode
|
|
2
|
+
|
|
3
|
+
[English](README.md) | [Русский](README.ru.md)
|
|
4
|
+
|
|
5
|
+
`@kisev/skills-opencode` - npm package с capability router, OpenCode runtime,
|
|
6
|
+
управлением agent profiles и opt-in installer для agents, commands и plugins. Он
|
|
7
|
+
не включает portable skills и не меняет конфигурацию при import, plugin load или
|
|
8
|
+
npm lifecycle. Package требует Node.js 22+ и OpenCode 1.18.29+.
|
|
9
|
+
|
|
10
|
+
## Установка skills
|
|
11
|
+
|
|
12
|
+
Сначала установите нужные portable skills через `npx skills` из публичного
|
|
13
|
+
репозитория:
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
npx --yes skills add kisev/skills --agent opencode --skill '*' --copy --yes
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Для одного skill укажите `--skill <name>`. Для воспроизводимой установки можно
|
|
20
|
+
передать URL GitHub tag, например
|
|
21
|
+
`https://github.com/kisev/skills/tree/v2.0.0`. Package никогда не устанавливает
|
|
22
|
+
и не обновляет skills. Если команда не нашла skill, она сообщает точную команду
|
|
23
|
+
`npx skills add` для его установки.
|
|
24
|
+
|
|
25
|
+
## Установка integration
|
|
26
|
+
|
|
27
|
+
Установите npm package там, где OpenCode сможет разрешить plugin:
|
|
28
|
+
|
|
29
|
+
```shell
|
|
30
|
+
npm install @kisev/skills-opencode@2.0.0
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Interactive selection доступен только в TTY. В non-TTY install нужно явно передать
|
|
34
|
+
`--commands`, `--agents` и `--plugins`; selectable plugins по умолчанию пусты.
|
|
35
|
+
Wizard показывает skill commands, package commands, fixed agents и
|
|
36
|
+
`rules-injector`, `rtk`, `zed-bell`. Сначала покажите план installer. CLI выводит короткую сводку:
|
|
37
|
+
счётчики по группам, только изменяемые paths, conflicts, restart flag, digest и
|
|
38
|
+
готовую confirm-команду. Эта команда не меняет deployment:
|
|
39
|
+
|
|
40
|
+
```shell
|
|
41
|
+
npm exec -- skills-opencode install --scope global --dry-run
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Проверьте сводку и примените только показанный digest:
|
|
45
|
+
|
|
46
|
+
```shell
|
|
47
|
+
npm exec -- skills-opencode install --scope global --confirm <digest>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`global` устанавливает assets в `~/.config/opencode/agents`,
|
|
51
|
+
`~/.config/opencode/commands` и `~/.config/opencode/plugins`. Для текущего
|
|
52
|
+
repository используйте `project`:
|
|
53
|
+
|
|
54
|
+
```shell
|
|
55
|
+
npm exec -- skills-opencode install --scope project --dry-run
|
|
56
|
+
npm exec -- skills-opencode install --scope project --confirm <digest>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Project assets находятся в `.opencode/agents`, `.opencode/commands` и
|
|
60
|
+
`.opencode/plugins` текущего working directory. Scope обязателен. Installer не изменяет `opencode.json`, не
|
|
61
|
+
перезаписывает неизвестные или изменённые files и сохраняет ownership manifests
|
|
62
|
+
только после confirmed apply.
|
|
63
|
+
|
|
64
|
+
Для automation добавьте `--json`. Этот режим сохраняет полный стабильный
|
|
65
|
+
machine-readable plan, включая `operations` и `requires_restart`:
|
|
66
|
+
|
|
67
|
+
```shell
|
|
68
|
+
npm exec -- skills-opencode install --scope global --dry-run --json
|
|
69
|
+
npm exec -- skills-opencode agent list --scope global --json
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Read-only doctor
|
|
73
|
+
|
|
74
|
+
`doctor` is a read-only installer health report. It never creates lifecycle
|
|
75
|
+
state, consumes receipts, recovers journals, starts plugins or starts LSP
|
|
76
|
+
servers. `project` and `global` are isolated scopes; unavailable OpenCode host
|
|
77
|
+
facts are reported as incomplete rather than inferred.
|
|
78
|
+
|
|
79
|
+
```shell
|
|
80
|
+
npm exec -- skills-opencode doctor --scope project
|
|
81
|
+
npm exec -- skills-opencode doctor --scope global --json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The JSON report is versioned and contains stable check IDs, package/catalog and
|
|
85
|
+
installed-manifest versions, ownership/drift/collision classifications, stage-8
|
|
86
|
+
inventory findings, lifecycle/runtime state summaries, redacted config
|
|
87
|
+
projections and LSP facts. Secrets, raw config, environment values, receipts
|
|
88
|
+
and credentials are never serialized. Exit code `0` is clean, `1` reports
|
|
89
|
+
findings, and `2` means invalid input or an incomplete probe failure.
|
|
90
|
+
|
|
91
|
+
## Reconcile retired assets
|
|
92
|
+
|
|
93
|
+
`reconcile` проверяет только public portable skills, package commands, plugins,
|
|
94
|
+
agents и installation metadata выбранного scope. XDG runtime state не читается и
|
|
95
|
+
не изменяется. Preview сохраняет private receipt с TTL и печатает digest:
|
|
96
|
+
|
|
97
|
+
```shell
|
|
98
|
+
npm exec -- skills-opencode reconcile --scope project --dry-run
|
|
99
|
+
npm exec -- skills-opencode reconcile --scope project --confirm <digest>
|
|
100
|
+
npm exec -- skills-opencode reconcile --scope global --dry-run --json
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Retired files с доказанным inventory ownership и exact SHA-256 перемещаются в
|
|
104
|
+
private content-addressed XDG archive с index, а не удаляются. Modified-managed,
|
|
105
|
+
user-owned, unknown, symlink, unsafe-path, worktree и ambiguous-source entries
|
|
106
|
+
остаются conflicts без изменения bytes. Journal target и archive обеспечивает
|
|
107
|
+
rollback, recovery и повторный no-op reconcile. Doctor показывает archive и
|
|
108
|
+
conflicts read-only.
|
|
109
|
+
|
|
110
|
+
Добавьте plugin в `opencode.json` вручную:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"$schema": "https://opencode.ai/config.json",
|
|
115
|
+
"plugin": ["@kisev/skills-opencode"]
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Полностью перезапустите OpenCode после install, upgrade или uninstall: registry
|
|
120
|
+
agents и commands строится до plugin hooks.
|
|
121
|
+
|
|
122
|
+
## Управление agents
|
|
123
|
+
|
|
124
|
+
Рекомендуемый интерфейс - прямой terminal CLI: он не вызывает LLM и не расходует
|
|
125
|
+
токены. Fixed roles `manager`, `architect`, `mapper`, `worker`, `review` и
|
|
126
|
+
стандартный `critic` всегда сохраняют имена и canonical prompts/permissions.
|
|
127
|
+
Меняются только `model` и `variant`:
|
|
128
|
+
|
|
129
|
+
```shell
|
|
130
|
+
npm exec -- skills-opencode agent list --scope global
|
|
131
|
+
npm exec -- skills-opencode agent configure manager --scope global --dry-run
|
|
132
|
+
npm exec -- skills-opencode agent model-set worker --scope global \
|
|
133
|
+
--model openai/gpt-5 --variant high --dry-run
|
|
134
|
+
npm exec -- skills-opencode agent reconcile --scope global --dry-run
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
`agent configure` предлагает настоящий terminal wizard: стрелками выбираются
|
|
138
|
+
agent из inventory, затем provider, только его models и, если metadata выбранной
|
|
139
|
+
модели публикует variants, variant. Текущие model/variant и target показываются
|
|
140
|
+
перед выбором; доступны `keep`, `change`, `clear variant`, `back` и `cancel`.
|
|
141
|
+
Wizard не вызывает LLM, OpenCode Question или refresh catalog. Если catalog
|
|
142
|
+
недоступен, он завершается без записи и печатает инструкцию для exact
|
|
143
|
+
`--model <provider/model>` с optional `--variant`. Для модели без variants
|
|
144
|
+
дополнительный selector не показывается.
|
|
145
|
+
|
|
146
|
+
Additional critic имеет имя `critic-<safe-suffix>`. Стандартный `critic` и fixed
|
|
147
|
+
roles нельзя удалить или переименовать:
|
|
148
|
+
|
|
149
|
+
```shell
|
|
150
|
+
npm exec -- skills-opencode critic add security --scope global \
|
|
151
|
+
--model anthropic/claude-sonnet-4-6 --dry-run
|
|
152
|
+
npm exec -- skills-opencode critic remove security --scope global --dry-run
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Для любой mutation используйте готовую confirm-команду из preview либо замените
|
|
156
|
+
`--dry-run` на `--confirm <digest>` и повторите те же аргументы. Человекочитаемый
|
|
157
|
+
plan не печатает полный JSON и сворачивает длинные группы paths. Digest связан с
|
|
158
|
+
одноразовым private receipt, действует 10 минут и повторно не применяется. Для
|
|
159
|
+
machine-readable result добавьте `--json`; поле `requires_restart` сообщает о
|
|
160
|
+
необходимости полностью перезапустить OpenCode.
|
|
161
|
+
|
|
162
|
+
В global scope profile configuration хранится в
|
|
163
|
+
`~/.config/opencode/.skills-opencode/agent-profiles.json`, а semantic deployment
|
|
164
|
+
manifest - рядом в `agent-profiles.manifest.json`. Для project scope те же файлы
|
|
165
|
+
находятся под `.opencode/.skills-opencode/`. Configuration хранит выбранные
|
|
166
|
+
model/variant и additional critics; package update её не сбрасывает. Manifest
|
|
167
|
+
хранит package version, exact critic pool и hashes canonical configuration и
|
|
168
|
+
rendered files.
|
|
169
|
+
|
|
170
|
+
Inventory различает `package-owned`, `managed`, `user-owned`, `drift` и exact-name
|
|
171
|
+
`collision`. User-owned и неизвестные agents не изменяются. Collision блокирует
|
|
172
|
+
apply; drift исправляется только явным `agent reconcile`. Все mutations проходят
|
|
173
|
+
под lifecycle lock, повторно проверяют inventory, используют journaled
|
|
174
|
+
all-or-rollback transaction и выполняют final validation. После прерывания
|
|
175
|
+
следующая mutation безопасно восстанавливает before-images и требует свежий plan.
|
|
176
|
+
|
|
177
|
+
## Upgrade и uninstall
|
|
178
|
+
|
|
179
|
+
После обновления npm package снова выполните dry-run и подтвердите новый digest.
|
|
180
|
+
Installer обновляет только files с совпадающим managed SHA-256.
|
|
181
|
+
|
|
182
|
+
При первом upgrade с `1.0.0` installer передаёт ownership шести fixed agents из
|
|
183
|
+
generic manifest в profile domain только при точном совпадении package/version,
|
|
184
|
+
manifest records и SHA-256 каждого файла. Любое отличие остаётся конфликтом.
|
|
185
|
+
Commands и plugins продолжают принадлежать generic installer. Uninstall удаляет
|
|
186
|
+
неизменённые deployments, но сохраняет profile configuration для последующей
|
|
187
|
+
установки.
|
|
188
|
+
|
|
189
|
+
```shell
|
|
190
|
+
npm exec -- skills-opencode uninstall --scope global --dry-run
|
|
191
|
+
npm exec -- skills-opencode uninstall --scope global --confirm <digest>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Uninstall удаляет только files из ownership manifest, если их SHA-256 не
|
|
195
|
+
изменился. Изменённые пользователем files остаются как `conflict`.
|
|
196
|
+
|
|
197
|
+
## Runtime options
|
|
198
|
+
|
|
199
|
+
Package экспортирует core OpenCode plugin и independent plugin factories
|
|
200
|
+
`rules-injector`, `rtk`, `zed-bell`. Retired plugin APIs и internal lifecycle
|
|
201
|
+
implementations public surface не входят:
|
|
202
|
+
|
|
203
|
+
Background Attempts создают workspace только через единый managed worktree
|
|
204
|
+
owner. Records используют private current-only state, marker и repository
|
|
205
|
+
fingerprint; release перепроверяет регистрацию, fingerprint и чистый status и
|
|
206
|
+
возвращает `blocked` без удаления при расхождении. Scheduler принимает строгий
|
|
207
|
+
five-field cron, не воспроизводит missed slots и пишет receipts `started`,
|
|
208
|
+
`completed`, `failed` или `overrun`.
|
|
209
|
+
|
|
210
|
+
`rules-injector` fail-soft применяет ограниченный budget и пропускает native
|
|
211
|
+
project/global rules. `rtk` fail-open сжимает большой bash output и добавляет
|
|
212
|
+
подсказку для edit error, но не содержит ownership guard.
|
|
213
|
+
|
|
214
|
+
## Routing этапа 18
|
|
215
|
+
|
|
216
|
+
`doit` владеет полным lifecycle evidence -> plan -> confirmation -> execution ->
|
|
217
|
+
checks -> report; `manager` только адаптирует его к OpenCode. Tool `route` имеет
|
|
218
|
+
четыре назначения: exploration -> `mapper`, architecture -> `architect`,
|
|
219
|
+
implementation -> `worker`, review -> `review` или один `critic`. Documentation и
|
|
220
|
+
quick остаются у `doit`.
|
|
221
|
+
|
|
222
|
+
Inventory берётся только из resolved host config. Caller не может подменить agents,
|
|
223
|
+
capabilities, tools, models или availability. Versioned receipts, cards и
|
|
224
|
+
mapper/worker/review/critic reports проверяются на реальных Task dispatch/result
|
|
225
|
+
hooks. Card связывает paths, checks, явные VCS operations и отдельные confirmations
|
|
226
|
+
для execution, publication и history rewrite.
|
|
227
|
+
|
|
228
|
+
## Границы
|
|
229
|
+
|
|
230
|
+
Portable skills в корне `skills/` универсальны и устанавливаются только через
|
|
231
|
+
`npx skills`. Этот package поставляет только OpenCode-specific assets и runtime
|
|
232
|
+
router. Команды - тонкие adapters: передают `$ARGUMENTS` как недоверенный ввод
|
|
233
|
+
в native Skill tool, а target validation, confirmation, batch/review rules и
|
|
234
|
+
формат результата остаются ответственностью skill или runner.
|
|
235
|
+
`capabilities`, `route` и `doctor` - package tools/commands для catalog, routing и
|
|
236
|
+
health. Tool `doctor` and direct CLI share one read-only facts API; `/doctor` is
|
|
237
|
+
only a thin adapter. Tool `agent_profiles` и четыре slash-команды `agent-list`,
|
|
238
|
+
`agent-model-set`, `critic-add`, `critic-remove` - optional thin UX над теми же
|
|
239
|
+
plan/apply contracts. Отдельного skill `agent-profiles` нет.
|
|
240
|
+
|
|
241
|
+
Package распространяется по лицензии MIT. Полные инструкции по portable skills,
|
|
242
|
+
upgrade и security boundaries находятся в корневом README репозитория.
|
package/dist/agent-profiles.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ export declare function validateAgentName(name: string): string;
|
|
|
109
109
|
export declare function validateModel(model: string): string;
|
|
110
110
|
export declare function validateVariant(variant: string | null | undefined): string | undefined;
|
|
111
111
|
export declare function renderAgentProfile(name: string, config: AgentProfileConfig, canonical: Record<FixedAgentRole, Buffer>): Buffer;
|
|
112
|
-
export declare function buildAgentProfilePlan(request: AgentProfileRequest, scope: Scope, cwd?: string, home?: string, legacy?: LegacyAgentOwnership): Promise<BuiltPlan>;
|
|
112
|
+
export declare function buildAgentProfilePlan(request: AgentProfileRequest, scope: Scope, cwd?: string, home?: string, legacy?: LegacyAgentOwnership, selectedAgents?: readonly FixedAgentRole[]): Promise<BuiltPlan>;
|
|
113
113
|
export declare function validateBuiltAgentProfilePlan(built: BuiltPlan): Promise<void>;
|
|
114
114
|
export declare function listAgentProfiles(scope: Scope, cwd?: string, home?: string): Promise<AgentInventory>;
|
|
115
115
|
export declare function previewAgentProfileChange(request: AgentProfileRequest, scope: Scope, cwd?: string, home?: string): Promise<AgentProfilePlan>;
|