@hupan56/wlkj 3.1.19 → 3.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/templates/qoder/commands/optional/wl-insight.md +5 -4
  3. package/templates/qoder/commands/optional/wl-report.md +4 -3
  4. package/templates/qoder/commands/optional/wl-status.md +3 -2
  5. package/templates/qoder/commands/wl-code.md +3 -2
  6. package/templates/qoder/commands/wl-design.md +3 -2
  7. package/templates/qoder/commands/wl-init.md +4 -3
  8. package/templates/qoder/commands/wl-prd.md +4 -3
  9. package/templates/qoder/commands/wl-req.md +48 -47
  10. package/templates/qoder/commands/wl-search.md +3 -2
  11. package/templates/qoder/commands/wl-task.md +23 -22
  12. package/templates/qoder/commands/wl-test.md +8 -7
  13. package/templates/qoder/skills/design-import/SKILL.md +9 -8
  14. package/templates/qoder/skills/design-review/SKILL.md +7 -6
  15. package/templates/qoder/skills/prd-generator/SKILL.md +14 -13
  16. package/templates/qoder/skills/prd-review/SKILL.md +7 -6
  17. package/templates/qoder/skills/prototype-generator/SKILL.md +11 -10
  18. package/templates/qoder/skills/spec-coder/SKILL.md +6 -5
  19. package/templates/qoder/skills/spec-generator/SKILL.md +7 -6
  20. package/templates/qoder/skills/test-generator/SKILL.md +8 -7
  21. package/templates/qoder/skills/wl-code/SKILL.md +7 -6
  22. package/templates/qoder/skills/wl-commit/SKILL.md +7 -6
  23. package/templates/qoder/skills/wl-design/SKILL.md +6 -5
  24. package/templates/qoder/skills/wl-init/SKILL.md +7 -6
  25. package/templates/qoder/skills/wl-insight/SKILL.md +7 -6
  26. package/templates/qoder/skills/wl-prd-full/SKILL.md +7 -6
  27. package/templates/qoder/skills/wl-prd-quick/SKILL.md +4 -3
  28. package/templates/qoder/skills/wl-prd-review/SKILL.md +5 -4
  29. package/templates/qoder/skills/wl-report/SKILL.md +8 -7
  30. package/templates/qoder/skills/wl-spec/SKILL.md +7 -6
  31. package/templates/qoder/skills/wl-status/SKILL.md +6 -5
  32. package/templates/qoder/skills/wl-task/SKILL.md +7 -6
  33. package/templates/qoder/skills/wl-test/SKILL.md +25 -24
@@ -9,9 +9,10 @@ trigger: "user invokes /wl-* command explicitly"
9
9
 
10
10
  **后续脚本里的 `$R` 代表仓库根**,先确定它(QoderWork 桌面端工作目录不是仓库根,相对路径会失效):
11
11
  ```bash
12
- R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
12
+ R=$($PY ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
+ PY=$(python --version >/dev/null 2>&1 && echo python || echo python3)
13
14
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `$PY "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
16
 
16
17
  # wl-spec — 生成开发 Spec(/wl-spec 命令入口)
17
18
 
@@ -22,13 +23,13 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
22
23
 
23
24
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
24
25
 
25
- - **当前身份**:当前开发者。读法:先 `R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
26
- `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
26
+ - **当前身份**:当前开发者。读法:先 `R=$($PY ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
27
+ `$PY "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
27
28
  ⚠️ 勿用裸相对路径 `.qoder/.developer`(QoderWork 桌面端 cwd 不在仓库根,会读不到而误报未初始化)。
28
- - **活动任务**:当前任务(决定 spec 存哪个 task 目录)。读法 `python "$R/.qoder/scripts/foundation/core/paths.py" current-task`(输出任务路径;空=无活动任务)。
29
+ - **活动任务**:当前任务(决定 spec 存哪个 task 目录)。读法 `$PY "$R/.qoder/scripts/foundation/core/paths.py" current-task`(输出任务路径;空=无活动任务)。
29
30
  - 扫描 PRD 来源:`data/docs/prd/`(已发布)+
