cowork-flow 0.0.50 → 0.0.52

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 (37) hide show
  1. package/CHANGELOG.md +69 -25
  2. package/README.md +44 -4
  3. package/package.json +2 -1
  4. package/presets/dsh/agent.cordis.yml +206 -0
  5. package/presets/dsh/plugins/workflow-state.js +293 -0
  6. package/presets/dsh/preset.yml +2 -0
  7. package/src/cli.js +12 -0
  8. package/src/commands/install-dsh-hook.js +225 -0
  9. package/src/commands/install-dsh-preset.js +72 -0
  10. package/template/.cowork-flow/.version +1 -1
  11. package/template/.cowork-flow/adapters/dsh/adapter.yaml +30 -0
  12. package/template/.cowork-flow/adapters/zcode/adapter.yaml +30 -0
  13. package/template/.cowork-flow/scripts/adapters/cli/batch_mode.py +7 -0
  14. package/template/.cowork-flow/scripts/adapters/cli/task_navigation.py +20 -2
  15. package/template/.cowork-flow/scripts/adapters/cli/task_next_runner.py +35 -3
  16. package/template/.cowork-flow/scripts/adapters/cli/task_parser.py +6 -3
  17. package/template/.cowork-flow/scripts/infra/paths.py +9 -1
  18. package/template/.cowork-flow/scripts/infra/process.py +32 -0
  19. package/template/.cowork-flow/scripts/infra/skill_manifest.py +11 -2
  20. package/template/.cowork-flow/scripts/run.py +2 -8
  21. package/template/.cowork-flow/scripts/runtime/session_state.py +32 -3
  22. package/template/.cowork-flow/scripts/services/plan_binding.py +21 -0
  23. package/template/.cowork-flow/scripts/services/task_archive.py +45 -0
  24. package/template/.cowork-flow/scripts/services/task_creation.py +2 -5
  25. package/template/.cowork-flow/scripts/services/task_lifecycle.py +24 -1
  26. package/template/.cowork-flow/scripts/services/workflow_runtime.py +2 -11
  27. package/template/.cowork-flow/spec/contracts/plan-binding.md +17 -0
  28. package/template/.cowork-flow/spec/runtime/host-assets.json +77 -0
  29. package/template/.cowork-flow/spec/schemas/host-assets.schema.json +2 -1
  30. package/template/.dsh/README.md +37 -0
  31. package/template/.zcode/.zcode-plugin/plugin.json +1 -1
  32. package/template/.zcode/hooks/hooks.json +15 -0
  33. package/template/.zcode/hooks/inject-context.js +167 -22
  34. package/template/.zcode/hooks/inject-context.selfcheck.mjs +256 -4
  35. package/template/AGENTS.md +3 -2
  36. package/template/skills/brainstorming/manifest.json +1 -1
  37. package/template/skills/runtime-health/scripts/doctor.py +105 -0
package/CHANGELOG.md CHANGED
@@ -1,41 +1,85 @@
1
1
  # Changelog
2
2
 
3
- ## 0.0.47 - 2026-08-05
3
+ ## 0.0.52 - 2026-08-26
4
4
 
5
- ### Release readiness
5
+ ### ZCode 宿主与 hook 体验
6
6
 
7
- - Added `npm run release:check` as the documented local release confidence gate. It currently delegates to `npm run test:all`, which runs Node full tests, template full tests, and `pack:check`.
8
- - Added this changelog to summarize release highlights and publish-time verification notes.
7
+ - 修复 hook 过期会话污染:按会话身份选取活动任务,全局兜底跳过失效绑定与 subagent 会话;显式身份无绑定时对齐 CLI 判 `no_task` 并列出可改绑活动任务。
8
+ - 注册 zcode 为一等宿主平台:`host-assets.json` platforms 条目 + `adapters/zcode/adapter.yaml`,alias 解析、平台检测、adapter 一致性校验与 doctor 全链路覆盖;`.zcode/` 维持插件分发不落工程。
9
+ - 纯 zcode 工程生命周期可用:技能落盘 `.cowork-flow/skills/`(宿主提示层仍由插件单源提供),内核 `skill_roots()` 解析 action owner;`detectAny` 增加 adapter 标记修复 sync 静默失养。
10
+ - contract digest 注入瘦身:SessionStart(含 compact/clear)注入完整块,UserPromptSubmit 仅重复指纹行。
11
+ - 新增 PostToolUse(Bash) 轮内刷新:生命周期命令落定后立即注入最新 workflow-state 与指纹行,无关命令零输出。
9
12
 
