@hupan56/wlkj 2.7.12 → 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 (253) hide show
  1. package/bin/cli.js +1435 -1107
  2. package/package.json +29 -29
  3. package/templates/qoder/agents/insight-planning.md +1 -1
  4. package/templates/qoder/agents/insight-research.md +28 -15
  5. package/templates/qoder/commands/optional/wl-insight.md +161 -161
  6. package/templates/qoder/commands/optional/wl-report.md +20 -39
  7. package/templates/qoder/commands/optional/wl-status.md +4 -4
  8. package/templates/qoder/commands/wl-code.md +2 -2
  9. package/templates/qoder/commands/wl-design.md +6 -6
  10. package/templates/qoder/commands/wl-init.md +3 -3
  11. package/templates/qoder/commands/wl-prd.md +26 -13
  12. package/templates/qoder/commands/wl-req.md +43 -0
  13. package/templates/qoder/commands/wl-search.md +78 -47
  14. package/templates/qoder/commands/wl-task.md +343 -40
  15. package/templates/qoder/commands/wl-test.md +43 -17
  16. package/templates/qoder/config.yaml +52 -14
  17. package/templates/qoder/hooks/post-tool-use.py +181 -0
  18. package/templates/qoder/hooks/session-start.py +94 -23
  19. package/templates/qoder/hooks/stop-eval.py +207 -0
  20. package/templates/qoder/hooks/user-prompt-submit.py +139 -0
  21. package/templates/qoder/rules/wl-pipeline.md +85 -49
  22. package/templates/qoder/scripts/README.md +102 -0
  23. package/templates/qoder/scripts/capability/__init__.py +26 -0
  24. package/templates/qoder/scripts/capability/__main__.py +72 -0
  25. package/templates/qoder/scripts/capability/adapters/__init__.py +29 -0
  26. package/templates/qoder/scripts/capability/adapters/cli.py +316 -0
  27. package/templates/qoder/scripts/capability/adapters/mcp.py +334 -0
  28. package/templates/qoder/scripts/capability/adapters/qw.py +271 -0
  29. package/templates/qoder/scripts/capability/caps/__init__.py +27 -0
  30. package/templates/qoder/scripts/capability/caps/context.py +36 -0
  31. package/templates/qoder/scripts/capability/caps/cron.py +50 -0
  32. package/templates/qoder/scripts/capability/caps/identity.py +43 -0
  33. package/templates/qoder/scripts/capability/caps/memory.py +71 -0
  34. package/templates/qoder/scripts/capability/caps/notify.py +41 -0
  35. package/templates/qoder/scripts/capability/caps/present.py +48 -0
  36. package/templates/qoder/scripts/capability/caps/repo.py +31 -0
  37. package/templates/qoder/scripts/capability/caps/sandbox.py +43 -0
  38. package/templates/qoder/scripts/capability/chain.py +92 -0
  39. package/templates/qoder/scripts/capability/memory_chain.py +41 -0
  40. package/templates/qoder/scripts/capability/registry.py +246 -0
  41. package/templates/qoder/scripts/capability/registry_mcp.py +250 -0
  42. package/templates/qoder/scripts/capability/smoke_test.py +211 -0
  43. package/templates/qoder/scripts/capability/smoke_test_report.json +94 -0
  44. package/templates/qoder/scripts/deployment/setup/__init__.py +11 -0
  45. package/templates/qoder/scripts/deployment/setup/carriers.py +669 -0
  46. package/templates/qoder/scripts/deployment/setup/carriers_verify.py +148 -0
  47. package/templates/qoder/scripts/{init_doctor.py → deployment/setup/init_doctor.py} +100 -39
  48. package/templates/qoder/scripts/{install_qoderwork.py → deployment/setup/install_qoderwork.py} +48 -30
  49. package/templates/qoder/scripts/{platform_doctor.py → deployment/setup/platform_doctor.py} +271 -259
  50. package/templates/qoder/scripts/{repo_root.py → deployment/setup/repo_root.py} +9 -2
  51. package/templates/qoder/scripts/{setup.py → deployment/setup/setup.py} +143 -14
  52. package/templates/qoder/scripts/{setup_lanhu.py → deployment/setup/setup_lanhu.py} +979 -963
  53. package/templates/qoder/scripts/domain/design/__init__.py +0 -0
  54. package/templates/qoder/scripts/{fill_prototype.py → domain/design/fill_prototype.py} +17 -5
  55. package/templates/qoder/scripts/{gen_design_doc.py → domain/design/gen_design_doc.py} +406 -394
  56. package/templates/qoder/scripts/domain/kg/__init__.py +11 -0
  57. package/templates/qoder/scripts/domain/kg/build/__init__.py +0 -0
  58. package/templates/qoder/scripts/domain/kg/build/build_entity_registry.py +201 -0
  59. package/templates/qoder/scripts/domain/kg/build/build_relations.py +132 -0
  60. package/templates/qoder/scripts/{build_style_index.py → domain/kg/build/build_style_index.py} +50 -15
  61. package/templates/qoder/scripts/domain/kg/build/build_workflows.py +149 -0
  62. package/templates/qoder/scripts/{kg_build.py → domain/kg/build/kg_build.py} +685 -612
  63. package/templates/qoder/scripts/{kg_build_db.py → domain/kg/build/kg_build_db.py} +338 -327
  64. package/templates/qoder/scripts/{kg_incremental.py → domain/kg/build/kg_incremental.py} +425 -393
  65. package/templates/qoder/scripts/{learn_aggregate.py → domain/kg/build/learn_aggregate.py} +212 -201
  66. package/templates/qoder/scripts/domain/kg/extract/__init__.py +0 -0
  67. package/templates/qoder/scripts/{common → domain/kg/extract}/extract.py +430 -419
  68. package/templates/qoder/scripts/domain/kg/extract/test_extract.py +115 -0
  69. package/templates/qoder/scripts/{common → domain/kg/extract}/ts_extract.py +614 -536
  70. package/templates/qoder/scripts/domain/kg/graph/__init__.py +0 -0
  71. package/templates/qoder/scripts/{kg_link_db.py → domain/kg/graph/kg_link_db.py} +235 -224
  72. package/templates/qoder/scripts/domain/kg/graph/kg_semantic.py +683 -0
  73. package/templates/qoder/scripts/{kg.py → domain/kg/kg.py} +871 -708
  74. package/templates/qoder/scripts/domain/kg/kg_capabilities.py +182 -0
  75. package/templates/qoder/scripts/domain/kg/search/__init__.py +0 -0
  76. package/templates/qoder/scripts/{context_pack.py → domain/kg/search/context_pack.py} +45 -17
  77. package/templates/qoder/scripts/{enrich_prompt.py → domain/kg/search/enrich_prompt.py} +238 -226
  78. package/templates/qoder/scripts/domain/kg/search/prefetch.py +384 -0
  79. package/templates/qoder/scripts/{common → domain/kg/search}/search_engine.py +207 -205
  80. package/templates/qoder/scripts/{search_index.py → domain/kg/search/search_index.py} +210 -88
  81. package/templates/qoder/scripts/domain/kg/server/__init__.py +0 -0
  82. package/templates/qoder/scripts/domain/kg/server/kgd.py +549 -0
  83. package/templates/qoder/scripts/domain/kg/server/perf_bench.py +197 -0
  84. package/templates/qoder/scripts/domain/kg/storage/__init__.py +0 -0
  85. package/templates/qoder/scripts/{kg_duckdb.py → domain/kg/storage/kg_duckdb.py} +70 -45
  86. package/templates/qoder/scripts/domain/learning/__init__.py +0 -0
  87. package/templates/qoder/scripts/{learn.py → domain/learning/learn.py} +157 -146
  88. package/templates/qoder/scripts/domain/report/__init__.py +11 -0
  89. package/templates/qoder/scripts/{add_session.py → domain/report/add_session.py} +256 -244
  90. package/templates/qoder/scripts/{export.py → domain/report/export.py} +72 -4
  91. package/templates/qoder/scripts/{report.py → domain/report/report.py} +292 -281
  92. package/templates/qoder/scripts/domain/report/report_snapshot.py +261 -0
  93. package/templates/qoder/scripts/domain/report/role.py +39 -0
  94. package/templates/qoder/scripts/{status.py → domain/report/status.py} +737 -628
  95. package/templates/qoder/scripts/domain/report/status_snapshot.py +191 -0
  96. package/templates/qoder/scripts/domain/requirement/__init__.py +0 -0
  97. package/templates/qoder/scripts/{archive_prd.py → domain/requirement/archive_prd.py} +389 -377
  98. package/templates/qoder/scripts/domain/requirement/req.py +228 -0
  99. package/templates/qoder/scripts/domain/task/__init__.py +11 -0
  100. package/templates/qoder/scripts/{git_sync.py → domain/task/git_sync.py} +90 -50
  101. package/templates/qoder/scripts/{syncgate.py → domain/task/syncgate.py} +18 -7
  102. package/templates/qoder/scripts/domain/task/task.py +229 -0
  103. package/templates/qoder/scripts/domain/task/task_lifecycle.py +606 -0
  104. package/templates/qoder/scripts/domain/task/task_query.py +162 -0
  105. package/templates/qoder/scripts/domain/task/task_relations.py +425 -0
  106. package/templates/qoder/scripts/{team_sync.py → domain/task/team_sync.py} +101 -23
  107. package/templates/qoder/scripts/domain/task/zentao_sync.py +370 -0
  108. package/templates/qoder/scripts/foundation/__init__.py +0 -0
  109. package/templates/qoder/scripts/foundation/bootstrap.py +145 -0
  110. package/templates/qoder/scripts/foundation/core/__init__.py +0 -0
  111. package/templates/qoder/scripts/foundation/core/cmd_registry.py +112 -0
  112. package/templates/qoder/scripts/foundation/core/config.py +187 -0
  113. package/templates/qoder/scripts/{common → foundation/core}/paths.py +706 -400
  114. package/templates/qoder/scripts/foundation/data/__init__.py +0 -0
  115. package/templates/qoder/scripts/foundation/data/contract.py +317 -0
  116. package/templates/qoder/scripts/{common → foundation/data}/events.py +2 -2
  117. package/templates/qoder/scripts/foundation/data/result.py +223 -0
  118. package/templates/qoder/scripts/{common → foundation/data}/task_utils.py +427 -392
  119. package/templates/qoder/scripts/foundation/identity/__init__.py +0 -0
  120. package/templates/qoder/scripts/foundation/identity/check_publish.py +103 -0
  121. package/templates/qoder/scripts/{common → foundation/identity}/developer.py +239 -238
  122. package/templates/qoder/scripts/foundation/identity/guard.py +159 -0
  123. package/templates/qoder/scripts/{common → foundation/identity}/identity.py +132 -9
  124. package/templates/qoder/scripts/foundation/identity/roles.py +60 -0
  125. package/templates/qoder/scripts/foundation/integrations/__init__.py +0 -0
  126. package/templates/qoder/scripts/{common → foundation/integrations}/active_task.py +30 -15
  127. package/templates/qoder/scripts/{common → foundation/integrations}/feishu.py +11 -10
  128. package/templates/qoder/scripts/{common → foundation/integrations}/terms.py +3 -3
  129. package/templates/qoder/scripts/foundation/integrations/zentao_client.py +220 -0
  130. package/templates/qoder/scripts/foundation/io/__init__.py +0 -0
  131. package/templates/qoder/scripts/{common → foundation/io}/filelock.py +1 -1
  132. package/templates/qoder/scripts/{common → foundation/io}/reqid.py +1 -1
  133. package/templates/qoder/scripts/foundation/protocol/__init__.py +0 -0
  134. package/templates/qoder/scripts/foundation/protocol/duckdb_conn.py +39 -0
  135. package/templates/qoder/scripts/foundation/protocol/mcp_base.py +268 -0
  136. package/templates/qoder/scripts/foundation/utils/__init__.py +0 -0
  137. package/templates/qoder/scripts/{common → foundation/utils}/eval_api.py +12 -1
  138. package/templates/qoder/scripts/{common → foundation/utils}/pip_install.py +23 -6
  139. package/templates/qoder/scripts/{common → foundation/utils}/platform_guard.py +1 -1
  140. package/templates/qoder/scripts/orchestration/__init__.py +0 -0
  141. package/templates/qoder/scripts/orchestration/wlkj.py +185 -0
  142. package/templates/qoder/scripts/protocol/__init__.py +0 -0
  143. package/templates/qoder/scripts/protocol/browser/README.md +207 -0
  144. package/templates/qoder/scripts/protocol/browser/SKILL.md +265 -0
  145. package/templates/qoder/scripts/protocol/browser/config.env +9 -0
  146. package/templates/qoder/scripts/protocol/browser/references/cdp-api.md +110 -0
  147. package/templates/qoder/scripts/protocol/browser/references/migration-2.5.3.md +72 -0
  148. package/templates/qoder/scripts/protocol/browser/references/site-patterns/.gitkeep +0 -0
  149. package/templates/qoder/scripts/protocol/browser/scripts/browser-discovery.mjs +138 -0
  150. package/templates/qoder/scripts/protocol/browser/scripts/cdp-proxy.mjs +672 -0
  151. package/templates/qoder/scripts/protocol/browser/scripts/check-deps.mjs +206 -0
  152. package/templates/qoder/scripts/protocol/browser/scripts/find-url.mjs +253 -0
  153. package/templates/qoder/scripts/protocol/browser/scripts/match-site.mjs +46 -0
  154. package/templates/qoder/scripts/protocol/browser/templates/config.env.template +9 -0
  155. package/templates/qoder/scripts/protocol/mcp/__init__.py +11 -0
  156. package/templates/qoder/scripts/protocol/mcp/kg_mcp_server.py +478 -0
  157. package/templates/qoder/scripts/{lanhu_stdio_wrapper.py → protocol/mcp/lanhu_stdio_wrapper.py} +131 -119
  158. package/templates/qoder/scripts/protocol/mcp/mcp_doctor.py +548 -0
  159. package/templates/qoder/scripts/protocol/mcp/mcp_launcher.py +600 -0
  160. package/templates/qoder/scripts/protocol/mcp/mysql_mcp_server.py +461 -0
  161. package/templates/qoder/scripts/protocol/mcp/zentao_mcp_server.py +1920 -0
  162. package/templates/qoder/scripts/protocol/transports/__init__.py +56 -0
  163. package/templates/qoder/scripts/protocol/transports/base.py +87 -0
  164. package/templates/qoder/scripts/protocol/transports/cli.py +132 -0
  165. package/templates/qoder/scripts/protocol/transports/http.py +141 -0
  166. package/templates/qoder/scripts/protocol/transports/stdio.py +293 -0
  167. package/templates/qoder/scripts/run_weekly_update.bat +27 -18
  168. package/templates/qoder/scripts/run_weekly_update.sh +22 -13
  169. package/templates/qoder/scripts/validation/__init__.py +0 -0
  170. package/templates/qoder/scripts/validation/eval/__init__.py +0 -0
  171. package/templates/qoder/scripts/validation/eval/perf-report-2026-06-24.md +139 -0
  172. package/templates/qoder/scripts/validation/eval/qwork_harness.py +617 -0
  173. package/templates/qoder/scripts/validation/eval/report-commands.md +220 -0
  174. package/templates/qoder/scripts/validation/eval/transcript_timing.py +386 -0
  175. package/templates/qoder/scripts/validation/metrics/__init__.py +0 -0
  176. package/templates/qoder/scripts/{eval_prd.py → validation/metrics/eval_prd.py} +84 -15
  177. package/templates/qoder/scripts/validation/metrics/usability_score.py +750 -0
  178. package/templates/qoder/scripts/validation/test/__init__.py +11 -0
  179. package/templates/qoder/scripts/validation/test/assertion_gen.py +551 -0
  180. package/templates/qoder/scripts/{autotest.py → validation/test/autotest.py} +1234 -1751
  181. package/templates/qoder/scripts/validation/test/autotest_auth.py +109 -0
  182. package/templates/qoder/scripts/{autotest_batch.py → validation/test/autotest_batch.py} +255 -224
  183. package/templates/qoder/scripts/validation/test/autotest_data.py +680 -0
  184. package/templates/qoder/scripts/validation/test/autotest_opencli.py +646 -0
  185. package/templates/qoder/scripts/{autotest_run.py → validation/test/autotest_run.py} +323 -297
  186. package/templates/qoder/scripts/validation/test/autotest_webaccess.py +571 -0
  187. package/templates/qoder/scripts/{benchmark.py → validation/test/benchmark.py} +17 -5
  188. package/templates/qoder/scripts/{kg_auto_login.py → validation/test/kg_auto_login.py} +208 -196
  189. package/templates/qoder/scripts/{kg_test_runner.py → validation/test/kg_test_runner.py} +13 -2
  190. package/templates/qoder/scripts/{page_probe.py → validation/test/page_probe.py} +470 -459
  191. package/templates/qoder/scripts/validation/test/smoke_all_commands.py +170 -0
  192. package/templates/qoder/settings.json +23 -2
  193. package/templates/qoder/skills/design-import/SKILL.md +235 -226
  194. package/templates/qoder/skills/design-review/SKILL.md +91 -82
  195. package/templates/qoder/skills/prd-generator/SKILL.md +38 -24
  196. package/templates/qoder/skills/prd-review/SKILL.md +8 -6
  197. package/templates/qoder/skills/prototype-generator/SKILL.md +296 -247
  198. package/templates/qoder/skills/spec-coder/SKILL.md +24 -15
  199. package/templates/qoder/skills/spec-generator/SKILL.md +24 -12
  200. package/templates/qoder/skills/test-generator/SKILL.md +9 -7
  201. package/templates/qoder/skills/wl-code/SKILL.md +25 -13
  202. package/templates/qoder/skills/wl-commit/SKILL.md +10 -9
  203. package/templates/qoder/skills/wl-design/SKILL.md +7 -5
  204. package/templates/qoder/skills/wl-init/SKILL.md +8 -8
  205. package/templates/qoder/skills/wl-insight/SKILL.md +25 -12
  206. package/templates/qoder/skills/wl-prd-full/SKILL.md +59 -8
  207. package/templates/qoder/skills/wl-prd-quick/SKILL.md +7 -7
  208. package/templates/qoder/skills/wl-prd-review/SKILL.md +18 -6
  209. package/templates/qoder/skills/wl-report/SKILL.md +27 -25
  210. package/templates/qoder/skills/wl-search/SKILL.md +151 -80
  211. package/templates/qoder/skills/wl-spec/SKILL.md +9 -7
  212. package/templates/qoder/skills/wl-status/SKILL.md +50 -18
  213. package/templates/qoder/skills/wl-task/SKILL.md +94 -12
  214. package/templates/qoder/skills/wl-test/SKILL.md +154 -45
  215. package/templates/qoder/templates/prd-full-template.md +7 -0
  216. package/templates/root/AGENTS.md +275 -237
  217. package/templates/root/requirements.txt +3 -0
  218. package/templates/root//344/275/277/347/224/250/350/257/264/346/230/216.md +3 -3
  219. package/templates/root//346/226/260/346/211/213/346/214/207/345/215/227.md +2 -2
  220. package/templates/qoder/hooks/inject-workflow-state.py +0 -169
  221. package/templates/qoder/scripts/__pycache__/check_mcp_launch.cpython-39.pyc +0 -0
  222. package/templates/qoder/scripts/__pycache__/install_qoderwork.cpython-39.pyc +0 -0
  223. package/templates/qoder/scripts/__pycache__/mcp_launcher.cpython-39.pyc +0 -0
  224. package/templates/qoder/scripts/__pycache__/platform_doctor.cpython-39.pyc +0 -0
  225. package/templates/qoder/scripts/check_carriers.py +0 -238
  226. package/templates/qoder/scripts/check_mcp.py +0 -298
  227. package/templates/qoder/scripts/check_mcp_launch.py +0 -183
  228. package/templates/qoder/scripts/check_qoderwork_consistency.py +0 -166
  229. package/templates/qoder/scripts/collect_prds.py +0 -31
  230. package/templates/qoder/scripts/common/mentions.py +0 -134
  231. package/templates/qoder/scripts/common/utf8.py +0 -38
  232. package/templates/qoder/scripts/extract_api_params.py +0 -246
  233. package/templates/qoder/scripts/extract_routes.py +0 -54
  234. package/templates/qoder/scripts/extract_routes_tree.py +0 -78
  235. package/templates/qoder/scripts/handoff.py +0 -22
  236. package/templates/qoder/scripts/init_developer.py +0 -76
  237. package/templates/qoder/scripts/kg_mcp_server.py +0 -801
  238. package/templates/qoder/scripts/kg_semantic.py +0 -150
  239. package/templates/qoder/scripts/mcp_launcher.py +0 -414
  240. package/templates/qoder/scripts/mysql_mcp_server.py +0 -396
  241. package/templates/qoder/scripts/parse_prds.py +0 -33
  242. package/templates/qoder/scripts/role.py +0 -51
  243. package/templates/qoder/scripts/sync_carriers.py +0 -259
  244. package/templates/qoder/scripts/task.py +0 -1261
  245. package/templates/qoder/scripts/workspace_init.py +0 -102
  246. package/templates/qoder/scripts/zentao_mcp_server.py +0 -424
  247. package/templates/qoder/skills/prompt-enrich/SKILL.md +0 -90
  248. /package/templates/qoder/scripts/{common → deployment}/__init__.py +0 -0
  249. /package/templates/qoder/{skills/prototype-generator/SKILL.md.zcode-79180-2af4721f-f9a6-412c-88db-c0af680d211b.tmp → scripts/domain/__init__.py} +0 -0
  250. /package/templates/qoder/scripts/{common → domain/kg/graph}/graph_traverse.py +0 -0
  251. /package/templates/qoder/scripts/{common → domain/kg/server}/repowiki.py +0 -0
  252. /package/templates/qoder/scripts/{common → foundation/io}/atomicio.py +0 -0
  253. /package/templates/qoder/scripts/{secure-ls.js → validation/test/secure-ls.js} +0 -0
