@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.
- package/bin/cli.js +261 -11
- package/package.json +1 -1
- package/templates/qoder/agents/insight-planning.md +67 -0
- package/templates/qoder/agents/insight-research.md +61 -0
- package/templates/qoder/agents/prd-reference.md +8 -2
- package/templates/qoder/commands/optional/wl-insight.md +275 -0
- package/templates/qoder/commands/{wl-report.md → optional/wl-report.md} +13 -5
- package/templates/qoder/commands/{wl-spec.md → optional/wl-spec.md} +1 -1
- package/templates/qoder/commands/{wl-status.md → optional/wl-status.md} +28 -2
- package/templates/qoder/commands/wl-code.md +10 -2
- package/templates/qoder/commands/wl-commit.md +1 -1
- package/templates/qoder/commands/wl-design-draw.md +78 -0
- package/templates/qoder/commands/wl-design-scan.md +108 -0
- package/templates/qoder/commands/wl-design-spec.md +154 -0
- package/templates/qoder/commands/wl-design.md +32 -0
- package/templates/qoder/commands/wl-init.md +24 -3
- package/templates/qoder/commands/wl-prd-full.md +226 -0
- package/templates/qoder/commands/wl-prd-quick.md +134 -0
- package/templates/qoder/commands/wl-prd-review.md +104 -0
- package/templates/qoder/commands/wl-prd.md +17 -311
- package/templates/qoder/commands/wl-search.md +66 -30
- package/templates/qoder/commands/wl-task.md +290 -59
- package/templates/qoder/commands/wl-test.md +92 -24
- package/templates/qoder/config.yaml +51 -15
- package/templates/qoder/hooks/inject-workflow-state.py +2 -2
- package/templates/qoder/hooks/session-start.py +82 -51
- package/templates/qoder/rules/wl-pipeline.md +216 -105
- package/templates/qoder/scripts/__pycache__/search_index.cpython-39.pyc +0 -0
- package/templates/qoder/scripts/archive_prd.py +377 -0
- package/templates/qoder/scripts/autotest.py +1715 -0
- package/templates/qoder/scripts/autotest_batch.py +224 -0
- package/templates/qoder/scripts/autotest_run.py +297 -0
- package/templates/qoder/scripts/benchmark.py +210 -209
- package/templates/qoder/scripts/build_style_index.py +444 -4
- package/templates/qoder/scripts/check_carriers.py +238 -0
- package/templates/qoder/scripts/check_mcp.py +298 -0
- package/templates/qoder/scripts/check_qoderwork_consistency.py +166 -0
- package/templates/qoder/scripts/common/events.py +46 -0
- package/templates/qoder/scripts/common/extract.py +419 -0
- package/templates/qoder/scripts/common/graph_traverse.py +533 -0
- package/templates/qoder/scripts/common/paths.py +89 -0
- package/templates/qoder/scripts/common/pip_install.py +144 -0
- package/templates/qoder/scripts/common/platform_guard.py +61 -0
- package/templates/qoder/scripts/common/search_engine.py +205 -205
- package/templates/qoder/scripts/common/terms.py +57 -0
- package/templates/qoder/scripts/common/ts_extract.py +536 -0
- package/templates/qoder/scripts/context_pack.py +73 -13
- package/templates/qoder/scripts/enrich_prompt.py +226 -0
- package/templates/qoder/scripts/eval_prd.py +318 -231
- package/templates/qoder/scripts/export.py +487 -487
- package/templates/qoder/scripts/extract_api_params.py +246 -0
- package/templates/qoder/scripts/extract_routes.py +54 -0
- package/templates/qoder/scripts/extract_routes_tree.py +78 -0
- package/templates/qoder/scripts/fill_prototype.py +707 -0
- package/templates/qoder/scripts/gen_design_doc.py +394 -0
- package/templates/qoder/scripts/git_sync.py +27 -15
- package/templates/qoder/scripts/init_doctor.py +292 -40
- package/templates/qoder/scripts/install_qoderwork.py +366 -9
- package/templates/qoder/scripts/kg.py +708 -0
- package/templates/qoder/scripts/kg_auto_login.py +196 -0
- package/templates/qoder/scripts/kg_build.py +612 -0
- package/templates/qoder/scripts/kg_build_db.py +327 -0
- package/templates/qoder/scripts/kg_duckdb.py +549 -0
- package/templates/qoder/scripts/kg_incremental.py +393 -0
- package/templates/qoder/scripts/kg_link_db.py +224 -0
- package/templates/qoder/scripts/kg_mcp_server.py +801 -0
- package/templates/qoder/scripts/kg_semantic.py +150 -0
- package/templates/qoder/scripts/kg_test_runner.py +241 -0
- package/templates/qoder/scripts/lanhu_stdio_wrapper.py +119 -0
- package/templates/qoder/scripts/learn.py +118 -39
- package/templates/qoder/scripts/learn_aggregate.py +201 -0
- package/templates/qoder/scripts/mcp_launcher.py +359 -0
- package/templates/qoder/scripts/mysql_mcp_server.py +396 -0
- package/templates/qoder/scripts/repo_root.py +106 -0
- package/templates/qoder/scripts/role.py +12 -0
- package/templates/qoder/scripts/run_weekly_update.bat +5 -0
- package/templates/qoder/scripts/run_weekly_update.sh +5 -0
- package/templates/qoder/scripts/search_index.py +307 -60
- package/templates/qoder/scripts/secure-ls.js +5640 -0
- package/templates/qoder/scripts/setup.py +706 -641
- package/templates/qoder/scripts/setup_lanhu.py +963 -0
- package/templates/qoder/scripts/status.py +250 -11
- package/templates/qoder/scripts/sync_carriers.py +259 -0
- package/templates/qoder/scripts/syncgate.py +2 -2
- package/templates/qoder/scripts/task.py +75 -0
- package/templates/qoder/scripts/team_sync.py +60 -4
- package/templates/qoder/scripts/workspace_init.py +1 -1
- package/templates/qoder/skills/design-import/SKILL.md +226 -0
- package/templates/qoder/skills/design-import/figma-workflow.md +81 -0
- package/templates/qoder/skills/design-review/SKILL.md +82 -25
- package/templates/qoder/skills/prd-generator/SKILL.md +184 -60
- package/templates/qoder/skills/prd-review/SKILL.md +18 -1
- package/templates/qoder/skills/prompt-enrich/SKILL.md +90 -0
- package/templates/qoder/skills/prototype-generator/SKILL.md +256 -141
- package/templates/qoder/skills/prototype-generator/SKILL.md.zcode-79180-2af4721f-f9a6-412c-88db-c0af680d211b.tmp +0 -0
- package/templates/qoder/skills/spec-coder/SKILL.md +18 -1
- package/templates/qoder/skills/spec-generator/SKILL.md +18 -1
- package/templates/qoder/skills/test-generator/SKILL.md +15 -2
- package/templates/qoder/skills/wl-code/SKILL.md +55 -36
- package/templates/qoder/skills/wl-commit/SKILL.md +89 -76
- package/templates/qoder/skills/wl-design/SKILL.md +55 -0
- package/templates/qoder/skills/wl-init/SKILL.md +76 -67
- package/templates/qoder/skills/wl-insight/SKILL.md +201 -81
- package/templates/qoder/skills/wl-prd-full/SKILL.md +69 -0
- package/templates/qoder/skills/wl-prd-quick/SKILL.md +49 -0
- package/templates/qoder/skills/wl-prd-review/SKILL.md +34 -0
- package/templates/qoder/skills/wl-report/SKILL.md +131 -107
- package/templates/qoder/skills/wl-search/SKILL.md +141 -75
- package/templates/qoder/skills/wl-spec/SKILL.md +49 -39
- package/templates/qoder/skills/wl-status/SKILL.md +83 -61
- package/templates/qoder/skills/wl-task/SKILL.md +132 -58
- package/templates/qoder/skills/wl-test/SKILL.md +406 -40
- package/templates/qoder/templates/prototype-app.html +13 -8
- package/templates/qoder/templates/prototype-web.html +376 -93
- package/templates/root/AGENTS.md +89 -34
- package/templates/root/requirements.txt +21 -0
- package/templates/root//344/275/277/347/224/250/350/257/264/346/230/216.md +259 -259
- package/templates/root//346/226/260/346/211/213/346/214/207/345/215/227.md +186 -186
- package/templates/qoder/agents/prd-planning.md +0 -57
- package/templates/qoder/agents/prd-research.md +0 -34
- package/templates/qoder/commands/wl-insight.md +0 -51
- package/templates/qoder/scripts/__pycache__/init_doctor.cpython-39.pyc +0 -0
- package/templates/qoder/scripts/__pycache__/setup.cpython-39.pyc +0 -0
- package/templates/qoder/scripts/common/__pycache__/developer.cpython-39.pyc +0 -0
- package/templates/qoder/skills/wl-prd/SKILL.md +0 -92
|
@@ -1,76 +1,89 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
git diff --
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
### Step
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
[
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
+
|
|
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-commit — 代码提交 + 质量门禁 + 同步
|
|
17
|
+
|
|
18
|
+
> ⚠️ DANGEROUS 操作(推代码到远端)。**执行前必须向用户确认提交信息。**
|
|
19
|
+
> 注意区分:用户说"同步/保存产出"通常指 team_sync(推 PRD/任务/索引);
|
|
20
|
+
> 用户说"提交/commit 代码"才是本 skill(推源码改动)。
|
|
21
|
+
|
|
22
|
+
## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
|
|
23
|
+
|
|
24
|
+
- `.qoder/.developer` — 当前开发者(提交作者)
|
|
25
|
+
- 当前工作目录的 `git status` 和 `git diff --stat` 看改了什么
|
|
26
|
+
- `.qoder/.current-task` — 若有活动任务,提交信息关联任务 ID
|
|
27
|
+
|
|
28
|
+
## 执行流程
|
|
29
|
+
|
|
30
|
+
### Step 1: 看改动
|
|
31
|
+
```bash
|
|
32
|
+
git status
|
|
33
|
+
git diff --stat
|
|
34
|
+
git diff --cached --stat
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Step 2: 质量门禁(提交前自检)
|
|
38
|
+
|
|
39
|
+
逐项检查,任何一项不过都暂停问用户:
|
|
40
|
+
- [ ] 无 TODO / FIXME 残留(grep 一下)
|
|
41
|
+
- [ ] 金额字段用了 BigDecimal(不出现 double/float 存钱)
|
|
42
|
+
- [ ] 命名/风格跟周围代码一致
|
|
43
|
+
- [ ] 若有对应 Spec:Spec 要求的接口/字段都覆盖了
|
|
44
|
+
- [ ] 测试通过(如有测试)
|
|
45
|
+
|
|
46
|
+
### Step 3: 生成提交信息
|
|
47
|
+
|
|
48
|
+
按团队约定:
|
|
49
|
+
```
|
|
50
|
+
[ai-generated] <type>: <简述>
|
|
51
|
+
|
|
52
|
+
<body 说明动机和关键改动>
|
|
53
|
+
```
|
|
54
|
+
type 选 feat / fix / refactor / docs / test / chore。
|
|
55
|
+
|
|
56
|
+
### Step 4: 用户确认
|
|
57
|
+
|
|
58
|
+
把"将要提交的文件 + 生成的 commit message"展示给用户,等确认。
|
|
59
|
+
**用户没明确说"提交/确认"之前,不要真的 commit。**
|
|
60
|
+
|
|
61
|
+
### Step 5: 提交 + 推送
|
|
62
|
+
```bash
|
|
63
|
+
git add <相关文件> # 精确 add,不用 git add .
|
|
64
|
+
git commit -m "<确认后的信息>"
|
|
65
|
+
git pull --rebase # 先拉远端
|
|
66
|
+
git push
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Step 6: 记录学习
|
|
70
|
+
|
|
71
|
+
提交成功后埋点(写当前开发者的 journal,供 /wl-status 健康度统计):
|
|
72
|
+
```bash
|
|
73
|
+
python "$R/.qoder/scripts/learn.py" record commit_done "{\"files\": <改动文件数>, \"task\": \"<关联任务ID或空>\"}"
|
|
74
|
+
```
|
|
75
|
+
> 失败静默忽略,绝不阻塞提交流程。
|
|
76
|
+
|
|
77
|
+
## 与 team_sync 的区别(重要)
|
|
78
|
+
|
|
79
|
+
| 场景 | 用什么 |
|
|
80
|
+
|------|--------|
|
|
81
|
+
| 提交**源码**改动(data/code/ 下的代码) | **wl-commit**(本 skill) |
|
|
82
|
+
| 提交**产出**(PRD/任务/索引/原型) | `team_sync.py push` |
|
|
83
|
+
| 两个都改了 | 先 wl-commit 推代码,再 team_sync push 推产出 |
|
|
84
|
+
|
|
85
|
+
## 失败处理
|
|
86
|
+
|
|
87
|
+
- `git push` 被拒(远端有新提交)→ `git pull --rebase` 解决后再推
|
|
88
|
+
- 冲突 → 列出冲突文件,问用户怎么解决(不擅自改业务代码)
|
|
89
|
+
- 质量门禁不过 → 列出问题,问用户是修复后提交还是强制提交(默认修复)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wl-design
|
|
3
|
+
description: "设计工序入口: import 录入设计稿→spec.json(默认) / generate 按设计spec出原型 / review 评审原型。用户说'录入设计稿''按设计出原型''评审原型'或输入 /wl-design 时触发。"
|
|
4
|
+
trigger: "用户说'录入设计稿''Figma稿录入''按设计出原型''评审原型''/wl-design'"
|
|
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-design — 设计工序入口(/wl-design 命令入口)
|
|
17
|
+
|
|
18
|
+
> 这是 `/wl-design` 命令的 skill 入口。让 QoderWork 的 `/` 列表也能用 `/wl-design`。
|
|
19
|
+
> 完整执行规则见三个功能型 skill:
|
|
20
|
+
> - `.qoder/skills/design-import/SKILL.md`(import 模式)
|
|
21
|
+
> - `.qoder/skills/prototype-generator/SKILL.md`(generate 模式)
|
|
22
|
+
> - `.qoder/skills/design-review/SKILL.md`(review 模式)
|
|
23
|
+
> 和命令 `.qoder/commands/wl-design.md`。
|
|
24
|
+
> **模块契约**(输入/输出/校验):`.qoder/contracts/design.md`
|
|
25
|
+
|
|
26
|
+
## 🚦 路由(三模式)
|
|
27
|
+
|
|
28
|
+
| 用户说 | 模式 | 走哪个 skill |
|
|
29
|
+
|--------|------|-------------|
|
|
30
|
+
| "录入设计稿""Figma稿录入""把这个设计录入" | **import**(默认) | design-import |
|
|
31
|
+
| "按设计出原型""按设计师规范出原型" | **generate** | prototype-generator |
|
|
32
|
+
| "评审原型""设计稿看一下""检查交互稿" | **review** | design-review |
|
|
33
|
+
| 模糊 | 先问意图 | — |
|
|
34
|
+
|
|
35
|
+
默认 import(最常见入口)。
|
|
36
|
+
|
|
37
|
+
## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
|
|
38
|
+
|
|
39
|
+
- `.qoder/.developer` — 当前设计师名(产出归属)
|
|
40
|
+
- `.qoder/.current-task` — 若存在,spec/原型命名带上任务关键词
|
|
41
|
+
- 平台必须明确(Web/APP/Both);如未指定,先问
|
|
42
|
+
- 风格真源:`data/style/*-design-spec.json`(优先)→ `data/code/` 源码 → `data/index/vben-style-reference.json`(Web)/ Vant(APP)
|
|
43
|
+
|
|
44
|
+
## 执行
|
|
45
|
+
|
|
46
|
+
按选中的模式,读对应 skill 的完整流程执行。三模式共用一个铁律:
|
|
47
|
+
|
|
48
|
+
**设计师的 spec 优先级 > 代码风格 > PDF 规范。**
|
|
49
|
+
`data/style/{需求名}-design-spec.json` 一旦存在,同需求的 prototype 必须锚定它。
|
|
50
|
+
|
|
51
|
+
## 铁律(三模式通用)
|
|
52
|
+
|
|
53
|
+
- **图标绝对禁止 emoji**:Web 用 Ant Design 内联 SVG,APP 用 Vant 字体图标
|
|
54
|
+
- **颜色只用真源**:不发明颜色
|
|
55
|
+
- **绝不编造 token**:设计师没说的值,留空或标"待确认"
|
|
@@ -1,67 +1,76 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: wl-init
|
|
3
|
-
description: "初始化/切换开发者身份 + 环境体检。Initialize/switch developer identity + environment health check. 用户说'初始化''我是谁''换开发者''环境检查''/wl-init''设置一下''开始用'时触发。"
|
|
4
|
-
trigger: "首次使用、换人、或遇到环境问题时;用户说'初始化''换开发者''环境检查''体检'"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
python
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
1
|
+
---
|
|
2
|
+
name: wl-init
|
|
3
|
+
description: "初始化/切换开发者身份 + 环境体检。Initialize/switch developer identity + environment health check. 用户说'初始化''我是谁''换开发者''环境检查''/wl-init''设置一下''开始用'时触发。"
|
|
4
|
+
trigger: "首次使用、换人、或遇到环境问题时;用户说'初始化''换开发者''环境检查''体检'"
|
|
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-init — 开发者身份 + 环境体检
|
|
17
|
+
|
|
18
|
+
幂等、增量。**绝不删除 workspace**,绝不覆盖 member.json / task.json。
|
|
19
|
+
|
|
20
|
+
## 触发场景
|
|
21
|
+
|
|
22
|
+
1. **首次使用本工具**:注册身份 + 全套体检 + 自愈
|
|
23
|
+
2. **换人/切换开发者**:写 `.qoder/.developer`,重定向 workspace 到新成员目录
|
|
24
|
+
3. **环境出问题**(索引不对、搜不到、脚本报错):体检 + `--fix` 自愈
|
|
25
|
+
4. **拉取团队最新**:体检时自动 `team_sync.py pull`
|
|
26
|
+
|
|
27
|
+
## 执行
|
|
28
|
+
|
|
29
|
+
### 无参数(仅体检)
|
|
30
|
+
```bash
|
|
31
|
+
python "$R/.qoder/scripts/init_doctor.py"
|
|
32
|
+
```
|
|
33
|
+
输出 8 段体检报告,每行 `[OK]/[WARN]/[FIX]/[MISS]` 标注。
|
|
34
|
+
|
|
35
|
+
### 带名字(注册 + 自愈)
|
|
36
|
+
```bash
|
|
37
|
+
python "$R/.qoder/scripts/init_doctor.py" --fix <名字> [角色]
|
|
38
|
+
# 例:python "$R/.qoder/scripts/init_doctor.py" --fix 小王 pm
|
|
39
|
+
```
|
|
40
|
+
做 3 件事:
|
|
41
|
+
1. 写 `.qoder/.developer`(key=value 格式)
|
|
42
|
+
2. `team_sync.py pull` 拉团队最新(图谱/PRD/任务)
|
|
43
|
+
3. 按 WARN 清单逐项 `--fix`(缺索引就建、缺模板就拷、git user.name 不一致就改)
|
|
44
|
+
|
|
45
|
+
### 仅自愈(不换人)
|
|
46
|
+
```bash
|
|
47
|
+
python "$R/.qoder/scripts/init_doctor.py" --fix
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 体检覆盖的 8 段
|
|
51
|
+
|
|
52
|
+
| 段 | 检查内容 | 出问题的后果 |
|
|
53
|
+
|----|---------|------------|
|
|
54
|
+
| 1 基础环境 | Python 3 / git 可用 | 全部脚本跑不了 |
|
|
55
|
+
| 2 开发者身份 | `.developer` 存在且与 git user.name 一致 | /wl-report 统计丢 |
|
|
56
|
+
| 3 团队同步 | 是否 >24h 未 pull | 拿不到队友 PRD/任务 |
|
|
57
|
+
| 4 源码仓库 | `data/code/` 三个项目在 | 搜不到代码 |
|
|
58
|
+
| 5 知识图谱 | `data/index/*.json` 新鲜(≤7 天) | 搜索结果过期 |
|
|
59
|
+
| 6 风格约束 | vben/chart/icon/style JSON + 原型模板 | 原型风格跑偏 |
|
|
60
|
+
| 7 PRD 模板 | prd-full/quick 模板 + rules + AGENTS.md | PRD 生成不规范 |
|
|
61
|
+
| 8 周五任务 | 本机是否设了 cron | 图谱是否自动保鲜 |
|
|
62
|
+
|
|
63
|
+
## 输出规则
|
|
64
|
+
|
|
65
|
+
- 体检完打印一句总结:「环境健康,可以开始工作:/wl-prd-full <需求>」或「N 个问题待修,加 --fix 自愈」
|
|
66
|
+
- 如果用户没给名字但 `.developer` 不存在:先问"你叫什么名字?角色是 pm/dev/design?"
|
|
67
|
+
- 如果 git user.name 与开发者名不一致:在体检里 `[WARN]` 提示,`--fix` 会自动改
|
|
68
|
+
|
|
69
|
+
## 完成后
|
|
70
|
+
|
|
71
|
+
体检/注册本身不需要 push(只改本地 `.developer`)。但若 `--fix` 触发了图谱重建,
|
|
72
|
+
完成后建议跑一次:
|
|
73
|
+
```bash
|
|
74
|
+
python "$R/.qoder/scripts/team_sync.py" push
|
|
75
|
+
```
|
|
76
|
+
让队友拿到刷新后的索引。
|