dsh-lead-mode 0.1.2 → 0.1.3

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,16 @@ 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 | Consequence |
42
+ |---|---|
43
+ | The only path that wakes the Lead is a teammate's own `send_message` | Omit the report-back requirement from the delegation prompt and the teammate finishes silently; the Lead stays asleep |
44
+ | A task change only wakes a caller currently inside `wait_agent` | Marking a task complete alone cannot wake an idle Lead |
45
+
46
+ So the skill's default is: finish your turn after delegating and let the message 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`.
38
47
 
39
48
  ### 3. The dependency self-check command
40
49
 
package/README.zh-CN.md CHANGED
@@ -34,7 +34,16 @@
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
+ | 唤醒 Lead 的路径只有 teammate 主动 `send_message` | 派活 prompt 里不写回报要求,teammate 干完不吭声,Lead 一直睡着 |
44
+ | task 变更只唤醒正在 `wait_agent` 的调用方 | 光靠 teammate 把 task 标 complete,唤不醒空闲的 Lead |
45
+
46
+ 所以 skill 的默认建议是:派完活就结束回合等消息(用户立刻看到进展),只有本回合内就必须拿到结果时才用一次 `wait_agent`。不要 `wait_agent` 套循环,也不要反复 `list_agents` 轮询。
38
47
 
39
48
  ### 三、依赖自检命令
40
49
 
package/cordis.patch.yml CHANGED
@@ -50,9 +50,13 @@
50
50
  有这些工具,就按 Lead 工作法干活:
51
51
 
52
52
  - 派活自包含。teammate 看不到你的上下文,把目标、约束、验收标准、已知失败、绝对路径都写进 prompt。
53
+ - 派活 prompt 里必须要求回报:干完用 send_message 给 lead 发一条。不写这句就不会有任何通知。
53
54
  - 写作用域不重叠。一人一块文件。分不开的活排成依赖。
54
55
  - 共享任务走 list、get、claim(带 revision)、干、complete。
55
- - 等齐必需的 teammate 再给最终答复。等之前先 list_agents 确认有人 running。
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.3",
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,68 @@ dsh plugin --profile <你的 profile 名> add @deepseek-ai/dsh-experimental-agen
31
31
 
32
32
  目标或指令有疑问先问用户。别自己挑一个解释就开始干。
33
33
 
34
+ ## 派活的四个参数
35
+
36
+ `spawn_teammate` 只有 `name`、`description`、`prompt`、`context` 四个参数。
37
+
38
+ | 参数 | 要点 |
39
+ |---|---|
40
+ | `name` | 小写连字符。**永久,不可复用**,创建失败的名字也占着 |
41
+ | `description` | 一行职责,给用户看,也给你后面对账 |
42
+ | `prompt` | 全部指令。teammate 只看到这一段 |
43
+ | `context` | `fresh`(默认)看不到你的历史;`fork` 继承你已完成的回合 |
44
+
45
+ `context` 怎么挑:
46
+
47
+ - **绝大多数用 `fresh`。** 活是自包含的,把上下文写进 prompt 就够。
48
+ - 只有当活依赖你已经掌握、又写不进 prompt 的东西时,才用 `fork`。
49
+
50
+ 取名字前先 `list_agents` 看一眼,别撞已占用的名字。
51
+
34
52
  ## 派活必须自包含
35
53
 
36
- teammate 看不到你的上下文。它能看到的只有你写的那段 prompt。
54
+ teammate 看不到你的上下文。它能看到的只有 `prompt`。
37
55
 
38
- 派活时把这些写全:
56
+ 把这些写全:
39
57
 
40
58
  - 目标、约束、验收标准
41
59
  - 已知的失败现象和报错原文
42
60
  - 相关文件路径,用绝对路径
43
61
  - 环境坑,比如本机 `diff` 是坏的要用 `/usr/bin/diff`
44
62
 