10
- ### Runtime and workflow hardening
13
+ ### 运行时与诊断
11
14
 
12
- - Hardened runtime context lifecycle, recovery observability, and fixed-subagent binding diagnostics.
13
- - Added Batch execution inspect facts, stronger Host action result validation, and documented Batch recovery behavior.
14
- - Normalized runtime-health and task-review issue facts so review output is easier to consume.
15
+ - 生命周期转换在提交单元内原子写 `.runtime/state-snapshot.json`;hook 在快照与所选任务一致时采用快照面包屑键,缺失或不一致回退 status 推导。Python 共享 hook 协议(build_hook_context)补直接单测。
16
+ - doctor 新增会话卫生检查:报告失效任务绑定、超龄未活跃、不可读的运行时会话文件。
15
17
 
16
- ### Host assets and integrations
18
+ ### 文档
17
19
 
18
- - Centralized Host Asset Manifest sync policy helpers and added a Host capability matrix contract.
19
- - Protected the ZCode multi-module scaffold boundary so plugin scaffolding does not vendor `.cowork-flow/` runtime files into module directories.
20
+ - AGENTS.md 0.1 明确注入块优先、勿重复运行导航器;README 平台清单与技能分发表同步 zcode。
20
21
 
21
- ### Party Mode
22
+ ## 0.0.51 - 2026-08-15
22
23
 
23
- - Extracted Party Mode board storage, enriched final report facts, and aligned Host action fallbacks with the capability matrix boundary.
24
- - Preserved the advisory-only contract: Party Mode does not advance task lifecycle state and does not replace implement/check review.
24
+ ### DSH host 接入
25
25
 
26
- ### Sync, update, and support UX
26
+ - 注册 DeepSeek Harness(dsh)host adapter 与平台标签映射(dsh_ context keys)。
27
+ - 新增 `install-dsh-preset` 分发 DSH agent 预设;预设内置 workflow-state hook 插件,向系统提示注入与其它宿主同构的 `<workflow-state>` 块,每条用户消息刷新,生命周期命令落定后轮内刷新。
28
+ - 补齐协议失败静默降级边界测试;记录 DSH 子代理绑定 field-test 路径(subagent init/bind/close)。
27
29
 
28
- - Added `sync --dry-run` readiness reports covering would-copy, protected skips, obsolete removals, Host asset refresh, pending recovery, and warnings.
29
- - Added `update --dry-run` readiness output so CLI updates can be previewed without installing.
30
- - Added the product support and troubleshooting playbook for task routing, runtime binding, Batch, Host asset drift, Party Mode, and release checks.
30
+ ### 计划绑定
31
31
 
32
- ### Verification
32
+ - `--from-plan` 支持绑定计划到 planning 任务(plan binding lite 收口),补 --from-plan help 与实际行为一致。
33
+ - 归档任务快照绑定计划(snapshot bound plan into archived task)。
33
34
 
34
- - Release gate: `npm run release:check`
35
- - Formatting gate: `git diff --check`
36
- - Windows note: POSIX-shell-only release tests may be reported as skipped when POSIX shell is unavailable; skips must remain visible and must not be reported as passes.
35
+ ### 运行时与发布
37
36
 
38
- ### Publish notes
37
+ - `platform_from_context_key` 单源化并修复 zcode 平台漂移;zcode 会话上下文确定性解析;slug 前缀与任务 id/name 归一。
38
+ - 共享 PYTHONPATH bootstrap;批量动作与 codex hook 在 Windows 通过 cmd wrapper 运行。
39
+ - CI 在 Ubuntu/Windows 双平台跑全量 pytest;发布流程先同步 Skill replicas 再过全量门禁。
39
40
 