@@ -16,7 +16,7 @@ User input: $ARGUMENTS
16
16
  ```bash
17
17
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
18
18
  ```
19
- > 后续脚本统一用 `python "$R/.qoder/scripts/xxx.py"`;所有仓库内相对路径(workspace/、data/code/)都前置 `"$R/"`。
19
+ > 后续脚本统一用 `python "$R/.qoder/scripts/orchestration/wlkj.py" <命令>`;所有仓库内相对路径(workspace/、data/code/)都前置 `"$R/"`。
20
20
 
21
21
  ## CRITICAL: Data Isolation
22
22
 
@@ -35,52 +35,33 @@ If no developer is set, refuse and say "Run /wl-init first".
35
35
 
36
36
  ## Data Sources (All Filtered by Current Developer)
37
37
 
38
- ### 1. Who am I?
39
- ```
40
- Read .qoder/.developer -> get developer name (e.g., "小王")
41
- This name is used to filter ALL data below.
42
- ```
38
+ ### Fast Path:一次拿全(必须先跑,禁止逐个 cat/ls/git log)
43
39
 
44
- ### 2. My Tasks (workspace/tasks/)
45
40
  ```bash
46
- # Find tasks where creator OR assignee = current developer
47
- python "$R/.qoder/scripts/task.py" list --mine
41
+ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
42
+ python "$R/.qoder/scripts/orchestration/wlkj.py" report-snapshot "$R" # 日报(今天)
43
+ python "$R/.qoder/scripts/orchestration/wlkj.py" report-snapshot "$R" --days 7 # 周报(近7天)
48
44
  ```
