Skip to content
dsh.fish
Bundle

dsh-teacher-preset

Teacher-focused vertical industry preset for DeepSeek Harness — supports school teachers and tutoring teachers with mode switching

Source
Daseanle
License
MIT
Updated
Updated 22 days ago

Readme

# dsh-teacher-preset

面向教师的 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) 垂直行业预设插件 — 支持学校教师和教培教师两种场景,通过 `mode` 配置一键切换。

## 功能

将 DSH 从通用 Agent 转变为教师专用助手。核心价值在于**模式切换 + 系统提示词 + 模板库 + 文件管理**,让教师无需构造复杂 prompt 即可生成规范的教学文档。

**核心能力:**
- **模式切换**:`school`(学校教师)/ `tutoring`(教培教师)/ `all`(全模式,默认)
- 学校教师:7 种教学文档模板(教案、评价量规、试卷、课堂检测、家校通知、教学反思、练习单)
- 教培教师:7 种教培专用模板(试听课教案、学情分析报告、续报话术、招生简章、课程大纲、学员档案、知识点切片)
- 模式隔离:school 模式下 LLM 只能看到学校模板,tutoring 模式下只看到教培模板
- 自动文件保存与归档(按类型/日期命名,同日同名不覆盖)
- 课程标准参考(覆盖小学/初中/高中 6 个学科)
- 3 套条件系统提示词,按模式注入对应工作流和方法论
- **批量模板加载**:一次调用加载多个模板,减少 LLM 轮次
- **全文搜索**:跨所有已保存材料搜索关键词,返回行号和上下文
- **HTML 导出**:将 Markdown 材料导出为可打印的 HTML(A4 排版 + 中文字体)

## 安装

### 前置条件

- Node.js >= 22.19 (or >= 24)
- DSH 已安装: `npm install -g @deepseek-ai/dsh`

### 从 GitHub 安装(推荐)

```bash
dsh plugin --profile web add github:Daseanle/dsh-teacher-preset
dsh web
```

### 从本地安装

```bash
git clone https://github.com/Daseanle/dsh-teacher-preset.git
cd dsh-teacher-preset && npm install && npm run build
dsh plugin --profile web add file:./dsh-teacher-preset
dsh web
```

## 配置

在 DSH 配置目录创建或编辑 `cordis.patch.yml`:

```yaml
- id: dsh-teacher-preset
  config:
    mode: "all"                   # school | tutoring | all
    gradeLevel: "小学六年级"        # 年级
    subject: "数学"                  # 学科
    textbookVersion: "人教版"        # 教材版本
    outputDir: "./teacher-materials"  # 输出目录
    language: "zh-CN"                # 输出语言
```

### 配置项

| 字段 | 类型 | 默认值 | 说明 |
|------|------|--------|------|
| `mode` | `school` \| `tutoring` \| `all` | `all` | 教师场景模式 |
| `gradeLevel` | string | `小学六年级` | 教师所教年级 |
| `subject` | string | `数学` | 教学学科 |
| `textbookVersion` | string | `人教版` | 教材版本 |
| `outputDir` | string | `./teacher-materials` | 生成材料保存目录 |
| `language` | string | `zh-CN` | 输出语言 |

### 模式说明

| 模式 | 适用教师 | 可用模板 | 系统提示词 |
|------|---------|---------|-----------|
| `school` | 公立/私立学校在职教师 | 7 种学校模板 | 备课→上课→课后反馈 |
| `tutoring` | 教培机构教师 | 7 种教培模板 | 招生→试听→排课→上课→反馈→续报 |
| `all` | 两类都适用 | 全部 14 种模板 | 自动判断需求,先问清楚教师身份 |

## 工具

| 工具 | 说明 |
|------|------|
| `teacher_load_template` | 按类型加载文档模板(enum 随 mode 动态变化) |
| `teacher_load_templates` | 批量加载多个模板(数组参数,自动去重,减少 LLM 轮次) |
| `teacher_save_material` | 将生成材料保存到输出目录,同日同名不覆盖(自动加后缀) |
| `teacher_list_materials` | 列出已保存的材料,支持按类型筛选 |
| `teacher_read_material` | 读取已保存的材料内容,用于查看或修改 |
| `teacher_search_materials` | 全文搜索已保存材料(大小写不敏感,返回行号和上下文) |
| `teacher_load_curriculum` | 加载当前学科和年级的课程标准参考 |
| `teacher_export_material` | 将材料导出为可打印 HTML(A4 排版 + 中文字体 + 打印 CSS) |

## 模板

### 学校教师模板(mode: school)

| 模板 | 说明 |
|------|------|
| `lesson-plan` | 教案 — 教学目标、教学过程、板书设计 |
| `rubric` | 评价量规 — 多维度评分表格 |
| `quiz` | 试卷 — 选择题、填空题、判断题、解答题 |
| `exit-ticket` | 课堂检测 — 快速形成性评价(3-5题) |
| `parent-notice` | 家校通知 — 家校沟通文档 |
| `reflection` | 教学反思 — 目标达成、成功与不足 |
| `worksheet` | 练习单 — 基础题、提高题、拓展题 |

### 教培教师模板(mode: tutoring)

| 模板 | 说明 |
|------|------|
| `trial-lesson` | 试听课教案 — 破冰展示、互动练习、成果转化 |
| `student-report` | 学情分析报告 — 入学测评、进步对比、薄弱分析 |
| `renewal-script` | 续报话术 — 学情回顾、问题诊断、方案推荐、异议处理 |
| `enrollment-flyer` | 招生简章 — 课程亮点、师资、排课、收费 |
| `course-outline` | 课程大纲 — 多周排课、知识点分配、阶段测评 |
| `student-profile` | 学员档案 — 学习风格、知识掌握、课堂表现、家长沟通 |
| `knowledge-map` | 知识点切片 — 考点拆解、难度分级、前置依赖、常见错误 |

