@hupan56/wlkj 3.1.8 → 3.1.10
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 +1 -1
- package/templates/qoder/agents/qoder-spec-gen.toml +10 -8
- package/templates/qoder/agents/spec-generator.md +5 -5
- package/templates/qoder/scripts/capability/adapters/mcp.py +6 -2
- package/templates/qoder/scripts/capability/adapters/qw.py +295 -271
- package/templates/qoder/scripts/capability/memory_chain.py +3 -1
- package/templates/qoder/scripts/domain/kg/kg_capabilities.py +3 -1
- package/templates/qoder/scripts/domain/kg/search/context_pack.py +3 -3
- package/templates/qoder/scripts/domain/kg/search/prefetch.py +1 -1
- package/templates/qoder/scripts/domain/kg/search/search_index.py +1 -1
- package/templates/qoder/scripts/protocol/mcp/kg_mcp_server.py +32 -1
- package/templates/root/AGENTS.md +275 -275
package/package.json
CHANGED
|
@@ -16,22 +16,24 @@ developer_instructions = """
|
|
|
16
16
|
如果没有,扫描 `workspace/specs/` 目录找到最新的未生成 Spec 的 PRD。
|
|
17
17
|
|
|
18
18
|
### Step 2: 读取上下文
|
|
19
|
-
|
|
20
|
-
1. PRD 文件 —
|
|
21
|
-
2. `.qoder/
|
|
22
|
-
3. `.qoder/
|
|
23
|
-
4.
|
|
24
|
-
5.
|
|
19
|
+
必须读取以下文件(**注意:这些是真实存在的路径,旧版引用的 rules/spec-template.md 等 4 个文件已不存在**):
|
|
20
|
+
1. PRD 文件 — 需求来源(drafts 里的 `REQ-*.md` 或 `data/docs/prd/REQ-*.md`)
|
|
21
|
+
2. `.qoder/skills/spec-generator/SKILL.md` — Spec 结构模板与生成流程(权威源)
|
|
22
|
+
3. `.qoder/contracts/spec.md` — Spec 模块契约(字段/格式/贯穿检索要求)
|
|
23
|
+
4. `data/docs/architecture/` 下的架构文档(如 `kg-layers.md`)— 项目架构
|
|
24
|
+
5. `data/docs/constitution/eva-metrics.md` — 质量度量(Spec 要对齐验收标准)
|
|
25
25
|
|
|
26
26
|
### Step 3: 生成 Spec
|
|
27
|
-
按 spec
|
|
27
|
+
按 SKILL.md + spec.md 契约的结构,从 PRD 提取:
|
|
28
28
|
- 每个用户故事 → API 接口
|
|
29
29
|
- 验收标准 → 接口输入/输出/异常
|
|
30
30
|
- 数据需求 → 数据库表设计
|
|
31
31
|
- 非功能需求 → 约束章节
|
|
32
32
|
|
|
33
33
|
### Step 4: 输出
|
|
34
|
-
写入 `workspace/specs/REQ-{ID}-{
|
|
34
|
+
写入 `workspace/specs/REQ-{ID}-{module}.spec.md`(**文件名必须带 `.spec.md` 后缀**,
|
|
35
|
+
与 `.qoder/contracts/spec.md` 契约一致 —— 旧版写成 `REQ-{ID}-{模块名}.md` 会导致
|
|
36
|
+
spec→code→test 贯穿检索断链)。
|
|
35
37
|
完成后汇报:文件列表、与 PRD 的映射关系、需要开发关注的点。
|
|
36
38
|
|
|
37
39
|
## 规则
|
|
@@ -10,12 +10,12 @@ You are the spec-generator. Do NOT spawn another spec-generator.
|
|
|
10
10
|
Generate technical Spec from PRD + Design.
|
|
11
11
|
|
|
12
12
|
## Workflow
|
|
13
|
-
1. Read PRD
|
|
14
|
-
2. Read design artifacts from workspace/tasks/{id}/design
|
|
15
|
-
3. Read team rules from workspace/constitution
|
|
16
|
-
4. Generate spec
|
|
13
|
+
1. Read PRD — 先找 `workspace/members/{dev}/drafts/REQ-*.md`,再找 `data/docs/prd/REQ-*.md`,最后 `workspace/specs/prd/`
|
|
14
|
+
2. Read design artifacts from `workspace/tasks/{id}/design/` (若存在)
|
|
15
|
+
3. Read team rules from `.qoder/skills/spec-generator/SKILL.md` + `.qoder/contracts/spec.md` (权威源);`workspace/constitution/` 有则参考
|
|
16
|
+
4. Generate spec covering:
|
|
17
17
|
- Architecture changes
|
|
18
18
|
- Data model changes
|
|
19
19
|
- API changes
|
|
20
20
|
- Implementation plan
|
|
21
|
-
5. Save to workspace/specs/
|
|
21
|
+
5. Save to `workspace/specs/REQ-{ID}-{module}.spec.md` (文件名带 `.spec.md` 后缀,与 contracts/spec.md 契约一致,保证 spec→code→test 贯穿检索)
|
|
@@ -270,9 +270,13 @@ class McpMemoryProvider:
|
|
|
270
270
|
import hashlib
|
|
271
271
|
import json
|
|
272
272
|
import time as _time
|
|
273
|
-
|
|
273
|
+
# ⚠ 不能 import init_schema! duckdb_conn 故意不导出它 (领域 DDL 留在各域)。
|
|
274
|
+
# 旧版 from ...duckdb_conn import init_schema → ImportError → 被下面 except 吞掉
|
|
275
|
+
# → INSERT 永不执行 → remember() 静默丢全部写入。
|
|
276
|
+
# learning_events 表已由 self.available 的 CREATE TABLE IF NOT EXISTS 保证存在,
|
|
277
|
+
# 这里直接 INSERT 即可。
|
|
278
|
+
from foundation.protocol.duckdb_conn import get_db
|
|
274
279
|
con = get_db()
|
|
275
|
-
init_schema(con)
|
|
276
280
|
eid = hashlib.md5(("%s:%s:%s" % (key, content, _time.time())).encode()).hexdigest()[:16]
|
|
277
281
|
ts = _time.strftime("%Y-%m-%dT%H:%M:%S")
|
|
278
282
|
data = json.dumps({"content": content}, ensure_ascii=False)
|