dsh-lead-mode 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,7 +34,18 @@ It is not tied to the preset. Any session can load it, two ways:
34
34
  - The model loads it when it judges the task needs it (the skill is marked model-invocable)
35
35
  - You run `/skill lead-mode` yourself
36
36
 
37
- It covers: agreeing on the goal before starting, making a delegation self-contained, keeping write scopes disjoint, the list/get/claim/complete flow for shared tasks, the rules for waiting on teammates, and doing the final verification yourself.
37
+ It covers: agreeing on the goal before starting, making a delegation self-contained, keeping write scopes disjoint, the list/get/claim/complete flow for shared tasks, how to wait on teammates, where a teammate's model comes from, and doing the final verification yourself.
38
+
39
+ Two of those facts only show up when you read the runtime source:
40
+
41
+ | Fact | Why it matters |
42
+ |---|---|
43
+ | A teammate settling notifies you automatically, carrying its closing message | Finish your turn after delegating; you do not need to sit and watch |
44
+ | A task change does not wake an idle Lead | Do not count on "it marked the task complete, so I know"; that path only wakes a caller currently inside `wait_agent` |
45
+
46
+ So the skill's default is: finish your turn after delegating and let the notification wake you (the user sees progress immediately), and use one `wait_agent` only when the current turn cannot continue without the result. Never loop `wait_agent`, and never poll with repeated `list_agents`.
47
+
48
+ Tell the teammate to put the **deliverable in its closing message** — that message is what comes back to you with the notification.
38
49
 
39
50
  ### 3. The dependency self-check command
40
51
 
package/README.zh-CN.md CHANGED
@@ -34,7 +34,18 @@
34
34
  - 模型判断需要时自己加载(skill 标记为模型可调用)
35
35
  - 你直接敲 `/skill lead-mode`
36
36
 
37
- 覆盖这些内容:开工前对齐目标、派活必须自包含、写作用域不重叠、共享任务的 list/get/claim/complete 流程、等 teammate 的规矩、最终验证自己做。
37
+ 覆盖这些内容:开工前对齐目标、派活必须自包含、写作用域不重叠、共享任务的 list/get/claim/complete 流程、怎么等 teammate、teammate 的模型从哪来、最终验证自己做。
38
+
39
+ 其中两条是读源码才确认的,容易踩:
40
+
41
+ | 事实 | 为什么重要 |
42
+ |---|---|
43
+ | teammate 收工会自动通知你,通知里带它收尾那条消息 | 派完活结束回合就够,不用盯着等 |
44
+ | task 变更不会唤醒空闲的 Lead | 别指望「它把 task 标 complete 了我就知道了」,那条路只唤醒正在 `wait_agent` 的调用方 |
45
+
46
+ 所以 skill 的默认建议是:派完活就结束回合等通知(用户立刻看到进展),只有本回合内就必须拿到结果时才用一次 `wait_agent`。不要 `wait_agent` 套循环,也不要反复 `list_agents` 轮询。
47
+
48
+ 派活 prompt 里要要求 teammate **把交付物写进收尾那条消息**——那条消息会随通知回到你手上。
38
49
 
39
50
  ### 三、依赖自检命令
40
51
 
package/cordis.patch.yml CHANGED
@@ -50,9 +50,13 @@
50
50
  有这些工具,就按 Lead 工作法干活:
51
51
 
52
52
  - 派活自包含。teammate 看不到你的上下文,把目标、约束、验收标准、已知失败、绝对路径都写进 prompt。
53
+ - 要求它收尾那条消息写清交付物。它收工时那条消息会随通知回到你手上。
53
54
  - 写作用域不重叠。一人一块文件。分不开的活排成依赖。
54
- - 共享任务走 list、get、claim(带 revision)、干、complete。
55
- - 等齐必需的 teammate 再给最终答复。等之前先 list_agents 确认有人 running。
55
+ - 共享任务走 list、get、claim(带 revision)、干、complete。task 只是账本,不是唤醒通道。
56
+ - 等活就结束回合等通知:teammate 收工、或给你发消息,都会唤醒你。task 变更只唤醒正在 wait_agent 的调用方,不会唤醒空闲的你。
57
+ - 不要用 wait_agent 套循环,也不要反复 list_agents 轮询。只有本回合内就必须拿到结果时才等一次。
58
+ - 等齐必需的 teammate 再给最终答复。
59
+ - teammate 继承你的模型,spawn_teammate 没法单独指定模型。
56
60
  - 最终验证自己做:跑测试、看 diff、核数字。不要只信回报。
