@hupan56/wlkj 2.7.11 → 3.0.0

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 (152) hide show
  1. package/bin/cli.js +375 -78
  2. package/package.json +29 -29
  3. package/templates/.qoder/.runtime/ctx-cache-5660152f1d6dd819.md +23 -0
  4. package/templates/.qoder/.runtime/ctx-cache-afdce0dac06b25b0.md +23 -0
  5. package/templates/.qoder/.runtime/search-cache-eae7644e7b122f35.txt +1 -0
  6. package/templates/.qoder/learning/eval-history.jsonl +28 -0
  7. package/templates/data/index/wiki-index.json +8 -0
  8. package/templates/qoder/agents/insight-planning.md +1 -1
  9. package/templates/qoder/agents/insight-research.md +28 -15
  10. package/templates/qoder/commands/optional/wl-insight.md +159 -161
  11. package/templates/qoder/commands/optional/wl-report.md +4 -4
  12. package/templates/qoder/commands/optional/wl-status.md +2 -2
  13. package/templates/qoder/commands/wl-code.md +2 -2
  14. package/templates/qoder/commands/wl-design.md +2 -2
  15. package/templates/qoder/commands/wl-init.md +3 -3
  16. package/templates/qoder/commands/wl-prd.md +2 -2
  17. package/templates/qoder/commands/wl-req.md +43 -0
  18. package/templates/qoder/commands/wl-search.md +8 -8
  19. package/templates/qoder/commands/wl-task.md +17 -17
  20. package/templates/qoder/commands/wl-test.md +41 -15
  21. package/templates/qoder/config.yaml +17 -1
  22. package/templates/qoder/hooks/session-start.py +12 -22
  23. package/templates/qoder/nul +4 -0
  24. package/templates/qoder/rules/wl-pipeline.md +22 -48
  25. package/templates/qoder/scripts/README.md +139 -0
  26. package/templates/qoder/scripts/common/autotest_auth.py +109 -0
  27. package/templates/qoder/scripts/common/bootstrap.py +145 -0
  28. package/templates/qoder/scripts/common/check_publish.py +98 -0
  29. package/templates/qoder/scripts/common/cmd_registry.py +112 -0
  30. package/templates/qoder/scripts/common/config.py +187 -0
  31. package/templates/qoder/scripts/common/contract.py +317 -0
  32. package/templates/qoder/scripts/common/developer.py +2 -1
  33. package/templates/qoder/scripts/common/feishu.py +10 -9
  34. package/templates/qoder/scripts/common/guard.py +159 -0
  35. package/templates/qoder/scripts/common/identity.py +121 -2
  36. package/templates/qoder/scripts/common/kg_capabilities.py +182 -0
  37. package/templates/qoder/scripts/common/mcp_base.py +268 -0
  38. package/templates/qoder/scripts/common/paths.py +187 -1
  39. package/templates/qoder/scripts/common/result.py +223 -0
  40. package/templates/qoder/scripts/common/roles.py +60 -0
  41. package/templates/qoder/scripts/common/task_utils.py +21 -9
  42. package/templates/qoder/scripts/common/test_extract.py +115 -0
  43. package/templates/qoder/scripts/kg/__init__.py +11 -0
  44. package/templates/qoder/scripts/kg/build_entity_registry.py +196 -0
  45. package/templates/qoder/scripts/kg/build_relations.py +127 -0
  46. package/templates/qoder/scripts/{build_style_index.py → kg/build_style_index.py} +39 -10
  47. package/templates/qoder/scripts/kg/build_workflows.py +144 -0
  48. package/templates/qoder/scripts/{context_pack.py → kg/context_pack.py} +18 -11
  49. package/templates/qoder/scripts/{enrich_prompt.py → kg/enrich_prompt.py} +232 -226
  50. package/templates/qoder/scripts/{extract_api_params.py → kg/extract.py} +398 -246
  51. package/templates/qoder/scripts/{kg.py → kg/kg.py} +638 -708
  52. package/templates/qoder/scripts/{kg_build.py → kg/kg_build.py} +618 -612
  53. package/templates/qoder/scripts/{kg_build_db.py → kg/kg_build_db.py} +333 -327
  54. package/templates/qoder/scripts/{kg_duckdb.py → kg/kg_duckdb.py} +38 -37
  55. package/templates/qoder/scripts/{kg_incremental.py → kg/kg_incremental.py} +420 -393
  56. package/templates/qoder/scripts/{kg_link_db.py → kg/kg_link_db.py} +230 -224
  57. package/templates/qoder/scripts/{kg_semantic.py → kg/kg_semantic.py} +156 -150
  58. package/templates/qoder/scripts/kg/prefetch.py +359 -0
  59. package/templates/qoder/scripts/{search_index.py → kg/search_index.py} +70 -14
  60. package/templates/qoder/scripts/mcp/__init__.py +11 -0
  61. package/templates/qoder/scripts/{kg_mcp_server.py → mcp/kg_mcp_server.py} +77 -272
  62. package/templates/qoder/scripts/{lanhu_stdio_wrapper.py → mcp/lanhu_stdio_wrapper.py} +125 -119
  63. package/templates/qoder/scripts/{check_mcp.py → mcp/mcp_doctor.py} +515 -298
  64. package/templates/qoder/scripts/{mcp_launcher.py → mcp/mcp_launcher.py} +442 -414
  65. package/templates/qoder/scripts/{mysql_mcp_server.py → mcp/mysql_mcp_server.py} +347 -396
  66. package/templates/qoder/scripts/{zentao_mcp_server.py → mcp/zentao_mcp_server.py} +384 -424
  67. package/templates/qoder/scripts/report/__init__.py +11 -0
  68. package/templates/qoder/scripts/{add_session.py → report/add_session.py} +250 -244
  69. package/templates/qoder/scripts/{archive_prd.py → report/archive_prd.py} +383 -377
  70. package/templates/qoder/scripts/{eval_prd.py → report/eval_prd.py} +73 -11
  71. package/templates/qoder/scripts/{export.py → report/export.py} +63 -0
  72. package/templates/qoder/scripts/{fill_prototype.py → report/fill_prototype.py} +6 -0
  73. package/templates/qoder/scripts/{gen_design_doc.py → report/gen_design_doc.py} +400 -394
  74. package/templates/qoder/scripts/{learn.py → report/learn.py} +152 -146
  75. package/templates/qoder/scripts/{learn_aggregate.py → report/learn_aggregate.py} +207 -201
  76. package/templates/qoder/scripts/{report.py → report/report.py} +287 -281
  77. package/templates/qoder/scripts/report/req.py +222 -0
  78. package/templates/qoder/scripts/report/role.py +33 -0
  79. package/templates/qoder/scripts/{status.py → report/status.py} +634 -628
  80. package/templates/qoder/scripts/setup/__init__.py +11 -0
  81. package/templates/qoder/scripts/setup/carriers.py +662 -0
  82. package/templates/qoder/scripts/{init_doctor.py → setup/init_doctor.py} +63 -26
  83. package/templates/qoder/scripts/{install_qoderwork.py → setup/install_qoderwork.py} +36 -26
  84. package/templates/qoder/scripts/{platform_doctor.py → setup/platform_doctor.py} +265 -259
  85. package/templates/qoder/scripts/{repo_root.py → setup/repo_root.py} +112 -106
  86. package/templates/qoder/scripts/{setup.py → setup/setup.py} +147 -0
  87. package/templates/qoder/scripts/{setup_lanhu.py → setup/setup_lanhu.py} +973 -963
  88. package/templates/qoder/scripts/task/__init__.py +11 -0
  89. package/templates/qoder/scripts/{git_sync.py → task/git_sync.py} +52 -31
  90. package/templates/qoder/scripts/{syncgate.py → task/syncgate.py} +6 -0
  91. package/templates/qoder/scripts/task/task.py +221 -0
  92. package/templates/qoder/scripts/task/task_lifecycle.py +596 -0
  93. package/templates/qoder/scripts/task/task_query.py +161 -0
  94. package/templates/qoder/scripts/task/task_relations.py +424 -0
  95. package/templates/qoder/scripts/{team_sync.py → task/team_sync.py} +93 -20
  96. package/templates/qoder/scripts/test/__init__.py +11 -0
  97. package/templates/qoder/scripts/{autotest.py → test/autotest.py} +1174 -1751
  98. package/templates/qoder/scripts/{autotest_batch.py → test/autotest_batch.py} +242 -224
  99. package/templates/qoder/scripts/test/autotest_data.py +675 -0
  100. package/templates/qoder/scripts/{autotest_run.py → test/autotest_run.py} +309 -297
  101. package/templates/qoder/scripts/{benchmark.py → test/benchmark.py} +6 -0
  102. package/templates/qoder/scripts/{kg_auto_login.py → test/kg_auto_login.py} +202 -196
  103. package/templates/qoder/scripts/{kg_test_runner.py → test/kg_test_runner.py} +7 -1
  104. package/templates/qoder/scripts/{page_probe.py → test/page_probe.py} +465 -459
  105. package/templates/qoder/scripts/wlkj.py +116 -0
  106. package/templates/qoder/settings.json +1 -10
  107. package/templates/qoder/skills/design-import/SKILL.md +226 -226
  108. package/templates/qoder/skills/design-review/SKILL.md +82 -82
  109. package/templates/qoder/skills/prd-generator/SKILL.md +26 -16
  110. package/templates/qoder/skills/prd-review/SKILL.md +5 -5
  111. package/templates/qoder/skills/prototype-generator/SKILL.md +256 -256
  112. package/templates/qoder/skills/spec-coder/SKILL.md +4 -4
  113. package/templates/qoder/skills/spec-generator/SKILL.md +4 -4
  114. package/templates/qoder/skills/test-generator/SKILL.md +5 -5
  115. package/templates/qoder/skills/wl-code/SKILL.md +4 -4
  116. package/templates/qoder/skills/wl-commit/SKILL.md +4 -4
  117. package/templates/qoder/skills/wl-design/SKILL.md +3 -3
  118. package/templates/qoder/skills/wl-init/SKILL.md +8 -8
  119. package/templates/qoder/skills/wl-insight/SKILL.md +5 -5
  120. package/templates/qoder/skills/wl-prd-full/SKILL.md +6 -6
  121. package/templates/qoder/skills/wl-prd-quick/SKILL.md +6 -6
  122. package/templates/qoder/skills/wl-prd-review/SKILL.md +4 -4
  123. package/templates/qoder/skills/wl-report/SKILL.md +7 -7
  124. package/templates/qoder/skills/wl-search/SKILL.md +13 -13
  125. package/templates/qoder/skills/wl-spec/SKILL.md +5 -5
  126. package/templates/qoder/skills/wl-status/SKILL.md +5 -5
  127. package/templates/qoder/skills/wl-task/SKILL.md +6 -6
  128. package/templates/qoder/skills/wl-test/SKILL.md +102 -39
  129. package/templates/root/AGENTS.md +39 -40
  130. package/templates/qoder/hooks/inject-workflow-state.py +0 -169
  131. package/templates/qoder/scripts/__pycache__/check_mcp_launch.cpython-39.pyc +0 -0
  132. package/templates/qoder/scripts/__pycache__/install_qoderwork.cpython-39.pyc +0 -0
  133. package/templates/qoder/scripts/__pycache__/mcp_launcher.cpython-39.pyc +0 -0
  134. package/templates/qoder/scripts/__pycache__/platform_doctor.cpython-39.pyc +0 -0
  135. package/templates/qoder/scripts/check_carriers.py +0 -238
  136. package/templates/qoder/scripts/check_mcp_launch.py +0 -183
  137. package/templates/qoder/scripts/check_qoderwork_consistency.py +0 -166
  138. package/templates/qoder/scripts/collect_prds.py +0 -31
  139. package/templates/qoder/scripts/common/mentions.py +0 -134
  140. package/templates/qoder/scripts/common/utf8.py +0 -38
  141. package/templates/qoder/scripts/extract_routes.py +0 -54
  142. package/templates/qoder/scripts/extract_routes_tree.py +0 -78
  143. package/templates/qoder/scripts/handoff.py +0 -22
  144. package/templates/qoder/scripts/init_developer.py +0 -76
  145. package/templates/qoder/scripts/parse_prds.py +0 -33
  146. package/templates/qoder/scripts/role.py +0 -51
  147. package/templates/qoder/scripts/sync_carriers.py +0 -259
  148. package/templates/qoder/scripts/task.py +0 -1261
  149. package/templates/qoder/scripts/workspace_init.py +0 -102
  150. package/templates/qoder/skills/prompt-enrich/SKILL.md +0 -90
  151. package/templates/qoder/skills/prototype-generator/SKILL.md.zcode-79180-2af4721f-f9a6-412c-88db-c0af680d211b.tmp +0 -0
  152. /package/templates/qoder/scripts/{secure-ls.js → test/secure-ls.js} +0 -0
