@hupan56/wlkj 2.6.0 → 2.7.1

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 +269 -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,71 +1,302 @@
1
1
  ---
2
2
  name: wl-task
3
- description: "Manage tasks with built-in RICE prioritization. Actions: create/list/start/finish/archive/rank"
4
- argument-hint: "[action] [task name or ID]"
3
+ description: "任务管理 + RICE 优先级 + 依赖排期。7 站流水线的'任务'站,产品在这里把 PRD 落成任务。Task management with RICE prioritization. "
4
+ argument-hint: "[动作] [任务名或ID] 动作: create/list/show/start/finish/archive/rank/plan"
5
5
  auto-approve: true
6
6
  allowed-tools: [Read, Glob, Grep, Bash, Write, Edit]
7
7
  ---
8
8
 
9
- # /wl-task - Task Management with Prioritization
9
+ # /wl-task - 任务管理(产品的排期站)
10
10
 
11
11
  User input: $ARGUMENTS
12
12
 
13
- ## Actions
14
- - create [name] - Create new task (`python .qoder/scripts/task.py create "<title>"`)
15
- - list - List all tasks (`task.py list [--mine] [--status s]`)
16
- - show [ID] - Show task details (`task.py show <name>`)
17
- - start [ID] - Start task (`task.py start <name>`, planning -> in_progress)
18
- - finish - Finish current task (`task.py finish`, -> completed)
19
- - archive [ID] - Archive completed task (`task.py archive <name>`)
20
- - rank - Re-prioritize all tasks using RICE (AI-driven, see below)
21
-
22
- ## Built-in Prioritization (no /prioritize needed)
23
- When creating multiple tasks or running "rank":
24
- 1. Run `task.py list` to get all pending tasks
25
- 2. Score each task: R(Reach) x I(Impact) x C(Confidence) / E(Effort)
26
- 3. Auto-sort by RICE score and show ranked list with scores
27
- 4. Ask: adjust any scores?
28
- 5. Write the confirmed score into each task.json as `"rice": <score>` (Edit tool)
29
-
30
- ## Storage
31
- Tasks stored in: workspace/tasks/{MM-DD-slug}/
32
- Each task: task.json + prd.md + implement.jsonl + check.jsonl
33
- Archived tasks move to: .qoder/archive/{YYYY-MM}/{MM-DD-slug}/
13
+ > **小而美 · 7 站之一。** 产品在这里把 PRD 落成可执行的任务,排好优先级和依赖,
14
+ > 然后交接给设计/开发工位。
15
+ > **模块契约**(输入/输出/校验):`.qoder/contracts/task.md`
16
+ > **第一性原理:又快又准。** = 并行评估 RICE + 一次取全任务列表;准 = PRD 衔接不丢字段 + 三道检查。
17
+
18
+ ## 🔧 环境自检(QoderWork 桌面端 vs Qoder IDE/CLI)
19
+
20
+ **先确定仓库根 R**(QoderWork 桌面端工作目录不是仓库根,相对路径会失效):
21
+ ```bash
22
+ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
23
+ ```
24
+ > 后续脚本统一用 `python "$R/.qoder/scripts/xxx.py"`(task.py / team_sync.py 等)。
25
+
26
+ ---
27
+
28
+ ## ⚠️ STEP 0: 动作路由(看 $ARGUMENTS 第一个词)
29
+
30
+ **判断 `$ARGUMENTS` 第一个词,立刻决定走哪条线。没有动作词 → 语义自动归档。**
31
+
32
+ | 用户说 / 第一个词 | 动作 | 跑什么 |
33
+ |------------------|------|--------|
34
+ | `create` / "建任务" / "加个任务" | **create** | `task.py create` |
35
+ | `list` / "看任务" / "我的任务" / "有哪些任务" | **list** | `task.py list` |
36
+ | `show` / "看下 XXX" / "XXX 怎么样了" | **show** | `task.py show <name>` |
37
+ | `start` / "开始做" / "启动 XXX" | **start** | `task.py start <name>` |
38
+ | `finish` / "做完了" / "完成了" | **finish** | `task.py finish` |
39
+ | `archive` / "归档" | **archive** | `task.py archive <name>` |
40
+ | `rank` / "排优先级" / "排一下" | **rank** | RICE 评估(见下) |
41
+ | `plan` / "排期" / "甘特图" / "排个日期" | **plan** | `task.py gantt` + set-due |
42
+ | **(无动作词)** | **语义自动归档** | 见下 |
43
+
44
+ ### 语义自动归档(无动作词时,AI 按这句话的意图判断)
45
+
46
+ - "PRD 写完了,建个任务吧" / "把刚才那个需求建成任务" → **create**(带 PRD 衔接)
47
+ - "现在要做哪些?" / "接下来干啥" → **list --ready**(只看能立刻开始的)
48
+ - "卡住的有哪些?" → **list --blocked**
49
+ - 拿不准意图 → **先 list 给全貌,再问用户要操作哪个**
50
+
51
+ ---
52
+
53
+ ## STEP 1: 三道前置检查(任何动作前先做,保证健壮)
54
+
55
+ 这三道是"鲁棒"的保障,防止脚本崩在半路、空数据吓到用户。
56
+
57
+ ### 检查 ①|身份在不在
58
+ ```bash
59
+ python -c "import sys; sys.path.insert(0,r'$R/.qoder/scripts'); from common.paths import get_developer, get_repo_root; d=get_developer(get_repo_root()); print(d or 'MISSING')"
60
+ ```
61
+ - 有名字 → 继续。
62
+ - `MISSING` → **停下,提示**:"还没初始化身份,先跑 `/wl-init 你的名字 产品`"。不要继续往下跑(create 会把 assignee 写成空)。
63
+
64
+ ### 检查 ②|tasks 目录在不在
65
+ - 不存在 / 空 → create 直接建;list/show/rank 等读操作 → **友好提示** "还没有任务,要建一个吗?" 而不是报错。
66
+
67
+ ### 检查 ③|脚本退出码
68
+ - `task.py` 任何子命令返回**非 0**,**先读 stderr 原样告诉用户**,不吞错。
69
+ - 常见非 0:`4` = 权限不足(零信任 ACL,只有 creator/assignee/admin 能改任务);`1` = 任务不存在 / task.json 缺失。
70
+ - 权限不足时提示:"这个任务不是你建的,找 `{assignee}` 或管理员操作。" 不要自己绕过 ACL。
71
+
72
+ ---
73
+
74
+ ## STEP 2: 各动作执行
75
+
76
+ ### create —— 把需求落成任务(产品最高频)
77
+
78
+ **A. PRD 衔接(准的保障:不丢字段)**
79
+
80
+ 如果刚跑完 `/wl-prd-full`(或用户说"把刚才那个需求建成任务"),先确认 PRD 在哪:
81
+ ```bash
82
+ # 找最近的 PRD 草稿(当前开发者的)
83
+ ls workspace/members/<developer>/drafts/REQ-*.md 2>nul
84
+ # 或已发布的
85
+ ls data/docs/prd/REQ-*.md 2>nul
86
+ ```
87
+ - 有 PRD → 从 PRD 提取**标题、模块、验收点**填进任务,**别让用户重述一遍**。
88
+ PRD 的 REQ-ID 记到 task.json 的 `tags` 里(如 `["REQ-2026-042"]`),方便双向追溯。
89
+ - 无 PRD → 用 $ARGUMENTS 里用户给的一句话当标题。
90
+
91
+ **B. 建任务**
92
+ ```bash
93
+ python "$R/.qoder/scripts/task.py" create "<标题>" --priority <P0|P1|P2|P3>
94
+ ```
95
+ - `--assignee` 不填则默认当前开发者(产品建的常指派给开发,可加 `--assignee 老李`)。
96
+ - `--slug` 不填则自动从标题生成(中文标题也能生成,但建议给个英文 slug 如 `--slug login-export`)。
97
+ - 同名撞库时脚本会自动加后缀(creator 短标记),**不阻塞**,告诉用户最终名字即可。
98
+
99
+ **C. 建完必做**
100
+ 1. 告诉用户任务路径:`workspace/tasks/{MM-DD-slug}/`,里面有 `prd.md` 模板(若已有 PRD,可把 PRD 内容贴进去或引用)。
101
+ 2. **待排期池 >3 个任务时**,主动建议:"要不要我跑个 rank 排下优先级?"
102
+ 3. 自动同步(用户永不碰 git):
103
+ ```bash
104
+ python "$R/.qoder/scripts/team_sync.py" push
105
+ ```
106
+
107
+ ### list —— 看任务(一次取全,别串行)
108
+
109
+ ```bash
110
+ python "$R/.qoder/scripts/task.py" list [--mine] [--status <s>] [--ready] [--blocked]
111
+ ```
112
+
113
+ | flag | 用途 |
114
+ |------|------|
115
+ | `--mine` | 只看我建/指派给我的(产品排自己负责的) |
116
+ | `--status planning` / `in_progress` / `completed` | 按状态过滤 |
117
+ | `--ready` | ⭐ 只看**能立刻开始的**(无未完成依赖)—— 回答"接下来做啥" |
118
+ | `--blocked` | 只看**卡住的**(有未完成依赖)—— 排查阻塞链 |
119
+
120
+ 输出渲染成表格(当前任务标 `*`):
121
+ ```
122
+ | * | 优先级 | 状态 | 任务 | 负责人 | 标题 | 备注(due/blocked) |
123
+ ```
124
+ **空数据兜底**:`No tasks found` 时别干巴巴贴脚本输出,补一句人话:
125
+ - 全空 → "还没有任何任务。刚写完 PRD 的话,说'建任务'我帮你落地。"
126
+ - `--ready` 空 → "当前没有能立刻开始的任务,都在等依赖。要看卡住的吗?(--blocked)"
127
+
128
+ ### show —— 看单个任务详情
129
+ ```bash
130
+ python "$R/.qoder/scripts/task.py" show <任务名或目录>
131
+ ```
132
+ 任务名支持模糊匹配(脚本内部 `resolve_task_dir` 会解析)。读完把关键字段(状态/优先级/assignee/due/依赖/prd路径)整理给用户。
133
+
134
+ ### start —— 启动任务(移交开发工位的信号)
135
+ ```bash
136
+ python "$R/.qoder/scripts/task.py" start <任务名>
137
+ ```
138
+ - 状态 `planning → in_progress`,成为活跃任务(`.current-task`)。
139
+ - 这是产品→开发的交接点:start 后开发就能 `/wl-code` 了。
140
+ - **ACL**:只有 creator/assignee/admin 能 start。被拒(返回 4)→ 提示找对应人。
141
+
142
+ ### reassign —— 改派任务负责人(多角色协作必需)
143
+ ```bash
144
+ python "$R/.qoder/scripts/task.py" reassign <任务名> <新负责人>
145
+ ```
146
+ - 场景:PM 建任务(assignee 默认是自己)后,要转给开发老李做。
147
+ - 改派后新负责人才能 `start`/`finish`(零信任 ACL 按 assignee 判定)。
148
+ - **ACL**:只有 **creator/admin** 能改派(assignee 自己不能转手甩锅)。被拒(返回 4)→ 提示找 creator。
149
+ - **改派历史自动记录**到 task.json 的 `assignee_history`(谁在何时从谁转给谁),便于追溯。
150
+
151
+ ### finish —— 完成当前任务
152
+ ```bash
153
+ python "$R/.qoder/scripts/team_sync.py" push
154
+ ```
155
+ - 活跃任务状态 → `completed`,活跃指针清除。
156
+ - 完成后提示:要不要 `archive` 归档?要不要看下个 `--ready` 的任务?
157
+ - 自动同步 push。
158
+
159
+ ### archive —— 归档(移到 .qoder/archive/{YYYY-MM}/)
160
+ ```bash
161
+ python "$R/.qoder/scripts/task.py" archive <任务名>
162
+ ```
163
+ - 事务化:先 move 成功再改 status,move 失败原任务完好。
164
+ - **自动清理孤儿依赖**:归档后,其它任务里对它的 `blocked_by/blocks/children/parent` 引用会被扫除(防止僵尸任务永远 blocked)。
165
+ - 提示用户:归档后任务不再出现在 list 里,但归档目录可翻历史。
166
+
167
+ ---
168
+
169
+ ## STEP 3: RICE 排序(rank 动作 —— 产品的优先级决策)
170
+
171
+ **RICE = Reach × Impact × Confidence ÷ Effort**
172
+
173
+ ### 一次取全(别逐个问)
174
+ ```bash
175
+ python "$R/.qoder/scripts/task.py" list --status planning
176
+ ```
177
+ 拿到所有待排任务,**一次性**评估,不要一个任务问四轮 R/I/C/E。
178
+
179
+ ### 评估口径(让 AI 自己先估,再让用户校准)
180
+ | 维度 | 怎么估 | 分值参考 |
181
+ |------|--------|----------|
182
+ | **R 触达** | 这个功能影响多少用户/订单?看 PRD 的用户画像 | 1=少 / 10=全员 |
183
+ | **I 影响** | 对核心目标的贡献度?看 PRD 的目标指标 | 0.5=弱 / 3=强 |
184
+ | **C 信心** | 有数据/竞品支撑?还是拍脑袋? | 50%=猜 / 100%=有据 |
185
+ | **E 工作量** | 大概几个人周?看 PRD 的功能点数量 | 1=小 / 5=大 |
186
+
187
+ ### 流程
188
+ 1. AI 对每个任务**先给一组 R/I/C/E 估算**(基于 PRD,标注信心来源)
189
+ 2. 算出 RICE 分,排序,展示给用户:
190
+ ```
191
+ | 排名 | 任务 | R | I | C | E | RICE | 信心来源 |
192
+ ```
193
+ 3. 问:"要调整哪个的打分?" —— 用户改完,**写回每个 task.json 的 `rice` 字段**(Edit 工具),并据此重排优先级(`--priority`)。
194
+ 4. push 同步。
195
+
196
+ ### 排不动时的兜底
197
+ - 任务都没有 PRD / PRD 太空 → 诚实说:"这几个缺 PRD 背景,R/I 估不准。要不先补 PRD,或直接用优先级(P0-P3)手动排?"
198
+ - 只有 1 个任务 → 不用 RICE,直接确认优先级即可。
199
+
200
+ ---
201
+
202
+ ## STEP 4: 排期与依赖(plan 动作 —— 产品的甘特图)
203
+
204
+ ### 设置截止日期
205
+ ```bash
206
+ python "$R/.qoder/scripts/task.py" set-due <任务名> <YYYY-MM-DD>
207
+ ```
208
+
209
+ ### 依赖关系(谁挡谁)
210
+ ```bash
211
+ # A 被 B 阻塞(要等 B 完成)
212
+ python "$R/.qoder/scripts/task.py" block <A任务名> <B任务名>
213
+ # 解除
214
+ python "$R/.qoder/scripts/task.py" unblock <A任务名> <B任务名>
215
+ ```
216
+ - **循环依赖自动检测**:脚本会 BFS 检查,发现环就拒绝(返回 1)。
217
+ - 反向 `blocks` 关系自动维护(A 被 B 阻塞时,B 的 blocks 自动加 A)。
218
+
219
+ ### 看甘特图
220
+ ```bash
221
+ python "$R/.qoder/scripts/team_sync.py" push
222
+ python "$R/.qoder/scripts/task.py" gantt [--weeks 4]
223
+ ```
224
+ - 只排有 `start_date`/`due_date` 的任务。
225
+ - 没日期的任务 → 提示:"用 `set-due` 给任务加截止日期,甘特图才会显示。"
226
+ - 自动标记逾期(⚠️)。
227
+
228
+ ---
229
+
230
+ ## STEP 5: 子任务(大需求拆解)
231
+
232
+ ```bash
233
+ # 把大任务 A 拆出子任务 B
234
+ python "$R/.qoder/scripts/task.py" add-subtask <A任务名> <B任务名>
235
+ python "$R/.qoder/scripts/task.py" remove-subtask <A任务名> <B任务名>
236
+ ```
237
+ - 父任务记录 `children`,子任务记录 `parent`。
238
+ - 产品用:把一个大需求拆成"前端/后端/数据"几个子任务,各自指派。
34
239
 
