@hupan56/wlkj 2.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.
- package/bin/cli.js +213 -0
- package/package.json +11 -0
- package/templates/cli.js +198 -0
- package/templates/qoder/commands/wl-code.md +43 -0
- package/templates/qoder/commands/wl-commit.md +30 -0
- package/templates/qoder/commands/wl-init.md +80 -0
- package/templates/qoder/commands/wl-insight.md +51 -0
- package/templates/qoder/commands/wl-prd.md +199 -0
- package/templates/qoder/commands/wl-report.md +166 -0
- package/templates/qoder/commands/wl-search.md +52 -0
- package/templates/qoder/commands/wl-spec.md +18 -0
- package/templates/qoder/commands/wl-status.md +51 -0
- package/templates/qoder/commands/wl-task.md +71 -0
- package/templates/qoder/commands/wl-test.md +42 -0
- package/templates/qoder/config.toml +5 -0
- package/templates/qoder/config.yaml +141 -0
- package/templates/qoder/hooks/inject-workflow-state.py +117 -0
- package/templates/qoder/hooks/session-start.py +204 -0
- package/templates/qoder/rules/wl-pipeline.md +105 -0
- package/templates/qoder/scripts/add_session.py +245 -0
- package/templates/qoder/scripts/benchmark.py +209 -0
- package/templates/qoder/scripts/build_style_index.py +268 -0
- package/templates/qoder/scripts/code_index.py +41 -0
- package/templates/qoder/scripts/collect_prds.py +31 -0
- package/templates/qoder/scripts/common/__init__.py +0 -0
- package/templates/qoder/scripts/common/active_task.py +230 -0
- package/templates/qoder/scripts/common/atomicio.py +172 -0
- package/templates/qoder/scripts/common/developer.py +161 -0
- package/templates/qoder/scripts/common/eval_api.py +144 -0
- package/templates/qoder/scripts/common/feishu.py +278 -0
- package/templates/qoder/scripts/common/filelock.py +211 -0
- package/templates/qoder/scripts/common/identity.py +285 -0
- package/templates/qoder/scripts/common/mentions.py +134 -0
- package/templates/qoder/scripts/common/paths.py +311 -0
- package/templates/qoder/scripts/common/reqid.py +218 -0
- package/templates/qoder/scripts/common/search_engine.py +205 -0
- package/templates/qoder/scripts/common/task_utils.py +342 -0
- package/templates/qoder/scripts/common/terms.py +234 -0
- package/templates/qoder/scripts/common/utf8.py +38 -0
- package/templates/qoder/scripts/context_pack.py +196 -0
- package/templates/qoder/scripts/eval_prd.py +225 -0
- package/templates/qoder/scripts/export.py +487 -0
- package/templates/qoder/scripts/git_sync.py +1087 -0
- package/templates/qoder/scripts/handoff.py +22 -0
- package/templates/qoder/scripts/init_developer.py +76 -0
- package/templates/qoder/scripts/init_doctor.py +527 -0
- package/templates/qoder/scripts/install_qoderwork.py +339 -0
- package/templates/qoder/scripts/learn.py +67 -0
- package/templates/qoder/scripts/notify.py +5 -0
- package/templates/qoder/scripts/parse_prds.py +33 -0
- package/templates/qoder/scripts/report.py +281 -0
- package/templates/qoder/scripts/role.py +39 -0
- package/templates/qoder/scripts/run_weekly_update.bat +17 -0
- package/templates/qoder/scripts/run_weekly_update.sh +20 -0
- package/templates/qoder/scripts/search_index.py +352 -0
- package/templates/qoder/scripts/setup.py +453 -0
- package/templates/qoder/scripts/setup_weekly_cron.bat +22 -0
- package/templates/qoder/scripts/setup_weekly_cron.sh +19 -0
- package/templates/qoder/scripts/status.py +389 -0
- package/templates/qoder/scripts/syncgate.py +330 -0
- package/templates/qoder/scripts/task.py +954 -0
- package/templates/qoder/scripts/team.py +29 -0
- package/templates/qoder/scripts/team_sync.py +419 -0
- package/templates/qoder/scripts/workspace_init.py +102 -0
- package/templates/qoder/settings.json +53 -0
- package/templates/qoder/skills/design-review/SKILL.md +25 -0
- package/templates/qoder/skills/prd-generator/SKILL.md +180 -0
- package/templates/qoder/skills/prd-review/SKILL.md +36 -0
- package/templates/qoder/skills/prototype-generator/SKILL.md +141 -0
- package/templates/qoder/skills/spec-coder/SKILL.md +69 -0
- package/templates/qoder/skills/spec-generator/SKILL.md +67 -0
- package/templates/qoder/skills/test-generator/SKILL.md +72 -0
- package/templates/qoder/skills/wl-commit/SKILL.md +76 -0
- package/templates/qoder/skills/wl-init/SKILL.md +67 -0
- package/templates/qoder/skills/wl-insight/SKILL.md +81 -0
- package/templates/qoder/skills/wl-report/SKILL.md +87 -0
- package/templates/qoder/skills/wl-search/SKILL.md +75 -0
- package/templates/qoder/skills/wl-status/SKILL.md +61 -0
- package/templates/qoder/skills/wl-task/SKILL.md +58 -0
- package/templates/qoder/templates/prd-full-template.md +103 -0
- package/templates/qoder/templates/prd-quick-template.md +69 -0
- package/templates/qoder/templates/prototype-app.html +344 -0
- package/templates/qoder/templates/prototype-web.html +310 -0
- package/templates/root/AGENTS.md +182 -0
- package/templates/root/README-pipeline.md +56 -0
- package/templates/root/ROLES.md +85 -0
- package/templates/root//346/226/260/346/211/213/346/214/207/345/215/227.md +186 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prd-generator
|
|
3
|
+
description: "生成 PRD + 平台匹配的原型。Generate PRD with platform-aware prototype. 用户说'写个需求''生成PRD''做个原型''保单这块加个功能''写个产品需求文档'时触发。"
|
|
4
|
+
trigger: "user describes a requirement, asks for PRD, mockup, or invokes /wl-prd"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PRD Generator Skill
|
|
8
|
+
|
|
9
|
+
## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
|
|
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` 重建)
|
|
15
|
+
|
|
16
|
+
读完后再判断是否要问平台(见 Step 0)。如果 `.developer` 不存在,先提示用户
|
|
17
|
+
"还没初始化,建议先说'初始化'(/wl-init)注册开发者身份",但不要阻塞。
|
|
18
|
+
|
|
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.**
|
|
25
|
+
|
|
26
|
+
**Copy and ask this exact question:**
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
这个需求是针对哪个平台?
|
|
30
|
+
|
|
31
|
+
1. **Web 管理端** (fywl-ui) - Ant Design Vue + VxeGrid 风格
|
|
32
|
+
2. **APP 移动端** (Carmg-H5) - Vant 风格
|
|
33
|
+
3. **两端都要**
|
|
34
|
+
|
|
35
|
+
请选择 (1/2/3):
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Then WAIT for user answer before proceeding.**
|
|
39
|
+
|
|
40
|
+
### Platform → Project Mapping
|
|
41
|
+
|
|
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
|
+
```bash
|
|
52
|
+
/wl-search <keyword> --platform web # For Web
|
|
53
|
+
/wl-search <keyword> --platform app # For APP
|
|
54
|
+
/wl-search <keyword> # For Both
|
|
55
|
+
```
|
|
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
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prd-review
|
|
3
|
+
description: "评审 PRD 完整性与质量。Review PRD for completeness and quality. 用户说'评审PRD''PRD质量怎么样''检查一下这个需求文档'时触发。"
|
|
4
|
+
trigger: "user invokes /review prd, asks to review/check PRD quality, or PM submits PRD"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PRD Review Skill
|
|
8
|
+
|
|
9
|
+
## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
|
|
10
|
+
|
|
11
|
+
- `.qoder/.developer` — 当前评审人
|
|
12
|
+
- `data/index/.index-meta.json` — 图谱新鲜度(影响"现实锚定"能否校验)
|
|
13
|
+
- 评审的 PRD 文件路径由用户指定;若用户没给路径,扫 `data/docs/prd/` 和
|
|
14
|
+
`workspace/members/{dev}/drafts/` 列出最近的 PRD 让用户选
|
|
15
|
+
|
|
16
|
+
## 评审检查项 (Checklist)
|
|
17
|
+
- [ ] 用户故事清晰
|
|
18
|
+
- [ ] 验收标准可测(Given-When-Then)
|
|
19
|
+
- [ ] 优先级已标(P0/P1/P2/P3)
|
|
20
|
+
- [ ] 模块/领域已识别
|
|
21
|
+
- [ ] 非功能性需求已列
|
|
22
|
+
- [ ] 边界情况已考虑(每个功能 ≥2 个异常场景)
|
|
23
|
+
- [ ] 依赖已识别
|
|
24
|
+
|
|
25
|
+
## 评审输出
|
|
26
|
+
|
|
27
|
+
报告:PASS 或 列出需修复的问题清单
|
|
28
|
+
若 PASS:更新任务状态为 prd_review passed
|
|
29
|
+
|
|
30
|
+
## 自动化校验(推荐)
|
|
31
|
+
|
|
32
|
+
跑一次 EVA 门禁给出客观分数:
|
|
33
|
+
```bash
|
|
34
|
+
python .qoder/scripts/eval_prd.py <PRD路径> [原型HTML路径]
|
|
35
|
+
```
|
|
36
|
+
分数 ≥80% 才能发布。低于 80% 把 EVA 报告的问题合并进上面的清单。
|
|
@@ -0,0 +1,141 @@
|
|
|
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`)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-coder
|
|
3
|
+
description: "严格按开发 Spec 实现代码。Implement code strictly following development Spec. 用户说'开始写代码''按规格实现''实现这个接口''把这个需求做出来'时触发。需用户确认(DANGEROUS)。"
|
|
4
|
+
trigger: "Spec 已确认待实现时;用户说'开始写代码''按spec实现''/wl-code'"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Spec Coder
|
|
8
|
+
|
|
9
|
+
严格按开发 Spec 实现代码,生成符合团队规范的代码。
|
|
10
|
+
|
|
11
|
+
> ⚠️ 这是 DANGEROUS 操作(会写源码)。执行前必须向用户确认。
|
|
12
|
+
|
|
13
|
+
## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
|
|
14
|
+
|
|
15
|
+
- `.qoder/.developer` — 当前开发者
|
|
16
|
+
- `.qoder/.current-task` — 当前任务(含任务相关的 Spec 路径)
|
|
17
|
+
- Spec 文件位置:`workspace/specs/REQ-{ID}-*.spec.md` 或 `workspace/tasks/{task-id}/spec.md`
|
|
18
|
+
- 目标代码库:`data/code/`(fywl-ics 后端 / fywl-ui 前端 / Carmg-H5 移动端)
|
|
19
|
+
|
|
20
|
+
## Step 1: 定位 Spec
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
ls workspace/specs/ # 全局 specs
|
|
24
|
+
ls workspace/tasks/ # 任务内的 specs
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
如有多份 Spec,问用户现在实现哪一份。
|
|
28
|
+
|
|
29
|
+
## Step 2: 读取上下文
|
|
30
|
+
|
|
31
|
+
1. **Spec 文件**(必需):开发规格
|
|
32
|
+
2. **PRD 文件**(推荐):原始需求,理解业务背景
|
|
33
|
+
3. **现有代码风格**(必需):用 search_index.py 找相关模块真实代码作参考
|
|
34
|
+
```bash
|
|
35
|
+
python .qoder/scripts/search_index.py <模块关键词>
|
|
36
|
+
```
|
|
37
|
+
读 top 2-3 个相似文件,照着它们的命名/结构/异常处理写
|
|
38
|
+
4. **架构/数据字典**(如存在):`.qoder/context/architecture.md`、`data-dictionary.md`
|
|
39
|
+
不存在就跳过,从现有代码推断
|
|
40
|
+
|
|
41
|
+
## Step 3: 按 Spec 实现
|
|
42
|
+
|
|
43
|
+
严格按 Spec 规格编码:
|
|
44
|
+
- **数据层**: Entity → Mapper → Service → Controller
|
|
45
|
+
- **接口层**: RESTful API,参数校验(JSR-303),统一 `Result<T>` 返回格式
|
|
46
|
+
- **业务层**: 按 Spec 业务逻辑实现
|
|
47
|
+
- **异常处理**: 按 Spec 定义的异常场景
|
|
48
|
+
- **金额**: 一律 `BigDecimal`,不用 double/float
|
|
49
|
+
|
|
50
|
+
## Step 4: 自检
|
|
51
|
+
|
|
52
|
+
- 所有 Spec 定义的接口都已实现
|
|
53
|
+
- 数据库字段与 Spec 一致
|
|
54
|
+
- 命名/结构跟现有同类代码一致(不另起炉灶)
|
|
55
|
+
- 无 TODO/FIXME 残留
|
|
56
|
+
|
|
57
|
+
## Step 5: 提示生成测试
|
|
58
|
+
|
|
59
|
+
实现完成后提示:
|
|
60
|
+
```
|
|
61
|
+
代码实现完成。说"写单元测试"可生成单元测试;说"提交"可走 commit 流程。
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 编码原则
|
|
65
|
+
|
|
66
|
+
1. 先读后写(读现有代码再动手)
|
|
67
|
+
2. Spec 是契约,严格实现
|
|
68
|
+
3. 发现 Spec 问题提出建议,不自行修改
|
|
69
|
+
4. 命名/风格跟周围代码走,不引入新范式
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-generator
|
|
3
|
+
description: "从已确认的 PRD 自动生成开发 Spec 文档(技术规格说明)。Auto-generate development Spec documents from confirmed PRDs. 用户说'生成规格''写spec''出技术方案''把PRD转成开发文档'时触发。"
|
|
4
|
+
trigger: "PRD 被确认/发布后自动触发;或用户说'生成Spec''写技术规格''/wl-spec'"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Spec Generator
|
|
8
|
+
|
|
9
|
+
从已确认的 PRD 生成开发 Spec 文档,遵循团队技术规范。
|
|
10
|
+
|
|
11
|
+
## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
|
|
12
|
+
|
|
13
|
+
- `.qoder/.developer` — 当前开发者
|
|
14
|
+
- `.qoder/.current-task` — 当前任务(决定 spec 存到哪个 task 目录)
|
|
15
|
+
- 扫描 PRD 来源目录:`data/docs/prd/`(已发布)+ `workspace/members/{dev}/drafts/REQ-*.md`(草稿)
|
|
16
|
+
找出还没有对应 Spec 的 PRD
|
|
17
|
+
- 风格/字段参考:`python .qoder/scripts/search_index.py --field <字段名>` 查现有字段命名约定
|
|
18
|
+
- 团队 Java 约定(MyBatis Plus + RESTful + BigDecimal 金额)写在本 skill 的 Step 3
|
|
19
|
+
|
|
20
|
+
## Step 1: 定位 PRD
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 列出已发布的 PRD
|
|
24
|
+
ls data/docs/prd/REQ-*.md
|
|
25
|
+
# 列出当前开发者的草稿 PRD
|
|
26
|
+
ls workspace/members/{developer}/drafts/REQ-*.md
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
找出"有 PRD 但无 Spec"的需求。如果有多份,问用户先做哪个。
|
|
30
|
+
|
|
31
|
+
## Step 2: 读取上下文
|
|
32
|
+
|
|
33
|
+
按优先级读取:
|
|
34
|
+
1. **PRD 文件**(必需):需求源
|
|
35
|
+
2. **历史 Spec**(推荐):扫 `workspace/specs/` 看同类需求的写法,照着写
|
|
36
|
+
3. **现有代码风格**(推荐):用 search_index.py 找相关模块的真实代码做参考
|
|
37
|
+
4. **数据字典**(如有):`.qoder/context/data-dictionary.md`(不存在则跳过,从现有 Entity 类推断)
|
|
38
|
+
|
|
39
|
+
## Step 3: 分析并生成
|
|
40
|
+
|
|
41
|
+
从 PRD 提取:
|
|
42
|
+
- 每个用户故事 → 一个或多个 API 接口
|
|
43
|
+
- 验收标准 → 接口入参/出参/错误场景
|
|
44
|
+
- 数据需求 → 数据库表设计
|
|
45
|
+
- 非功能性需求 → 约束章节
|
|
46
|
+
|
|
47
|
+
## Step 4: 输出
|
|
48
|
+
|
|
49
|
+
写到 `workspace/specs/REQ-{ID}-{module}.spec.md`(或 task 目录 `workspace/tasks/{task-id}/spec.md`)
|
|
50
|
+
|
|
51
|
+
规则:
|
|
52
|
+
- 每条 PRD 验收标准都映射到一个 Spec 测试用例
|
|
53
|
+
- API 路径遵循 RESTful 约定
|
|
54
|
+
- 表名遵循 `t_{module}_{entity}`
|
|
55
|
+
- 金额字段必须用 `BigDecimal`
|
|
56
|
+
- 不写 PRD 未定义的功能
|
|
57
|
+
- Entity → Mapper → Service → Controller 全栈结构
|
|
58
|
+
|
|
59
|
+
## Step 5: 通知
|
|
60
|
+
|
|
61
|
+
报告给被分配的开发者评审。
|
|
62
|
+
|
|
63
|
+
## 触发条件
|
|
64
|
+
|
|
65
|
+
- 手动:用户说"生成 Spec"、"写技术规格"、"/wl-spec"
|
|
66
|
+
- 任务驱动:PRD 评审通过后,下一步通常就是生成 Spec
|
|
67
|
+
- 子 agent:可被 prd-generator 在 PRD 确认后调度
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-generator
|
|
3
|
+
description: "从已实现代码和 Spec 自动生成单元测试。Auto-generate unit tests from implemented code and Spec. 用户说'写单元测试''补测试''覆盖一下''写个test'时触发。需用户确认(DANGEROUS)。"
|
|
4
|
+
trigger: "代码实现完成后;用户说'写测试''补单测''生成test''/wl-test'"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Test Generator
|
|
8
|
+
|
|
9
|
+
按团队规范,基于已实现代码和 Spec 生成单元测试。
|
|
10
|
+
|
|
11
|
+
> ⚠️ 这是 DANGEROUS 操作(会写源码)。执行前必须向用户确认。
|
|
12
|
+
|
|
13
|
+
## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
|
|
14
|
+
|
|
15
|
+
- `.qoder/.developer` — 当前开发者
|
|
16
|
+
- `.qoder/.current-task` — 当前任务
|
|
17
|
+
- Spec 文件:`workspace/specs/REQ-{ID}-*.spec.md` 或 `workspace/tasks/{task-id}/spec.md`
|
|
18
|
+
- 已实现代码:用 search_index.py 定位
|
|
19
|
+
```bash
|
|
20
|
+
python .qoder/scripts/search_index.py <类名或模块关键词>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Step 1: 定位待测代码
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
ls workspace/specs/REQ-{ID}-*.md # Spec 文件(测试用例映射源)
|
|
27
|
+
ls data/code/ # 已实现代码库
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
把 Spec 匹配到对应的实现文件。
|
|
31
|
+
|
|
32
|
+
## Step 2: 读取上下文
|
|
33
|
+
|
|
34
|
+
1. **实现代码**(必需):当前需求相关的 `data/code/` 文件
|
|
35
|
+
2. **Spec 文件**(推荐):测试用例映射来源
|
|
36
|
+
3. **现有测试代码**(推荐):用 search_index.py 找同类 Test 类,照着写
|
|
37
|
+
```bash
|
|
38
|
+
python .qoder/scripts/search_index.py Test
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Step 3: 生成测试
|
|
42
|
+
|
|
43
|
+
参照现有 Test 类的写法(命名、断言库、Mock 方式),不另起炉灶:
|
|
44
|
+
|
|
45
|
+
### Service 层测试
|
|
46
|
+
- 每个公开方法组一个测试类
|
|
47
|
+
- Mock 所有外部依赖(Mapper、外部 Service、Redis 等)
|
|
48
|
+
- 覆盖:正常路径、错误路径、边界条件
|
|
49
|
+
|
|
50
|
+
### Controller 层测试
|
|
51
|
+
- MockMvc 测端点
|
|
52
|
+
- 校验参数校验
|
|
53
|
+
- 校验返回格式
|
|
54
|
+
|
|
55
|
+
### 测试方法约定
|
|
56
|
+
- Given-When-Then 模式
|
|
57
|
+
- `@DisplayName` 中文描述
|
|
58
|
+
- 断言用 AssertJ(若现有代码用 JUnit 断言则跟随)
|
|
59
|
+
- 测试数据用 Builder 模式
|
|
60
|
+
|
|
61
|
+
## Step 4: 输出
|
|
62
|
+
|
|
63
|
+
- 路径:`tests/{package-path}/{ClassName}Test.java`(跟随现有 test 目录结构)
|
|
64
|
+
- 命名:`{TestedClassName}Test.java`
|
|
65
|
+
- 每个测试方法独立(无执行顺序依赖)
|
|
66
|
+
|
|
67
|
+
## 测试原则
|
|
68
|
+
|
|
69
|
+
1. 正常路径 100%,错误路径 100%
|
|
70
|
+
2. 核心业务边界条件全覆盖
|
|
71
|
+
3. 无外部系统依赖(全 Mock)
|
|
72
|
+
4. 测试方法之间无相互依赖
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wl-commit
|
|
3
|
+
description: "代码提交 + push + 同步,带质量门禁。Git commit + push + sync with pre-commit quality gate. 用户说'提交代码''commit''推上去''保存代码''提交一下'时触发。需用户确认(DANGERONS)。"
|
|
4
|
+
trigger: "用户说'提交''commit''推上去''保存代码''提交一下''/wl-commit'"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# wl-commit — 代码提交 + 质量门禁 + 同步
|
|
8
|
+
|
|
9
|
+
> ⚠️ DANGEROUS 操作(推代码到远端)。**执行前必须向用户确认提交信息。**
|
|
10
|
+
> 注意区分:用户说"同步/保存产出"通常指 team_sync(推 PRD/任务/索引);
|
|
11
|
+
> 用户说"提交/commit 代码"才是本 skill(推源码改动)。
|
|
12
|
+
|
|
13
|
+
## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
|
|
14
|
+
|
|
15
|
+
- `.qoder/.developer` — 当前开发者(提交作者)
|
|
16
|
+
- 当前工作目录的 `git status` 和 `git diff --stat` 看改了什么
|
|
17
|
+
- `.qoder/.current-task` — 若有活动任务,提交信息关联任务 ID
|
|
18
|
+
|
|
19
|
+
## 执行流程
|
|
20
|
+
|
|
21
|
+
### Step 1: 看改动
|
|
22
|
+
```bash
|
|
23
|
+
git status
|
|
24
|
+
git diff --stat
|
|
25
|
+
git diff --cached --stat
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Step 2: 质量门禁(提交前自检)
|
|
29
|
+
|
|
30
|
+
逐项检查,任何一项不过都暂停问用户:
|
|
31
|
+
- [ ] 无 TODO / FIXME 残留(grep 一下)
|
|
32
|
+
- [ ] 金额字段用了 BigDecimal(不出现 double/float 存钱)
|
|
33
|
+
- [ ] 命名/风格跟周围代码一致
|
|
34
|
+
- [ ] 若有对应 Spec:Spec 要求的接口/字段都覆盖了
|
|
35
|
+
- [ ] 测试通过(如有测试)
|
|
36
|
+
|
|
37
|
+
### Step 3: 生成提交信息
|
|
38
|
+
|
|
39
|
+
按团队约定:
|
|
40
|
+
```
|
|
41
|
+
[ai-generated] <type>: <简述>
|
|
42
|
+
|
|
43
|
+
<body 说明动机和关键改动>
|
|
44
|
+
```
|
|
45
|
+
type 选 feat / fix / refactor / docs / test / chore。
|
|
46
|
+
|
|
47
|
+
### Step 4: 用户确认
|
|
48
|
+
|
|
49
|
+
把"将要提交的文件 + 生成的 commit message"展示给用户,等确认。
|
|
50
|
+
**用户没明确说"提交/确认"之前,不要真的 commit。**
|
|
51
|
+
|
|
52
|
+
### Step 5: 提交 + 推送
|
|
53
|
+
```bash
|
|
54
|
+
git add <相关文件> # 精确 add,不用 git add .
|
|
55
|
+
git commit -m "<确认后的信息>"
|
|
56
|
+
git pull --rebase # 先拉远端
|
|
57
|
+
git push
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Step 6: 记录学习
|
|
61
|
+
|
|
62
|
+
把本次提交记入 `.qoder/learning/`(用于 /wl-report 和 /wl-status 统计)。
|
|
63
|
+
|
|
64
|
+
## 与 team_sync 的区别(重要)
|
|
65
|
+
|
|
66
|
+
| 场景 | 用什么 |
|
|
67
|
+
|------|--------|
|
|
68
|
+
| 提交**源码**改动(data/code/ 下的代码) | **wl-commit**(本 skill) |
|
|
69
|
+
| 提交**产出**(PRD/任务/索引/原型) | `team_sync.py push` |
|
|
70
|
+
| 两个都改了 | 先 wl-commit 推代码,再 team_sync push 推产出 |
|
|
71
|
+
|
|
72
|
+
## 失败处理
|
|
73
|
+
|
|
74
|
+
- `git push` 被拒(远端有新提交)→ `git pull --rebase` 解决后再推
|
|
75
|
+
- 冲突 → 列出冲突文件,问用户怎么解决(不擅自改业务代码)
|
|
76
|
+
- 质量门禁不过 → 列出问题,问用户是修复后提交还是强制提交(默认修复)
|