@ppdocs/mcp 3.2.26 → 3.2.28
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/dist/cli.js +77 -43
- package/dist/tools/flowchart.js +5 -2
- package/package.json +1 -1
- package/templates/commands/pp/diagnose.md +174 -82
- package/templates/commands/pp/discuss.md +4 -4
- package/templates/commands/pp/execute.md +151 -84
- package/templates/commands/pp/init.md +200 -123
- package/templates/commands/pp/protocol.md +181 -0
- package/templates/commands/pp/review.md +158 -55
- package/templates/commands/pp/sync.md +229 -178
package/dist/cli.js
CHANGED
|
@@ -441,12 +441,15 @@ function generateMcpPermissions() {
|
|
|
441
441
|
/** 安装 Claude Code 模板 */
|
|
442
442
|
function installClaudeTemplates(cwd) {
|
|
443
443
|
const claudeDir = path.join(cwd, '.claude');
|
|
444
|
-
// 1. 复制 commands/pp/
|
|
444
|
+
// 1. 复制 commands/pp/ (先清空旧版,确保安装最新模板)
|
|
445
445
|
const srcCommands = path.join(TEMPLATES_DIR, 'commands', 'pp');
|
|
446
446
|
const destCommands = path.join(claudeDir, 'commands', 'pp');
|
|
447
447
|
if (fs.existsSync(srcCommands)) {
|
|
448
|
+
if (fs.existsSync(destCommands)) {
|
|
449
|
+
fs.rmSync(destCommands, { recursive: true });
|
|
450
|
+
}
|
|
448
451
|
copyDirRecursive(srcCommands, destCommands);
|
|
449
|
-
console.log(`✅ Installed .claude/commands/pp
|
|
452
|
+
console.log(`✅ Installed .claude/commands/pp/ (old versions cleaned)`);
|
|
450
453
|
}
|
|
451
454
|
// 2. 复制 hooks/
|
|
452
455
|
const srcHooks = path.join(TEMPLATES_DIR, 'hooks');
|
|
@@ -483,10 +486,13 @@ function installClaudeTemplates(cwd) {
|
|
|
483
486
|
fs.writeFileSync(settingsPath, JSON.stringify(mergedSettings, null, 2));
|
|
484
487
|
console.log(`✅ Configured .claude/settings.json hooks (${process.platform})`);
|
|
485
488
|
console.log(`✅ Added ${mcpPermissions.length} MCP method permissions`);
|
|
489
|
+
// 4. 安装工作流到 .agents/workflows/ (全平台通用)
|
|
490
|
+
installWorkflows(cwd);
|
|
486
491
|
}
|
|
487
|
-
/** 安装 Codex 模板 (生成 AGENTS.md) */
|
|
492
|
+
/** 安装 Codex 模板 (生成 AGENTS.md + 工作流) */
|
|
488
493
|
function installCodexTemplates(cwd) {
|
|
489
494
|
generateAgentsMd(cwd);
|
|
495
|
+
installWorkflows(cwd);
|
|
490
496
|
}
|
|
491
497
|
/** 生成 AGENTS.md 工具函数 (去重) */
|
|
492
498
|
function generateAgentsMd(cwd) {
|
|
@@ -510,64 +516,90 @@ function installCursorTemplates(cwd, apiUrl, user) {
|
|
|
510
516
|
fs.copyFileSync(srcRules, destRules);
|
|
511
517
|
console.log(`✅ Created .cursorrules`);
|
|
512
518
|
}
|
|
519
|
+
// 3. 安装工作流到 .agents/workflows/
|
|
520
|
+
installWorkflows(cwd);
|
|
513
521
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
+
// ========================================================================
|
|
523
|
+
// ★ 通用工作流安装 — 全平台共享 (删旧 + 写新)
|
|
524
|
+
// 所有 IDE 最终都通过此函数安装 .agents/workflows/ 下的工作流文件
|
|
525
|
+
// ========================================================================
|
|
526
|
+
/** 工作流版本映射表: 模板文件名 → { 工作流命令名, 描述 } */
|
|
527
|
+
const WORKFLOW_MAP = {
|
|
528
|
+
'protocol.md': { name: 'pp-task', desc: '知识驱动任务协议 — 图谱先查→任务追踪→逐步验证→实时回写' },
|
|
529
|
+
'init.md': { name: 'pp-init', desc: 'System Genesis Architect - 从文件系统提取秩序,构建知识图谱,重点识别**复用性资产**' },
|
|
530
|
+
'sync.md': { name: 'pp-sync', desc: 'Knowledge Graph Deep-Sync Protocol' },
|
|
531
|
+
'review.md': { name: 'pp-shencha', desc: '审查任务成果' },
|
|
532
|
+
'diagnose.md': { name: 'pp-diagnose', desc: '深度问题诊断' },
|
|
533
|
+
'execute.md': { name: 'pp-execute', desc: '执行开发任务' },
|
|
534
|
+
'audit.md': { name: 'pp-audit', desc: '多Agent代码审计' },
|
|
535
|
+
'discuss.md': { name: 'pp-discuss', desc: '讨论响应与协作' },
|
|
536
|
+
'Zero_Defec_Genesis.md': { name: 'plan', desc: '零缺陷创生协议' },
|
|
537
|
+
'SynchronizationProtocol.md': { name: 'pp-syncpro', desc: 'Knowledge Graph Quick-Sync Protocol' },
|
|
538
|
+
};
|
|
539
|
+
/** 已废弃的旧版工作流文件名 (从早期 COMMAND_MAP 残留, 安装时自动清理) */
|
|
540
|
+
const LEGACY_WORKFLOW_NAMES = ['pp-fenxi.md', 'pp-review.md'];
|
|
541
|
+
/**
|
|
542
|
+
* 通用工作流安装: 删除旧版 → 写入最新版到 .agents/workflows/
|
|
543
|
+
* 全平台共享: Antigravity / Claude Code / Cursor / Codex / Kiro
|
|
544
|
+
* @param dirs 额外的安装目标目录 (如 Antigravity 的 global_workflows/)
|
|
545
|
+
*/
|
|
546
|
+
function installWorkflows(cwd, extraDirs = []) {
|
|
522
547
|
const cmdSrcDir = path.join(TEMPLATES_DIR, 'commands', 'pp');
|
|
523
548
|
if (!fs.existsSync(cmdSrcDir))
|
|
524
549
|
return;
|
|
525
|
-
//
|
|
526
|
-
const homeDir = process.env.USERPROFILE || process.env.HOME || '';
|
|
527
|
-
const globalWorkflowDir = path.join(homeDir, '.gemini', 'antigravity', 'global_workflows');
|
|
528
|
-
if (!fs.existsSync(globalWorkflowDir)) {
|
|
529
|
-
fs.mkdirSync(globalWorkflowDir, { recursive: true });
|
|
530
|
-
}
|
|
531
|
-
// 同时也安装到项目本地 .agents/workflows/ (作为备用)
|
|
550
|
+
// 项目本地 .agents/workflows/
|
|
532
551
|
const localWorkflowDir = path.join(cwd, '.agents', 'workflows');
|
|
533
552
|
if (!fs.existsSync(localWorkflowDir)) {
|
|
534
553
|
fs.mkdirSync(localWorkflowDir, { recursive: true });
|
|
535
554
|
}
|
|
536
|
-
//
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
555
|
+
// 所有目标目录: 本地 + 额外 (如 global_workflows)
|
|
556
|
+
const allDirs = [localWorkflowDir, ...extraDirs];
|
|
557
|
+
// ★ Step 1: 清理 — 收集要清理的文件名 (当前版本 + 废弃名)
|
|
558
|
+
const targetNames = new Set(Object.values(WORKFLOW_MAP).map(m => `${m.name}.md`));
|
|
559
|
+
for (const legacy of LEGACY_WORKFLOW_NAMES) {
|
|
560
|
+
targetNames.add(legacy);
|
|
561
|
+
}
|
|
562
|
+
for (const dir of allDirs) {
|
|
563
|
+
for (const name of targetNames) {
|
|
564
|
+
const file = path.join(dir, name);
|
|
565
|
+
if (fs.existsSync(file)) {
|
|
566
|
+
fs.unlinkSync(file);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
// ★ Step 2: 安装 — 读取模板, 添加 YAML frontmatter, 写入所有目标目录
|
|
547
571
|
const files = fs.readdirSync(cmdSrcDir).filter(f => f.endsWith('.md'));
|
|
548
572
|
let count = 0;
|
|
549
573
|
for (const file of files) {
|
|
550
|
-
const mapping =
|
|
574
|
+
const mapping = WORKFLOW_MAP[file];
|
|
551
575
|
if (!mapping)
|
|
552
|
-
continue;
|
|
576
|
+
continue;
|
|
553
577
|
const content = fs.readFileSync(path.join(cmdSrcDir, file), 'utf-8');
|
|
554
|
-
// 生成 Antigravity 格式: YAML frontmatter + 内容
|
|
555
578
|
const workflow = `---\ndescription: ${mapping.desc}\n---\n\n${content}`;
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
if (!fs.existsSync(globalFile)) {
|
|
559
|
-
fs.writeFileSync(globalFile, workflow, 'utf-8');
|
|
560
|
-
count++;
|
|
561
|
-
}
|
|
562
|
-
// 同时写入项目本地目录
|
|
563
|
-
const localFile = path.join(localWorkflowDir, `${mapping.name}.md`);
|
|
564
|
-
if (!fs.existsSync(localFile)) {
|
|
565
|
-
fs.writeFileSync(localFile, workflow, 'utf-8');
|
|
579
|
+
for (const dir of allDirs) {
|
|
580
|
+
fs.writeFileSync(path.join(dir, `${mapping.name}.md`), workflow, 'utf-8');
|
|
566
581
|
}
|
|
582
|
+
count++;
|
|
567
583
|
}
|
|
568
584
|
if (count > 0) {
|
|
569
|
-
|
|
585
|
+
const targets = allDirs.map(d => path.basename(d)).join(' + ');
|
|
586
|
+
console.log(`✅ Installed ${count} workflows (old versions cleaned) → ${targets}`);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
/** 安装 Antigravity (Gemini IDE) 模板 */
|
|
590
|
+
function installAntigravityTemplates(cwd, apiUrl, user) {
|
|
591
|
+
// Antigravity 由 gemini CLI 注册 env,文件配置不注入避免冲突
|
|
592
|
+
createMcpConfigAt(path.join(cwd, '.gemini', 'settings.json'), apiUrl, { noEnv: true, user });
|
|
593
|
+
// 2. 生成 AGENTS.md
|
|
594
|
+
generateAgentsMd(cwd);
|
|
595
|
+
// 3. Antigravity 全局 workflows 目录 (额外安装目标)
|
|
596
|
+
const homeDir = process.env.USERPROFILE || process.env.HOME || '';
|
|
597
|
+
const globalWorkflowDir = path.join(homeDir, '.gemini', 'antigravity', 'global_workflows');
|
|
598
|
+
if (!fs.existsSync(globalWorkflowDir)) {
|
|
599
|
+
fs.mkdirSync(globalWorkflowDir, { recursive: true });
|
|
570
600
|
}
|
|
601
|
+
// 4. 调用通用安装: .agents/workflows/ + global_workflows/
|
|
602
|
+
installWorkflows(cwd, [globalWorkflowDir]);
|
|
571
603
|
}
|
|
572
604
|
/** 安装 Kiro 模板 */
|
|
573
605
|
function installKiroTemplates(cwd, apiUrl, user) {
|
|
@@ -583,6 +615,8 @@ function installKiroTemplates(cwd, apiUrl, user) {
|
|
|
583
615
|
fs.copyFileSync(srcRules, destRules);
|
|
584
616
|
console.log(`✅ Created .kiro/rules/ppdocs.md`);
|
|
585
617
|
}
|
|
618
|
+
// 3. 安装工作流到 .agents/workflows/
|
|
619
|
+
installWorkflows(cwd);
|
|
586
620
|
}
|
|
587
621
|
/** 检测当前工作区包含的 IDE */
|
|
588
622
|
function detectIDEs(cwd) {
|
package/dist/tools/flowchart.js
CHANGED
|
@@ -314,11 +314,14 @@ export function registerFlowchartTools(server, ctx) {
|
|
|
314
314
|
if (!isNaN(num))
|
|
315
315
|
nextVer = Math.round((num + 0.1) * 10) / 10;
|
|
316
316
|
}
|
|
317
|
+
// normalize escaped newlines from AI clients (e.g. "\\n" → actual newline)
|
|
318
|
+
const normalizedContent = decoded.docContent.replace(/\\n/g, '\n');
|
|
319
|
+
const normalizedSummary = decoded.docSummary.replace(/\\n/g, '\n');
|
|
317
320
|
docEntries.push({
|
|
318
321
|
version: `v${nextVer.toFixed(1)}`,
|
|
319
322
|
date: new Date().toISOString(),
|
|
320
|
-
summary:
|
|
321
|
-
content:
|
|
323
|
+
summary: normalizedSummary,
|
|
324
|
+
content: normalizedContent,
|
|
322
325
|
});
|
|
323
326
|
node.docEntries = docEntries;
|
|
324
327
|
changes.push(`docEntries(v${nextVer.toFixed(1)})`);
|
package/package.json
CHANGED
|
@@ -1,82 +1,174 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
1
|
+
**角色**: Deep-Trace Diagnostician — 沿流程图逐层下探定位问题,而不是盲目翻代码
|
|
2
|
+
|
|
3
|
+
核心理念:**先在宏观地图(流程图)上定位,再在微观战场(代码)上排查。**
|
|
4
|
+
|
|
5
|
+
## 诊断宪法
|
|
6
|
+
|
|
7
|
+
| 原则 | 要求 |
|
|
8
|
+
|:---|:---|
|
|
9
|
+
| **图谱先行** | 禁止在未查询图谱前直接跳入代码 |
|
|
10
|
+
| **递归下探** | 从 main 逐层进入子图, 直到锁定叶子级嫌疑节点 |
|
|
11
|
+
| **双层取证** | 必须同时对比图谱预期与代码现实, 分类裂痕 |
|
|
12
|
+
| **数据驱动** | 用 code_impact 量化影响范围, 禁止凭感觉判断 |
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 标准流程
|
|
17
|
+
|
|
18
|
+
### Phase 1: 知识锚定
|
|
19
|
+
|
|
20
|
+
**1.1 建立全景**
|
|
21
|
+
```
|
|
22
|
+
kg_tree() → 知识全景图
|
|
23
|
+
kg_flowchart(action:"get") → 主图结构 (8个模块 + 连线)
|
|
24
|
+
kg_rules(action:"get", ruleType:"errorAnalysis") → 错误分析规则
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**1.2 关键词定位模块**
|
|
28
|
+
```
|
|
29
|
+
从问题描述提取关键词, 映射到主图节点:
|
|
30
|
+
|
|
31
|
+
"存储/读写/JSON" → n_storage
|
|
32
|
+
"页面/组件/白屏" → n_frontend
|
|
33
|
+
"MCP/工具/超时" → n_mcp
|
|
34
|
+
"路由/API/请求" → n_entry
|
|
35
|
+
"文档/搜索/节点" → n_kg
|
|
36
|
+
"讨论/会议/协作" → n_collab
|
|
37
|
+
"密码/权限/认证" → n_auth
|
|
38
|
+
"扫描/符号/索引" → n_analyzer
|
|
39
|
+
|
|
40
|
+
无法定位 → 询问用户补充信息
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Phase 2: 递归下探
|
|
44
|
+
|
|
45
|
+
**从定位到的主图节点开始, 逐层进入子图:**
|
|
46
|
+
```
|
|
47
|
+
Step 1: 主图节点详情
|
|
48
|
+
kg_flowchart(action:"get_node", nodeId:"n_定位模块", expand:2,
|
|
49
|
+
includeDoc:true, includeFiles:true)
|
|
50
|
+
→ 节点文档 + 上下游连线 + 绑定文件
|
|
51
|
+
|
|
52
|
+
Step 2: 进入子图
|
|
53
|
+
该节点有 subFlowchart?
|
|
54
|
+
├─ YES → kg_flowchart(action:"get", chartId:"sub_xxx")
|
|
55
|
+
│ → 子图内所有节点和连线
|
|
56
|
+
│ → 根据问题特征, 缩小到子图内某个节点
|
|
57
|
+
│ → 该子节点还有子图? → 继续下探
|
|
58
|
+
└─ NO → 已到代码根基, 进入 Phase 3
|
|
59
|
+
|
|
60
|
+
Step 3: 输出疑点路径
|
|
61
|
+
main.n_storage
|
|
62
|
+
→ sub_storage.n_graph_store
|
|
63
|
+
→ sub_graph_store.n_search_docs
|
|
64
|
+
← 嫌疑锁定
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Phase 3: 爆炸半径
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
code_smart_context(嫌疑符号名)
|
|
71
|
+
→ 代码依赖 + 关联文档 + 匹配规则 + 影响范围摘要
|
|
72
|
+
|
|
73
|
+
code_impact(嫌疑符号名)
|
|
74
|
+
→ L1 直接引用 (必须检查)
|
|
75
|
+
→ L2 间接引用 (建议检查)
|
|
76
|
+
→ L3 传递引用 (注意)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**输出 ASCII 影响范围图**:
|
|
80
|
+
```
|
|
81
|
+
┌──────────┐
|
|
82
|
+
│ 嫌疑函数 │
|
|
83
|
+
└─────┬────┘
|
|
84
|
+
L1 直接 ───┤
|
|
85
|
+
├→ 调用者A (文件路径)
|
|
86
|
+
├→ 调用者B (文件路径)
|
|
87
|
+
L2 间接 ───┤
|
|
88
|
+
└→ 调用者C → 调用者D
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
→ 用户确认嫌疑范围后进入 Phase 4
|
|
92
|
+
|
|
93
|
+
### Phase 4: 双层取证
|
|
94
|
+
|
|
95
|
+
**左眼: 图谱真理 (预期行为)**
|
|
96
|
+
```
|
|
97
|
+
kg_flowchart(action:"get_node", nodeId:嫌疑节点,
|
|
98
|
+
includeDoc:true, fullDoc:true)
|
|
99
|
+
→ 该节点文档中描述的预期逻辑
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**右眼: 代码现实 (真实行为)**
|
|
103
|
+
```
|
|
104
|
+
code_context(嫌疑文件路径) → 文件360°依赖关系
|
|
105
|
+
Read(嫌疑文件) → 实际源码
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**对比分类裂痕**:
|
|
109
|
+
```
|
|
110
|
+
🔴 代码Bug:
|
|
111
|
+
图谱描述: "search_docs 应返回匹配文档数组"
|
|
112
|
+
代码实现: 返回了 undefined (缺少 return)
|
|
113
|
+
→ 修复代码
|
|
114
|
+
|
|
115
|
+
🟠 设计缺陷:
|
|
116
|
+
图谱描述: "按标题搜索"
|
|
117
|
+
代码实现: 确实按标题搜索
|
|
118
|
+
但实际需求: 应支持全文搜索 (图谱本身逻辑不完整)
|
|
119
|
+
→ 修复图谱 + 代码
|
|
120
|
+
|
|
121
|
+
🟡 文档脱节:
|
|
122
|
+
代码已添加了缓存逻辑, 运行正确
|
|
123
|
+
图谱中完全未记载此功能
|
|
124
|
+
→ 同步图谱
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Phase 5: 诊断报告
|
|
128
|
+
|
|
129
|
+
**5.1 报告结构**
|
|
130
|
+
```
|
|
131
|
+
## 诊断报告
|
|
132
|
+
|
|
133
|
+
### 定位路径
|
|
134
|
+
main.n_storage → sub_storage.n_graph_store → n_search_docs
|
|
135
|
+
|
|
136
|
+
### 根因分类
|
|
137
|
+
🔴 代码Bug / 🟠 设计缺陷 / 🟡 文档脱节
|
|
138
|
+
|
|
139
|
+
### 数据流图
|
|
140
|
+
[搜索请求] → [解析关键词] → [匹配文档] → [返回结果✗]
|
|
141
|
+
↑ 此处缺少return
|
|
142
|
+
|
|
143
|
+
### 详细分析
|
|
144
|
+
| 环节 | 输入 | 预期输出 | 实际输出 | 判定 |
|
|
145
|
+
|:---|:---|:---|:---|:---|
|
|
146
|
+
| 解析关键词 | "auth" | ["auth"] | ["auth"] | ✅ |
|
|
147
|
+
| 匹配文档 | ["auth"] | Doc[] | Doc[] | ✅ |
|
|
148
|
+
| 返回结果 | Doc[] | Doc[] | undefined | ❌ |
|
|
149
|
+
|
|
150
|
+
### 影响范围
|
|
151
|
+
L1: 3个直接调用方受影响
|
|
152
|
+
L2: 2个间接调用方可能受影响
|
|
153
|
+
|
|
154
|
+
### 修复建议
|
|
155
|
+
1. [具体修复方案]
|
|
156
|
+
2. → 可传递给 /pp:execute 执行
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 工具速查
|
|
162
|
+
|
|
163
|
+
| 阶段 | 工具 | 用途 |
|
|
164
|
+
|:---|:---|:---|
|
|
165
|
+
| 锚定 | `kg_tree()` | 全景鸟瞰 |
|
|
166
|
+
| 锚定 | `kg_flowchart(get)` | 主图结构 |
|
|
167
|
+
| 锚定 | `kg_rules(get)` | 分析规则 |
|
|
168
|
+
| 下探 | `kg_flowchart(get_node, expand:N)` | 节点详情+上下游 |
|
|
169
|
+
| 下探 | `kg_flowchart(get, chartId:子图)` | 进入子图 |
|
|
170
|
+
| 半径 | `code_smart_context(symbol)` | 全关联上下文 |
|
|
171
|
+
| 半径 | `code_impact(symbol)` | 爆炸半径分析 |
|
|
172
|
+
| 取证 | `code_context(file)` | 文件360°依赖 |
|
|
173
|
+
| 取证 | `Read(file)` | 读取源码 |
|
|
174
|
+
| 取证 | `code_path(symbolA, symbolB)` | 两点间调用链 |
|
|
@@ -28,8 +28,8 @@ kg_discuss({ action: "read", id: "选中ID" })
|
|
|
28
28
|
|
|
29
29
|
**并行执行**:
|
|
30
30
|
1. 阅读讨论全部消息, 理解各方立场
|
|
31
|
-
2. `
|
|
32
|
-
3. `
|
|
31
|
+
2. `kg_flowchart(action:"get_node", nodeId:相关节点, expand:2)` 获取本项目的标准逻辑
|
|
32
|
+
3. `kg_rules(action:"get", ruleType:"codeStyle")` 获取编码规范 (如涉及代码)
|
|
33
33
|
|
|
34
34
|
### Step 4: 分析与回复
|
|
35
35
|
**分析框架**:
|
|
@@ -85,6 +85,6 @@ kg_discuss({
|
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
**发起前检查**:
|
|
88
|
-
1. `
|
|
89
|
-
2. 明确参与方 (通过 `kg_projects` 查看可用项目)
|
|
88
|
+
1. `kg_tree()` + `kg_flowchart(action:"get_node")` 确认问题确实需要跨项目协商
|
|
89
|
+
2. 明确参与方 (通过 `kg_projects()` 查看可用项目)
|
|
90
90
|
3. 内容包含: 背景、问题、本方方案、期望对方行动
|