35
240
  ---
36
241
 
37
- ## Flow
38
-
39
- ### create
40
- 1. Run `python .qoder/scripts/task.py create "<title>" [--assignee dev] [--priority P0-P3]`
41
- 2. Task directory is created with task.json (status=planning) and prd.md template
42
- 3. If user provides description -> fill it into prd.md
43
- 4. If multiple tasks pending -> auto-suggest ranking
44
- 5. Auto-sync: `python .qoder/scripts/team_sync.py push`
45
-
46
- ### list
47
- Run `python .qoder/scripts/task.py list` and show as table:
48
- | ID | Name | Status | Priority | RICE | Assignee | Updated |
49
-
50
- ### rank
51
- 1. List all planning/pending tasks
52
- 2. For each: estimate R, I, C, E
53
- 3. Calculate RICE scores
54
- 4. Show ranked result
55
- 5. Ask: confirm order? Then persist scores to task.json
56
-
57
- ### start
58
- 1. Run `python .qoder/scripts/task.py start <name>`
59
- 2. Status: planning -> in_progress, task becomes the active task
60
- 3. Load PRD + context, ready for /wl-spec or /wl-code
61
-
62
- ### finish
63
- 1. Run `python .qoder/scripts/task.py finish`
64
- 2. Status -> completed, active task pointer cleared
65
- 3. Record to learning system
66
- 4. Auto-sync: `python .qoder/scripts/team_sync.py push`
67
-
68
- ### archive
69
- 1. Run `python .qoder/scripts/task.py archive <name>`
70
- 2. Moves task to .qoder/archive/{YYYY-MM}/
71
- 3. Record completion metrics
242
+ ## 🔒 三道质量检查(create 时全跑,其它动作跳过)
243
+
244
+ 对齐 `/wl-prd-full` 的质量锁理念,保证任务不"飘":
245
+
246
+ | 检查 | 查什么 | 不过怎么办 |
247
+ |------|--------|-----------|
248
+ | **检查① 衔接锁** | PRD 的需求,task 的 tags 里有没有记 REQ-ID?标题有没有对上 PRD? | 补上 REQ-ID 关联,提示"可从 PRD 复制验收点到 task 的 prd.md" |
249
+ | **检查② 归属锁** | assignee 是谁?产品建的任务指派给开发了吗? | assignee 为空 → 问"指派给谁?",或默认当前开发者但显式提示 |
250
+ | **检查③ 阻塞锁** | 这个任务有没有依赖?依赖建对了吗?(产品常忘标依赖) | 列出可能的依赖任务,问"要不要 block 上?" |
251
+
252
+ > 这三道不是阻塞门(任务照样能建),而是**建完后顺手提醒**,降低"建了任务但没人接/卡死/孤儿"的概率。
253
+
254
+ ---
255
+
256
+ ## Storage(存储规则)
257
+
258
+ ```
259
+ 任务目录 workspace/tasks/{MM-DD-slug}/
260
+ ├── task.json 元数据(状态/优先级/RICE/依赖/assignee)
261
+ ├── prd.md PRD 模板(或引用已有 PRD)
262
+ ├── implement.jsonl 实现上下文(开发填)
263
+ └── check.jsonl 检查上下文(测试填)
264
+ 归档 → .qoder/archive/{YYYY-MM}/{MM-DD-slug}/
265
+ 活跃指针 .qoder/.current-task
266
+ ```
267
+
268
+ ---
269
+
270
+ ## 与上下游的衔接(7 站流水线)
271
+
272
+ ```
273
+ prd ──create(带REQ-ID)──→ task ──start──→ code/test ──finish/archive──→ 归档
274
+ ↑ ↓ rank ↓
275
+ PRD 的验收点 → task.prd.md RICE 排序 开发接 /wl-code
276
+ ```
277
+
278
+ | 方向 | 衔接点 |
279
+ |------|--------|
280
+ | 上游 prd | create 时把 REQ-ID 记进 tags,PRD 验收点贴进 task 的 prd.md |
281
+ | 下游 code/test | start 后,开发从 task 目录的 prd.md/spec 开始 `/wl-code` |
282
+ | 自身 | finish/archive 后任务出 list,但留在归档可追溯 |
283
+
284
+ ---
285
+
286
+ ## 路由小结
287
+
288
+ ```
289
+ /wl-task ← list 给全貌(语义:看任务)
290
+ /wl-task create <标题> ← 建任务(最高频)
291
+ /wl-task list --ready ← 看能立刻做的
292
+ /wl-task list --blocked ← 看卡住的
293
+ /wl-task show <名> ← 看详情
294
+ /wl-task start <名> ← 启动(移交开发)
295
+ /wl-task reassign <名> <开发> ← 改派任务负责人(PM 建完转给开发,多角色协作)
296
+ /wl-task finish ← 完成
297
+ /wl-task archive <名> ← 归档
298
+ /wl-task rank ← RICE 排优先级
299
+ /wl-task plan ← 甘特图/排期/依赖
300
+ ```
301
+
302
+ > 完整执行规则见 `.qoder/skills/wl-task/SKILL.md`(Quest/QoderWork 自然语言入口)。
@@ -1,42 +1,110 @@
1
1
  ---