30
31
  `workspace/members/{dev}/drafts/REQ-*.md`(草稿),找出还没 Spec 的 PRD
31
- - 字段命名约定:`python "$R/.qoder/scripts/orchestration/wlkj.py" search --field <字段名>`
32
+ - 字段命名约定:`$PY "$R/.qoder/scripts/orchestration/wlkj.py" search --field <字段名>`
32
33
  - 团队 Java 约定(MyBatis Plus + RESTful + BigDecimal 金额)见
33
34
  `.qoder/skills/spec-generator/SKILL.md` 的 Step 3
34
35
 
@@ -9,9 +9,10 @@ trigger: "user invokes /wl-* command explicitly"
9
9
 
10
10
  **后续脚本里的 `$R` 代表仓库根**,先确定它(QoderWork 桌面端工作目录不是仓库根,相对路径会失效):
11
11
  ```bash
12
- R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
12
+ R=$($PY ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
+ PY=$(python --version >/dev/null 2>&1 && echo python || echo python3)
13
14
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `$PY "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
16
 
16
17
  # wl-status — 项目状态总览
17
18
 
@@ -22,8 +23,8 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
22
23
  ### ⚡ Fast Path:一次拿全(必须先跑,禁止逐个 cat/ls)
23
24
 
24
25
  ```bash
25
- R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
26
- python "$R/.qoder/scripts/orchestration/wlkj.py" status-snapshot "$R"
26
+ R=$($PY ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
27
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" status-snapshot "$R"
27
28
  ```
28
29
 
29
30
  这一个命令**一次返回全部所需数据**(JSON):开发者、图谱新鲜度、EVA 历史、
@@ -103,7 +104,7 @@ python "$R/.qoder/scripts/orchestration/wlkj.py" status-snapshot "$R"
103
104
  健康度展示后,**追加一个可用性看板**(让"工作流用没用起来"可视化):
104
105
 
105
106
  ```bash
106
- python "$R/.qoder/scripts/orchestration/wlkj.py" usability --html
107
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" usability --html
107
108
  ```
108
109
 
109
110
  - **QoderWork**:脚本自动调 `qoder_show_widget` 把交互看板(仪表盘 + 绿黄红指标条)**嵌入对话流**。
@@ -9,9 +9,10 @@ trigger: "user invokes /wl-* command explicitly"
9
9
 
10
10
  **后续脚本里的 `$R` 代表仓库根**,先确定它(QoderWork 桌面端工作目录不是仓库根,相对路径会失效):
11
11
  ```bash
12
- R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
12
+ R=$($PY ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
+ PY=$(python --version >/dev/null 2>&1 && echo python || echo python3)
13
14
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `$PY "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
16
 
16
17
  # wl-task — 任务管理(7 站之「任务」站 · 产品工位)
17
18
 
@@ -118,16 +119,16 @@ AI: ✅ 需求#761 已关联 build#22(本周) + #16(未来)
118
119
 
119
120
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
120
121
 
121
- - **当前身份**:当前开发者(assignee 默认值)。读法:先 `R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
122
- `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
122
+ - **当前身份**:当前开发者(assignee 默认值)。读法:先 `R=$($PY ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
123
+ `$PY "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
123
124
  ⚠️ 勿用裸相对路径 `.qoder/.developer`(QoderWork 桌面端 cwd 不在仓库根,会读不到而误报未初始化)。
124
- - **活动任务**:当前活动任务("开始做""完成了"默认对它操作)。读法 `python "$R/.qoder/scripts/foundation/core/paths.py" current-task`(输出任务路径;空=无活动任务)。
125
+ - **活动任务**:当前活动任务("开始做""完成了"默认对它操作)。读法 `$PY "$R/.qoder/scripts/foundation/core/paths.py" current-task`(输出任务路径;空=无活动任务)。
125
126
  - 列出已有任务:`cap.mcp.call("list_tasks", {})`
