@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.
@@ -0,0 +1,630 @@
1
+ # wlkj 工作流 —— 完整命令与操作指南
2
+
3
+ > **版本**:`@hupan56/wlkj@2.3.3`
4
+ > **适用**:Qoder IDE / Quest / QoderWork / 任何终端
5
+ > **对象**:产品经理、开发者、新用户(不需要懂 git / Python)
6
+ >
7
+ > 本文档涵盖**从零安装到日常使用的全部命令和操作**。
8
+
9
+ ---
10
+
11
+ ## 目录
12
+
13
+ 1. [前置环境安装](#1-前置环境安装)
14
+ 2. [初始化](#2-初始化)
15
+ 3. [升级](#3-升级)
16
+ 4. [日常使用:在 Qoder 里](#4-日常使用在-qoder-里)
17
+ 5. [日常使用:在终端里](#5-日常使用在终端里)
18
+ 6. [代码搜索(10 种模式)](#6-代码搜索10-种模式)
19
+ 7. [PRD 生成(4 种模式 + 评估)](#7-prd-生成4-种模式--评估)
20
+ 8. [任务管理(13 个子命令)](#8-任务管理13-个子命令)
21
+ 9. [报告与导出](#9-报告与导出)
22
+ 10. [团队协作与冲突处理](#10-团队协作与冲突处理)
23
+ 11. [QoderWork 桌面端](#11-qoderwork-桌面端)
24
+ 12. [故障排查](#12-故障排查)
25
+ 13. [命令速查表](#13-命令速查表)
26
+
27
+ ---
28
+
29
+ ## 1. 前置环境安装
30
+
31
+ ### 1.1 只需装一样:Node.js
32
+
33
+ `npx` 是 Node.js 自带的。没有 Node.js 跑不了 `npx`。
34
+
35
+ | 系统 | 怎么装 |
36
+ |------|--------|
37
+ | **Windows** | 打开 https://nodejs.org → 下载 **LTS 版** → 双击安装,一路下一步 → **重新打开终端** |
38
+ | **Mac** | `brew install node` 或去 nodejs.org 下载 .pkg |
39
+ | **Linux** | `curl -fsSL https://deb.nodesource.com/setup_lts.x \| sudo -E bash - && sudo apt install -y nodejs` |
40
+
41
+ 验证:
42
+ ```bash
43
+ node --version # 看到 v20.x.x 或更高
44
+ ```
45
+
46
+ > **注**:装完 Node.js **必须重新打开终端窗口**,否则 `npx` 命令找不到。
47
+
48
+ ### 1.2 自动装其余(Python + git)
49
+
50
+ ```bash
51
+ npx @hupan56/wlkj install-env
52
+ ```
53
+ > **作用**:检测并自动安装 Python(引擎需要)和 git(团队同步需要)。
54
+ > 用 winget(Win)/ brew(Mac)/ apt(Linux)自动装。
55
+ > **三个都已装** → 全部跳过,不做任何事。
56
+
57
+ 只检测不装:
58
+ ```bash
59
+ npx @hupan56/wlkj install-env --check
60
+ ```
61
+ > **输出**:`Node.js: [OK] v20.x` / `Python: [OK] 3.x` / `git: [OK] 2.x`
62
+ > 三个 `[OK]` 就可以往下走了。
63
+
64
+ ### 1.3 装到非 C 盘(可选)
65
+
66
+ ```bash
67
+ npx @hupan56/wlkj install-env --location D:\wldev
68
+ ```
69
+ > **作用**:尝试把三个软件装到 D:\wldev。
70
+ > **注意**:winget 的 --location 对 Python 不一定生效。如果没装到指定目录,
71
+ > 手动去官网下载安装包选目录,然后用 add-path 加进 PATH。
72
+
73
+ ### 1.4 手动加 PATH
74
+
75
+ ```bash
76
+ npx @hupan56/wlkj add-path D:\wldev\nodejs
77
+ npx @hupan56/wlkj add-path D:\wldev\Python312
78
+ ```
79
+ > **作用**:把目录加到系统 PATH(幂等,重复跑不会加两次)。
80
+ > 跑完**重新打开终端**生效。
81
+
82
+ ---
83
+
84
+ ## 2. 初始化
85
+
86
+ ### 2.1 一键安装(新用户必跑)
87
+
88
+ ```bash
89
+ mkdir my-project # 建一个空文件夹
90
+ cd my-project # 进去
91
+ npx @hupan56/wlkj init 你的名字
92
+ ```
93
+ > **作用**:一键完成以下全部:
94
+ > 1. 拷贝完整引擎(.qoder/ 全部脚本 + 技能 + 命令 + 规则 + 模板)
95
+ > 2. 建 workspace / data 目录结构
96
+ > 3. git init(如果没有)
97
+ > 4. 写 .gitignore(保护敏感文件不提交)
98
+ > 5. **注册身份**(写 member.json + 生成签名密钥 → push 门禁的前提)
99
+ > 6. **配 git**(检测 git config,没配就用你的名字设 local)
100
+ > 7. clone 代码仓库(Carmg-H5 / fywl-ics / fywl-ui)
101
+ > 8. 建知识图谱(14000+ 文件索引)
102
+ > 9. 写版本戳
103
+ >
104
+ > **耗时**:首次约 3-5 分钟(clone 大仓库 + 建索引)。之后秒级。
105
+ > **幂等**:可以重复跑,不会覆盖你已有的草稿和任务。
106
+
107
+ ### 2.2 验证初始化
108
+
109
+ ```bash
110
+ npx @hupan56/wlkj status
111
+ ```
112
+ > **预期输出**:
113
+ > ```
114
+ > dev: 你的名字
115
+ > Current task: (none)
116
+ > PRDs: 0
117
+ > engine: 2.3.3 (最新: v2.3.3) [最新]
118
+ > ```
119
+
120
+ ### 2.3 切换开发者(同一台机器换人用)
121
+
122
+ ```bash
123
+ npx @hupan56/wlkj init 另一个人的名字
124
+ ```
125
+ > **作用**:更新 `.developer` 文件,切换身份。
126
+ > 会自动清除上一个开发者的活跃任务指针(防误操作)。
127
+
128
+ ### 2.4 环境体检
129
+
130
+ ```bash
131
+ python .qoder/scripts/init_doctor.py
132
+ ```
133
+ > **作用**:9 段检查:
134
+ > 1. 基础环境(Python / git)
135
+ > 2. 开发者身份
136
+ > 3. 团队仓库同步
137
+ > 4. 源码仓库(data/code/)
138
+ > 5. 知识图谱(data/index/)
139
+ > 6. 风格约束
140
+ > 7. PRD 模板 + Qoder 载体
141
+ > 8. 周五自动构建
142
+ > 9. QoderWork 技能
143
+
144
+ 自动修复:
145
+ ```bash
146
+ python .qoder/scripts/init_doctor.py --fix
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 3. 升级
152
+
153
+ ### 3.1 已装用户升级(新版本发布后)
154
+
155
+ ```bash
156
+ npx @hupan56/wlkj update
157
+ ```
158
+ > **作用**:
159
+ > - 刷新所有引擎文件(.py / .md / .html)
160
+ > - **保护 config.yaml**(你的团队 git URL 不动)
161
+ > - **保护 settings.json**(你的权限配置不动)
162
+ > - 强制刷新 QoderWork commands
163
+ > - 写入新版本号
164
+ >
165
+ > **不碰**:.developer / .current-task / workspace/ / data/ 业务数据
166
+ >
167
+ > 跑完**重启 Qoder / 新建对话**生效。
168
+
169
+ ### 3.2 检查是否最新
170
+
171
+ ```bash
172
+ npx @hupan56/wlkj status
173
+ ```
174
+ > 如果落后会显示:`engine: 2.2.0 (最新: v2.3.3) [可升级: npx @hupan56/wlkj update]`
175
+
176
+ ---
177
+
178
+ ## 4. 日常使用:在 Qoder 里
179
+
180
+ ### 4.1 斜杠命令(输 `/` 就看到)
181
+
182
+ | 命令 | 做什么 | 自动确认 |
183
+ |------|--------|---------|
184
+ | `/wl-init` | 初始化 / 切换开发者 | ✅ |
185
+ | `/wl-prd` | 生成 PRD + 原型 | ✅ |
186
+ | `/wl-search` | 搜代码 / API / 字段 / PRD / Wiki | ✅ |
187
+ | `/wl-task` | 任务管理 | ✅ |
188
+ | `/wl-status` | 项目健康度 + 进度 | ✅ |
189
+ | `/wl-spec` | 从 PRD 生成技术规格 | ✅ |
190
+ | `/wl-report` | 日报 / 周报 | ✅ |
191
+ | `/wl-insight` | 反馈分析 + 指标回顾 | ✅ |
192
+ | `/wl-code` | 按 Spec 写代码 | ⚠️ 需确认 |
193
+ | `/wl-test` | 写单元测试 | ⚠️ 需确认 |
194
+ | `/wl-commit` | 提交代码 + push | ⚠️ 需确认 |
195
+
196
+ ### 4.2 自然语言(最推荐,不用记命令)
197
+
198
+ | 你说什么 | 触发什么 |
199
+ |---------|---------|
200
+ | "写个 XX 的需求" | PRD + 原型生成 |
201
+ | "查一下 XX 代码在哪" | 代码搜索 |
202
+ | "建个任务,优先级高" | 任务创建 |
203
+ | "项目进度怎么样" | 项目状态 |
204
+ | "写个日报" | 日报生成 |
205
+ | "生成规格" | Spec 生成 |
206
+ | "开始写代码" | 代码实现 |
207
+ | "写单元测试" | 测试生成 |
208
+ | "提交代码" | git commit + push |
209
+ | "用户反馈怎么样" | 反馈分析 |
210
+
211
+ > AI 会自动路由到对应技能。不需要记斜杠命令。
212
+
213
+ ---
214
+
215
+ ## 5. 日常使用:在终端里
216
+
217
+ ### 5.1 状态查看
218
+
219
+ ```bash
220
+ npx @hupan56/wlkj status
221
+ ```
222
+
223
+ ### 5.2 中文 Git 命令(不懂 git 也能用)
224
+
225
+ | 命令 | 等价于 | 作用 |
226
+ |------|--------|------|
227
+ | `npx @hupan56/wlkj 提交` | `git add . && commit && push` | 全部提交并推送 |
228
+ | `npx @hupan56/wlkj 提交PRD` | 只提交 `workspace/specs/prd/` | 提交 PRD |
229
+ | `npx @hupan56/wlkj 提交Spec` | 只提交 `workspace/specs/` | 提交技术规格 |
230
+ | `npx @hupan56/wlkj 提交任务` | 只提交 `workspace/tasks/` | 提交任务 |
231
+ | `npx @hupan56/wlkj 推送` | `git push` | 只推送 |
232
+ | `npx @hupan56/wlkj 拉取最新` | `git pull` | 拉队友最新 |
233
+ | `npx @hupan56/wlkj 同步` | `git pull` | 同上 |
234
+ | `npx @hupan56/wlkj 查看状态` | `git status` | 看改了哪些文件 |
235
+
236
+ ---
237
+
238
+ ## 6. 代码搜索(10 种模式)
239
+
240
+ ### 6.1 关键词搜索(最常用)
241
+ ```bash
242
+ python .qoder/scripts/search_index.py 考勤
243
+ ```
244
+ > 搜全项目。中文自动分词("异常记录"→异常+记录→abnormal+record)。
245
+
246
+ ### 6.2 平台过滤
247
+ ```bash
248
+ python .qoder/scripts/search_index.py 考勤 --platform web # 只搜 Web 管理端 (fywl-ui)
249
+ python .qoder/scripts/search_index.py 考勤 --platform app # 只搜 APP 移动端 (Carmg-H5)
250
+ ```
251
+
252
+ ### 6.3 搜 API
253
+ ```bash
254
+ python .qoder/scripts/search_index.py --api salary
255
+ ```
256
+ > 返回 API 路径 + 所在文件。
257
+
258
+ ### 6.4 搜字段
259
+ ```bash
260
+ python .qoder/scripts/search_index.py --field nickName
261
+ ```
262
+ > 返回字段名 → 中文标题 → 使用文件。写 PRD 时用来查字段命名约定。
263
+
264
+ ### 6.5 搜页面样式
265
+ ```bash
266
+ python .qoder/scripts/search_index.py --style table --platform web
267
+ python .qoder/scripts/search_index.py --style form --platform web
268
+ ```
269
+ > 类型:table / form / detail / modal / dashboard。返回同类页面示例。
270
+
271
+ ### 6.6 搜历史 PRD
272
+ ```bash
273
+ python .qoder/scripts/search_index.py --prd 保险
274
+ ```
275
+
276
+ ### 6.7 搜 Repo Wiki(语义级,最精准)
277
+ ```bash
278
+ python .qoder/scripts/search_index.py --wiki 保险
279
+ ```
280
+ > 搜 Qoder IDE 生成的模块文档。带行号引用,比读源码精准。
281
+ > **前提**:项目已用 Qoder IDE 生成 Repo Wiki。
282
+
283
+ ### 6.8 组件统计
284
+ ```bash
285
+ python .qoder/scripts/search_index.py --components
286
+ ```
287
+
288
+ ### 6.9 模块概览
289
+ ```bash
290
+ python .qoder/scripts/search_index.py --modules
291
+ ```
292
+
293
+ ### 6.10 一次取全(Fast Path,写 PRD 前用)
294
+ ```bash
295
+ python .qoder/scripts/context_pack.py 保险 --platform web
296
+ ```
297
+ > 一次返回 7 章节:代码 + 页面 + 字段 + PRD + API + 样式 + Wiki。
298
+ > 比逐个 search 省 5-6 次往返。
299
+
300
+ ---
301
+
302
+ ## 7. PRD 生成(4 种模式 + 评估)
303
+
304
+ ### 7.1 Reference 模式(默认)
305
+ ```
306
+ /wl-prd 异常列表新增项目类型筛选
307
+ ```
308
+ > 参考现有代码 + 历史 PRD 生成。适合"照着已有的做类似的"。
309
+
310
+ ### 7.2 Brainstorm 模式(创新需求)
311
+ ```
312
+ /wl-prd 头脑风暴:如何优化车辆调度效率
313
+ ```
314
+ > SCAMPER 7 维度 + 多 agent 并行调研。适合"想不出怎么做"。
315
+
316
+ ### 7.3 Planning 模式(规划类)
317
+ ```
318
+ /wl-prd 规划:下季度车辆管理模块重构
319
+ ```
320
+ > 现状分析 + 理想态研究 + Gap 分析 + MVP。适合"大方向"。
321
+
322
+ ### 7.4 Quick 模式(小改动)
323
+ ```
324
+ /wl-prd 快速:列表加个导出按钮
325
+ ```
326
+ > 快速定位 + Mini-PRD + 微型原型(只改 diff)。适合"小功能"。
327
+
328
+ ### 7.5 EVA 质量门禁
329
+ ```bash
330
+ python .qoder/scripts/eval_prd.py <prd.md> [prototype.html]
331
+ ```
332
+ > 10 维度打分。≥80% 才能发布。<80% 会列出缺什么,修完再评估。
333
+ > **PRD 发布前自动跑**,不过不放行。
334
+
335
+ ### 7.6 生成时会自动做
336
+ 1. **先问平台**(Web / APP / 两端)—— 强制,不跳过
337
+ 2. 分配 REQ-ID(原子分配器,防撞号)
338
+ 3. 生成匹配平台风格的原型(Ant Design / Vant)
339
+ 4. 跑 EVA 评估
340
+ 5. 发布到 `workspace/specs/prd/`
341
+ 6. 自动 team_sync push
342
+ 7. 飞书通知团队
343
+
344
+ ---
345
+
346
+ ## 8. 任务管理(13 个子命令)
347
+
348
+ ### 8.1 创建
349
+ ```bash
350
+ python .qoder/scripts/task.py create "异常筛选功能" --priority P0
351
+ ```
352
+ > 优先级:P0(紧急)/ P1(高)/ P2(中)/ P3(低)
353
+
354
+ ### 8.2 列表
355
+ ```bash
356
+ python .qoder/scripts/task.py list # 全部
357
+ python .qoder/scripts/task.py list --mine # 只看我的
358
+ ```
359
+
360
+ ### 8.3 查看详情
361
+ ```bash
362
+ python .qoder/scripts/task.py show 06-15-异常筛选功能
363
+ ```
364
+
365
+ ### 8.4 开始
366
+ ```bash
367
+ python .qoder/scripts/task.py start 06-15-异常筛选功能
368
+ ```
369
+ > planning → in_progress。记录开始时间戳。
370
+
371
+ ### 8.5 当前任务
372
+ ```bash
373
+ python .qoder/scripts/task.py current
374
+ ```
375
+
376
+ ### 8.6 完成
377
+ ```bash
378
+ python .qoder/scripts/task.py finish
379
+ ```
380
+ > 完成当前任务。→ completed。记录完成时间 + 算用时 + 飞书通知。
381
+
382
+ ### 8.7 归档
383
+ ```bash
384
+ python .qoder/scripts/task.py archive 06-15-异常筛选功能
385
+ ```
386
+ > 移到 archive/。**自动清理其他任务对它的依赖引用**(防僵尸任务)。
387
+
388
+ ### 8.8 截止日期
389
+ ```bash
390
+ python .qoder/scripts/task.py set-due 06-15-异常筛选功能 2026-12-31
391
+ ```
392
+
393
+ ### 8.9 阻塞关系
394
+ ```bash
395
+ python .qoder/scripts/task.py block 06-15-任务B 06-15-任务A # B 被 A 阻塞
396
+ python .qoder/scripts/task.py unblock 06-15-任务B 06-15-任务A # 解除
397
+ ```
398
+
399
+ ### 8.10 子任务
400
+ ```bash
401
+ python .qoder/scripts/task.py add-subtask 06-15-父任务 06-15-子任务
402
+ python .qoder/scripts/task.py remove-subtask 06-15-父任务 06-15-子任务
403
+ ```
404
+ > 子任务必须是已存在的任务(关联,不是创建)。
405
+
406
+ ### 8.11 甘特图
407
+ ```bash
408
+ python .qoder/scripts/task.py gantt
409
+ ```
410
+
411
+ ---
412
+
413
+ ## 9. 报告与导出
414
+
415
+ ### 9.1 日报
416
+ ```bash
417
+ python .qoder/scripts/report.py daily
418
+ python .qoder/scripts/report.py daily --push-feishu # 同时发飞书
419
+ ```
420
+ > 内容:今日完成 / 进行中 / 明日计划 / 提交统计。
421
+
422
+ ### 9.2 周报
423
+ ```bash
424
+ python .qoder/scripts/report.py weekly
425
+ python .qoder/scripts/report.py weekly --push-feishu
426
+ ```
427
+
428
+ ### 9.3 导出 Jira CSV
429
+ ```bash
430
+ python .qoder/scripts/export.py jira
431
+ ```
432
+
433
+ ### 9.4 导出 OpenAPI
434
+ ```bash
435
+ python .qoder/scripts/export.py openapi
436
+ ```
437
+ > 从 Java Controller 提取 API 规范。
438
+
439
+ ### 9.5 导出调用图
440
+ ```bash
441
+ python .qoder/scripts/export.py callgraph
442
+ ```
443
+
444
+ ### 9.6 项目状态
445
+ ```bash
446
+ python .qoder/scripts/status.py
447
+ ```
448
+ > 健康度(6 维加权)+ 阻塞图 + 截止日期 + 周期时间。
449
+
450
+ ---
451
+
452
+ ## 10. 团队协作与冲突处理
453
+
454
+ ### 10.1 提交产出(PRD / 任务 / 索引)
455
+
456
+ ```bash
457
+ python .qoder/scripts/team_sync.py push
458
+ ```
459
+ > **这是团队协作的核心命令**。会自动完成:
460
+ > 1. 白名单 staging(只提交 workspace/ + data/docs + data/index,不提交敏感文件)
461
+ > 2. 四道门禁检查(身份 / git 作者 / 秘密扫描 / REQ-ID 撞号 / EVA)
462
+ > 3. commit
463
+ > 4. **先 `git pull --rebase`** 再 push(处理远端有新提交的情况)
464
+ > 5. push
465
+
466
+ ### 10.2 拉取队友产出
467
+ ```bash
468
+ python .qoder/scripts/team_sync.py pull
469
+ ```
470
+ > `git pull --rebase --autostash`。本地未提交改动会被 stash 保护。
471
+
472
+ ### 10.3 提交前会先拉吗?
473
+
474
+ **会。** push 流程的第 4 步就是 `git pull --rebase`:
475
+ ```
476
+ push → commit → pull --rebase → push
477
+ ```
478
+ 先拉远端最新,rebase 到本地提交之上,然后才 push。
479
+
480
+ ### 10.4 会有冲突吗?
481
+
482
+ **可能有**,但很少。原因和概率:
483
+
484
+ | 场景 | 冲突概率 | 原因 |
485
+ |------|---------|------|
486
+ | 两人改**同一个 PRD 文件** | 高 | 同文件同行 |
487
+ | 两人各建**自己的 PRD/任务** | 极低 | 不同路径,git 自动合并 |
488
+ | 两人都改**索引文件** | 低 | team_sync 用 FileLock 串行化,不会同时改 |
489
+ | 两人离线各建**同号 PRD** | 中 | REQ-ID 撞号(门禁会拦住,不会真的冲突) |
490
+
491
+ > **大多数情况不冲突**,因为每人的产出在 `workspace/members/{你的名字}/` 下,路径不交叉。
492
+
493
+ ### 10.5 冲突了怎么办?
494
+
495
+ 如果 push 时检测到 rebase 冲突,会输出:
496
+ ```
497
+ SYNC_CONFLICT: 自动同步遇到冲突, 已安全回退 (本地产出未丢失)。
498
+ AI 请按以下步骤解决冲突:
499
+ 1. git status # 看哪些文件冲突
500
+ 2. git pull --rebase origin master # 重新拉取
501
+ 3. 编辑冲突文件 (<<<<<<< 标记处), 保留双方改动
502
+ 4. git add <解决后的文件> # 标记已解决
503
+ 5. git rebase --continue # 继续 rebase
504
+ 6. git push # 推送
505
+ ```
506
+ > **用户不需要自己跑这些** —— AI(Qoder 里的对话)会自动帮你执行。
507
+ > 本地产出不会丢(已安全回退)。
508
+
509
+ ### 10.6 四道门禁(提交前自动检查)
510
+
511
+ | 门禁 | 检查什么 | 失败怎么办 |
512
+ |------|---------|-----------|
513
+ | ① 身份 | member.json + 签名密钥存在 | 跑 `init 你的名字` |
514
+ | ② Git 作者 | git config 跟注册一致 | 按 TODO 提示跑 git config |
515
+ | ③ 秘密扫描 | 无 AWS/GitHub/私钥泄露 | 删掉敏感内容 |
516
+ | ④ REQ-ID | 无撞号 / 跳号 | 改其中一个的编号 |
517
+ | ⑤ EVA | PRD 质量达标(≥80%) | 补全缺失章节 |
518
+
519
+ > 门禁失败 → staging 撤销,不提交,打印原因。修完重跑即可。
520
+
521
+ ---
522
+
523
+ ## 11. QoderWork 桌面端
524
+
525
+ ### 11.1 安装技能到 QoderWork
526
+ ```bash
527
+ python .qoder/scripts/install_qoderwork.py
528
+ ```
529
+ > 把 .qoder/skills/ 安装到 `~/.qoderwork/skills/`(junction 方式)。
530
+ > 装完重启 QoderWork,按 `/` 就能看到 11 个 `/wl-*` 命令。
531
+
532
+ ### 11.2 强制刷新 commands(升级后用)
533
+ ```bash
534
+ python .qoder/scripts/install_qoderwork.py --force-commands
535
+ ```
536
+
537
+ ### 11.3 检查安装状态
538
+ ```bash
539
+ python .qoder/scripts/install_qoderwork.py --check
540
+ ```
541
+
542
+ ### 11.4 飞书通知
543
+
544
+ **方式 A:QoderWork IM Channel(交互式)**
545
+ > Settings → IM Channels → 绑定 Lark(飞书)→ 扫码
546
+ > 之后说"写日报发飞书",QoderWork 自动用连接器发。
547
+
548
+ **方式 B:webhook(任何环境)**
549
+ ```bash
550
+ python .qoder/scripts/report.py daily --push-feishu
551
+ ```
552
+ > 在 `.qoder/config.yaml` 里配飞书 bot webhook URL。
553
+ > PRD 发布 / 任务完成 / 截止提醒 / 评估拒绝 → 自动发飞书卡片。
554
+
555
+ ---
556
+
557
+ ## 12. 故障排查
558
+
559
+ ### 12.1 环境问题
560
+ ```bash
561
+ python .qoder/scripts/init_doctor.py --fix # 自动修复
562
+ ```
563
+
564
+ ### 12.2 命令找不到
565
+ > 重新打开终端(PATH 可能没刷新)。
566
+
567
+ ### 12.3 看不到斜杠命令
568
+ > Qoder IDE / Quest:新建对话。
569
+ > QoderWork:重启应用 + 新建对话。
570
+
571
+ ### 12.4 git push 被拒
572
+ > 队友先推了。team_sync 会自动 `pull --rebase` 重试 3 次。
573
+ > 如果还是失败,按 SYNC_CONFLICT 提示让 AI 解决冲突。
574
+
575
+ ### 12.5 知识图谱过期
576
+ > 代码改了但搜索结果不更新?跑:
577
+ ```bash
578
+ python .qoder/scripts/git_sync.py --index-only
579
+ ```
580
+
581
+ ### 12.6 性能基准
582
+ ```bash
583
+ python .qoder/scripts/benchmark.py
584
+ ```
585
+
586
+ ---
587
+
588
+ ## 13. 命令速查表
589
+
590
+ ### 新用户(第一次用)
591
+ ```bash
592
+ # 1. 装 Node.js(手动,一次性)
593
+ # 2. 装其余
594
+ npx @hupan56/wlkj install-env
595
+ # 3. 安装引擎
596
+ mkdir my-project && cd my-project
597
+ npx @hupan56/wlkj init 你的名字
598
+ # 4. 开始用!在 Qoder 里说 "写个 XX 的需求"
599
+ ```
600
+
601
+ ### 已装用户(升级)
602
+ ```bash
603
+ npx @hupan56/wlkj update
604
+ ```
605
+
606
+ ### 日常(在 Qoder 里)
607
+ ```
608
+ /wl-prd 写需求
609
+ /wl-search 查代码
610
+ /wl-task 建任务
611
+ /wl-status 看进度
612
+ /wl-report 写日报
613
+ /wl-spec 出技术方案
614
+ /wl-code 写代码
615
+ /wl-test 写测试
616
+ /wl-commit 提交
617
+ ```
618
+
619
+ ### 日常(在终端里)
620
+ ```bash
621
+ npx @hupan56/wlkj status # 看状态
622
+ npx @hupan56/wlkj 提交 # 提交全部
623
+ npx @hupan56/wlkj 拉取最新 # 拉队友最新
624
+ python .qoder/scripts/report.py daily # 日报
625
+ python .qoder/scripts/git_sync.py # 刷新知识图谱
626
+ ```
627
+
628
+ ---
629
+
630
+ > **一句话**:不会命令就说中文,AI 自动路由。斜杠命令只是快捷入口。