## 架构

```
DSH Agent (Node.js)
  └─ Cordis Framework
       └─ dsh-teacher-preset plugin (apply(ctx, config))
            ├─ Config Schema (zod: mode, gradeLevel, subject, textbookVersion, outputDir, language)
            ├─ TemplateManager (mode → getTypesForMode() → 7 or 14 types)
            ├─ System Prompt: buildSystemPrompt(mode) → school / tutoring / all
            │    ├─ buildSchoolPrompt()  — 备课→上课→课后反馈 + 教学法指南
            │    ├─ buildTutoringPrompt() — 招生→试听→排课→上课→反馈→续报 + 教培方法论
            │    └─ buildAllPrompt()    — 双工作流 + 自动判断指引
            ├─ Tool: teacher_load_template (enum = tm.types, mode-filtered)
            ├─ Tool: teacher_load_templates (batch loading, array param, dedup)
            ├─ Tool: teacher_save_material (type validation = tm.types)
            ├─ Tool: teacher_list_materials (scans only mode-appropriate dirs)
            ├─ Tool: teacher_read_material (type validation = tm.types)
            ├─ Tool: teacher_search_materials (full-text search, case-insensitive)
            ├─ Tool: teacher_load_curriculum (课程标准)
            ├─ Tool: teacher_export_material (MD → HTML via marked + wrapHtml)
            ├─ html-template.ts (print CSS, Chinese fonts, A4 page)
            ├─ 14 Markdown templates (7 school + 7 tutoring)
            └─ ctx.effect() cleanup
```

## 使用示例

### 学校教师模式

```
> 帮我写一节"分数的初步认识"的教案
  → 自动加载教案模板 → 生成内容 → 保存到 teacher-materials/lesson-plan/

> 生成一份第一单元的数学试卷,10道选择题
  → 自动加载试卷模板 → 生成题目和答案 → 保存到 teacher-materials/quiz/
```

### 教培教师模式

```
> 帮我生成一份小数乘法试听课教案
  → 自动加载试听课模板 → 生成五环节内容 → 保存到 teacher-materials/trial-lesson/

> 写一份春季班续报话术,这个学生计算薄弱
  → 自动加载续报话术模板 → 生成学情回顾+方案+异议处理 → 保存到 teacher-materials/renewal-script/
```

### 全模式

```
> 帮我出一份招生简章
  → LLM 自动判断为教培场景 → 加载招生简章模板 → 生成内容 → 保存

> 写一节圆的面积的教案
  → LLM 自动判断为学校场景 → 加载教案模板 → 生成内容 → 保存
```

## 项目结构

```
dsh-teacher-preset/
├── src/
│   ├── index.ts              # 插件入口: apply(ctx, config) + 3 套系统提示词
│   ├── templates.ts          # 模板管理器 + 模式过滤 (SCHOOL/TUTORING/ALL types)
│   ├── params.ts             # buildParameters() JSON Schema 转换
│   ├── html-template.ts      # HTML 导出模板 (打印 CSS + 中文字体)
│   └── tools/
│       ├── load-template.ts  # teacher_load_template (动态 enum)
│       ├── load-templates.ts # teacher_load_templates (批量加载 + 去重)
│       ├── save-material.ts  # teacher_save_material (动态 type 校验)
│       ├── list-materials.ts # teacher_list_materials (动态 type 扫描)
│       ├── read-material.ts  # teacher_read_material (动态 type 校验 + 路径遍历防护)
│       ├── search-materials.ts # teacher_search_materials (全文搜索)
│       ├── export-material.ts # teacher_export_material (HTML 导出)
│       └── load-curriculum.ts # teacher_load_curriculum
├── templates/                # 14 个 Markdown 模板
│   ├── lesson-plan.md        # 学校: 教案
│   ├── rubric.md             # 学校: 评价量规
│   ├── quiz.md               # 学校: 试卷
│   ├── exit-ticket.md        # 学校: 课堂检测
│   ├── parent-notice.md      # 学校: 家校通知
│   ├── reflection.md         # 学校: 教学反思
│   ├── worksheet.md          # 学校: 练习单
│   ├── trial-lesson.md       # 教培: 试听课教案
│   ├── student-report.md     # 教培: 学情分析报告
│   ├── renewal-script.md     # 教培: 续报话术
│   ├── enrollment-flyer.md   # 教培: 招生简章
│   ├── course-outline.md     # 教培: 课程大纲
│   ├── student-profile.md    # 教培: 学员档案
│   └── knowledge-map.md      # 教培: 知识点切片
├── test/
│   └── integration.mjs       # 集成测试 (541 tests)
├── cordis.patch.yml          # 示例配置
├── package.json
├── tsconfig.json
├── CHANGELOG.md
└── LICENSE
```

## 路线图

| 阶段 | 范围 | 状态 |
|------|------|------|
| Phase 1 — MVP | 5 工具 + 系统提示词 + 7 学校模板 + 配置 + 测试 | Complete |
| Phase 1.5 — DSH 兼容 | 修复 8 个 DSH 环境兼容性问题 + 真实 LLM 验证 | Complete |
| Phase 2 — 教培模式 | mode 切换 + 7 教培模板 + 条件系统提示词 + 模式隔离 | Complete |
| Phase 3 — 增强 | 批量模板加载 + 全文搜索 + HTML 导出 | Complete |

## License

MIT

Install

dsh plugin --profile web add github:Daseanle/dsh-teacher-preset

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source