49
- Only show tasks where task.json has:
50
- - `creator` == current developer, OR
51
- - `assignee` == current developer
52
45
 
53
- ### 3. My Session History
54
- ```
55
- Read: workspace/members/{current_developer}/journal/
56
- Only files in THIS developer's journal directory.
57
- ```
46
+ 一个命令返回 JSON,**5 个数据源已全部按当前开发者过滤**:
47
+ - `developer` — 当前开发者名(过滤键)
48
+ - `my_tasks` — task.py list --mine 的结果
49
+ - `commits` {项目: [提交]} 自动扫 data/code/ 各项目按 author 过滤
50
+ - `journal` — 该开发者 journal 的学习/反馈事件
51
+ - `my_prds` — 该开发者写的 PRD/草稿
52
+ - `date_range` — 报告日期范围
58
53
 
59
- ### 4. My Git Commits
60
- ```bash
61
- # For each project in data/code/:
62
- cd "$R/data/code/{project}"
63
- git log --author="{current_developer}" --since="{date}" --oneline
64
- ```
65
- Filter by git author matching current developer name.
66
-
67
- ### 5. My PRDs
68
- ```
69
- Read: workspace/members/{current_developer}/drafts/ -> drafts by this developer
70
- Read: workspace/specs/prd/*.md -> check if PRD frontmatter has author == current developer
71
- ```
54
+ > 性能:旧方式 7 步顺序采集、5-7 次调用;聚合后 1 轮 1 次调用(实测更快)。
55
+ > `developer` 为 "(未设置)" → 停下,提示先 `/wl-init`。缺失字段为 null = 该源无内容,如实写"无产出"。
72
56
 