2
2
  name: wl-test
3
- description: "Generate unit tests for implemented code. Needs confirmation."
4
- argument-hint: "[class-name or file-path]"
3
+ description: "测试工作流: 意图式用例 + Playwright MCP 执行 + 锚点缓存。"
4
+ argument-hint: "[quick|browser|unit] <描述或任务>"
5
5
  auto-approve: false
6
6
  allowed-tools: [Read, Glob, Grep, Bash, Write, Edit]
7
7
  ---
8
8
 
9
- # /wl-test - Generate Tests
9
+ # /wl-test - 测试
10
10
 
11
11
  User input: $ARGUMENTS
12
12
 
13
- ## Step 1: Find Target Code
13
+ > ⚠️ DANGEROUS(生成用例 + 可能驱动浏览器)。执行前向用户确认。
14
14
 
15
- If class-name provided, search for it:
16
- python .qoder/scripts/search_index.py <class-name>
17
- If no argument, use current task's implemented code.
15
+ ## 🔧 环境自检(QoderWork 桌面端 vs Qoder IDE/CLI)
18
16
 
19
- ## Step 2: Read Code + Spec
17
+ **先确定仓库根 R**(QoderWork 桌面端工作目录不是仓库根,相对路径会失效):
18
+ ```bash
19
+ R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
20
+ ```
21
+ > 后续脚本统一用 `python "$R/.qoder/scripts/xxx.py"`。
20
22
 
