@hupan56/wlkj 2.7.12 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +344 -78
- package/package.json +29 -29
- package/templates/.qoder/.runtime/ctx-cache-5660152f1d6dd819.md +23 -0
- package/templates/.qoder/.runtime/ctx-cache-afdce0dac06b25b0.md +23 -0
- package/templates/.qoder/.runtime/search-cache-eae7644e7b122f35.txt +1 -0
- package/templates/.qoder/learning/eval-history.jsonl +28 -0
- package/templates/data/index/wiki-index.json +8 -0
- package/templates/qoder/agents/insight-planning.md +1 -1
- package/templates/qoder/agents/insight-research.md +28 -15
- package/templates/qoder/commands/optional/wl-insight.md +159 -161
- package/templates/qoder/commands/optional/wl-report.md +4 -4
- package/templates/qoder/commands/optional/wl-status.md +2 -2
- package/templates/qoder/commands/wl-code.md +2 -2
- package/templates/qoder/commands/wl-design.md +2 -2
- package/templates/qoder/commands/wl-init.md +3 -3
- package/templates/qoder/commands/wl-prd.md +2 -2
- package/templates/qoder/commands/wl-req.md +43 -0
- package/templates/qoder/commands/wl-search.md +8 -8
- package/templates/qoder/commands/wl-task.md +17 -17
- package/templates/qoder/commands/wl-test.md +41 -15
- package/templates/qoder/config.yaml +17 -1
- package/templates/qoder/hooks/session-start.py +12 -22
- package/templates/qoder/nul +4 -0
- package/templates/qoder/rules/wl-pipeline.md +22 -48
- package/templates/qoder/scripts/README.md +139 -0
- package/templates/qoder/scripts/common/autotest_auth.py +109 -0
- package/templates/qoder/scripts/common/bootstrap.py +145 -0
- package/templates/qoder/scripts/common/check_publish.py +98 -0
- package/templates/qoder/scripts/common/cmd_registry.py +112 -0
- package/templates/qoder/scripts/common/config.py +187 -0
- package/templates/qoder/scripts/common/contract.py +317 -0
- package/templates/qoder/scripts/common/developer.py +2 -1
- package/templates/qoder/scripts/common/feishu.py +10 -9
- package/templates/qoder/scripts/common/guard.py +159 -0
- package/templates/qoder/scripts/common/identity.py +121 -2
- package/templates/qoder/scripts/common/kg_capabilities.py +182 -0
- package/templates/qoder/scripts/common/mcp_base.py +268 -0
- package/templates/qoder/scripts/common/paths.py +187 -1
- package/templates/qoder/scripts/common/result.py +223 -0
- package/templates/qoder/scripts/common/roles.py +60 -0
- package/templates/qoder/scripts/common/task_utils.py +21 -9
- package/templates/qoder/scripts/common/test_extract.py +115 -0
- package/templates/qoder/scripts/kg/__init__.py +11 -0
- package/templates/qoder/scripts/kg/build_entity_registry.py +196 -0
- package/templates/qoder/scripts/kg/build_relations.py +127 -0
- package/templates/qoder/scripts/{build_style_index.py → kg/build_style_index.py} +39 -10
- package/templates/qoder/scripts/kg/build_workflows.py +144 -0
- package/templates/qoder/scripts/{context_pack.py → kg/context_pack.py} +18 -11
- package/templates/qoder/scripts/{enrich_prompt.py → kg/enrich_prompt.py} +232 -226
- package/templates/qoder/scripts/{extract_api_params.py → kg/extract.py} +398 -246
- package/templates/qoder/scripts/{kg.py → kg/kg.py} +638 -708
- package/templates/qoder/scripts/{kg_build.py → kg/kg_build.py} +618 -612
- package/templates/qoder/scripts/{kg_build_db.py → kg/kg_build_db.py} +333 -327
- package/templates/qoder/scripts/{kg_duckdb.py → kg/kg_duckdb.py} +38 -37
- package/templates/qoder/scripts/{kg_incremental.py → kg/kg_incremental.py} +420 -393
- package/templates/qoder/scripts/{kg_link_db.py → kg/kg_link_db.py} +230 -224
- package/templates/qoder/scripts/{kg_semantic.py → kg/kg_semantic.py} +156 -150
- package/templates/qoder/scripts/kg/prefetch.py +359 -0
- package/templates/qoder/scripts/{search_index.py → kg/search_index.py} +70 -14
- package/templates/qoder/scripts/mcp/__init__.py +11 -0
- package/templates/qoder/scripts/{kg_mcp_server.py → mcp/kg_mcp_server.py} +77 -272
- package/templates/qoder/scripts/{lanhu_stdio_wrapper.py → mcp/lanhu_stdio_wrapper.py} +125 -119
- package/templates/qoder/scripts/{check_mcp.py → mcp/mcp_doctor.py} +515 -298
- package/templates/qoder/scripts/{mcp_launcher.py → mcp/mcp_launcher.py} +442 -414
- package/templates/qoder/scripts/{mysql_mcp_server.py → mcp/mysql_mcp_server.py} +347 -396
- package/templates/qoder/scripts/{zentao_mcp_server.py → mcp/zentao_mcp_server.py} +384 -424
- package/templates/qoder/scripts/report/__init__.py +11 -0
- package/templates/qoder/scripts/{add_session.py → report/add_session.py} +250 -244
- package/templates/qoder/scripts/{archive_prd.py → report/archive_prd.py} +383 -377
- package/templates/qoder/scripts/{eval_prd.py → report/eval_prd.py} +73 -11
- package/templates/qoder/scripts/{export.py → report/export.py} +63 -0
- package/templates/qoder/scripts/{fill_prototype.py → report/fill_prototype.py} +6 -0
- package/templates/qoder/scripts/{gen_design_doc.py → report/gen_design_doc.py} +400 -394
- package/templates/qoder/scripts/{learn.py → report/learn.py} +152 -146
- package/templates/qoder/scripts/{learn_aggregate.py → report/learn_aggregate.py} +207 -201
- package/templates/qoder/scripts/{report.py → report/report.py} +287 -281
- package/templates/qoder/scripts/report/req.py +222 -0
- package/templates/qoder/scripts/report/role.py +33 -0
- package/templates/qoder/scripts/{status.py → report/status.py} +634 -628
- package/templates/qoder/scripts/setup/__init__.py +11 -0
- package/templates/qoder/scripts/setup/carriers.py +662 -0
- package/templates/qoder/scripts/{init_doctor.py → setup/init_doctor.py} +63 -26
- package/templates/qoder/scripts/{install_qoderwork.py → setup/install_qoderwork.py} +36 -26
- package/templates/qoder/scripts/{platform_doctor.py → setup/platform_doctor.py} +265 -259
- package/templates/qoder/scripts/{repo_root.py → setup/repo_root.py} +112 -106
- package/templates/qoder/scripts/{setup.py → setup/setup.py} +113 -4
- package/templates/qoder/scripts/{setup_lanhu.py → setup/setup_lanhu.py} +973 -963
- package/templates/qoder/scripts/task/__init__.py +11 -0
- package/templates/qoder/scripts/{git_sync.py → task/git_sync.py} +52 -31
- package/templates/qoder/scripts/{syncgate.py → task/syncgate.py} +6 -0
- package/templates/qoder/scripts/task/task.py +221 -0
- package/templates/qoder/scripts/task/task_lifecycle.py +596 -0
- package/templates/qoder/scripts/task/task_query.py +161 -0
- package/templates/qoder/scripts/task/task_relations.py +424 -0
- package/templates/qoder/scripts/{team_sync.py → task/team_sync.py} +93 -20
- package/templates/qoder/scripts/test/__init__.py +11 -0
- package/templates/qoder/scripts/{autotest.py → test/autotest.py} +1174 -1751
- package/templates/qoder/scripts/{autotest_batch.py → test/autotest_batch.py} +242 -224
- package/templates/qoder/scripts/test/autotest_data.py +675 -0
- package/templates/qoder/scripts/{autotest_run.py → test/autotest_run.py} +309 -297
- package/templates/qoder/scripts/{benchmark.py → test/benchmark.py} +6 -0
- package/templates/qoder/scripts/{kg_auto_login.py → test/kg_auto_login.py} +202 -196
- package/templates/qoder/scripts/{kg_test_runner.py → test/kg_test_runner.py} +7 -1
- package/templates/qoder/scripts/{page_probe.py → test/page_probe.py} +465 -459
- package/templates/qoder/scripts/wlkj.py +116 -0
- package/templates/qoder/settings.json +1 -10
- package/templates/qoder/skills/design-import/SKILL.md +226 -226
- package/templates/qoder/skills/design-review/SKILL.md +82 -82
- package/templates/qoder/skills/prd-generator/SKILL.md +26 -16
- package/templates/qoder/skills/prd-review/SKILL.md +5 -5
- package/templates/qoder/skills/prototype-generator/SKILL.md +256 -256
- package/templates/qoder/skills/spec-coder/SKILL.md +4 -4
- package/templates/qoder/skills/spec-generator/SKILL.md +4 -4
- package/templates/qoder/skills/test-generator/SKILL.md +5 -5
- package/templates/qoder/skills/wl-code/SKILL.md +4 -4
- package/templates/qoder/skills/wl-commit/SKILL.md +4 -4
- package/templates/qoder/skills/wl-design/SKILL.md +3 -3
- package/templates/qoder/skills/wl-init/SKILL.md +8 -8
- package/templates/qoder/skills/wl-insight/SKILL.md +5 -5
- package/templates/qoder/skills/wl-prd-full/SKILL.md +6 -6
- package/templates/qoder/skills/wl-prd-quick/SKILL.md +6 -6
- package/templates/qoder/skills/wl-prd-review/SKILL.md +4 -4
- package/templates/qoder/skills/wl-report/SKILL.md +7 -7
- package/templates/qoder/skills/wl-search/SKILL.md +13 -13
- package/templates/qoder/skills/wl-spec/SKILL.md +5 -5
- package/templates/qoder/skills/wl-status/SKILL.md +5 -5
- package/templates/qoder/skills/wl-task/SKILL.md +6 -6
- package/templates/qoder/skills/wl-test/SKILL.md +102 -39
- package/templates/root/AGENTS.md +39 -40
- package/templates/qoder/hooks/inject-workflow-state.py +0 -169
- package/templates/qoder/scripts/__pycache__/check_mcp_launch.cpython-39.pyc +0 -0
- package/templates/qoder/scripts/__pycache__/install_qoderwork.cpython-39.pyc +0 -0
- package/templates/qoder/scripts/__pycache__/mcp_launcher.cpython-39.pyc +0 -0
- package/templates/qoder/scripts/__pycache__/platform_doctor.cpython-39.pyc +0 -0
- package/templates/qoder/scripts/check_carriers.py +0 -238
- package/templates/qoder/scripts/check_mcp_launch.py +0 -183
- package/templates/qoder/scripts/check_qoderwork_consistency.py +0 -166
- package/templates/qoder/scripts/collect_prds.py +0 -31
- package/templates/qoder/scripts/common/mentions.py +0 -134
- package/templates/qoder/scripts/common/utf8.py +0 -38
- package/templates/qoder/scripts/extract_routes.py +0 -54
- package/templates/qoder/scripts/extract_routes_tree.py +0 -78
- package/templates/qoder/scripts/handoff.py +0 -22
- package/templates/qoder/scripts/init_developer.py +0 -76
- package/templates/qoder/scripts/parse_prds.py +0 -33
- package/templates/qoder/scripts/role.py +0 -51
- package/templates/qoder/scripts/sync_carriers.py +0 -259
- package/templates/qoder/scripts/task.py +0 -1261
- package/templates/qoder/scripts/workspace_init.py +0 -102
- package/templates/qoder/skills/prompt-enrich/SKILL.md +0 -90
- package/templates/qoder/skills/prototype-generator/SKILL.md.zcode-79180-2af4721f-f9a6-412c-88db-c0af680d211b.tmp +0 -0
- /package/templates/qoder/scripts/{secure-ls.js → test/secure-ls.js} +0 -0
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
"""
|
|
4
|
-
QODER Pipeline - Workspace Init
|
|
5
|
-
|
|
6
|
-
Creates personal workspace under team workspace:
|
|
7
|
-
workspace/members/{developer}/
|
|
8
|
-
journal/
|
|
9
|
-
drafts/
|
|
10
|
-
inbox/
|
|
11
|
-
|
|
12
|
-
Also syncs latest from git (git pull).
|
|
13
|
-
|
|
14
|
-
Usage:
|
|
15
|
-
python .qoder/scripts/workspace_init.py <developer-name>
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
from __future__ import annotations
|
|
19
|
-
|
|
20
|
-
import os
|
|
21
|
-
import subprocess
|
|
22
|
-
import sys
|
|
23
|
-
from datetime import datetime
|
|
24
|
-
from pathlib import Path
|
|
25
|
-
|
|
26
|
-
# Add scripts to path
|
|
27
|
-
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
28
|
-
|
|
29
|
-
from common.paths import get_repo_root, get_developer, FILE_DEVELOPER
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def init_workspace(name: str) -> bool:
|
|
33
|
-
"""Initialize personal workspace under team workspace."""
|
|
34
|
-
if not name:
|
|
35
|
-
print("Error: developer name required", file=sys.stderr)
|
|
36
|
-
return False
|
|
37
|
-
|
|
38
|
-
repo_root = get_repo_root()
|
|
39
|
-
|
|
40
|
-
# 1. Create .developer file in .qoder/ (engine)
|
|
41
|
-
dev_file = repo_root / ".qoder" / FILE_DEVELOPER
|
|
42
|
-
if dev_file.is_file():
|
|
43
|
-
existing = get_developer(repo_root)
|
|
44
|
-
if existing:
|
|
45
|
-
print(f"Developer already: {existing}")
|
|
46
|
-
print(f"Workspace: workspace/members/{existing}/")
|
|
47
|
-
return True
|
|
48
|
-
|
|
49
|
-
dev_file.write_text(
|
|
50
|
-
f"name={name}\ninitialized_at={datetime.now().isoformat()}\n",
|
|
51
|
-
encoding="utf-8"
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
# 2. Create personal workspace under team workspace
|
|
55
|
-
personal = repo_root / "workspace" / "members" / name
|
|
56
|
-
for sub in ["journal", "drafts", "inbox"]:
|
|
57
|
-
(personal / sub).mkdir(parents=True, exist_ok=True)
|
|
58
|
-
|
|
59
|
-
# 3. Create initial journal
|
|
60
|
-
today = datetime.now().strftime("%Y-%m-%d")
|
|
61
|
-
journal = personal / "journal" / f"journal-1.md"
|
|
62
|
-
if not journal.exists():
|
|
63
|
-
journal.write_text(
|
|
64
|
-
f"# Journal - {name}\n\n> Started: {today}\n\n---\n\n",
|
|
65
|
-
encoding="utf-8"
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
# 4. Git pull (sync latest)
|
|
69
|
-
try:
|
|
70
|
-
result = subprocess.run(
|
|
71
|
-
["git", "pull"],
|
|
72
|
-
capture_output=True, text=True, cwd=str(repo_root), timeout=30
|
|
73
|
-
)
|
|
74
|
-
pull_msg = result.stdout.strip() if result.returncode == 0 else "already up to date"
|
|
75
|
-
except Exception:
|
|
76
|
-
pull_msg = "skipped (no remote)"
|
|
77
|
-
|
|
78
|
-
print(f"Developer: {name}")
|
|
79
|
-
print(f"Personal workspace: workspace/members/{name}/")
|
|
80
|
-
print(f" journal/ session logs")
|
|
81
|
-
print(f" drafts/ personal drafts")
|
|
82
|
-
print(f" inbox/ pending items")
|
|
83
|
-
print(f"Git sync: {pull_msg}")
|
|
84
|
-
return True
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
def main():
|
|
88
|
-
if len(sys.argv) < 2:
|
|
89
|
-
print("Usage: python .qoder/scripts/workspace_init.py <your-name>")
|
|
90
|
-
print("Example: python .qoder/scripts/workspace_init.py zhangsan")
|
|
91
|
-
sys.exit(1)
|
|
92
|
-
|
|
93
|
-
name = sys.argv[1]
|
|
94
|
-
if init_workspace(name):
|
|
95
|
-
print("\nNext: say 'help me generate PRD' in Qoder to start pipeline")
|
|
96
|
-
sys.exit(0)
|
|
97
|
-
else:
|
|
98
|
-
sys.exit(1)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if __name__ == "__main__":
|
|
102
|
-
main()
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: prompt-enrich
|
|
3
|
-
description: "提问润色(第0步): 用户每条消息后先跑极速润色(<10ms), 定位业务上下文, 输出润色结果给用户确认, 再走原命令。触发: 每条含业务词的用户消息。"
|
|
4
|
-
trigger: "用户每条消息(含业务关键词时)"
|
|
5
|
-
always_apply: true
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## 🔧 仓库根定位(QoderWork 桌面端 vs Qoder IDE/CLI)
|
|
10
|
-
|
|
11
|
-
**后续脚本里的 `$R` 代表仓库根**,先确定它(QoderWork 桌面端工作目录不是仓库根,相对路径会失效):
|
|
12
|
-
```bash
|
|
13
|
-
R=$(python ~/.qoderwork/repo_root.py 2>/dev/null) || R=.
|
|
14
|
-
```
|
|
15
|
-
> `repo_root.py` 从 `~/.qoderwork/mcp.json` 反推仓库根;失败回退 `.`(IDE/CLI 工作目录即仓库根)。找不到时先跑 `python .qoder/scripts/install_qoderwork.py`。
|
|
16
|
-
|
|
17
|
-
# prompt-enrich — 提问润色(每个命令的第 0 步)
|
|
18
|
-
|
|
19
|
-
> **这是什么**:用户提问后,先极速判断这句话命中哪些业务上下文,输出一个「润色后的提示词」给用户确认,再走原命令。
|
|
20
|
-
> **不是什么**:不是独立命令,是内置在每条消息处理前的第 0 步。
|
|
21
|
-
|
|
22
|
-
## 🚦 执行规则(每条用户消息都适用)
|
|
23
|
-
|
|
24
|
-
收到用户消息后,**在做任何其它事之前**,先判断:
|
|
25
|
-
|
|
26
|
-
### 第 0 步:极速润色(必须最先做)
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
python "$R/.qoder/scripts/enrich_prompt.py" "<用户原话>" --json
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
- 脚本纯内存查表,实测 **< 50ms**(冷启动含索引加载;热态 < 10ms)
|
|
33
|
-
- 不跑重检索(那个留到确认后)
|
|
34
|
-
|
|
35
|
-
**看返回的 `is_business` 字段**:
|
|
36
|
-
|
|
37
|
-
| is_business | 意思 | 你怎么做 |
|
|
38
|
-
|-------------|------|----------|
|
|
39
|
-
| `false` | 非业务消息(谢谢/继续/确认润色等) | **跳过润色**,直接处理用户请求 |
|
|
40
|
-
| `true` | 业务消息 | **输出润色块**,等用户确认 |
|
|
41
|
-
|
|
42
|
-
### is_business=true 时,输出润色块(严格按这个格式)
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
🔎 极速润色(Xms)— 直接用或回复「改:xxx」调整
|
|
46
|
-
─────────────────────────────────────
|
|
47
|
-
业务词: insurance, approval, abnormal...
|
|
48
|
-
相关代码: 19 处 (abnormal, anomaly, approval, exception...)
|
|
49
|
-
相关 API: /insurance
|
|
50
|
-
─────────────────────────────────────
|
|
51
|
-
将以此上下文继续。回复「好」接受,或「改: <你的调整>」。
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**然后停下,等用户回复。** 不要继续往下做命令。
|
|
55
|
-
|
|
56
|
-
### 用户确认后
|
|
57
|
-
|
|
58
|
-
| 用户回复 | 你怎么做 |
|
|
59
|
-
|---------|----------|
|
|
60
|
-
| 「好」「继续」「接受」「确认」或任意无"改"字 | 接受润色,继续走原命令(prd/code/test...) |
|
|
61
|
-
| 「改: 不要保险,只要批改」 | 按用户调整的上下文继续 |
|
|
62
|
-
| 「不要润色」 | 跳过润色,用原话继续 |
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## 关键约束
|
|
67
|
-
|
|
68
|
-
1. **必须最先做**:润色是第 0 步,排在平台询问、搜索、读文件之前。
|
|
69
|
-
例外:`/wl-init`、`/wl-search` 这种纯工具命令可跳过润色(它们不产契约)。
|
|
70
|
-
2. **极速**:只用 enrich_prompt.py,不用 context_pack(那是确认后的事)。
|
|
71
|
-
3. **可改可拒**:润色结果是建议,用户有最终决定权。
|
|
72
|
-
4. **不改变意图**:润色只补上下文,不改用户要做的事(还是 /wl-prd-full /wl-code 等)。
|
|
73
|
-
|
|
74
|
-
## 与其它命令的关系
|
|
75
|
-
|
|
76
|
-
润色是**横切关注点**,所有产契约的命令(prd/design/spec/code/test)都先过它:
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
用户: /wl-prd-full 保险批改那个异常统计页加个审批按钮
|
|
80
|
-
↓
|
|
81
|
-
第0步: enrich_prompt → 输出润色块 → 用户确认
|
|
82
|
-
↓
|
|
83
|
-
第1步起: /wl-prd-full 原流程(用确认后的上下文跑 context_pack)
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## 为什么用脚本而不是靠 AI 自己想
|
|
87
|
-
|
|
88
|
-
- **快**:纯内存查表纳秒级,AI 自己推理要秒级
|
|
89
|
-
- **准**:复用 common/terms.py 的中文分词 + keyword-index,跟 /wl-search 同源
|
|
90
|
-
- **一致**:每次润色逻辑一样,不依赖 AI 心情
|
|
File without changes
|
|
File without changes
|