Files
2026-04-09 13:42:10 +02:00

79 lines
2.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: sync-dingtalk
description: 同步教案到钉钉知识库。用于将本地 Markdown 教案/大纲/销售材料同步到钉钉「标准化教案手册」知识库。支持同步单个文件或批量同步。
user-invokable: true
---
# 同步教案到钉钉知识库
将本地 Markdown 文件同步到钉钉「标准化教案手册」知识库,创建为可在线编辑的钉钉文档。
## 前置条件
需要有效的用户 Token。如果 Token 过期30天需要重新授权
```bash
cd d:/projects/vibecoding/AICODE-2026 && python scripts/sync_to_dingtalk.py auth
```
## 用法
用户可能会用以下方式触发:
- `/sync-dingtalk AICODE03-05` — 同步指定课次
- `/sync-dingtalk aicode03` — 同步 AICODE-03 全部教案
- `/sync-dingtalk aicode06` — 同步 AICODE-06 全部教案
- `/sync-dingtalk outline` — 同步课程大纲
- `/sync-dingtalk sales` — 同步销售材料
- `/sync-dingtalk all` — 同步所有内容
- "把这篇教案同步到钉钉" — 同步当前讨论的教案
## 执行逻辑
### 1. 解析用户意图
从用户输入中判断要同步的目标:
- **指定课次**(如 `AICODE03-05`):找到对应的 `.md` 文件,同步单篇
- **指定路线**(如 `aicode03``aicode06`):批量同步该路线所有教案
- **`outline`**:同步 `3-lessons/AICODE-03/AICODE-03课程大纲.md` + `3-lessons/AICODE-06/AICODE-06课程大纲.md`
- **`sales`**:同步 `2-sales/课程介绍.md` + `2-sales/家长QA.md`
- **`all`**:同步全部
### 2. 执行同步
使用 Bash 工具运行以下命令:
```bash
cd d:/projects/vibecoding/AICODE-2026 && python scripts/sync_to_dingtalk.py <target>
```
其中 `<target>` 是以下之一:
- `all` — 全部同步
- `aicode03` — AICODE-03 全部教案
- `aicode06` — AICODE-06 全部教案
- `outline` — 课程大纲
- `sales` — 销售材料
如果是**同步单个文件**,直接传文件路径:
```bash
cd d:/projects/vibecoding/AICODE-2026 && python scripts/sync_to_dingtalk.py "3-lessons/AICODE-03/AICODE03-05 自然语言驱动开发.md"
```
### 3. 处理结果
- 成功:告诉用户同步完成,报告同步了多少篇文档
- Token 过期:提示用户运行 `python scripts/sync_to_dingtalk.py auth` 重新授权
- 其他错误:显示错误信息
## 文件夹映射
| 本地路径 | 钉钉知识库位置 |
|---------|--------------|
| `3-lessons/AICODE-03/*.md` | AICODE-AI编程创新课 / AICODE-03 |
| `3-lessons/AICODE-06/*.md` | AICODE-AI编程创新课 / AICODE-06 |
| `3-lessons/AICODE-03/AICODE-03课程大纲.md` | AICODE-AI编程创新课 / AICODE-03 |
| `3-lessons/AICODE-06/AICODE-06课程大纲.md` | AICODE-AI编程创新课 / AICODE-06 |
| `2-sales/课程介绍.md` | AI人工智能课 / 销售工具 |
| `2-sales/家长QA.md` | AI人工智能课 / 销售工具 |