21
- Read the implementation file and related spec.
22
- Understand what needs to be tested.
23
+ ## 🚦 第一步:路由(看用户输入,立刻决定走哪条线)
23
24
 
24
- ## Step 3: Generate Tests
25
+ **判断 `$ARGUMENTS` 第一个词:**
26
+ - `unit` → 单元测试(读 test-generator skill,跳到本文末尾"unit"段)
27
+ - `browser` 或 含任务名(如 06-14-xxx) → 基于任务的浏览器测试(跳"browser"段)
28
+ - **`coverage` 或 "覆盖""盲区""哪些没测" → 测试覆盖矩阵(跳"coverage"段)**
29
+ - **其他全部 → quick 快速测试**(最常见,如"测一下登录""验下保险页面")
25
30
 
26
- Read test-generator skill for testing workflow.
27
- Generate tests covering:
28
- 1. Happy path for each function
29
- 2. Edge cases (null, empty, boundary values)
30
- 3. Error handling
31
- 4. Integration points
31
+ 用户说"quick 测一下登录" **quick**。
32
+ 用户没说任务名,只是随口"测一下 XX" → **quick**。
32
33
 
33
- ## Step 4: Self-Check
34
+ ---
35
+
36
+ ## quick 快速测试(默认 · 零搜索 · 最快)
37
+
38
+ **铁律:quick 模式不搜代码、不读源码、不查 API。** 用户说测什么,AI 直接据常识
39
+ +该页面的通用交互模式生成用例。平台/环境 AI 推断(web 默认、test 默认),
40
+ **只在真不确定平台时才问一句**。不要问地址、不要问登录方式——这些 config/文档里都有。
41
+
42
+ ### 流程(3 步,不绕弯)
43
+
44
+ **Step 1:AI 据用户描述生成用例 JSON。** 不搜代码。常见页面直接写:
45
+ - 登录页:goto /auth/login → 填账号密码 → 点登录 → 断言跳转
46
+ - 列表页:goto 列表 → 断言表格加载 → 翻页/筛选
47
+ - 表单页:goto → 填字段 → 提交 → 断言成功提示
48
+ 需要真实数据(账号/密码)用 `{{ask:描述}}` 占位,URL 用 `{{base_url}}`。
49
+ 正向 + 关键异常各一条。
50
+
51
+ **Step 2:调脚本,注入数据 + 出执行计划:**
52
+ ```bash
53
+ python "$R/.qoder/scripts/autotest.py" quick \
54
+ --cases '<Step1生成的JSON>' \
55
+ --desc "<用户描述>" --platform <web|app>
56
+ ```
57
+ 脚本自动:解析 test 环境域名 + 从个人文档注入账号密码 + 出执行计划。
58
+ 若提示"需要测试数据" → 逐项问用户,再用 `--data` 传。
59
+
60
+ **Step 3:执行由 QoderWork 浏览器连接器承担(真实场景)。**
61
+ 脚本只出计划,不自己开浏览器。无连接器 → 降级人工核对清单。
62
+ 跑完回传结果出报告:
63
+ ```bash
64
+ python "$R/.qoder/scripts/autotest.py" quick --record '{"Q-1":"pass","Q-2":"fail"}'
65
+ ```
66
+
67
+ ---
68
+
69
+ ## browser 基于任务的浏览器测试(需先有任务)
70
+
71
+ 用户明确给了任务名/回归某个任务时走这条。完整流程见 skill。
72
+
73
+ ```bash
74
+ python "$R/.qoder/scripts/task.py" list # 确认任务
75
+ python "$R/.qoder/scripts/autotest.py" generate <task> # 生成骨架
76
+ # AI 读任务 PRD「验收标准」补全 steps/expected(真实数据用 {{ask:}})
77
+ python "$R/.qoder/scripts/autotest.py" run <task> # 注入+出执行计划
78
+ python "$R/.qoder/scripts/autotest.py" run <task> --record '{"..":"pass"}' # 回收结果
79
+ ```
80
+
81
+ ---
82
+
83
+ ## coverage 测试覆盖矩阵(哪些功能有测试 / 哪些是空白)
84
+
85
+ 用户说"测试覆盖""哪些没测""回归盲区"时走这条。
86
+
87
+ **PREFERRED: MCP 工具(最快):**
88
+ ```
89
+ mcp__coverage_matrix()
90
+ ```
91
+
92
+ **FALLBACK: 直接看索引:**
93
+ ```bash
94
+ python -c "import json; d=json.load(open('$R/data/index/test-pages.json')); print(json.dumps(d,ensure_ascii=False,indent=2))"
95
+ ```
96
+
97
+ 输出:哪些功能/页面有测试用例(test-pages.json + test-assertions.json),哪些是空白。
98
+ AI 据此建议"优先补 XX 功能的测试"。
99
+
100
+ ---
34
101
 
