@hupan56/wlkj 3.0.0 → 3.1.2

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 (237) hide show
  1. package/bin/cli.js +1435 -1373
  2. package/package.json +1 -1
  3. package/templates/qoder/commands/optional/wl-insight.md +6 -4
  4. package/templates/qoder/commands/optional/wl-report.md +20 -39
  5. package/templates/qoder/commands/optional/wl-status.md +4 -4
  6. package/templates/qoder/commands/wl-code.md +2 -2
  7. package/templates/qoder/commands/wl-design.md +5 -5
  8. package/templates/qoder/commands/wl-init.md +3 -3
  9. package/templates/qoder/commands/wl-prd.md +26 -13
  10. package/templates/qoder/commands/wl-req.md +3 -3
  11. package/templates/qoder/commands/wl-search.md +78 -47
  12. package/templates/qoder/commands/wl-task.md +343 -40
  13. package/templates/qoder/commands/wl-test.md +10 -10
  14. package/templates/qoder/config.yaml +35 -13
  15. package/templates/qoder/hooks/post-tool-use.py +181 -0
  16. package/templates/qoder/hooks/session-start.py +82 -1
  17. package/templates/qoder/hooks/stop-eval.py +207 -0
  18. package/templates/qoder/hooks/user-prompt-submit.py +139 -0
  19. package/templates/qoder/rules/wl-pipeline.md +70 -8
  20. package/templates/qoder/scripts/README.md +78 -115
  21. package/templates/qoder/scripts/capability/__init__.py +26 -0
  22. package/templates/qoder/scripts/capability/__main__.py +72 -0
  23. package/templates/qoder/scripts/capability/adapters/__init__.py +29 -0
  24. package/templates/qoder/scripts/capability/adapters/cli.py +316 -0
  25. package/templates/qoder/scripts/capability/adapters/mcp.py +334 -0
  26. package/templates/qoder/scripts/capability/adapters/qw.py +271 -0
  27. package/templates/qoder/scripts/capability/caps/__init__.py +27 -0
  28. package/templates/qoder/scripts/capability/caps/context.py +36 -0
  29. package/templates/qoder/scripts/capability/caps/cron.py +50 -0
  30. package/templates/qoder/scripts/capability/caps/identity.py +43 -0
  31. package/templates/qoder/scripts/capability/caps/memory.py +71 -0
  32. package/templates/qoder/scripts/capability/caps/notify.py +41 -0
  33. package/templates/qoder/scripts/capability/caps/present.py +48 -0
  34. package/templates/qoder/scripts/capability/caps/repo.py +31 -0
  35. package/templates/qoder/scripts/capability/caps/sandbox.py +43 -0
  36. package/templates/qoder/scripts/capability/chain.py +92 -0
  37. package/templates/qoder/scripts/capability/memory_chain.py +41 -0
  38. package/templates/qoder/scripts/capability/registry.py +246 -0
  39. package/templates/qoder/scripts/capability/registry_mcp.py +250 -0
  40. package/templates/qoder/scripts/capability/smoke_test.py +211 -0
  41. package/templates/qoder/scripts/capability/smoke_test_report.json +94 -0
  42. package/templates/qoder/scripts/{report → deployment/setup}/__init__.py +11 -11
  43. package/templates/qoder/scripts/{setup → deployment/setup}/carriers.py +33 -26
  44. package/templates/qoder/scripts/deployment/setup/carriers_verify.py +148 -0
  45. package/templates/qoder/scripts/{setup → deployment/setup}/init_doctor.py +40 -16
  46. package/templates/qoder/scripts/{setup → deployment/setup}/install_qoderwork.py +20 -12
  47. package/templates/qoder/scripts/{setup → deployment/setup}/platform_doctor.py +8 -2
  48. package/templates/qoder/scripts/{setup → deployment/setup}/repo_root.py +113 -112
  49. package/templates/qoder/scripts/{setup → deployment/setup}/setup.py +31 -11
  50. package/templates/qoder/scripts/{setup → deployment/setup}/setup_lanhu.py +13 -7
  51. package/templates/qoder/scripts/domain/__init__.py +0 -0
  52. package/templates/qoder/scripts/domain/design/__init__.py +0 -0
  53. package/templates/qoder/scripts/{report → domain/design}/fill_prototype.py +12 -6
  54. package/templates/qoder/scripts/{report → domain/design}/gen_design_doc.py +8 -2
  55. package/templates/qoder/scripts/{setup → domain/kg}/__init__.py +11 -11
  56. package/templates/qoder/scripts/domain/kg/build/__init__.py +0 -0
  57. package/templates/qoder/scripts/{kg → domain/kg/build}/build_entity_registry.py +7 -2
  58. package/templates/qoder/scripts/{kg → domain/kg/build}/build_relations.py +7 -2
  59. package/templates/qoder/scripts/{kg → domain/kg/build}/build_style_index.py +13 -7
  60. package/templates/qoder/scripts/{kg → domain/kg/build}/build_workflows.py +7 -2
  61. package/templates/qoder/scripts/{kg → domain/kg/build}/kg_build.py +76 -9
  62. package/templates/qoder/scripts/{kg → domain/kg/build}/kg_build_db.py +7 -2
  63. package/templates/qoder/scripts/{kg → domain/kg/build}/kg_incremental.py +11 -6
  64. package/templates/qoder/scripts/{report → domain/kg/build}/learn_aggregate.py +9 -4
  65. package/templates/qoder/scripts/domain/kg/extract/__init__.py +0 -0
  66. package/templates/qoder/scripts/{common → domain/kg/extract}/extract.py +430 -419
  67. package/templates/qoder/scripts/{common → domain/kg/extract}/test_extract.py +115 -115
  68. package/templates/qoder/scripts/{common → domain/kg/extract}/ts_extract.py +614 -536
  69. package/templates/qoder/scripts/domain/kg/graph/__init__.py +0 -0
  70. package/templates/qoder/scripts/{kg → domain/kg/graph}/kg_link_db.py +7 -2
  71. package/templates/qoder/scripts/domain/kg/graph/kg_semantic.py +683 -0
  72. package/templates/qoder/scripts/{kg → domain/kg}/kg.py +263 -30
  73. package/templates/qoder/scripts/{common → domain/kg}/kg_capabilities.py +182 -182
  74. package/templates/qoder/scripts/domain/kg/search/__init__.py +0 -0
  75. package/templates/qoder/scripts/{kg → domain/kg/search}/context_pack.py +30 -9
  76. package/templates/qoder/scripts/{kg → domain/kg/search}/enrich_prompt.py +10 -4
  77. package/templates/qoder/scripts/{kg → domain/kg/search}/prefetch.py +33 -8
  78. package/templates/qoder/scripts/{common → domain/kg/search}/search_engine.py +207 -205
  79. package/templates/qoder/scripts/{kg → domain/kg/search}/search_index.py +143 -77
  80. package/templates/qoder/scripts/domain/kg/server/__init__.py +0 -0
  81. package/templates/qoder/scripts/domain/kg/server/kgd.py +549 -0
  82. package/templates/qoder/scripts/domain/kg/server/perf_bench.py +197 -0
  83. package/templates/qoder/scripts/domain/kg/storage/__init__.py +0 -0
  84. package/templates/qoder/scripts/{kg → domain/kg/storage}/kg_duckdb.py +38 -14
  85. package/templates/qoder/scripts/domain/learning/__init__.py +0 -0
  86. package/templates/qoder/scripts/{report → domain/learning}/learn.py +8 -3
  87. package/templates/qoder/scripts/{mcp → domain/report}/__init__.py +11 -11
  88. package/templates/qoder/scripts/{report → domain/report}/add_session.py +9 -3
  89. package/templates/qoder/scripts/{report → domain/report}/export.py +10 -5
  90. package/templates/qoder/scripts/{report → domain/report}/report.py +9 -4
  91. package/templates/qoder/scripts/domain/report/report_snapshot.py +261 -0
  92. package/templates/qoder/scripts/{report → domain/report}/role.py +10 -4
  93. package/templates/qoder/scripts/{report → domain/report}/status.py +112 -9
  94. package/templates/qoder/scripts/domain/report/status_snapshot.py +191 -0
  95. package/templates/qoder/scripts/domain/requirement/__init__.py +0 -0
  96. package/templates/qoder/scripts/{report → domain/requirement}/archive_prd.py +8 -2
  97. package/templates/qoder/scripts/{report → domain/requirement}/req.py +228 -222
  98. package/templates/qoder/scripts/{kg → domain/task}/__init__.py +11 -11
  99. package/templates/qoder/scripts/{task → domain/task}/git_sync.py +40 -21
  100. package/templates/qoder/scripts/{task → domain/task}/syncgate.py +13 -8
  101. package/templates/qoder/scripts/{task → domain/task}/task.py +13 -5
  102. package/templates/qoder/scripts/{task → domain/task}/task_lifecycle.py +606 -596
  103. package/templates/qoder/scripts/{task → domain/task}/task_query.py +162 -161
  104. package/templates/qoder/scripts/{task → domain/task}/task_relations.py +425 -424
  105. package/templates/qoder/scripts/{task → domain/task}/team_sync.py +9 -4
  106. package/templates/qoder/scripts/domain/task/zentao_sync.py +370 -0
  107. package/templates/qoder/scripts/foundation/__init__.py +0 -0
  108. package/templates/qoder/scripts/{common → foundation}/bootstrap.py +10 -10
  109. package/templates/qoder/scripts/foundation/core/__init__.py +0 -0
  110. package/templates/qoder/scripts/{common → foundation/core}/cmd_registry.py +1 -1
  111. package/templates/qoder/scripts/{common → foundation/core}/config.py +1 -1
  112. package/templates/qoder/scripts/{common → foundation/core}/paths.py +706 -586
  113. package/templates/qoder/scripts/foundation/data/__init__.py +0 -0
  114. package/templates/qoder/scripts/{common → foundation/data}/contract.py +2 -2
  115. package/templates/qoder/scripts/{common → foundation/data}/events.py +2 -2
  116. package/templates/qoder/scripts/{common → foundation/data}/result.py +1 -1
  117. package/templates/qoder/scripts/{common → foundation/data}/task_utils.py +427 -404
  118. package/templates/qoder/scripts/foundation/identity/__init__.py +0 -0
  119. package/templates/qoder/scripts/{common → foundation/identity}/check_publish.py +103 -98
  120. package/templates/qoder/scripts/{common → foundation/identity}/developer.py +239 -239
  121. package/templates/qoder/scripts/{common → foundation/identity}/guard.py +2 -2
  122. package/templates/qoder/scripts/{common → foundation/identity}/identity.py +14 -10
  123. package/templates/qoder/scripts/{common → foundation/identity}/roles.py +1 -1
  124. package/templates/qoder/scripts/foundation/integrations/__init__.py +0 -0
  125. package/templates/qoder/scripts/{common → foundation/integrations}/active_task.py +30 -15
  126. package/templates/qoder/scripts/{common → foundation/integrations}/feishu.py +2 -2
  127. package/templates/qoder/scripts/{common → foundation/integrations}/terms.py +3 -3
  128. package/templates/qoder/scripts/foundation/integrations/zentao_client.py +220 -0
  129. package/templates/qoder/scripts/foundation/io/__init__.py +0 -0
  130. package/templates/qoder/scripts/{common → foundation/io}/filelock.py +1 -1
  131. package/templates/qoder/scripts/{common → foundation/io}/reqid.py +1 -1
  132. package/templates/qoder/scripts/foundation/protocol/__init__.py +0 -0
  133. package/templates/qoder/scripts/foundation/protocol/duckdb_conn.py +39 -0
  134. package/templates/qoder/scripts/{common → foundation/protocol}/mcp_base.py +1 -1
  135. package/templates/qoder/scripts/foundation/utils/__init__.py +0 -0
  136. package/templates/qoder/scripts/{common → foundation/utils}/eval_api.py +12 -1
  137. package/templates/qoder/scripts/{common → foundation/utils}/pip_install.py +23 -6
  138. package/templates/qoder/scripts/{common → foundation/utils}/platform_guard.py +1 -1
  139. package/templates/qoder/scripts/orchestration/__init__.py +0 -0
  140. package/templates/qoder/scripts/orchestration/wlkj.py +185 -0
  141. package/templates/qoder/scripts/protocol/__init__.py +0 -0
  142. package/templates/qoder/scripts/protocol/browser/README.md +207 -0
  143. package/templates/qoder/scripts/protocol/browser/SKILL.md +265 -0
  144. package/templates/qoder/scripts/protocol/browser/config.env +9 -0
  145. package/templates/qoder/scripts/protocol/browser/references/cdp-api.md +110 -0
  146. package/templates/qoder/scripts/protocol/browser/references/migration-2.5.3.md +72 -0
  147. package/templates/qoder/scripts/protocol/browser/references/site-patterns/.gitkeep +0 -0
  148. package/templates/qoder/scripts/protocol/browser/scripts/browser-discovery.mjs +138 -0
  149. package/templates/qoder/scripts/protocol/browser/scripts/cdp-proxy.mjs +672 -0
  150. package/templates/qoder/scripts/protocol/browser/scripts/check-deps.mjs +206 -0
  151. package/templates/qoder/scripts/protocol/browser/scripts/find-url.mjs +253 -0
  152. package/templates/qoder/scripts/protocol/browser/scripts/match-site.mjs +46 -0
  153. package/templates/qoder/scripts/protocol/browser/templates/config.env.template +9 -0
  154. package/templates/qoder/scripts/protocol/mcp/__init__.py +11 -0
  155. package/templates/qoder/scripts/protocol/mcp/kg_mcp_server.py +478 -0
  156. package/templates/qoder/scripts/{mcp → protocol/mcp}/lanhu_stdio_wrapper.py +11 -5
  157. package/templates/qoder/scripts/{mcp → protocol/mcp}/mcp_doctor.py +47 -14
  158. package/templates/qoder/scripts/protocol/mcp/mcp_launcher.py +600 -0
  159. package/templates/qoder/scripts/{mcp → protocol/mcp}/mysql_mcp_server.py +181 -67
  160. package/templates/qoder/scripts/protocol/mcp/zentao_mcp_server.py +1920 -0
  161. package/templates/qoder/scripts/protocol/transports/__init__.py +56 -0
  162. package/templates/qoder/scripts/protocol/transports/base.py +87 -0
  163. package/templates/qoder/scripts/protocol/transports/cli.py +132 -0
  164. package/templates/qoder/scripts/protocol/transports/http.py +141 -0
  165. package/templates/qoder/scripts/protocol/transports/stdio.py +293 -0
  166. package/templates/qoder/scripts/run_weekly_update.bat +27 -18
  167. package/templates/qoder/scripts/run_weekly_update.sh +22 -13
  168. package/templates/qoder/scripts/validation/__init__.py +0 -0
  169. package/templates/qoder/scripts/validation/eval/__init__.py +0 -0
  170. package/templates/qoder/scripts/validation/eval/perf-report-2026-06-24.md +139 -0
  171. package/templates/qoder/scripts/validation/eval/qwork_harness.py +617 -0
  172. package/templates/qoder/scripts/validation/eval/report-commands.md +220 -0
  173. package/templates/qoder/scripts/validation/eval/transcript_timing.py +386 -0
  174. package/templates/qoder/scripts/validation/metrics/__init__.py +0 -0
  175. package/templates/qoder/scripts/{report → validation/metrics}/eval_prd.py +17 -10
  176. package/templates/qoder/scripts/validation/metrics/usability_score.py +750 -0
  177. package/templates/qoder/scripts/validation/test/__init__.py +11 -0
  178. package/templates/qoder/scripts/validation/test/assertion_gen.py +551 -0
  179. package/templates/qoder/scripts/{test → validation/test}/autotest.py +64 -4
  180. package/templates/qoder/scripts/{common → validation/test}/autotest_auth.py +1 -1
  181. package/templates/qoder/scripts/{test → validation/test}/autotest_batch.py +16 -3
  182. package/templates/qoder/scripts/{test → validation/test}/autotest_data.py +17 -12
  183. package/templates/qoder/scripts/validation/test/autotest_opencli.py +646 -0
  184. package/templates/qoder/scripts/{test → validation/test}/autotest_run.py +17 -3
  185. package/templates/qoder/scripts/validation/test/autotest_webaccess.py +571 -0
  186. package/templates/qoder/scripts/{test → validation/test}/benchmark.py +12 -6
  187. package/templates/qoder/scripts/{test → validation/test}/kg_auto_login.py +8 -2
  188. package/templates/qoder/scripts/{test → validation/test}/kg_test_runner.py +7 -2
  189. package/templates/qoder/scripts/{test → validation/test}/page_probe.py +8 -3
  190. package/templates/qoder/scripts/validation/test/smoke_all_commands.py +170 -0
  191. package/templates/qoder/settings.json +30 -0
  192. package/templates/qoder/skills/design-import/SKILL.md +22 -13
  193. package/templates/qoder/skills/design-review/SKILL.md +19 -10
  194. package/templates/qoder/skills/prd-generator/SKILL.md +22 -18
  195. package/templates/qoder/skills/prd-review/SKILL.md +6 -4
  196. package/templates/qoder/skills/prototype-generator/SKILL.md +63 -14
  197. package/templates/qoder/skills/spec-coder/SKILL.md +22 -13
  198. package/templates/qoder/skills/spec-generator/SKILL.md +22 -10
  199. package/templates/qoder/skills/test-generator/SKILL.md +7 -5
  200. package/templates/qoder/skills/wl-code/SKILL.md +23 -11
  201. package/templates/qoder/skills/wl-commit/SKILL.md +9 -8
  202. package/templates/qoder/skills/wl-design/SKILL.md +5 -3
  203. package/templates/qoder/skills/wl-init/SKILL.md +6 -6
  204. package/templates/qoder/skills/wl-insight/SKILL.md +23 -10
  205. package/templates/qoder/skills/wl-prd-full/SKILL.md +57 -6
  206. package/templates/qoder/skills/wl-prd-quick/SKILL.md +3 -3
  207. package/templates/qoder/skills/wl-prd-review/SKILL.md +16 -4
  208. package/templates/qoder/skills/wl-report/SKILL.md +25 -23
  209. package/templates/qoder/skills/wl-search/SKILL.md +149 -78
  210. package/templates/qoder/skills/wl-spec/SKILL.md +7 -5
  211. package/templates/qoder/skills/wl-status/SKILL.md +48 -16
  212. package/templates/qoder/skills/wl-task/SKILL.md +92 -10
  213. package/templates/qoder/skills/wl-test/SKILL.md +75 -29
  214. package/templates/qoder/templates/prd-full-template.md +7 -0
  215. package/templates/root/AGENTS.md +275 -236
  216. package/templates/root/requirements.txt +3 -0
  217. package/templates/root//344/275/277/347/224/250/350/257/264/346/230/216.md +3 -3
  218. package/templates/root//346/226/260/346/211/213/346/214/207/345/215/227.md +2 -2
  219. package/templates/.qoder/.runtime/ctx-cache-5660152f1d6dd819.md +0 -23
  220. package/templates/.qoder/.runtime/ctx-cache-afdce0dac06b25b0.md +0 -23
  221. package/templates/.qoder/.runtime/search-cache-eae7644e7b122f35.txt +0 -1
  222. package/templates/.qoder/learning/eval-history.jsonl +0 -28
  223. package/templates/data/index/wiki-index.json +0 -8
  224. package/templates/qoder/nul +0 -4
  225. package/templates/qoder/scripts/kg/extract.py +0 -398
  226. package/templates/qoder/scripts/kg/kg_semantic.py +0 -156
  227. package/templates/qoder/scripts/mcp/kg_mcp_server.py +0 -606
  228. package/templates/qoder/scripts/mcp/mcp_launcher.py +0 -442
  229. package/templates/qoder/scripts/mcp/zentao_mcp_server.py +0 -384
  230. package/templates/qoder/scripts/task/__init__.py +0 -11
  231. package/templates/qoder/scripts/test/__init__.py +0 -11
  232. package/templates/qoder/scripts/wlkj.py +0 -116
  233. /package/templates/qoder/scripts/{common → deployment}/__init__.py +0 -0
  234. /package/templates/qoder/scripts/{common → domain/kg/graph}/graph_traverse.py +0 -0
  235. /package/templates/qoder/scripts/{common → domain/kg/server}/repowiki.py +0 -0
  236. /package/templates/qoder/scripts/{common → foundation/io}/atomicio.py +0 -0
  237. /package/templates/qoder/scripts/{test → validation/test}/secure-ls.js +0 -0