57
61
  - id: agent-instructions
58
62
  name: '@deepseek-ai/dsh-agent-instructions'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-lead-mode",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Lead mode for DSH: an agent preset, a working-method skill, a dependency self-check, and two reminders that tell you to enable the official Agent Teams. | 给 DSH 加 Lead 模式:预设、skill、依赖自检、两条前置提醒。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -31,18 +31,79 @@ dsh plugin --profile <你的 profile 名> add @deepseek-ai/dsh-experimental-agen
31
31
 
32
32
  目标或指令有疑问先问用户。别自己挑一个解释就开始干。
33
33
 
34
- ## 派活必须自包含
34
+ ## 等通知,别轮询
35
35
 
36
- teammate 看不到你的上下文。它能看到的只有你写的那段 prompt。
36
+ teammate 干完你**会被唤醒**,不用自己盯着。
37
37
 
38
- 派活时把这些写全:
38
+ | 事件 | 唤醒空闲的你吗 | 带回什么 |
39
+ |---|---|---|
40
+ | teammate 一轮干完、没有新消息 | 会 | 它收尾那条消息 |
41
+ | teammate 主动 `send_message` 给你 | 会 | 那条消息 |
42
+ | task 被 claim 或 complete | **不会** | 只唤醒正在 `wait_agent` 的调用方 |
43
+
44
+ 所以默认这么做:**派完活就结束回合。** 把「派了谁、等什么」写清楚,然后收工。用户立刻看到进展,你不空转。teammate 收工时你被唤醒,接着干。
45
+
46
+ `wait_agent` 只在「本回合内就必须拿到结果才能继续」时用一次。它的好处是 task 变更也能唤醒它。默认等 30 秒,上限 1 小时。
47
+
48
+ 禁止这两件事:
49
+
50
+ - 用 `wait_agent` 套循环
51
+ - 反复 `list_agents` 轮询
52
+
53
+ `list_agents` 只用来回答「谁在跑、谁卡住了」,不用来等。
54
+
55
+ `wait_agent` 返回 `noProgress` 不是错误,是告诉你没人在跑,该换手段。
56
+
57
+ ## 派活的四个参数
58
+
59
+ `spawn_teammate` 只有 `name`、`description`、`prompt`、`context` 四个参数。
60
+
61
+ | 参数 | 要点 |
62
+ |---|---|
63
+ | `name` | 小写连字符。**永久,不可复用**,创建失败的名字也占着 |
64
+ | `description` | 一行职责,给用户看,也给你后面对账 |
65
+ | `prompt` | 全部指令。teammate 只看到这一段 |
66
+ | `context` | `fresh`(默认)看不到你的历史;`fork` 继承你已完成的回合 |
67
+
68
+ `context` 怎么挑:
69
+
70
+ - **绝大多数用 `fresh`。** 活是自包含的,把上下文写进 prompt 就够。
71
+ - 只有当活依赖你已经掌握、又写不进 prompt 的东西时,才用 `fork`。
72
+
73
+ 取名字前先 `list_agents` 看一眼,别撞已占用的名字。
74
+
75
+ ## prompt 怎么写
76
+
77
+ teammate 看不到你的上下文。它能看到的只有 `prompt`。
78
+
79
+ 把这些写全:
39
80
 
40
81
  - 目标、约束、验收标准
41
82
  - 已知的失败现象和报错原文
42
83
  - 相关文件路径,用绝对路径
43
84
  - 环境坑,比如本机 `diff` 是坏的要用 `/usr/bin/diff`
44
85
 