35
- - [ ] Tests are runnable
36
- - [ ] Cover main scenarios
37
- - [ ] Use proper assertions
38
- - [ ] Follow team test conventions
102
+ ## unit 单元测试
39
103
 
40
- ## Step 5: Report
104
+ `.qoder/skills/test-generator/SKILL.md`:定位实现代码 读 spec → 生成
105
+ JUnit 测试(Mock + MockMvc,Given-When-Then)→ 输出 `tests/{package}/{Class}Test.java`。
106
+ (只有这条线才需要 search_index 找代码。)
41
107
 
42
- Tell user what tests were generated and suggest /wl-commit next.
108
+ ## 报告
109
+ - quick:用例表 + 执行结果(pass/fail),全过建议继续别的,失败列原因
110
+ - browser:同上 + 建议修复重跑或 `/wl-commit`
@@ -1,16 +1,27 @@
1
+ # 角色定义 (与 kg.py ROLE_SECTIONS 的 5 角色对齐)
2
+ # commands: 该角色建议主用的命令 (软引导, 不拦截 —— 任何角色都能跑任何命令)
3
+ # permissions: 声明式权限 (当前未强制执行, 留作未来硬权限墙)
1
4
  roles:
2
5
  pm:
3
- name: Product Manager
6
+ name: 产品经理
4
7
  permissions: [create_task, write_prd, approve_prd, review_spec]
