|
|
# AI 实训教案模块更新 Implementation Plan
|
|
|
|
|
|
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
|
|
|
|
**Goal:** 将 AI 实训教案切换到新的六个课程模块,并向 AI 发送包含教案结构要求的提示词。
|
|
|
|
|
|
**Architecture:** 教案选择页维护唯一的六模块数组和提示词生成函数。点击模块后,将完整提示词写入既有 `teachingPlan` session 缓存;通用对话页继续读取该缓存并将文本作为既有 Kimi 请求的 POST body 发送,不调整接口协议。
|
|
|
|
|
|
**Tech Stack:** Vue 3 Composition API、Vite、Node.js `assert` 静态检查。
|
|
|
|
|
|
## Global Constraints
|
|
|
|
|
|
- 仅修改 AI 实训教案选择页及其静态检查,不变更聊天接口、成绩中心或 AI 助学/助评接口。
|
|
|
- 页面必须只提供以下六个模块:互联网产品开发基础认知、市场洞察与需求分析、产品规划与设计、产品开发与测试验证、产品上线与运营推广、综合实训。
|
|
|
- 每次预置请求必须同时包含课程名称、所选模块、教学目标、实训任务、实施步骤、预期成果、评价要点。
|
|
|
|
|
|
---
|
|
|
|
|
|
### Task 1: 覆盖新模块与提示词的静态检查
|
|
|
|
|
|
**Files:**
|
|
|
- Create: `tests/ai-training-lesson-plan.static.test.cjs`
|
|
|
- Modify: `src/views/analysis-of-students/training-lesson-plan.vue`
|
|
|
|
|
|
**Interfaces:**
|
|
|
- Consumes: `training-lesson-plan.vue` 的 `dialogue` 常量和 `generateTeachingPlan(val)`。
|
|
|
- Produces: 对六个模块和结构化提示词的回归保护;测试通过时输出 `AI training lesson plan static checks passed`。
|
|
|
|
|
|
- [ ] **Step 1: 写出失败的静态检查**
|
|
|
|
|
|
```js
|
|
|
const assert = require("assert");
|
|
|
const fs = require("fs");
|
|
|
const path = require("path");
|
|
|
|
|
|
const root = path.resolve(__dirname, "..");
|
|
|
const page = fs.readFileSync(path.join(root, "src/views/analysis-of-students/training-lesson-plan.vue"), "utf8");
|
|
|
const modules = [
|
|
|
"互联网产品开发基础认知",
|
|
|
"市场洞察与需求分析",
|
|
|
"产品规划与设计",
|
|
|
"产品开发与测试验证",
|
|
|
"产品上线与运营推广",
|
|
|
"综合实训",
|
|
|
];
|
|
|
|
|
|
for (const name of modules) assert(page.includes(name), `missing module: ${name}`);
|
|
|
assert(!page.includes("市场需求挖掘"), "old module names must be removed");
|
|
|
assert(page.includes("互联网产品开发实训课程"), "prompt should name the course");
|
|
|
for (const section of ["教学目标", "实训任务", "实施步骤", "预期成果", "评价要点"]) {
|
|
|
assert(page.includes(section), `prompt should require ${section}`);
|
|
|
}
|
|
|
console.log("AI training lesson plan static checks passed");
|
|
|
```
|
|
|
|
|
|
- [ ] **Step 2: 运行测试并确认失败**
|
|
|
|
|
|
Run: `node tests/ai-training-lesson-plan.static.test.cjs`
|
|
|
|
|
|
Expected: FAIL,因为页面尚未出现全部六个模块及结构化提示词字段。
|
|
|
|
|
|
- [ ] **Step 3: 以最小改动更新选择页和提示词**
|
|
|
|
|
|
在 `training-lesson-plan.vue` 中将旧的五项 `dialogue` 常量替换为六项数组;保留模板的 `v-for` 渲染。将 `generateTeachingPlan(val)` 的缓存值改为下列模板字符串,其中 `${val}` 保持为当前点击的模块:
|
|
|
|
|
|
```js
|
|
|
`请为“互联网产品开发实训课程”的“${val}”模块生成一份实训教案。
|
|
|
请按以下结构输出:
|
|
|
1. 教学目标
|
|
|
2. 实训任务
|
|
|
3. 实施步骤
|
|
|
4. 预期成果
|
|
|
5. 评价要点
|
|
|
内容应贴合互联网产品开发的真实业务场景,并给出可直接用于课堂组织的说明。`
|
|
|
```
|
|
|
|
|
|
- [ ] **Step 4: 运行新增检查并确认通过**
|
|
|
|
|
|
Run: `node tests/ai-training-lesson-plan.static.test.cjs`
|
|
|
|
|
|
Expected: PASS,并输出 `AI training lesson plan static checks passed`。
|
|
|
|
|
|
- [ ] **Step 5: 运行所有前端静态检查**
|
|
|
|
|
|
Run: `Get-ChildItem -Path tests -Filter '*.cjs' | Sort-Object Name | ForEach-Object { node $_.FullName; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } }`
|
|
|
|
|
|
Expected: 所有检查通过,包含新增的 AI 实训教案检查。
|
|
|
|
|
|
- [ ] **Step 6: 提交实现**
|
|
|
|
|
|
```bash
|
|
|
git add src/views/analysis-of-students/training-lesson-plan.vue tests/ai-training-lesson-plan.static.test.cjs
|
|
|
git commit -m "feat: update AI lesson plan modules"
|
|
|
```
|