Files
memind/.cursor/skills/memind-scenario-test/SKILL.md
T
john b93c92a3e2
Memind CI / Test, build, and release guards (push) Failing after 14m27s
test(scenario): cover multi-image page generation end to end
The read_image poisoning fix had no end-to-end guard because scenarios could
only send text. Add an upload_images step that renders and uploads visually
distinct images, let chat steps attach them the same way the WeChat channel
does, and assert the generated page actually embeds every upload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-22 10:50:23 +08:00

3.7 KiB
Raw Blame History

name, description
name description
memind-scenario-test Run Memind end-to-end scenario simulations (login, multi-turn chat, page generation, public URL checks). Use when the user asks for 模拟场景测试, 场景测试, E2E 流程验证, 模拟用户操作, or describes a step-by-step chat/page test flow.

Memind 场景模拟测试

用户说「帮我模拟场景测试」或描述多步聊天/做页面流程时,必须走本 skill,不要手动拼 curl 或浏览器点选。

唯一入口

node scripts/run-scenario-test.mjs --scenario <id>

列出场景:

node scripts/run-scenario-test.mjs --list

前置条件

  1. 本地 Portal 已运行(默认 http://127.0.0.1:8081,可用 pnpm dev
  2. goosed / agent 链路可用(场景会真实发消息并等待 agent 回复)
  3. 账户默认 john / 888888;密码可用 JOHN_PASSWORD 覆盖

启动前检查:

curl -sf http://127.0.0.1:8081/auth/status

默认场景:苏州攻略页面

对应用户定义的流程,场景文件 scenarios/suzhou-page.json

  1. 登录 john / 888888
  2. 发送 hi,等待 assistant 回复
  3. 发送 帮我看看苏州攻略,1日攻略,做一个页面
  4. 验证:收到回复、含苏州关键词、有公网页面链接、HTTP 200、页面内容命中关键词

执行:

node scripts/run-scenario-test.mjs --scenario suzhou-page

Agent 工作流

  1. 确认场景:用户未指定时默认 suzhou-page;说了别的流程则查 --list 或新建场景文件
  2. 确认服务Portal /auth/status 必须 200
  3. 执行脚本:完整跑完,不要中途改用浏览器手点
  4. 失败处理:读失败项 → 修代码或环境 → 重跑同一场景
  5. 汇报:用下方模板

扩展新场景

复制 scenarios/_template.jsonscenarios/<id>.json

步骤类型(当前支持):

action 说明
login HTTP 登录,取 cookie + userId
chat 发消息(同 session 多轮),等 run 终态 + assistant 新回复
upload_images 生成并上传测试图片到 MindSpace,供后续 chat 步骤引用

upload_images 字段:categoryCode(默认 oa)、images[] (每项 filename / background / shape / accentshape 支持 circle square triangle diamond)。后续 chat 步骤设 useUploadedAssets: true 即可把这些图作为本轮附件发出。

chat.expect 可选断言:

  • assistantMinChars / timeoutMs
  • replyKeywords:回复文本关键词
  • forbidReplyPatterns:回复中不允许出现的字符串
  • page.keywords / requirePublicLink / requireHttp200 / requireMindspaceCover
  • page.requireUploadedImages / page.minUploadedImages:页面必须嵌入 upload_images 上传的资产

新增更复杂步骤(截图、微信、多账户)时:先扩展 scripts/scenario-test-lib.mjs,再加场景 JSON不要在 skill 里写死一次性命令。

结果模板

## 场景测试结果

- 场景:suzhou-page(苏州攻略一日游页面)
- Portalhttp://127.0.0.1:8081
- 账户:john
- 结果:通过 / 失败

### 步骤
1. 登录 — 通过
2. hi → 回复 — 通过(N 字)
3. 苏州页面 — 通过 / 失败

### 页面(如有)
- 链接:
- HTTP
- 关键词:

### 失败项与下一步

与 memind-test 的分工

诉求 用哪个
模拟真实用户聊天 + 做页面 本 skillrun-scenario-test.mjs
改代码后跑单测/回归守卫 memind-test skillrun-memind-tests.mjs
103 发包 portal-release skill