5
- skills: [prd-generator, prd-review]
8
+ commands: [wl-init, wl-insight, wl-prd-full, wl-prd-quick, wl-prd-review, wl-design, wl-task, wl-search, wl-status, wl-report]
6
9
  design:
7
- name: Designer
10
+ name: 设计师
8
11
  permissions: [upload_design, approve_design]
9
- skills: [design-review]
12
+ commands: [wl-init, wl-design, wl-search, wl-status]
10
13
  dev:
11
- name: Developer
14
+ name: 开发
12
15
  permissions: [write_spec, implement, commit, review_code]
13
- skills: [spec-coder, test-generator]
16
+ commands: [wl-init, wl-spec, wl-code, wl-test, wl-search, wl-commit, wl-status]
17
+ test:
18
+ name: 测试
19
+ permissions: [run_test, review_acceptance]
20
+ commands: [wl-init, wl-test, wl-search, wl-status]
21
+ admin:
22
+ name: 管理员
23
+ permissions: [manage_index, manage_members, all]
24
+ commands: [wl-init, wl-status, wl-search, wl-report]
14
25
 
15
26
  pipeline:
16
27
  workspace_dir: workspace
@@ -21,6 +32,16 @@ pipeline:
21
32
  auto_spec_on_prd_push: true
22
33
  req_id_start: 1
