dsh-project-based-learning 1.1.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 +65 -0
- package/CONTRIBUTING.md +80 -0
- package/LICENSE +21 -0
- package/README.md +120 -0
- package/README.zh.md +118 -0
- package/cordis.patch.yml +15 -0
- package/docs/DESIGN-AUDIT.md +505 -0
- package/docs/ENGINE-REVISION-2.zh.md +487 -0
- package/docs/installing.zh.md +105 -0
- package/docs/original-workflow.zh.md +379 -0
- package/docs/releasing.zh.md +85 -0
- package/docs/review-round1-A-edu.zh.md +66 -0
- package/docs/review-round1-B-eng.zh.md +60 -0
- package/docs/review-round1-C-bounded.zh.md +55 -0
- package/docs/zero-knowledge-path.zh.md +60 -0
- package/examples/PROGRESS.demo.md +72 -0
- package/examples/state.demo.json +185 -0
- package/examples/state.selftest-invalid.json +58 -0
- package/lib/index.js +64 -0
- package/package.json +77 -0
- package/skills/dsh-coach/SKILL.md +108 -0
- package/skills/dsh-coach/assets/review-report.md +40 -0
- package/skills/dsh-coach/assets/stage-acceptance.md +51 -0
- package/skills/dsh-coach/assets/state.template.json +59 -0
- package/skills/dsh-coach/assets/task-card.md +29 -0
- package/skills/dsh-coach/references/domains/unity-csharp/archetypes.md +306 -0
- package/skills/dsh-coach/references/domains/unity-csharp/diagnosis-bank.md +978 -0
- package/skills/dsh-coach/references/domains/unity-csharp/example.md +356 -0
- package/skills/dsh-coach/references/domains/unity-csharp/glossary.md +110 -0
- package/skills/dsh-coach/references/domains/unity-csharp/manifest.yml +14 -0
- package/skills/dsh-coach/references/domains/unity-csharp/pitfalls.md +400 -0
- package/skills/dsh-coach/references/domains/unity-csharp/verification.md +308 -0
- package/skills/dsh-coach/references/engine/adapt.md +48 -0
- package/skills/dsh-coach/references/engine/diagnosis.md +76 -0
- package/skills/dsh-coach/references/engine/domain-contract.md +73 -0
- package/skills/dsh-coach/references/engine/intake.md +63 -0
- package/skills/dsh-coach/references/engine/permissions.md +44 -0
- package/skills/dsh-coach/references/engine/review-acceptance.md +67 -0
- package/skills/dsh-coach/references/engine/route.md +51 -0
- package/skills/dsh-coach/references/engine/state.md +116 -0
- package/skills/dsh-coach/references/engine/task-loop.md +68 -0
- package/skills/dsh-coach/scripts/coach-install.mjs +98 -0
- package/skills/dsh-coach/scripts/coach-selftest.mjs +205 -0
- package/skills/dsh-coach/scripts/coach-validate.mjs +817 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
本文件记录 dsh-coach 的对外变更。版本号含义:
|
|
4
|
+
|
|
5
|
+
- **插件包版本**(`package.json#version`):npm 包与组合包层的版本。
|
|
6
|
+
- **引擎版本**(`SKILL.md` 与 `references/engine/` 的教学法逻辑):`1.0.0` 起,交互协议变化才递增。
|
|
7
|
+
- **状态 schema 版本**(`state.json#schemaVersion`):`1.0`,字段语义变化才递增。
|
|
8
|
+
- **领域包版本**(`references/domains/<id>/manifest.yml#version`):各学科独立演进,与引擎版本解耦。
|
|
9
|
+
|
|
10
|
+
## [1.1.0] - 2026-09-12
|
|
11
|
+
|
|
12
|
+
**教学缺陷修复**(来自真实使用反馈:只问不教、过度要求实测、该教的让人自己悟)。引擎交互协议变化 → 引擎版本与插件包版本同步递增。
|
|
13
|
+
|
|
14
|
+
### 修复
|
|
15
|
+
|
|
16
|
+
- **新增 R9 讲授**:知识类内容不再要求学员自我发现。三条触发(学员明说没学过/诊断显示前置缺失/内容属事实性知识)**必须引用可见观察**;讲授为五步结构(概念 → 为什么需要 → 最小示例 → 用户亲自应用 → 确认题);**技能类只改变"回补的形式",不改变"先尝试"的顺序**;R9 明示"不是加速项"。同时修复了 `SKILL.md` 丢失原文限定词「在获得必要信息前」而变成**无条件禁令**的回归——那条禁令原本正面挡住了"零基础就直接讲"。
|
|
17
|
+
- **新增 R10 实测最小化**:只有"依赖运行时行为"且"静态阅读代码或文档无法判定"时才要求实测;要求时**必须给出所依据的文档章节或文件行号**。文档矛盾/版本差异属例外,仍须实测。
|
|
18
|
+
- **R3 拆为三类自述**:能力自述(线索)/缺口自述(**直接采信并转入讲授**)/操作自述(按部分验证接受,**不得要求重复实测,也不得要求补交实测材料**)。同步改写 `task-loop.md` 中"声称'我做了'不是证据"。
|
|
19
|
+
- **证据按结论类型分层**:知识类看"无提示解释机制 + 迁移到新情境"(**单题正确只算部分验证**);行为类看运行结果或材料。`artifact` 明确承认**问答记录**与**操作自述记录**;`review-acceptance.md` 声明"充分证据三条件**只用于阶段验收**"。
|
|
20
|
+
- **受阻路径补上讲授出口**:`task-loop.md`、`adapt.md`、`diagnosis.md` 三处终点各加"知识类缺失 → 按 R9 讲授"。
|
|
21
|
+
- **领域包题库加门槛**:每题新增 `类型`(事实性/推理性/综合)与 `前置知识`;**事实性题不得作为首次接触题**;Q1-1 移入《讲授后确认题》并补讲授要点;最小覆盖索引与按原型推荐组合同步更新(4 组组合补齐三类覆盖);`example.md` 的示范同步改为"先讲授、再用 Q1-1 确认"的 R9 路径。
|
|
22
|
+
|
|
23
|
+
### 新增
|
|
24
|
+
|
|
25
|
+
- `evidence[].stage` 允许 `0`(**诊断期证据**),`PROGRESS.md` 显示为"诊断期"。
|
|
26
|
+
- 校验器新增 warn `ST-W7`:疑为"单题即发已验证"时提醒(**只提醒、不拦截**,取舍理由见 `docs/ENGINE-REVISION-2.zh.md` §7.3)。
|
|
27
|
+
- 指令 `先讲再做` / `讲一下 X`。
|
|
28
|
+
- `docs/zero-knowledge-path.zh.md`:零基础路径人工回归清单。
|
|
29
|
+
|
|
30
|
+
### 变更
|
|
31
|
+
|
|
32
|
+
- 双语 README 的「自述不算证据/Self-reports are not evidence」改为**三类自述**的准确表述,并补"知识直接教、技能才靠练"。
|
|
33
|
+
- `docs/ENGINE-REVISION-2.zh.md` 与三份第 1 轮独立审核报告(`docs/review-round1-{A-edu,B-eng,C-bounded}.zh.md`):改动过程、被驳回项与理由。
|
|
34
|
+
|
|
35
|
+
### 打包与发布
|
|
36
|
+
|
|
37
|
+
- **npm 包名**:`dsh-project-based-learning`(与仓库同名)。`cordis.patch.yml` 的 `name:` 必须等于包名,已同步。
|
|
38
|
+
- `@deepseek-ai/cordis` 与 `@deepseek-ai/dsh` 均标为 `optional` peer:profile 的 pnpm 配置为 `autoInstallPeers: false`,必装 peer 无法自动补装,会让首次 `dsh plugin add` 以退出码 1 结束。
|
|
39
|
+
- README 按社区惯例重写:首行语言互链、首屏给出可复制的安装命令;删除「验证状态」一类过程记录。
|
|
40
|
+
|
|
41
|
+
### 未做(明确记录)
|
|
42
|
+
|
|
43
|
+
- **未**把 `evidence[].kind` 设为必填、**未**升 `schemaVersion`:第 1 轮三份审核一致认为该方案会被自贴标签绕过、与分层判据不等价,且会让既有 `schemaVersion=1.0` 的状态文件全部失败。留待下一版以"选填 + 缺失从严"的形式评估。
|
|
44
|
+
|
|
45
|
+
## [1.0.0] - 2026-09-11
|
|
46
|
+
|
|
47
|
+
仓库:<https://github.com/Kirisame1969/dsh-project-based-learning>(默认分支 `main`,CI 在 ubuntu/windows × node 22/24 四组合全绿)
|
|
48
|
+
|
|
49
|
+
首个公开版本。
|
|
50
|
+
|
|
51
|
+
### 新增
|
|
52
|
+
|
|
53
|
+
- **教学引擎**(学科无关):`skills/dsh-coach/SKILL.md` + `references/engine/`(intake、diagnosis、route、task-loop、review-acceptance、adapt、state、permissions、domain-contract)。
|
|
54
|
+
- **状态契约**:`.coach/state.json` 为唯一事实源,`.coach/PROGRESS.md` 为生成视图;含机械不变量与多项补充检查(1.0.0 时为 13 条;**1.1.0 增至 21 条**,见 `references/engine/state.md`)。
|
|
55
|
+
- **校验器**:`coach-validate.mjs`(状态层 + 领域包结构 + 引擎分层检查,零依赖)。
|
|
56
|
+
- **回归自测**:`coach-selftest.mjs`(含反向夹具与分层负例自动化;不启动子进程,可在受限沙箱内运行)。
|
|
57
|
+
- **安装器**:`coach-install.mjs`(复制或目录联接安装到技能根,含递归与覆盖守卫)。
|
|
58
|
+
- **Unity/C# 领域包**:`references/domains/unity-csharp/` —— 6 个项目原型、14 道诊断题(7 维度 ×2)、19 条陷阱分 9 组、5 条核对配方、完整示例、约 86 条术语。
|
|
59
|
+
- **组合包形态**:`lib/index.js` + `cordis.patch.yml`,把同一份技能注册为 DSH 运行时技能;`dsh-plugin-dev check` 通过。
|
|
60
|
+
- **文档**:`docs/DESIGN-AUDIT.md`(三轮改动审核记录,含被驳回的自身建议)、`docs/installing.zh.md`、双语 README、`CONTRIBUTING.md`。
|
|
61
|
+
|
|
62
|
+
### 已知限制
|
|
63
|
+
|
|
64
|
+
- 领域包中标注"(未验证)"的 Unity 命令需在装有 Unity Editor 的环境实测后才可用于验收判定。
|
|
65
|
+
- 校验器只覆盖状态层、领域包结构与引擎分层,不能验证对话质量。
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# 贡献指南
|
|
2
|
+
|
|
3
|
+
感谢你考虑为 dsh-coach 做贡献。本项目的核心设计是**教学法引擎与学科内容分离**,因此最有价值的贡献通常是**新增或改进一个领域包**。
|
|
4
|
+
|
|
5
|
+
## 环境要求
|
|
6
|
+
|
|
7
|
+
- Node.js `^22.19.0 || >=24.0.0`(与 `package.json#engines` 一致)
|
|
8
|
+
- **零运行时依赖**:本项目不引入构建步骤、不使用 npm 依赖。请保持这一点。
|
|
9
|
+
|
|
10
|
+
## 本地验证(提交前必须全绿)
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
node test/entry.smoke.mjs # 组合包入口契约 + 技能资源齐全
|
|
14
|
+
node skills/dsh-coach/scripts/coach-selftest.mjs # 校验器回归自测(含反向夹具与分层负例)
|
|
15
|
+
node skills/dsh-coach/scripts/coach-validate.mjs --state examples/state.demo.json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
若你手上有 `dsh-plugin-guide` 提供的工具链,可再跑一次静态检查:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
dsh-plugin-dev check --strict
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 贡献类型
|
|
25
|
+
|
|
26
|
+
### 1. 新增学科领域包(最欢迎)
|
|
27
|
+
|
|
28
|
+
引擎是学科无关的;学科内容全部住在 `skills/dsh-coach/references/domains/<domain-id>/`。新增一个学科 = 新增一个目录,**不需要改引擎**。
|
|
29
|
+
|
|
30
|
+
**步骤**
|
|
31
|
+
|
|
32
|
+
1. 读契约:`skills/dsh-coach/references/engine/domain-contract.md`。
|
|
33
|
+
2. 新建 `references/domains/<domain-id>/`,按契约补齐七个文件:
|
|
34
|
+
`manifest.yml`、`archetypes.md`、`diagnosis-bank.md`、`verification.md`、`pitfalls.md`、`example.md`、`glossary.md`。
|
|
35
|
+
3. `manifest.yml` 必须恰好包含契约规定的 8 个键(不增删),且 `id` 与目录名一致。
|
|
36
|
+
4. 跑校验器确认契约通过:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
node skills/dsh-coach/scripts/coach-validate.mjs --state examples/state.demo.json --domain-dir skills/dsh-coach/references/domains/<domain-id>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**内容要求(会被人工审)**
|
|
43
|
+
|
|
44
|
+
- 诊断题必须贴合真实项目,而不是通用考试;每题标注考察维度与最小诊断类别(理解预测 / 问题定位 / 小型实现)。
|
|
45
|
+
- 核对配方必须可复制执行,并标注前置条件、期望输出、失败含义、所需沙箱模式、AI 能否代执行。
|
|
46
|
+
- 无法实测的命令必须在行内标注「(未验证)」,并说明原因——**这是硬性要求**,不要凭记忆编造命令或 API。
|
|
47
|
+
- **讲授要点必须与判分要点一致**:新增或修改某题的「讲授要点」时,必须逐条对照同一题的「合格回答要点」与「典型错误回答」,**不得互相矛盾**。第 2 轮独立审核实测发现过一次此类错误——讲授要点讲的正是判分要点列为"典型错误"的答案;这类错误会经由 R9 把错的机制直接教给零基础学员。
|
|
48
|
+
- 陷阱条目要写出机制,而不只是症状。
|
|
49
|
+
|
|
50
|
+
### 2. 改引擎
|
|
51
|
+
|
|
52
|
+
引擎文件是 `skills/dsh-coach/SKILL.md` 与 `references/engine/*.md`。
|
|
53
|
+
|
|
54
|
+
**红线**:`SKILL.md`、`references/engine/*.md`、`assets/*.md` 中**不得出现学科专有词条**。校验器的 `LY01` 检查会用硬令牌黑名单拦截(NFKC 归一化 + 整词匹配;`scripts/` 不参与扫描,因为校验器自身含词表)。这条红线是"可替换特化"能成立的唯一保证。
|
|
55
|
+
|
|
56
|
+
改教学法规则时,请在 PR 描述里说明:**原规则的失败场景是什么、为什么必须改**。本项目对引擎改动采用保守流程——参见 `docs/DESIGN-AUDIT.md` 记录的六项检验(必要性 / 最小性 / 反方论证 / 回归 / 可验证 / 复审),其中多条"看起来更好"的改动被明确驳回。
|
|
57
|
+
|
|
58
|
+
### 3. 改校验器与工具
|
|
59
|
+
|
|
60
|
+
`skills/dsh-coach/scripts/` 下三个脚本,同样零依赖:
|
|
61
|
+
|
|
62
|
+
- 新增不变量时,**必须同时**:在 `references/engine/state.md` 声明该不变量、在 `coach-selftest.mjs` 增加断言、并在反向夹具 `examples/state.selftest-invalid.json` 里覆盖它。
|
|
63
|
+
- 禁止引入子进程与管道(受限沙箱下会失败);自测必须在进程内调用校验函数。
|
|
64
|
+
- 只读代码路径不得写文件;写文件路径必须可清理。
|
|
65
|
+
|
|
66
|
+
## 提交 PR
|
|
67
|
+
|
|
68
|
+
1. 分支命名:`feat/domain-<id>`、`fix/engine-<topic>`、`chore/<topic>`。
|
|
69
|
+
2. 提交信息:祈使句,说明**为什么**;领域包 PR 请附上题目/配方的来源或实测记录。
|
|
70
|
+
3. 确认清单:
|
|
71
|
+
- [ ] 上述三条本地验证命令全绿
|
|
72
|
+
- [ ] 未把学科词条写进引擎文件
|
|
73
|
+
- [ ] 新领域包补了 `example.md`(填好的基线 + 阶段 + 审阅 + 验收结论)
|
|
74
|
+
- [ ] 无法实测的命令已标「(未验证)」
|
|
75
|
+
- [ ] `CHANGELOG.md` 在"未发布"处补了条目(如有)
|
|
76
|
+
4. 若你要把插件收录进社区列表,那是**另一个仓库**的 PR:[awesome-dsh-plugin/awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)(另有 [dshworks/awesome-dsh-plugins](https://github.com/dshworks/awesome-dsh-plugins))。请先读该仓库的 `contributing.md` 再提。
|
|
77
|
+
|
|
78
|
+
## 许可
|
|
79
|
+
|
|
80
|
+
本项目为 MIT。提交贡献即表示你同意以 MIT 许可发布你的贡献。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kirisame1969
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
[简体中文](README.zh.md)
|
|
2
|
+
|
|
3
|
+
# dsh-coach
|
|
4
|
+
|
|
5
|
+
**A project-based learning coach for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH): the learner does the work, the coach runs the loop.**
|
|
6
|
+
|
|
7
|
+
One tree, two forms: a **skill**, and an installable **plugin bundle**. The teaching engine is subject-agnostic; subject knowledge lives in swappable **domain packs** (one ships today: Unity / C#).
|
|
8
|
+
|
|
9
|
+
It does not tutor by lecturing. It runs a loop: confirm the goal → diagnose with real tasks → build an evidence-backed capability baseline → set staged deliverables → let the learner attempt first → review with graded problems → accept or reject a stage on evidence.
|
|
10
|
+
|
|
11
|
+
## Why it exists
|
|
12
|
+
|
|
13
|
+
Most AI "tutoring" collapses into one of two failures: lecturing from zero, or handing over finished work. Both destroy learning. This skill encodes the opposite rules as a protocol the agent must follow:
|
|
14
|
+
|
|
15
|
+
- **The learner attempts first.** A complete answer is a last resort, not a first move.
|
|
16
|
+
- **Hints are graded** (1 remind the goal → 5 full reference), and jumping to level 5 unasked is forbidden.
|
|
17
|
+
- **Self-reports are graded, never taken on faith and never waved away.** An *ability* claim ("I'm fluent") is only a lead and never counts as verified by itself; a *gap* claim ("I never learned X") is believed immediately and switches the coach into **teaching** instead of quizzing; an *action* report ("I ran it, the output was X") is accepted as partially verified unless contradicted — the coach will not keep asking you to re-run it.
|
|
18
|
+
- **Facts get taught; skills get practised.** When the missing piece is factual knowledge (an API name or signature, a call order, a language rule, a documented default), the coach explains it — mechanism, why your task needs it, a minimal example, then one confirmation question. Scaffolding and graded hints are for *skills* (writing code, debugging, designing), not for facts.
|
|
19
|
+
- **AI-assisted work counts only once the learner can explain, modify and verify it.**
|
|
20
|
+
- **Acceptance is three-tiered** (pass / conditional / fail), with a *reproducible + explainable + modifiable* test for evidence sufficiency.
|
|
21
|
+
|
|
22
|
+
These rules are not just prose: a zero-dependency validator enforces them mechanically on the learner's state file.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
### Option 1 — plugin bundle (recommended)
|
|
27
|
+
|
|
28
|
+
Into any DSH profile:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
dsh plugin --profile web add dsh-project-based-learning # or --profile headless, or your own profile
|
|
32
|
+
dsh --profile web --dump-config # the dsh-project-based-learning layer should appear
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Without npm, install straight from this repository:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
dsh plugin --profile web add github:Kirisame1969/dsh-project-based-learning
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The bundle layer (`cordis.patch.yml`) registers the packaged skill through `ctx.skills.register()`. The plugin only consumes the `skills` service — it imports nothing from the harness and brings no second copy of Cordis.
|
|
42
|
+
|
|
43
|
+
### Option 2 — skill files only
|
|
44
|
+
|
|
45
|
+
Into a DSH skill root (project-scoped `.dsh/skills/`, or `$DSH_HOME/skills/` for every workspace):
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx -y -p dsh-project-based-learning coach-install --dest-root "$DSH_HOME/skills"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
From a checkout, the same installer runs locally and supports `--dry-run`, `--link` and `--force`:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
node skills/dsh-coach/scripts/coach-install.mjs --dry-run
|
|
55
|
+
node skills/dsh-coach/scripts/coach-install.mjs --dest-root "$DSH_HOME/skills"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Option 3 — no install at all
|
|
59
|
+
|
|
60
|
+
Point your agent at `skills/dsh-coach/SKILL.md` and ask it to follow that file. Everything (engine protocol, domain pack, scripts) is plain files.
|
|
61
|
+
|
|
62
|
+
## Using it
|
|
63
|
+
|
|
64
|
+
Once loaded, drive it with natural-language commands:
|
|
65
|
+
|
|
66
|
+
| Command | What happens |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `开始诊断` | Goal + experience intake, then a 3-task minimum diagnostic |
|
|
69
|
+
| `制定路线` | Stage plan with deliverables, non-goals and acceptance criteria |
|
|
70
|
+
| `本次任务:…` | One task loop (deliverable → attempt → hints → evidence) |
|
|
71
|
+
| `给提示,级别 N` | Only the requested hint level (1–5) |
|
|
72
|
+
| `审阅成果:…` | Review with severity + mechanism + impact + minimal fix + verification |
|
|
73
|
+
| `验收阶段` | Three-tier verdict, `userOnly` checklist, retrieval recap |
|
|
74
|
+
| `复盘` | Capability delta, error patterns, next step |
|
|
75
|
+
| `调整节奏` | Re-plan for time/difficulty |
|
|
76
|
+
| `直接答案` | Full reference answer (recorded as *not* evidence) |
|
|
77
|
+
| `查看学习档案` / `更新学习档案` | Read / write the state file |
|
|
78
|
+
|
|
79
|
+
The command vocabulary is Chinese today. The engine prose is language-neutral — translating it is a welcome contribution.
|
|
80
|
+
|
|
81
|
+
## How it works
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
skills/dsh-coach/
|
|
85
|
+
├── SKILL.md # engine: the loop, the standing rules, command → file map
|
|
86
|
+
├── references/engine/ # 9 protocol files, loaded on demand
|
|
87
|
+
├── references/domains/unity-csharp/ # the swappable subject pack (7 files)
|
|
88
|
+
├── assets/ # state template + task/review/acceptance templates
|
|
89
|
+
└── scripts/ # zero-dependency validator, selftest, installer
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- **State** lives in `.coach/state.json` — a single source of truth — with `.coach/PROGRESS.md` rendered from it (never hand-edited).
|
|
93
|
+
- **The validator** checks the state file, the domain-pack contract, and a **layering rule**: no subject-specific tokens may appear in engine files. Run it after every accepted action:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
node skills/dsh-coach/scripts/coach-validate.mjs --state .coach/state.json --render
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Adding another subject
|
|
100
|
+
|
|
101
|
+
The engine is subject-agnostic; adding a subject never requires touching it. Create `references/domains/<new-id>/` with the seven contract files and fill in `manifest.yml` — see [`CONTRIBUTING.md`](CONTRIBUTING.md) and `skills/dsh-coach/references/engine/domain-contract.md`.
|
|
102
|
+
|
|
103
|
+
## Requirements
|
|
104
|
+
|
|
105
|
+
- Node.js `^22.19.0 || >=24.0.0` (the scripts themselves only need `fs.cpSync`, available since 16.7; the plugin matrix matches the harness).
|
|
106
|
+
- No npm dependencies, no build step. `lib/index.js` is hand-written source, not a build artifact.
|
|
107
|
+
|
|
108
|
+
## Documentation
|
|
109
|
+
|
|
110
|
+
- [`docs/installing.zh.md`](docs/installing.zh.md) — installation details (native DSH / DSH Desktop / each skill root)
|
|
111
|
+
- [`CHANGELOG.md`](CHANGELOG.md) — version history
|
|
112
|
+
- [`CONTRIBUTING.md`](CONTRIBUTING.md) — how to add a domain pack
|
|
113
|
+
|
|
114
|
+
## Contributing
|
|
115
|
+
|
|
116
|
+
The most valuable contribution is a **new domain pack**. Start with [`CONTRIBUTING.md`](CONTRIBUTING.md).
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
[MIT](LICENSE).
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
[English](README.md)
|
|
2
|
+
|
|
3
|
+
# dsh-coach
|
|
4
|
+
|
|
5
|
+
**面向 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)的项目制学习教练:学员动手,教练跑闭环。**
|
|
6
|
+
|
|
7
|
+
同一棵树同时提供两种形态:**技能(skill)**,以及可安装的**组合包(plugin bundle)**。教学引擎与学科内容分离——学科知识住在可整体替换的**领域包**里(当前提供 Unity / C#)。
|
|
8
|
+
|
|
9
|
+
它不靠讲课来"教"。它跑一条闭环:确认目标 → 用真实任务做诊断 → 建立有证据支撑的能力基线 → 设定分阶段可交付成果 → 让学员先动手 → 用分级问题审阅 → 依据证据判阶段通过与否。
|
|
10
|
+
|
|
11
|
+
## 为什么做这个
|
|
12
|
+
|
|
13
|
+
AI"辅导"通常掉进两个坑:从零开始照本宣科,或者直接替人把活干完。两者都毁掉学习。本项目把相反的规则写成了 agent 必须遵守的协议:
|
|
14
|
+
|
|
15
|
+
- **学员先尝试。** 完整答案是最后手段,不是第一步。
|
|
16
|
+
- **提示分级**(1 提醒目标 → 5 完整参考),未经请求跳到第 5 级是禁止的。
|
|
17
|
+
- **自述按三类区别对待**,既不一律采信、也不一律不采信:**能力自述**("我熟练")只是线索,不能单独作为已验证;**缺口自述**("我没学过 X")**直接采信并转入讲授**,而不是先考一遍;**操作自述**("我跑了一次,输出是 X")无反证时按部分验证接受——教练不会再要求你重跑一遍,也不会再要你先补截图。
|
|
18
|
+
- **知识直接教,技能才靠练。** 缺的是事实性知识(API 名称与签名、调用顺序、语言规则、文档已明的默认值)时,教练会**讲清楚**:概念 → 为什么你的任务需要它 → 最小示例 → 一道确认题。脚手架与分级提示用于**技能**(写代码、排错、设计),不用于事实。
|
|
19
|
+
- **AI 参与的成果,只有在学员能解释、修改、验证之后**才算作他的能力证据。
|
|
20
|
+
- **验收三档**(通过 / 有条件通过 / 未通过),证据充分性的判据是"可复现 + 可解释 + 可修改"。
|
|
21
|
+
|
|
22
|
+
这些规则不只是文字:一个**零依赖校验器**会在学员的状态文件上机械地执行它们。
|
|
23
|
+
|
|
24
|
+
## 安装
|
|
25
|
+
|
|
26
|
+
### 方式一:组合包(推荐)
|
|
27
|
+
|
|
28
|
+
装进任意 DSH profile:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
dsh plugin --profile web add dsh-project-based-learning # 也可用 --profile headless 或你自己的 profile
|
|
32
|
+
dsh --profile web --dump-config # 应出现 dsh-project-based-learning 层
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
不经 npm,直接从本仓库安装:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
dsh plugin --profile web add github:Kirisame1969/dsh-project-based-learning
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
组合包层(`cordis.patch.yml`)通过 `ctx.skills.register()` 注册随包分发的技能。插件只消费 `skills` 服务,不 import 任何 harness 包,也不会带进第二份 Cordis。
|
|
42
|
+
|
|
43
|
+
### 方式二:只装技能文件
|
|
44
|
+
|
|
45
|
+
装进任意 DSH 技能根(项目级 `.dsh/skills/`,或用户级 `$DSH_HOME/skills/`):
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx -y -p dsh-project-based-learning coach-install --dest-root "$DSH_HOME/skills"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
若已有本仓库检出,可直接运行同一个安装器,支持 `--dry-run`、`--link` 与 `--force`:
|
|
52
|
+
|
|
53
|
+
```powershell
|
|
54
|
+
node skills\dsh-coach\scripts\coach-install.mjs --dry-run
|
|
55
|
+
node skills\dsh-coach\scripts\coach-install.mjs --dest-root "$env:DSH_HOME\skills"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 方式三:完全不安装
|
|
59
|
+
|
|
60
|
+
把 agent 指向 `skills/dsh-coach/SKILL.md`,让它按该文件执行。所有内容(引擎协议、领域包、脚本)都是普通文件。
|
|
61
|
+
|
|
62
|
+
## 用法
|
|
63
|
+
|
|
64
|
+
加载后用自然语言指令驱动:
|
|
65
|
+
|
|
66
|
+
| 指令 | 作用 |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `开始诊断` | 收集目标与经验,做三类最小覆盖诊断 |
|
|
69
|
+
| `制定路线` | 生成/调整阶段路线 |
|
|
70
|
+
| `本次任务:…` | 进入单次任务循环 |
|
|
71
|
+
| `给提示,级别 N` | 只给指定级别的提示 |
|
|
72
|
+
| `审阅成果:…` | 按五要素 + 依据 + 核对状态审阅 |
|
|
73
|
+
| `验收阶段` | 三档结论 + `userOnly` 逐项核对 + 检索式复述 |
|
|
74
|
+
| `复盘` | 能力变化 / 错误模式 / 下一步 |
|
|
75
|
+
| `调整节奏` | 按时间或难度调整路线 |
|
|
76
|
+
| `直接答案` | 给完整参考实现(记录为**不计**能力证据) |
|
|
77
|
+
| `查看学习档案` / `更新学习档案` | 读/写状态并校验 |
|
|
78
|
+
|
|
79
|
+
## 工作原理
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
skills/dsh-coach/
|
|
83
|
+
├── SKILL.md # 引擎:闭环、常驻规则、指令→必读文件映射
|
|
84
|
+
├── references/engine/ # 9 个协议文件,按需加载
|
|
85
|
+
├── references/domains/unity-csharp/ # 可替换的学科包(7 个文件)
|
|
86
|
+
├── assets/ # 状态模板 + 任务卡/审阅/验收模板
|
|
87
|
+
└── scripts/ # 零依赖校验器、回归自测、安装器
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- **状态**在 `.coach/state.json`——唯一事实源;`.coach/PROGRESS.md` 由它渲染而来(**禁止手工编辑**)。
|
|
91
|
+
- **校验器**检查状态文件、领域包契约,以及一条**分层规则**:引擎文件中不得出现学科专有词条。每次可验收动作后运行:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
node skills/dsh-coach/scripts/coach-validate.mjs --state .coach/state.json --render
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 替换学科特化
|
|
98
|
+
|
|
99
|
+
引擎学科无关;换学科**不需要改引擎**。新增 `references/domains/<new-id>/` 七个文件并按契约填 `manifest.yml` 即可,步骤见 [`CONTRIBUTING.md`](CONTRIBUTING.md) 与 `skills/dsh-coach/references/engine/domain-contract.md`。
|
|
100
|
+
|
|
101
|
+
## 环境要求
|
|
102
|
+
|
|
103
|
+
- Node.js `^22.19.0 || >=24.0.0`(脚本本身只需 ≥ 16.7 的 `fs.cpSync`;插件矩阵与 harness 对齐)。
|
|
104
|
+
- 无 npm 依赖、无构建步骤。`lib/index.js` 是手写来源,不是构建产物。
|
|
105
|
+
|
|
106
|
+
## 文档
|
|
107
|
+
|
|
108
|
+
- [`docs/installing.zh.md`](docs/installing.zh.md) —— 安装细则(原生 DSH / DSH Desktop / 各技能根)
|
|
109
|
+
- [`CHANGELOG.md`](CHANGELOG.md) —— 版本变更
|
|
110
|
+
- [`CONTRIBUTING.md`](CONTRIBUTING.md) —— 如何新增领域包
|
|
111
|
+
|
|
112
|
+
## 贡献
|
|
113
|
+
|
|
114
|
+
最受欢迎的贡献是**新增一个学科领域包**。请先读 [`CONTRIBUTING.md`](CONTRIBUTING.md)。
|
|
115
|
+
|
|
116
|
+
## 许可
|
|
117
|
+
|
|
118
|
+
[MIT](LICENSE)。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# dsh-coach 组合包层:把随包分发的教练技能注册为一个 DSH 运行时技能。
|
|
2
|
+
#
|
|
3
|
+
# 本文件是 `package.json#dsh.bundle.patch` 指向的层。层语义:一个 YAML 数组的
|
|
4
|
+
# 行动词(row verbs);`insert` 向组合后的配置加入插件行,后续层可按 `id`
|
|
5
|
+
# 整行替换该行(config 整体替换)。
|
|
6
|
+
#
|
|
7
|
+
# `name` 是加载器要 import 的模块名:解析到本包的入口(package.json#main → index.js),
|
|
8
|
+
# 由它调用 `ctx.skills.register()` 注册技能。**它必须等于本包的 npm 包名**,改名时同步此
|
|
9
|
+
# 行,否则层加载会因模块解析失败而报错。
|
|
10
|
+
#
|
|
11
|
+
# 前提:目标 profile 已挂载 `@deepseek-ai/dsh-skill`(`@deepseek-ai/dsh-base` 已包含)。
|
|
12
|
+
# 本包不贡献任何工具,也不改动既有行。
|
|
13
|
+
- insert:
|
|
14
|
+
- id: dsh-coach
|
|
15
|
+
name: dsh-project-based-learning
|