126
127
  - 衔接 PRD:扫 `workspace/members/{dev}/drafts/REQ-*.md` + `data/docs/prd/REQ-*.md`
127
128
 
128
129
  ## 🔒 三道前置检查(任何动作前先做,保证健壮)
129
130
 
130
- 1. **身份检查**:跑 `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`,无输出/退出码1 = 未初始化 → 停下,提示先 `/wl-init`(否则 create 会把 assignee 写空)。
131
+ 1. **身份检查**:跑 `$PY "$R/.qoder/scripts/foundation/core/paths.py" whoami`,无输出/退出码1 = 未初始化 → 停下,提示先 `/wl-init`(否则 create 会把 assignee 写空)。
131
132
  2. **空数据兜底**:tasks 目录不存在/空 → 读操作友好提示"还没有任务",不报错;create 直接建。
132
133
  3. **脚本退出码**:`task.py` 返回非 0 → 原样读 stderr 告诉用户。`4`=权限不足(零信任 ACL),`1`=任务不存在/JSON 缺失。**绝不绕过 ACL。**
133
134
 
@@ -46,9 +46,9 @@ trigger: "user invokes /wl-* command explicitly"
46
46
  **③ 用例 JSON 必须用 `--cases-file` 传文件,禁止内联 `--cases`。**
47
47
  ```bash
48
48
  # ✅ 对: 写文件再传路径(不截断)
49
- python "$R/.qoder/scripts/orchestration/wlkj.py" test quick --cases-file <文件路径> --env test --platform web
49
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test quick --cases-file <文件路径> --env test --platform web
50
50
  # ❌ 错: 内联(长JSON截断, 多条用例必丢)
51
- python "$R/.qoder/scripts/orchestration/wlkj.py" test quick --cases '[{"case_id"...(超长)...}]'
51
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test quick --cases '[{"case_id"...(超长)...}]'
52
52
  ```
53
53
 
54
54
  **④ 无锚点时必须先 snapshot 拿真实 anchor 再填,禁止预猜 CSS selector。**
@@ -67,9 +67,9 @@ python "$R/.qoder/scripts/orchestration/wlkj.py" test quick --cases '[{"case_id"
67
67
  **⑥ recall 的 `--url` 必须用相对路径(无前导斜杠),避开 Git-bash/MSYS 路径转换坑。**
68
68
  ```bash
69
69
  # ✅ 对: 相对路径 (MSYS 不转换)
70
- python "$R/.qoder/scripts/orchestration/wlkj.py" test recall --url auth/login
70
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test recall --url auth/login
71
71
  # ❌ 错: 前导斜杠会被 Windows Git-bash 转成 /D:/.../Git/auth/login
72
- python "$R/.qoder/scripts/orchestration/wlkj.py" test recall --url /auth/login
72
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test recall --url /auth/login
73
73
  ```
74
74
  (脚本已加 normalize 兜底能修这个,但别依赖兜底——直接写相对路径最干净。)
75
75
 
@@ -95,11 +95,12 @@ python "$R/.qoder/scripts/orchestration/wlkj.py" test recall --url /auth/login
95
95
  >
96
96
  > **先确定仓库根 R**(QoderWork 桌面端工作目录不是仓库根,相对路径会失效):
97
97
  > ```bash
98
- > R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
98
+ > R=$($PY ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
99
+ PY=$(python --version >/dev/null 2>&1 && echo python || echo python3)
99
100
  > ```
100
101
  > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。
101
- > **后续脚本统一用 `python "$R/.qoder/scripts/orchestration/wlkj.py" <命令>`,不要再搜!**
102
- > 如果 `repo_root.py` 报错找不到,先在仓库里跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
102
+ > **后续脚本统一用 `$PY "$R/.qoder/scripts/orchestration/wlkj.py" <命令>`,不要再搜!**
103
+ > 如果 `repo_root.py` 报错找不到,先在仓库里跑 `$PY "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
103
104
 
104
105
  - `<R>/.qoder/.developer` — 当前开发者
105
106
  - `<R>/.qoder/config.yaml` 的 `autotest:` 段 — 环境/域名
@@ -112,7 +113,7 @@ python "$R/.qoder/scripts/orchestration/wlkj.py" test recall --url /auth/login
112
113
 
113
114
  **唯一正确做法**——1 条命令查 MySQL sys_menu 真实路由:
114
115
  ```bash
