@hupan56/wlkj 2.6.0 → 2.7.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 (125) hide show
  1. package/bin/cli.js +261 -11
  2. package/package.json +1 -1
  3. package/templates/qoder/agents/insight-planning.md +67 -0
  4. package/templates/qoder/agents/insight-research.md +61 -0
  5. package/templates/qoder/agents/prd-reference.md +8 -2
  6. package/templates/qoder/commands/optional/wl-insight.md +275 -0
  7. package/templates/qoder/commands/{wl-report.md → optional/wl-report.md} +13 -5
  8. package/templates/qoder/commands/{wl-spec.md → optional/wl-spec.md} +1 -1
  9. package/templates/qoder/commands/{wl-status.md → optional/wl-status.md} +28 -2
  10. package/templates/qoder/commands/wl-code.md +10 -2
  11. package/templates/qoder/commands/wl-commit.md +1 -1
  12. package/templates/qoder/commands/wl-design-draw.md +78 -0
  13. package/templates/qoder/commands/wl-design-scan.md +108 -0
  14. package/templates/qoder/commands/wl-design-spec.md +154 -0
  15. package/templates/qoder/commands/wl-design.md +32 -0
  16. package/templates/qoder/commands/wl-init.md +24 -3
  17. package/templates/qoder/commands/wl-prd-full.md +226 -0
  18. package/templates/qoder/commands/wl-prd-quick.md +134 -0
  19. package/templates/qoder/commands/wl-prd-review.md +104 -0
  20. package/templates/qoder/commands/wl-prd.md +17 -311
  21. package/templates/qoder/commands/wl-search.md +66 -30
  22. package/templates/qoder/commands/wl-task.md +290 -59
  23. package/templates/qoder/commands/wl-test.md +92 -24
  24. package/templates/qoder/config.yaml +51 -15
  25. package/templates/qoder/hooks/inject-workflow-state.py +2 -2
  26. package/templates/qoder/hooks/session-start.py +82 -51
  27. package/templates/qoder/rules/wl-pipeline.md +216 -105
  28. package/templates/qoder/scripts/__pycache__/search_index.cpython-39.pyc +0 -0
  29. package/templates/qoder/scripts/archive_prd.py +377 -0
  30. package/templates/qoder/scripts/autotest.py +1715 -0
  31. package/templates/qoder/scripts/autotest_batch.py +224 -0
  32. package/templates/qoder/scripts/autotest_run.py +297 -0
  33. package/templates/qoder/scripts/benchmark.py +210 -209
  34. package/templates/qoder/scripts/build_style_index.py +444 -4
  35. package/templates/qoder/scripts/check_carriers.py +238 -0
  36. package/templates/qoder/scripts/check_mcp.py +298 -0
  37. package/templates/qoder/scripts/check_qoderwork_consistency.py +166 -0
  38. package/templates/qoder/scripts/common/events.py +46 -0
  39. package/templates/qoder/scripts/common/extract.py +419 -0
  40. package/templates/qoder/scripts/common/graph_traverse.py +533 -0
  41. package/templates/qoder/scripts/common/paths.py +89 -0
  42. package/templates/qoder/scripts/common/pip_install.py +144 -0
  43. package/templates/qoder/scripts/common/platform_guard.py +61 -0
  44. package/templates/qoder/scripts/common/search_engine.py +205 -205
  45. package/templates/qoder/scripts/common/terms.py +57 -0
  46. package/templates/qoder/scripts/common/ts_extract.py +536 -0
  47. package/templates/qoder/scripts/context_pack.py +73 -13
  48. package/templates/qoder/scripts/enrich_prompt.py +226 -0
  49. package/templates/qoder/scripts/eval_prd.py +318 -231
  50. package/templates/qoder/scripts/export.py +487 -487
  51. package/templates/qoder/scripts/extract_api_params.py +246 -0
  52. package/templates/qoder/scripts/extract_routes.py +54 -0
  53. package/templates/qoder/scripts/extract_routes_tree.py +78 -0
  54. package/templates/qoder/scripts/fill_prototype.py +707 -0
  55. package/templates/qoder/scripts/gen_design_doc.py +394 -0
  56. package/templates/qoder/scripts/git_sync.py +27 -15
  57. package/templates/qoder/scripts/init_doctor.py +292 -40
  58. package/templates/qoder/scripts/install_qoderwork.py +366 -9
  59. package/templates/qoder/scripts/kg.py +708 -0
  60. package/templates/qoder/scripts/kg_auto_login.py +196 -0
  61. package/templates/qoder/scripts/kg_build.py +612 -0
  62. package/templates/qoder/scripts/kg_build_db.py +327 -0
  63. package/templates/qoder/scripts/kg_duckdb.py +549 -0
  64. package/templates/qoder/scripts/kg_incremental.py +393 -0
  65. package/templates/qoder/scripts/kg_link_db.py +224 -0
  66. package/templates/qoder/scripts/kg_mcp_server.py +801 -0
  67. package/templates/qoder/scripts/kg_semantic.py +150 -0
  68. package/templates/qoder/scripts/kg_test_runner.py +241 -0
  69. package/templates/qoder/scripts/lanhu_stdio_wrapper.py +119 -0
  70. package/templates/qoder/scripts/learn.py +118 -39
  71. package/templates/qoder/scripts/learn_aggregate.py +201 -0
  72. package/templates/qoder/scripts/mcp_launcher.py +359 -0
  73. package/templates/qoder/scripts/mysql_mcp_server.py +396 -0
  74. package/templates/qoder/scripts/repo_root.py +106 -0
  75. package/templates/qoder/scripts/role.py +12 -0
  76. package/templates/qoder/scripts/run_weekly_update.bat +5 -0
  77. package/templates/qoder/scripts/run_weekly_update.sh +5 -0
  78. package/templates/qoder/scripts/search_index.py +307 -60
  79. package/templates/qoder/scripts/secure-ls.js +5640 -0
  80. package/templates/qoder/scripts/setup.py +706 -641
  81. package/templates/qoder/scripts/setup_lanhu.py +963 -0
  82. package/templates/qoder/scripts/status.py +250 -11
  83. package/templates/qoder/scripts/sync_carriers.py +259 -0
  84. package/templates/qoder/scripts/syncgate.py +2 -2
  85. package/templates/qoder/scripts/task.py +75 -0
  86. package/templates/qoder/scripts/team_sync.py +60 -4
  87. package/templates/qoder/scripts/workspace_init.py +1 -1
  88. package/templates/qoder/skills/design-import/SKILL.md +226 -0
  89. package/templates/qoder/skills/design-import/figma-workflow.md +81 -0
  90. package/templates/qoder/skills/design-review/SKILL.md +82 -25
  91. package/templates/qoder/skills/prd-generator/SKILL.md +184 -60
  92. package/templates/qoder/skills/prd-review/SKILL.md +18 -1
  93. package/templates/qoder/skills/prompt-enrich/SKILL.md +90 -0
  94. package/templates/qoder/skills/prototype-generator/SKILL.md +256 -141
  95. package/templates/qoder/skills/prototype-generator/SKILL.md.zcode-79180-2af4721f-f9a6-412c-88db-c0af680d211b.tmp +0 -0
  96. package/templates/qoder/skills/spec-coder/SKILL.md +18 -1
  97. package/templates/qoder/skills/spec-generator/SKILL.md +18 -1
  98. package/templates/qoder/skills/test-generator/SKILL.md +15 -2
  99. package/templates/qoder/skills/wl-code/SKILL.md +55 -36
  100. package/templates/qoder/skills/wl-commit/SKILL.md +89 -76
  101. package/templates/qoder/skills/wl-design/SKILL.md +55 -0
  102. package/templates/qoder/skills/wl-init/SKILL.md +76 -67
  103. package/templates/qoder/skills/wl-insight/SKILL.md +201 -81
  104. package/templates/qoder/skills/wl-prd-full/SKILL.md +69 -0
  105. package/templates/qoder/skills/wl-prd-quick/SKILL.md +49 -0
  106. package/templates/qoder/skills/wl-prd-review/SKILL.md +34 -0
  107. package/templates/qoder/skills/wl-report/SKILL.md +131 -107
  108. package/templates/qoder/skills/wl-search/SKILL.md +141 -75
  109. package/templates/qoder/skills/wl-spec/SKILL.md +49 -39
  110. package/templates/qoder/skills/wl-status/SKILL.md +83 -61
  111. package/templates/qoder/skills/wl-task/SKILL.md +132 -58
  112. package/templates/qoder/skills/wl-test/SKILL.md +406 -40
  113. package/templates/qoder/templates/prototype-app.html +13 -8
  114. package/templates/qoder/templates/prototype-web.html +376 -93
  115. package/templates/root/AGENTS.md +89 -34
  116. package/templates/root/requirements.txt +21 -0
  117. package/templates/root//344/275/277/347/224/250/350/257/264/346/230/216.md +259 -259
  118. package/templates/root//346/226/260/346/211/213/346/214/207/345/215/227.md +186 -186
  119. package/templates/qoder/agents/prd-planning.md +0 -57
  120. package/templates/qoder/agents/prd-research.md +0 -34
  121. package/templates/qoder/commands/wl-insight.md +0 -51
  122. package/templates/qoder/scripts/__pycache__/init_doctor.cpython-39.pyc +0 -0
  123. package/templates/qoder/scripts/__pycache__/setup.cpython-39.pyc +0 -0
  124. package/templates/qoder/scripts/common/__pycache__/developer.cpython-39.pyc +0 -0
  125. package/templates/qoder/skills/wl-prd/SKILL.md +0 -92