40
- - This entry documents the current `0.0.47` release candidate. It does not tag, publish, or bump the package version by itself.
41
- - Before publishing, confirm the version in `package.json`, `package-lock.json`, `template/.cowork-flow/.version`, and `template/.zcode/.zcode-plugin/plugin.json` matches the intended release.
41
+ ## 0.0.50 - 2026-08-10
42
+
43
+ ### 文档
44
+
45
+ - task-review 技能把用户自定义 spec 明确为绑定义务(binding obligations)。
46
+
47
+ ## 0.0.49 - 2026-08-08
48
+
49
+ ### 计划与任务
50
+
51
+ - 引入 plan binding lite:任务元数据绑定计划文件,Normal/High-risk 任务启动前校验计划与 decision anchor 就绪。
52
+ - `task next` 暴露实现优先读上下文(implement read-first);test-first 技能强化 red-green 指引。
53
+
54
+ ### 运行时与架构
55
+
56
+ - 新增源码检出 source-refresh 命令;任务上下文服务模块化,lifecycle CLI adapter 瘦身;架构护栏测试固化边界。
57
+ - 状态恢复诊断增强;host manifest 契约对齐;批量与 party 编排器模块化。
58
+ - 保持 python 3.9 runner 兼容。
59
+
60
+ ### CI / 发布
61
+
62
+ - 增加 Windows 发布信心门禁;发布验证测试稳定化。
63
+
64
+ ## 0.0.48 - 2026-08-05
65
+
66
+ ### 运行时与流程
67
+
68
+ - 拆分 lifecycle 命令;route 契约收紧;runtime context 生命周期硬化,恢复元数据错误 fail-closed;subagent 运行错误码透出。
69
+ - 移除 legacy changes control plane 与 add-session journal 工作流;guides 指引归入规划阶段。
70
+
71
+ ### Party Mode 与 Batch
72
+
73
+ - 抽取 Party board 存储层;final report facts 丰富;host action fallback 对齐 capability matrix。
74
+ - Batch 增加 inspect facts 与 host action 结果校验;恢复契约文档化。
75
+
76
+ ### Host 资产与健康
77
+
78
+ - 新增 host capability matrix 契约;host-assets sync 策略集中;防止 ZCode scaffold 向模块目录泄漏流程文件。
79
+ - task-review issue 与 runtime-health envelope 归一,review/health 输出更易消费。
80
+
81
+ ### 文档
82
+
83
+ - README 项目概览刷新、任务流程图;产品故障排查 playbook;changelog 发布就绪说明。
84
+
85
+ ## 0.0.47 - 2026-08-05
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  |---|---|
13
13
  | 任务流程 | `task next --json` 给出下一步 action,`task next --run` 只执行当前 action。 |
14
14
  | 运行健康 | `doctor` 诊断 runtime、host assets、Skill replica 和任务 hygiene,不推进生命周期。 |
15
- | Host 分发 | Host Asset Manifest 驱动 Codex / OpenCode / Claude Code / ZCode 资产和 obsolete 清理。 |
15
+ | Host 分发 | Host Asset Manifest 驱动 Codex / OpenCode / Claude Code / ZCode / DeepSeek Harness 资产和 obsolete 清理。 |
16
16
  | 批处理与讨论 | Batch 发布 Host action;Party Mode 只输出 advisory final facts。 |
17
17
  | 发布准备 | `release:check`、`CHANGELOG.md`、`pack:check` 固定发布前证据。 |
18
18
 
@@ -58,11 +58,17 @@ cowork-flow update --dry-run
58
58
  # 安装 ZCode 插件(可选)
59
59
  cowork-flow install-zcode-plugin
60
60
 
61
+ # 安装 DSH 预设(可选,整套 agent)
62
+ cowork-flow install-dsh-preset
63
+
64
+ # 机器级安装实时 workflow-state 注入(推荐:不换预设,任意 DSH 会话生效)
65
+ cowork-flow install-dsh-hook
66
+
61
67
  # 维护者发布前检查
62
68
  npm run release:check