115
- python "$R/.qoder/scripts/orchestration/wlkj.py" search --routes 保险
116
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" search --routes 保险
116
117
  # → 保险管理 -> /veh/vehicle/vehAffair/insurance
117
118
  ```
118
119
  - 数据来自 MySQL `sys_menu` 表(后台动态菜单,**唯一事实源**)
@@ -165,7 +166,7 @@ coverage_matrix()
165
166
 
166
167
  **Step 0:recall 查锚点**(用相对 URL,避开 MSYS 坑)
167
168
  ```bash
168
- python "$R/.qoder/scripts/orchestration/wlkj.py" test recall --url auth/login
169
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test recall --url auth/login
169
170
  ```
170
171
  - **有锚点** → 生成用例时直接把 anchor 填进 step(确定性命中,快、零 LLM)
171
172
  - **无锚点(首次)** → **先 navigate + snapshot 拿真实锚点,再生成用例**(见 Step 0.6)
@@ -212,8 +213,8 @@ snapshot 返回形如:
212
213
 
213
214
  **🎯 知道页面名/URL 时,AI 先查按钮+接口画像(最精准,1 条命令拿到所有交互点):**
214
215
  ```bash
215
- python "$R/.qoder/scripts/orchestration/wlkj.py" test page --kw 保险 # 按业务名查
216
- python "$R/.qoder/scripts/orchestration/wlkj.py" test page --url /veh/insurance # 按URL查
216
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test page --kw 保险 # 按业务名查
217
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test page --url /veh/insurance # 按URL查
217
218
  ```
218
219
  (这是 AI 在 `/wl-test` 流程内部自动调用的工具,**用户只用 `/wl-test`,不碰此命令**。)
219
220
  输出每个按钮的 handler + 调用接口 + HTTP 方法 + 置信度,**直接对应到用例的 click→assert 断言点**。开发 `finish` 任务时也会自动生成 `test-handoff.md`,内容同此画像——交接场景直接读那份即可,不必重查。
@@ -245,7 +246,7 @@ python "$R/.qoder/scripts/orchestration/wlkj.py" test page --url /veh/insurance
245
246
  # AI 先写文件:
246
247
  # 写 workspace/members/{dev}/drafts/_autotest-cases.json
247
248
  # 再调:
248
- python "$R/.qoder/scripts/orchestration/wlkj.py" test quick \
249
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test quick \
249
250
  --cases-file workspace/members/{dev}/drafts/_autotest-cases.json \
250
251
  --desc "<用户描述>" --platform <web|app>
251
252
  ```
@@ -326,7 +327,7 @@ python "$R/.qoder/scripts/orchestration/wlkj.py" test quick \
326
327
 
327
328
  **执行方式**:把测试结果 + 测试中 `browser_snapshot` 看到的页面元素一起回传:
328
329
  ```bash
329
- python "$R/.qoder/scripts/orchestration/wlkj.py" test quick \
330
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test quick \
330
331
  --cases-file <之前的cases文件> \
331
332
  --record '{"Q-1":"pass","Q-2":"pass","Q-3":"pass"}' \
332
333
  --page-json '{"url":"/veh/vehicle/vehAffair/insurance","elements":[{"role":"textbox","name":"车牌号"},{"role":"button","name":"搜索"},{"role":"button","name":"新增"}]}'
@@ -348,10 +349,10 @@ python "$R/.qoder/scripts/orchestration/wlkj.py" test quick \
348
349
 
349
350
  ```bash
350
351
  cap.mcp.call("list_tasks", {}) # 确认任务存在