23
34
 
35
+ # ── MySQL 只读 MCP (QAS 测试环境, 团队共享) ──
36
+ # mcp_launcher.py 启动 mysql MCP 时从这里读连接信息。
37
+ # 是测试库只读账号, 安全可进 git 团队共享。
38
+ mysql:
39
+ host: 10.54.6.9
40
+ port: 3306
41
+ user: fywl_ics_test
42
+ password: Fywl_ics_test56476
43
+ env_name: "QAS 测试环境"
44
+
24
45
  # ── Platforms (知识图谱/搜索的平台映射, 换项目改这里即可) ──
25
46
  # search_index.py --platform <key或alias> 会过滤到对应 project 目录
26
47
  platforms:
@@ -35,6 +56,24 @@ platforms:
35
56
  ui_stack: "Vant 3"
36
57
  prototype_template: .qoder/templates/prototype-app.html
37
58
 
59
+ # ── 自动化测试 (浏览器/E2E) ──
60
+ # /wl-test 浏览器测试用。base_url 留空=未配, run 时报错提示用 --url 或在此填。
61
+ # 命令行 --url > --env(查这里) > 报错。换部署地址改这里即可, 不用动脚本。
62
+ autotest:
63
+ default_env: test # /wl-test 不指定 --env 时的默认环境
64
+ environments:
65
+ test: # 测试环境
66
+ web: { base_url: "https://icsqas.inforecloud.com/" } # ← 填 fywl-ui 测试地址, 如 http://10.x.x.x:8080
67
+ app: { base_url: "" } # ← 填 Carmg-H5 测试地址
68
+ pre: # 预生产环境
69
+ web: { base_url: "https://icspre.inforecloud.com/" }
70
+ app: { base_url: "" }
71
+ prod: # 生产环境 (慎用, 会测真实数据)
72
+ web: { base_url: "https://ics.inforecloud.com/" }
73
+ app: { base_url: "" }
74
+ # 生成用例时从 PRD 哪些段抽取验收点 (AI 读 skill 时参考)
75
+ case_source_section: ["验收标准", "功能清单"]
76
+
38
77
  # ── 团队协作仓库 (workspace/ 产出 push 到这里) ──
