dsh-learn-mode 0.0.0-stage → 0.2.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/client/client.js +452 -0
- package/cordis.patch.yml +111 -0
- package/index.js +19 -0
- package/package.json +42 -6
- package/skills/dsh-learn-mode/SKILL.md +190 -0
- package/skills/learn-synthesizer/SKILL.md +278 -0
- package/skills/learn-synthesizer/analysis/workspace-file-convention.md +402 -0
- package/skills/learn-synthesizer/evals/evals.json +72 -0
- package/skills/learn-synthesizer/references/axis-types.md +20 -0
- package/skills/learn-synthesizer/references/example-structures.md +291 -0
- package/skills/learn-synthesizer/references/feedback-types.md +296 -0
- package/skills/learn-synthesizer/references/gotchas.md +322 -0
- package/skills/learn-synthesizer/references/sub-agent-prompt.md +222 -0
- package/skills/learn-synthesizer/rules/core-principles.md +173 -0
- package/skills/learn-synthesizer/rules/output-format.md +355 -0
- package/skills/learn-synthesizer/rules/quality-gates.md +209 -0
- package/skills/learn-synthesizer/scripts/pdf_to_md.py +124 -0
- package/skills/learn-synthesizer/templates/MISSION.md +38 -0
- package/skills/learn-synthesizer/templates/deep-dive.md +73 -0
- package/skills/learn-synthesizer/templates/map-evolution.md +38 -0
- package/skills/learn-synthesizer/templates/understanding-map.md +42 -0
- package/skills/learn-synthesizer/workflows/stage0.5-mission.md +141 -0
- package/skills/learn-synthesizer/workflows/stage1-collect.md +214 -0
- package/skills/learn-synthesizer/workflows/stage2-extract.md +254 -0
- package/skills/learn-synthesizer/workflows/stage2.5-importance.md +197 -0
- package/skills/learn-synthesizer/workflows/stage3-merge.md +492 -0
- package/skills/learn-synthesizer/workflows/stage3.5-gap.md +317 -0
- package/skills/learn-synthesizer/workflows/stage4-chapter-agent.md +342 -0
- package/skills/learn-synthesizer/workflows/stage4-ref-extract.md +111 -0
- package/skills/learn-synthesizer/workflows/stage4-write.md +355 -0
- package/skills/learn-synthesizer/workflows/stage4.5-verify.md +327 -0
- package/skills/learn-synthesizer/workflows/stage5-review.md +196 -0
- package/skills/learn-synthesizer/workflows/stage5.5-iterate.md +297 -0
- package/skills/learn-synthesizer/workflows/stage6-finalize.md +310 -0
- package/skills/learn-synthesizer/workflows/stage6-progressive.md +173 -0
- package/skills-provider.mjs +99 -0
- package/workbench-host.mjs +425 -0
- package/README.md +0 -3
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# 阶段6(改造后):教程交付 + 渐进深化入口
|
|
2
|
+
|
|
3
|
+
教程生成完成后,不再是一次性交付。改为交付后开启持续陪伴模式。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 6.5 交付教程 + 初始化知识空间
|
|
8
|
+
|
|
9
|
+
### 步骤1:生成 Understanding Map
|
|
10
|
+
|
|
11
|
+
使用 `templates/understanding-map.md` 模板,基于已完成的章节列表在工作区创建 `understanding-map.md`:
|
|
12
|
+
|
|
13
|
+
- 章节状态初始化为 `[未开始]`
|
|
14
|
+
- 元信息中填入教程版本 V1 和交付日期
|
|
15
|
+
- Mission 引用 MISSION.md(如存在,否则标注 [UNDEFINED])
|
|
16
|
+
|
|
17
|
+
### 步骤2:向用户展示交付内容并提示渐进深化入口
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
教程已交付在 [工作区路径]。
|
|
21
|
+
|
|
22
|
+
这不是终点——知识空间已保留,后续你可以随时回来:
|
|
23
|
+
|
|
24
|
+
1. "我学完了第 1-3 章" → 标记已掌握,推荐后续学习路径
|
|
25
|
+
2. "第 5 章太浅了,帮我深挖" → 补充搜索,重写该章
|
|
26
|
+
3. "[主题] 出新版本了" → 增量搜索新资料,更新对应章节
|
|
27
|
+
4. "帮我生成配套练习" → 基于教程内容生成 quiz + coding exercise
|
|
28
|
+
5. "按我现在进度,推荐下一步" → 分析薄弱点,推荐优先补缺
|
|
29
|
+
6. "重新按 Mission 检查" → 重新审视 MISSION.md,移除不符合 Mission 的内容
|
|
30
|
+
|
|
31
|
+
教程可以随时回来继续,不需要从头开始。
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 6.6 渐进深化命令
|
|
37
|
+
|
|
38
|
+
用户在已有教程的工作区回来时触发。先读取 `understanding-map.md` 了解用户当前进度。
|
|
39
|
+
|
|
40
|
+
### 命令处理表
|
|
41
|
+
|
|
42
|
+
| 用户命令 | 触发条件 | 处理流程 |
|
|
43
|
+
|---------|---------|---------|
|
|
44
|
+
| "我学完了第 X-Y 章" | 识别"学完""完成""看完了"+ 章节号 | §6.6.1 |
|
|
45
|
+
| "第 X 章太浅了 / 不够深 / 看不懂" | 识别章节号 + "浅""不够""不懂" | §6.6.2 |
|
|
46
|
+
| "[主题] 出新版本了" | 识别"新版本""新版""更新了" | §6.6.3 |
|
|
47
|
+
| "帮我生成练习" | 识别"练习""quiz""题目""自测" | §6.6.4 |
|
|
48
|
+
| "按我进度推荐下一步" | 识别"推荐""下一步""进度" | §6.6.5 |
|
|
49
|
+
| "重新按 Mission 检查" | 识别"Mission""目标""检查" | §6.6.6 |
|
|
50
|
+
| "深潜 [主题]" | 识别"深潜""讲透" + 主题 | §6.6.7 |
|
|
51
|
+
|
|
52
|
+
### 6.6.1 标记已掌握 + 推荐路径
|
|
53
|
+
|
|
54
|
+
1. 更新 `understanding-map.md`:将第 X-Y 章的状态改为 `[已掌握]`
|
|
55
|
+
2. 找出第一个状态为 `[未开始]` 的章节
|
|
56
|
+
3. 向用户输出:
|
|
57
|
+
> "已标记第 X-Y 章为已掌握。建议继续学习第 Z 章:{章节标题}。
|
|
58
|
+
>
|
|
59
|
+
> 薄弱点提醒:{如有,列出薄弱点推荐优先回顾}"
|
|
60
|
+
|
|
61
|
+
### 6.6.2 深化指定章节
|
|
62
|
+
|
|
63
|
+
1. 确认需深化的具体内容(用户说"太浅"是不够的,追问具体哪里不够)
|
|
64
|
+
2. 定位该章对应的知识点,在 `_internal/02-extract/` 中检查来源
|
|
65
|
+
3. 针对该章主题补充搜索(关键词聚焦该知识点的难点、边界、高阶用法)
|
|
66
|
+
4. 为补充资料派发 Sub-agent 提取
|
|
67
|
+
5. 重写该章节,覆盖原有文件,在文件开头标注 `[V1.1 深化: YYYY-MM-DD]`
|
|
68
|
+
6. 更新 `understanding-map.md`:追加渐进深化历史记录
|
|
69
|
+
|
|
70
|
+
### 6.6.3 版本更新
|
|
71
|
+
|
|
72
|
+
1. 搜索新版本资料(官方文档 changelog、迁移指南)
|
|
73
|
+
2. 为新增/变更内容派发 Sub-agent 提取
|
|
74
|
+
3. 对比新旧版本,识别:
|
|
75
|
+
- 新增内容:追加到对应章节,标注 `[NEW in Vx.x]`
|
|
76
|
+
- 废弃内容:标注 `[已过时]`
|
|
77
|
+
- 变更内容:标注 `[VERSION_DIFF: 旧方案... → 新方案...]`
|
|
78
|
+
4. 更新 `reference/` 目录中的命令速查和模板
|
|
79
|
+
|
|
80
|
+
### 6.6.4 生成练习
|
|
81
|
+
|
|
82
|
+
1. 扫描 `understanding-map.md` 中 `[已掌握]` 和 `[进行中]` 的章节
|
|
83
|
+
2. 为每个章节生成:
|
|
84
|
+
- 5-10 道选择题(检查概念理解)
|
|
85
|
+
- 2-3 道编码练习(检查实操能力)
|
|
86
|
+
3. 生成独立文件 `practice/quiz.md`(选择题)+ `practice/exercises/`(编码练习)
|
|
87
|
+
|
|
88
|
+
### 6.6.5 进度分析 + 推荐
|
|
89
|
+
|
|
90
|
+
1. 读取 `understanding-map.md` 分析:
|
|
91
|
+
- 整体完成率
|
|
92
|
+
- 薄弱点列表
|
|
93
|
+
- 与 Mission.Success 的差距
|
|
94
|
+
2. 推荐:优先补齐薄弱点,还是继续顺序学习
|
|
95
|
+
3. 输出推荐理由
|
|
96
|
+
|
|
97
|
+
### 6.6.6 Mission 重新检查
|
|
98
|
+
|
|
99
|
+
1. 重新读取 `MISSION.md`
|
|
100
|
+
2. 逐章检查:该章内容是否服务于 Mission
|
|
101
|
+
3. 不符合的内容标注为 `[已排除: Mission]` 或降级为 [了解]
|
|
102
|
+
4. 向用户报告调整结果,询问确认
|
|
103
|
+
|
|
104
|
+
### 6.6.7 深潜(独立深潜文档)
|
|
105
|
+
|
|
106
|
+
1. 确认深潜主题与当前深度档(默认仅【深潜】档节点触发;用户可要求对任意主题深潜)
|
|
107
|
+
2. 补充搜索:按主轴配套的评估维度定向搜索(`references/axis-types.md`)
|
|
108
|
+
3. 使用 `templates/deep-dive.md` 生成独立深潜文档,存放于 `00-地图/deep-dives/`(有地图层时)或 `deep-dives/`(无地图层时)
|
|
109
|
+
4. 执行 §6.9 地图影响检查
|
|
110
|
+
5. 更新 session-state.md
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 6.7 增量更新的原则
|
|
115
|
+
|
|
116
|
+
- **不得重写已掌握的章节**:除非用户明确提出
|
|
117
|
+
- **增量标记**:新增/修改内容用 `[NEW in V1.x]` 标注
|
|
118
|
+
- **不删除旧内容**:过时内容标注 `[已过时]`,保留供参考
|
|
119
|
+
- **更新 understanding-map**:每次操作后追加渐进深化历史
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 6.8 保存会话状态
|
|
124
|
+
|
|
125
|
+
每次渐进深化操作后,更新工作区的 `session-state.md`:
|
|
126
|
+
|
|
127
|
+
```markdown
|
|
128
|
+
# 会话状态
|
|
129
|
+
主题: [主题名]
|
|
130
|
+
更新时间: [当前时间]
|
|
131
|
+
学习模式: 完整教程(渐进深化模式)
|
|
132
|
+
工作区: [工作区绝对路径]
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 进度
|
|
137
|
+
当前阶段: 渐进深化活跃
|
|
138
|
+
教程版本: V1.x
|
|
139
|
+
|
|
140
|
+
## 最新操作
|
|
141
|
+
- [操作类型]: [结果摘要]
|
|
142
|
+
- 日期: YYYY-MM-DD
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 恢复指令
|
|
147
|
+
读取 understanding-map.md 了解用户进度,继续渐进深化模式。
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 6.9 生长机制:地图影响检查与生态状态
|
|
153
|
+
|
|
154
|
+
知识库是生长的,不是冻结的。技术在生态中的地位会变化(上升/主流/衰退/淘汰),全局文件必须随之联动。
|
|
155
|
+
|
|
156
|
+
### 深潜收尾:地图影响检查(强制执行)
|
|
157
|
+
|
|
158
|
+
每次完成一个深潜(或一次深化/版本更新操作)后,逐项检查:
|
|
159
|
+
|
|
160
|
+
1. 本次学习是否改变了相关节点的**生态状态**(上升/主流/衰退/淘汰)?
|
|
161
|
+
2. 是否改变了相关节点的**深度档**(如发现某技术比预想更重要/已被取代)?
|
|
162
|
+
3. 是否暴露了新的前置依赖或缺漏节点?
|
|
163
|
+
4. 以上任一答案为"是" → 联动更新地图层文件(`00-地图.md`)、相关 outline 与路线图;commit 信息写清"改了什么、为什么"
|
|
164
|
+
|
|
165
|
+
### 会话恢复兜底
|
|
166
|
+
|
|
167
|
+
会话恢复检查(SKILL.md 开头)时顺带检查:若工作区存在地图层文件且其更新时间超过 **8 周**,向用户提示:"地图已超过 8 周未更新,是否需要做一次生态状态巡检?"——只提示,不强制执行。
|
|
168
|
+
|
|
169
|
+
### 生态状态来源
|
|
170
|
+
|
|
171
|
+
- 新深潜的结论
|
|
172
|
+
- §6.6.3 版本更新发现的变化
|
|
173
|
+
- 用户基于行业观察的直接判断
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 随包技能提供器:把本包 skills/ 下的技能注册进 DSH skill 注册表。
|
|
3
|
+
*
|
|
4
|
+
* 为什么需要它:DSH 不会自动扫描插件包里的 skills/ 目录;技能必须由插件用
|
|
5
|
+
* ctx.skills.registerProvider() 显式注册(参见出货包 @deepseek-ai/dsh-skill-badge)。
|
|
6
|
+
*
|
|
7
|
+
* 零第三方依赖,只用 node 内置模块;rank 取 BUNDLED_SKILL_RANK 的数值 600。
|
|
8
|
+
*/
|
|
9
|
+
import { readdir, readFile } from 'node:fs/promises'
|
|
10
|
+
import path from 'node:path'
|
|
11
|
+
import { fileURLToPath } from 'node:url'
|
|
12
|
+
|
|
13
|
+
const PROVIDER_NAME = 'dsh-learn-mode-bundled'
|
|
14
|
+
/** 与 @deepseek-ai/dsh-skill 的 BUNDLED_SKILL_RANK 对齐。 */
|
|
15
|
+
const BUNDLED_SKILL_RANK = 600
|
|
16
|
+
const SKILLS_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), 'skills')
|
|
17
|
+
|
|
18
|
+
/** 解析 SKILL.md 的 YAML frontmatter(只取标量键,够本包使用)。 */
|
|
19
|
+
function parseFrontmatter(text) {
|
|
20
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(text)
|
|
21
|
+
if (match === null) return {}
|
|
22
|
+
const out = {}
|
|
23
|
+
for (const line of match[1].split(/\r?\n/)) {
|
|
24
|
+
const kv = /^([A-Za-z0-9_-]+):\s*(.*)$/.exec(line)
|
|
25
|
+
if (kv !== null) out[kv[1]] = kv[2].replace(/^['"]|['"]$/g, '').trim()
|
|
26
|
+
}
|
|
27
|
+
return out
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function discover() {
|
|
31
|
+
let entries
|
|
32
|
+
try {
|
|
33
|
+
entries = await readdir(SKILLS_DIR, { withFileTypes: true })
|
|
34
|
+
} catch {
|
|
35
|
+
return []
|
|
36
|
+
}
|
|
37
|
+
const found = []
|
|
38
|
+
for (const entry of entries) {
|
|
39
|
+
if (!entry.isDirectory()) continue
|
|
40
|
+
const dir = path.join(SKILLS_DIR, entry.name)
|
|
41
|
+
const file = path.join(dir, 'SKILL.md')
|
|
42
|
+
let text
|
|
43
|
+
try {
|
|
44
|
+
text = await readFile(file, 'utf8')
|
|
45
|
+
} catch {
|
|
46
|
+
continue
|
|
47
|
+
}
|
|
48
|
+
const fm = parseFrontmatter(text)
|
|
49
|
+
// 目录名必须与 frontmatter name 一致,否则跳过(避免注册出名称漂移的技能)
|
|
50
|
+
if (fm.name !== entry.name || fm.description === undefined) continue
|
|
51
|
+
found.push({ dir, file, name: fm.name, description: fm.description })
|
|
52
|
+
}
|
|
53
|
+
return found
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const provider = {
|
|
57
|
+
name: PROVIDER_NAME,
|
|
58
|
+
async list() {
|
|
59
|
+
const items = await discover()
|
|
60
|
+
return items.map((item) => ({
|
|
61
|
+
name: item.name,
|
|
62
|
+
description: item.description,
|
|
63
|
+
invocation: { modelInvocable: true, userInvocable: true },
|
|
64
|
+
provider: PROVIDER_NAME,
|
|
65
|
+
source: 'bundled',
|
|
66
|
+
resourceBase: { kind: 'directory', path: item.dir },
|
|
67
|
+
rank: BUNDLED_SKILL_RANK,
|
|
68
|
+
locator: item.file,
|
|
69
|
+
}))
|
|
70
|
+
},
|
|
71
|
+
async get(candidate) {
|
|
72
|
+
const file = typeof candidate.locator === 'string' ? candidate.locator : candidate.locator?.path
|
|
73
|
+
const content = await readFile(file, 'utf8')
|
|
74
|
+
return {
|
|
75
|
+
name: candidate.name,
|
|
76
|
+
description: candidate.description,
|
|
77
|
+
invocation: candidate.invocation,
|
|
78
|
+
provider: PROVIDER_NAME,
|
|
79
|
+
source: 'bundled',
|
|
80
|
+
resourceBase: candidate.resourceBase,
|
|
81
|
+
content,
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** 注册随包技能提供器(可被组合插件复用)。 */
|
|
87
|
+
export function registerSkills(ctx) {
|
|
88
|
+
ctx.skills.registerProvider(() => provider)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Cordis 插件名(独立挂载时使用)。 */
|
|
92
|
+
export const name = 'dsh-learn-mode-bundled-skills'
|
|
93
|
+
/** 需要的服务。 */
|
|
94
|
+
export const inject = ['skills']
|
|
95
|
+
|
|
96
|
+
/** 注册随包技能提供器(插件入口)。 */
|
|
97
|
+
export function apply(ctx) {
|
|
98
|
+
registerSkills(ctx)
|
|
99
|
+
}
|