一键导入
t-demo-run
Run a single demo E2E test file, diagnose failures, dispatch fixes to agents, and re-run until pass.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run a single demo E2E test file, diagnose failures, dispatch fixes to agents, and re-run until pass.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Execute phased task plans by dispatching work to specialized sub-agents for backend, frontend, miniapp, Flutter, or demo phases.
Validate task plan executability and consistency with a 100-point score and P0/P1/P2 fix list.
Convert technical design documents into executable phased task plans with ordered work breakdown.
Evaluate technical design documents for implementability, completeness, and consistency with a quantitative 100-point score.
Initialize a full-stack project skeleton with Rust backend (Axum + SeaORM + Redis) and React frontend (TypeScript + TanStack + Tailwind).
Generate technical design documents including API design, database schema, and implementation details for a feature.
| name | t-demo-run |
| description | Run a single demo E2E test file, diagnose failures, dispatch fixes to agents, and re-run until pass. |
| argument-hint | [测试文件路径] |
| allowed-tools | ["Read","Glob","Grep","Bash","Task","TaskCreate","TaskUpdate","TaskList","TaskGet","Agent"] |
运行时边界统一参考:${CLAUDE_PLUGIN_ROOT}/protocols/runtime-boundaries.md
/t-demo-run demo/e2e/super-admin/super-admin-comprehensive-demo.e2e.ts
参数校验。
测试文件必须存在且扩展名为 .e2e.ts。
运行前清理。
uv run scripts/cleanup-demo.py
uv run scripts/demo-test-runner.py "[测试文件]" --run-id [RUN_ID]
若整个测试文件通过:
若整个测试文件失败,列出测试用例。
uv run scripts/demo-test-runner.py "[测试文件]" --list-tests
uv run scripts/demo-test-runner.py "[测试文件]" --run-id [RUN_ID] --grep "[测试标题]"
单用例失败修复循环(最多 6 次)。
先通过 Agent(subagent_type="demo-diagnose") 启动诊断 subagent,传入 testFile、runId、testCaseTitle,生成结构化诊断。
按诊断结果通过 Agent tool 分发到对应修复 subagent:Agent(subagent_type="demo-dev") / Agent(subagent_type="frontend-dev") / Agent(subagent_type="backend-dev") / Agent(subagent_type="miniapp-dev")。
上述每次 Agent 调用均按 ${CLAUDE_PLUGIN_ROOT}/protocols/subagent-dispatch.md 执行。
读取修复 agent 返回的 tests_to_run(必填)并校验字段:
layer: backend|frontend|miniapp|flutter|democommand: 可直接执行命令reason: 关联说明required: 是否必须通过(默认 true)执行补测(按层顺序串行):backend -> frontend -> miniapp -> flutter -> demo。
补测命令必须来自允许入口:
uv run scripts/backend-test.py -- [filter]cd frontend && npm run test:run -- [pattern]cd miniapp && npm run typecheck 或 cd miniapp && npm run build:weappuv run scripts/demo-test-runner.py "[测试文件]" --run-id [RUN_ID] --grep "[测试标题]"miniapp 补测只在目标项目存在 miniapp/ 或诊断报告明确归因到小程序交付线时执行;未启用 miniapp 的项目跳过该层。
Flutter 补测只在目标项目存在声明 Flutter SDK 的 pubspec.yaml,或诊断报告明确归因到 Flutter 交付线时执行;未启用 Flutter 的项目跳过该层。
若 agent 未返回 tests_to_run:
重新运行当前用例验证修复(即 demo 层验证)。
结果输出。
最后一行必须输出机器可解析 JSON,格式固定为:
Result: {"success":"true|false","fixed":"true|false","logs":"demo/test-results/runs/[RUN_ID]","exit_code":0,"test_file":"demo/e2e/...","run_id":"[RUN_ID]","error":""}
success: 最终 Demo 验证是否通过。fixed: 本次是否经历失败后修复并通过;首次整体通过时为 false。logs: 本次运行主日志目录,优先使用 demo-test-runner.py 返回的 logs。exit_code: 最终 Demo 验证退出码。test_file: 输入测试文件路径。run_id: 本次运行 ID。error: 失败时的简要错误;成功时为空字符串。error 字段。当流程中断时:
TaskList。pending 或 failed 任务继续执行。Result: {...}。