@wwkit/harness 1.0.33 → 1.0.35
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/LICENSE +21 -21
- package/README.md +128 -128
- package/agents/scrum.md +206 -186
- package/agents/sprint.md +130 -121
- package/bin/index.js +291 -226
- package/commands/fix.md +87 -87
- package/commands/git-sync.md +217 -217
- package/commands/net-port.md +364 -364
- package/commands/pytest.md +10 -10
- package/commands/resume.md +104 -104
- package/commands/tl.md +11 -11
- package/commands/tsl.md +12 -0
- package/package.json +5 -4
- package/plugin.js +19 -19
- package/readme/development.md +39 -39
- package/readme/publish.md +41 -41
- package/readme/testing.md +44 -44
- package/scripts/postinstall.js +58 -58
- package/skills/better-agents/SKILL.md +300 -0
- package/skills/better-agents/references/evidence-map.md +102 -0
- package/skills/better-agents/references/format-spec.md +91 -0
- package/skills/better-agents/references/section-template.md +116 -0
- package/skills/better-skill/SKILL.md +319 -124
- package/skills/better-skill/references/new-mode.md +126 -0
- package/skills/blame-agents/SKILL.md +270 -0
- package/skills/blame-agents/references/check-agents.js +364 -0
- package/skills/blame-agents/references/scoring-rules.md +259 -0
- package/skills/blame-skill/SKILL.md +163 -201
- package/skills/blame-skill/references/scoring-rules.md +190 -0
- package/skills/blame-sprint-agent/SKILL.md +172 -0
- package/skills/blame-sprint-agent/references/scoring-rules.md +113 -0
- package/skills/blame-sprint-skill/SKILL.md +165 -0
- package/skills/blame-sprint-skill/references/scoring-rules.md +101 -0
- package/skills/extract/SKILL.md +119 -119
- package/skills/extract/references/build-xpath.js +30 -30
- package/skills/extract/references/clean-html.js +90 -90
- package/skills/extract/references/detail.md +54 -54
- package/skills/extract/references/detail.schema.json5 +48 -48
- package/skills/extract/references/extract-detail.js +71 -71
- package/skills/extract/references/extract-regex.js +81 -81
- package/skills/extract/references/extract-sample.js +48 -48
- package/skills/extract/references/list-rule-gen.md +109 -109
- package/skills/extract/references/list.md +134 -134
- package/skills/extract/references/list.schema.json5 +33 -33
- package/skills/extract/references/navi.md +44 -44
- package/skills/extract/references/navi.schema.json5 +23 -23
- package/skills/extract/references/text.md +40 -40
- package/skills/extract/references/text.schema.json5 +21 -21
- package/skills/extract/references/to-text.js +20 -20
- package/skills/extract/references/validate-schema.js +39 -39
- package/skills/jstest/SKILL.md +561 -561
- package/skills/jstest/references/case-create.md +327 -327
- package/skills/jstest/references/case-fix.md +273 -273
- package/skills/jstest/references/config.md +148 -148
- package/skills/jstest/references/coverage-analyze.md +247 -247
- package/skills/jstest/references/env-ensure.md +210 -210
- package/skills/jstest/references/execute.md +168 -168
- package/skills/jstest/references/sample.md +166 -166
- package/skills/jstest/references/scoring-rules.md +75 -75
- package/skills/jstest/references/src/jstest-sample/Calculator.js +80 -80
- package/skills/jstest/references/src/jstest-sample/ConfigManager.js +72 -72
- package/skills/jstest/references/src/jstest-sample/FileProcessor.js +57 -57
- package/skills/jstest/references/src/jstest-sample/OrderService.js +98 -98
- package/skills/jstest/references/src/jstest-sample/TokenGenerator.js +60 -60
- package/skills/jstest/references/src/jstest-sample/UserService.js +56 -56
- package/skills/jstest/references/src/jstest-sample/index.js +6 -6
- package/skills/jstest/references/suitability-check.md +232 -232
- package/skills/jstest/references/test-standards.md +288 -288
- package/skills/lint/SKILL.md +440 -440
- package/skills/lint/references/ai-fix.md +137 -137
- package/skills/lint/references/config-setup.md +102 -102
- package/skills/lint/references/config.md +65 -65
- package/skills/lint/references/detect-language.js +65 -65
- package/skills/lint/references/env-ensure.md +88 -88
- package/skills/lint/references/language-detect.md +75 -75
- package/skills/lint/references/languages/js.md +110 -110
- package/skills/lint/references/languages/py.md +89 -89
- package/skills/lint/references/rules-analyze.md +125 -125
- package/skills/lint/references/suitability-check.md +81 -81
- package/skills/lint/references/tool-fix.md +90 -90
- package/skills/pytest/SKILL.md +555 -555
- package/skills/pytest/references/case-create.md +324 -324
- package/skills/pytest/references/case-fix.md +271 -271
- package/skills/pytest/references/config.md +145 -145
- package/skills/pytest/references/coverage-analyze.md +223 -223
- package/skills/pytest/references/env-ensure.md +195 -195
- package/skills/pytest/references/execute.md +152 -152
- package/skills/pytest/references/sample.md +159 -159
- package/skills/pytest/references/scoring-rules.md +57 -57
- package/skills/pytest/references/src/pytest-sample/Calculator.py +67 -67
- package/skills/pytest/references/src/pytest-sample/ConfigManager.py +68 -68
- package/skills/pytest/references/src/pytest-sample/FileProcessor.py +53 -53
- package/skills/pytest/references/src/pytest-sample/OrderService.py +82 -82
- package/skills/pytest/references/src/pytest-sample/TokenGenerator.py +50 -50
- package/skills/pytest/references/src/pytest-sample/UserService.py +45 -45
- package/skills/pytest/references/suitability-check.md +220 -220
- package/skills/pytest/references/test-standards.md +244 -244
- package/skills/query/SKILL.md +71 -71
- package/skills/read-docs/SKILL.md +134 -134
- package/skills/read-docs/references/opencode/agents/cases.md +206 -206
- package/skills/read-docs/references/opencode/agents/design-pattern.md +47 -47
- package/skills/read-docs/references/opencode/agents/detail.md +191 -191
- package/skills/read-docs/references/opencode/agents/examples.md +100 -100
- package/skills/read-docs/references/opencode/agents/index.md +309 -309
- package/skills/read-docs/references/opencode/agents/parallel-dispatch.md +149 -149
- package/skills/read-docs/references/opencode/agents/subagent-internals.md +217 -217
- package/skills/read-docs/references/opencode/agents/workflow.md +161 -161
- package/skills/read-docs/references/opencode/cli/commands/acp.md +31 -31
- package/skills/read-docs/references/opencode/cli/commands/agent.md +16 -16
- package/skills/read-docs/references/opencode/cli/commands/attach.md +20 -20
- package/skills/read-docs/references/opencode/cli/commands/mcp.md +37 -37
- package/skills/read-docs/references/opencode/cli/commands/others.md +48 -48
- package/skills/read-docs/references/opencode/cli/commands/plugin.md +12 -12
- package/skills/read-docs/references/opencode/cli/commands/provider.md +43 -43
- package/skills/read-docs/references/opencode/cli/commands/run.md +81 -81
- package/skills/read-docs/references/opencode/cli/commands/serve.md +84 -84
- package/skills/read-docs/references/opencode/cli/commands/session.md +37 -37
- package/skills/read-docs/references/opencode/cli/commands/web.md +14 -14
- package/skills/read-docs/references/opencode/cli/env.md +38 -38
- package/skills/read-docs/references/opencode/cli/index.md +18 -18
- package/skills/read-docs/references/opencode/cli/tui.md +35 -35
- package/skills/read-docs/references/opencode/commands/examples.md +42 -42
- package/skills/read-docs/references/opencode/commands/index.md +185 -185
- package/skills/read-docs/references/opencode/config/provider.md +151 -151
- package/skills/read-docs/references/opencode/formatter/index.md +70 -70
- package/skills/read-docs/references/opencode/guide/config.md +419 -419
- package/skills/read-docs/references/opencode/guide/formatters.md +70 -70
- package/skills/read-docs/references/opencode/guide/index.md +37 -37
- package/skills/read-docs/references/opencode/guide/providers.md +31 -31
- package/skills/read-docs/references/opencode/guide/rules.md +63 -63
- package/skills/read-docs/references/opencode/plugins/examples.md +75 -75
- package/skills/read-docs/references/opencode/plugins/index.md +188 -188
- package/skills/read-docs/references/opencode/reference/index.md +118 -118
- package/skills/read-docs/references/opencode/rule/index.md +77 -77
- package/skills/read-docs/references/opencode/skills/detail.md +113 -113
- package/skills/read-docs/references/opencode/skills/examples.md +141 -141
- package/skills/read-docs/references/opencode/skills/index.md +126 -126
- package/skills/read-docs/references/opencode/skills/workflow.md +146 -146
- package/skills/read-docs/references/opencode/tests/agent.md +9 -9
- package/skills/read-docs/references/opencode/tests/config.md +59 -59
- package/skills/read-docs/references/opencode/tests/file.md +11 -11
- package/skills/read-docs/references/opencode/tests/serve.md +17 -17
- package/skills/read-docs/references/opencode/tests/session.md +30 -30
- package/skills/read-docs/references/opencode/tests/web.md +16 -16
- package/skills/read-docs/references/opencode/tools/arguments.md +305 -305
- package/skills/read-docs/references/opencode/tools/context.md +17 -17
- package/skills/read-docs/references/opencode/tools/custom.md +110 -110
- package/skills/read-docs/references/opencode/tools/detail.md +104 -104
- package/skills/read-docs/references/opencode/tools/examples.md +71 -71
- package/skills/read-docs/references/opencode/tools/index.md +56 -56
- package/skills/read-docs/references/opencode/tools/lsp.md +25 -25
- package/skills/read-docs/references/opencode/tools/mcp.md +132 -132
- package/skills/read-docs/references/opencode/train/README.md +134 -134
- package/skills/read-docs/references/opencode/train/agent-basic.md +771 -771
- package/skills/read-docs/references/opencode/train/command-basic.md +667 -667
- package/skills/read-docs/references/opencode/train/config-basic.md +508 -508
- package/skills/read-docs/references/opencode/train/index.md +163 -163
- package/skills/read-docs/references/opencode/train/practice.md +872 -872
- package/skills/read-docs/references/opencode/train/skill-basic.md +607 -607
- package/skills/read-docs/references/opencode/tui/commands/config.md +31 -31
- package/skills/read-docs/references/opencode/tui/commands/editor.md +46 -46
- package/skills/read-docs/references/opencode/tui/commands/index.md +124 -124
- package/skills/read-docs/references/opencode/tui/commands/init.md +4 -4
- package/skills/read-docs/references/opencode/tui/index.md +26 -26
- package/skills/read-docs/references/superpowers/bootstrap.md +107 -107
- package/skills/read-docs/references/superpowers/comparison.md +77 -77
- package/skills/read-docs/references/superpowers/context.md +71 -71
- package/skills/read-docs/references/superpowers/index.md +58 -58
- package/skills/read-docs/references/superpowers/parallel.md +49 -49
- package/skills/read-docs/references/superpowers/sdd.md +183 -183
- package/skills/read-docs/references/superpowers/skills.md +68 -68
- package/skills/read-docs/references/superpowers/workflow.md +83 -83
- package/skills/revise/SKILL.md +121 -121
- package/skills/revise/references/article.md +36 -36
- package/skills/revise/references/article.schema.json5 +40 -40
- package/skills/revise/references/gallery.md +34 -34
- package/skills/revise/references/gallery.schema.json5 +40 -40
- package/skills/revise/references/question.md +32 -32
- package/skills/revise/references/question.schema.json5 +31 -31
- package/skills/revise/references/status.md +31 -31
- package/skills/revise/references/status.schema.json5 +27 -27
- package/skills/revise/references/validate-schema.js +39 -39
- package/skills/step-extract/SKILL.md +205 -0
- package/skills/tsl/SKILL.md +393 -0
- package/skills/tsl/package.json +10 -0
- package/skills/tsl/references/global-review-rules.md +25 -0
- package/skills/tsl/references/prepare-prompt.md +150 -0
- package/skills/tsl/references/terminology-rules.md +93 -0
- package/skills/tsl/references/translation-guide.md +23 -0
- package/skills/tsl/references/translation-prompt.md +115 -0
- package/skills/tsl/references/translation-rules.md +48 -0
- package/skills/tsl/references/verification-rules.md +58 -0
- package/skills/tsl/scripts/check-boundaries.js +140 -0
- package/skills/tsl/scripts/chunk-text.js +144 -0
- package/skills/tsl/scripts/clean-text.js +121 -0
- package/skills/tsl/scripts/cleanup-glossary.js +160 -0
- package/skills/tsl/scripts/extract-pdf.js +94 -0
- package/skills/tsl/scripts/generate-review.js +179 -0
- package/skills/tsl/scripts/merge-result.js +164 -0
- package/skills/tsl/scripts/verify-chunk.js +170 -0
- package/skills/tsl-format/SKILL.md +298 -0
- package/skills/tsl-format/references/format-prompt.md +103 -0
- package/skills/tsl-format/references/format-rules.md +58 -0
- package/skills/tsl-format/scripts/chunk-bilingual.js +96 -0
- package/skills/tsl-format/scripts/merge-format.js +105 -0
- package/src/config.js +29 -29
- package/src/config.json5 +19 -19
- package/skills/new-skill/SKILL.md +0 -227
- package/skills/new-skill/references/template.md +0 -53
- package/skills/new-skill/references/workflow-patterns.md +0 -104
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
# configure
|
|
2
|
-
Customize TUI behavior through `tui.json` (or `tui.jsonc`).
|
|
3
|
-
- This is separate from `opencode.json`.
|
|
4
|
-
- `keybinds` is merged with built-in defaults, so you only need to configure the shortcuts you want to change.
|
|
5
|
-
|
|
6
|
-
```json
|
|
7
|
-
{
|
|
8
|
-
"$schema": "https://opencode.ai/tui.json",
|
|
9
|
-
"theme": "opencode",
|
|
10
|
-
"leader_timeout": 2000,
|
|
11
|
-
"keybinds": {
|
|
12
|
-
"leader": "ctrl+x",
|
|
13
|
-
"command_list": "ctrl+p"
|
|
14
|
-
},
|
|
15
|
-
"scroll_speed": 3,
|
|
16
|
-
"scroll_acceleration": {
|
|
17
|
-
"enabled": false
|
|
18
|
-
},
|
|
19
|
-
"diff_style": "auto",
|
|
20
|
-
"mouse": true,
|
|
21
|
-
"attention": {
|
|
22
|
-
"enabled": true,
|
|
23
|
-
"notifications": true,
|
|
24
|
-
"sound": true,
|
|
25
|
-
"volume": 0.4,
|
|
26
|
-
"sound_pack": "opencode.default",
|
|
27
|
-
"sounds": {
|
|
28
|
-
"error": "./sounds/error.mp3"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
# configure
|
|
2
|
+
Customize TUI behavior through `tui.json` (or `tui.jsonc`).
|
|
3
|
+
- This is separate from `opencode.json`.
|
|
4
|
+
- `keybinds` is merged with built-in defaults, so you only need to configure the shortcuts you want to change.
|
|
5
|
+
|
|
6
|
+
```json
|
|
7
|
+
{
|
|
8
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
9
|
+
"theme": "opencode",
|
|
10
|
+
"leader_timeout": 2000,
|
|
11
|
+
"keybinds": {
|
|
12
|
+
"leader": "ctrl+x",
|
|
13
|
+
"command_list": "ctrl+p"
|
|
14
|
+
},
|
|
15
|
+
"scroll_speed": 3,
|
|
16
|
+
"scroll_acceleration": {
|
|
17
|
+
"enabled": false
|
|
18
|
+
},
|
|
19
|
+
"diff_style": "auto",
|
|
20
|
+
"mouse": true,
|
|
21
|
+
"attention": {
|
|
22
|
+
"enabled": true,
|
|
23
|
+
"notifications": true,
|
|
24
|
+
"sound": true,
|
|
25
|
+
"volume": 0.4,
|
|
26
|
+
"sound_pack": "opencode.default",
|
|
27
|
+
"sounds": {
|
|
28
|
+
"error": "./sounds/error.mp3"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
32
|
```
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
# editor
|
|
2
|
-
Open external editor for composing messages. Uses the editor set in your `EDITOR` environment variable.
|
|
3
|
-
```
|
|
4
|
-
/editor
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
流程是:
|
|
8
|
-
1. TUI 创建一个临时文件
|
|
9
|
-
2. 用 $EDITOR 打开它(如 vim、code --wait)
|
|
10
|
-
3. 你在编辑器里写内容,保存并关闭
|
|
11
|
-
4. TUI 读取临时文件内容,作为消息发送给 AI 和 git commit 不加 -m 时打开编辑器写提交信息是同一个机制。
|
|
12
|
-
|
|
13
|
-
关键是编辑器必须阻塞等待——像 vim 天然阻塞,VS Code 则需要 code --wait 参数才会等关闭后再返回控制权给 TUI。
|
|
14
|
-
|
|
15
|
-
## setup
|
|
16
|
-
Both the `/editor` and `/export` commands use the editor specified in your EDITOR environment variable.
|
|
17
|
-
|
|
18
|
-
Linux/macOS
|
|
19
|
-
```
|
|
20
|
-
export EDITOR=nano
|
|
21
|
-
export EDITOR=vim
|
|
22
|
-
|
|
23
|
-
# For GUI editors, VS Code, Cursor, VSCodium, Windsurf, Zed, etc.
|
|
24
|
-
export EDITOR="code --wait"
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Windows(cmd)
|
|
28
|
-
```
|
|
29
|
-
set EDITOR=notepad
|
|
30
|
-
set EDITOR=code --wait
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Windows(Powershell)
|
|
34
|
-
```
|
|
35
|
-
$env:EDITOR = "notepad"
|
|
36
|
-
$env:EDITOR = "code --wait"
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## popular editors
|
|
40
|
-
- code : VSCode
|
|
41
|
-
- cursor
|
|
42
|
-
- windsurf
|
|
43
|
-
- nvim
|
|
44
|
-
- vim
|
|
45
|
-
- nano
|
|
46
|
-
- notepad : Windows Notepad
|
|
1
|
+
# editor
|
|
2
|
+
Open external editor for composing messages. Uses the editor set in your `EDITOR` environment variable.
|
|
3
|
+
```
|
|
4
|
+
/editor
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
流程是:
|
|
8
|
+
1. TUI 创建一个临时文件
|
|
9
|
+
2. 用 $EDITOR 打开它(如 vim、code --wait)
|
|
10
|
+
3. 你在编辑器里写内容,保存并关闭
|
|
11
|
+
4. TUI 读取临时文件内容,作为消息发送给 AI 和 git commit 不加 -m 时打开编辑器写提交信息是同一个机制。
|
|
12
|
+
|
|
13
|
+
关键是编辑器必须阻塞等待——像 vim 天然阻塞,VS Code 则需要 code --wait 参数才会等关闭后再返回控制权给 TUI。
|
|
14
|
+
|
|
15
|
+
## setup
|
|
16
|
+
Both the `/editor` and `/export` commands use the editor specified in your EDITOR environment variable.
|
|
17
|
+
|
|
18
|
+
Linux/macOS
|
|
19
|
+
```
|
|
20
|
+
export EDITOR=nano
|
|
21
|
+
export EDITOR=vim
|
|
22
|
+
|
|
23
|
+
# For GUI editors, VS Code, Cursor, VSCodium, Windsurf, Zed, etc.
|
|
24
|
+
export EDITOR="code --wait"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Windows(cmd)
|
|
28
|
+
```
|
|
29
|
+
set EDITOR=notepad
|
|
30
|
+
set EDITOR=code --wait
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Windows(Powershell)
|
|
34
|
+
```
|
|
35
|
+
$env:EDITOR = "notepad"
|
|
36
|
+
$env:EDITOR = "code --wait"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## popular editors
|
|
40
|
+
- code : VSCode
|
|
41
|
+
- cursor
|
|
42
|
+
- windsurf
|
|
43
|
+
- nvim
|
|
44
|
+
- vim
|
|
45
|
+
- nano
|
|
46
|
+
- notepad : Windows Notepad
|
|
47
47
|
- subl : sublime text
|
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
# Commands
|
|
2
|
-
Type `/` followed by a command name to execute
|
|
3
|
-
```
|
|
4
|
-
/help
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
Most commands also have keyboard shortcuts using `ctrl+x` as the default leader key.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## connect
|
|
11
|
-
Add a provider to OpenCode. Allows you to select from available providers and add their API keys.
|
|
12
|
-
```
|
|
13
|
-
/connect
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## compact
|
|
17
|
-
Compact the current session:
|
|
18
|
-
```
|
|
19
|
-
/compact
|
|
20
|
-
|
|
21
|
-
// alias
|
|
22
|
-
/summarize
|
|
23
|
-
|
|
24
|
-
// keybind
|
|
25
|
-
ctrl+x c
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## details
|
|
29
|
-
Toggle tool execution details.
|
|
30
|
-
```
|
|
31
|
-
/details
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## exit
|
|
35
|
-
Exit OpenCode. Aliases: `/quit`, `/q`
|
|
36
|
-
```
|
|
37
|
-
/exit
|
|
38
|
-
|
|
39
|
-
// keybind
|
|
40
|
-
ctrl+x q
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## export
|
|
44
|
-
Export current conversation to Markdown and open in your default editor.
|
|
45
|
-
```
|
|
46
|
-
/export
|
|
47
|
-
|
|
48
|
-
// keybind
|
|
49
|
-
ctrl+x x
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## models
|
|
53
|
-
List available models.
|
|
54
|
-
```
|
|
55
|
-
/models
|
|
56
|
-
|
|
57
|
-
// keybind
|
|
58
|
-
ctrl+x m
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## new
|
|
62
|
-
Start a new session. Alias: `/clear`
|
|
63
|
-
```
|
|
64
|
-
/new
|
|
65
|
-
|
|
66
|
-
// keybind
|
|
67
|
-
ctrl+x n
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## redo
|
|
71
|
-
Redo a previously undone message. Only available after using `/undo`.
|
|
72
|
-
```
|
|
73
|
-
/redo
|
|
74
|
-
|
|
75
|
-
// keybind
|
|
76
|
-
ctrl+x r
|
|
77
|
-
```
|
|
78
|
-
Uses Git to manage the file changes. So your project needs to be a Git repository.
|
|
79
|
-
|
|
80
|
-
## undo
|
|
81
|
-
Undo last message in the conversation.
|
|
82
|
-
```
|
|
83
|
-
/undo
|
|
84
|
-
|
|
85
|
-
// keybind
|
|
86
|
-
ctrl+x u
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Removes the most recent user message, all subsequent responses, and any file changes.
|
|
90
|
-
|
|
91
|
-
## sessions
|
|
92
|
-
List and switch between sessions. Aliases: `/resume`, `/continue`
|
|
93
|
-
```
|
|
94
|
-
/resume
|
|
95
|
-
|
|
96
|
-
// keybind
|
|
97
|
-
ctrl+x l
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## themes
|
|
101
|
-
List available themes.
|
|
102
|
-
```
|
|
103
|
-
/themes
|
|
104
|
-
|
|
105
|
-
// keybind
|
|
106
|
-
ctrl+x t
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## thinking
|
|
110
|
-
Toggle the visibility of thinking/reasoning blocks in the conversation. When enabled, you can see the model’s reasoning process for models that support extended thinking.
|
|
111
|
-
```
|
|
112
|
-
/thinking
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## share
|
|
116
|
-
Share current session.
|
|
117
|
-
```
|
|
118
|
-
/share
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## unshare
|
|
122
|
-
Unshare current session.
|
|
123
|
-
```
|
|
124
|
-
/unshare
|
|
1
|
+
# Commands
|
|
2
|
+
Type `/` followed by a command name to execute
|
|
3
|
+
```
|
|
4
|
+
/help
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
Most commands also have keyboard shortcuts using `ctrl+x` as the default leader key.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## connect
|
|
11
|
+
Add a provider to OpenCode. Allows you to select from available providers and add their API keys.
|
|
12
|
+
```
|
|
13
|
+
/connect
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## compact
|
|
17
|
+
Compact the current session:
|
|
18
|
+
```
|
|
19
|
+
/compact
|
|
20
|
+
|
|
21
|
+
// alias
|
|
22
|
+
/summarize
|
|
23
|
+
|
|
24
|
+
// keybind
|
|
25
|
+
ctrl+x c
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## details
|
|
29
|
+
Toggle tool execution details.
|
|
30
|
+
```
|
|
31
|
+
/details
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## exit
|
|
35
|
+
Exit OpenCode. Aliases: `/quit`, `/q`
|
|
36
|
+
```
|
|
37
|
+
/exit
|
|
38
|
+
|
|
39
|
+
// keybind
|
|
40
|
+
ctrl+x q
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## export
|
|
44
|
+
Export current conversation to Markdown and open in your default editor.
|
|
45
|
+
```
|
|
46
|
+
/export
|
|
47
|
+
|
|
48
|
+
// keybind
|
|
49
|
+
ctrl+x x
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## models
|
|
53
|
+
List available models.
|
|
54
|
+
```
|
|
55
|
+
/models
|
|
56
|
+
|
|
57
|
+
// keybind
|
|
58
|
+
ctrl+x m
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## new
|
|
62
|
+
Start a new session. Alias: `/clear`
|
|
63
|
+
```
|
|
64
|
+
/new
|
|
65
|
+
|
|
66
|
+
// keybind
|
|
67
|
+
ctrl+x n
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## redo
|
|
71
|
+
Redo a previously undone message. Only available after using `/undo`.
|
|
72
|
+
```
|
|
73
|
+
/redo
|
|
74
|
+
|
|
75
|
+
// keybind
|
|
76
|
+
ctrl+x r
|
|
77
|
+
```
|
|
78
|
+
Uses Git to manage the file changes. So your project needs to be a Git repository.
|
|
79
|
+
|
|
80
|
+
## undo
|
|
81
|
+
Undo last message in the conversation.
|
|
82
|
+
```
|
|
83
|
+
/undo
|
|
84
|
+
|
|
85
|
+
// keybind
|
|
86
|
+
ctrl+x u
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Removes the most recent user message, all subsequent responses, and any file changes.
|
|
90
|
+
|
|
91
|
+
## sessions
|
|
92
|
+
List and switch between sessions. Aliases: `/resume`, `/continue`
|
|
93
|
+
```
|
|
94
|
+
/resume
|
|
95
|
+
|
|
96
|
+
// keybind
|
|
97
|
+
ctrl+x l
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## themes
|
|
101
|
+
List available themes.
|
|
102
|
+
```
|
|
103
|
+
/themes
|
|
104
|
+
|
|
105
|
+
// keybind
|
|
106
|
+
ctrl+x t
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## thinking
|
|
110
|
+
Toggle the visibility of thinking/reasoning blocks in the conversation. When enabled, you can see the model’s reasoning process for models that support extended thinking.
|
|
111
|
+
```
|
|
112
|
+
/thinking
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## share
|
|
116
|
+
Share current session.
|
|
117
|
+
```
|
|
118
|
+
/share
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## unshare
|
|
122
|
+
Unshare current session.
|
|
123
|
+
```
|
|
124
|
+
/unshare
|
|
125
125
|
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# init
|
|
2
|
-
Guided setup for creating or updating `AGENTS.md`.
|
|
3
|
-
```
|
|
4
|
-
/init
|
|
1
|
+
# init
|
|
2
|
+
Guided setup for creating or updating `AGENTS.md`.
|
|
3
|
+
```
|
|
4
|
+
/init
|
|
5
5
|
```
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# TUI
|
|
2
|
-
Using the OpenCode terminal user interface.
|
|
3
|
-
|
|
4
|
-
```
|
|
5
|
-
opencode
|
|
6
|
-
|
|
7
|
-
// start with a specific working dir
|
|
8
|
-
opencode /path/to/project
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## File references
|
|
12
|
-
Using `@` to reference files in the current working dir.
|
|
13
|
-
- The content of the file is added to the conversation automatically.
|
|
14
|
-
```
|
|
15
|
-
How is auth handled in @packages/functions/src/api/index.ts
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Bash commands
|
|
20
|
-
Start with `!` to run a shell command.
|
|
21
|
-
- The output of the command is added to the conversation as a tool result.
|
|
22
|
-
```
|
|
23
|
-
!ls -la
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
# TUI
|
|
2
|
+
Using the OpenCode terminal user interface.
|
|
3
|
+
|
|
4
|
+
```
|
|
5
|
+
opencode
|
|
6
|
+
|
|
7
|
+
// start with a specific working dir
|
|
8
|
+
opencode /path/to/project
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## File references
|
|
12
|
+
Using `@` to reference files in the current working dir.
|
|
13
|
+
- The content of the file is added to the conversation automatically.
|
|
14
|
+
```
|
|
15
|
+
How is auth handled in @packages/functions/src/api/index.ts
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Bash commands
|
|
20
|
+
Start with `!` to run a shell command.
|
|
21
|
+
- The output of the command is added to the conversation as a tool result.
|
|
22
|
+
```
|
|
23
|
+
!ls -la
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
# Bootstrap 注入机制
|
|
2
|
-
|
|
3
|
-
## 安装方式
|
|
4
|
-
|
|
5
|
-
在 opencode 的 `opencode.json` 中注册:
|
|
6
|
-
|
|
7
|
-
```json
|
|
8
|
-
{
|
|
9
|
-
"plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
|
|
10
|
-
}
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
或使用本地路径:
|
|
14
|
-
|
|
15
|
-
```json
|
|
16
|
-
{
|
|
17
|
-
"plugin": ["~/.config/opencode/node_modules/superpowers"]
|
|
18
|
-
}
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## 插件入口
|
|
22
|
-
|
|
23
|
-
**文件**: `.opencode/plugins/superpowers.js`(`package.json` 的 `"main"`)
|
|
24
|
-
|
|
25
|
-
插件导出 `SuperpowersPlugin`,接收 `{ client, directory }` 参数,返回两个 hook:
|
|
26
|
-
|
|
27
|
-
| Hook | 作用 |
|
|
28
|
-
|------|------|
|
|
29
|
-
| `config` | 将 `skills/` 目录注册到 `config.skills.paths`,让 opencode 发现 superpowers 的 14 个技能 |
|
|
30
|
-
| `experimental.chat.messages.transform` | 将 `using-superpowers/SKILL.md` 的内容注入到会话的第一条 user message 前面 |
|
|
31
|
-
|
|
32
|
-
## Bootstrap 注入逻辑
|
|
33
|
-
|
|
34
|
-
```javascript
|
|
35
|
-
// .opencode/plugins/superpowers.js (简化)
|
|
36
|
-
|
|
37
|
-
const getBootstrapContent = () => {
|
|
38
|
-
// 模块级缓存:SKILL.md 不变,只读一次
|
|
39
|
-
if (_bootstrapCache !== undefined) return _bootstrapCache
|
|
40
|
-
|
|
41
|
-
const skillPath = path.join(skillsDir, 'using-superpowers', 'SKILL.md')
|
|
42
|
-
const fullContent = fs.readFileSync(skillPath, 'utf8')
|
|
43
|
-
const { content } = extractAndStripFrontmatter(fullContent) // 去掉 frontmatter
|
|
44
|
-
|
|
45
|
-
_bootstrapCache = `<EXTREMELY_IMPORTANT>
|
|
46
|
-
You have superpowers.
|
|
47
|
-
|
|
48
|
-
**IMPORTANT: The using-superpowers skill content is included below. It is ALREADY LOADED - you are currently following it. Do NOT use the skill tool to load "using-superpowers" again - that would be redundant.**
|
|
49
|
-
|
|
50
|
-
${content}
|
|
51
|
-
|
|
52
|
-
${toolMapping}
|
|
53
|
-
</EXTREMELY_IMPORTANT>`
|
|
54
|
-
return _bootstrapCache
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
'experimental.chat.messages.transform': async (_input, output) => {
|
|
59
|
-
const bootstrap = getBootstrapContent()
|
|
60
|
-
if (!bootstrap || !output.messages.length) return
|
|
61
|
-
|
|
62
|
-
const firstUser = output.messages.find(m => m.info.role === 'user')
|
|
63
|
-
if (!firstUser || !firstUser.parts.length) return
|
|
64
|
-
|
|
65
|
-
// 幂等检查:已有注入则跳过
|
|
66
|
-
if (firstUser.parts.some(p => p.type === 'text' && p.text.includes('EXTREMELY_IMPORTANT'))) return
|
|
67
|
-
|
|
68
|
-
// 注入到第一条 user message 的 parts 最前面
|
|
69
|
-
const ref = firstUser.parts[0]
|
|
70
|
-
firstUser.parts.unshift({ ...ref, type: 'text', text: bootstrap })
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## 关键设计决策
|
|
76
|
-
|
|
77
|
-
1. **注入到 user message 而非 system message**:避免 system message 在每轮重复导致的 token 膨胀(#750),以及多 system message 破坏 Qwen 等模型的问题(#894)
|
|
78
|
-
2. **模块级缓存**:`messages.transform` 在每个 agent step 都触发(不只是每轮),缓存避免重复磁盘 IO(#1202)
|
|
79
|
-
3. **幂等检查**:通过 `EXTREMELY_IMPORTANT` 标记防止重复注入
|
|
80
|
-
4. **工具映射**:为 opencode 平台生成特定的工具映射表
|
|
81
|
-
|
|
82
|
-
## 工具映射(opencode 平台)
|
|
83
|
-
|
|
84
|
-
| 技能中的动作 | opencode 工具 |
|
|
85
|
-
|-------------|--------------|
|
|
86
|
-
| Create or update todos | `todowrite` |
|
|
87
|
-
| `Subagent (general-purpose):` | `task` with `subagent_type: "general"` |
|
|
88
|
-
| Invoke a skill | `skill` 工具 |
|
|
89
|
-
| Read files | `read` |
|
|
90
|
-
| Create, edit, or delete files | `apply_patch` |
|
|
91
|
-
| Run shell commands | `bash` |
|
|
92
|
-
| Search files | `grep`, `glob` |
|
|
93
|
-
| Fetch a URL | `webfetch` |
|
|
94
|
-
|
|
95
|
-
## 跨平台注入机制
|
|
96
|
-
|
|
97
|
-
| 平台 | 注入机制 | 触发时机 |
|
|
98
|
-
|------|---------|---------|
|
|
99
|
-
| opencode | `experimental.chat.messages.transform` hook | 每个 agent step |
|
|
100
|
-
| Claude Code | `SessionStart` hook → `additionalContext` | 会话启动/clear/compact |
|
|
101
|
-
| Cursor | `SessionStart` hook → `additional_context` | 会话启动 |
|
|
102
|
-
| Codex | 插件系统 | 插件加载 |
|
|
103
|
-
| Gemini CLI | 扩展系统 | 扩展加载 |
|
|
104
|
-
| Pi | 扩展 + 原生技能 | 会话启动 + compact 后 |
|
|
105
|
-
| Copilot CLI | `additionalContext` (SDK 标准) | 会话启动 |
|
|
106
|
-
|
|
107
|
-
Claude Code 的 session-start hook 是一个 bash 脚本,读取 `using-superpowers/SKILL.md`,JSON 转义后输出为 `additionalContext`。
|
|
1
|
+
# Bootstrap 注入机制
|
|
2
|
+
|
|
3
|
+
## 安装方式
|
|
4
|
+
|
|
5
|
+
在 opencode 的 `opencode.json` 中注册:
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
或使用本地路径:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"plugin": ["~/.config/opencode/node_modules/superpowers"]
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 插件入口
|
|
22
|
+
|
|
23
|
+
**文件**: `.opencode/plugins/superpowers.js`(`package.json` 的 `"main"`)
|
|
24
|
+
|
|
25
|
+
插件导出 `SuperpowersPlugin`,接收 `{ client, directory }` 参数,返回两个 hook:
|
|
26
|
+
|
|
27
|
+
| Hook | 作用 |
|
|
28
|
+
|------|------|
|
|
29
|
+
| `config` | 将 `skills/` 目录注册到 `config.skills.paths`,让 opencode 发现 superpowers 的 14 个技能 |
|
|
30
|
+
| `experimental.chat.messages.transform` | 将 `using-superpowers/SKILL.md` 的内容注入到会话的第一条 user message 前面 |
|
|
31
|
+
|
|
32
|
+
## Bootstrap 注入逻辑
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
// .opencode/plugins/superpowers.js (简化)
|
|
36
|
+
|
|
37
|
+
const getBootstrapContent = () => {
|
|
38
|
+
// 模块级缓存:SKILL.md 不变,只读一次
|
|
39
|
+
if (_bootstrapCache !== undefined) return _bootstrapCache
|
|
40
|
+
|
|
41
|
+
const skillPath = path.join(skillsDir, 'using-superpowers', 'SKILL.md')
|
|
42
|
+
const fullContent = fs.readFileSync(skillPath, 'utf8')
|
|
43
|
+
const { content } = extractAndStripFrontmatter(fullContent) // 去掉 frontmatter
|
|
44
|
+
|
|
45
|
+
_bootstrapCache = `<EXTREMELY_IMPORTANT>
|
|
46
|
+
You have superpowers.
|
|
47
|
+
|
|
48
|
+
**IMPORTANT: The using-superpowers skill content is included below. It is ALREADY LOADED - you are currently following it. Do NOT use the skill tool to load "using-superpowers" again - that would be redundant.**
|
|
49
|
+
|
|
50
|
+
${content}
|
|
51
|
+
|
|
52
|
+
${toolMapping}
|
|
53
|
+
</EXTREMELY_IMPORTANT>`
|
|
54
|
+
return _bootstrapCache
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
'experimental.chat.messages.transform': async (_input, output) => {
|
|
59
|
+
const bootstrap = getBootstrapContent()
|
|
60
|
+
if (!bootstrap || !output.messages.length) return
|
|
61
|
+
|
|
62
|
+
const firstUser = output.messages.find(m => m.info.role === 'user')
|
|
63
|
+
if (!firstUser || !firstUser.parts.length) return
|
|
64
|
+
|
|
65
|
+
// 幂等检查:已有注入则跳过
|
|
66
|
+
if (firstUser.parts.some(p => p.type === 'text' && p.text.includes('EXTREMELY_IMPORTANT'))) return
|
|
67
|
+
|
|
68
|
+
// 注入到第一条 user message 的 parts 最前面
|
|
69
|
+
const ref = firstUser.parts[0]
|
|
70
|
+
firstUser.parts.unshift({ ...ref, type: 'text', text: bootstrap })
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 关键设计决策
|
|
76
|
+
|
|
77
|
+
1. **注入到 user message 而非 system message**:避免 system message 在每轮重复导致的 token 膨胀(#750),以及多 system message 破坏 Qwen 等模型的问题(#894)
|
|
78
|
+
2. **模块级缓存**:`messages.transform` 在每个 agent step 都触发(不只是每轮),缓存避免重复磁盘 IO(#1202)
|
|
79
|
+
3. **幂等检查**:通过 `EXTREMELY_IMPORTANT` 标记防止重复注入
|
|
80
|
+
4. **工具映射**:为 opencode 平台生成特定的工具映射表
|
|
81
|
+
|
|
82
|
+
## 工具映射(opencode 平台)
|
|
83
|
+
|
|
84
|
+
| 技能中的动作 | opencode 工具 |
|
|
85
|
+
|-------------|--------------|
|
|
86
|
+
| Create or update todos | `todowrite` |
|
|
87
|
+
| `Subagent (general-purpose):` | `task` with `subagent_type: "general"` |
|
|
88
|
+
| Invoke a skill | `skill` 工具 |
|
|
89
|
+
| Read files | `read` |
|
|
90
|
+
| Create, edit, or delete files | `apply_patch` |
|
|
91
|
+
| Run shell commands | `bash` |
|
|
92
|
+
| Search files | `grep`, `glob` |
|
|
93
|
+
| Fetch a URL | `webfetch` |
|
|
94
|
+
|
|
95
|
+
## 跨平台注入机制
|
|
96
|
+
|
|
97
|
+
| 平台 | 注入机制 | 触发时机 |
|
|
98
|
+
|------|---------|---------|
|
|
99
|
+
| opencode | `experimental.chat.messages.transform` hook | 每个 agent step |
|
|
100
|
+
| Claude Code | `SessionStart` hook → `additionalContext` | 会话启动/clear/compact |
|
|
101
|
+
| Cursor | `SessionStart` hook → `additional_context` | 会话启动 |
|
|
102
|
+
| Codex | 插件系统 | 插件加载 |
|
|
103
|
+
| Gemini CLI | 扩展系统 | 扩展加载 |
|
|
104
|
+
| Pi | 扩展 + 原生技能 | 会话启动 + compact 后 |
|
|
105
|
+
| Copilot CLI | `additionalContext` (SDK 标准) | 会话启动 |
|
|
106
|
+
|
|
107
|
+
Claude Code 的 session-start hook 是一个 bash 脚本,读取 `using-superpowers/SKILL.md`,JSON 转义后输出为 `additionalContext`。
|