73
57
  ---
74
58
 
75
59
  ## Daily Report Flow
76
60
 
77
- 1. Read `.qoder/.developer` -> get developer name and role
78
- 2. Calculate today's date range
79
- 3. Filter tasks by creator/assignee == developer
80
- 4. Filter git log by --author == developer
81
- 5. Read developer's journal entries from today
82
- 6. Check developer's drafts for new PRDs
83
- 7. Generate report with ONLY this developer's data
61
+ 1. **跑聚合脚本一次拿全数据**(见上 Fast Path,已含 developer/tasks/commits/journal/prds)
62
+ 2. **用拿到的数据生成报告**(只写当前开发者的数据,见下方模板)
63
+
64
+ > 禁止再逐个 cat .developer / ls / git log —— 聚合脚本已全给。数据源无内容就如实写"无产出"。
84
65
 
85
66
  Output:
86
67
  ```
@@ -102,7 +83,7 @@ Output:
102
83
  ```
103
84
 
104
85
  Save to: workspace/members/{developer}/journal/daily-{date}.md
105
- Then auto-sync (user never touches git): `python "$R/.qoder/scripts/team_sync.py" push`
86
+ Then auto-sync (user never touches git): `cap.mcp.call("sync", {"direction": "push"})`
106
87
 
107
88
  ---