@@ -11,18 +11,42 @@ trigger: "user invokes /wl-* command explicitly"
11
11
  ```bash
12
12
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
13
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
15
 
16
16
  # Prototype Generator
17
17
 
18
18
  Generate production-ready HTML prototypes that match the project's actual UI style.
19
19
 
20
+ ## 🔌 MCP 工具可用性(双轨)
21
+
22
+ 本 skill 用到的知识图谱 MCP 工具(`MCP 工具 (` / `MCP 工具 (`)**自动路由(有 MCP 走 MCP,无 MCP 走 CLI)**。
23
+
24
+ - **QoderWork**:直接调 MCP 工具(更快更准)。
25
+ - **Qoder IDE/Quest/CLI(无 MCP)**:用 `python "$R/.qoder/scripts/orchestration/wlkj.py" search` 降级(`--style` / `--field <名>` / `--vben` / `--components`);仅 MCP 有的能力(如 fill_prototype/context_pack)跳过或人工补。
26
+
20
27
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
21
28
 
22
- - `.qoder/.developer` — 决定产出存到 `workspace/members/{dev}/drafts/`
29
+ - **当前身份**:决定产出存到 `workspace/members/{dev}/drafts/`。读法:先 `R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
30
+ 再 `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
31
+ ⚠️ 勿用裸相对路径 `.qoder/.developer`(QoderWork 桌面端 cwd 不在仓库根,会读不到而误报未初始化)。
23
32
  - 若 `.qoder/.current-task` 存在,原型命名带上任务关键词
24
33
  - 平台(Web/APP/Both)必须明确;如未指定,先问用户(见 prd-generator Step 0)
25
34
 
35
+ ## ⚠️ 前置门: 用户是否选了"画原型"?(v3.1 新增)
36
+
37
+ 本 skill **只在用户明确选择"画原型"后才进入**。
38
+
39
+ - 如果上游 `/wl-prd-full` 或 `/wl-prd` 在「批量确认」环节已决定**不画**(PRD 第 1 行
40
+ `@contract` 头标记 `prototype: none`),**立即退出本 skill**,不生成任何 HTML。
41
+ - 如果上游没有 contract 头(独立调用本 skill),**先问用户**:
42
+ `这个需求要画原型吗?(画 / 不画)`
43
+ 用户答"不画"→ 退出;用户答"画"→ 继续。
44
+ - **绝不擅自决定画/不画**。决策权在用户,本 skill 只执行。
45
+
46
+ > 这条门治"AI 默默画了个塑料骨架"的反模式——比如"出交车点检固定为总部全局规则"
47
+ > 这种纯规则下发型需求,AI 不该自己往里塞一个配置页原型。
48
+
49
+ ---
26
50
  ## Step 0: Know the Platform
27
51
 
28
52
  The platform MUST already be decided (asked by /wl-prd-full Step 0).
@@ -62,15 +86,15 @@ style must STILL come from the system, never from generic admin templates:
62
86
  4. In the prototype header comment, cite which real files the style came from
63
87
  — if you cannot name a source file, you have NOT done step 1.
64
88
 
65
- ## Step 0.5: Get Design System (MUST DO FIRST)
89
+ ## 🔒 Step 0.5: Get Design System(硬门 #1,跳过则 A2 必扣分)
66
90
 
67
91
  **PREFERRED: Call MCP tool (faster, auto-generates if missing):**
68
92
  ```
69
- mcp__qoder-knowledge-graph__get_design_system(platform='web')
93
+ cap.mcp.call("get_design_system", {"platform": "web"})
70
94
  ```
71
95
 
72
96
  **FALLBACK: Read file directly:**
73
- Read `data/design/DESIGN.md`. If missing, run `python "$R/.qoder/scripts/report/gen_design_doc.py"`.
97
+ Read `data/design/DESIGN.md`. If missing, run `python "$R/.qoder/scripts/orchestration/wlkj.py" design-doc`.
74
98
 
75
99
  Returns: layout fingerprint (sidebar 160px, mixed-nav), token set (primary HSL),
76
100
  page type patterns, form behavior modes, icon rules, component stats.
@@ -86,16 +110,16 @@ Read the requirement to decide:
86
110
  - **Modal/Drawer**: Popup form
87
111
  - **Dashboard**: Charts + summary cards
88
112
 
89
- ## Step 1.5: Prefill Draft (MUST DO - 80% auto, 20% you adjust)
113
+ ## 🔒 Step 1.5: Prefill Draft(硬门 #2,跳过等于从零手抄 必出模板感)
90
114
 
91
115
  **PREFERRED: Call MCP tool:**
92
116
  ```
93
- mcp__qoder-knowledge-graph__fill_prototype(keyword='营业外合同', platform='web')
117
+ cap.mcp.call("fill_prototype", {"keyword": "营业外合同", "platform": "web"})
94
118
  ```
95
119
 
96
120
  **FALLBACK: Run script:**
97
121
  ```bash
98
- python "$R/.qoder/scripts/report/fill_prototype.py" <关键词> --platform <web|app>
122
+ python "$R/.qoder/scripts/orchestration/wlkj.py" fill-prototype <关键词> --platform <web|app>
99
123
  ```
100
124
 
101
125
  Returns: 80% complete HTML draft (real columns/fields/layout injected) + data manifest.
@@ -130,28 +154,28 @@ Your job: 20% adjustment only (interaction details, layout tweaks).
130
154
 
131
155
  **PREFERRED: MCP tools (designer-focused, no code noise):**
132
156
  ```
133
- mcp__qoder-knowledge-graph__context_pack(keyword='异常资产申请', platform='web', role='design')
157
+ cap.mcp.call("context_pack", {"keyword": "异常资产申请", "platform": "web", "role": "design"})
134
158
  ```
135
159
  `role='design'` 只返回页面示例+布局指纹+风格速查+字段,过滤掉代码/API噪音。
136
160
  比无 role 更干净,原型生成专用。
137
161
 
138
162
  **理解业务交互流程(原型要有状态,不只是静态截图):**
139
163
  ```
140
- mcp__qoder-knowledge-graph__get_workflow(module='资产')
164
+ cap.mcp.call("get_workflow", {"module": "资产"})
141
165
  ```
142
166
  返回操作链(如:查询→新增→提交→审批→归档→导出)。
143
167
  AI 据此设计原型的交互状态和页面跳转。
144
168
 
145
169
  **查语义级模块文档(比读代码更省 token):**
146
170
  ```
147
- mcp__search_wiki(keyword='资产')
171
+ cap.mcp.call("search_wiki", {"keyword": "资产"})
148
172
  ```
149
173
 
150
174
  **FALLBACK: Python scripts:**
151
175
  ```bash
152
- python "$R/.qoder/scripts/kg/search_index.py" --style <table|form|detail|modal|dashboard> --platform <web|app>
153
- python "$R/.qoder/scripts/kg/search_index.py" <keyword> --platform <web|app>
154
- python "$R/.qoder/scripts/kg/search_index.py" --field <field_name>
176
+ python "$R/.qoder/scripts/orchestration/wlkj.py" search --style <table|form|detail|modal|dashboard> --platform <web|app>
177
+ python "$R/.qoder/scripts/orchestration/wlkj.py" search <keyword> --platform <web|app>
178
+ python "$R/.qoder/scripts/orchestration/wlkj.py" search --field <field_name>
155
179
  ```
156
180
 
157
181
  Then read the TOP 2-3 most similar existing Vue files to extract:
@@ -236,6 +260,31 @@ ready-to-paste SVGs extracted from the actual projects).
236
260
  4. ICS 的菜单来自后端接口(`access_mode: backend`),静态代码里抓不到完整菜单树,
237
261
  所以菜单层级**必须由需求/PRD 提供**,不要去代码里找。
238
262
 
263
+ ## 🔒 Step 3.5: 来源锚定 + UTF-8(硬门 #3,eval A2 检查)
264
+
265
+ ### 来源锚定(必做)
266
+
267
+ 生成的 HTML 必须在 `<head>` 里写一行注释,标注样式来源的真实文件:
268
+
269
+ ```html
270
+ <!-- @prototype-source: fywl-ui/apps/ics/src/views/xxx/index.vue, fywl-ui/apps/ics/src/api/xxx.ts -->
271
+ <meta name="x-source-pages" content="fywl-ui/.../index.vue">
272
+ ```
273
+
274
+ - 来源文件**必须来自 Step 2 读过的真实 Vue/TS 文件**(prefetch 返回的 page_examples)
275
+ - 写不出具体文件名 = 你没做 Step 2 = 违规
276
+ - eval A2 会检查:HTML 含 `@prototype-source:` 或 `x-source-pages` → 通过;否则 A2 扣 5 分
277
+
278
+ ### UTF-8 强制(治编码乱码)
279
+
280
+ 生成的 HTML **必须用 UTF-8 写入**,否则中文 `<title>`/注释会变成 `鍑轰氦杞?` 乱码。
281
+
282
+ - Write 工具调用时,内容里的中文必须是原始 UTF-8(不要从 GBK 源复制)
283
+ - 如果用 Python 写文件:`open(path, 'w', encoding='utf-8')`
284
+ - **绝不要从 bash 输出里复制中文再粘贴**(bash 在 Windows 上可能转 GBK)→ 优先让
285
+ `fill_prototype` 脚本直接出文件,AI 只 Edit 占位符
286
+
287
+ ---
239
288
  ## Step 4: Highlight Changes + Interactivity
240
289
 
241
290
  - Mark NEW/CHANGED elements with the template's `highlight-new` class
@@ -11,7 +11,7 @@ trigger: "user invokes /wl-* command explicitly"
11
11
  ```bash
12
12
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
13
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
15
 
16
16
  # Spec Coder
17
17
 
@@ -25,8 +25,10 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
25
25
 
26
26
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
27
27
 
28
- - `.qoder/.developer` 当前开发者
29
- - `.qoder/.current-task` 当前任务(含任务相关的 Spec 路径)
28
+ - **当前身份**:当前开发者。读法:先 `R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
29
+ `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
30
+ ⚠️ 勿用裸相对路径 `.qoder/.developer`(QoderWork 桌面端 cwd 不在仓库根,会读不到而误报未初始化)。
31
+ - **活动任务**:当前任务(含任务相关的 Spec 路径)。读法 `python "$R/.qoder/scripts/foundation/core/paths.py" current-task`(输出任务路径;空=无活动任务)。
30
32
  - Spec 文件位置:`workspace/specs/REQ-{ID}-*.spec.md` 或 `workspace/tasks/{task-id}/spec.md`
31
33
  - 目标代码库:`data/code/`(fywl-ics 后端 / fywl-ui 前端 / Carmg-H5 移动端)
32
34
 
@@ -41,19 +43,26 @@ ls workspace/tasks/ # 任务内的 specs
41
43
 
42
44
  ## Step 2: 读取上下文
43
45
 
46
+ ### ⚡ 取全一次到位(先跑,省掉后续多次 search/Read)
47
+
48
+ ```bash
49
+ cap.mcp.call("context_pack", {"keyword": "..."}) <spec里的模块关键词> --platform <web|app> --role dev
50
+ ```
51
+
52
+ **一次拿到**:相关代码文件(第1段) + 真实字段名(第3段) + 相关 API(第5段) + Repo Wiki(第7段)。
53
+ 拿到后 Read top 2-3 个命中的相似文件,照着它们的命名/结构/异常处理写。**不要再 search_index 单词搜**。
54
+
55
+ ### 同时并发补这两项(与上面 context_pack 无依赖,同回合并发)
56
+
44
57
  1. **Spec 文件**(必需):开发规格
45
58
  2. **PRD 文件**(推荐):原始需求,理解业务背景
46
- 3. **现有代码风格**(必需):用 search_index.py 找相关模块真实代码作参考
47
- ```bash
48
- python "$R/.qoder/scripts/kg/search_index.py" <模块关键词>
49
- ```
50
- 读 top 2-3 个相似文件,照着它们的命名/结构/异常处理写
51
- 4. **架构/数据字典**(如存在):`.qoder/context/architecture.md`、`data-dictionary.md`
52
- 不存在就跳过,从现有代码推断
53
- 5. **真实表结构(推荐)**:写 Entity/SQL 前调 MySQL MCP 核对数据库真实列定义。
54
- - `mcp__qoder-mysql__query_schema(table='表名', db='库名')`
59
+ 3. **真实表结构**(写 Entity/SQL 前必查):context_pack 不含 DB schema,单独调
60
+ - `cap.mcp.call("query_schema", {"table": "表名", "db": "库名"})`(先 list_envs 问环境)
55
61
  - 拿真实列名/类型/可空/注释(含枚举定义),避免 Entity 字段和数据库对不上
56
- - 注意:[QAS 测试环境] 结构与生产一致;数据行仅参考格式
62
+ - [QAS 测试环境] 结构与生产一致;数据行仅参考格式
63
+
64
+ > 架构/数据字典 `.qoder/context/architecture.md`、`data-dictionary.md` 如存在顺手读,不存在跳过。
65
+ > 以上 Spec/PRD/query_schema 三项相互独立 → **同一条消息并发发**,不要逐个等。
57
66
 
58
67
  ## Step 3: 按 Spec 实现
59
68
 
@@ -11,7 +11,7 @@ trigger: "user invokes /wl-* command explicitly"
11
11
  ```bash
12
12
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
13
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
15
 
16
16
  # Spec Generator
17
17
 
@@ -23,11 +23,13 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
23
23
 
24
24
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
25
25
 
26
- - `.qoder/.developer` 当前开发者
27
- - `.qoder/.current-task` 当前任务(决定 spec 存到哪个 task 目录)
26
+ - **当前身份**:当前开发者。读法:先 `R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
27
+ `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
28
+ ⚠️ 勿用裸相对路径 `.qoder/.developer`(QoderWork 桌面端 cwd 不在仓库根,会读不到而误报未初始化)。
29
+ - **活动任务**:当前任务(决定 spec 存到哪个 task 目录)。读法 `python "$R/.qoder/scripts/foundation/core/paths.py" current-task`(输出任务路径;空=无活动任务)。
28
30
  - 扫描 PRD 来源目录:`data/docs/prd/`(已发布)+ `workspace/members/{dev}/drafts/REQ-*.md`(草稿)
29
31
  找出还没有对应 Spec 的 PRD
30
- - 风格/字段参考:`python "$R/.qoder/scripts/kg/search_index.py" --field <字段名>` 查现有字段命名约定
32
+ - 风格/字段参考:`python "$R/.qoder/scripts/orchestration/wlkj.py" search --field <字段名>` 查现有字段命名约定
31
33
  - 团队 Java 约定(MyBatis Plus + RESTful + BigDecimal 金额)写在本 skill 的 Step 3
32
34
 
33
35
  ## Step 1: 定位 PRD
@@ -43,15 +45,25 @@ ls workspace/members/{developer}/drafts/REQ-*.md
43
45
 
44
46
  ## Step 2: 读取上下文
45
47
 
46
- 按优先级读取:
48
+ ### ⚡ 取全一次到位(先跑,省掉后续多次 search/Read)
49
+
50
+ ```bash
51
+ cap.mcp.call("context_pack", {"keyword": "..."}) <PRD里的模块关键词> --platform <web|app> --role dev
52
+ ```
53
+
54
+ **一次拿到**:相关代码文件(第1段) + 真实字段名(第3段) + 相关 API(第5段) + Repo Wiki(第7段)。
55
+ 照着第1段命中的相似文件学写法,**不要再 search_index 单词搜**。
56
+
57
+ ### 同时并发补这几项(与 context_pack 无依赖,同回合并发)
58
+
47
59
  1. **PRD 文件**(必需):需求源
48
60
  2. **历史 Spec**(推荐):扫 `workspace/specs/` 看同类需求的写法,照着写
49
- 3. **现有代码风格**(推荐):用 search_index.py 找相关模块的真实代码做参考
50
- 4. **数据字典**(如有):`.qoder/context/data-dictionary.md`(不存在则跳过,从现有 Entity 类推断)
51
- 5. **真实表结构(强烈推荐)**:调 MySQL MCP 查数据库真实字段,别靠猜。
52
- - `mcp__qoder-mysql__query_schema(table='quality_case', db='fywl_ics_quality')`
61
+ 3. **真实表结构**(强烈推荐):context_pack 不含 DB schema,写 API 字段前单独查
62
+ - 先 `cap.mcp.call("list_envs", {})` 问环境,再 `query_schema(table='quality_case', db='fywl_ics_quality')`
53
63
  - 拿到真实列名/类型/注释(注释里常含枚举定义,如"0=小时,1=工作日")
54
- - 注意:[QAS 测试环境] 表结构与生产一致可放心用;数据行是测试数据仅参考格式
64
+
65
+ > 数据字典 `.qoder/context/data-dictionary.md` 如存在顺手读,不存在跳过。
66
+ > 以上 PRD/历史Spec/query_schema 三项相互独立 → **同一条消息并发发**,不要逐个等。
55
67
 
56
68
  ## Step 3: 分析并生成
57
69
 
@@ -11,7 +11,7 @@ trigger: "user invokes /wl-* command explicitly"
11
11
  ```bash
12
12
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
13
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
15
 
16
16
  # Test Generator
17
17
 
@@ -25,12 +25,14 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
25
25
 
26
26
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
27
27
 
28
- - `.qoder/.developer` 当前开发者
29
- - `.qoder/.current-task` 当前任务
28
+ - **当前身份**:当前开发者。读法:先 `R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
29
+ `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
30
+ ⚠️ 勿用裸相对路径 `.qoder/.developer`(QoderWork 桌面端 cwd 不在仓库根,会读不到而误报未初始化)。
31
+ - **活动任务**:当前任务。读法 `python "$R/.qoder/scripts/foundation/core/paths.py" current-task`(输出任务路径;空=无活动任务)。
30
32
  - Spec 文件:`workspace/specs/REQ-{ID}-*.spec.md` 或 `workspace/tasks/{task-id}/spec.md`
31
33
  - 已实现代码:用 search_index.py 定位
32
34
  ```bash
33
- python "$R/.qoder/scripts/kg/search_index.py" <类名或模块关键词>
35
+ python "$R/.qoder/scripts/orchestration/wlkj.py" search <类名或模块关键词>
34
36
  ```
35
37
 
36
38
  ## Step 1: 定位待测代码
@@ -48,7 +50,7 @@ ls data/code/ # 已实现代码库
48
50
  2. **Spec 文件**(推荐):测试用例映射来源
49
51
  3. **现有测试代码**(推荐):用 search_index.py 找同类 Test 类,照着写
50
52
  ```bash
51
- python "$R/.qoder/scripts/kg/search_index.py" Test
53
+ python "$R/.qoder/scripts/orchestration/wlkj.py" search Test
52
54
  ```
53
55
 
54
56
  ## Step 3: 生成测试
@@ -11,7 +11,7 @@ trigger: "user invokes /wl-* command explicitly"
11
11
  ```bash
12
12
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
13
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
15
 
16
16
  # wl-code — 按 Spec 实现代码(/wl-code 命令入口)
17
17
 
@@ -22,28 +22,40 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
22
22
 
23
23
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
24
24
 
25
- - `.qoder/.developer` 当前开发者
26
- - `.qoder/.current-task` 当前活动任务(找对应的 spec)
25
+ - **当前身份**:当前开发者。读法:先 `R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
26
+ `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
27
+ ⚠️ 勿用裸相对路径 `.qoder/.developer`(QoderWork 桌面端 cwd 不在仓库根,会读不到而误报未初始化)。
28
+ - **活动任务**:当前活动任务(找对应的 spec)。读法 `python "$R/.qoder/scripts/foundation/core/paths.py" current-task`(输出任务路径;空=无活动任务)。
27
29
  - 活动任务的 spec:`workspace/specs/` 或 `workspace/tasks/{id}/spec.md`
28
30
 
29
- ### 改代码前必查(用知识图谱 MCP,防改崩)
31
+ ### 取全一次到位(spec 里的模块名 → 1 次 context_pack 拿全)
30
32
 
31
- 1. **改表影响分析**:涉及改数据库表/Entity 时,先 `mcp__qoder-knowledge-graph__table_impact(table='表名')`
33
+ ```bash
34
+ cap.mcp.call("context_pack", {"keyword": "..."}) <模块关键词> --platform <web|app> --role dev
35
+ ```
36
+
37
+ **一次返回**:相关代码文件(第1段) + 字段真名(第3段) + 相关 API(第5段) + Repo Wiki(第7段)。
38
+ 拿到后直接 Read 2-3 个命中的代码文件照着写,**不要再 search_index 单词搜**(context 第1段已给全代码路径)。
39
+ > 只有关键词命中太少时,才回退 `search_index.py <词>` 补搜。
40
+
41
+ ### 改表/改 Entity 前必查(用知识图谱 MCP,防改崩)
42
+
43
+ > ⚠️ 本段依赖知识图谱 MCP(`cap.mcp.call("search_code", ...)` / `cap.mcp.call("query_schema", ...)`),自动路由。
44
+ > Qoder IDE/Quest/CLI 无 MCP 时:table_impact 无脚本等价,需人工评估改动波及面;真实字段可用 `python "$R/.qoder/scripts/orchestration/wlkj.py" search --field <表名>` 查代码侧字段(不含 DB 真实列类型)。
45
+
46
+ 1. **改表影响分析**:涉及改数据库表/Entity 时,先 `cap.mcp.call("table_impact", {"table": "表名"})`
32
47
  - 查这张表关联哪些 Entity + 影响哪些 Controller/接口。
33
48
  - 例:`table_impact(table='quality_case')` → 发现影响 QualityCaseController + 5 个接口。
34
49
  - 看完才知道改动波及面,避免改一处崩多处。
35
- 2. **真实字段核对**:写 Entity/SQL 前 `mcp__qoder-mysql__query_schema(table='表名')`
50
+ 2. **真实字段核对**:写 Entity/SQL 前 `cap.mcp.call("query_schema", {"table": "表名"})`
51
+ - context_pack 不含 DB 表结构(只有代码字段名),写 Entity/DDL 必须单独查真实列。
36
52
  - 拿真实列名/类型/注释(含枚举定义),别靠推断。
37
53
  - [QAS环境] 表结构与生产一致可放心用。
38
54
 
39
55
  ## 执行
40
56
 
41
57
  1. **加载 Spec**:按 REQ-ID 找 spec;没参数就读 `.qoder/.current-task`
42
- 2. **搜相关代码**:
43
- ```bash
44
- python "$R/.qoder/scripts/kg/search_index.py" <关键词>
45
- ```
46
- 读相关文件了解现有模式。
58
+ 2. **一次取全上下文**:用上面 context_pack(spec 里的模块名)拿代码+字段+API,再 Read 命中的 2-3 个文件
47
59
  3. **按 spec-coder skill 实现**:严格按 spec,遵循 data/code/ 的团队约定
48
60
  4. **自检**:
49
61
  - [ ] Spec 所有需求都覆盖
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wl-commit
3
- description: "代码提交 + push + 同步,带质量门禁。Git commit + push + sync with pre-commit quality gate. 需用户确认(DANGERONS)。"
3
+ description: "代码提交 + push + 同步,带质量门禁。Git commit + push + sync with pre-commit quality gate. 需用户确认(DANGEROUS)。"
4
4
  trigger: "user invokes /wl-* command explicitly"
5
5
  ---
6
6
 
@@ -11,7 +11,7 @@ trigger: "user invokes /wl-* command explicitly"
11
11
  ```bash
12
12
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
13
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
15
 
16
16
  # wl-commit — 代码提交 + 质量门禁 + 同步
17
17
 
@@ -21,18 +21,19 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
21
21
 
22
22
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
23
23
 
24
- - `.qoder/.developer` 当前开发者(提交作者)
24
+ - **当前身份**:当前开发者(提交作者)。读法:先 `R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
25
+ 再 `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
26
+ ⚠️ 勿用裸相对路径 `.qoder/.developer`(QoderWork 桌面端 cwd 不在仓库根,会读不到而误报未初始化)。
25
27
  - 当前工作目录的 `git status` 和 `git diff --stat` 看改了什么
26
- - `.qoder/.current-task` — 若有活动任务,提交信息关联任务 ID
28
+ - **活动任务**:若有活动任务,提交信息关联任务 ID。读法 `python "$R/.qoder/scripts/foundation/core/paths.py" current-task`(输出任务路径;空=无活动任务)。
27
29
 
28
30
  ## 执行流程
29
31
 
30
32
  ### Step 1: 看改动
31
33
  ```bash
32
- git status
33
- git diff --stat
34
- git diff --cached --stat
34
+ git status && git diff HEAD --stat
35
35
  ```
36
+ > 三个只读查询合并成一条命令一次拿全(status + 工作区/暂存区改动清单),别分三次发。
36
37
 
37
38
  ### Step 2: 质量门禁(提交前自检)
38
39
 
@@ -70,7 +71,7 @@ git push
70
71
 
71
72
  提交成功后埋点(写当前开发者的 journal,供 /wl-status 健康度统计):
72
73
  ```bash
73
- python "$R/.qoder/scripts/report/learn.py" record commit_done "{\"files\": <改动文件数>, \"task\": \"<关联任务ID或空>\"}"
74
+ python "$R/.qoder/scripts/orchestration/wlkj.py" learn record commit_done "{\"files\": <改动文件数>, \"task\": \"<关联任务ID或空>\"}"
74
75
  ```
75
76
  > 失败静默忽略,绝不阻塞提交流程。
76
77
 
@@ -11,7 +11,7 @@ trigger: "user invokes /wl-* command explicitly"
11
11
  ```bash
12
12
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
13
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
15
 
16
16
  # wl-design — 设计工序入口(/wl-design 命令入口)
17
17
 
@@ -36,8 +36,10 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
36
36
 
37
37
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
38
38
 
39
- - `.qoder/.developer` 当前设计师名(产出归属)
40
- - `.qoder/.current-task` 若存在,spec/原型命名带上任务关键词
39
+ - **当前身份**:当前设计师名(产出归属)。读法:先 `R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
40
+ `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
41
+ ⚠️ 勿用裸相对路径 `.qoder/.developer`(QoderWork 桌面端 cwd 不在仓库根,会读不到而误报未初始化)。
42
+ - **活动任务**:若存在,spec/原型命名带上任务关键词。读法 `python "$R/.qoder/scripts/foundation/core/paths.py" current-task`(输出任务路径;空=无活动任务)。
41
43
  - 平台必须明确(Web/APP/Both);如未指定,先问
42
44
  - 风格真源:`data/style/*-design-spec.json`(优先)→ `data/code/` 源码 → `data/index/vben-style-reference.json`(Web)/ Vant(APP)
43
45
 
@@ -11,7 +11,7 @@ trigger: "user invokes /wl-* command explicitly"
11
11
  ```bash
12
12
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
13
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
15
 
16
16
  # wl-init — 开发者身份 + 环境体检
17
17
 
@@ -28,14 +28,14 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
28
28
 
29
29
  ### 无参数(仅体检)
30
30
  ```bash
31
- python "$R/.qoder/scripts/setup/init_doctor.py"
31
+ python "$R/.qoder/scripts/orchestration/wlkj.py" doctor
32
32
  ```
33
33
  输出 8 段体检报告,每行 `[OK]/[WARN]/[FIX]/[MISS]` 标注。
34
34
 
35
35
  ### 带名字(注册 + 自愈)
36
36
  ```bash
37
- python "$R/.qoder/scripts/setup/init_doctor.py" --fix <名字> [角色]
38
- # 例:python "$R/.qoder/scripts/setup/init_doctor.py" --fix 小王 pm
37
+ python "$R/.qoder/scripts/orchestration/wlkj.py" doctor --fix <名字> [角色]
38
+ # 例:python "$R/.qoder/scripts/orchestration/wlkj.py" doctor --fix 小王 pm
39
39
  ```
40
40
  做 3 件事:
41
41
  1. 写 `.qoder/.developer`(key=value 格式)
@@ -44,7 +44,7 @@ python "$R/.qoder/scripts/setup/init_doctor.py" --fix <名字> [角色]
44
44
 
45
45
  ### 仅自愈(不换人)
46
46
  ```bash
47
- python "$R/.qoder/scripts/setup/init_doctor.py" --fix
47
+ python "$R/.qoder/scripts/orchestration/wlkj.py" doctor --fix
48
48
  ```
49
49
 
50
50
  ## 体检覆盖的 8 段
@@ -71,6 +71,6 @@ python "$R/.qoder/scripts/setup/init_doctor.py" --fix
71
71
  体检/注册本身不需要 push(只改本地 `.developer`)。但若 `--fix` 触发了图谱重建,
72
72
  完成后建议跑一次:
73
73
  ```bash
74
- python "$R/.qoder/scripts/task/team_sync.py" push
74
+ cap.mcp.call("sync", {"direction": "push"})
75
75
  ```
76
76
  让队友拿到刷新后的索引。
@@ -11,7 +11,7 @@ trigger: "user invokes /wl-* command explicitly"
11
11
  ```bash
12
12
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
13
  ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python "$R/.qoder/scripts/orchestration/wlkj.py" install-qw`。
15
15
 
16
16
  # wl-insight — 需求探索(7 站之前的「探索站」· 产品工位)
17
17
 
@@ -54,17 +54,30 @@ insight(探索/调研/规划)→ [用户确认转PRD] → prd(落地)→
54
54
 
55
55
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
56
56
 
57
- - `.qoder/.developer` 当前探索者(报告归属)
58
- - **现状锚点**:`python "$R/.qoder/scripts/kg/context_pack.py" <关键词> --platform <web|app>`(必跑,探索不能脱离现状凭空想)
59
- - `.qoder/learning/feedback.jsonl` 历史 insight 报告索引(可能为空)
60
- - 相关历史 PRD:`data/docs/prd/`(看已经做了什么,避免重复)
57
+ - **当前身份**:当前探索者(报告归属)。读法:先 `R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.` 定位仓库根,
58
+ `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`(输出开发者名;空=未初始化)。
59
+ ⚠️ 勿用裸相对路径 `.qoder/.developer`(QoderWork 桌面端 cwd 不在仓库根,会读不到而误报未初始化)。
60
+ - **现状锚点(必跑,只跑这一次)**:用 prefetch 一次取全,不要串行换词搜:
61
+ ```bash
62
+ python "$R/.qoder/scripts/orchestration/wlkj.py" kg prefetch "<需求描述原句>"
63
+ ```
64
+ > **不传 `--platform` = 默认双平台一次返回**(platform: all)。探索阶段需求常未定平台,
65
+ > 直接默认双平台拿全,**绝不 web 跑一次、app 再跑一次**(这是 insight 慢的 #2 元凶)。
66
+ > 用户明确说"只要 web/只要 app"时,才加 `--platform web` 或 `app`。
67
+ > 探索需求常含多业务实体(如"3D地图实时车辆调度"),prefetch 自动拆多词批量搜、
68
+ > 一次合并代码+页面+字段+历史PRD标题+API+RepoWiki。**拿到后不要再串行 search/find/grep**,
69
+ > 也不要再单独扫 `data/docs/prd/`(prefetch 第4段已返回相关历史 PRD 标题,要参考某篇再单独读那篇)。
70
+ - `workspace/members/{dev}/journal/feedback.jsonl` — 历史 insight 报告索引(可能为空;按人分文件,团队 git 共享)
71
+
72
+ > 🚫 禁止串行换词搜:第一次 prefetch 没命中或命中少,先反思是不是需求描述太泛,
73
+ > 不要本能地 context_pack 换第2个、第3个词再搜(这是 insight 慢的 #1 元凶)。
61
74
 
62
75
  ---
63
76
 
64
77
  ## 🔒 三道前置检查(任何动作前先做)
65
78
 
66
- 1. **身份检查**:`.developer` 缺失 → 停下,提示先 `/wl-init`,不继续。
67
- 2. **现状锚点**:任何探索前先跑 `context_pack.py`。**不锚定现状的探索 = 凭空臆想,禁止。**
79
+ 1. **身份检查**:跑 `python "$R/.qoder/scripts/foundation/core/paths.py" whoami`,无输出/退出码1 = 未初始化 → 停下,提示先 `/wl-init`
80
+ 2. **现状锚点**:任何探索前先跑 **1 次** `kg.py prefetch "<需求句>"`(见上方自取上下文段)。**不锚定现状的探索 = 凭空臆想,禁止。禁止串行换词搜。**
68
81
  3. **报告归属**:报告必须写到 `workspace/members/{dev}/drafts/`,用 `.developer` 归属。
69
82
 
70
83
  ---
@@ -106,7 +119,7 @@ OST ├─ Opportunity(用户机会/痛点)─ discover ──┤ → i
106
119
  ## 三类型怎么做(概要,详见命令定义)
107
120
 
108
121
  **discover(需求发现)—— 用 JTBD + OST 前两层:**
109
- 1. 跑 context_pack 锚定现状
122
+ 1. 跑 **1 次** prefetch 锚定现状(多业务实体一次取全,不要串行换词搜)
110
123
  2. 用 JTBD 还原"用户要完成什么 job",列出痛点/机会
111
124
  3. 每个机会对应一个业务 outcome(OST 第 1-2 层)
112
125
  4. 输出机会清单,问用户"哪个值得深入?"
@@ -155,7 +168,7 @@ prd 以 reference 模式(mode: reference)承接,读取 insight 报告作
155
168
 
156
169
  ## 🧩 QoderWork 增强:外部数据源(可选 · 无连接器则自动回退)
157
170
 
158
- > 依赖 **QoderWork 桌面端连接器**(Settings → Connectors & MCP)。
171
+ > 通过 capability 层自动路由(Settings → Connectors & MCP)。
159
172
  > **纯 Qoder IDE / CLI 没有连接器 → 本段不生效,insight 用 context_pack + web 搜索足够。**
160
173
  > 探测方式:仅当运行环境提供了「Browser / MCP 工具」可调用时才用。
161
174
 
@@ -186,7 +199,7 @@ prd 以 reference 模式(mode: reference)承接,读取 insight 报告作
186
199
 
187
200
  insight 报告**默认不 push**(个人探索草稿)。用户说"发出去/同步/分享给团队"才:
188
201
  ```bash
189
- python "$R/.qoder/scripts/task/team_sync.py" push
202
+ cap.mcp.call("sync", {"direction": "push"})
190
203
  ```
191
204
 
192
205
  ---