@@ -1,141 +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
- # Prototype Generator
8
-
9
- Generate production-ready HTML prototypes that match the project's actual UI style.
10
-
11
- ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
12
-
13
- - `.qoder/.developer` — 决定产出存到 `workspace/members/{dev}/drafts/`
14
- - `.qoder/.current-task` 存在,原型命名带上任务关键词
15
- - 平台(Web/APP/Both)必须明确;如未指定,先问用户(见 prd-generator Step 0)
16
-
17
- ## Step 0: Know the Platform
18
-
19
- The platform MUST already be decided (asked by /wl-prd Step 0).
20
- If you don't know it, STOP and ask the user (Web 管理端 / APP 移动端 / 两端都要).
21
-
22
- | Platform | Project | Template | Design Tokens |
23
- |----------|---------|----------|---------------|
24
- | Web | fywl-ui | .qoder/templates/prototype-web.html | data/index/vben-style-reference.json (HSL) |
25
- | APP | Carmg-H5 | .qoder/templates/prototype-app.html | Vant 3 variables (in template) |
26
- | Both | both | both templates | generate 2 files: -web.html and -app.html |
27
-
28
- ## Style Sources (Priority Order)
29
-
30
- 1. **data/code/** - Existing Vue code from the TARGET project (HIGHEST priority)
31
- 2. **data/index/vben-style-reference.json** - Vben design tokens (Web)
32
- / Vant variables baked into prototype-app.html (APP)
33
- 3. **data/index/chart-style-reference.json** - Dashboard/big-screen/chart
34
- idioms (REQUIRED for dashboard/看板/大屏/统计类原型)
35
- 4. **data/style/** - PDF design specs (only if a token is missing above)
36
-
37
- If code conflicts with PDF, CODE WINS. The templates already contain the
38
- correct tokens — do NOT invent colors or copy Ant Design defaults
39
- (#1890ff is NOT this project's primary).
40
-
41
- ## ⚠️ NEW-FEATURE prototypes MUST also anchor to real pages
42
-
43
- For a feature with NO existing page (e.g. brainstorm/new dashboard), the
44
- style must STILL come from the system, never from generic admin templates:
45
-
46
- 1. Find the closest in-system page family:
47
- `search_index.py --style <type> --platform <p>` + read 1-2 real pages
48
- 2. Dashboard/看板/大屏类: read data/index/chart-style-reference.json and
49
- choose the idiom — 大屏深蓝风 (dashboard/monitor 先例: 全国地图/驾驶舱)
50
- or 浅色卡片风 (dashboard/workbench 先例: 工作台统计卡)
51
- 3. Use REAL business vocabulary from the index (e.g. 异常三分类
52
- 人员作业异常/车辆异常/费用异常 comes from workbench/components/abnormal.vue)
53
- 4. In the prototype header comment, cite which real files the style came from
54
- — if you cannot name a source file, you have NOT done step 1.
55
-
56
- ## Step 1: Determine Prototype Type
57
-
58
- Read the requirement to decide:
59
- - **Table page**: List with search form + data grid + actions
60
- - **Form page**: Create/edit form with validation
61
- - **Detail page**: Read-only data display
62
- - **Modal/Drawer**: Popup form
63
- - **Dashboard**: Charts + summary cards
64
-
65
- ## Step 2: Load Style Context
66
-
67
- ```bash
68
- # Find real example pages of this type in the target project
69
- python .qoder/scripts/search_index.py --style <table|form|detail|modal|dashboard> --platform <web|app>
70
-
71
- # Find similar existing pages by business keyword
72
- python .qoder/scripts/search_index.py <keyword> --platform <web|app>
73
-
74
- # Find field definitions (real field names + Chinese labels)
75
- python .qoder/scripts/search_index.py --field <field_name>
76
- ```
77
-
78
- Then read the TOP 2-3 most similar existing Vue files to extract:
79
- - Table column titles/fields and widths
80
- - Form field layouts and component types
81
- - Button styles and positions
82
-
83
- ## Step 3: Fill the Template
84
-
85
- Read the platform template and replace its placeholders:
86
-
87
- **prototype-web.html** (Web, Vben Admin HSL variables, sidebar layout, VxeGrid table):
88
- - `{{TITLE}}` - browser tab title
89
- - `{{MODULE_NAME}}` - sidebar/breadcrumb module name
90
- - `{{PAGE_NAME}}` - page name in breadcrumb
91
- - `{{SEARCH_FORM_FIELDS}}` - search form items (label + input/select)
92
- - `{{TABLE_HEADERS}}` - `<th>` cells using REAL column titles from code
93
- - `{{TABLE_ROWS}}` - `<tr>` rows with realistic sample data
94
-
95
- **prototype-app.html** (APP, Vant 3 variables, 375px, NavBar + TabBar):
96
- - `{{TITLE}}` - browser tab title
97
- - `{{PAGE_TITLE}}` - NavBar title
98
- - `{{LIST_ITEMS}}` - list cells (van-cell style)
99
- - `{{ITEM_TITLE}}` / `{{ITEM_DESC}}` - cell content
100
-
101
- Key design tokens already in the templates (do not override):
102
- - Web primary: `hsl(212 100% 45%)` via `--primary` (from vben-style-reference.json)
103
- - APP primary: `--van-primary-color: #1989fa`
104
-
105
- ## ⚠️ Icons: NEVER emoji, ALWAYS the project's real icon system
106
-
107
- Source of truth: **data/index/icon-reference.json** (real usage counts +
108
- ready-to-paste SVGs extracted from the actual projects).
109
-
110
- - **Web (fywl-ui)**: Ant Design icons. Inline the SVG from icon-reference.json:
111
- ```html
112
- <span class="anticon">{svg from icon-reference.json web.svg.outlined[...]}</span>
113
- <style>.anticon svg{width:1em;height:1em;fill:currentColor}</style>
114
- ```
115
- Most-used in the real app: Download(303x), Plus(171x), Delete, Search, Edit...
116
- - **APP (Carmg-H5)**: Vant font icons:
117
- ```html
118
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@4/lib/index.css">
119
- <i class="van-icon van-icon-search"></i>
120
- ```
121
- Most-used: arrow-down, arrow, plus, cross, search...
122
- - An emoji (👤🚛💰⚠️...) anywhere in a prototype = automatic style FAIL.
123
-
124
- ## Step 4: Highlight Changes + Interactivity
125
-
126
- - Mark NEW/CHANGED elements with the template's `highlight-new` class
127
- (subtle border + legend), so reviewers see the diff at a glance
128
- - Minimal JavaScript: row click highlight, form expand/collapse,
129
- tab switching, modal open/close, validation hints
130
- - Single self-contained HTML file, no external dependencies
131
-
132
- ## Rules
133
-
134
- 1. **ALWAYS match the TARGET platform style** - colors, spacing, fonts come
135
- from the template + real code, never from memory
136
- 2. **NEVER invent new patterns** - if the project uses VxeGrid, mimic VxeGrid
137
- 3. **Use REAL fields** - column titles and field names must come from the
138
- actual code found in Step 2, not made up
139
- 4. **Prototype must be interactive** - clickable buttons, fillable forms, hover states
140
- 5. **Save to** `workspace/members/{developer}/drafts/prototype-{feature}.html`
141
- (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. 用户说'做个原型''画个 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`)
@@ -4,8 +4,21 @@ description: "严格按开发 Spec 实现代码。Implement code strictly follow
4
4
  trigger: "Spec 已确认待实现时;用户说'开始写代码''按spec实现''/wl-code'"
5
5
  ---
6
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
+
7
16
  # Spec Coder
8
17
 
18
+ > 📌 **主入口:`/wl-code` 命令。** 本 skill 是其实现层 + Quest/QoderWork 自然语言路由。
19
+ > 两者功能等价,优先用 `/wl-code`。
20
+ > **模块契约**(输入/输出/校验):`.qoder/contracts/code.md`
21
+
9
22
  严格按开发 Spec 实现代码,生成符合团队规范的代码。
10
23
 
11
24
  > ⚠️ 这是 DANGEROUS 操作(会写源码)。执行前必须向用户确认。
@@ -32,11 +45,15 @@ ls workspace/tasks/ # 任务内的 specs
32
45
  2. **PRD 文件**(推荐):原始需求,理解业务背景
33
46
  3. **现有代码风格**(必需):用 search_index.py 找相关模块真实代码作参考
34
47
  ```bash
35
- python .qoder/scripts/search_index.py <模块关键词>
48
+ python "$R/.qoder/scripts/search_index.py" <模块关键词>
36
49
  ```
37
50
  读 top 2-3 个相似文件,照着它们的命名/结构/异常处理写
38
51
  4. **架构/数据字典**(如存在):`.qoder/context/architecture.md`、`data-dictionary.md`
39
52
  不存在就跳过,从现有代码推断
53
+ 5. **真实表结构(推荐)**:写 Entity/SQL 前调 MySQL MCP 核对数据库真实列定义。
54
+ - `mcp__qoder-mysql__query_schema(table='表名', db='库名')`
55
+ - 拿真实列名/类型/可空/注释(含枚举定义),避免 Entity 字段和数据库对不上
56
+ - 注意:[QAS 测试环境] 结构与生产一致;数据行仅参考格式
40
57
 
41
58
  ## Step 3: 按 Spec 实现
42
59
 
@@ -4,8 +4,21 @@ description: "从已确认的 PRD 自动生成开发 Spec 文档(技术规格
4
4
  trigger: "PRD 被确认/发布后自动触发;或用户说'生成Spec''写技术规格''/wl-spec'"
5
5
  ---
6
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
+
7
16
  # Spec Generator
8
17
 
18
+ > 📌 **主入口:`/wl-spec` 命令。** 本 skill 是其实现层 + Quest/QoderWork 自然语言路由。
19
+ > 两者功能等价,优先用 `/wl-spec`。
20
+ > **模块契约**(输入/输出/校验):`.qoder/contracts/spec.md`
21
+
9
22
  从已确认的 PRD 生成开发 Spec 文档,遵循团队技术规范。
10
23
 
11
24
  ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
@@ -14,7 +27,7 @@ trigger: "PRD 被确认/发布后自动触发;或用户说'生成Spec''写技
14
27
  - `.qoder/.current-task` — 当前任务(决定 spec 存到哪个 task 目录)
15
28
  - 扫描 PRD 来源目录:`data/docs/prd/`(已发布)+ `workspace/members/{dev}/drafts/REQ-*.md`(草稿)
16
29
  找出还没有对应 Spec 的 PRD
17
- - 风格/字段参考:`python .qoder/scripts/search_index.py --field <字段名>` 查现有字段命名约定
30
+ - 风格/字段参考:`python "$R/.qoder/scripts/search_index.py" --field <字段名>` 查现有字段命名约定
18
31
  - 团队 Java 约定(MyBatis Plus + RESTful + BigDecimal 金额)写在本 skill 的 Step 3
19
32
 
20
33
  ## Step 1: 定位 PRD
@@ -35,6 +48,10 @@ ls workspace/members/{developer}/drafts/REQ-*.md
35
48
  2. **历史 Spec**(推荐):扫 `workspace/specs/` 看同类需求的写法,照着写
36
49
  3. **现有代码风格**(推荐):用 search_index.py 找相关模块的真实代码做参考
37
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')`
53
+ - 拿到真实列名/类型/注释(注释里常含枚举定义,如"0=小时,1=工作日")
54
+ - 注意:[QAS 测试环境] 表结构与生产一致可放心用;数据行是测试数据仅参考格式
38
55
 
39
56
  ## Step 3: 分析并生成
40
57
 
@@ -4,8 +4,21 @@ description: "从已实现代码和 Spec 自动生成单元测试。Auto-generat
4
4
  trigger: "代码实现完成后;用户说'写测试''补单测''生成test''/wl-test'"
5
5
  ---
6
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
+
7
16
  # Test Generator
8
17
 
18
+ > 📌 **主入口:`/wl-test unit` 命令。** 本 skill 是其 unit 模式的实现层 + Quest/QoderWork 自然语言路由。
19
+ > (`/wl-test` 默认走 browser/quick,说"单元测试"才进本 skill。)
20
+ > **模块契约**(输入/输出/校验):`.qoder/contracts/test.md`
21
+
9
22
  按团队规范,基于已实现代码和 Spec 生成单元测试。
10
23
 
11
24
  > ⚠️ 这是 DANGEROUS 操作(会写源码)。执行前必须向用户确认。
@@ -17,7 +30,7 @@ trigger: "代码实现完成后;用户说'写测试''补单测''生成test''/w
17
30
  - Spec 文件:`workspace/specs/REQ-{ID}-*.spec.md` 或 `workspace/tasks/{task-id}/spec.md`
18
31
  - 已实现代码:用 search_index.py 定位
19
32
  ```bash
20
- python .qoder/scripts/search_index.py <类名或模块关键词>
33
+ python "$R/.qoder/scripts/search_index.py" <类名或模块关键词>
21
34
  ```
22
35
 
23
36
  ## Step 1: 定位待测代码
@@ -35,7 +48,7 @@ ls data/code/ # 已实现代码库
35
48
  2. **Spec 文件**(推荐):测试用例映射来源
36
49
  3. **现有测试代码**(推荐):用 search_index.py 找同类 Test 类,照着写
37
50
  ```bash
38
- python .qoder/scripts/search_index.py Test
51
+ python "$R/.qoder/scripts/search_index.py" Test
39
52
  ```
40
53
 
41
54
  ## Step 3: 生成测试
@@ -1,36 +1,55 @@
1
- ---
2
- name: wl-code
3
- description: "按开发 Spec 严格实现代码(/wl-code 命令入口)。Implement code following a Spec strictly. 用户说'开始写代码''按规格实现''实现这个接口''把这个需求做出来'或输入 /wl-code 时触发。需用户确认(DANGEROUS)。"
4
- trigger: "Spec 已确认待实现;用户说'开始写代码''按spec实现''/wl-code'"
5
- ---
6
-
7
- # wl-code — 按 Spec 实现代码(/wl-code 命令入口)
8
-
9
- > 这是 `/wl-code` 命令的 skill 入口。让 QoderWork 的 `/` 列表也能用 `/wl-code`。
10
- > ⚠️ DANGEROUS 操作(写代码),执行前向用户确认范围。
11
- > 完整规则见功能型 skill `.qoder/skills/spec-coder/SKILL.md`
12
- > 和命令 `.qoder/commands/wl-code.md`。
13
-
14
- ## ⚙️ 自取上下文(Quest / QoderWork hook 注入,必须自读)
15
-
16
- - `.qoder/.developer` 当前开发者
17
- - `.qoder/.current-task` — 当前活动任务(找对应的 spec)
18
- - 活动任务的 spec:`workspace/specs/` `workspace/tasks/{id}/spec.md`
19
-
20
- ## 执行
21
-
22
- 1. **加载 Spec**:按 REQ-ID 找 spec;没参数就读 `.qoder/.current-task`
23
- 2. **搜相关代码**:
24
- ```bash
25
- python .qoder/scripts/search_index.py <关键词>
26
- ```
27
- 读相关文件了解现有模式。
28
- 3. **按 spec-coder skill 实现**:严格按 spec,遵循 data/code/ 的团队约定
29
- 4. **自检**:
30
- - [ ] Spec 所有需求都覆盖
31
- - [ ] 无 TODO/FIXME
32
- - [ ] 风格跟周围代码一致
33
- - [ ] 有错误处理
34
- 5. **报告**:告诉用户实现了什么,建议下一步 `/wl-test`
35
-
36
- 详细编码规范见 `.qoder/skills/spec-coder/SKILL.md`。
1
+ ---
2
+ name: wl-code
3
+ description: "按开发 Spec 严格实现代码(/wl-code 命令入口)。Implement code following a Spec strictly. 用户说'开始写代码''按规格实现''实现这个接口''把这个需求做出来'或输入 /wl-code 时触发。需用户确认(DANGEROUS)。"
4
+ trigger: "Spec 已确认待实现;用户说'开始写代码''按spec实现''/wl-code'"
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
+ # wl-code按 Spec 实现代码(/wl-code 命令入口)
17
+
18
+ > 这是 `/wl-code` 命令的 skill 入口。让 QoderWork 的 `/` 列表也能用 `/wl-code`。
19
+ > ⚠️ DANGEROUS 操作(写代码),执行前向用户确认范围。
20
+ > 完整规则见功能型 skill `.qoder/skills/spec-coder/SKILL.md`
21
+ > 和命令 `.qoder/commands/wl-code.md`。
22
+
23
+ ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
24
+
25
+ - `.qoder/.developer` — 当前开发者
26
+ - `.qoder/.current-task` — 当前活动任务(找对应的 spec)
27
+ - 活动任务的 spec:`workspace/specs/` 或 `workspace/tasks/{id}/spec.md`
28
+
29
+ ### 改代码前必查(用知识图谱 MCP,防改崩)
30
+
31
+ 1. **改表影响分析**:涉及改数据库表/Entity 时,先 `mcp__qoder-knowledge-graph__table_impact(table='表名')`
32
+ - 查这张表关联哪些 Entity + 影响哪些 Controller/接口。
33
+ - 例:`table_impact(table='quality_case')` 发现影响 QualityCaseController + 5 个接口。
34
+ - 看完才知道改动波及面,避免改一处崩多处。
35
+ 2. **真实字段核对**:写 Entity/SQL 前 `mcp__qoder-mysql__query_schema(table='表名')`
36
+ - 拿真实列名/类型/注释(含枚举定义),别靠推断。
37
+ - [QAS环境] 表结构与生产一致可放心用。
38
+
39
+ ## 执行
40
+
41
+ 1. **加载 Spec**:按 REQ-ID 找 spec;没参数就读 `.qoder/.current-task`
42
+ 2. **搜相关代码**:
43
+ ```bash
44
+ python "$R/.qoder/scripts/search_index.py" <关键词>
45
+ ```
46
+ 读相关文件了解现有模式。
47
+ 3. **按 spec-coder skill 实现**:严格按 spec,遵循 data/code/ 的团队约定
48
+ 4. **自检**:
49
+ - [ ] Spec 所有需求都覆盖
50
+ - [ ] 无 TODO/FIXME
51
+ - [ ] 风格跟周围代码一致
52
+ - [ ] 有错误处理
53
+ 5. **报告**:告诉用户实现了什么,建议下一步 `/wl-test`
54
+
55
+ 详细编码规范见 `.qoder/skills/spec-coder/SKILL.md`。