108
89
 
@@ -151,7 +132,7 @@ Output:
151
132
  ```
152
133
 
153
134
  Save to: workspace/members/{developer}/journal/weekly-{week}.md
154
- Then auto-sync (user never touches git): `python "$R/.qoder/scripts/team_sync.py" push`
135
+ Then auto-sync (user never touches git): `cap.mcp.call("sync", {"direction": "push"})`
155
136
 
156
137
  ---
157
138
 
@@ -16,7 +16,7 @@ User input: $ARGUMENTS (default: show current status)
16
16
  ```bash
17
17
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
18
18
  ```
19
- > 后续脚本统一用 `python "$R/.qoder/scripts/xxx.py"`;仓库内相对路径都前置 `"$R/"`。
19
+ > 后续脚本统一用 `python "$R/.qoder/scripts/orchestration/wlkj.py" <命令>`;仓库内相对路径都前置 `"$R/"`。
20
20
 
21
21
  ## Scopes
22
22
  - (no arg or "current") -> Current sprint status
@@ -30,7 +30,7 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
30
30
 
31
31
  **PREFERRED: MCP 工具:**
32
32
  ```
33
- mcp__qoder-knowledge-graph__feature_overview(feature='资产管理')
33
+ cap.mcp.call("feature_overview", {"feature": "资产管理"})
34
34
  ```
35
35
 
36
36
  返回:该功能的完整画像——后端端点 + 前端按钮 + 测试用例 + 关联页面 + PRD。
@@ -66,10 +66,10 @@ Show:
66
66
  ## Health Score
67
67
  Calculate from:
68
68
  | Dimension | Weight | Source |
69
- | EVA quality trend | 25% | tail .qoder/learning/eval-history.jsonl (avg score_pct, target >=80) |
69
+ | EVA quality trend | 25% | tail data/learning/eval-history.jsonl (avg score_pct, target >=80) |
70
70
  | Index freshness | 20% | data/index/.index-meta.json last_sync (<=7 days) + verify checks |
71
71
  | On-time delivery | 20% | task completion dates |
72
- | Sync health | 15% | python "$R/.qoder/scripts/team_sync.py" status (ahead/behind/dirty) |
72
+ | Sync health | 15% | python "$R/.qoder/scripts/orchestration/wlkj.py" sync status (ahead/behind/dirty) |
73
73
  | Pipeline flow | 10% | PRD->Spec->Code conversion |
74
74
  | Learning growth | 10% | learning/patterns/ entries |
75
75
 
@@ -16,7 +16,7 @@ User input: $ARGUMENTS
16
16
  ```bash
17
17
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
18
18
  ```
19
- > 后续脚本统一用 `python "$R/.qoder/scripts/xxx.py"`。
19
+ > 后续脚本统一用 `python "$R/.qoder/scripts/orchestration/wlkj.py" <命令>`。
20
20
 
21
21
  ## Step 1: Load Spec
22
22
 
@@ -26,7 +26,7 @@ Read the spec file to understand requirements.
26
26
 
27
27
  ## Step 2: Search Related Code
28
28
 
29
- Run: python "$R/.qoder/scripts/search_index.py" <keyword>
29
+ Run: python "$R/.qoder/scripts/orchestration/wlkj.py" search <keyword>
30
30
  Find existing code that this implementation relates to.
31
31
  Read relevant files for context.
32
32
 
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: wl-design
3
- description: "设计工序: 预览(蓝湖稿→HTML) / 扫描(看系统现状) / 评审(检查合规)。设计师在蓝湖画完,一条链接出预览。"
3
+ description: "设计工序入口: import 录入设计稿→spec.json(默认) / generate 按设计spec出原型 / review 评审原型。"
4
4
  argument-hint: "[预览|扫描|评审] <蓝湖链接或功能名>"
5
5
  auto-approve: true
6
- allowed-tools: [Read, Glob, Grep, Bash, Write, Edit, mcp__qoder-knowledge-graph, mcp__lanhu, mcp__qoder-mysql]
6
+ allowed-tools: [Read, Glob, Grep, Bash, Write, Edit]
7
7
  ---
8
8
 
9
9
  # /wl-design - 设计工序站
@@ -32,14 +32,14 @@ User input: $ARGUMENTS
32
32
 
33
33
  **Step 1:列设计稿**
34
34
  ```
35
- mcp__lanhu__lanhu_get_designs(url="<蓝湖链接>")
35
+ cap.mcp.call("lanhu_get_designs", {"url": "<蓝湖链接>"})
36
36
  ```
37
37
  - 蓝湖链接含 `pid`(项目 ID),如 `https://lanhuapp.com/web/#/item/project/stage?tid=xxx&pid=xxx`
38
38
  - 返回设计稿列表(名称 + 序号)
39
39
 
40
40
  **Step 2:分析出 HTML**
41
41
  ```
42
- mcp__lanhu__lanhu_get_ai_analyze_design_result(url="<蓝湖链接>", design_names="<名称或序号或all>")
42
+ cap.mcp.call("lanhu_get_ai_analyze_design_result", {"url": "<蓝湖链接>", "design_names": "<名称或序号或all>"})
43
43
  ```
44
44
  - 返回 **HTML+CSS 代码**(工具原文:"GET VISUAL CONTENT + HTML CODE")
45
45
  - AI 把返回的 HTML 存成文件:`workspace/members/{developer}/drafts/prototype-{feature}.html`