39
78
  # 这是团队共享 PRD/任务/原型的仓库, 跟 data/code/ 的源码仓库不同。
40
79
  # setup.py init 时会交互式配置 git remote add origin <url>。
@@ -58,16 +97,16 @@ git_sync:
58
97
  projects:
59
98
  Carmg-H5:
60
99
  remote: origin
61
- url: http://10.87.106.228:8877/pengxicheng/Carmg-H5.git # ← 改成你的
62
- branch: jlzDEV # ← 改成你的主分支
100
+ url: http://10.87.106.228:8877/pengxicheng/Carmg-H5.git
101
+ branch: master
63
102
  fywl-ics:
64
103
  remote: origin
65
- url: http://10.87.106.228:8877/fywl-ics/fywl-ics.git # ← 改成你的
66
- branch: release-fix # ← 改成你的主分支
104
+ url: http://10.87.106.228:8877/fywl-ics/fywl-ics.git
105
+ branch: online
67
106
  fywl-ui:
68
107
  remote: origin
69
- url: http://10.87.106.228:8877/fywl-ics/fywl-ui.git # ← 改成你的
70
- branch: release-fix # ← 改成你的主分支
108
+ url: http://10.87.106.228:8877/fywl-ics/fywl-ui.git
109
+ branch: online
71
110
 
72
111
 
73
112
  prd_modes:
@@ -144,6 +183,3 @@ notification:
144
183
  console:
145
184
  type: console
146
185
  enabled: true
147
-
148
- codex:
149
- dispatch_mode: inline
@@ -113,8 +113,8 @@ def get_status():
113
113
 
114
114
  # Statuses written by task.py: planning -> in_progress -> completed
115
115
  GUIDE = {
116
- None: 'No active task. Use /wl-prd to start, or /wl-task create.',
117
- 'planning': 'Task in planning. Use /wl-prd to write the PRD, then /wl-task start.',
116
+ None: 'No active task. Use /wl-prd-full to start, or /wl-task create.',
117
+ 'planning': 'Task in planning. Use /wl-prd-full to write the PRD, then /wl-task start.',
118
118
  'in_progress': 'Dev in progress. /wl-spec to generate spec, /wl-code to implement.',
119
119
  'completed': 'Task completed. /wl-task archive to archive, or start the next one.',
120
120
  }