@menghuan1918/dsh-apollo 0.0.0-stage → 0.4.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 (40) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +253 -2
  3. package/cordis.patch.yml +78 -0
  4. package/docs/DEVELOPMENT.md +682 -0
  5. package/package.json +76 -4
  6. package/presets/eng/NOTICE +3 -0
  7. package/presets/eng/plugins/exit-guard/index.js +111 -0
  8. package/presets/eng/plugins/exit-guard/package.json +7 -0
  9. package/presets/eng/plugins/mode-instructions/index.js +124 -0
  10. package/presets/eng/plugins/mode-instructions/package.json +7 -0
  11. package/presets/eng/plugins/wait-subagent/index.js +233 -0
  12. package/presets/eng/plugins/wait-subagent/package.json +7 -0
  13. package/presets/eng-ptc.patch.yml +186 -0
  14. package/presets/eng.patch.yml +338 -0
  15. package/skills/brainstorming/SKILL.md +90 -0
  16. package/skills/brainstorming/spec-document-reviewer-prompt.md +50 -0
  17. package/skills/code-review/SKILL.md +90 -0
  18. package/skills/dev/SKILL.md +41 -0
  19. package/skills/diagnosing-bugs/SKILL.md +132 -0
  20. package/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +55 -0
  21. package/skills/exec/SKILL.md +78 -0
  22. package/skills/handoff/SKILL.md +23 -0
  23. package/skills/main-agent-driven-development/SKILL.md +64 -0
  24. package/skills/tdd/SKILL.md +34 -0
  25. package/skills/tdd/mocking.md +59 -0
  26. package/skills/tdd/tests.md +77 -0
  27. package/src/cli/claude.js +166 -0
  28. package/src/cli/codex.js +164 -0
  29. package/src/cli/jsonl.js +216 -0
  30. package/src/cli-adapter.js +198 -0
  31. package/src/cli-sessions.js +69 -0
  32. package/src/client.js +1128 -0
  33. package/src/config.js +327 -0
  34. package/src/dsh-home.js +38 -0
  35. package/src/index.js +181 -0
  36. package/src/panel.js +844 -0
  37. package/src/settings.js +191 -0
  38. package/src/subagents.js +198 -0
  39. package/third-party/LICENSE-MIT-dsh-standard-preset +21 -0
  40. package/third-party/NOTICE-mattpocock-skills +21 -0
