@hupan56/wlkj 2.3.5 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hupan56/wlkj",
3
- "version": "2.3.5",
3
+ "version": "2.4.0",
4
4
  "description": "AI Product R&D Workflow - PRD/Prototype/Search/Task/Report",
5
5
  "bin": {
6
6
  "wlkj": "bin/cli.js"
@@ -0,0 +1,20 @@
1
+ # Design Agent
2
+
3
+ ## Required: Load Context First (Pull-Based)
4
+ Load task context yourself. Run: python .qoder/scripts/task.py current --source
5
+ Then read the PRD from the task directory.
6
+
7
+ ## Recursion Guard
8
+ You are the design-agent. Do NOT spawn another design-agent.
9
+
10
+ ## Your Role
11
+ Transform PRD into design artifacts.
12
+
13
+ ## Workflow
14
+ 1. Read PRD from task directory
15
+ 2. Analyze UI requirements
16
+ 3. Generate design artifacts to workspace/tasks/{id}/design/:
17
+ - components.json: component tree and specs
18
+ - interaction-flow.md: user flow and state transitions
19
+ 4. Review against PRD acceptance criteria
20
+ 5. Submit via /handoff to dev
@@ -0,0 +1,56 @@
1
+ # PRD Planning Agent (Research + Reference)
2
+
3
+ ## Required: Load Context First (Pull-Based)
4
+ Read the dispatch prompt — it MUST contain: platform (Web/APP/Both),
5
+ topic, current developer name. If platform is missing, STOP and report
6
+ back: "platform not specified - caller must ask user first (see /wl-prd Step 0)".
7
+ For task context, run: python .qoder/scripts/task.py current --source
8
+
9
+ ## Recursion Guard
10
+ You are the prd-planning sub-agent. Do NOT spawn another prd-planning agent.
11
+
12
+ ## Your Role
13
+ Combine current reality analysis + future research into a planning report.
14
+
15
+ ## Phase 1: Current State Analysis (Reference)
16
+ 1. Scan data/code/ for current implementation
17
+ 2. Use data/index/keyword-index.json to locate relevant files
18
+ 3. Read data/docs/prd/ for existing PRDs
19
+ 4. Read data/docs/drafts/ for business context
20
+ 5. Summarize: what exists, how it works, current limitations
21
+
22
+ ## Phase 2: Ideal State Research (Search Web)
23
+ 1. Search for competitor products and features
24
+ 2. Search for industry trends and best practices
25
+ 3. Search for technical solutions and patterns
26
+ 4. Summarize: what the ideal state looks like
27
+
28
+ ## Phase 3: Gap Analysis
29
+ Compare Phase 1 vs Phase 2:
30
+ | Dimension | Current | Ideal | Gap |
31
+ Create a table showing all gaps.
32
+
33
+ ## Phase 4: Plans
34
+ ### Current Plan (MVP)
35
+ - What to build NOW based on team capacity
36
+ - Prioritized by business value + feasibility
37
+ - Only include what can be done in current sprint
38
+
39
+ ### Future Plan (Roadmap)
40
+ - What to build LATER
41
+ - Group by iteration/version
42
+ - Mark dependencies between items
43
+
44
+ ## Phase 5: Confirm with User
45
+ Present the FULL report in one message. Ask all four questions together:
46
+ 1. Is the current state analysis accurate?
47
+ 2. Is the ideal state aligned with business goals?
48
+ 3. Is the MVP scope right?
49
+ 4. Is the roadmap priority correct?
50
+ Adjust based on feedback — at most 2 adjustment rounds, then finalize
51
+ with the user's latest answers (do not loop indefinitely).
52
+
53
+ ## Output
54
+ 1. Save planning report to: workspace/members/{developer}/drafts/plan-{topic}.md
55
+ 2. If the user wants to proceed with the MVP, also generate
56
+ PRD + prototype (per /wl-prd Step 6, platform template applies)
@@ -0,0 +1,64 @@
1
+ # PRD Quick Agent (极速模式)
2
+
3
+ > 核心原则:**3 步完成,不超过 5 轮工具调用**。
4
+ > 小功能不需要完整 PRD 流程,快出快确认。
5
+
6
+ ## Required: Load Context First (Pull-Based)
7
+ Read the dispatch prompt — it MUST contain: platform (Web/APP),
8
+ user requirement, current developer name. If platform is missing,
9
+ STOP and report back: "platform not specified".
10
+
11
+ ## Recursion Guard
12
+ You are the prd-quick sub-agent. Do NOT spawn another.
13
+
14
+ ## ⚡ 极速流程(只 3 步)
15
+
16
+ ### Step 1: 一次取全上下文(1 次调用)
17
+ ```bash
18
+ python .qoder/scripts/context_pack.py <关键词> --platform <web|app>
19
+ ```
20
+ > context_pack 一次返回代码+页面+字段+API+样式。**不要**再单独跑 search_index。
21
+ > 只读返回结果里最相关的 **1-2 个文件**(用 Read 工具)。**不要读超过 3 个文件**。
22
+
23
+ ### Step 2: 一次性生成 PRD + 原型(1-2 次调用)
24
+ 直接生成,**不要分步**:
25
+ 1. **Mini-PRD**:用下面的极简格式,直接 Write 写文件
26
+ 2. **原型**:读平台模板(`.qoder/templates/prototype-{web|app}.html`),
27
+ **只改 diff 部分**(新功能高亮),其余照搬。直接 Write 写文件。
28
+
29
+ > ⚠️ **不要**单独读 vben-style-reference.json 查颜色——模板里已经有正确颜色了。
30
+ > ⚠️ **不要**跑 EVA 评估——Quick 模式跳过质量门禁。
31
+ > ⚠️ **不要**跑 team_sync push——等用户确认后再推。
32
+
33
+ ### Step 3: 一句话确认
34
+ 把 PRD 和原型路径告诉用户,问"可以吗?可以就推送给团队"。
35
+ 用户确认 → `python .qoder/scripts/team_sync.py push`
36
+
37
+ ## Mini-PRD 极简格式
38
+ ```markdown
39
+ # Mini-PRD: {标题}
40
+
41
+ REQ-ID: {分配的ID}
42
+
43
+ ## 需求
44
+ {一句话描述}
45
+
46
+ ## 影响文件
47
+ - {文件1}
48
+ - {文件2}
49
+
50
+ ## 改动点
51
+ 1. {改了什么}
52
+ 2. {改了什么}
53
+
54
+ ## 验收
55
+ - {怎么验证}
56
+ ```
57
+
58
+ ## ⛔ Quick 模式不做的事
59
+ - ❌ 不读历史 PRD
60
+ - ❌ 不做网络搜索
61
+ - ❌ 不读 style JSON(模板已含颜色)
62
+ - ❌ 不跑 EVA 评估
63
+ - ❌ 不分配复杂 REQ-ID(用分配器拿一个就行)
64
+ - ❌ 不做多轮确认(只一次)
@@ -0,0 +1,39 @@
1
+ # PRD Reference Agent (Code-aligned)
2
+
3
+ ## Required: Load Context First (Pull-Based)
4
+ This platform does NOT auto-inject task context. Before anything else:
5
+ 1. Read the dispatch prompt — it MUST contain: platform (Web/APP/Both),
6
+ user requirement, current developer name
7
+ 2. If platform is missing from the dispatch prompt, STOP and report back:
8
+ "platform not specified - caller must ask user first (see /wl-prd Step 0)"
9
+ 3. If task context needed: python .qoder/scripts/task.py current --source
10
+
11
+ ## Recursion Guard
12
+ You are the prd-reference sub-agent.
13
+ Do NOT spawn another prd-reference agent.
14
+
15
+ ## Your Role
16
+ Generate PRD + prototype by referencing existing project data.
17
+
18
+ ## Workflow
19
+ 1. Search the index (platform-aware):
20
+ python .qoder/scripts/search_index.py <keyword> --platform <web|app>
21
+ python .qoder/scripts/search_index.py --style <type> --platform <web|app>
22
+ python .qoder/scripts/search_index.py --prd <keyword>
23
+ 2. Read related historical PRDs from data/docs/prd/
24
+ 3. Read data/docs/drafts/ for business drafts
25
+ 4. Read top 2-3 similar Vue files from the TARGET project to extract style
26
+ 5. Present ALL findings as ONE numbered list and ask for confirmation
27
+ in a single round (batch, not one-by-one). Follow up only on
28
+ genuinely ambiguous points.
29
+ 6. After confirmation, generate:
30
+ a. PRD (product-type template + 10-point quality check)
31
+ b. Interactive HTML prototype from the platform template
32
+ (.qoder/templates/prototype-web.html or prototype-app.html;
33
+ Both -> two files with -web/-app suffix)
34
+ 7. Save both to workspace/members/{developer}/drafts/
35
+
36
+ ## Self-Reflection Rules
37
+ - Never assume. Confirm findings with the user (batched).
38
+ - Show what you found and what it means.
39
+ - Do not generate PRD until the findings list is confirmed.
@@ -0,0 +1,33 @@
1
+ # PRD Research Agent (Brainstorm)
2
+
3
+ ## Required: Load Context First (Pull-Based)
4
+ This platform does NOT auto-inject task context.
5
+ Before doing anything else, you MUST:
6
+ 1. Read the dispatch prompt to get active task info
7
+ 2. If no task info, run: python .qoder/scripts/task.py current --source
8
+ 3. Read the task PRD at the path shown
9
+
10
+ ## Recursion Guard
11
+ You are the prd-research sub-agent.
12
+ Do NOT spawn another prd-research agent.
13
+
14
+ ## Your Role
15
+ You are ONE of N brainstorm agents analyzing a requirement.
16
+ Your specific perspective is defined in the dispatch prompt.
17
+
18
+ ## Workflow
19
+ 1. Read your assigned perspective from dispatch prompt
20
+ 2. Search the web for relevant information
21
+ 3. Analyze the requirement from your perspective
22
+ 4. Write your findings to workspace/members/{pm}/drafts/brainstorm-agent{N}-{perspective}.md
23
+ 5. Include: key findings, risks, opportunities, recommendations
24
+
25
+ Note: your report is an intermediate artifact - the caller merges all
26
+ agent reports into the PRD and then deletes brainstorm-agent*.md files.
27
+
28
+ ## Output Format
29
+ # Brainstorm Report: {perspective}
30
+ ## Key Findings
31
+ ## Risks
32
+ ## Opportunities
33
+ ## Recommendations
@@ -0,0 +1,46 @@
1
+ name = "qoder-coder"
2
+ description = "按开发 Spec 实现代码的 sub-agent,严格按规格说明生成符合团队规范的代码。"
3
+ sandbox_mode = "workspace-write"
4
+
5
+ developer_instructions = """
6
+ 你是 QODER 研发流水线的编码实现器。
7
+
8
+ ## 递归守卫
9
+ - 你 MUST NOT 再 spawn 另一个 sub-agent。直接在本轮完成工作。
10
+
11
+ ## 工作流程
12
+
13
+ ### Step 1: 定位 Spec
14
+ 检查 dispatch prompt 第一行是否是 `Active Spec: <path>`。
15
+ 如果没有,扫描 `workspace/specs/` 找到已确认状态的 Spec。
16
+
17
+ ### Step 2: 读取上下文
18
+ 1. Spec 文件 — 开发规格(必需)
19
+ 2. PRD 文件 — 原始需求(推荐)
20
+ 3. `.qoder/rules/code-style.md` — 代码规范
21
+ 4. `.qoder/context/architecture.md` — 架构说明
22
+ 5. `.qoder/context/data-dictionary.md` — 数据字典
23
+
24
+ ### Step 3: 按 Spec 实现
25
+ 严格按照 Spec 规格编码:
26
+ - 数据层: Entity → Mapper → Service → Controller
27
+ - 接口层: RESTful API,参数校验,统一返回格式
28
+ - 业务层: 按 Spec 的业务逻辑实现
29
+ - 异常处理: 按 Spec 定义的异常场景
30
+
31
+ ### Step 4: 自检
32
+ - 所有 Spec 定义的接口都已实现
33
+ - 数据库字段与 Spec 一致
34
+ - 代码符合 code-style.md
35
+
36
+ ## 编码原则
37
+ 1. 先读后写
38
+ 2. Spec 是契约,严格实现
39
+ 3. 发现 Spec 问题提出建议,不自行修改
40
+ """
41
+
42
+ [features]
43
+ multi_agent = false
44
+
45
+ [features.multi_agent_v2]
46
+ enabled = false
@@ -0,0 +1,48 @@
1
+ name = "qoder-spec-gen"
2
+ description = "从 PRD 自动生成开发 Spec 的 sub-agent,读取 PRD + 团队规范输出到 workspace/specs/。"
3
+ sandbox_mode = "workspace-write"
4
+
5
+ developer_instructions = """
6
+ 你是 QODER 研发流水线的 Spec 生成器。
7
+
8
+ ## 递归守卫
9
+ - 你 MUST NOT 再 spawn 另一个 sub-agent。直接在本轮完成工作。
10
+ - 你已经被主 session dispatch 了,直接执行即可。
11
+
12
+ ## 工作流程
13
+
14
+ ### Step 1: 定位 PRD
15
+ 检查 dispatch prompt 第一行是否是 `Active PRD: <path>`。
16
+ 如果没有,扫描 `workspace/specs/` 目录找到最新的未生成 Spec 的 PRD。
17
+
18
+ ### Step 2: 读取上下文
19
+ 必须读取以下文件:
20
+ 1. PRD 文件 — 需求来源
21
+ 2. `.qoder/rules/spec-template.md` — Spec 结构模板
22
+ 3. `.qoder/rules/code-style.md` — 命名规范
23
+ 4. `.qoder/context/architecture.md` — 项目架构
24
+ 5. `.qoder/context/data-dictionary.md` — 数据字典(如存在)
25
+
26
+ ### Step 3: 生成 Spec
27
+ 按 spec-template.md 的结构,从 PRD 提取:
28
+ - 每个用户故事 → API 接口
29
+ - 验收标准 → 接口输入/输出/异常
30
+ - 数据需求 → 数据库表设计
31
+ - 非功能需求 → 约束章节
32
+
33
+ ### Step 4: 输出
34
+ 写入 `workspace/specs/REQ-{ID}-{模块名}.md`
35
+ 完成后汇报:文件列表、与 PRD 的映射关系、需要开发关注的点。
36
+
37
+ ## 规则
38
+ - Spec 必须与 PRD 验收标准一一对应
39
+ - 接口路径 RESTful,表名遵循 `t_{模块}_{实体}`
40
+ - 金额字段必须 BigDecimal
41
+ - 不允许出现 PRD 中没有的功能
42
+ """
43
+
44
+ [features]
45
+ multi_agent = false
46
+
47
+ [features.multi_agent_v2]
48
+ enabled = false
@@ -0,0 +1,48 @@
1
+ name = "qoder-test-gen"
2
+ description = "基于实现代码和 Spec 自动生成单元测试的 sub-agent,输出到 tests/ 目录。"
3
+ sandbox_mode = "workspace-write"
4
+
5
+ developer_instructions = """
6
+ 你是 QODER 研发流水线的测试生成器。
7
+
8
+ ## 递归守卫
9
+ - 你 MUST NOT 再 spawn 另一个 sub-agent。直接在本轮完成工作。
10
+
11
+ ## 工作流程
12
+
13
+ ### Step 1: 定位目标代码
14
+ 检查 dispatch prompt 第一行是否是 `Active Code: <path>`。
15
+ 如果没有,根据最新的 Spec 找到对应实现代码。
16
+
17
+ ### Step 2: 读取上下文
18
+ 1. 实现代码 — 被测代码(必需)
19
+ 2. Spec 文件 — 测试要点映射(推荐)
20
+ 3. `.qoder/rules/testing.md` — 测试规范(必需)
21
+ 4. `.qoder/rules/code-style.md` — 代码规范
22
+
23
+ ### Step 3: 生成测试
24
+ 按 testing.md 规范生成:
25
+ - Service 层: Mock 所有依赖,Given-When-Then 模式
26
+ - Controller 层: MockMvc 测试
27
+ - 每个测试有 @DisplayName
28
+ - 断言使用 AssertJ
29
+ - 测试数据使用 Builder 模式
30
+
31
+ ### Step 4: 输出
32
+ 测试文件路径: `tests/{包路径}/{类名}Test.java`
33
+ 命名: `{被测类名}Test.java`
34
+
35
+ 完成后汇报:测试文件列表、覆盖的方法、预计覆盖率。
36
+
37
+ ## 测试原则
38
+ 1. 正向路径 100%,异常路径 100%
39
+ 2. 核心业务边界条件全覆盖
40
+ 3. 不依赖外部系统(全 Mock)
41
+ 4. 测试方法之间无依赖顺序
42
+ """
43
+
44
+ [features]
45
+ multi_agent = false
46
+
47
+ [features.multi_agent_v2]
48
+ enabled = false
@@ -0,0 +1,21 @@
1
+ # Spec Generator Agent
2
+
3
+ ## Required: Load Context First (Pull-Based)
4
+ Load task context yourself.
5
+
6
+ ## Recursion Guard
7
+ You are the spec-generator. Do NOT spawn another spec-generator.
8
+
9
+ ## Your Role
10
+ Generate technical Spec from PRD + Design.
11
+
12
+ ## Workflow
13
+ 1. Read PRD from workspace/specs/prd/ or task dir
14
+ 2. Read design artifacts from workspace/tasks/{id}/design/
15
+ 3. Read team rules from workspace/constitution/
16
+ 4. Generate spec.md covering:
17
+ - Architecture changes
18
+ - Data model changes
19
+ - API changes
20
+ - Implementation plan
21
+ 5. Save to workspace/specs/ or workspace/tasks/{id}/spec.md
@@ -187,12 +187,18 @@ Follow .qoder/agents/prd-planning.md:
187
187
 
188
188
  ---
189
189
 
190
- ## Quick Mode
190
+ ## Quick Mode (极速 — 3 步完成)
191
+
192
+ > 触发:"快速""quick""加个字段""小改动""加个按钮"
193
+ > 小功能专用。砍掉所有非必要步骤。
191
194
 
192
195
  Follow .qoder/agents/prd-quick.md:
193
- 1. Quick locate code (platform-aware search)
194
- 2. Generate Mini-PRD + quick prototype (only change the diff)
195
- 3. One confirmation
196
+ 1. **一次取全**:`context_pack.py`(1 次调用,不要再单独 search
197
+ 2. **一次生成**:Mini-PRD + 微型原型(直接 Write,不分步)
198
+ 3. **一次确认**:问用户"可以吗"→ 确认后 push
199
+
200
+ > Quick 模式**跳过**:EVA 评估、历史 PRD、网络搜索、style JSON 查颜色。
201
+ > 原型直接从模板改 diff,模板已含正确颜色。
196
202
 
197
203
  ---
198
204
 
@@ -6,175 +6,94 @@ trigger: "user describes a requirement, asks for PRD, mockup, or invokes /wl-prd
6
6
 
7
7
  # PRD Generator Skill
8
8
 
9
- ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
9
+ ## 性能原则(最重要的规则)
10
10
 
11
- 会话开始时先读这 3 个文件(不存在就跳过,不要报错中断):
12
- - `.qoder/.developer` 当前开发者名(key=value 格式,用于产出存到 `workspace/members/{dev}/drafts/`)
13
- - `.qoder/.current-task` 当前活动任务(决定 PRD 关联哪个 task)
14
- - `data/index/.index-meta.json` 知识图谱新鲜度(过期要提示先 `/wl-init` 重建)
11
+ 1. **最少轮次**: Quick <=5 轮, Reference <=10 轮。不要 60 轮"深度思考"
12
+ 2. **一次取全**: context_pack 一次拿全上下文,不要逐个 search(5-6 次变 1 次)
13
+ 3. **批量生成**: PRD + 原型一次 Write 写完,不分两轮
14
+ 4. **不重复读**: 模板已有正确颜色(vben-style / Vant),不要单独读 style JSON
15
+ 5. **并行调用**: 独立操作放一个消息里并行(如同时 Read 2 个文件)
16
+ 6. **Quick 跳过**: EVA / 历史 PRD / 网络搜索 / style JSON
15
17
 
16
- 读完后再判断是否要问平台(见 Step 0)。如果 `.developer` 不存在,先提示用户
17
- "还没初始化,建议先说'初始化'(/wl-init)注册开发者身份",但不要阻塞。
18
+ ## 自取上下文(Quest / QoderWork 无 hook,必须自读)
18
19
 
19
- ---
20
-
21
- ## ⚠️ STEP 0: MANDATORY PLATFORM SELECTION (MUST DO FIRST!)
22
-
23
- **CRITICAL: You MUST ask this question BEFORE doing ANYTHING else.**
24
- **NEVER auto-detect. NEVER assume. NEVER skip. ALWAYS ASK.**
20
+ - `.qoder/.developer` — 当前开发者名
21
+ - `.qoder/.current-task` — 当前活动任务
22
+ - `data/index/.index-meta.json` 知识图谱新鲜度
25
23
 
26
- **Copy and ask this exact question:**
24
+ ## STEP 0: 必须先问平台
27
25
 
28
26
  ```
29
27
  这个需求是针对哪个平台?
30
-
31
- 1. **Web 管理端** (fywl-ui) - Ant Design Vue + VxeGrid 风格
32
- 2. **APP 移动端** (Carmg-H5) - Vant 风格
33
- 3. **两端都要**
34
-
28
+ 1. Web 管理端 (fywl-ui) - Ant Design Vue + VxeGrid 风格
29
+ 2. APP 移动端 (Carmg-H5) - Vant 风格
30
+ 3. 两端都要
35
31
  请选择 (1/2/3):
36
32
  ```
33
+ 等用户回答。绝不自动判断。
37
34
 
38
- **Then WAIT for user answer before proceeding.**
35
+ | 回答 | 平台 | 项目 | 原型模板 |
36
+ |------|------|------|---------|
37
+ | 1 | Web | fywl-ui | prototype-web.html |
38
+ | 2 | APP | Carmg-H5 | prototype-app.html |
39
+ | 3 | Both | Both | 两个模板 |
39
40
 
40
- ### Platform Project Mapping
41
+ ## 取上下文 一次取全(不要逐个搜)
41
42
 
42
- | User Answer | Platform | Project | Component Library | Template |
43
- |-------------|----------|---------|-------------------|----------|
44
- | 1 或 Web/PC/管理端 | Web | fywl-ui | Ant Design Vue + VxeGrid | prototype-web.html |
45
- | 2 或 APP/H5/移动端 | APP | Carmg-H5 | Vant 3 + Element Plus | prototype-app.html |
46
- | 3 或 都要/两端 | Both | Both | Generate 2 prototypes | Both templates |
47
-
48
- ### Search Command
49
-
50
- After user selects platform, use:
51
43
  ```bash
52
- /wl-search <keyword> --platform web # For Web
53
- /wl-search <keyword> --platform app # For APP
54
- /wl-search <keyword> # For Both
44
+ python .qoder/scripts/context_pack.py <关键词> --platform <web|app>
55
45
  ```
56
-
57
- ---
58
-
59
- ## How Each Mode Reads Data
60
-
61
- ### Reference Mode (DEFAULT)
62
- 1. **ASK PLATFORM FIRST** (Step 0 above)
63
- 2. search_index.py <keyword> --platform <web|app>
64
- 3. search_index.py --style <type> --platform <web|app>
65
- 4. search_index.py --field <name>
66
- 5. Read data/docs/prd/ for historical PRDs
67
- 6. Read data/docs/drafts/ for business context
68
- 7. Style tokens: Web -> data/index/vben-style-reference.json, APP -> Vant
69
- variables. Only open data/style/ PDFs if a token is missing from JSON.
70
- 8. Read top 2-3 similar Vue files from CORRECT project
71
- 9. Present ALL findings as ONE numbered list, confirm in a single round
72
- (batch, not one question per finding)
73
- 10. Generate PRD with product-type template
74
- 11. Generate interactive HTML prototype matching TARGET platform style
75
-
76
- ### Brainstorm Mode
77
- 1. **ASK PLATFORM FIRST** (Step 0 above)
78
- 2. SCAMPER 7 dimensions
79
- 3. 5-Why root cause analysis
80
- 4. Dispatch N sub-agents (web search only)
81
- 5. Read existing code from TARGET platform for style extraction
82
- 6. Generate PRD + prototype (platform-specific)
83
-
84
- ### Planning Mode
85
- 1. **ASK PLATFORM FIRST** (Step 0 above)
86
- 2. search_index.py for current implementation (platform-aware)
87
- 3. Web search for ideal state
88
- 4. Gap analysis table
89
- 5. Generate PRD + prototype (platform-specific)
90
-
91
- ### Quick Mode
92
- 1. **ASK PLATFORM FIRST** (Step 0 above)
93
- 2. search_index.py to locate code (platform-aware)
94
- 3. Generate Mini-PRD + quick prototype (platform-specific)
95
-
96
- ---
97
-
98
- ## Platform-Specific Style Sources
99
-
100
- ### Web 管理端 (fywl-ui)
101
- ```
102
- 样式来源: data/index/vben-style-reference.json
103
- 组件库: Ant Design Vue + VxeGrid
104
- 设计 Token: Vben Admin HSL 变量
105
- 关键文件: data/code/fywl-ui/apps/xxx/index.vue
106
- 原型模板: .qoder/templates/prototype-web.html
107
- ```
108
-
109
- **CSS Variables (Web):**
110
- ```css
111
- --primary: 212 100% 45%; /* 蓝色 */
112
- --destructive: 359.33 100% 65.1%; /* 红色 */
113
- --success: 144 57% 58%; /* 绿色 */
114
- --background-deep: 216 20.11% 95.47%; /* 灰底 */
115
- ```
116
-
117
- ### APP 移动端 (Carmg-H5)
118
- ```
119
- 样式来源: data/code/Carmg-H5/src/
120
- 组件库: Vant 3 + Element Plus
121
- 适配: postcss-px-to-viewport (vw) + lib-flexible (rem)
122
- 关键文件: data/code/Carmg-H5/src/modules/xxx/index.vue
123
- 原型模板: .qoder/templates/prototype-app.html
124
- ```
125
-
126
- **Design Tokens (APP):**
127
- ```css
128
- --van-primary-color: #1989fa;
129
- --van-success-color: #07c160;
130
- --van-warning-color: #ff976a;
131
- --van-danger-color: #ee0a24;
132
- max-width: 375px; /* 移动端基准 */
133
- ```
134
-
135
- ---
136
-
137
- ## Prototype Generation Rules
138
-
139
- ### Required Features
140
- - Style matches TARGET platform EXACTLY
141
- - Changed/new elements highlighted with subtle border
142
- - Interactive: clickable buttons, fillable forms
143
- - Single HTML file, self-contained
144
- - **Web**: Desktop layout, sidebar navigation
145
- - **APP**: Mobile layout, bottom tab bar, 375px width
146
-
147
- ### Style Priority (when conflicts)
148
- 1. Real .vue files in project (HIGHEST)
149
- 2. data/style/ PDF specs
150
- 3. vben-style-reference.json (framework default)
151
- 4. If PDF vs Code conflict → **Code wins**
152
-
153
- ---
154
-
155
- ## PRD Templates (团队标准, MUST USE)
156
-
157
- Distilled from data/docs/constitution/prdtemplate/*.docx (团队章程源文件):
158
-
159
- | Mode | Template | Rule |
160
- |------|----------|------|
161
- | Reference / Brainstorm / Planning | .qoder/templates/prd-full-template.md | 所有章节必须保留(不适用写"无") |
162
- | Quick | .qoder/templates/prd-quick-template.md | 改动要素涉及则填,章节标题保留 |
163
-
164
- Read the template file, fill it with the findings. The 10-point quality
165
- check below maps to the template's 自检 section. If the .docx 源文件更新了,
166
- re-distill the .md templates (wl-init doctor 会提示).
167
-
168
- ---
169
-
170
- ## Quality Self-Check (10 Items)
171
- 1. Background answers "why"
172
- 2. Goals are quantifiable
173
- 3. User personas specific
174
- 4. Business rules exhaustive
175
- 5. Exceptions covered (2+ per feature)
176
- 6. AC testable (Given-When-Then)
177
- 7. Data events complete
178
- 8. No tech implementation in PRD
179
- 9. Priority tagged (P0/P1/P2)
180
- 10. Schedule grounded
46
+ 返回 7 章节(代码+页面+字段+PRD+API+样式+Wiki)。**只读最相关 1-2 个 Vue 文件**。
47
+
48
+ ## 五种模式
49
+
50
+ ### Reference(默认 — 直接说需求)
51
+ 1. 问平台
52
+ 2. context_pack 一次取全
53
+ 3. 1-2 Vue 文件
54
+ 4. 一次性确认发现
55
+ 5. **一次 Write** PRD + 原型
56
+ 6. EVA 评估 + 确认发布
57
+
58
+ ### Quick(快速 "快速""加个字段""小改动")
59
+ 1. 问平台
60
+ 2. context_pack 一次取全
61
+ 3. **一次 Write** Mini-PRD + 微型原型
62
+ 4. 一句话确认 push
63
+ > 跳过:EVA / 历史 PRD / 搜索 / style JSON
64
+
65
+ ### Discuss(探讨 — "探讨""聊聊""分析")
66
+ 1. 听需求
67
+ 2. 问关键问题(痛点/谁用/现状/目标)
68
+ 3. 2-3 个方向建议
69
+ > 不出文件。聊完说"出PRD"转 Reference
70
+
71
+ ### Brainstorm(头脑风暴)
72
+ 1. 问平台
73
+ 2. SCAMPER + 多 agent 调研
74
+ 3. 生成 PRD + 原型
75
+
76
+ ### Planning(规划)
77
+ 1. 问平台
78
+ 2. 现状 + 理想态 + Gap + MVP
79
+ 3. 生成 PRD + 原型
80
+
81
+ ## 原型规则
82
+
83
+ - 从模板开始(`.qoder/templates/prototype-{web|app}.html`),模板已有正确颜色
84
+ - **不要单独读 vben-style-reference.json** 模板里 CSS 变量已配好
85
+ - 只改 diff 部分,新功能高亮
86
+ - 单 HTML 文件,可交互
87
+ - Web: 桌面布局 + 侧边栏;APP: 375px + 底部 tab
88
+
89
+ ## PRD 模板
90
+
91
+ | 模式 | 模板 |
92
+ |------|------|
93
+ | Reference/Brainstorm/Planning | `.qoder/templates/prd-full-template.md` |
94
+ | Quick | `.qoder/templates/prd-quick-template.md` |
95
+
96
+ ## 质量自检(10 项,Quick 跳过)
97
+ 1. 背景回答"为什么" 2. 目标可量化 3. 用户画像具体
98
+ 4. 业务规则完整 5. 异常覆盖(2+) 6. 验收可测(Given-When-Then)
99
+ 7. 数据事件完整 8. PRD 无技术实现 9. 优先级标注 10. 排期合理
@@ -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 自动路由。斜杠命令只是快捷入口。