@hupan56/wlkj 2.3.4 → 2.4.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.
@@ -6,175 +6,94 @@ trigger: "user describes a requirement, asks for PRD, mockup, or invokes /wl-prd
6
6
 
7
7
  # PRD Generator Skill
8
8
 
9
- ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
9
+ ## 性能原则(最重要的规则)
10
10
 
11
- 会话开始时先读这 3 个文件(不存在就跳过,不要报错中断):
12
- - `.qoder/.developer` 当前开发者名(key=value 格式,用于产出存到 `workspace/members/{dev}/drafts/`)
13
- - `.qoder/.current-task` 当前活动任务(决定 PRD 关联哪个 task)
14
- - `data/index/.index-meta.json` 知识图谱新鲜度(过期要提示先 `/wl-init` 重建)
11
+ 1. **最少轮次**: Quick <=5 轮, Reference <=10 轮。不要 60 轮"深度思考"
12
+ 2. **一次取全**: context_pack 一次拿全上下文,不要逐个 search(5-6 次变 1 次)
13
+ 3. **批量生成**: PRD + 原型一次 Write 写完,不分两轮
14
+ 4. **不重复读**: 模板已有正确颜色(vben-style / Vant),不要单独读 style JSON
15
+ 5. **并行调用**: 独立操作放一个消息里并行(如同时 Read 2 个文件)
16
+ 6. **Quick 跳过**: EVA / 历史 PRD / 网络搜索 / style JSON
15
17
 
16
- 读完后再判断是否要问平台(见 Step 0)。如果 `.developer` 不存在,先提示用户
17
- "还没初始化,建议先说'初始化'(/wl-init)注册开发者身份",但不要阻塞。
18
+ ## 自取上下文(Quest / QoderWork 无 hook,必须自读)
18
19
 
19
- ---
20
-
21
- ## ⚠️ STEP 0: MANDATORY PLATFORM SELECTION (MUST DO FIRST!)
22
-
23
- **CRITICAL: You MUST ask this question BEFORE doing ANYTHING else.**
24
- **NEVER auto-detect. NEVER assume. NEVER skip. ALWAYS ASK.**
20
+ - `.qoder/.developer` — 当前开发者名
21
+ - `.qoder/.current-task` — 当前活动任务
22
+ - `data/index/.index-meta.json` 知识图谱新鲜度
25
23
 
26
- **Copy and ask this exact question:**
24
+ ## STEP 0: 必须先问平台
27
25
 
28
26
  ```
29
27
  这个需求是针对哪个平台?
30
-
31
- 1. **Web 管理端** (fywl-ui) - Ant Design Vue + VxeGrid 风格
32
- 2. **APP 移动端** (Carmg-H5) - Vant 风格
33
- 3. **两端都要**
34
-
28
+ 1. Web 管理端 (fywl-ui) - Ant Design Vue + VxeGrid 风格
29
+ 2. APP 移动端 (Carmg-H5) - Vant 风格
30
+ 3. 两端都要
35
31
  请选择 (1/2/3):
36
32
  ```
33
+ 等用户回答。绝不自动判断。
37
34
 
38
- **Then WAIT for user answer before proceeding.**
35
+ | 回答 | 平台 | 项目 | 原型模板 |
36
+ |------|------|------|---------|
37
+ | 1 | Web | fywl-ui | prototype-web.html |
38
+ | 2 | APP | Carmg-H5 | prototype-app.html |
39
+ | 3 | Both | Both | 两个模板 |
39
40
 
40
- ### Platform Project Mapping
41
+ ## 取上下文 一次取全(不要逐个搜)
41
42
 
42
- | User Answer | Platform | Project | Component Library | Template |
43
- |-------------|----------|---------|-------------------|----------|
44
- | 1 或 Web/PC/管理端 | Web | fywl-ui | Ant Design Vue + VxeGrid | prototype-web.html |
45
- | 2 或 APP/H5/移动端 | APP | Carmg-H5 | Vant 3 + Element Plus | prototype-app.html |
46
- | 3 或 都要/两端 | Both | Both | Generate 2 prototypes | Both templates |
47
-
48
- ### Search Command
49
-
50
- After user selects platform, use:
51
43
  ```bash
52
- /wl-search <keyword> --platform web # For Web
53
- /wl-search <keyword> --platform app # For APP
54
- /wl-search <keyword> # For Both
44
+ python .qoder/scripts/context_pack.py <关键词> --platform <web|app>
55
45
  ```