@@ -1,256 +1,256 @@
1
- ---
2
- name: prototype-generator
3
- description: "生成匹配项目 UI 风格的交互式 HTML 原型(Web 端 fywl-ui 用 Vben Admin + Ant Design Vue;APP 端 Carmg-H5 用 Vant 3)。Generate interactive HTML prototypes matching project UI style. 用户说'做个原型''画个 mockup''看看效果''出个界面预览'时触发。"
4
- trigger: "user asks for prototype, mockup, UI preview, or when PRD needs visual illustration"
5
- ---
6
-
7
-
8
- ## 🔧 仓库根定位(QoderWork 桌面端 vs Qoder IDE/CLI)
9
-
10
- **后续脚本里的 `$R` 代表仓库根**,先确定它(QoderWork 桌面端工作目录不是仓库根,相对路径会失效):
11
- ```bash
12
- R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
- ```
14
- > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/install_qoderwork.py`。
15
-
16
- # Prototype Generator
17
-
18
- Generate production-ready HTML prototypes that match the project's actual UI style.
19
-
20
- ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
21
-
22
- - `.qoder/.developer` — 决定产出存到 `workspace/members/{dev}/drafts/`
23
- - 若 `.qoder/.current-task` 存在,原型命名带上任务关键词
24
- - 平台(Web/APP/Both)必须明确;如未指定,先问用户(见 prd-generator Step 0)
25
-
26
- ## Step 0: Know the Platform
27
-
28
- The platform MUST already be decided (asked by /wl-prd-full Step 0).
29
- If you don't know it, STOP and ask the user (Web 管理端 / APP 移动端 / 两端都要).
30
-
31
- | Platform | Project | Template | Design Tokens |
32
- |----------|---------|----------|---------------|
33
- | Web | fywl-ui | .qoder/templates/prototype-web.html | data/index/vben-style-reference.json (HSL) |
34
- | APP | Carmg-H5 | .qoder/templates/prototype-app.html | Vant 3 variables (in template) |
35
- | Both | both | both templates | generate 2 files: -web.html and -app.html |
36
-
37
- ## Style Sources (Priority Order)
38
-
39
- 1. **data/code/** - Existing Vue code from the TARGET project (HIGHEST priority)
40
- 2. **data/index/vben-style-reference.json** - Vben design tokens (Web)
41
- / Vant variables baked into prototype-app.html (APP)
42
- 3. **data/index/chart-style-reference.json** - Dashboard/big-screen/chart
43
- idioms (REQUIRED for dashboard/看板/大屏/统计类原型)
44
- 4. **data/style/** - PDF design specs (only if a token is missing above)
45
-
46
- If code conflicts with PDF, CODE WINS. The templates already contain the
47
- correct tokens — do NOT invent colors or copy Ant Design defaults
48
- (#1890ff is NOT this project's primary).
49
-
50
- ## ⚠️ NEW-FEATURE prototypes MUST also anchor to real pages
51
-
52
- For a feature with NO existing page (e.g. brainstorm/new dashboard), the
53
- style must STILL come from the system, never from generic admin templates:
54
-
55
- 1. Find the closest in-system page family:
56
- `search_index.py --style <type> --platform <p>` + read 1-2 real pages
57
- 2. Dashboard/看板/大屏类: read data/index/chart-style-reference.json and
58
- choose the idiom — 大屏深蓝风 (dashboard/monitor 先例: 全国地图/驾驶舱)
59
- or 浅色卡片风 (dashboard/workbench 先例: 工作台统计卡)
60
- 3. Use REAL business vocabulary from the index (e.g. 异常三分类
61
- 人员作业异常/车辆异常/费用异常 comes from workbench/components/abnormal.vue)
62
- 4. In the prototype header comment, cite which real files the style came from
63
- — if you cannot name a source file, you have NOT done step 1.
64
-
65
- ## Step 0.5: Get Design System (MUST DO FIRST)
66
-
67
- **PREFERRED: Call MCP tool (faster, auto-generates if missing):**
68
- ```
69
- mcp__qoder-knowledge-graph__get_design_system(platform='web')
70
- ```
71
-
72
- **FALLBACK: Read file directly:**
73
- Read `data/design/DESIGN.md`. If missing, run `python "$R/.qoder/scripts/gen_design_doc.py"`.
74
-
75
- Returns: layout fingerprint (sidebar 160px, mixed-nav), token set (primary HSL),
76
- page type patterns, form behavior modes, icon rules, component stats.
77
-
78
- > This is the v0.dev Registry equivalent — one call teaches AI the entire design system.
79
-
80
- ## Step 1: Determine Prototype Type
81
-
82
- Read the requirement to decide:
83
- - **Table page**: List with search form + data grid + actions
84
- - **Form page**: Create/edit form with validation
85
- - **Detail page**: Read-only data display
86
- - **Modal/Drawer**: Popup form
87
- - **Dashboard**: Charts + summary cards
88
-
89
- ## Step 1.5: Prefill Draft (MUST DO - 80% auto, 20% you adjust)
90
-
91
- **PREFERRED: Call MCP tool:**
92
- ```
93
- mcp__qoder-knowledge-graph__fill_prototype(keyword='营业外合同', platform='web')
94
- ```
95
-
96
- **FALLBACK: Run script:**
97
- ```bash
98
- python "$R/.qoder/scripts/fill_prototype.py" <关键词> --platform <web|app>
99
- ```
100
-
101
- Returns: 80% complete HTML draft (real columns/fields/layout injected) + data manifest.
102
- Your job: 20% adjustment only (interaction details, layout tweaks).
103
- **DO NOT change tokens/colors/layout params — they come from real code.**
104
- 需要用户提供参考页/设计稿,而不是默默画个默认骨架
105
-
106
- 脚本/MCP 输出的数据清单包含:
107
- 1. **真实表格列/表单字段**(来自 page_examples,非编造)
108
- 2. **layout_fingerprint**(侧边栏宽度 160px、布局模式 mixed-nav,已注入 CSS)
109
- 3. **behaviors**(表单模式 single/wizard/tabs、表格分页方式、弹窗类型)
110
- 4. **🆕 真实按钮文案**(来自 entity-registry,如"添加反馈资产""导出 Excel"——别编"新增/编辑")
111
- 5. **🆕 功能模块**(需求属于哪个模块、该模块有多少现有页面、标杆页面路径)
112
- 6. **预填 HTML 草稿**(80% 完成)
113
-
114
- 你的工作只剩 **20% 微调**:
115
- - 用数据清单里的**真实按钮文案**替换通用文案(详情/编辑 → 系统真实按钮名)
116
- - 补充交互细节(侧边栏折叠、弹窗、Tab 切换)
117
- - 参考功能模块的标杆页面,确保布局跟同模块页面一致
118
-
119
- **⚠️ 铁律**:
120
- - 草稿里的 token(颜色/间距/侧边栏宽度)是**正确的**,**不要改成 #1890ff 或你编的值**
121
- - 数据清单里的字段/按钮来自真实代码,**不要替换成你编的**
122
- - 按钮文案优先用 entity-registry 里的真实文案,没有才用通用文案
123
- - 你只做"调整",不做"重写"——如果草稿已满足需求,甚至可以零修改直接用
124
-
125
- > **为什么这一步必要**:旧流程 AI 从零手写 HTML+CSS,12 个原型里 2 个硬编码了
126
- > 禁止的 #1890ff(Ant Design 默认色,非 Vben),模板形同虚设。
127
- > fill_prototype 从源头消灭这个问题——token 继承模板,字段来自索引。
128
-
129
- ## Step 2: Load Style Context(仅当 Step 1.5 草稿不够时补充)
130
-
131
- **PREFERRED: MCP tools (designer-focused, no code noise):**
132
- ```
133
- mcp__qoder-knowledge-graph__context_pack(keyword='异常资产申请', platform='web', role='design')
134
- ```
135
- `role='design'` 只返回页面示例+布局指纹+风格速查+字段,过滤掉代码/API噪音。
136
- 比无 role 更干净,原型生成专用。
137
-
138
- **理解业务交互流程(原型要有状态,不只是静态截图):**
139
- ```
140
- mcp__qoder-knowledge-graph__get_workflow(module='资产')
141
- ```
142
- 返回操作链(如:查询→新增→提交→审批→归档→导出)。
143
- AI 据此设计原型的交互状态和页面跳转。
144
-
145
- **查语义级模块文档(比读代码更省 token):**
146
- ```
147
- mcp__search_wiki(keyword='资产')
148
- ```
149
-
150
- **FALLBACK: Python scripts:**
151
- ```bash
152
- python "$R/.qoder/scripts/search_index.py" --style <table|form|detail|modal|dashboard> --platform <web|app>
153
- python "$R/.qoder/scripts/search_index.py" <keyword> --platform <web|app>
154
- python "$R/.qoder/scripts/search_index.py" --field <field_name>
155
- ```
156
-
157
- Then read the TOP 2-3 most similar existing Vue files to extract:
158
- - Table column titles/fields and widths
159
- - Form field layouts and component types
160
- - Button styles and positions
161
-
162
- ## Step 3: Fill the Template
163
-
164
- Read the platform template and replace its placeholders.
165
-
166
- **prototype-web.html** (Web, Vben Admin mixed-nav shell, VxeGrid table):
167
-
168
- 布局外壳 = mixed-nav 三段式(顶部一级菜单 + 左侧二级菜单[可折叠三级] + 主区标签页)。
169
- fill_prototype 会按目标项目的 `layout_fingerprint` 自动填示例菜单骨架,
170
- 你只需按 PRD/需求替换成真实菜单层级。
171
-
172
- 占位符:
173
- - `{{TITLE}}` - browser tab title
174
- - `{{LOGO_TEXT}}` - 顶部 logo 文字(如 "ICS智云")
175
- - `{{MODULE_NAME}}` - 当前模块名(breadcrumb/菜单高亮用)
176
- - `{{TOP_MENU}}` - 顶部一级菜单项(`<div class="top-menu-item">`),当前模块加 `active`
177
- - `{{SIDEBAR_MENU}}` - 左侧二级菜单;三级用 `<details class="sidebar-group">` 折叠(见下),当前页加 `sidebar-item active`
178
- - `{{TABS}}` - 主区标签页(承载三四级页面),当前页加 `tab-item active`
179
- - `{{PAGE_NAME}}` - page name in breadcrumb
180
- - `{{SEARCH_FORM_FIELDS}}` - search form items (label + input/select)
181
- - `{{TABLE_HEADERS}}` - `<th>` cells using REAL column titles from code
182
- - `{{TABLE_ROWS}}` - `<tr>` rows with realistic sample data
183
-
184
- 三级折叠菜单写法(原生 `<details>`,零 JS):
185
- ```html
186
- <details class="sidebar-group">
187
- <summary>二级菜单A</summary>
188
- <div class="sidebar-sub">
189
- <div class="sidebar-item">三级菜单A-1</div>
190
- <div class="sidebar-item">三级菜单A-2</div>
191
- </div>
192
- </details>
193
- ```
194
-
195
- **prototype-app.html** (APP, Vant 3 variables, 375px, NavBar + TabBar):
196
- - `{{TITLE}}` - browser tab title
197
- - `{{PAGE_TITLE}}` - NavBar title
198
- - `{{LIST_ITEMS}}` - list cells (van-cell style)
199
- - `{{ITEM_TITLE}}` / `{{ITEM_DESC}}` - cell content
200
-
201
- Key design tokens already in the templates (do not override):
202
- - Web primary: 来自 `style-index.json` 的 `layout_fingerprint.color_primary`
203
- (ICS = `hsl(214.58, 86.34%, 59.8%)`,已写入模板 `:root --primary`)
204
- - APP primary: `--van-primary-color: #1989fa`
205
-
206
- ## ⚠️ Icons: NEVER emoji, ALWAYS the project's real icon system
207
-
208
- Source of truth: **data/index/icon-reference.json** (real usage counts +
209
- ready-to-paste SVGs extracted from the actual projects).
210
-
211
- - **Web (fywl-ui)**: Ant Design icons. Inline the SVG from icon-reference.json:
212
- ```html
213
- <span class="anticon">{svg from icon-reference.json web.svg.outlined[...]}</span>
214
- <style>.anticon svg{width:1em;height:1em;fill:currentColor}</style>
215
- ```
216
- Most-used in the real app: Download(303x), Plus(171x), Delete, Search, Edit...
217
- - **APP (Carmg-H5)**: Vant font icons:
218
- ```html
219
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@4/lib/index.css">
220
- <i class="van-icon van-icon-search"></i>
221
- ```
222
- Most-used: arrow-down, arrow, plus, cross, search...
223
- - An emoji (👤🚛💰⚠️...) anywhere in a prototype = automatic style FAIL.
224
-
225
- ## ⚠️ 菜单/侧边栏层级: 必须按需求填, 不准退化成扁平框
226
-
227
- 这是最常翻车的点。模板已是 **mixed-nav 多级骨架**(一级顶栏 + 二级侧栏 +
228
- 三级折叠 + 标签页),不要退化成旧的"扁平单级 sidebar"。
229
-
230
- 铁律:
231
- 1. 如果 PRD/需求**描述了侧边栏或菜单结构**(如"左边点一级显示二级,右边显示
232
- 三四级"),**严格按它填** `{{TOP_MENU}}`/`{{SIDEBAR_MENU}}`/`{{TABS}}`。
233
- 例如"一级→二级,右侧三四级"翻译成:顶部一级 tab + 左侧二级列表 + 标签页放三四级。
234
- 2. 如果需求没提菜单,保留 fill_prototype 填的**示例多级结构**(不要删成单级)。
235
- 3. 永远不要把 `{{SIDEBAR_MENU}}` 填成只有一个 `sidebar-item` —— 那是 bug。
236
- 4. ICS 的菜单来自后端接口(`access_mode: backend`),静态代码里抓不到完整菜单树,
237
- 所以菜单层级**必须由需求/PRD 提供**,不要去代码里找。
238
-
239
- ## Step 4: Highlight Changes + Interactivity
240
-
241
- - Mark NEW/CHANGED elements with the template's `highlight-new` class
242
- (subtle border + legend), so reviewers see the diff at a glance
243
- - Minimal JavaScript: row click highlight, form expand/collapse,
244
- tab switching, modal open/close, validation hints
245
- - Single self-contained HTML file, no external dependencies
246
-
247
- ## Rules
248
-
249
- 1. **ALWAYS match the TARGET platform style** - colors, spacing, fonts come
250
- from the template + real code, never from memory
251
- 2. **NEVER invent new patterns** - if the project uses VxeGrid, mimic VxeGrid
252
- 3. **Use REAL fields** - column titles and field names must come from the
253
- actual code found in Step 2, not made up
254
- 4. **Prototype must be interactive** - clickable buttons, fillable forms, hover states
255
- 5. **Save to** `workspace/members/{developer}/drafts/prototype-{feature}.html`
256
- (Both platforms -> `prototype-{feature}-web.html` + `prototype-{feature}-app.html`)
1
+ ---
2
+ name: prototype-generator
3
+ description: "生成匹配项目 UI 风格的交互式 HTML 原型(Web 端 fywl-ui 用 Vben Admin + Ant Design Vue;APP 端 Carmg-H5 用 Vant 3)。Generate interactive HTML prototypes matching project UI style. "
4
+ trigger: "user invokes /wl-* command explicitly"
5
+ ---
6
+
7
+
8
+ ## 🔧 仓库根定位(QoderWork 桌面端 vs Qoder IDE/CLI)
9
+
10
+ **后续脚本里的 `$R` 代表仓库根**,先确定它(QoderWork 桌面端工作目录不是仓库根,相对路径会失效):
11
+ ```bash
12
+ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
13
+ ```
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
15
+
16
+ # Prototype Generator
17
+
18
+ Generate production-ready HTML prototypes that match the project's actual UI style.
19
+
20
+ ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
21
+
22
+ - `.qoder/.developer` — 决定产出存到 `workspace/members/{dev}/drafts/`
23
+ - 若 `.qoder/.current-task` 存在,原型命名带上任务关键词
24
+ - 平台(Web/APP/Both)必须明确;如未指定,先问用户(见 prd-generator Step 0)
25
+
26
+ ## Step 0: Know the Platform
27
+
28
+ The platform MUST already be decided (asked by /wl-prd-full Step 0).
29
+ If you don't know it, STOP and ask the user (Web 管理端 / APP 移动端 / 两端都要).
30
+
31
+ | Platform | Project | Template | Design Tokens |
32
+ |----------|---------|----------|---------------|
33
+ | Web | fywl-ui | .qoder/templates/prototype-web.html | data/index/vben-style-reference.json (HSL) |
34
+ | APP | Carmg-H5 | .qoder/templates/prototype-app.html | Vant 3 variables (in template) |
35
+ | Both | both | both templates | generate 2 files: -web.html and -app.html |
36
+
37
+ ## Style Sources (Priority Order)
38
+
39
+ 1. **data/code/** - Existing Vue code from the TARGET project (HIGHEST priority)
40
+ 2. **data/index/vben-style-reference.json** - Vben design tokens (Web)
41
+ / Vant variables baked into prototype-app.html (APP)
42
+ 3. **data/index/chart-style-reference.json** - Dashboard/big-screen/chart
43
+ idioms (REQUIRED for dashboard/看板/大屏/统计类原型)
44
+ 4. **data/style/** - PDF design specs (only if a token is missing above)
45
+
46
+ If code conflicts with PDF, CODE WINS. The templates already contain the
47
+ correct tokens — do NOT invent colors or copy Ant Design defaults
48
+ (#1890ff is NOT this project's primary).
49
+
50
+ ## ⚠️ NEW-FEATURE prototypes MUST also anchor to real pages
51
+
52
+ For a feature with NO existing page (e.g. brainstorm/new dashboard), the
53
+ style must STILL come from the system, never from generic admin templates:
54
+
55
+ 1. Find the closest in-system page family:
56
+ `search_index.py --style <type> --platform <p>` + read 1-2 real pages
57
+ 2. Dashboard/看板/大屏类: read data/index/chart-style-reference.json and
58
+ choose the idiom — 大屏深蓝风 (dashboard/monitor 先例: 全国地图/驾驶舱)
59
+ or 浅色卡片风 (dashboard/workbench 先例: 工作台统计卡)
60
+ 3. Use REAL business vocabulary from the index (e.g. 异常三分类
61
+ 人员作业异常/车辆异常/费用异常 comes from workbench/components/abnormal.vue)
62
+ 4. In the prototype header comment, cite which real files the style came from
63
+ — if you cannot name a source file, you have NOT done step 1.
64
+
65
+ ## Step 0.5: Get Design System (MUST DO FIRST)
66
+
67
+ **PREFERRED: Call MCP tool (faster, auto-generates if missing):**
68
+ ```
69
+ mcp__qoder-knowledge-graph__get_design_system(platform='web')
70
+ ```
71
+
72
+ **FALLBACK: Read file directly:**
73
+ Read `data/design/DESIGN.md`. If missing, run `python "$R/.qoder/scripts/report/gen_design_doc.py"`.
74
+
75
+ Returns: layout fingerprint (sidebar 160px, mixed-nav), token set (primary HSL),
76
+ page type patterns, form behavior modes, icon rules, component stats.
77
+
78
+ > This is the v0.dev Registry equivalent — one call teaches AI the entire design system.
79
+
80
+ ## Step 1: Determine Prototype Type
81
+
82
+ Read the requirement to decide:
83
+ - **Table page**: List with search form + data grid + actions
84
+ - **Form page**: Create/edit form with validation
85
+ - **Detail page**: Read-only data display
86
+ - **Modal/Drawer**: Popup form
87
+ - **Dashboard**: Charts + summary cards
88
+
89
+ ## Step 1.5: Prefill Draft (MUST DO - 80% auto, 20% you adjust)
90
+
91
+ **PREFERRED: Call MCP tool:**
92
+ ```
93
+ mcp__qoder-knowledge-graph__fill_prototype(keyword='营业外合同', platform='web')
94
+ ```
95
+
96
+ **FALLBACK: Run script:**
97
+ ```bash
98
+ python "$R/.qoder/scripts/report/fill_prototype.py" <关键词> --platform <web|app>
99
+ ```
100
+
101
+ Returns: 80% complete HTML draft (real columns/fields/layout injected) + data manifest.
102
+ Your job: 20% adjustment only (interaction details, layout tweaks).
103
+ **DO NOT change tokens/colors/layout params — they come from real code.**
104
+ 需要用户提供参考页/设计稿,而不是默默画个默认骨架
105
+
106
+ 脚本/MCP 输出的数据清单包含:
107
+ 1. **真实表格列/表单字段**(来自 page_examples,非编造)
108
+ 2. **layout_fingerprint**(侧边栏宽度 160px、布局模式 mixed-nav,已注入 CSS)
109
+ 3. **behaviors**(表单模式 single/wizard/tabs、表格分页方式、弹窗类型)
110
+ 4. **🆕 真实按钮文案**(来自 entity-registry,如"添加反馈资产""导出 Excel"——别编"新增/编辑")
111
+ 5. **🆕 功能模块**(需求属于哪个模块、该模块有多少现有页面、标杆页面路径)
112
+ 6. **预填 HTML 草稿**(80% 完成)
113
+
114
+ 你的工作只剩 **20% 微调**:
115
+ - 用数据清单里的**真实按钮文案**替换通用文案(详情/编辑 → 系统真实按钮名)
116
+ - 补充交互细节(侧边栏折叠、弹窗、Tab 切换)
117
+ - 参考功能模块的标杆页面,确保布局跟同模块页面一致
118
+
119
+ **⚠️ 铁律**:
120
+ - 草稿里的 token(颜色/间距/侧边栏宽度)是**正确的**,**不要改成 #1890ff 或你编的值**
121
+ - 数据清单里的字段/按钮来自真实代码,**不要替换成你编的**
122
+ - 按钮文案优先用 entity-registry 里的真实文案,没有才用通用文案
123
+ - 你只做"调整",不做"重写"——如果草稿已满足需求,甚至可以零修改直接用
124
+
125
+ > **为什么这一步必要**:旧流程 AI 从零手写 HTML+CSS,12 个原型里 2 个硬编码了
126
+ > 禁止的 #1890ff(Ant Design 默认色,非 Vben),模板形同虚设。
127
+ > fill_prototype 从源头消灭这个问题——token 继承模板,字段来自索引。
128
+
129
+ ## Step 2: Load Style Context(仅当 Step 1.5 草稿不够时补充)
130
+
131
+ **PREFERRED: MCP tools (designer-focused, no code noise):**
132
+ ```
133
+ mcp__qoder-knowledge-graph__context_pack(keyword='异常资产申请', platform='web', role='design')
134
+ ```
135
+ `role='design'` 只返回页面示例+布局指纹+风格速查+字段,过滤掉代码/API噪音。
136
+ 比无 role 更干净,原型生成专用。
137
+
138
+ **理解业务交互流程(原型要有状态,不只是静态截图):**
139
+ ```
140
+ mcp__qoder-knowledge-graph__get_workflow(module='资产')
141
+ ```
142
+ 返回操作链(如:查询→新增→提交→审批→归档→导出)。
143
+ AI 据此设计原型的交互状态和页面跳转。
144
+
145
+ **查语义级模块文档(比读代码更省 token):**
146
+ ```
147
+ mcp__search_wiki(keyword='资产')
148
+ ```
149
+
150
+ **FALLBACK: Python scripts:**
151
+ ```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>
155
+ ```
156
+
157
+ Then read the TOP 2-3 most similar existing Vue files to extract:
158
+ - Table column titles/fields and widths
159
+ - Form field layouts and component types
160
+ - Button styles and positions
161
+
162
+ ## Step 3: Fill the Template
163
+
164
+ Read the platform template and replace its placeholders.
165
+
166
+ **prototype-web.html** (Web, Vben Admin mixed-nav shell, VxeGrid table):
167
+
168
+ 布局外壳 = mixed-nav 三段式(顶部一级菜单 + 左侧二级菜单[可折叠三级] + 主区标签页)。
169
+ fill_prototype 会按目标项目的 `layout_fingerprint` 自动填示例菜单骨架,
170
+ 你只需按 PRD/需求替换成真实菜单层级。
171
+
172
+ 占位符:
173
+ - `{{TITLE}}` - browser tab title
174
+ - `{{LOGO_TEXT}}` - 顶部 logo 文字(如 "ICS智云")
175
+ - `{{MODULE_NAME}}` - 当前模块名(breadcrumb/菜单高亮用)
176
+ - `{{TOP_MENU}}` - 顶部一级菜单项(`<div class="top-menu-item">`),当前模块加 `active`
177
+ - `{{SIDEBAR_MENU}}` - 左侧二级菜单;三级用 `<details class="sidebar-group">` 折叠(见下),当前页加 `sidebar-item active`
178
+ - `{{TABS}}` - 主区标签页(承载三四级页面),当前页加 `tab-item active`
179
+ - `{{PAGE_NAME}}` - page name in breadcrumb
180
+ - `{{SEARCH_FORM_FIELDS}}` - search form items (label + input/select)
181
+ - `{{TABLE_HEADERS}}` - `<th>` cells using REAL column titles from code
182
+ - `{{TABLE_ROWS}}` - `<tr>` rows with realistic sample data
183
+
184
+ 三级折叠菜单写法(原生 `<details>`,零 JS):
185
+ ```html
186
+ <details class="sidebar-group">
187
+ <summary>二级菜单A</summary>
188
+ <div class="sidebar-sub">
189
+ <div class="sidebar-item">三级菜单A-1</div>
190
+ <div class="sidebar-item">三级菜单A-2</div>
191
+ </div>
192
+ </details>
193
+ ```
194
+
195
+ **prototype-app.html** (APP, Vant 3 variables, 375px, NavBar + TabBar):
196
+ - `{{TITLE}}` - browser tab title
197
+ - `{{PAGE_TITLE}}` - NavBar title
198
+ - `{{LIST_ITEMS}}` - list cells (van-cell style)
199
+ - `{{ITEM_TITLE}}` / `{{ITEM_DESC}}` - cell content
200
+
201
+ Key design tokens already in the templates (do not override):
202
+ - Web primary: 来自 `style-index.json` 的 `layout_fingerprint.color_primary`
203
+ (ICS = `hsl(214.58, 86.34%, 59.8%)`,已写入模板 `:root --primary`)
204
+ - APP primary: `--van-primary-color: #1989fa`
205
+
206
+ ## ⚠️ Icons: NEVER emoji, ALWAYS the project's real icon system
207
+
208
+ Source of truth: **data/index/icon-reference.json** (real usage counts +
209
+ ready-to-paste SVGs extracted from the actual projects).
210
+
211
+ - **Web (fywl-ui)**: Ant Design icons. Inline the SVG from icon-reference.json:
212
+ ```html
213
+ <span class="anticon">{svg from icon-reference.json web.svg.outlined[...]}</span>
214
+ <style>.anticon svg{width:1em;height:1em;fill:currentColor}</style>
215
+ ```
216
+ Most-used in the real app: Download(303x), Plus(171x), Delete, Search, Edit...
217
+ - **APP (Carmg-H5)**: Vant font icons:
218
+ ```html
219
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@4/lib/index.css">
220
+ <i class="van-icon van-icon-search"></i>
221
+ ```
222
+ Most-used: arrow-down, arrow, plus, cross, search...
223
+ - An emoji (👤🚛💰⚠️...) anywhere in a prototype = automatic style FAIL.
224
+
225
+ ## ⚠️ 菜单/侧边栏层级: 必须按需求填, 不准退化成扁平框
226
+
227
+ 这是最常翻车的点。模板已是 **mixed-nav 多级骨架**(一级顶栏 + 二级侧栏 +
228
+ 三级折叠 + 标签页),不要退化成旧的"扁平单级 sidebar"。
229
+
230
+ 铁律:
231
+ 1. 如果 PRD/需求**描述了侧边栏或菜单结构**(如"左边点一级显示二级,右边显示
232
+ 三四级"),**严格按它填** `{{TOP_MENU}}`/`{{SIDEBAR_MENU}}`/`{{TABS}}`。
233
+ 例如"一级→二级,右侧三四级"翻译成:顶部一级 tab + 左侧二级列表 + 标签页放三四级。
234
+ 2. 如果需求没提菜单,保留 fill_prototype 填的**示例多级结构**(不要删成单级)。
235
+ 3. 永远不要把 `{{SIDEBAR_MENU}}` 填成只有一个 `sidebar-item` —— 那是 bug。
236
+ 4. ICS 的菜单来自后端接口(`access_mode: backend`),静态代码里抓不到完整菜单树,
237
+ 所以菜单层级**必须由需求/PRD 提供**,不要去代码里找。
238
+
239
+ ## Step 4: Highlight Changes + Interactivity
240
+
241
+ - Mark NEW/CHANGED elements with the template's `highlight-new` class
242
+ (subtle border + legend), so reviewers see the diff at a glance
243
+ - Minimal JavaScript: row click highlight, form expand/collapse,
244
+ tab switching, modal open/close, validation hints
245
+ - Single self-contained HTML file, no external dependencies
246
+
247
+ ## Rules
248
+
249
+ 1. **ALWAYS match the TARGET platform style** - colors, spacing, fonts come
250
+ from the template + real code, never from memory
251
+ 2. **NEVER invent new patterns** - if the project uses VxeGrid, mimic VxeGrid
252
+ 3. **Use REAL fields** - column titles and field names must come from the
253
+ actual code found in Step 2, not made up
254
+ 4. **Prototype must be interactive** - clickable buttons, fillable forms, hover states
255
+ 5. **Save to** `workspace/members/{developer}/drafts/prototype-{feature}.html`
256
+ (Both platforms -> `prototype-{feature}-web.html` + `prototype-{feature}-app.html`)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: spec-coder
3
- description: "严格按开发 Spec 实现代码。Implement code strictly following development Spec. 用户说'开始写代码''按规格实现''实现这个接口''把这个需求做出来'时触发。需用户确认(DANGEROUS)。"
4
- trigger: "Spec 已确认待实现时;用户说'开始写代码''按spec实现''/wl-code'"
3
+ description: "严格按开发 Spec 实现代码。Implement code strictly following development Spec. 需用户确认(DANGEROUS)。"
4
+ trigger: "user invokes /wl-* command explicitly"
5
5
  ---
6
6
 
7
7
 
@@ -11,7 +11,7 @@ trigger: "Spec 已确认待实现时;用户说'开始写代码''按spec实现'
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/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
15
15
 
16
16
  # Spec Coder
17
17
 
@@ -45,7 +45,7 @@ ls workspace/tasks/ # 任务内的 specs
45
45
  2. **PRD 文件**(推荐):原始需求,理解业务背景
46
46
  3. **现有代码风格**(必需):用 search_index.py 找相关模块真实代码作参考
47
47
  ```bash
48
- python "$R/.qoder/scripts/search_index.py" <模块关键词>
48
+ python "$R/.qoder/scripts/kg/search_index.py" <模块关键词>
49
49
  ```
50
50
  读 top 2-3 个相似文件,照着它们的命名/结构/异常处理写
51
51
  4. **架构/数据字典**(如存在):`.qoder/context/architecture.md`、`data-dictionary.md`
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: spec-generator
3
- description: "从已确认的 PRD 自动生成开发 Spec 文档(技术规格说明)。Auto-generate development Spec documents from confirmed PRDs. 用户说'生成规格''写spec''出技术方案''把PRD转成开发文档'时触发。"
4
- trigger: "PRD 被确认/发布后自动触发;或用户说'生成Spec''写技术规格''/wl-spec'"
3
+ description: "从已确认的 PRD 自动生成开发 Spec 文档(技术规格说明)。Auto-generate development Spec documents from confirmed PRDs. "
4
+ trigger: "user invokes /wl-* command explicitly"
5
5
  ---
6
6
 
7
7
 
@@ -11,7 +11,7 @@ trigger: "PRD 被确认/发布后自动触发;或用户说'生成Spec''写技
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/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
15
15
 
16
16
  # Spec Generator
17
17
 
@@ -27,7 +27,7 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
27
27
  - `.qoder/.current-task` — 当前任务(决定 spec 存到哪个 task 目录)
28
28
  - 扫描 PRD 来源目录:`data/docs/prd/`(已发布)+ `workspace/members/{dev}/drafts/REQ-*.md`(草稿)
29
29
  找出还没有对应 Spec 的 PRD
30
- - 风格/字段参考:`python "$R/.qoder/scripts/search_index.py" --field <字段名>` 查现有字段命名约定
30
+ - 风格/字段参考:`python "$R/.qoder/scripts/kg/search_index.py" --field <字段名>` 查现有字段命名约定
31
31
  - 团队 Java 约定(MyBatis Plus + RESTful + BigDecimal 金额)写在本 skill 的 Step 3
32
32
 
33
33
  ## Step 1: 定位 PRD
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: test-generator
3
- description: "从已实现代码和 Spec 自动生成单元测试。Auto-generate unit tests from implemented code and Spec. 用户说'写单元测试''补测试''覆盖一下''写个test'时触发。需用户确认(DANGEROUS)。"
4
- trigger: "代码实现完成后;用户说'写测试''补单测''生成test''/wl-test'"
3
+ description: "从已实现代码和 Spec 自动生成单元测试。Auto-generate unit tests from implemented code and Spec. 需用户确认(DANGEROUS)。"
4
+ trigger: "user invokes /wl-* command explicitly"
5
5
  ---
6
6
 
7
7
 
@@ -11,7 +11,7 @@ trigger: "代码实现完成后;用户说'写测试''补单测''生成test''/w
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/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
15
15
 
16
16
  # Test Generator
17
17
 
@@ -30,7 +30,7 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
30
30
  - Spec 文件:`workspace/specs/REQ-{ID}-*.spec.md` 或 `workspace/tasks/{task-id}/spec.md`
31
31
  - 已实现代码:用 search_index.py 定位
32
32
  ```bash
33
- python "$R/.qoder/scripts/search_index.py" <类名或模块关键词>
33
+ python "$R/.qoder/scripts/kg/search_index.py" <类名或模块关键词>
34
34
  ```
35
35
 
36
36
  ## Step 1: 定位待测代码
@@ -48,7 +48,7 @@ ls data/code/ # 已实现代码库
48
48
  2. **Spec 文件**(推荐):测试用例映射来源
49
49
  3. **现有测试代码**(推荐):用 search_index.py 找同类 Test 类,照着写
50
50
  ```bash
51
- python "$R/.qoder/scripts/search_index.py" Test
51
+ python "$R/.qoder/scripts/kg/search_index.py" Test
52
52
  ```
53
53
 
54
54
  ## Step 3: 生成测试
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: wl-code
3
- description: "按开发 Spec 严格实现代码(/wl-code 命令入口)。Implement code following a Spec strictly. 用户说'开始写代码''按规格实现''实现这个接口''把这个需求做出来'或输入 /wl-code 时触发。需用户确认(DANGEROUS)。"
4
- trigger: "Spec 已确认待实现;用户说'开始写代码''按spec实现''/wl-code'"
3
+ description: "按开发 Spec 严格实现代码(/wl-code 命令入口)。Implement code following a Spec strictly. 需用户确认(DANGEROUS)。"
4
+ trigger: "user invokes /wl-* command explicitly"
5
5
  ---
6
6
 
7
7
 
@@ -11,7 +11,7 @@ trigger: "Spec 已确认待实现;用户说'开始写代码''按spec实现''/w
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/install_qoderwork.py`。
14
+ > `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/setup/install_qoderwork.py`。
15
15
 
16
16
  # wl-code — 按 Spec 实现代码(/wl-code 命令入口)
17
17
 
@@ -41,7 +41,7 @@ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
41
41
  1. **加载 Spec**:按 REQ-ID 找 spec;没参数就读 `.qoder/.current-task`
42
42
  2. **搜相关代码**:
43
43
  ```bash
44
- python "$R/.qoder/scripts/search_index.py" <关键词>
44
+ python "$R/.qoder/scripts/kg/search_index.py" <关键词>
45
45
  ```
46
46
  读相关文件了解现有模式。
47
47
  3. **按 spec-coder skill 实现**:严格按 spec,遵循 data/code/ 的团队约定