@@ -0,0 +1,186 @@
1
+ # dsh-apollo bundle patch: the `eng-ptc` (工程(PTC)模式) agent preset.
2
+ #
3
+ # A copy of the eng plugins block (presets/eng.patch.yml — read that file for
4
+ # the per-row rationale) with exactly the deltas the upstream `ptc` preset
5
+ # applies to `standard`:
6
+ # - `tool-presentation { mode: ptc }`: every tool is reached through the
7
+ # run_code TypeScript SDK (needs the host `ptc-runtime` row);
8
+ # - `workflow-ptc` and `tool-workflow` disabled: PTC fans out by calling
9
+ # subagent several times inside one run_code program instead;
10
+ # plus `eng-mode-instructions { ptc: true }`, which adds the rule for fanning
11
+ # out subagents inside one run_code program. Preset-local plugins reuse the eng modules.
12
+ # tests/upstream-drift.test.mjs checks this file against both eng and the
13
+ # upstream `ptc` preset; edit eng first, then redo these deltas.
14
+ #
15
+ # `config.id` MUST stay `eng-ptc`: it is the preset identity historical
16
+ # sessions resume by.
17
+
18
+ - insert:
19
+ - id: preset-eng-ptc
20
+ name: '@deepseek-ai/dsh-agent-preset'
21
+ config:
22
+ id: eng-ptc
23
+ name: 工程(PTC)模式
24
+ description: >-
25
+ 工程模式的 PTC 变体:工具经 run_code 的 TypeScript SDK 调用,一个程序组合多步操作;与官方 PTC 模式一致不提供 workflow 工具。
26
+ order: 11
27
+ plugins:
28
+
29
+ - id: persona
30
+ name: '@deepseek-ai/dsh-persona'
31
+ config:
32
+ prefix: >-
33
+ You are a coding agent powered by the {{model}} model.
34
+
35
+ - id: agent-instructions
36
+ name: '@deepseek-ai/dsh-agent-instructions'
37
+ config:
38
+ maxBytes: 65536
39
+
40
+ - id: time-context
41
+ name: '@deepseek-ai/dsh-time-context'
42
+
43
+ - id: tool-bash
44
+ name: '@deepseek-ai/dsh-tool-bash'
45
+ disabled: !!js process.platform === 'win32'
46
+
47
+ - id: tool-pwsh
48
+ name: '@deepseek-ai/dsh-tool-pwsh'
49
+ disabled: !!js process.platform !== 'win32'
50
+
51
+ - id: tool-fs
52
+ name: '@deepseek-ai/dsh-tool-fs'
53
+
54
+ - id: tool-fs-search
55
+ name: '@deepseek-ai/dsh-tool-fs-search'
56
+ config:
57
+ sampleOverCapGlobResults: false
58
+
59
+ - id: tool-jobs
60
+ name: '@deepseek-ai/dsh-tool-jobs'
61
+ config:
62
+ maxConsecutiveWakes: 5000
63
+
64
+ - id: skill-filesystem
65
+ name: '@deepseek-ai/dsh-skill-filesystem'
66
+
67
+ - id: tool-skill
68
+ name: '@deepseek-ai/dsh-tool-skill'
69
+
70
+ - id: planning
71
+ name: cordis:group
72
+ group: true
73
+ isolate:
74
+ planMode: true
75
+ config:
76
+ - id: plan-mode
77
+ name: '@deepseek-ai/dsh-plan-mode'
78
+ config:
79
+ section: |
80
+ You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
81
+
82
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
83
+
84
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
85
+
86
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
87
+
88
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
89
+
90
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
91
+
92
+ - id: compaction
93
+ name: cordis:group
94
+ group: true
95
+ isolate:
96
+ compaction: true
97
+ toolResultPruner: true
98
+ config:
99
+ - id: compaction-basic
100
+ name: '@deepseek-ai/dsh-compaction-basic'
101
+
102
+ - id: command-compact
103
+ name: '@deepseek-ai/dsh-command-compact'
104
+
105
+ - id: tool-result-pruner
106
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
107
+ config:
108
+ thresholdChars: 16384
109
+ headChars: 8192
110
+ tailChars: 2048
111
+
112
+ - id: delegation
113
+ name: cordis:group
114
+ group: true
115
+ isolate:
116
+ workflowEngine: true
117
+ config:
118
+ - id: tool-subagent-control
119
+ name: '@deepseek-ai/dsh-tool-subagent-control'
120
+
121
+ - id: tool-subagent-list-agents
122
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
123
+
124
+ - id: tool-subagent
125
+ name: '@deepseek-ai/dsh-tool-subagent'
126
+ config:
127
+ provider: spawn
128
+ toolName: subagent
129
+ modelSelectionSettings: true
130
+
131
+ - id: tool-subagent-fork
132
+ name: '@deepseek-ai/dsh-tool-subagent'
133
+ config:
134
+ provider: fork
135
+ toolName: subagent_fork
136
+
137
+ - id: workflow-ptc
138
+ name: '@deepseek-ai/dsh-workflow-ptc'
139
+ disabled: true
140
+ config:
141
+ provider: spawn
142
+
143
+ - id: tool-workflow
144
+ name: '@deepseek-ai/dsh-tool-workflow'
145
+ disabled: true
146
+
147
+ - id: tool-ask-user
148
+ name: '@deepseek-ai/dsh-tool-ask-user'
149
+
150
+ - id: tool-todo
151
+ name: '@deepseek-ai/dsh-tool-todo'
152
+ config:
153
+ allowParallelInProgress: true
154
+
155
+ - id: tool-web
156
+ name: '@deepseek-ai/dsh-tool-web'
157
+ config:
158
+ fetch: true
159
+ searchTimeoutMs: 60000
160
+
161
+ - id: tool-presentation
162
+ name: '@deepseek-ai/dsh-agent-tool-presentation'
163
+ config:
164
+ mode: ptc
165
+
166
+ - id: present
167
+ name: '@deepseek-ai/dsh-tool-present'
168
+
169
+ - id: tool-plugin-manager
170
+ name: '@deepseek-ai/dsh-plugin-manager/tools'
171
+ disabled: true
172
+
173
+ - id: tool-plugin-market
174
+ name: '@deepseek-ai/dsh-plugin-market/tools'
175
+ disabled: true
176
+
177
+ - id: tool-wait-subagent
178
+ name: '@menghuan1918/dsh-apollo/presets/eng/plugins/wait-subagent/index.js'
179
+
180
+ - id: eng-exit-guard
181
+ name: '@menghuan1918/dsh-apollo/presets/eng/plugins/exit-guard/index.js'
182
+
183
+ - id: eng-mode-instructions
184
+ name: '@menghuan1918/dsh-apollo/presets/eng/plugins/mode-instructions/index.js'
185
+ config:
186
+ ptc: true
@@ -0,0 +1,338 @@
1
+ # dsh-apollo bundle patch: the `eng` (工程模式) agent preset, declared as
2
+ # one `@deepseek-ai/dsh-agent-preset` insert row — the DSH 0.2.1 preset
3
+ # mechanism (the `<dshHome>/.agent-presets` scan root is gone; third-party
4
+ # presets ship as bundle-patch insert rows). Loaded after ./cordis.patch.yml
5
+ # per the `dsh.bundle.patch` array in package.json.
6
+ #
7
+ # The `config.plugins` block below is the single source of truth for the
8
+ # preset's row list; it supersedes the former presets/eng/agent.cordis.yml +
9
+ # preset.yml pair (metadata folded into `config`). `config.id` MUST stay
10
+ # `eng`: it is the preset identity historical sessions resume by.
11
+ #
12
+ # Preset-local plugin modules are referenced by bare package subpaths
13
+ # (`@menghuan1918/dsh-apollo/presets/eng/plugins/...`): names inside `config.plugins`
14
+ # resolve from the profile directory's node_modules (where this package is
15
+ # installed or linked; `exports["./presets/*"]` maps the subpath), not from
16
+ # the preset directory.
17
+
18
+ - insert:
19
+ - id: preset-eng
20
+ name: '@deepseek-ai/dsh-agent-preset'
21
+ config:
22
+ id: eng
23
+ name: 工程模式
24
+ description: >-
25
+ 面向编码与基础设施任务的工程 Agent:内置工程纪律、后台任务与子代理约定、由独立 goal 插件提供的长期目标续跑。
26
+ order: 10
27
+ plugins:
28
+ #
29
+ # This plugins block is an AGENT-PLANE composition. The roster mounts it ONCE under a
30
+ # standing scope; every session naming it joins by scope parentage, so the
31
+ # tools and prompt sections registered here cover each joined agent while a
32
+ # session's own state stays keyed per Session/Agent inside the plugins. The
33
+ # host composition (`base.cordis.yml` + `web.cordis.yml`) keeps everything a
34
+ # preset must not own: the registries themselves, the sandbox and approval
35
+ # stack, persistence, and the model route.
36
+ #
37
+ # A service row here MUST sit inside a group carrying an `isolate` realm.
38
+ # Without one it publishes into the root realm, where it is process-global —
39
+ # another preset publishing the same name collides, and a host reader would
40
+ # resolve one preset's instance for every session; `dsh-agent-preset` rejects
41
+ # that at mount. `true` means an entry-local realm: this standing mount's own
42
+ # private instance, apart from every other preset's. (A shared label does NOT
43
+ # pool instances — `provide()` throws on the second registration under the
44
+ # same realm symbol; labels join REALMS, and are not what this file needs.)
45
+
46
+ # ── identity ────────────────────────────────────────────────────────────────
47
+
48
+ # The preset's own persona, shadowing the deployment default for this agent.
49
+ # One row on purpose: the engineering rules, delegation policy and model
50
+ # tiers live in the preset's `eng:mode-instructions` section, not in the
51
+ # persona; ~/.dsh/AGENTS.md only keeps machine-local conventions.
52
+ # 0.2.1's upstream `standard` preset carries `prefix` only: the working-
53
+ # directory `suffix` line it used to set is gone, and eng follows suit.
54
+ - id: persona
55
+ name: '@deepseek-ai/dsh-persona'
56
+ config:
57
+ prefix: >-
58
+ You are a coding agent powered by the {{model}} model.
59
+
60
+ # Workspace instructions (repository AGENTS.md files) are injected from the
61
+ # first request, capped at 64 KiB.
62
+ - id: agent-instructions
63
+ name: '@deepseek-ai/dsh-agent-instructions'
64
+ config:
65
+ maxBytes: 65536
66
+
67
+ # 0.2.1 standard adds the per-step time context (sampled current time,
68
+ # browser time zone and elapsed time) so date/time reasoning does not depend
69
+ # on the model's own clock. It consumes host services and provides nothing,
70
+ # so it needs no realm.
71
+ - id: time-context
72
+ name: '@deepseek-ai/dsh-time-context'
73
+
74
+ # ── shell ───────────────────────────────────────────────────────────────────
75
+
76
+ # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
77
+ # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
78
+ # the criterion for host-plane ownership — injection resolves before any session
79
+ # exists, so there is no agent to key by. Behind a preset realm those variables
80
+ # never reached the model's shell at all. Both shell tools consume the host
81
+ # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
82
+ # host-plane too.
83
+ - id: tool-bash
84
+ name: '@deepseek-ai/dsh-tool-bash'
85
+ disabled: !!js process.platform === 'win32'
86
+
87
+ - id: tool-pwsh
88
+ name: '@deepseek-ai/dsh-tool-pwsh'
89
+ disabled: !!js process.platform !== 'win32'
90
+
91
+ # ── filesystem ──────────────────────────────────────────────────────────────
92
+
93
+ # Both register into the host `tools` registry and provide nothing, so
94
+ # they need no realm. The `fs` service and its policy stay in the host.
95
+ - id: tool-fs
96
+ name: '@deepseek-ai/dsh-tool-fs'
97
+
98
+ - id: tool-fs-search
99
+ name: '@deepseek-ai/dsh-tool-fs-search'
100
+ config:
101
+ sampleOverCapGlobResults: false
102
+
103
+ # ── background jobs ────────────────────────────────────────────────────────
104
+
105
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
106
+ # its producers sit outside any realm this file could put it in — `tool-bash`
107
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
108
+ # to every sibling row, so `run_in_background` would answer "background jobs
109
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
110
+ # owning agent anyway, so one host instance serves every session. What a preset
111
+ # chooses is whether its agent can collect and stop background work at all.
112
+ #
113
+ # LOCAL OVERRIDE (2026-09-22): `maxConsecutiveWakes` is 5000 instead of the
114
+ # bundled 3. The budget is spent by every completion that opens a turn on an
115
+ # idle owner and is restored ONLY by a user-authored message, so a long
116
+ # unattended chain of background jobs parks after its third wake — from the
117
+ # fourth completion on, the notice degrades to injection and waits for the
118
+ # user's next input. Keep this value identical in the eng-ptc patch (the
119
+ # upstream-drift test compares both presets against upstream with the
120
+ # same whitelist); upstream ships no such key.
121
+ - id: tool-jobs
122
+ name: '@deepseek-ai/dsh-tool-jobs'
123
+ config:
124
+ maxConsecutiveWakes: 5000
125
+
126
+ # The automation-task tools (schedule_create/list/update/delete) are
127
+ # deliberately omitted from engineering mode: coding/infrastructure work
128
+ # does not need scheduled reminders. The host `schedule` service and the
129
+ # sidebar Automation page stay available to other presets.
130
+
131
+ # ── skills ──────────────────────────────────────────────────────────────────
132
+
133
+ # The skill REGISTRY lives in the host composition and is layered per scope:
134
+ # these rows register into THIS preset's layer of it, so they need no realm.
135
+ # `skill-filesystem` contributes local-root discovery for agents on this preset, and
136
+ # `tool-skill` gives them the catalog and loader; the merged catalog also
137
+ # carries whatever the deployment registered globally (repository plugins).
138
+ - id: skill-filesystem
139
+ name: '@deepseek-ai/dsh-skill-filesystem'
140
+
141
+ - id: tool-skill
142
+ name: '@deepseek-ai/dsh-tool-skill'
143
+
144
+ # ── goals ───────────────────────────────────────────────────────────────────
145
+
146
+ # Native command-goal/tool-goal rows are deliberately omitted. The goal
147
+ # domain is owned by the independent dsh-better-goal plugin row in the
148
+ # top-level patch: it registers one `goal` tool and one `/goal` command
149
+ # per Agent, hides any legacy goal tools a preset still carries, and has
150
+ # its own Plugins row for round limits and question timeouts. The two
151
+ # removed rows remain deliberate removals in tests/upstream-drift.test.mjs,
152
+ # which asserts they still exist upstream before filtering them out.
153
+
154
+ # ── plan mode ───────────────────────────────────────────────────────────────
155
+
156
+ # Plan state is per-agent by nature, so an entry-local realm is not a
157
+ # workaround here — it is the correct lifetime.
158
+ - id: planning
159
+ name: cordis:group
160
+ group: true
161
+ isolate:
162
+ planMode: true
163
+ config:
164
+ - id: plan-mode
165
+ name: '@deepseek-ai/dsh-plan-mode'
166
+ config:
167
+ section: |
168
+ You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
169
+
170
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
171
+
172
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
173
+
174
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
175
+
176
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
177
+
178
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
179
+
180
+ # ── compaction ──────────────────────────────────────────────────────────────
181
+
182
+ # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
183
+ # share this realm rather than sit outside it.
184
+ #
185
+ # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
186
+ # plane, and the rows here resolve that one instance. It takes no configuration,
187
+ # keys every fold by Session, and owns the context-meter projection units the
188
+ # browser reads for every session — behind a realm those units would come and go
189
+ # with whichever presets happen to be mounted. What a preset chooses is whether
190
+ # its agent compacts at all, which is `compaction-basic` below.
191
+ - id: compaction
192
+ name: cordis:group
193
+ group: true
194
+ isolate:
195
+ compaction: true
196
+ toolResultPruner: true
197
+ config:
198
+ - id: compaction-basic
199
+ name: '@deepseek-ai/dsh-compaction-basic'
200
+
201
+ - id: command-compact
202
+ name: '@deepseek-ai/dsh-command-compact'
203
+
204
+ - id: tool-result-pruner
205
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
206
+ config:
207
+ # Deliberately 2x the upstream `standard` preset (8192/4096/1024): eng
208
+ # sessions emit large build/test/log tool results, and the extra
209
+ # head/tail retention preserves the failure context the agent acts on.
210
+ thresholdChars: 16384
211
+ headChars: 8192
212
+ tailChars: 2048
213
+
214
+ # ── delegation and workflows ────────────────────────────────────────────────
215
+
216
+ # The `subagents` registry and its spawn/fork backends live in the HOST
217
+ # composition: the registry is a process singleton whose cross-session queries
218
+ # the api-proxy serves to the browser, and a provider name may only be
219
+ # registered once. This preset contributes the delegation TOOLS, which resolve
220
+ # that host registry.
221
+ #
222
+ # `workflows` is different — nothing outside an agent reads it — so every row
223
+ # that reaches it shares one entry-local realm here, and a consumer left
224
+ # outside would resolve a host registry this preset does not populate.
225
+ #
226
+ # 0.1.2-alpha.4 note: the one-way child `report` tool is gone — parent/child
227
+ # messaging now rides the globally named `send_message` registered by
228
+ # `tool-subagent-control` below (children inherit it too), so this preset
229
+ # mounts no messaging row of its own.
230
+ - id: delegation
231
+ name: cordis:group
232
+ group: true
233
+ isolate:
234
+ workflowEngine: true
235
+ config:
236
+ - id: tool-subagent-control
237
+ name: '@deepseek-ai/dsh-tool-subagent-control'
238
+
239
+ - id: tool-subagent-list-agents
240
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
241
+
242
+ - id: tool-subagent
243
+ name: '@deepseek-ai/dsh-tool-subagent'
244
+ config:
245
+ provider: spawn
246
+ toolName: subagent
247
+ modelSelectionSettings: true
248
+
249
+ # Fork omits model selection so provider/model stay equal to the parent and
250
+ # the inherited history remains eligible for KV Cache reuse.
251
+ - id: tool-subagent-fork
252
+ name: '@deepseek-ai/dsh-tool-subagent'
253
+ config:
254
+ provider: fork
255
+ toolName: subagent_fork
256
+
257
+ # 0.1.6-alpha.2 renamed `dsh-workflow-worker-thread` to `dsh-workflow-ptc`
258
+ # (workflow orchestration in the shared sandboxed Node PTC runtime).
259
+ - id: workflow-ptc
260
+ name: '@deepseek-ai/dsh-workflow-ptc'
261
+ config:
262
+ provider: spawn
263
+
264
+ - id: tool-workflow
265
+ name: '@deepseek-ai/dsh-tool-workflow'
266
+
267
+ # ── remaining model-facing rows ─────────────────────────────────────────────
268
+
269
+ - id: tool-ask-user
270
+ name: '@deepseek-ai/dsh-tool-ask-user'
271
+
272
+ - id: tool-todo
273
+ name: '@deepseek-ai/dsh-tool-todo'
274
+ config:
275
+ allowParallelInProgress: true
276
+
277
+ # The `web` service and its search/fetch providers stay in the host
278
+ # composition; only the model-facing tool is per-session. `fetch` reads the
279
+ # host-mounted SSRF-guarded `web-fetch-http` provider.
280
+ - id: tool-web
281
+ name: '@deepseek-ai/dsh-tool-web'
282
+ config:
283
+ fetch: true
284
+ searchTimeoutMs: 60000
285
+
286
+ # Declares deliverable files to the user (file-card surface). Upstream
287
+ # `standard` mounts it; eng is a fork-copy of that block, so this row has to be
288
+ # carried by hand — `tests/upstream-drift.test.mjs` fails when a shipped
289
+ # preset gains rows that eng never picked up.
290
+ - id: present
291
+ name: '@deepseek-ai/dsh-tool-present'
292
+
293
+ # 0.2.1 ships both plugin surfaces disabled by default; enable either only in a
294
+ # copy of this plugins block (edits saved from the Web editor override
295
+ # config.plugins by row id from the profile patch).
296
+ - id: tool-plugin-manager
297
+ name: '@deepseek-ai/dsh-plugin-manager/tools'
298
+ disabled: true
299
+
300
+ - id: tool-plugin-market
301
+ name: '@deepseek-ai/dsh-plugin-market/tools'
302
+ disabled: true
303
+
304
+ # ── subagent waiting ─────────────────────────────────────────────────────────
305
+
306
+ # Preset-local plugin: explicit wait for one continuable child to settle, so
307
+ # the agent can block on a specific subagent (pi-style await_task semantics)
308
+ # without giving up send_message continuations. The module specifier is a
309
+ # bare subpath of this package (@menghuan1918/dsh-apollo/presets/eng/plugins/...):
310
+ # config.plugins names resolve from the profile directory's node_modules,
311
+ # where this package is installed or linked; it has zero bare imports on
312
+ # purpose.
313
+ - id: tool-wait-subagent
314
+ name: '@menghuan1918/dsh-apollo/presets/eng/plugins/wait-subagent/index.js'
315
+
316
+ # ── exit guard ───────────────────────────────────────────────────────────────
317
+ #
318
+ # Preset-local plugin: pi-atlas 式退出守卫。回合结束(agent/turn-stopping)
319
+ # 时若有运行中的直接子代理或后台任务,注入 next-step 提醒(agent.steer)
320
+ # 强制回合继续,直到 wait_subagent / job_output / job_kill 处理完毕或用户
321
+ # 中断(被中断回合不触发)。开关为正式 Config.exitGuard,默认关闭,
322
+ # 每次事件读取当前值,设置保存后即时生效。监听器注册型
323
+ # 插件,无服务发布,无需 realm。
324
+ - id: eng-exit-guard
325
+ name: '@menghuan1918/dsh-apollo/presets/eng/plugins/exit-guard/index.js'
326
+
327
+ # ── mode instructions ────────────────────────────────────────────────────────
328
+
329
+ # Preset-local prompt section carrying the engineering discipline (moved out
330
+ # of the user-global ~/.dsh/AGENTS.md), the delegation policy, the model
331
+ # tiers rendered from Apollo settings (`tiers.*`), and the exit guard
332
+ # contract when that switch is on. Registered as a system-prompt section
333
+ # (order 1, right after the persona slot) so it is scoped to sessions
334
+ # mounted on this preset; its text is re-rendered per request from the live
335
+ # Apollo config. `ptc: true` (set by eng-ptc) adds the rule for fanning
336
+ # out subagents inside one run_code program.
337
+ - id: eng-mode-instructions
338
+ name: '@menghuan1918/dsh-apollo/presets/eng/plugins/mode-instructions/index.js'
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: brainstorming
3
+ description: "Design large requirements as multiple cooperating Specs. Use only when the user explicitly invokes /brainstorming, or asks to split a large task into executable Specs."
4
+ ---
5
+
6
+ # Brainstorming Large Tasks
7
+
8
+ Turn a large requirement into one approved master Spec and at least two executable sub-Specs. Stay KISS: split only along real responsibility, dependency, or verification boundaries.
9
+
10
+ **The end state is a handoff to `/exec`.** Do not implement features, create worktrees, or invoke development skills. Stop once the user approves the written Specs.
11
+
12
+ ## Process
13
+
14
+ 1. **Explore project context** — inspect files, docs, and current project state. Look up facts yourself; do not ask the user.
15
+ 2. **Ask one question at a time** — one decision question per message, walking the design tree systematically, each question led by a recommended answer. Separate facts (look up yourself) from decisions (the user's call). See the question rules below.
16
+ 3. **Offer 2-3 options** — with tradeoffs and a recommendation, leading with the recommended option.
17
+ 4. **Present the design in sections** — scale each section's length to its complexity, and get the user's confirmation on each. When a split is needed, present it (master Spec + sub-Specs, dependency order, shared contracts, integration acceptance).
18
+ 5. **Write all Specs** — self-review after writing (placeholders, contradictions, ambiguity, over-detail) and fix inline. See self-review below.
19
+ 6. **Dispatch a spec-reviewer** — per [`spec-document-reviewer-prompt.md`](spec-document-reviewer-prompt.md), dispatch a fresh read-only `subagent` (quality tier) to review the master Spec and all sub-Specs; fix blockers and re-dispatch if needed.
20
+ 7. **Ask the user to review** — revise per feedback until approved.
21
+ 8. **Hand off to `/exec`** — tell the user to invoke `/exec` with the master Spec path.
22
+
23
+ Done when: the master Spec and all sub-Specs are on disk, the user has approved them, and the `/exec` invocation has been given.
24
+
25
+ ## Question rules
26
+
27
+ - **One question per message.** Wait for the answer before continuing. Asking several at once causes confusion.
28
+ - **Lead with a recommended answer.** Include the reasoning; the user can accept, reject, or amend it.
29
+ - **Facts vs decisions.** Get facts from the codebase or docs; never ask the user. Present decisions to the user and wait for an answer.
30
+ - **Prefer multiple choice**, though open-ended questions are fine too.
31
+ - **Focus on understanding:** goals, constraints, success criteria, architecture, error handling, testing.
32
+
33
+ Do not write Specs before consensus. When a later answer changes a premise, go back and fix earlier decisions.
34
+
35
+ ## Design granularity
36
+
37
+ A sub-Spec defines **what and why**, plus the boundaries needed to implement and verify it independently. It is not an implementation recipe. (The master Spec is exempt — it is just goal + index; see the split guidance.)
38
+
39
+ - Include goals, scope, key decisions, component responsibilities, interactions, externally observable behavior, error semantics, acceptance criteria, and test scope.
40
+ - Leave local coding choices to implementation. No code, pseudocode, private type design, per-file change lists, or step-by-step instructions.
41
+ - Write exact public contracts (API routes, shared schemas, config keys) only when compatibility or migration depends on them.
42
+
43
+ ## Split guidance
44
+
45
+ The master Spec carries only the overall goal + index (see Multi-Spec structure below), never any concrete execution content. **Lean toward more sub-Specs** — split as many as the task has independent units, with two as the floor; finer splits are worth it as long as each sub-Spec can still be implemented and verified independently. Every sub-Spec must be independently implementable and testable, suited to its own Spec → implementation cycle.
46
+
47
+ **Splitting pays off when:** the task is genuinely complex, with multiple independent subsystems or parallel tracks; each sub-Spec has a clear interface; and the split improves clarity rather than just enabling parallelism.
48
+
49
+ **Signals of over-splitting:** circular dependencies between sub-Specs; nothing can be verified independently; shared contracts diverge in several places; sub-Specs carved out with no independent responsibility.
50
+
51
+ Quality over parallelism — split for clarity, not just for parallel execution.
52
+
53
+ ## Multi-Spec structure
54
+
55
+ ### Master Spec
56
+
57
+ **Only the overall goal + index, no execution content.** Confined to: overall goal, scope and non-goals, sub-Spec index (one line per sub-Spec: responsibility + path), dependency DAG and parallel groups, and a pointer to overall acceptance. Push all concrete content — key decisions, shared contracts, component responsibilities, interactions, error semantics — down to the sub-Specs; the master Spec only names which sub-Spec defines/owns each contract. Never implement anything in the master Spec.
58
+
59
+ ### Sub-Spec
60
+
61
+ What independent implementation, review, testing, and commit need: a boundary-clear goal, in-scope/out-of-scope behavior, dependencies, inputs/outputs and shared contracts, error semantics, acceptance criteria, a focused verification scope, and a link back to the master Spec. Do not copy the master Spec; carry over only the contracts execution needs.
62
+
63
+ ## File layout
64
+
65
+ Pick one landing location based on the actual workspace; do not write to both:
66
+
67
+ ```text
68
+ <workspace>/.workspace-docs/specs/MM-DD-<topic>-master-design/ # when the workspace has .workspace-docs/
69
+ <target-repo>/docs/specs/MM-DD-<topic>-master-design/ # otherwise the target repo's own specs directory
70
+ ├── MM-DD-<topic>-master-design.md
71
+ ├── MM-DD-<topic>-<subtask-A>-design.md
72
+ └── MM-DD-<topic>-<subtask-B>-design.md
73
+ ```
74
+
75
+ - Link master Spec and sub-Specs to each other in both directions.
76
+ - When the directory already holds other Specs, follow their file naming and header format; do not introduce a second convention.
77
+ - When writing under `.workspace-docs/`, give every file an OKF header (`type: Design Spec`, `title`, `description`, `tags`, `status`, `repos`); committing and pushing follow that repo's own `AGENTS.md`. Where the target repo has no such convention, use its existing doc format and do not invent OKF.
78
+
79
+ ## Self-review
80
+
81
+ After writing, check with fresh eyes: placeholders (`TODO`/`TBD`), internal consistency, scope focus, ambiguity, over-detail. Fix everything inline. This is your own first pass; a spec-reviewer subagent then does the independent review (process step 6).
82
+
83
+ ## Visual aids
84
+
85
+ When showing beats telling (mockups, layouts, architecture diagrams, option comparisons), write a self-contained HTML file to the system temp directory (`$TMPDIR`, or `/tmp` when unset), named `brainstorm-<topic>-<n>.html`:
86
+
87
+ - Write the complete document with the write tool: inline CSS, no external dependencies, no scripts, no server; 2-4 options or variants per page.
88
+ - Never reuse a file name; for iterations write a new file (`-2`, `-3`).
89
+ - Tell the user the file path (the DSH UI can open it for preview directly) and summarize the page in one or two sentences; the user looks, then answers back in the conversation — clicks are not collected.
90
+ - Decide per question whether a visual helps; keep conceptual choices (A/B/C options, tradeoff lists) in the conversation.