351
- python "$R/.qoder/scripts/orchestration/wlkj.py" test generate <task> # 生成骨架到 autotest-cases.jsonl
352
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test generate <task> # 生成骨架到 autotest-cases.jsonl
352
353
  # AI 读任务 PRD「验收标准」补全 steps/expected (真实数据用 {{ask:}}, 不搜源码)
353
- python "$R/.qoder/scripts/orchestration/wlkj.py" test run <task> # 注入+出执行计划
354
- python "$R/.qoder/scripts/orchestration/wlkj.py" test run <task> --record '{"..":"pass"}' # 回收结果
354
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test run <task> # 注入+出执行计划
355
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test run <task> --record '{"..":"pass"}' # 回收结果
355
356
  ```
356
357
 
357
358
  **回归测试增强(图谱 MCP)**:测接口改动时,用 `get_impact` 查影响范围,自动覆盖受影响页面:
@@ -388,10 +389,10 @@ JUnit 测试(Mock + MockMvc,Given-When-Then,`@DisplayName`,AssertJ)→
388
389
 
389
390
  ```bash
390
391
  # 从任务 PRD 的验收标准章节抿断言
391
- python "$R/.qoder/scripts/orchestration/wlkj.py" test assertion-gen --task <任务名> --page 保险
392
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test assertion-gen --task <任务名> --page 保险
392
393
 
393
394
  # 临时用 GWT 文本兜底(PRD 没写验收标准时)
394
- python "$R/.qoder/scripts/orchestration/wlkj.py" test assertion-gen \
395
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test assertion-gen \
395
396
  --gwt "Given 已登录保险页 When 点击延期提交 Then 接口 /api/insurance/delay 返回 code=200 且 状态列显示审批中" \
396
397
  --page 保险
397
398
  ```
@@ -416,9 +417,9 @@ python "$R/.qoder/scripts/orchestration/wlkj.py" test assertion-gen \
416
417
  域名才放 config(全团队一致)。账号密码每人不同 → 个人文档。
417
418
  - **个人文档**:`workspace/members/{你的名字}/autotest-data.yaml`(gitignored,永不 push)
418
419
  ```bash
419
- python "$R/.qoder/scripts/orchestration/wlkj.py" test init-data # 生成模板
420
- python "$R/.qoder/scripts/orchestration/wlkj.py" test set-data 登录账号 test --env test # 填(按环境/平台分块)
421
- python "$R/.qoder/scripts/orchestration/wlkj.py" test list-data --env test # 查看(密码脱敏)
420
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test init-data # 生成模板
421
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test set-data 登录账号 test --env test # 填(按环境/平台分块)
422
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test list-data --env test # 查看(密码脱敏)
422
423
  ```
423
424
  run/quick 时按 env/platform 自动取最精确的值;`--data` 可临时覆盖。
424
425
 
@@ -428,7 +429,7 @@ run/quick 时按 env/platform 自动取最精确的值;`--data` 可临时覆
428
429
 
429
430
  **Step A:查登录态**
430
431
  ```bash
431
- python "$R/.qoder/scripts/orchestration/wlkj.py" test login-state show
432
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test login-state show
432
433
  ```
433
434
 
434
435
  **Step B:按登录态决定行为**
@@ -449,8 +450,8 @@ python "$R/.qoder/scripts/orchestration/wlkj.py" test login-state show
449
450
 
450
451
  ```bash
451
452
  # 手动操作(一般不用,AI 会自动):
452
- python "$R/.qoder/scripts/orchestration/wlkj.py" test login-state mark --env pre --platform web # 标记已登录
453
- python "$R/.qoder/scripts/orchestration/wlkj.py" test login-state clear --env pre # 清除(强制重登录)
453
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test login-state mark --env pre --platform web # 标记已登录
454
+ $PY "$R/.qoder/scripts/orchestration/wlkj.py" test login-state clear --env pre # 清除(强制重登录)
454
455
  ```
455
456
 
456
457
  ## 🧩 QoderWork 增强:浏览器自动执行(可选 · 无连接器则自动回退)