45
- 派活 prompt 里写「按刚才说的做」等于没派。它不知道「刚才」。
86
+ 写「按刚才说的做」等于没派。它不知道「刚才」。
87
+
88
+ ### 收尾那条消息就是交付物
89
+
90
+ teammate 收工时,它**最后那条消息**会随通知回到你手上,格式是「Its closing message:」加正文。
91
+
92
+ 所以派活时直接要求它收尾写清:
93
+
94
+ ```
95
+ 收尾那条消息写四块:结论 / 文件清单 / 验收输出 / 偏离规格的地方。
96
+ ```
97
+
98
+ 这比你额外要求一次 `send_message` 省事,而且是你默认拿得到的东西。
99
+
100
+ 需要**中途**进度(干到一半问一句、或者要它先确认再继续)时,才另外要求它 `send_message` 给你。
101
+
102
+ ### 收尾消息可能被省掉
103
+
104
+ 如果 teammate 在收工前刚给你发过 `send_message`,通知里不会重复它的收尾正文,而是写「It sent you a message just before finishing, so its closing message is omitted.」。
105
+
106
+ 也就是说:你要么拿到收尾消息,要么拿到它发的那条,不会两个都没。
46
107
 
47
108
  ## 写作用域不重叠
48
109
 
@@ -52,6 +113,8 @@ teammate 看不到你的上下文。它能看到的只有你写的那段 prompt
52
113
 
53
114
  写作用域有重叠时,在 task 描述里写明重叠在哪、谁先谁后。别指望 teammate 自己协调。
54
115
 
116
+ 作用域只是提示,不是锁。bash、格式化工具、代码生成器都绕开文件版本检查,所以派完活要自己看最终 diff。
117
+
55
118
  ## 共享任务流程
56
119
 
57
120
  每个活都是一个共享任务。流程固定:
@@ -66,13 +129,35 @@ teammate 看不到你的上下文。它能看到的只有你写的那段 prompt
66
129
 
67
130
  task 描述就是完整规格。规格写细一点,teammate 少问一轮。
68
131
 
69
- ## 等 teammate 的规矩
132
+ task 是给人看的账本,不是唤醒通道。别指望「它把 task 标 complete 了我就知道了」。
133
+
134
+ ## teammate 用什么模型
135
+
136
+ **不能单独指定。** `spawn_teammate` 没有 model 或 provider 参数。
137
+
138
+ teammate 继承你(Lead)在 spawn 那一刻的 provider 和 model。想换只有两条路:
139
+
140
+ | 想要什么 | 怎么做 |
141
+ |---|---|
142
+ | 整队换模型 | 切 Lead 自己的模型。之后新 spawn 的 teammate 跟着变 |
143
+ | 按任务挑模型 | 用不了 team,改用经典 `subagent` 工具 |
144
+
145
+ 经典 `subagent` 支持 `provider`、`model`、`reasoning_effort`、`agent_preset` 四个参数(本插件预设已开 `modelSelectionSettings`)。
146
+
147
+ 代价说清楚:经典 `subagent` 是一次性子代理,没有共享任务板,没有持久身份。要用团队就得接受统一模型。
148
+
149
+ ## 状态怎么看
70
150
 
71
- `wait_agent` 前先 `list_agents`,确认有人正在 running。没人在跑,`wait_agent` 立刻返回 noProgress,白等。
151
+ | 状态 | 含义 |
152
+ |---|---|
153
+ | `running` | 正在跑一个回合 |
154
+ | `inactive` | 没有回合在执行。**不代表活干完、也不代表失败** |
155
+ | `provisioning` | 正在创建 |
156
+ | `failed` | 创建失败 |
72
157
 
73
- 没人在跑就先 `send_message` 唤醒,再等。
158
+ `inactive` 有两种情况:teammate 已经收工(你收到过它的通知),或者它被存档了、等你再给它发消息才醒来。
74
159
 
75
- `inactive` 只说明当前没有 turn 在执行,不代表活干完了、也不代表失败。看 task 状态判断。
160
+ 只有 Lead 能创建和打断 teammate(`interrupt_agent`)。打断不清空它排队的消息。
76
161
 
77
162
  ## 给最终答复前
78
163
 
@@ -85,4 +170,4 @@ task 描述就是完整规格。规格写细一点,teammate 少问一轮。
85
170
 
86
171
  结论在前。文件清单、验收输出、偏离规格三块分开。
87
172
 
88
- 没实测的数字不写精确值。不知道就写「未验证」。
173
+ 没实测的数字不写精确值。不知道就写「未验证」。