45
- 派活 prompt 里写「按刚才说的做」等于没派。它不知道「刚才」。
63
+ 写「按刚才说的做」等于没派。它不知道「刚才」。
64
+
65
+ ### prompt 里必须写回报要求
66
+
67
+ 这是最容易漏、后果最严重的一条:
68
+
69
+ ```
70
+ 干完用 send_message 给 lead 发一条,写:结论 + 文件清单 + 验收输出 + 偏离规格的地方。
71
+ ```
72
+
73
+ 漏了这句,teammate 干完就不吭声,你会一直睡着。原因见下一节。
74
+
75
+ ## 等通知,别轮询
76
+
77
+ 唤醒 Lead 的路径只有一条:**teammate 主动给你 `send_message`。**
78
+
79
+ 三种事件的真实行为:
80
+
81
+ | 事件 | 会不会唤醒空闲的你 |
82
+ |---|---|
83
+ | teammate 给你发消息 | 会。新回合开始 |
84
+ | task 被 claim 或 complete | **不会**。只唤醒正在 `wait_agent` 的调用方 |
85
+ | teammate 静默收工 | **不会**。teammate 是常驻的,收工不结清 |
86
+
87
+ 所以等活按这个顺序选:
88
+
89
+ 1. **优选:派完活就结束回合。** 把「派了谁、等什么」写清楚,然后收工。用户立刻看到进展,你不空转。teammate 回报时你被唤醒,接着干。
90
+ 2. **次选:本回合内就必须拿到结果才继续时,用一次 `wait_agent`。** 它的好处是 task 变更也能唤醒。默认等 30 秒,上限 1 小时。
91
+ 3. **禁止:`wait_agent` 套循环,或反复 `list_agents` 轮询。** 那是空转。
92
+
93
+ `list_agents` 只用来回答「谁在跑、谁卡住了」,不用来等。
94
+
95
+ `wait_agent` 返回 `noProgress` 不是错误,是告诉你没人在跑,该换手段。
46
96
 
47
97
  ## 写作用域不重叠
48
98
 
@@ -52,6 +102,8 @@ teammate 看不到你的上下文。它能看到的只有你写的那段 prompt
52
102
 
53
103
  写作用域有重叠时,在 task 描述里写明重叠在哪、谁先谁后。别指望 teammate 自己协调。
54
104
 
105
+ 作用域只是提示,不是锁。bash、格式化工具、代码生成器都绕开文件版本检查,所以派完活要自己看最终 diff。
106
+
55
107
  ## 共享任务流程
56
108
 
57
109
  每个活都是一个共享任务。流程固定:
@@ -66,13 +118,33 @@ teammate 看不到你的上下文。它能看到的只有你写的那段 prompt
66
118
 
67
119
  task 描述就是完整规格。规格写细一点,teammate 少问一轮。
68
120
 
69
- ## 等 teammate 的规矩
121
+ ## teammate 用什么模型
122
+
123
+ **不能单独指定。** `spawn_teammate` 没有 model 或 provider 参数。
124
+
125
+ teammate 继承你(Lead)在 spawn 那一刻的 provider 和 model。想换只有两条路:
126
+
127
+ | 想要什么 | 怎么做 |
128
+ |---|---|
129
+ | 整队换模型 | 切 Lead 自己的模型。之后新 spawn 的 teammate 跟着变 |
130
+ | 按任务挑模型 | 用不了 team,改用经典 `subagent` 工具 |
131
+
132
+ 经典 `subagent` 支持 `provider`、`model`、`reasoning_effort`、`agent_preset` 四个参数(本插件预设已开 `modelSelectionSettings`)。
133
+
134
+ 代价说清楚:经典 `subagent` 是一次性子代理,没有共享任务板,没有持久身份。要用团队就得接受统一模型。
135
+
136
+ ## 状态怎么看
70
137
 
71
- `wait_agent` 前先 `list_agents`,确认有人正在 running。没人在跑,`wait_agent` 立刻返回 noProgress,白等。
138
+ | 状态 | 含义 |
139
+ |---|---|
140
+ | `running` | 正在跑一个回合 |
141
+ | `inactive` | 没有回合在执行。**不代表活干完、也不代表失败** |
142
+ | `provisioning` | 正在创建 |
143
+ | `failed` | 创建失败 |
72
144
 
73
- 没人在跑就先 `send_message` 唤醒,再等。
145
+ `inactive` 时它不吭声是正常的。想知道它干到哪,`list_agents` 看状态,`team_task_list` 看任务归属。
74
146
 
75
- `inactive` 只说明当前没有 turn 在执行,不代表活干完了、也不代表失败。看 task 状态判断。
147
+ 只有 Lead 能创建和打断 teammate(`interrupt_agent`)。打断不清空它排队的消息。
76
148
 
77
149
  ## 给最终答复前
78
150
 
@@ -85,4 +157,4 @@ task 描述就是完整规格。规格写细一点,teammate 少问一轮。
85
157
 
86
158
  结论在前。文件清单、验收输出、偏离规格三块分开。
87
159
 
88
- 没实测的数字不写精确值。不知道就写「未验证」。
160
+ 没实测的数字不写精确值。不知道就写「未验证」。