56
-
57
- ---
58
-
59
- ## How Each Mode Reads Data
60
-
61
- ### Reference Mode (DEFAULT)
62
- 1. **ASK PLATFORM FIRST** (Step 0 above)
63
- 2. search_index.py <keyword> --platform <web|app>
64
- 3. search_index.py --style <type> --platform <web|app>
65
- 4. search_index.py --field <name>
66
- 5. Read data/docs/prd/ for historical PRDs
67
- 6. Read data/docs/drafts/ for business context
68
- 7. Style tokens: Web -> data/index/vben-style-reference.json, APP -> Vant
69
- variables. Only open data/style/ PDFs if a token is missing from JSON.
70
- 8. Read top 2-3 similar Vue files from CORRECT project
71
- 9. Present ALL findings as ONE numbered list, confirm in a single round
72
- (batch, not one question per finding)
73
- 10. Generate PRD with product-type template
74
- 11. Generate interactive HTML prototype matching TARGET platform style
75
-
76
- ### Brainstorm Mode
77
- 1. **ASK PLATFORM FIRST** (Step 0 above)
78
- 2. SCAMPER 7 dimensions
79
- 3. 5-Why root cause analysis
80
- 4. Dispatch N sub-agents (web search only)
81
- 5. Read existing code from TARGET platform for style extraction
82
- 6. Generate PRD + prototype (platform-specific)
83
-
84
- ### Planning Mode
85
- 1. **ASK PLATFORM FIRST** (Step 0 above)
86
- 2. search_index.py for current implementation (platform-aware)
87
- 3. Web search for ideal state
88
- 4. Gap analysis table
89
- 5. Generate PRD + prototype (platform-specific)
90
-
91
- ### Quick Mode
92
- 1. **ASK PLATFORM FIRST** (Step 0 above)
93
- 2. search_index.py to locate code (platform-aware)
94
- 3. Generate Mini-PRD + quick prototype (platform-specific)
95
-
96
- ---
97
-
98
- ## Platform-Specific Style Sources
99
-
100
- ### Web 管理端 (fywl-ui)
101
- ```
102
- 样式来源: data/index/vben-style-reference.json
103
- 组件库: Ant Design Vue + VxeGrid
104
- 设计 Token: Vben Admin HSL 变量
105
- 关键文件: data/code/fywl-ui/apps/xxx/index.vue
106
- 原型模板: .qoder/templates/prototype-web.html
107
- ```
108
-
109
- **CSS Variables (Web):**
110
- ```css
111
- --primary: 212 100% 45%; /* 蓝色 */
112
- --destructive: 359.33 100% 65.1%; /* 红色 */
113
- --success: 144 57% 58%; /* 绿色 */
114
- --background-deep: 216 20.11% 95.47%; /* 灰底 */
115
- ```
116
-
117
- ### APP 移动端 (Carmg-H5)
118
- ```
119
- 样式来源: data/code/Carmg-H5/src/
120
- 组件库: Vant 3 + Element Plus
121
- 适配: postcss-px-to-viewport (vw) + lib-flexible (rem)
122
- 关键文件: data/code/Carmg-H5/src/modules/xxx/index.vue
123
- 原型模板: .qoder/templates/prototype-app.html
124
- ```
125
-
126
- **Design Tokens (APP):**
127
- ```css
128
- --van-primary-color: #1989fa;
129
- --van-success-color: #07c160;
130
- --van-warning-color: #ff976a;
131
- --van-danger-color: #ee0a24;
132
- max-width: 375px; /* 移动端基准 */
133
- ```
134
-
135
- ---
136
-
137
- ## Prototype Generation Rules
138
-
139
- ### Required Features
140
- - Style matches TARGET platform EXACTLY
141
- - Changed/new elements highlighted with subtle border
142
- - Interactive: clickable buttons, fillable forms
143
- - Single HTML file, self-contained
144
- - **Web**: Desktop layout, sidebar navigation
145
- - **APP**: Mobile layout, bottom tab bar, 375px width
146
-
147
- ### Style Priority (when conflicts)
148
- 1. Real .vue files in project (HIGHEST)
149
- 2. data/style/ PDF specs
150
- 3. vben-style-reference.json (framework default)
151
- 4. If PDF vs Code conflict → **Code wins**
152
-
153
- ---
154
-
155
- ## PRD Templates (团队标准, MUST USE)
156
-
157
- Distilled from data/docs/constitution/prdtemplate/*.docx (团队章程源文件):
158
-
159
- | Mode | Template | Rule |
160
- |------|----------|------|
161
- | Reference / Brainstorm / Planning | .qoder/templates/prd-full-template.md | 所有章节必须保留(不适用写"无") |
162
- | Quick | .qoder/templates/prd-quick-template.md | 改动要素涉及则填,章节标题保留 |
163
-
164
- Read the template file, fill it with the findings. The 10-point quality
165
- check below maps to the template's 自检 section. If the .docx 源文件更新了,
166
- re-distill the .md templates (wl-init doctor 会提示).
167
-
168
- ---
169
-
170
- ## Quality Self-Check (10 Items)
171
- 1. Background answers "why"
172
- 2. Goals are quantifiable
173
- 3. User personas specific
174
- 4. Business rules exhaustive
175
- 5. Exceptions covered (2+ per feature)
176
- 6. AC testable (Given-When-Then)
177
- 7. Data events complete
178
- 8. No tech implementation in PRD
179
- 9. Priority tagged (P0/P1/P2)
180
- 10. Schedule grounded
46
+ 返回 7 章节(代码+页面+字段+PRD+API+样式+Wiki)。**只读最相关 1-2 个 Vue 文件**。
47
+
48
+ ## 五种模式
49
+
50
+ ### Reference(默认 — 直接说需求)
51
+ 1. 问平台
52
+ 2. context_pack 一次取全
53
+ 3. 1-2 Vue 文件
54
+ 4. 一次性确认发现
55
+ 5. **一次 Write** PRD + 原型
56
+ 6. EVA 评估 + 确认发布
57
+
58
+ ### Quick(快速 "快速""加个字段""小改动")
59
+ 1. 问平台
60
+ 2. context_pack 一次取全
61
+ 3. **一次 Write** Mini-PRD + 微型原型
62
+ 4. 一句话确认 push
63
+ > 跳过:EVA / 历史 PRD / 搜索 / style JSON
64
+
65
+ ### Discuss(探讨 — "探讨""聊聊""分析")
66
+ 1. 听需求
67
+ 2. 问关键问题(痛点/谁用/现状/目标)
68
+ 3. 2-3 个方向建议
69
+ > 不出文件。聊完说"出PRD"转 Reference
70
+
71
+ ### Brainstorm(头脑风暴)
72
+ 1. 问平台
73
+ 2. SCAMPER + 多 agent 调研
74
+ 3. 生成 PRD + 原型
75
+
76
+ ### Planning(规划)
77
+ 1. 问平台
78
+ 2. 现状 + 理想态 + Gap + MVP
79
+ 3. 生成 PRD + 原型
80
+
81
+ ## 原型规则
82
+
83
+ - 从模板开始(`.qoder/templates/prototype-{web|app}.html`),模板已有正确颜色
84
+ - **不要单独读 vben-style-reference.json** 模板里 CSS 变量已配好
85
+ - 只改 diff 部分,新功能高亮
86
+ - 单 HTML 文件,可交互
87
+ - Web: 桌面布局 + 侧边栏;APP: 375px + 底部 tab
88
+
89
+ ## PRD 模板
90
+
91
+ | 模式 | 模板 |
92
+ |------|------|
93
+ | Reference/Brainstorm/Planning | `.qoder/templates/prd-full-template.md` |
94
+ | Quick | `.qoder/templates/prd-quick-template.md` |
95
+
96
+ ## 质量自检(10 项,Quick 跳过)
97
+ 1. 背景回答"为什么" 2. 目标可量化 3. 用户画像具体
98
+ 4. 业务规则完整 5. 异常覆盖(2+) 6. 验收可测(Given-When-Then)
99
+ 7. 数据事件完整 8. PRD 无技术实现 9. 优先级标注 10. 排期合理
@@ -38,10 +38,22 @@ trigger: "用户描述需求、要 PRD、要原型、要 mockup,或直接 /wl-
38
38
  - `.qoder/.current-task` — 当前活动任务
39
39
  - `data/index/.index-meta.json` — 知识图谱新鲜度(过期提示先 `/wl-init`,不阻塞)
40
40
 
41
- ## 完整流程
41
+ ## 五种模式(看用户怎么说自动选)
42
42
 
43
- `.qoder/commands/wl-prd.md` 执行(含 Reference/Brainstorm/Planning/Quick
44
- 四种模式)。核心步骤:
43
+ | 用户怎么说 | 模式 | 出PRD? | 出原型? |
44
+ |-----------|------|---------|---------|
45
+ | 直接说需求(默认) | Reference 参考 | ✅ | ✅ |
46
+ | "探讨""聊聊""分析一下""不知道怎么做" | **Discuss 探讨** | ❌ | ❌ |
47
+ | "头脑风暴""brainstorm" | Brainstorm 头脑风暴 | ✅ | ✅ |
48
+ | "规划""plan" | Planning 规划 | ✅ | ✅ |
49
+ | "快速""quick""加个字段" | Quick 快速 | ✅ | ✅ |
50
+
51
+ > **探讨模式**:纯讨论,理需求、拆问题、给方向建议。不出文件。
52
+ > 讨论完用户说"出PRD"→ 自动转参考模式。
53
+
54
+ ## 完整流程(Reference/Brainstorm/Planning/Quick 模式)
55
+
56
+ 按 `.qoder/commands/wl-prd.md` 执行。核心步骤:
45
57
 
46
58
  1. **一次取全上下文**(fast path):
47
59
  ```bash