63
69
  ```
64
70
 
65
- 平台选项:`codex` / `opencode` / `claude-code` / `all`(逗号分隔)
71
+ 平台选项:`codex` / `opencode` / `claude-code` / `dsh` / `zcode` / `all`(逗号分隔)
66
72
 
67
73
  ## 仓库结构
68
74
 
@@ -74,6 +80,7 @@ template/
74
80
  ├── .codex/ # Codex agents / hooks / config
75
81
  ├── .claude/ # Claude Code settings / agents / hooks
76
82
  ├── .opencode/ # OpenCode agents / commands / plugins
83
+ ├── .dsh/ # DeepSeek Harness 标记(sync 检测 + 说明)
77
84
  ├── .zcode/ # ⭐ ZCode 插件(hooks + skills + agents + scaffold instructions)
78
85
  └── .cowork-flow/
79
86
  ├── config.yaml # 项目配置
@@ -100,7 +107,9 @@ Skills 维护在 `template/skills/` 唯一源码,`init` / `sync` 时按目录
100
107
  | 平台 | 目标目录 |
101
108
  |---|---|
102
109
  | `codex` / `opencode` | `.agents/skills/` |
110
+ | `dsh` | `.agents/skills/` |
103
111
  | `claude-code` | `.claude/skills/` |
112
+ | `zcode` | `.cowork-flow/skills/`(内核 owner 解析用;系统提示层仍由 ZCode 插件单源提供,不重复加载) |
104
113
 
105
114
  分发动作:`adversarial-review`、`agent-dispatch`、`batch-execution`、`brainstorming`、`cowork-flow`、`cowork-flow-maintenance`、`decision-audit`、`failure-analysis`、`game-design`、`party-mode`、`python-runtime-design`、`runtime-health`、`spec-sync`、`task-planning`、`task-review`、`test-first`
106
115
 
@@ -112,13 +121,15 @@ Skills 维护在 `template/skills/` 唯一源码,`init` / `sync` 时按目录
112
121
  | `sync <path> [--dry-run]` | 同步已初始化项目的模板和技能 |
113
122
  | `source-refresh [path] [--dry-run]` | 维护者刷新 source checkout 的 ignored live runtime 与 Host Skill replica |
114
123
  | `install-zcode-plugin` | 安装 ZCode 插件到全局缓存 |
124
+ | `install-dsh-preset` | 安装 DSH agent 预设到 `~/.dsh/.agent-presets/cowork-flow/`(整套 agent,可选) |
125
+ | `install-dsh-hook` | 机器级注册 workflow-state hook 组合行到 `$DSH_HOME/cordis.patch.yml`(当前 DSH 的 agent 提示不收集 host 层 section,实时注入请用预设方式) |
115
126
  | `update [--dry-run]` | 升级 CLI 本身 |
116
127
 
117
128
  ### init 选项
118
129
 
119
130
  | 选项 | 说明 |
120
131
  |---|---|
121
- | `--platform <p>` | 平台:`codex` / `opencode` / `claude-code` / `all` |
132
+ | `--platform <p>` | 平台:`codex` / `opencode` / `claude-code` / `dsh` / `zcode` / `all` |
122
133
  | `--developer <n>` | 开发者名称 |
123
134
  | `--force` | 覆盖已有文件 |
124
135
  | `--dry-run` | 预览不写入 |
@@ -161,7 +172,7 @@ ZCode 插件只安装 hook、skills、agents 和轻量说明文件;`.cowork-fl
161
172
 
162
173
  **Hook 注入内容:**
163
174
  - `workflow-state` — 当前任务状态
164
- - `contract-digest` — 合同摘要(SHA256 fingerprint)
175
+ - `contract-digest` — 合同摘要:SessionStart 注入完整块,后续消息仅重复 SHA256 fingerprint
165
176
  - `delegated_subtask` — 子代理运行时上下文
166
177
 
167
178
  **插件子代理:**