@@ -64,7 +64,7 @@ mcp__lanhu__lanhu_get_ai_analyze_design_result(url="<蓝湖链接>", design_name
64
64
 
65
65
  ### 流程(1 次调用取全)
66
66
  ```
67
- mcp__qoder-knowledge-graph__context_pack(keyword='<功能名>', platform='web')
67
+ cap.mcp.call("context_pack", {"keyword": "<功能名>", "platform": "web"})
68
68
  ```
69
69
  返回 8 段:相关代码 + 同类页面 + 字段 + API + 风格 token + 组件 + 数据库表结构。
70
70
 
@@ -121,5 +121,5 @@ mcp__qoder-knowledge-graph__context_pack(keyword='<功能名>', platform='web')
121
121
 
122
122
  评审输出后,记录到 learning:
123
123
  ```bash
124
- python "$R/.qoder/scripts/learn.py" record review_done "{\"target\":\"$feature\",\"result\":\"$pass_or_issues\"}"
124
+ python "$R/.qoder/scripts/orchestration/wlkj.py" learn record review_done "{\"target\":\"$feature\",\"result\":\"$pass_or_issues\"}"
125
125
  ```
@@ -19,7 +19,7 @@ Usage:
19
19
  ```bash
20
20
  R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
21
21
  ```
22
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。后续脚本统一用 `python "$R/.qoder/scripts/xxx.py"`。
22
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。后续脚本统一用 `python "$R/.qoder/scripts/orchestration/wlkj.py" <命令>`。
23
23
 
24
24
  ## Engine: init_doctor.py (幂等, 增量, 永不重头再来)
25
25
 
@@ -28,7 +28,7 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
28
28
 
29
29
  ### Case 1: /wl-init (no arguments)
30
30
  ```bash
31
- python "$R/.qoder/scripts/init_doctor.py"
31
+ python "$R/.qoder/scripts/orchestration/wlkj.py" doctor
32
32
  ```
33
33
  Report the doctor's findings to the user in friendly language.
34
34
  If it found fixable issues, ask: "发现 N 个问题,要我自动修复吗?"
@@ -36,7 +36,7 @@ then run with --fix.
36
36
 
37
37
  ### Case 2/3: /wl-init 小王 [pm]
38
38
  ```bash
39
- python "$R/.qoder/scripts/init_doctor.py" --fix 小王 [pm]
39
+ python "$R/.qoder/scripts/orchestration/wlkj.py" doctor --fix 小王 [pm]
40
40
  ```
41
41
  This single command does ALL of:
42
42
  1. 注册/切换开发者 (.qoder/.developer, key=value 格式) + 个人空间目录
@@ -3,7 +3,7 @@ name: wl-prd
3
3
  description: "需求: 完整(13章,新功能) / 快速(6章,小改动) / 评审(检查质量)。默认根据描述自动判断。"
4
4
  argument-hint: "[完整|快速|评审] [需求描述] 可选: 参考:<insight报告路径>"
5
5
  auto-approve: true
6
- allowed-tools: [Read, Glob, Grep, Bash, Write, Edit, mcp__qoder-knowledge-graph, mcp__qoder-mysql]
6
+ allowed-tools: [Read, Glob, Grep, Bash, Write, Edit]
7
7
  ---
8
8
 
9
9
  # /wl-prd - 需求工序站
@@ -34,32 +34,45 @@ User input: $ARGUMENTS
34
34
  **新模块/新业务/新流程用这个。** 支持衔接 insight:`参考:<报告路径>`
35
35
 
36
36
  **铁律:平台必问。** 先问:
37
- ```
37
+ ``
38
38
  这个需求是针对哪个平台?
39
39
  1. Web 管理端 (fywl-ui)
40
40
  2. APP 移动端 (Carmg-H5)
41
41
  3. 两端都要
42
42
  请选择 (1/2/3):
43
- ```
43
+ ``
44
44
 
45
45
  ### 取上下文(1 次调用取全 8 段)
46
- ```bash
47
- python "$R/.qoder/scripts/context_pack.py" <业务词> --platform <web|app>
48
- ```
46
+ ``bash
47
+ python "$R/.qoder/scripts/orchestration/wlkj.py" context <业务词> --platform <web|app>
48
+ ``
49
49
  - 第 4 段 = 历史 PRD(防重复)
50
50
  - 第 5 段 = 相关 API
51
51
  - 第 8 段 = 数据库表结构+真实字段
52
- - 涉及枚举字段时额外调 `mcp__qoder-mysql__query_distinct`
52
+ - 涉及枚举字段时额外调 `cap.mcp.call("query_distinct`
53
53
 
54
54
  ### 产出
55
55
  - PRD: `workspace/members/{dev}/drafts/REQ-{YYYY}-{NNN}-{标题}.md`(13 章)
56
- - 原型: `workspace/members/{dev}/drafts/prototype-{feature}.html`
57
- - 第一行必须带 `@contract` 头(platform/req-id/mode/acceptance)
56
+ - 原型(**可选**,见下「原型要不要画」): `workspace/members/{dev}/drafts/prototype-{feature}.html`
57
+ - 第一行必须带 `@contract` 头(platform/req-id/mode/acceptance/prototype
58
+
59
+ ### 原型要不要画?(融入批量确认)
60
+
61
+ **默认建议**(用户可一键改,详见 `.qoder/skills/wl-prd-full/SKILL.md` STEP 0.5):
62
+ - 纯规则/接口/定时/参数/计算类 → **不画**(如"出交车点检固定为总部全局规则")
63
+ - 含页面/菜单/表单/弹窗/详情/向导/看板/大屏 → **画**
64
+ - 加字段/按钮/文案/导出 → **不画**
65
+ - 混合(页面+规则)→ 只画页面那部分
66
+
67
+ **两端都画时**:默认只画主端一份,用户明确要求才画 2 份。
68
+
69
+ **不画时**:PRD 第 11 章写 `无({原因},经用户确认豁免)` + `@contract` 头标 `prototype: none`;
70
+ eval 自动跳过 A2(满分从 100 降到 70,照样 PASS);`/wl-design` `/wl-code` 据此跳过原型环节。
58
71
 
59
72
  ### 质量门禁
60
- ```bash
61
- python "$R/.qoder/scripts/eval_prd.py" <prd.md> [原型.html]
62
- ```
73
+ ``bash
74
+ python "$R/.qoder/scripts/orchestration/wlkj.py" eval <prd.md> [原型.html]
75
+ ``
63
76
  ≥ 80% 才 PASS。完整模板见 `.qoder/templates/prd-full-template.md`。
64
77
 
65
78
  ---
@@ -89,7 +102,7 @@ python "$R/.qoder/scripts/eval_prd.py" <prd.md> [原型.html]
89
102
  - 影响范围是否评估
90
103
  - 非功能性需求是否覆盖
91
104
  - ...
92
- 3. 跑 EVA 评分:`eval_prd.py <prd.md>`
105
+ 3. 跑 EVA 评分:`python "$R/.qoder/scripts/orchestration/wlkj.py" eval <prd.md>`(wlkj.py eval 内部映射 validation/metrics/eval_prd.py)
93
106
  4. 输出:总分 + 7 项 ✓/✗ + 改进建议
94
107
 
95
108
  ---
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: "需求管理: 看需求/看产出/发布"
3
+ argument-hint: "[REQ-ID] [发布]"
4
+ ---
5
+
6
+ # /wl-req 需求生命周期管理
7
+
8
+ > 一个需求的所有产出(PRD/原型/任务/规格)聚合在 REQ-ID 容器, 一条命令看全貌。
9
+
10
+ ## 用法 (只需记 2 个姿势)
11
+
12
+ | 输入 | 做什么 |
13
+ |------|--------|
14
+ | `/wl-req` | 列出所有需求 (跨草稿/产出/历史桶) |
15
+ | `/wl-req REQ-2026-001` | 显示该需求的全部产出 |
16
+ | `/wl-req REQ-2026-001 发布` | 草稿→产出→发禅道 (一步到位) |
17
+
18
+ ## 实现层
19
+
20
+ ```bash
21
+ # 列需求
22
+ python "$R/.qoder/scripts/orchestration/wlkj.py" req
23
+
24
+ # 看某需求全貌
25
+ python "$R/.qoder/scripts/orchestration/wlkj.py" req REQ-2026-001
26
+
27
+ # 发布 (promote + publish)
28
+ python "$R/.qoder/scripts/orchestration/wlkj.py" req REQ-2026-001 发布
29
+ ```
30
+
31
+ ## 结构
32
+
33
+ ```
34
+ workspace/members/{dev}/
35
+ ├── drafts/2026/06/W26/REQ-2026-001/ ← 草稿(私有)
36
+ │ ├── prd.md
37
+ │ ├── prototype.html
38
+ │ └── tasks/
39
+ ├── outputs/2026/06/W26/REQ-2026-001/ ← 产出(团队可见, 发布后)
40
+ │ └── exports/ (docx/pdf)
41
+ ```
42
+
43
+ 时间桶(YYYY/MM/Ww)内建: 本周=活动区, 历史=过去的桶, 无独立 archive。
@@ -3,45 +3,51 @@ name: wl-search
3
3
  description: "查代码/业务/API/字段/PRD + 知识图谱(影响分析/覆盖矩阵/功能画像/业务流程/多跳遍历)的唯一入口。"
4
4
  argument-hint: "[keyword] or --api [path] or subcommand. 全系13个能力见下表"
5
5
  auto-approve: true
6
- allowed-tools: [Read, Bash, mcp__qoder-knowledge-graph]
6
+ allowed-tools: [Read, Bash]
7
7
  ---
8
8
 
9
9
  # /wl-search - 搜索代码 & 知识图谱
10
10
 
11
11
  User input: $ARGUMENTS
12
12
 
13
- ## 🔧 环境自检(QoderWork 桌面端 vs Qoder IDE/CLI)
13
+ ## 执行方式(宿主无关,自动路由)
14
14
 
15
- **先确定仓库根 R**(QoderWork 桌面端工作目录不是仓库根,相对路径会失效):
16
- ```bash
17
- R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
15
+ ```python
16
+ from capability import resolve
17
+ cap = resolve()
18
+ result = cap.mcp.call("search_code", {"keyword": "保险", "platform": "web"})
18
19
  ```
19
- > 后续脚本统一用 `python "$R/.qoder/scripts/xxx.py"`。
20
-
21
- ## 双轨:MCP 优先(仅 QoderWork)/ kg.py 兜底(全系列通用)
22
-
23
- **QoderWork 环境**(有 `mcp__qoder-knowledge-graph`):直接调 MCP 工具,更快。
24
- **其他 Qoder 载体**(IDE/Quest/CLI):跑 `python "$R/.qoder/scripts/kg.py"`,功能等价。
25
-
26
- 不确定在哪个环境?先试 MCP;MCP 工具不存在就用 kg.py。
27
20
 
28
- ## 13 个能力对照表
29
-
30
- | 用户要查什么 | MCP 工具(QoderWork) | kg.py 命令(全系列) |
31
- |-------------|---------------------|---------------------|
32
- | 代码在哪 / 搜关键词 | `search_code(keyword='考勤', platform='web')` | `kg.py search 考勤 --platform web` |
33
- | API 端点 | `search_api(keyword='salary')` | `kg.py api salary` |
34
- | 已有 PRD(防重复造轮子) | `search_prd(keyword='保险')` | `kg.py prd 保险` |
35
- | 改某接口影响哪些页面 | `get_impact(endpoint='/asset')` | `kg.py impact /asset` |
36
- | 某函数/端点的完整关联 | `context_360(symbol='handleExport')` | `kg.py context360 handleExport` |
37
- | 一次取全(代码+页面+字段+API) | `context_pack(keyword='车辆', role='pm')` | `kg.py context 车辆 --role pm` |
38
- | 哪些功能有/没测试 | `coverage_matrix()` | `kg.py coverage` |
39
- | 功能完整画像 | `feature_overview(feature='资产管理')` | `kg.py feature 资产管理` |
40
- | 业务流程链(几步) | `get_workflow(module='assets')` | `kg.py workflow assets` |
41
- | 多跳遍历(关联实体) | `multi_hop(symbol='资产管理', max_depth=3)` | `kg.py hop 资产管理 --depth 3` |
42
- | Repo Wiki 模块文档 | `search_wiki(keyword='考勤')` | `kg.py wiki 考勤` |
43
- | 原型预填(真实数据) | `fill_prototype(keyword='车辆', platform='web')` | `kg.py fill-prototype 车辆 --platform web` |
44
- | 设计系统规范 | `get_design_system(platform='web')` | `kg.py design-system --platform web` |
21
+ 自动路由:有 MCP 走 MCP(快),无 MCP 走 wlkj.py(CLI 降级)。零宿主感知。
22
+
23
+ ## 第一步:先判断问题类型,别一上来就 search
24
+
25
+ | 问题类型 | 首选(一次到位) | 别这样 |
26
+ |---------|-----------------|----------|
27
+ | **"XX怎么实现的/怎么做的"** | `cap.mcp.call("context_pack", {"keyword": "XX", "role": "dev"})` | 不要一个个 search(会搜 5-7 次,慢费 token) |
28
+ | **"XX代码在哪"** | `cap.mcp.call("search_code", {"keyword": "XX"})` | 不要 context(杀鸡用牛刀) |
29
+ | **"改 XX 影响谁"** | `cap.mcp.call("get_impact", {"endpoint": "/XX"})` | — |
30
+
31
+ > 理解一个功能怎么做的问题,`context_pack` 一条命令拿全代码+API+字段,绝大多数情况只需 Read 2-3 个文件就够,
32
+ > 不用反复 search。Glob 找不到文件时用 search_code 兜底,**不准跑 find/findstr/dir /s**。
33
+
34
+ ## 13 个能力(统一 cap.mcp.call 调用)
35
+
36
+ | 用户要查什么 | 调用方式 |
37
+ |-------------|---------|
38
+ | 代码在哪 / 搜关键词 | `cap.mcp.call("search_code", {"keyword": "考勤", "platform": "web"})` |
39
+ | API 端点 | `cap.mcp.call("search_api", {"keyword": "salary"})` |
40
+ | 已有 PRD(防重复造轮子) | `cap.mcp.call("search_prd", {"keyword": "保险"})` |
41
+ | 改某接口影响哪些页面 | `cap.mcp.call("get_impact", {"endpoint": "/asset"})` |
42
+ | 某函数/端点的完整关联 | `cap.mcp.call("context_360", {"symbol": "handleExport"})` |
43
+ | 一次取全(代码+页面+字段+API) | `cap.mcp.call("context_pack", {"keyword": "车辆", "role": "pm"})` |
44
+ | 哪些功能有/没测试 | `cap.mcp.call("coverage_matrix", {})` |
45
+ | 功能完整画像 | `cap.mcp.call("feature_overview", {"feature": "资产管理"})` |
46
+ | 业务流程链(几步) | `cap.mcp.call("get_workflow", {"module": "assets"})` |
47
+ | 多跳遍历(关联实体) | `cap.mcp.call("multi_hop", {"symbol": "资产管理", "depth": 3})` |
48
+ | Repo Wiki 模块文档 | `cap.mcp.call("search_wiki", {"keyword": "考勤"})` |
49
+ | 原型预填(真实数据) | `cap.mcp.call("fill_prototype", {"keyword": "车辆", "platform": "web"})` |
50
+ | 设计系统规范 | `cap.mcp.call("get_design_system", {"platform": "web"})` |
45
51
 
46
52
  ## 快速判断该用哪个
47
53
 
@@ -50,27 +56,52 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
50
56
  - **"哪些功能缺测试"** → `coverage`
51
57
  - **"盘点流程有几步"** → `workflow`
52
58
  - **"XX 谁调用了/调用链"** → `context360` 或 `hop`
53
- - **写 PRD 前一次取全** → `context --role pm`
54
- - **出原型前** → `design-system` + `fill-prototype`
59
+ - **写 PRD 前一次取全** → `context_pack --role pm`
60
+ - **出原型前** → `design_system` + `fill_prototype`
55
61
 
56
- ## 字段/页面风格/组件(仍用 search_index.py)
62
+ ## 字段/页面风格/组件
57
63
 
58
- 这些 kg.py 未单独封装,直接跑:
64
+ 这些不是 MCP 工具,走 CLI 降级:
59
65
 
60
66
  ```
61
- python "$R/.qoder/scripts/search_index.py" --field <字段名>
62
- python "$R/.qoder/scripts/search_index.py" --style <table|form|detail|modal|dashboard> [--platform web|app]
63
- python "$R/.qoder/scripts/search_index.py" --list # Top50 关键词
64
- python "$R/.qoder/scripts/search_index.py" --modules # 项目模块概览
65
- python "$R/.qoder/scripts/search_index.py" --components # 组件使用统计
67
+ cap.mcp.call("search_code", {"keyword": "--field <字段名>"}) # 字段搜索
68
+ cap.mcp.call("search_code", {"keyword": "--style table"}) # 风格搜索
69
+ cap.mcp.call("search_code", {"keyword": "--list"}) # Top50 关键词
70
+ cap.mcp.call("search_code", {"keyword": "--modules"}) # 项目模块概览
71
+ cap.mcp.call("search_code", {"keyword": "--components"}) # 组件使用统计
66
72
  ```
67
73
 
74
+ ## 数据库查询(真实库表结构/数据/枚举)— ⚠️ 强制先问环境
75
+
76
+ 当用户意图涉及**数据库 / 表结构 / 字段 / 枚举取值 / 真实数据**,走 `cap.mcp.call("list_envs")` 等,**不走知识图谱**。
77
+
78
+ 可用工具(全部带可选 `env` 参数):
79
+ - `cap.mcp.call("list_envs", {})` — 列出所有可用环境(**第一步必须先调这个**)
80
+ - `cap.mcp.call("query_schema", {"table": "t_xxx", "env": "test"})` — 表结构
81
+ - `cap.mcp.call("query_data", {"table": "t_xxx", "env": "test"})` — 数据
82
+ - `cap.mcp.call("query_distinct", {"table": "t_xxx", "column": "status", "env": "test"})` — 枚举值
83
+
84
+ ### 🔒 安全红线:查库前必须先问环境(不可跳过)
85
+
86
+ **标准流程:**
87
+ 1. **先调 `cap.mcp.call("list_envs", {})`** 拿到所有环境标签,列给用户选
88
+ 2. **用户明确选定后**,后续工具调用都带上 `env=<用户选的标签>`
89
+ 3. 生产环境 🔴 真实数据,仅供核对字段含义/格式,**禁止作为业务结论外传**
90
+
68
91
  ## 没给参数时
69
92
 
70
- 如果用户没给关键词/子命令,先问意图,或跑 `python "$R/.qoder/scripts/search_index.py" --list` 列出热门关键词让用户选。
93
+ 如果用户没给关键词/子命令,先问意图,或跑 `cap.mcp.call("search_code", {"keyword": "--list"})` 列出热门关键词让用户选。
71
94
 
72
95
  ## DO NOT grep the entire codebase
73
96
 
97
+ 🚫 **绝对禁止**用 `findstr /s`、`grep -r`、`os.walk`、`subprocess` 全盘递归扫 data/code。
98
+
99
+ **中文文案/报错溯源**(用户查的是中文短语),**唯一合法方式**:
100
+ ```bash
101
+ # grep-text 走 CLI 降级(不是 MCP 工具)
102
+ python "$R/.qoder/scripts/orchestration/wlkj.py" kg grep-text 车辆不存在 --ext java --limit 20
103
+ ```
104
+
74
105
  ## How to Use Results
75
106
 
76
107
  1. Pick the most relevant files (2-3 max)
@@ -79,10 +110,10 @@ python "$R/.qoder/scripts/search_index.py" --components # 组件使用统计
79
110
 
80
111
  ## Examples
81
112
 
82
- - `/wl-search 考勤` -> `kg.py search 考勤`
83
- - `/wl-search --api salary` -> `kg.py api salary`
84
- - `/wl-search 改 /asset 影响谁` -> `kg.py impact /asset`
85
- - `/wl-search 哪些功能没测试` -> `kg.py coverage`
86
- - `/wl-search 资产管理功能画像` -> `kg.py feature 资产管理`
87
- - `/wl-search 资产盘点流程` -> `kg.py workflow assets`
88
- - `/wl-search --modules` -> `search_index.py --modules`
113
+ - `/wl-search 考勤` `cap.mcp.call("search_code", {"keyword": "考勤"})`
114
+ - `/wl-search --api salary` `cap.mcp.call("search_api", {"keyword": "salary"})`
115
+ - `/wl-search 改 /asset 影响谁` `cap.mcp.call("get_impact", {"endpoint": "/asset"})`
116
+ - `/wl-search 哪些功能没测试` `cap.mcp.call("coverage_matrix", {})`
117
+ - `/wl-search t_quality_case 表结构` → 先 `list_envs()` 问环境 → `query_schema`
118
+ - `/wl-search 资产管理功能画像` `cap.mcp.call("feature_overview", {"feature": "资产管理"})`
119
+ - `/wl-search 车辆不存在报错从哪来` `wlkj.py kg grep-text 车辆不存在 --ext java`