dsh-convenient-mode 0.0.0-stage → 0.9.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,75 @@
1
+ # CHANGELOG
2
+
3
+ ## 0.9.0 — 2026-11-08
4
+
5
+ - 包名改为 `dsh-convenient-mode`(npm 上的 `dsh-stack` 已被他人占用,市场只认 npm 名)。仓库仍是 `ShawnSun-debug/dsh-stack`。
6
+ - `build-bundle.mjs` 改为从 package.json 读包名写插件行:改名时最容易漏的一处,现在不会再漏。
7
+ - 守卫日志目录随包名改为 `$DSH_HOME/dsh-convenient-mode/guard.log`。
8
+ - 补 repository / homepage / bugs / keywords,准备发布。
9
+
10
+ ## 0.8.1 — 2026-11-08
11
+
12
+ - 电脑端不受影响:安装器只在 `$DSH_HOME/dsh-go` 已存在时才写界面配置;没有 dsh-go 的机器直接跳过,连目录都不建。
13
+ - 桌面加载器只读 `dsh.bundle.patch` 与 `dsh.bundle.platforms`(不写即全平台),`dsh.go` 是未知字段,被忽略。
14
+
15
+ ## 0.8.0 — 2026-11-08
16
+
17
+ - 带 dsh-go 界面:插件自带 `ui/go.json`(4 颗胶囊 + 4 张新对话建议卡),安装时自动并进 `$DSH_HOME/dsh-go/ui.json`,卸载时只拿走自己那几项。
18
+ - 合并幂等,用户自己加的胶囊/建议卡原样保留(按动作而不是标签识别)。
19
+ - `package.json` 声明适配:`dsh.go.ui` + `minAppVersion: 1.0.13`。
20
+ - 胶囊从 5 颗减回 4 颗:5 颗会把输入框那一行撑到出现遮挡。
21
+ - 用例 40 → 45(新增 lib/go-ui.mjs 的合并/移除用例)。
22
+
23
+ ## 0.7.2 — 2026-11-08
24
+
25
+ - 修打包:`files` 里缺 `presets/`,tarball 里没有 `presets/persona.txt`,拿到包的人无法重建 bundle、也改不了人设。
26
+ - 新增 `test/package.test.mjs`:断言 files 覆盖运行与重建需要的文件,且 files 里没有不存在的条目。
27
+ - `npm test` 改成 `node --test test/*.test.mjs`(Node 24 不接受目录导入)。
28
+ - 用例 38 → 40。
29
+
30
+ ## 0.7.1 — 2026-11-08
31
+
32
+ - 修 0.7.0 的错位:路由读的是会话里上一句用户消息(当前这句在 pre-step 时还没写进会话),导致「现在几点了」被当成上一轮的任务判成 high。改成优先读本步认领的消息。
33
+ - 闲聊档按你的要求从 low 改成 off。
34
+ - 用例 37 → 38。
35
+
36
+ ## 0.7.0 — 2026-11-08
37
+
38
+ - 按意图路由推理强度:闲聊/问状态 → low,修 bug·重构·设计·评审·交付·计划 → max,其余 → high。
39
+ - 只改 effort,不插「模型已切换」提示(内核对此类切换不产生 notice)。
40
+ - 你在界面上手动切过强度后,本会话不再自动改。
41
+ - 已知限制:内核在 pre-step 之前就读了 selection,所以改动从下一步生效;一问一答的单步回合会慢一拍。
42
+ - 用例 34 → 37。
43
+
44
+ ## 0.6.1 — 2026-11-08
45
+
46
+ - 修 context 规则误报:在脚本里落盘的 PROGRESS.md(heredoc / `node -e` / `cat >`)以前不算写过,长会话里会重复提醒。
47
+ - 用例 33 → 34。
48
+
49
+ ## 0.6.0 — 2026-11-08
50
+
51
+ - 意图路由:说人话就按流程走,不用报技能名。回合第一步看用户原话,「解释一下 / 发出去 / 审一下 / 到哪了 / 接手 / 做个页面 / 出个计划 / 修一下 / 验证一下」各自路由到对应技能,注入一条一两句的流程提示。
52
+ - 不带斜杠的技能名也认:`ds-tdd`、`用 ds-ship 做完` 都能触发。
53
+ - 路由走独立通道,不占守卫的回合预算,也不会重复提醒同一回合。
54
+ - 用例 32 → 33。
55
+
56
+ ## 0.5.1 — 2026-11-08
57
+
58
+ - 提醒给具体命令:按被改文件的类型给 `node --check x.js` / `npx tsc --noEmit` / `python3 -m py_compile x.py` 等;推不出来才退回通用说法。
59
+ - 守卫写日志:命中一条就追加一行 JSON 到 `$DSH_HOME/dsh-stack/guard.log`(时间、会话、回合、规则、界面、文件),超过 200KB 留最后 500 行。
60
+ - 提醒文案压短(127 → 约 70 字)。
61
+ - 用例 26 → 29。
62
+
63
+ ## 0.5.0 — 2026-11-08
64
+
65
+ - 29 个 ds-* 技能全部进预设:10 条每轮必守(覆盖 15 个)+ 4 行任务索引(覆盖 14 个)。
66
+ - 守卫上线:evidence / unstick / delivery / scope / context 五条规则,pre-step 前置提醒 + 轮末 steer 兜底,每回合最多 2 条。
67
+ - 回放工具 `scripts/guard-replay.mjs`:按 step 逐步回放真实会话,量每条规则会不会响;`--all` 覆盖全部历史会话。
68
+ - 规则收紧:delivery 排除临时仓库探针,scope 只数代码文件且门槛 6 个;context 走独立通道,不占回合预算。
69
+ - 文档:新增 [docs/mapping.md](docs/mapping.md)(29 条映射与守卫覆盖表)。
70
+
71
+ ## 0.4.0 — 2026-11-07
72
+
73
+ - 从 `dsh-ds-stack` 改名为 `dsh-stack`。
74
+ - 常驻技能 baseline(8 个,rank 600)+ 一条命令的安装/卸载。
75
+ - `cordis.patch.yml` 由 `scripts/build-bundle.mjs` 从官方 ptc 预设生成,带逐字节反向校验。
package/CHECKLIST.md ADDED
@@ -0,0 +1,120 @@
1
+ # 交付清单 —— dsh-stack
2
+
3
+ 一个 DSH 内核插件。装进任何 profile,选「DS Stack 模式」就生效。
4
+
5
+ ---
6
+
7
+ ## 一、插件做什么
8
+
9
+ | # | 做的事 | 落在哪 |
10
+ |---|---|---|
11
+ | 1 | 往 system prompt 每轮注入一段工作纪律 + 自动触发规则 | `presets/persona.txt` → 由 `cordis.patch.yml` 注入 preset |
12
+ | 2 | 注册 8 个 ds-* 技能(rank 600,散装副本 rank 500 优先,本包兜底) | `lib/index.js` + `assets/skills/` |
13
+ | 3 | 提供一条命令的安装/卸载(Windows junction,其它平台复制目录) | `scripts/install.mjs` |
14
+ | 4 | 守卫:改完没验证 / 同一修法连错两次,在 pre-step 提醒、轮末 steer 兜底 | `lib/guard.js`(`npm test`) |
15
+
16
+ 它**不**做的事:不改 DSH 源码、不写注册表、不替用户改 `~/.agents/skills`、不自动安装别的插件。
17
+
18
+ ## 二、每轮注入的规则(29 个技能全部进来)
19
+
20
+ 第一层「每轮必守」10 条:复述与最小改动、先写失败测试、跑真检查、失败两次换前提、结构先定形状、证据与结论同条、汇报三段式、去 AI 腔、多文件先出计划、长任务 PROGRESS.md。
21
+
22
+ 第二层「按任务触发」4 行索引:发出去(ship/ready/pr/pr-comments/watch-pr)、多人看(jury/review-loop)、并行与赌错(swarm/best-of-n)、接手与状态(adopt/revive/catchup)。
23
+
24
+ 守卫再把能机械检查的部分接住:缺证据、连续失败、真推送后、代码文件改太多(6 个以上,文档不算)、长会话没写 PROGRESS.md(每会话一次,独立通道)。每次命中都会追加一行到 $DSH_HOME/dsh-convenient-mode/guard.log。规则改动前先用 scripts/guard-replay.mjs 量一遍历史会话(71 回合的基线:unstick 1、evidence 9、delivery 7、scope 18、context 3)。
25
+ ## 三、它提供的技能(8 个常驻;模式一共引用 29 个)
26
+
27
+ 常驻指随包分发、散装副本缺失时兜底的那 8 个;模式规则引用的 29 个不依赖这些文件存在。逐条映射见 [docs/mapping.md](docs/mapping.md)。
28
+
29
+ | 技能 | 做什么 | 什么时候出现 |
30
+ |---|---|---|
31
+ | `ds-mode` | 默认工作风格:复述、先读后改、一步一验、短报告 | 每个任务开场 |
32
+ | `ds-plan-loop` | 编号计划 + 每步验收 + 一次批判 | 多文件、多步骤 |
33
+ | `ds-verify-loop` | 真检查 → 读真错误 → 修根因 → 重跑 | 修 bug 时自动接在 ds-tdd 后 |
34
+ | `ds-principles` | 设计/调试/验证/委派的紧凑原则 | 结构决策 |
35
+ | `ds-tdd` | 先写会失败的测试 | 修 bug 时自动触发 |
36
+ | `ds-unstick` | 两次失败就点破假设、直接测 | 同一失败第二次 |
37
+ | `ds-blast-radius` | 找 diff 之外会炸的地方并真跑证明 | 高风险改动 |
38
+ | `ds-context-reset` | 状态存 PROGRESS.md,换上下文续跑 | 长任务、上下文过半 |
39
+
40
+ 其余 21 个 ds-* 技能不随包,仍在 `~/.agents/skills`,任务命中时按 description 自动匹配。
41
+
42
+ ## 四、它调用什么
43
+
44
+ | 调用对象 | 用途 | 谁需要它 |
45
+ |---|---|---|
46
+ | DSH `skills` 服务 | `inject: ["skills"]`,注册 provider | 插件本体,必须 |
47
+ | Skill 工具(`skill`) | 命中时加载 SKILL.md 正文 | 运行时 |
48
+ | `grill` 技能 | 结构改动规则的前半(问透) | 推荐但不必须:没有它时规则要求「一次一问、能查的自己查」后直接进 `ds-blueprint` |
49
+ | `git` / `gh` | ds-pr、ds-ship、ds-ready 等 PR 流程 | 只有跑 PR 流程时 |
50
+ | `python3` | ds-watch-pr 的 `scripts/watch_pr.py` | 只有盯 PR 时 |
51
+ | `subagent` 能力 | ds-jury / ds-swarm 开并行 worker | 只有用这两条时 |
52
+
53
+ ## 五、装法
54
+
55
+ ### 本机(Windows,已装)
56
+
57
+ ```powershell
58
+ cd D:\Phoneix\plugins\dsh-stack
59
+ node scripts/install.mjs --check # 报 resident skills: 8
60
+ node scripts/install.mjs --apply --profile superagent
61
+ ```
62
+
63
+ ### 另一台机器 / 手机上的 DSH 内核
64
+
65
+ 整个目录自包含,`cordis.patch.yml` 已生成好,**不需要**重新构建:
66
+
67
+ 1. 复制整个 `dsh-stack/` 目录过去(任意路径)。
68
+ 2. 目标机器上装好 `grill` 技能(规则点名了它)。
69
+ 3. `node <目录>/scripts/install.mjs --check` → 应报 `resident skills: 8`
70
+ 4. `node <目录>/scripts/install.mjs --apply --profile <profile 名>`
71
+ 5. `node <目录>/scripts/install.mjs --verify --profile <profile 名>` → 应全 PASS、最后一行 `verify: ok`
72
+ 6. 重启 DSH → 模式选择里选「DS Stack 模式」。
73
+
74
+ 没有符号链接权限的平台(部分移动端)会自动退化成复制目录,安装器会打印用的是哪一档。
75
+
76
+ ### 目标机器自己跑 DSH 内核时(手机)
77
+
78
+ 先重新生成 bundle,再装:
79
+
80
+ ```bash
81
+ node scripts/build-bundle.mjs # 用那台机器的基底预设生成;找不到根会打印候选和 DSH_APP_ROOT 用法
82
+ node scripts/build-bundle.mjs --check
83
+ ```
84
+
85
+ 原因:`cordis.patch.yml` 是从**生成它那台机器**的官方 ptc 预设推导出来的;两边 DSH 版本不同时,它引用的插件行可能不存在。
86
+
87
+ 另外,`@路径` 解析的是那台机器自己的工作区,跨机器的文件要先复制过去。
88
+
89
+ ### 目标机器上没有 node 时(手工三步)
90
+
91
+ 1. 把整个插件目录复制到 `<profile>/node_modules/dsh-convenient-mode`。
92
+ 2. 编辑 `<profile>/package.json`:
93
+ - `dependencies` 里加 `"dsh-convenient-mode": "file:<复制过去的绝对路径>"`(用 link: 也行,取决于包管理器);
94
+ - `dsh.profile.bundles` 数组里加一项 `"dsh-convenient-mode"`。
95
+ 3. 重启 DSH,模式选择里应出现「DS Stack 模式」。
96
+
97
+ ## 六、本机验证记录(2026-11-08,插件版本 0.5.0)
98
+
99
+ | 检查 | 命令 | 结果 |
100
+ |---|---|---|
101
+ | 技能数 | `node scripts/install.mjs --check` | `resident skills: 8` |
102
+ | 技能 provider 真跑 | 直接调 `lib/index.js` 的 `apply` + `list()` | 8 条,rank 600,source `bundled`,描述齐全,`get()` 返回去掉 frontmatter 的正文 |
103
+ | bundle 生成 | `node scripts/build-bundle.mjs` | round-trip ok,persona 19 行写入 `cordis.patch.yml` |
104
+ | 安装器语法 | `node --check scripts/install.mjs` | ok |
105
+ | 规则是否真的进了 bundle | 对 `cordis.patch.yml` 做 5 条字符串断言 | 全部命中 |
106
+ | 装后核对(目标机器用) | `--verify --profile demo`(临时 profile,装前/装后/卸后各跑一次) | 装前 3 条 FAIL、装后全 PASS、卸后回到 FAIL,退出码 1/0/1 |
107
+ | bundle 是合法 YAML | 用 `yaml` 包解析 `cordis.patch.yml` | 顶层数组;`preset-ds-stack` 的 `id=ds-stack`、`name=DS Stack 模式`;24 个 plugin 行;`skill-ds-stack` 行在;persona 19 行(10 条必守 + 4 行索引)。已随 0.5.0 复核。`!!js` 标签报警是基底预设自带的,DSH 加载器认识它 |
108
+ | 干净 profile 安装 | 临时 profile + 独立 `USERPROFILE` 跑 `--apply` | 依赖写成 `link:`、bundle 注册、junction 建成、profile 留 `.bak-` |
109
+ | 干净 profile 卸载 | 同一 profile 跑 `--remove` | 依赖、bundle、链接全部回滚 |
110
+ | 无符号链接的平台 | `DS_STACK_NO_SYMLINK=1` 强制退化 | 打印 `symlink failed (NO_SYMLINK), copied the folder instead`,复制 10 个条目,`--remove` 能删掉复制目录 |
111
+
112
+ 手机端已安装并验证(2026-11-08):装进 web profile 后重启,模式出现在列表里;守卫在真实回合里触发过两次(缺证据、长会话),
113
+ `source.kind = ds-stack-guard` 写进会话日志。回放基线:21 会话 / 71 回合 → unstick 1、evidence 9、delivery 7、scope 18、context 3。
114
+
115
+ ## 七、已知限制
116
+
117
+ 1. 常驻副本与 `~/.agents/skills` 的散装副本是两份文件,改一边不会同步另一边。
118
+ 2. `grill` 不在包内(它是入口技能,正文还依赖 `~/.agents/grill-parts/` 里的成员,装不全反而误导),规则已写成没有它也能退化执行。
119
+ 3. `ds-blueprint` 的正文第一步写着「讲不清就先跑 ds-explain」,与本模式「不用 ds-explain」的规则冲突;本包没改技能正文,以规则为准。
120
+ 4. DSH 升级后官方基底预设若变,需要在本机重跑 `build-bundle.mjs` 并重启。
package/INSTALL.txt ADDED
@@ -0,0 +1,61 @@
1
+ dsh-convenient-mode 0.9.0 —— DS Stack 模式插件
2
+ =========================================
3
+
4
+ 这个插件给 DSH 内核加一个 agent 模式:每轮注入两层规则(10 条每轮必守 + 4 行任务索引,
5
+ 覆盖全部 29 个 ds-* 技能),并自带 8 个常驻技能;另有 5 条守卫做机械检查。
6
+ 每一条技能落在哪,见 docs/mapping.md。
7
+ 安装时还会把 ui/go.json 并进 dsh-go 的界面配置(胶囊与建议卡),卸载时只移除这几项。包内 cordis.patch.yml 已生成,不需要重新构建。
8
+
9
+
10
+ 装法 A(目标机器有 node,推荐)
11
+ --------------------------------
12
+ 1. 解压到任意目录
13
+ 2. node scripts/install.mjs --check 应输出 resident skills: 8
14
+ 3. node scripts/install.mjs --apply --profile <profile 名>
15
+ 4. node scripts/install.mjs --verify --profile <profile 名> 应全 PASS,最后一行 verify: ok
16
+ 5. 重启 DSH,模式选择里选「DS Stack 模式」
17
+
18
+ 装法 B(没有 node)
19
+ -------------------
20
+ 1. 把整个目录复制到 <profile>/node_modules/dsh-convenient-mode
21
+ 2. 编辑 <profile>/package.json:
22
+ dependencies 里加 "dsh-convenient-mode": "file:<该目录的绝对路径>"
23
+ dsh.profile.bundles 数组里加 "dsh-convenient-mode"
24
+ 3. 重启 DSH
25
+
26
+ ### 手机上(自己跑 DSH 内核)
27
+
28
+ 手机上的 DSH 是独立内核,工作区在手机上,跟这台机器没有共享目录。所以:
29
+
30
+ 1. **先重新生成 bundle**。包里的 `cordis.patch.yml` 是在电脑上按官方 ptc 预设生成的,手机上的 DSH 版本不同时,它引用的插件行可能对不上:
31
+ ```bash
32
+ node scripts/build-bundle.mjs # 自动找本机 DSH 根;找不到会打印候选并让你用 DSH_APP_ROOT 指过去
33
+ node scripts/build-bundle.mjs --check
34
+ ```
35
+ 2. 再按上面的 A/B 装法安装。
36
+ 3. 装完跑 `--verify`。
37
+ 4. 重启 DSH → 选「DS Stack 模式」。
38
+
39
+ **引用文件**:`@路径` 解析的是**手机内核自己**的工作区。要引用电脑上的文件,先把它们复制进手机的工作区(这个包解压进工作区即可),再写 `@<相对路径>`。含空格用 `@"..."`,目录带尾斜杠。
40
+
41
+ 装完怎么确认
42
+ -------------
43
+ - 先跑 node scripts/install.mjs --verify --profile <profile 名>:
44
+ 它逐条检查 profile 里是否真有依赖、bundle、node_modules 副本,以及包内 bundle 是否带规则;缺哪条会打印 FAIL 并以退出码 1 结束。
45
+ - <profile>/package.json 的 dsh.profile.bundles 含 dsh-convenient-mode
46
+ - 重启后新会话的系统提示里应出现「每轮必守」与「按任务触发(命中就做)」两层
47
+ - 守卫是否加载:跑一次 `node scripts/guard-replay.mjs` 看基线,或直接看会话里有没有 `ds-stack-guard` 来源的提醒
48
+ - 模式列表里没有「DS Stack 模式」时,先确认上面两处真的写进去了,再看 DSH 日志
49
+ - 设计说明与 29 条映射:docs/mapping.md;版本变更:CHANGELOG.md
50
+
51
+ 依赖
52
+ -----
53
+ - DSH 内核。cordis.patch.yml 是从官方 ptc 预设生成的,随包携带。
54
+ - grill 技能:可选。没有它时,「结构改动」那条规则会退化成「一次一问、能查的自己查」。
55
+
56
+ 卸载
57
+ -----
58
+ node scripts/install.mjs --remove --profile <profile 名>
59
+ (会还原 package.json 的依赖与 bundles,并删掉 node_modules 里的链接或复制目录)
60
+
61
+ 更多:CHECKLIST.md(做什么 / 调用什么 / 验证记录)、README.md、RESIDENT.md
package/README.md CHANGED
@@ -1,3 +1,137 @@
1
- # Temporary Holding Version
1
+ # dsh-stack
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 一个 DSH 插件,做三件事:
4
+
5
+ 1. **「DS Stack 模式」agent preset** —— 在官方 `ptc` 预设上加一层:工作纪律人设 + 自动触发规则。
6
+ 2. **8 个常驻 ds-* 技能** —— 作为技能 provider 注册(rank 600),散装副本缺失时兜底。
7
+ 3. **守卫** —— 把两条最容易漂的规则变成机制:改完没验证、同一修法连错两次。
8
+ 4. **一套可搬走的安装器** —— 复制目录 + 跑一条命令,重启即生效;不写注册表,不改系统。
9
+
10
+ ## 它每轮注入什么
11
+
12
+ `presets/persona.txt` 的全文会作为 system prompt 前缀注入每一轮。现在是两层:
13
+
14
+ | 层 | 条数 | 内容 | 谁执行 |
15
+ |---|---|---|---|
16
+ | 每轮必守 | 10 条(覆盖 15 个技能)| ds-mode / ds-verify-loop / ds-tdd / ds-unstick / ds-blueprint / ds-explain / ds-unslop / ds-plan-loop / ds-context-reset / ds-ledger / ds-blast-radius / ds-principles / ds-lessons / ds-sharpen / grill | 模型,每轮都在眼前 |
17
+ | 按任务触发 | 4 行索引 | ds-ship / ds-ready / ds-pr / ds-pr-comments / ds-watch-pr / ds-jury / ds-review-loop / ds-swarm / ds-best-of-n / ds-adopt / ds-revive / ds-catchup / ds-design / ds-design-audit / ds-help | 模型,命中即做;可机械检查的交给守卫 |
18
+
19
+ 29 个 ds-* 技能全部在这两层里出现过,没有只在磁盘上躺着的。人设从 512 字变成 1041 字(每轮多约 350 token)。
20
+ ## 29 个技能都落在哪
21
+
22
+ 完整映射见 [docs/mapping.md](docs/mapping.md):每轮必守的 15 个、按任务触发的 14 个、被守卫机械化的 5 条,一张表看完。
23
+
24
+ ## 结构
25
+
26
+ | 文件 | 作用 |
27
+ |---|---|
28
+ | [cordis.patch.yml](cordis.patch.yml) | bundle 层:由 [scripts/build-bundle.mjs](scripts/build-bundle.mjs) 从官方 **ptc** 预设生成,插入 `preset-ds-stack` |
29
+ | [lib/index.js](lib/index.js) | 技能 provider:`inject: ["skills"]`,注册 `assets/skills/*/SKILL.md`,rank 600;装上守卫 |
30
+ | [lib/guard.js](lib/guard.js) | 守卫:`agent/pre-step` 前置提醒 + `agent/turn-stopping` 兜底 |
31
+ | [test/guard.test.mjs](test/guard.test.mjs) | 守卫的 26 个用例(`npm test`) |
32
+ | [scripts/guard-replay.mjs](scripts/guard-replay.mjs) | 按步回放真实会话,量每条规则会响几次(`npm run replay`) |
33
+ | [assets/skills/](assets/skills) | 8 个常驻技能 |
34
+ | [presets/persona.txt](presets/persona.txt) | 模式人设 + 自动触发规则,每轮注入 |
35
+ | [skills.manifest.json](skills.manifest.json) | 8 条 sha256 + 21 个不常驻项 + 优先级阶梯 |
36
+ | [RESIDENT.md](RESIDENT.md) | 人读的常驻清单与触发规则表 |
37
+ | [scripts/install.mjs](scripts/install.mjs) | 注册成 profile bundle(Windows 用 junction,其它平台复制目录) |
38
+ | [scripts/build-bundle.mjs](scripts/build-bundle.mjs) | 生成 bundle,带逐字节反向校验;基底可切:`DS_STACK_BASE=standard` |
39
+
40
+ ## 安装 / 卸载
41
+
42
+ ```bash
43
+ node scripts/install.mjs --check # 只报告,不动任何文件
44
+ node scripts/install.mjs --apply --profile <名字> # 注册到某个 profile
45
+ node scripts/install.mjs --remove --profile <名字> # 撤销
46
+ ```
47
+
48
+ `--apply` 写三处(各留 `.bak-<时间戳>`):profile 的 `package.json` 依赖、`dsh.profile.bundles`、`node_modules/dsh-convenient-mode` 链接(Windows 建 junction,其它平台复制目录)。重启 DSH,在模式选择里选「DS Stack 模式」。
49
+
50
+ ## 搬到另一台机器 / 手机
51
+
52
+ 整个目录是自包含的,没有绝对路径依赖(`cordis.patch.yml` 已生成好,不需要重新构建):
53
+
54
+ 1. 把插件目录整个复制过去,放在任意位置。
55
+ 2. `node <目录>/scripts/install.mjs --apply --profile <profile 名>`
56
+ 3. 重启 DSH,选「DS Stack 模式」。
57
+
58
+ 前置条件:`grill` 技能可选(没有它时规则会退化成「一次一问、能查的自己查」);`ds-*` 散装副本不是必需的,常驻那 8 个由本包自带。
59
+
60
+ **目标机器自己跑 DSH 内核(例如手机)时,多一步**:先 `node scripts/build-bundle.mjs` 用**那台机器**的基底预设重新生成 `cordis.patch.yml`(脚本会自己找 DSH 安装根,找不到就打印候选并提示用 `DSH_APP_ROOT` 指过去),再装。电脑上生成的 patch 直接搬过去,版本不一致时可能引用不存在的插件行。
61
+
62
+ 工作区不共享:`@路径` 解析的是目标机器自己的工作区,要引用别处的文件,先复制进去。
63
+
64
+ ## 手机界面(dsh-go)
65
+
66
+ 插件自带 `ui/go.json`:输入框上方 4 颗胶囊(解释 / 审阅 / 发出 / 进度)和新对话页 4 张建议卡。
67
+ `install.mjs --apply` 会把它们并进 `$DSH_HOME/dsh-go/ui.json`;`--remove` 只拿走自己那几项,你手工加的不会被删。
68
+ 识别按动作(`send` 的文本)而不是标签,所以改标签不会重复插入。
69
+
70
+ `package.json` 里声明适配:`dsh.go.ui = ./ui/go.json`、`minAppVersion = 1.0.13`。
71
+
72
+ ## 按意图调推理强度
73
+
74
+ 模式会在回合第一步看你说的话,决定要想多深(只改 effort,不插提示):
75
+
76
+ | 你说的话 | 强度 |
77
+ |---|---|
78
+ | 你好 / 谢谢 / 几点了 / 天气 | off |
79
+ | 修 bug、重构、设计、评审、交付、计划 | max |
80
+ | 其余(默认) | high |
81
+
82
+ 你手动切过强度后,本会话不再自动改。限制:内核先读 selection 再跑钩子,改动从下一步生效。
83
+
84
+ ## 不用报技能名:意图路由
85
+
86
+ 回合第一步会读你这句话,认出来就按对应流程走,注入一条一两句的提示(不占守卫预算):
87
+
88
+ | 你会说 | 走哪条 |
89
+ |---|---|
90
+ | 解释一下 / 怎么跑 / 什么原理 | ds-explain 三段式 |
91
+ | 发出去 / 合并 / 开 PR | ds-ship(或 ds-ready) |
92
+ | 审一下 / 挑毛病 / 第二意见 | ds-review-loop 或 ds-jury |
93
+ | 到哪了 / 进展 | ds-catchup |
94
+ | 接手这个 PR | ds-adopt |
95
+ | 做个页面 / 改 UI | ds-design |
96
+ | 出个计划 / 分几步 | ds-plan-loop |
97
+ | 修一下 / 报错 / 挂了 | ds-tdd → ds-verify-loop |
98
+ | 验证一下 / 测一下 | ds-verify-loop |
99
+
100
+ 直接写 `ds-tdd`(不带斜杠)也认。认不出来就不猜,什么也不加。
101
+
102
+ ## 守卫:规则不靠自觉
103
+
104
+ persona 的规则是散文,长会话里会漂。守卫在两个点上看本回合的会话日志:
105
+
106
+ | 触发点 | 什么时候 | 做什么 |
107
+ |---|---|---|
108
+ | `agent/pre-step` | 模型每一次开口之前 | 命中规则 → 在这一步的消息末尾追加一条 checkpoint |
109
+ | `agent/turn-stopping` | 模型仍要收尾 | 同样的判定 → `steer` 一句,让回合再走一步 |
110
+
111
+ 五条规则:改了非文档文件却没有成功的检查(ds-verify-loop);连续 2 次工具调用失败(ds-unstick);本回合真推送 / 开了 PR(ds-blast-radius + ds-pr,临时仓库探针不算);一轮成功改了 6 个以上代码文件(ds-plan-loop,文档和配置成批写不算);会话很长却没写过 PROGRESS.md(ds-context-reset,每会话一次,走独立通道,不占回合预算)。前四条每回合最多 2 条。
112
+
113
+ 提醒会带上具体命令(按文件类型推断);每命中一条,守卫往 `$DSH_HOME/dsh-convenient-mode/guard.log` 追加一行 JSON,不用翻压缩会话就能看它吵不吵。
114
+
115
+ 先量再改:`npm run replay` 会把一个真实会话按步回放,输出每条规则会响几次;`node scripts/guard-replay.mjs --all` 跑全部历史会话。改动规则前先看这个数。
116
+
117
+ 两种工具形态都认:直接调用的 `write`/`edit`/`bash`,以及 PTC 模式下 `run_code` 程序里的内层调用(`tool/ptc-dispatch`,自带 `isError`,用 `rootCallId` 找回回合)。`run_code` 自己的外层结果不算证据——它只是整段程序的汇总。
118
+
119
+ 边界:每回合最多 2 条(pre-step 1 + 轮末 1);只改 `.md/.txt/.rst` 等文档时豁免;守卫自己抛错只 `warn` 一次,绝不打断回合。
120
+
121
+ 为什么不是只在轮末:`dsh-agent-loop` 先跑 `step()`(助手消息已推送),再跑 `turn-stopping`;轮末只能补一句,收不回已经发出去的结论。
122
+
123
+ ## 覆盖关系
124
+
125
+ ```
126
+ project .dsh 100 < project .agents 200 < custom 300 < ~/.dsh/skills 400 < ~/.agents/skills 500 < 本插件 600
127
+ ```
128
+
129
+ 数字小的赢,本地同名散装副本优先,插件只保证「缺了也还在」。想反过来压本地,把 `lib/index.js` 的 `RANK` 改到 500 以下。
130
+
131
+ ## 边界
132
+
133
+ - 常驻技能正文口径:`description` ≤180 字符、单卷正文 ≤2000 字符。
134
+ - 不常驻的 21 个仍在 `~/.agents/skills`,需要时自动匹配加载;本插件不负责它们的存在性。
135
+ - `~/.agents/skills` 里的同名散装副本 rank 500,压过本包 600:本包改了正文、散装不动,运行时读到的还是旧副本。两边要一起改。
136
+ - DSH 升级后基底预设变了,要重跑 `node scripts/build-bundle.mjs` 再重启(需要本机有官方 `ptc.patch.yml`)。
137
+ - 技能正文是上游原文;示例路径要换成本机真实路径。
package/RESIDENT.md ADDED
@@ -0,0 +1,46 @@
1
+ # 当前常驻技能清单
2
+
3
+ > 先分清两件事:**常驻 8 个**指本包随包分发、在散装副本缺失时兜底的那 8 个技能;
4
+ > 而「DS Stack 模式」的规则引用的是全部 29 个 ds-*(10 条必守 + 4 行任务索引)——
5
+ > 那部分写在 presets/persona.txt,不依赖这些技能文件存在。全量映射见 docs/mapping.md。
6
+
7
+ 更新:2026-11-05 来源:`assets/skills`
8
+
9
+ **8 个**(29 → 16 → 8 → 9 → 8)。ds-explain 已移出常驻(模式规则规定不使用它);ds-context-reset 因为在长时间 ds-ship 流程里要靠 PROGRESS.md 换上下文续跑而留下。
10
+
11
+ | # | 技能 | 一句话 |
12
+ |---|---|---|
13
+ | 1 | `ds-blast-radius` | 找 diff 之外会炸的地方,并真跑证明关键安全事实 |
14
+ | 2 | `ds-context-reset` | 状态存 PROGRESS.md,换新上下文凭文件续上 |
15
+ | 3 | `ds-mode` | 常驻工作风格:复述任务、先读后改、小步验证、短报告 |
16
+ | 4 | `ds-plan-loop` | 编号计划 + 每步验收 + 一次批判,再逐步执行 |
17
+ | 5 | `ds-principles` | 设计/调试/验证/委派的紧凑原则,带触发条件 |
18
+ | 6 | `ds-tdd` | 先写会失败的测试,再最小修复(修 bug 时自动触发) |
19
+ | 7 | `ds-unstick` | 两次失败就点明假设、直接测、列三种别的办法 |
20
+ | 8 | `ds-verify-loop` | 编辑 → 真检查 → 读真错误 → 修根因 → 重跑(修 bug 时自动接在 ds-tdd 后面) |
21
+
22
+ **不常驻(21 个)**:`ds-adopt`、`ds-best-of-n`、`ds-blueprint`、`ds-catchup`、`ds-design`、`ds-design-audit`、`ds-explain`、`ds-help`、`ds-jury`、`ds-ledger`、`ds-lessons`、`ds-pr`、`ds-pr-comments`、`ds-ready`、`ds-review-loop`、`ds-revive`、`ds-sharpen`、`ds-ship`、`ds-swarm`、`ds-unslop`、`ds-watch-pr`
23
+
24
+ ## 自动触发规则(写在 presets/persona.txt,每轮注入)
25
+
26
+ | 命中 | 动作 |
27
+ |---|---|
28
+ | 修 bug | `ds-tdd` 先写一条会失败的测试 → `ds-verify-loop` 跑到绿;同一命令两轮不绿转 `ds-unstick` |
29
+ | 结构改动(新模块/新接口/签名未定) | `grill` 问透(没有 grill 就一次一问、能查的自己查)→ `ds-blueprint` 定形状;两条成对,不单独用 |
30
+ | 需要审视 | `ds-jury`;`ds-review-loop`、`ds-lessons` 只在用户点名时用 |
31
+ | 任何时候 | 不使用 `ds-explain` |
32
+
33
+ ## 进常驻改变了什么、没改变什么
34
+
35
+ - **改变了**:`~/.agents/skills` 被清空、换机器、重装之后,这 8 个照常出现。
36
+ - **没改变**:每轮 token 不变(每个技能一行 description,原来就在目录里);命中率不变;运行时读到的正文也不变 —— rank 500 的散装副本始终压过本包的 600,本包只在散装缺失时接管。
37
+
38
+ ## 维护约定
39
+
40
+ 散装副本和本包是两份独立文件。**改了散装不同步这里,换机器后就是旧版。** 同步检查:
41
+
42
+ ```powershell
43
+ node scripts/install.mjs --check
44
+ ```
45
+
46
+ 应答应为 `resident skills: 8`。逐文件摘要见 `skills.manifest.json` 的 `sha256`。
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: ds-blast-radius
3
+ description: "Find what a change breaks outside its own diff, then prove the key safety fact by running real code. Use before shipping risky or unfamiliar changes. /ds-blast-radius"
4
+ ---
5
+
6
+ # ds-blast-radius
7
+
8
+ Listing callers is easy. The job is finding the breakage that a text search will not show, and proving the change is safe with a run instead of an argument.
9
+
10
+ ## Steps
11
+
12
+ 1. Read the change: the diff, the symbols it adds, changes or removes, and the behavior it now has that the diff does not spell out.
13
+ 2. Find the one or two facts the change is safe because of, for example "this only removes cache entries that are already expired". Most risk clears if that fact holds. Spend your effort here.
14
+ 3. Look where search stops. Read the source of libraries you call at their pinned version. Check timing: async ordering, teardown, retries. Follow data that leaves the code: API responses, database columns, file formats, config, other languages reading the same data.
15
+ 4. Grade each key fact by how far you proved it:
16
+ 1. you said so (worthless alone),
17
+ 2. you pointed at a real file and line,
18
+ 3. you traced the failure path and showed it cannot be reached,
19
+ 4. you ran a script or test against the real code that fails loudly if you are wrong,
20
+ 5. you reproduced it in the running app.
21
+ 5. Push each key fact to level 4 when it is cheap. Usually that is one small script calling the exact function in question.
22
+ 6. Report: the key facts, their proof level with the command and output, any real breakage found, and what stayed unproven.
23
+
24
+ ## Stop when
25
+
26
+ - Every key fact is at level 4 or higher, or you have said why it could not be, and the report is written.
27
+ - Or you found a real break. Report it with the repro and stop.
28
+
29
+ ## Rules
30
+
31
+ - A convincing write-up is not proof. Show output.
32
+ - Do not fix anything here. Hand fixes to the normal flow.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: ds-context-reset
3
+ description: "Keeps a PROGRESS.md for long tasks so a fresh session can resume. Use when a task spans sessions, the model repeats itself, or context is half full, or /ds-context-reset."
4
+ ---
5
+
6
+ # ds-context-reset
7
+
8
+ Store the state of the work in a file, not in the chat, so a fresh context can continue without drift.
9
+
10
+ ## Steps
11
+
12
+ 1. At the start of a long task, create PROGRESS.md at the repo root with these sections:
13
+ - **Goal**: one or two sentences, plus the acceptance check for the whole task.
14
+ - **Done**: the verified steps, each with the command and result that proved it.
15
+ - **Next**: the ordered steps that remain. The first item is the exact next action.
16
+ - **Open questions**: unknowns and decisions that wait for the user.
17
+ - **Key facts**: paths, commands, versions, gotchas, and approaches that failed (with the reason).
18
+ 2. Update PROGRESS.md after every verified step. Do not update it for unverified ones. Commit the code and PROGRESS.md together with a descriptive message.
19
+ 3. Watch for reset signals: you repeat an earlier answer, you forget a fact that is in Key facts, you retry a fix that failed, the same file gets reread many times, or the context is more than about half full.
20
+ 4. When a signal appears, finish or revert the current step so the tree is in a known state.
21
+ 5. Rewrite PROGRESS.md as a complete handoff. A reader who has only this file and the repo must be able to continue. Remove chatter and keep the facts.
22
+ 6. Start a fresh session or subagent. Give it one instruction: "Read PROGRESS.md and `git log -5`, run the acceptance check for the last Done item, then do the first item in Next."
23
+ 7. In the new context, confirm that the baseline check passes before you make new edits. If it fails, fix that first.
24
+
25
+ ## Stop when
26
+
27
+ - The goal's acceptance check passes and PROGRESS.md shows every item as Done.
28
+ - You have done 3 resets on one Next item without progress. Stop and ask the user, with the file as your report.
29
+
30
+ ## Rules
31
+
32
+ - PROGRESS.md holds facts and evidence, not plans that nobody has checked.
33
+ - Keep it under about 150 lines. Move old Done items into a short summary line.
34
+ - Never put secrets or tokens in it.
35
+ - The fresh context reads the file, not the old transcript.
36
+ - Pair with ds-plan-loop for the Next list and with ds-unstick for the failed-approach notes.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: ds-mode
3
+ description: "Working style for every coding task: restate, read before editing, one verified step at a time, evidence before claims. Use when starting work or when the run drifts. /ds-mode"
4
+ ---
5
+
6
+ # DeepSeek working mode
7
+
8
+ Apply this on every task. It keeps the loop tight and the claims honest.
9
+
10
+ ## Before you act
11
+
12
+ 1. Restate the task in one line: the goal, and the smallest change that meets it. Do not wait for approval.
13
+ 2. Read the code you will touch before you edit it. Before you change a behavior, find every caller.
14
+ 3. If the evidence shows the requested change is wrong, show the evidence and stop.
15
+ 4. Past two steps, write a short numbered plan where every step ends in something a command can check. Use ds-plan-loop past a few files.
16
+
17
+ ## While you work
18
+
19
+ - Make the smallest diff that solves the problem. Delete before you add: no layers, options, or helpers that nothing needs yet.
20
+ - One change at a time, each followed by a real command that proves it: a test, a build, a script, or the program. Use ds-verify-loop for the check.
21
+ - Fix the root cause, not the symptom. Use ds-principles for types, structure, and where a guard goes.
22
+ - Proceed on reversible work without asking. Pause before irreversible actions: force push, deploy, delete data, message someone else.
23
+ - The same fix failing twice means stop: switch to ds-unstick and test the premise. No third variant.
24
+ - Long or multi-phase work gets a decision log with ds-ledger, so a reset can resume.
25
+
26
+ ## Before you say done
27
+
28
+ - Show evidence in the same message as the claim: the command you ran and its result. "It compiles" is not proof it works.
29
+ - Label each claim measured, inferred, or guessed.
30
+ - If a check failed or you skipped one, say so plainly.
31
+ - Run ds-review-loop on nontrivial diffs before reporting.
32
+
33
+ ## The final report
34
+
35
+ - Goal in one line, then what changed with exact paths, then the checks and their results, then open issues or blockers. Short, plain sentences; apply ds-unslop to the report and to any comments.
36
+
37
+ ## Detail on demand
38
+
39
+ Context hygiene, comment rules, what counts as a real check, and how to size a plan: `references/detail.md`.
@@ -0,0 +1,32 @@
1
+ # ds-mode — detail
2
+
3
+ Expanded form of the rules in `SKILL.md`. Read it when the task is long, the context is filling up, or a rule needs its worked example.
4
+
5
+ ## Keep context lean
6
+
7
+ - Read the parts you need, not whole files, when a range will do.
8
+ - Keep summaries in your context, not raw output. Trim long logs to the lines that matter.
9
+ - Send bulk reading, wide searches, and large fan-out to subagents when the harness has them. Ask each for a short conclusion with file paths.
10
+ - Do not reread a file you just edited. Do not repeat a search you already ran.
11
+
12
+ ## Comments in code
13
+
14
+ Write a comment only to explain a reason the code cannot show. Delete comments that narrate what the next line does.
15
+
16
+ ## What counts as a real check
17
+
18
+ - A test that exercises the changed path, run and read.
19
+ - A build, type check, or lint whose config actually covers the file.
20
+ - A script or the program itself, fed the input the change affects.
21
+ - Not a check: rereading the diff, "looks right", or a command you never ran.
22
+
23
+ ## Reversible vs irreversible
24
+
25
+ - Reversible, proceed: edit a file, add a test, rerun a command, revert an unpushed local commit.
26
+ - Irreversible, pause first: force push, deploy or restart a shared service, delete data, message someone else, rewrite published history.
27
+
28
+ ## Sizing a plan
29
+
30
+ - Two steps or fewer: do it, and state the steps in one line.
31
+ - Three to ten steps: numbered plan in the reply, each step with its check.
32
+ - More than ten: split it, or hand the work to ds-plan-loop.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: ds-plan-loop
3
+ description: "Numbered plan with an acceptance check per step, one critique pass, then execute step by step. Use for multi-file, unclear or previously bungled work. /ds-plan-loop"
4
+ ---
5
+
6
+ # ds-plan-loop
7
+
8
+ Plan before coding, check the plan once, then build the task one verified step at a time.
9
+
10
+ ## Steps
11
+
12
+ 1. Restate the goal in one sentence. List the files and commands you expect to touch, and read them before you plan. Do not plan from memory.
13
+ 2. Write a numbered plan. Each step gets one action and one acceptance check that a command or a direct observation can confirm, for example "`npm test -- auth` passes". Keep each step small enough to verify in a single diff.
14
+ 3. Write the plan to a file (PLAN.md, or the PROGRESS.md from ds-context-reset) so later steps and fresh sessions can read it.
15
+ 4. Critique the plan in a fresh pass, as a reviewer who did not write it. If you can, run the critique in a subagent or new session. Answer three questions:
16
+ - Which step is missing (setup, migration, config, tests, cleanup)?
17
+ - Which assumption has not been checked against the code or docs?
18
+ - Is there a simpler path that reaches the same goal with fewer steps?
19
+ 5. Revise the plan. Check each risky assumption now by reading code or running a command. Do not carry it forward as a guess.
20
+ 6. Execute step 1 only. Run its acceptance check and read the real output. Use ds-verify-loop when the check fails.
21
+ 7. Mark the step done in the plan file, with the evidence (command and result). Then move to the next step.
22
+ 8. If a step shows that the plan is wrong, stop and revise the remaining steps before continuing. Do not improvise around it.
23
+
24
+ ## Stop when
25
+
26
+ - Every step is marked done and its check passed, and the original goal holds when you check it end to end.
27
+ - You have done 2 critique rounds. A third round almost never finds anything new, so execute.
28
+ - A step fails its check twice in a row. Switch to ds-unstick.
29
+
30
+ ## Rules
31
+
32
+ No step without a check. One step per diff. No steps the goal does not need. Keep the plan at 3-10 steps. Expanded rules and worked examples: `references/detail.md`.