@@ -169,6 +180,35 @@ ZCode 插件只安装 hook、skills、agents 和轻量说明文件;`.cowork-fl
169
180
  - `cowork-check` — 绑定 runtime context 后做独立检查
170
181
  - `cowork-research` — 绑定 runtime context 后做只读调研
171
182
 
183
+ ## DSH 接入
184
+
185
+ ```bash
186
+ cowork-flow init ./my-project --platform dsh # 项目资产:AGENTS.md + .agents/skills/ + .dsh 标记
187
+ cowork-flow install-dsh-hook # 机器级:注册 hook 组合行(实时注入见下方说明)
188
+ ```
189
+
190
+ `install-dsh-hook` 把 `workflow-state.js` 插件作为 `insert:` patch 注册到 `$DSH_HOME/cordis.patch.yml`(未设置 `DSH_HOME` 时默认 `~/.dsh`),组合层面可被 `dsh --dump-config` 验证。经实测(DSH 0.1.1-rc.1),**agent 提示组装不收集 host 层 section**:该组合行不会在会话系统提示中产生 `<workflow-state>` 块。当前 DSH 版本下实时注入仍需预设方式(`install-dsh-preset`);本命令保留为组合层面的幂等注册能力(卸载见下),待 DSH 支持 agent-scope patch / workspace 级组合后可直接生效(见 `docs/dsh-upstream-proposal.md`)。
191
+
192
+ 在未安装 cowork-flow 的项目里 hook 完全无感:JS 侧根目录预检直接短路——不注入内容、不启动 Python 进程。全局开关(环境变量):`COWORK_FLOW_HOOKS=0` / `COWORK_FLOW_DISABLE_HOOKS=1`。卸载:`cowork-flow install-dsh-hook --uninstall`(`--force` 同时删除插件文件)。
193
+
194
+ > 安装或更新后需要**重启 DSH**(`cordis.patch.yml` 在启动时组合,新增/变更不会被热加载)。
195
+
196
+ > 使用预设(`install-dsh-preset`)时无需再运行 `install-dsh-hook`——预设已内置同一 hook。
197
+
198
+ ## DSH 预设
199
+
200
+ ```bash
201
+ cowork-flow install-dsh-preset # 安装
202
+ cowork-flow install-dsh-preset --force # 覆盖已安装
203
+ cowork-flow install-dsh-preset --dry-run # 预览不写入
204
+ ```
205
+
206
+ 安装到 `~/.dsh/.agent-presets/cowork-flow/`(`DSH_HOME` 存在时以其为准):`agent.cordis.yml` + `preset.yml` + 全部流程技能。安装后在 DeepSeek Harness 中新建会话并选择 **Cowork Flow** 预设即可使用:persona 携带流程门禁规则,技能目录随预设挂载,不依赖项目本地副本。
207
+
208
+ 预设组合是部署 `standard` 预设的拷贝 + 最小改动(persona 流程规则、`skill-filesystem` 指向预设自带 `skills/`);`cowork-flow init --platform dsh` 仍负责项目级资产(`AGENTS.md`、`.agents/skills/`、`.dsh/` 标记)。
209
+
210
+ 预设内置 **workflow-state hook**(`plugins/workflow-state.js`):DSH 原生等效于 Codex/Claude hook,向系统提示末尾注入与其它宿主同构的 `<workflow-state>` 块,每条用户消息刷新一次,并在生命周期命令(`task`/`subagent`/`resume`)执行完成后立即轮内刷新(替换语义,不累积)。项目无 `.cowork-flow` 根、缺少 Python 或设 `COWORK_FLOW_HOOKS=0` / `COWORK_FLOW_DISABLE_HOOKS=1` 时静默降级,由 AGENTS.md 门禁的运行导航器兜底。
211
+
172
212
  ## 任务流程
173
213
 
174
214
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cowork-flow",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
4
4
  "description": "CLI for installing and maintaining cowork-flow collaboration templates.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,6 +11,7 @@
11
11
  "src",
12
12
  "template",
13
13
  "template/.zcode",
14
+ "presets",
14
15
  "README.md",
15
16
  "CHANGELOG.md",
16
17
  "!template/**/__pycache__/**",
@@ -0,0 +1,206 @@
1
+ # The `cowork-flow` agent preset: the standard coding agent plus the
2
+ # cowork-flow workflow framework (task gate, planning, fixed subagents, skills).
3
+ #
4
+ # This file is a copy of the deployment's `standard` preset with two changes:
5
+ # the persona carries cowork-flow operating rules, and `skill-filesystem`
6
+ # points at this preset's own `skills/` directory (installed alongside by
7
+ # `cowork-flow install-dsh-preset`).
8
+ #
9
+ # The `dsh` host adapter lives in the cowork-flow repository
10
+ # (template/.cowork-flow/adapters/dsh/adapter.yaml) and declares this preset's
11
+ # capability model; this file is the DSH-side composition it describes.
12
+
13
+ # ── identity ────────────────────────────────────────────────────────────────
14
+
15
+ - id: persona
16
+ name: '@deepseek-ai/dsh-persona'
17
+ config:
18
+ text: >-
19
+ You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
20
+
21
+ 你运行在 cowork-flow 流程框架上。项目已接入时,工作区 AGENTS.md 的"0.1 编码前强制门禁"生效:编辑文件、变更代码、派发子代理之前,先确定当前工作流状态(系统提示含 <workflow-state> 块则按其路由,否则运行 ./.cowork-flow/run task next),再决定放行、阻断还是路由;no_task / planning / completed 状态阻断写代码。只读问答、纯查询命令、用户明确说"跳过流程"时豁免。
22
+
23
+ 子代理身份由 runtime context 绑定决定,不由 prompt 推断:固定子代理(cowork-implement / cowork-check / cowork-research)按 agent-dispatch 技能执行 subagent bind / close,未绑定时禁止 start / resume / archive / commit / 派发 agent。
24
+
25
+ 项目流程以 task next、runtime gate、Skill command manifests 和 .cowork-flow/spec/ 硬契约为准;不要维护第二套流程文档或 Skill 注册控制面。文档语言中文;提交策略允许 AI 提交。
26
+
27
+ - id: agent-instructions
28
+ name: '@deepseek-ai/dsh-agent-instructions'
29
+ config:
30
+ maxBytes: 65536
31
+
32
+ # ── shell ───────────────────────────────────────────────────────────────────
33
+
34
+ - id: tool-bash
35
+ name: '@deepseek-ai/dsh-tool-bash'
36
+ disabled: !!js process.platform === 'win32'
37
+
38
+ - id: tool-pwsh
39
+ name: '@deepseek-ai/dsh-tool-pwsh'
40
+ disabled: !!js process.platform !== 'win32'
41
+
42
+ # ── filesystem ──────────────────────────────────────────────────────────────
43
+
44
+ - id: tool-fs
45
+ name: '@deepseek-ai/dsh-tool-fs'
46
+
47
+ - id: tool-fs-search
48
+ name: '@deepseek-ai/dsh-tool-fs-search'
49
+ config:
50
+ sampleOverCapGlobResults: false
51
+
52
+ # ── background jobs ────────────────────────────────────────────────────────
53
+
54
+ - id: tool-jobs
55
+ name: '@deepseek-ai/dsh-tool-jobs'
56
+
57
+ # ── skills ──────────────────────────────────────────────────────────────────
58
+
59
+ # The skill REGISTRY lives in the host composition and is layered per scope:
60
+ # these rows register into THIS preset's layer of it. `skill-filesystem`
61
+ # contributes the cowork-flow skills shipped with this preset (`customSkillDirs`,
62
+ # resolved against the preset's own directory via `baseUrl`) on top of the
63
+ # local-root discovery for the current workspace.
64
+ - id: skill-filesystem
65
+ name: '@deepseek-ai/dsh-skill-filesystem'
66
+ config:
67
+ customSkillDirs:
68
+ - !!js "process.getBuiltinModule('node:url').fileURLToPath(new URL('skills/', baseUrl))"
69
+
70
+ - id: tool-skill
71
+ name: '@deepseek-ai/dsh-tool-skill'
72
+
73
+ # ── workflow state hook ────────────────────────────────────────────────────
74
+ # DSH-native equivalent of the Codex/Claude hooks: registers a system-prompt
75
+ # section (rendered last) that carries the `<workflow-state>` block, refreshed
76
+ # per user message. Consumes the host `systemPrompt` registry and publishes
77
+ # nothing, so it sits loose like the tool rows above.
78
+ - id: workflow-state-hook
79
+ name: './plugins/workflow-state.js'
80
+
81
+ # ── goals ───────────────────────────────────────────────────────────────────
82
+
83
+ - id: tool-goal
84
+ name: '@deepseek-ai/dsh-tool-goal'
85
+
86
+ # ── plan mode ───────────────────────────────────────────────────────────────
87
+
88
+ - id: planning
89
+ name: cordis:group
90
+ group: true
91
+ isolate:
92
+ planMode: true
93
+ config:
94
+ - id: plan-mode
95
+ name: '@deepseek-ai/dsh-plan-mode'
96
+ config:
97
+ section: |
98
+ You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user 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.
99
+
100
+ 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.
101
+
102
+ 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.
103
+
104
+ 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.
105
+
106
+ 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.
107
+
108
+ 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.
109
+
110
+ # ── compaction ──────────────────────────────────────────────────────────────
111
+
112
+ - id: compaction
113
+ name: cordis:group
114
+ group: true
115
+ isolate:
116
+ compaction: true
117
+ toolResultPruner: true
118
+ config:
119
+ - id: compaction-basic
120
+ name: '@deepseek-ai/dsh-compaction-basic'
121
+
122
+ - id: command-compact
123
+ name: '@deepseek-ai/dsh-command-compact'
124
+
125
+ - id: tool-result-pruner
126
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
127
+ config:
128
+ thresholdChars: 8192
129
+ headChars: 4096
130
+ tailChars: 1024
131
+
132
+ # ── delegation and workflows ────────────────────────────────────────────────
133
+
134
+ - id: delegation
135
+ name: cordis:group
136
+ group: true
137
+ isolate:
138
+ workflowEngine: true
139
+ config:
140
+ - id: tool-subagent-control
141
+ name: '@deepseek-ai/dsh-tool-subagent-control'
142
+
143
+ - id: tool-subagent-list-agents
144
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
145
+
146
+ - id: tool-subagent
147
+ name: '@deepseek-ai/dsh-tool-subagent'
148
+ config:
149
+ provider: spawn
150
+ toolName: subagent
151
+ backgroundMode: continuable
152
+
153
+ - id: tool-subagent-fork
154
+ name: '@deepseek-ai/dsh-tool-subagent'
155
+ config:
156
+ provider: fork
157
+ toolName: subagent_fork
158
+ backgroundMode: continuable
159
+
160
+ - id: tool-subagent-codex
161
+ name: '@deepseek-ai/dsh-tool-subagent'
162
+ disabled: true
163
+ config:
164
+ provider: codex
165
+ toolName: subagent_codex
166
+ enableRunInBackground: false
167
+ maxDepth: provider-managed
168
+
169
+ - id: tool-subagent-claude-code
170
+ name: '@deepseek-ai/dsh-tool-subagent'
171
+ disabled: true
172
+ config:
173
+ provider: claude-code
174
+ toolName: subagent_claude_code
175
+ enableRunInBackground: false
176
+ maxDepth: provider-managed
177
+
178
+ - id: workflow-worker-thread
179
+ name: '@deepseek-ai/dsh-workflow-worker-thread'
180
+ config:
181
+ provider: spawn
182
+
183
+ - id: tool-workflow
184
+ name: '@deepseek-ai/dsh-tool-workflow'
185
+
186
+ - id: tool-ralph
187
+ name: '@deepseek-ai/dsh-tool-ralph'
188
+ config:
189
+ subagentProvider: spawn
190
+ maxRounds: 64
191
+
192
+ # ── remaining model-facing rows ─────────────────────────────────────────────
193
+
194
+ - id: tool-ask-user
195
+ name: '@deepseek-ai/dsh-tool-ask-user'
196
+
197
+ - id: tool-todo
198
+ name: '@deepseek-ai/dsh-tool-todo'
199
+ config:
200
+ allowParallelInProgress: true
201
+
202
+ - id: tool-web
203
+ name: '@deepseek-ai/dsh-tool-web'
204
+ config:
205
+ fetch: false
206
+ searchTimeoutMs: 60000