@roarpeng/graphflow 1.4.4 → 1.7.4
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/AGENTS.md +1 -1
- package/CHANGELOG.md +72 -0
- package/CLAUDE.md +1 -1
- package/README.md +76 -50
- package/dist/agents/atp-schema.d.ts +59 -0
- package/dist/agents/atp-schema.d.ts.map +1 -0
- package/dist/agents/atp-schema.js +3 -0
- package/dist/agents/atp-schema.js.map +1 -0
- package/dist/agents/decision-engine.d.ts +55 -0
- package/dist/agents/decision-engine.d.ts.map +1 -0
- package/dist/agents/decision-engine.js +338 -0
- package/dist/agents/decision-engine.js.map +1 -0
- package/dist/agents/insight.d.ts +69 -2
- package/dist/agents/insight.d.ts.map +1 -1
- package/dist/agents/insight.js +420 -27
- package/dist/agents/insight.js.map +1 -1
- package/dist/agents/task-profile.d.ts +19 -0
- package/dist/agents/task-profile.d.ts.map +1 -0
- package/dist/agents/task-profile.js +64 -0
- package/dist/agents/task-profile.js.map +1 -0
- package/dist/agents/validator.js +1 -1
- package/dist/agents/validator.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +4 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/discover-workspace.d.ts.map +1 -1
- package/dist/config/discover-workspace.js +13 -2
- package/dist/config/discover-workspace.js.map +1 -1
- package/dist/config/embedding-factory.d.ts.map +1 -1
- package/dist/config/embedding-factory.js +87 -8
- package/dist/config/embedding-factory.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +10 -4
- package/dist/config/loader.js.map +1 -1
- package/dist/config/provider-env.d.ts +32 -0
- package/dist/config/provider-env.d.ts.map +1 -0
- package/dist/config/provider-env.js +51 -0
- package/dist/config/provider-env.js.map +1 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +7 -2
- package/dist/config/resolve.js.map +1 -1
- package/dist/config/schema.d.ts +17 -3
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/workspace-root.d.ts +0 -12
- package/dist/config/workspace-root.d.ts.map +1 -1
- package/dist/config/workspace-root.js +21 -5
- package/dist/config/workspace-root.js.map +1 -1
- package/dist/core/agent-delegation.d.ts +8 -1
- package/dist/core/agent-delegation.d.ts.map +1 -1
- package/dist/core/agent-delegation.js +233 -38
- package/dist/core/agent-delegation.js.map +1 -1
- package/dist/core/cancellation.d.ts +57 -0
- package/dist/core/cancellation.d.ts.map +1 -0
- package/dist/core/cancellation.js +195 -0
- package/dist/core/cancellation.js.map +1 -0
- package/dist/core/dag-engine.d.ts +6 -1
- package/dist/core/dag-engine.d.ts.map +1 -1
- package/dist/core/dag-engine.js +67 -9
- package/dist/core/dag-engine.js.map +1 -1
- package/dist/core/orchestrator-context.d.ts.map +1 -1
- package/dist/core/orchestrator-context.js +28 -3
- package/dist/core/orchestrator-context.js.map +1 -1
- package/dist/core/orchestrator-route.d.ts +1 -1
- package/dist/core/orchestrator-route.d.ts.map +1 -1
- package/dist/core/orchestrator-route.js.map +1 -1
- package/dist/core/orchestrator.js +6 -1
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/runtime-controller.d.ts +19 -0
- package/dist/core/runtime-controller.d.ts.map +1 -0
- package/dist/core/runtime-controller.js +89 -0
- package/dist/core/runtime-controller.js.map +1 -0
- package/dist/core/types.d.ts +17 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/graph/context-slicer-types.d.ts +2 -4
- package/dist/graph/context-slicer-types.d.ts.map +1 -1
- package/dist/graph/context-slicer-types.js.map +1 -1
- package/dist/graph/context-slicer.d.ts +1 -0
- package/dist/graph/context-slicer.d.ts.map +1 -1
- package/dist/graph/context-slicer.js +54 -18
- package/dist/graph/context-slicer.js.map +1 -1
- package/dist/graph/file-indexer-walker.d.ts +3 -0
- package/dist/graph/file-indexer-walker.d.ts.map +1 -1
- package/dist/graph/file-indexer-walker.js.map +1 -1
- package/dist/graph/file-indexer.d.ts +1 -0
- package/dist/graph/file-indexer.d.ts.map +1 -1
- package/dist/graph/file-indexer.js +14 -18
- package/dist/graph/file-indexer.js.map +1 -1
- package/dist/graph/file-watcher.d.ts.map +1 -1
- package/dist/graph/file-watcher.js +9 -2
- package/dist/graph/file-watcher.js.map +1 -1
- package/dist/graph/graph-utils.d.ts +6 -1
- package/dist/graph/graph-utils.d.ts.map +1 -1
- package/dist/graph/graph-utils.js +116 -2
- package/dist/graph/graph-utils.js.map +1 -1
- package/dist/graph/graphify-file-client.d.ts.map +1 -1
- package/dist/graph/graphify-file-client.js +2 -1
- package/dist/graph/graphify-file-client.js.map +1 -1
- package/dist/graph/hit-diversify.d.ts +31 -0
- package/dist/graph/hit-diversify.d.ts.map +1 -0
- package/dist/graph/hit-diversify.js +270 -0
- package/dist/graph/hit-diversify.js.map +1 -0
- package/dist/graph/language-indexers/go.d.ts.map +1 -1
- package/dist/graph/language-indexers/go.js +2 -3
- package/dist/graph/language-indexers/go.js.map +1 -1
- package/dist/graph/language-indexers/incremental-parse.d.ts +9 -0
- package/dist/graph/language-indexers/incremental-parse.d.ts.map +1 -0
- package/dist/graph/language-indexers/incremental-parse.js +114 -0
- package/dist/graph/language-indexers/incremental-parse.js.map +1 -0
- package/dist/graph/language-indexers/python.d.ts.map +1 -1
- package/dist/graph/language-indexers/python.js +2 -3
- package/dist/graph/language-indexers/python.js.map +1 -1
- package/dist/graph/language-indexers/rust.d.ts.map +1 -1
- package/dist/graph/language-indexers/rust.js +2 -3
- package/dist/graph/language-indexers/rust.js.map +1 -1
- package/dist/graph/language-indexers/tree-sitter-loader.d.ts +19 -3
- package/dist/graph/language-indexers/tree-sitter-loader.d.ts.map +1 -1
- package/dist/graph/language-indexers/tree-sitter-loader.js +24 -4
- package/dist/graph/language-indexers/tree-sitter-loader.js.map +1 -1
- package/dist/graph/query-expand.d.ts.map +1 -1
- package/dist/graph/query-expand.js +2 -0
- package/dist/graph/query-expand.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/agent-mcp-installer.d.ts +39 -0
- package/dist/integrations/agent-mcp-installer.d.ts.map +1 -1
- package/dist/integrations/agent-mcp-installer.js +220 -14
- package/dist/integrations/agent-mcp-installer.js.map +1 -1
- package/dist/learning/embedding-quality.d.ts +46 -0
- package/dist/learning/embedding-quality.d.ts.map +1 -0
- package/dist/learning/embedding-quality.js +131 -0
- package/dist/learning/embedding-quality.js.map +1 -0
- package/dist/learning/embeddings.d.ts +46 -3
- package/dist/learning/embeddings.d.ts.map +1 -1
- package/dist/learning/embeddings.js +186 -26
- package/dist/learning/embeddings.js.map +1 -1
- package/dist/learning/hnsw-index.d.ts +9 -35
- package/dist/learning/hnsw-index.d.ts.map +1 -1
- package/dist/learning/hnsw-index.js +8 -154
- package/dist/learning/hnsw-index.js.map +1 -1
- package/dist/learning/skill-flywheel.d.ts +1 -1
- package/dist/learning/skill-flywheel.d.ts.map +1 -1
- package/dist/learning/skill-flywheel.js +10 -3
- package/dist/learning/skill-flywheel.js.map +1 -1
- package/dist/routing/deepseek-tools.d.ts +7 -0
- package/dist/routing/deepseek-tools.d.ts.map +1 -0
- package/dist/routing/deepseek-tools.js +154 -0
- package/dist/routing/deepseek-tools.js.map +1 -0
- package/dist/routing/model-router.d.ts +1 -1
- package/dist/routing/model-router.d.ts.map +1 -1
- package/dist/routing/model-router.js +5 -1
- package/dist/routing/model-router.js.map +1 -1
- package/dist/routing/provider-adapters/anthropic.d.ts.map +1 -1
- package/dist/routing/provider-adapters/anthropic.js +7 -4
- package/dist/routing/provider-adapters/anthropic.js.map +1 -1
- package/dist/routing/provider-adapters/bailian.d.ts.map +1 -1
- package/dist/routing/provider-adapters/bailian.js +7 -4
- package/dist/routing/provider-adapters/bailian.js.map +1 -1
- package/dist/routing/provider-adapters/deepseek.d.ts +5 -0
- package/dist/routing/provider-adapters/deepseek.d.ts.map +1 -0
- package/dist/routing/provider-adapters/deepseek.js +109 -0
- package/dist/routing/provider-adapters/deepseek.js.map +1 -0
- package/dist/routing/provider-adapters/doubao.d.ts.map +1 -1
- package/dist/routing/provider-adapters/doubao.js +7 -4
- package/dist/routing/provider-adapters/doubao.js.map +1 -1
- package/dist/routing/provider-adapters/openai.d.ts +2 -4
- package/dist/routing/provider-adapters/openai.d.ts.map +1 -1
- package/dist/routing/provider-adapters/openai.js +23 -32
- package/dist/routing/provider-adapters/openai.js.map +1 -1
- package/dist/routing/provider-adapters/types.d.ts +61 -0
- package/dist/routing/provider-adapters/types.d.ts.map +1 -0
- package/dist/routing/provider-adapters/types.js +56 -0
- package/dist/routing/provider-adapters/types.js.map +1 -0
- package/dist/routing/provider-executor.d.ts +6 -1
- package/dist/routing/provider-executor.d.ts.map +1 -1
- package/dist/routing/provider-executor.js +70 -39
- package/dist/routing/provider-executor.js.map +1 -1
- package/dist/routing/provider-health.d.ts.map +1 -1
- package/dist/routing/provider-health.js +7 -1
- package/dist/routing/provider-health.js.map +1 -1
- package/dist/routing/role-capabilities.d.ts +11 -0
- package/dist/routing/role-capabilities.d.ts.map +1 -0
- package/dist/routing/role-capabilities.js +94 -0
- package/dist/routing/role-capabilities.js.map +1 -0
- package/dist/surfaces/antigravity-rules/graphflow.md +8 -8
- package/dist/surfaces/cli/runtime/env.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime/env.js +3 -0
- package/dist/surfaces/cli/runtime/env.js.map +1 -1
- package/dist/surfaces/cli/runtime/facade.d.ts +2 -1
- package/dist/surfaces/cli/runtime/facade.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime/facade.js +1 -0
- package/dist/surfaces/cli/runtime/facade.js.map +1 -1
- package/dist/surfaces/cli/runtime/graph.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime/graph.js +7 -1
- package/dist/surfaces/cli/runtime/graph.js.map +1 -1
- package/dist/surfaces/cli/runtime/routing.d.ts +3 -0
- package/dist/surfaces/cli/runtime/routing.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime/routing.js +31 -4
- package/dist/surfaces/cli/runtime/routing.js.map +1 -1
- package/dist/surfaces/cli/runtime/settings.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime/settings.js +0 -5
- package/dist/surfaces/cli/runtime/settings.js.map +1 -1
- package/dist/surfaces/cli/runtime/types.d.ts +23 -9
- package/dist/surfaces/cli/runtime/types.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime.d.ts +1 -1
- package/dist/surfaces/cli/runtime.d.ts.map +1 -1
- package/dist/surfaces/cli/runtime.js +2 -1
- package/dist/surfaces/cli/runtime.js.map +1 -1
- package/dist/surfaces/copilot-instructions/graphflow.md +6 -6
- package/dist/surfaces/cursor-rules/graphflow.mdc +20 -27
- package/dist/surfaces/mcp/server.js +17 -6
- package/dist/surfaces/mcp/server.js.map +1 -1
- package/dist/surfaces/mcp/tool-definitions.d.ts.map +1 -1
- package/dist/surfaces/mcp/tool-definitions.js +31 -124
- package/dist/surfaces/mcp/tool-definitions.js.map +1 -1
- package/dist/surfaces/mcp/tool-handlers.d.ts.map +1 -1
- package/dist/surfaces/mcp/tool-handlers.js +80 -42
- package/dist/surfaces/mcp/tool-handlers.js.map +1 -1
- package/dist/surfaces/trae-rules/graphflow.md +9 -9
- package/dist/surfaces/trae-skill/graphflow/SKILL.md +68 -75
- package/package.json +2 -2
- package/src/surfaces/antigravity-rules/graphflow.md +8 -8
- package/src/surfaces/copilot-instructions/graphflow.md +6 -6
- package/src/surfaces/cursor-rules/graphflow.mdc +20 -27
- package/src/surfaces/trae-rules/graphflow.md +9 -9
- package/src/surfaces/trae-skill/graphflow/SKILL.md +68 -75
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "graphflow"
|
|
3
|
-
description: "Graph-based code context compression, task planning, and knowledge graph orchestration (
|
|
3
|
+
description: "Graph-based code context compression, task planning, and knowledge graph orchestration (10 MCP tools). Invoke before ANY code question, bug fix, debugging, file reading, Chinese/CJK query, refactor, or multi-step edit — ALWAYS call graphflow_context MCP first when GraphFlow is connected."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# GraphFlow Skill
|
|
@@ -20,11 +20,9 @@ GraphFlow is a graph-based context and planning service backed by a persistent M
|
|
|
20
20
|
▼
|
|
21
21
|
┌─────────────────────────────────────────────────┐
|
|
22
22
|
│ GraphFlow MCP Server (persistent backend) │
|
|
23
|
-
│
|
|
24
|
-
│
|
|
25
|
-
│
|
|
26
|
-
│ skill_guide, diagnose, export_artifact, import_artifact,│
|
|
27
|
-
│ stats │
|
|
23
|
+
│ 10 tools: context, plan, index, insight, run, │
|
|
24
|
+
│ report_outcome, skill_insights, diagnose, │
|
|
25
|
+
│ artifact, skill_guide │
|
|
28
26
|
└──────────────────┬──────────────────────────────┘
|
|
29
27
|
│
|
|
30
28
|
▼
|
|
@@ -51,7 +49,7 @@ GraphFlow is a graph-based context and planning service backed by a persistent M
|
|
|
51
49
|
- Scan the whole repository recursively before trying GraphFlow
|
|
52
50
|
- Read large files before checking GraphFlow anchors
|
|
53
51
|
- Skip GraphFlow for complex tasks
|
|
54
|
-
- Use grep for codebase exploration before `
|
|
52
|
+
- Use grep for codebase exploration before `graphflow_context`
|
|
55
53
|
|
|
56
54
|
### Trae / Trae CN setup (Rules + Skill + MCP)
|
|
57
55
|
|
|
@@ -59,11 +57,11 @@ Trae loads **Rules every turn** and **Skills on demand**. GraphFlow `install` wr
|
|
|
59
57
|
|
|
60
58
|
| Path | Role |
|
|
61
59
|
|------|------|
|
|
62
|
-
| `.trae/rules/graphflow.md` | `alwaysApply: true` — **must** call `
|
|
60
|
+
| `.trae/rules/graphflow.md` | `alwaysApply: true` — **must** call `graphflow_context` first |
|
|
63
61
|
| `.trae/skills/graphflow/SKILL.md` | Full workflows; trigger with `#graphflow` |
|
|
64
62
|
| `User/mcp.json` | GraphFlow MCP server |
|
|
65
63
|
|
|
66
|
-
If Rules are missing, type `#graphflow` at the start of a chat. Pass `rootDir` = current project absolute path on every
|
|
64
|
+
If Rules are missing, type `#graphflow` at the start of a chat. Pass `rootDir` = current project absolute path on every context call.
|
|
67
65
|
|
|
68
66
|
### Antigravity IDE setup (Rules + Skill + MCP)
|
|
69
67
|
|
|
@@ -95,45 +93,37 @@ Run `npx @roarpeng/graphflow install` from the project root. Do **not** hardcode
|
|
|
95
93
|
|
|
96
94
|
---
|
|
97
95
|
|
|
98
|
-
## Tool Inventory (
|
|
96
|
+
## Tool Inventory (10 MCP Tools)
|
|
99
97
|
|
|
100
98
|
### Core Context Tools (Highest Frequency)
|
|
101
99
|
|
|
102
100
|
| Tool | Purpose | Call Frequency |
|
|
103
101
|
|------|---------|---------------|
|
|
104
|
-
| `
|
|
105
|
-
| `graphflow_expand_anchor` | Expand a single anchor to full content | **High** - dive deeper into specific items |
|
|
102
|
+
| `graphflow_context` | Preview compressed context (query) or expand anchor (anchorId) | **Highest** - default first step |
|
|
106
103
|
|
|
107
104
|
### Planning Tools (High Frequency)
|
|
108
105
|
|
|
109
106
|
| Tool | Purpose | Call Frequency |
|
|
110
107
|
|------|---------|---------------|
|
|
111
|
-
| `graphflow_plan` | Multi-step task decomposition & DAG | High - before complex work |
|
|
112
|
-
| `graphflow_plan_insight` | Six Thinking Hats + 5-Why deep analysis | Medium - ambiguous/high-stakes tasks |
|
|
108
|
+
| `graphflow_plan` | Multi-step task decomposition & DAG (mode='simple' or 'insight') | High - before complex work |
|
|
113
109
|
| `graphflow_run` | Plan + context package (bridge mode) | Medium - full task packaging |
|
|
114
110
|
| `graphflow_report_outcome` | Report bridge-mode execution outcome back | Medium - close the learning loop |
|
|
115
|
-
| `
|
|
116
|
-
| `graphflow_merge_insight` | Merge submitted insights into unified plan | Medium - after submit_insight |
|
|
111
|
+
| `graphflow_insight` | Submit or merge agent insights | Medium - no external LLM API |
|
|
117
112
|
|
|
118
113
|
### Graph Management Tools (Medium Frequency)
|
|
119
114
|
|
|
120
115
|
| Tool | Purpose | Call Frequency |
|
|
121
116
|
|------|---------|---------------|
|
|
122
|
-
| `graphflow_index` | Incremental workspace re-index | Medium - after file changes |
|
|
123
|
-
| `graphflow_index_file` | Single file incremental index | Medium-High - after saving a file |
|
|
124
|
-
| `graphflow_rebuild` | Clear cache + full re-index | Low - when graph is stale/corrupted |
|
|
125
|
-
| `graphflow_inspect_graph` | Graph stats & sample nodes/edges | Low - check graph health |
|
|
117
|
+
| `graphflow_index` | Incremental workspace re-index, single-file, or full rebuild | Medium - after file changes |
|
|
126
118
|
|
|
127
119
|
### Collaboration & Insights Tools (Low Frequency)
|
|
128
120
|
|
|
129
121
|
| Tool | Purpose | Call Frequency |
|
|
130
122
|
|------|---------|---------------|
|
|
131
|
-
| `
|
|
132
|
-
| `graphflow_import_artifact` | Import graph artifact | Low - skip full index on new machine |
|
|
123
|
+
| `graphflow_artifact` | Export or import graph artifact | Low - team sharing |
|
|
133
124
|
| `graphflow_skill_insights` | Learned skill patterns | Low - leverage prior learning |
|
|
134
125
|
| `graphflow_skill_guide` | Skill usage guide for connected agents | Low - onboarding |
|
|
135
|
-
| `
|
|
136
|
-
| `graphflow_diagnose` | Provider health & model routing | Rare - config issues |
|
|
126
|
+
| `graphflow_diagnose` | Provider health, graph stats, and token savings | Low - ROI tracking / config issues |
|
|
137
127
|
|
|
138
128
|
---
|
|
139
129
|
|
|
@@ -144,32 +134,32 @@ Run `npx @roarpeng/graphflow install` from the project root. Do **not** hardcode
|
|
|
144
134
|
**Use when:** Answering code questions, exploring codebase, understanding modules
|
|
145
135
|
|
|
146
136
|
```
|
|
147
|
-
Step 1:
|
|
137
|
+
Step 1: graphflow_context(query: "<your question>")
|
|
148
138
|
Step 2: Read summary + anchors as primary context
|
|
149
|
-
Step 3: Expand specific anchors with
|
|
139
|
+
Step 3: Expand specific anchors with graphflow_context(anchorId: "...") when needed
|
|
150
140
|
Step 4: Read full files only when exact edits required
|
|
151
141
|
```
|
|
152
142
|
|
|
153
|
-
**Input -
|
|
143
|
+
**Input - context (preview):**
|
|
154
144
|
```typescript
|
|
155
145
|
{
|
|
156
|
-
query: string; // Required - user question (Chinese OK)
|
|
146
|
+
query: string; // Required for preview - user question (Chinese OK)
|
|
157
147
|
englishQuery?: string; // Agent-translated English code search terms (recommended for CJK)
|
|
158
148
|
configPath?: string;
|
|
159
149
|
rootDir?: string;
|
|
160
150
|
}
|
|
161
151
|
```
|
|
162
152
|
|
|
163
|
-
**Input -
|
|
153
|
+
**Input - context (expand):**
|
|
164
154
|
```typescript
|
|
165
155
|
{
|
|
166
|
-
anchorId: string; // Required - anchor id from
|
|
156
|
+
anchorId: string; // Required for expand - anchor id from preview
|
|
167
157
|
configPath?: string;
|
|
168
158
|
rootDir?: string;
|
|
169
159
|
}
|
|
170
160
|
```
|
|
171
161
|
|
|
172
|
-
**Output structure (
|
|
162
|
+
**Output structure (preview):**
|
|
173
163
|
```typescript
|
|
174
164
|
{
|
|
175
165
|
summary: string[];
|
|
@@ -197,12 +187,14 @@ GraphFlow tokenizes CJK and expands workspace path hints. When that is not enoug
|
|
|
197
187
|
**Preferred (proactive):**
|
|
198
188
|
```
|
|
199
189
|
Step 1: Translate user intent to English file/symbol terms with YOUR model
|
|
200
|
-
Step 2:
|
|
190
|
+
Step 2: graphflow_context({ query: "<Chinese>", englishQuery: "PoseDetectionPage avatarMode BattlePage shieldEffect", rootDir })
|
|
201
191
|
Step 3: Use summary + anchors
|
|
202
192
|
```
|
|
203
193
|
|
|
204
194
|
Use **exact file/class/component names** (PascalCase stems). Avoid generic words like `exercise` when the user means camera/pose UI — that word often hits data/types layers instead of pages.
|
|
205
195
|
|
|
196
|
+
For **module families** (Zustand store + `slices/`): put file stems in `englishQuery` (`useGameStore companionSlice dailySlice inventorySlice`), not bare domain words like `monster` (often ranks `data/monsters` over `monsterSlice`).
|
|
197
|
+
|
|
206
198
|
**Fallback:** If `anchorCount < 3` and `agentWorkItems` includes `query-translate-en`, answer JSON prompt and retry with `englishQuery`.
|
|
207
199
|
|
|
208
200
|
---
|
|
@@ -212,7 +204,7 @@ Use **exact file/class/component names** (PascalCase stems). Avoid generic words
|
|
|
212
204
|
**Use when:** Multi-step changes, refactors, features with unclear scope
|
|
213
205
|
|
|
214
206
|
```
|
|
215
|
-
Step 1:
|
|
207
|
+
Step 1: graphflow_context(query: "<task>")
|
|
216
208
|
Step 2: graphflow_plan(task: "<task description>")
|
|
217
209
|
Step 3: Review plan steps and dependencies
|
|
218
210
|
Step 4: Execute step by step, using GraphFlow context for each step
|
|
@@ -223,6 +215,8 @@ Step 5: graphflow_index() after major changes
|
|
|
223
215
|
```typescript
|
|
224
216
|
{
|
|
225
217
|
task: string; // Required - task description to plan
|
|
218
|
+
mode?: "simple" | "insight"; // 'simple' (default) for quick planning, 'insight' for Six Hats + 5-Why
|
|
219
|
+
configPath?: string;
|
|
226
220
|
}
|
|
227
221
|
```
|
|
228
222
|
|
|
@@ -250,8 +244,8 @@ Step 5: graphflow_index() after major changes
|
|
|
250
244
|
**Use when:** High-stakes changes, root-cause analysis, ambiguous requirements
|
|
251
245
|
|
|
252
246
|
```
|
|
253
|
-
Step 1:
|
|
254
|
-
Step 2:
|
|
247
|
+
Step 1: graphflow_context(query: "<task>")
|
|
248
|
+
Step 2: graphflow_plan(task: "<task description>", mode: "insight")
|
|
255
249
|
Step 3: Review Six Hats analysis and 5-Why chains
|
|
256
250
|
Step 4: Use insights to inform implementation plan
|
|
257
251
|
Step 5: Execute with regular context previews
|
|
@@ -304,7 +298,7 @@ graphflow_index(rootDir?: string, configPath?: string)
|
|
|
304
298
|
|
|
305
299
|
#### Single File Index (fastest)
|
|
306
300
|
```
|
|
307
|
-
|
|
301
|
+
graphflow_index(filePath: string, configPath?: string)
|
|
308
302
|
```
|
|
309
303
|
- Index just one file
|
|
310
304
|
- Perfect for onSave hooks
|
|
@@ -312,7 +306,7 @@ graphflow_index_file(filePath: string, configPath?: string)
|
|
|
312
306
|
|
|
313
307
|
#### Full Rebuild (slow but clean)
|
|
314
308
|
```
|
|
315
|
-
|
|
309
|
+
graphflow_index(mode: "full", rootDir?: string, configPath?: string)
|
|
316
310
|
```
|
|
317
311
|
- Clears ALL cached data
|
|
318
312
|
- Full re-index from scratch
|
|
@@ -320,11 +314,12 @@ graphflow_rebuild(rootDir?: string, configPath?: string)
|
|
|
320
314
|
|
|
321
315
|
#### Inspect Graph State
|
|
322
316
|
```
|
|
323
|
-
|
|
317
|
+
graphflow_diagnose(nodeLimit?, edgeLimit?, rootDir?)
|
|
324
318
|
```
|
|
325
319
|
- Check graph size, file count, symbol count
|
|
326
320
|
- Verify indexing worked correctly
|
|
327
321
|
- Sample nodes to verify quality
|
|
322
|
+
- Also shows provider health and token savings
|
|
328
323
|
|
|
329
324
|
---
|
|
330
325
|
|
|
@@ -334,7 +329,7 @@ graphflow_inspect_graph(nodeLimit?, edgeLimit?, rootDir?)
|
|
|
334
329
|
|
|
335
330
|
#### Export Artifact
|
|
336
331
|
```
|
|
337
|
-
|
|
332
|
+
graphflow_artifact(mode: "export", outputPath?, compression?)
|
|
338
333
|
```
|
|
339
334
|
- Export graph to portable gzip artifact
|
|
340
335
|
- Share with team to skip full indexing
|
|
@@ -342,7 +337,7 @@ graphflow_export_artifact(outputPath?, compression?)
|
|
|
342
337
|
|
|
343
338
|
#### Import Artifact
|
|
344
339
|
```
|
|
345
|
-
|
|
340
|
+
graphflow_artifact(mode: "import", inputPath?)
|
|
346
341
|
```
|
|
347
342
|
- Import teammate's graph artifact
|
|
348
343
|
- Skip initial full workspace index
|
|
@@ -362,9 +357,9 @@ graphflow_skill_insights(limit?, rootDir?)
|
|
|
362
357
|
|
|
363
358
|
#### Token Savings Stats
|
|
364
359
|
```
|
|
365
|
-
|
|
360
|
+
graphflow_diagnose(configPath?, rootDir?)
|
|
366
361
|
```
|
|
367
|
-
-
|
|
362
|
+
- Check the `stats` field for cumulative token savings across all runs
|
|
368
363
|
- ROI tracking
|
|
369
364
|
- See how much GraphFlow has saved
|
|
370
365
|
|
|
@@ -375,6 +370,7 @@ graphflow_diagnose(configPath?)
|
|
|
375
370
|
- Check provider health
|
|
376
371
|
- Verify model routing
|
|
377
372
|
- Debug configuration issues
|
|
373
|
+
- Also returns graph stats and token savings
|
|
378
374
|
|
|
379
375
|
---
|
|
380
376
|
|
|
@@ -384,37 +380,37 @@ graphflow_diagnose(configPath?)
|
|
|
384
380
|
Start
|
|
385
381
|
│
|
|
386
382
|
├─ Is this a codebase question/exploration?
|
|
387
|
-
│ └─ YES →
|
|
383
|
+
│ └─ YES → graphflow_context ← START HERE
|
|
388
384
|
│ │
|
|
389
385
|
│ └─ Need more detail on specific item?
|
|
390
|
-
│ └─ YES →
|
|
386
|
+
│ └─ YES → graphflow_context(anchorId)
|
|
391
387
|
│
|
|
392
388
|
├─ Is this a multi-step coding task?
|
|
393
|
-
│ ├─ Simple (2-3 files) →
|
|
394
|
-
│ ├─ Complex →
|
|
395
|
-
│ └─ Ambiguous/high-stakes →
|
|
389
|
+
│ ├─ Simple (2-3 files) → context + implement
|
|
390
|
+
│ ├─ Complex → context → graphflow_plan → implement
|
|
391
|
+
│ └─ Ambiguous/high-stakes → context → graphflow_plan(mode="insight") → implement
|
|
396
392
|
│
|
|
397
393
|
├─ Do you need a complete packaged task?
|
|
398
394
|
│ └─ YES → graphflow_run (bridge mode) → execute → report_outcome
|
|
399
395
|
│
|
|
400
396
|
├─ Did you just make file changes?
|
|
401
|
-
│ ├─ Single file →
|
|
397
|
+
│ ├─ Single file → graphflow_index(filePath)
|
|
402
398
|
│ └─ Multiple files → graphflow_index (incremental)
|
|
403
399
|
│
|
|
404
400
|
├─ Is the graph giving bad results?
|
|
405
|
-
│ ├─ First →
|
|
401
|
+
│ ├─ First → graphflow_diagnose (check state)
|
|
406
402
|
│ ├─ Then → graphflow_index (try incremental)
|
|
407
|
-
│ └─ Last resort →
|
|
403
|
+
│ └─ Last resort → graphflow_index(mode="full") (full rebuild)
|
|
408
404
|
│
|
|
409
405
|
├─ Sharing with teammates?
|
|
410
|
-
│ ├─ Export →
|
|
411
|
-
│ └─ Import →
|
|
406
|
+
│ ├─ Export → graphflow_artifact(mode="export")
|
|
407
|
+
│ └─ Import → graphflow_artifact(mode="import")
|
|
412
408
|
│
|
|
413
409
|
├─ Do you want to leverage prior learning?
|
|
414
410
|
│ └─ YES → graphflow_skill_insights
|
|
415
411
|
│
|
|
416
412
|
├─ Tracking ROI?
|
|
417
|
-
│ └─
|
|
413
|
+
│ └─ graphflow_diagnose (check stats field)
|
|
418
414
|
│
|
|
419
415
|
└─ Is routing/models misbehaving?
|
|
420
416
|
└─ YES → graphflow_diagnose
|
|
@@ -455,21 +451,21 @@ Always pay attention to `tokenBudget`:
|
|
|
455
451
|
## Best Practices
|
|
456
452
|
|
|
457
453
|
### 1. Context First, Always
|
|
458
|
-
- Start EVERY coding task with `
|
|
454
|
+
- Start EVERY coding task with `graphflow_context`
|
|
459
455
|
- Only read full files when compressed context is insufficient
|
|
460
456
|
- Never grep the whole repo before trying GraphFlow
|
|
461
457
|
|
|
462
458
|
### 2. Plan Before Complex Work
|
|
463
459
|
- Use `graphflow_plan` for anything beyond 2-3 files
|
|
464
|
-
- Use `
|
|
460
|
+
- Use `graphflow_plan(mode="insight")` for ambiguous tasks
|
|
465
461
|
- Follow the DAG order (respect dependencies)
|
|
466
462
|
- Use context from GraphFlow at each step
|
|
467
463
|
|
|
468
464
|
### 3. Keep Graph Fresh
|
|
469
|
-
- Call `
|
|
465
|
+
- Call `graphflow_index(filePath)` after saving individual files
|
|
470
466
|
- Call `graphflow_index` after significant changes
|
|
471
467
|
- Prefer incremental index over full rebuild
|
|
472
|
-
- Check `
|
|
468
|
+
- Check `graphflow_diagnose` if results seem off
|
|
473
469
|
|
|
474
470
|
### 4. Close the Learning Loop
|
|
475
471
|
- After bridge-mode runs, call `graphflow_report_outcome`
|
|
@@ -492,18 +488,18 @@ Always pay attention to `tokenBudget`:
|
|
|
492
488
|
|
|
493
489
|
### "0 anchors found" or empty results
|
|
494
490
|
1. **Chinese/CJK:** translate to English keywords; pass `englishQuery` or answer `agentWorkItems` id `query-translate-en`
|
|
495
|
-
2. Check if graph exists: `
|
|
491
|
+
2. Check if graph exists: `graphflow_diagnose`
|
|
496
492
|
3. If empty: run `graphflow_index`
|
|
497
493
|
4. If still empty: verify `rootDir` points to correct project
|
|
498
494
|
|
|
499
495
|
### Results seem stale
|
|
500
496
|
1. Run `graphflow_index` (incremental, fast)
|
|
501
|
-
2. If still stale: `
|
|
497
|
+
2. If still stale: `graphflow_index(mode="full")` (full, slow)
|
|
502
498
|
|
|
503
499
|
### Context quality is poor
|
|
504
500
|
1. Try more specific query terms
|
|
505
|
-
2. Check if symbols are indexed (
|
|
506
|
-
3. Run `
|
|
501
|
+
2. Check if symbols are indexed (diagnose)
|
|
502
|
+
3. Run `graphflow_index(mode="full")` if the graph may be stale
|
|
507
503
|
|
|
508
504
|
### Tool errors / configuration issues
|
|
509
505
|
1. Run `graphflow_diagnose` to check provider health
|
|
@@ -511,9 +507,9 @@ Always pay attention to `tokenBudget`:
|
|
|
511
507
|
3. Check workspace root is correct
|
|
512
508
|
|
|
513
509
|
### Want to share graph with teammates
|
|
514
|
-
1. Export: `
|
|
510
|
+
1. Export: `graphflow_artifact(mode="export")`
|
|
515
511
|
2. Send the artifact file
|
|
516
|
-
3. Teammate imports: `
|
|
512
|
+
3. Teammate imports: `graphflow_artifact(mode="import")`
|
|
517
513
|
|
|
518
514
|
---
|
|
519
515
|
|
|
@@ -521,16 +517,16 @@ Always pay attention to `tokenBudget`:
|
|
|
521
517
|
|
|
522
518
|
```typescript
|
|
523
519
|
// 90% of the time - start here
|
|
524
|
-
await
|
|
520
|
+
await graphflow_context({ query: "what you're looking for" });
|
|
525
521
|
|
|
526
522
|
// Need more detail on a specific anchor?
|
|
527
|
-
await
|
|
523
|
+
await graphflow_context({ anchorId: "symbol:src/foo.ts:abc123" });
|
|
528
524
|
|
|
529
525
|
// Before complex tasks
|
|
530
526
|
await graphflow_plan({ task: "describe the task" });
|
|
531
527
|
|
|
532
528
|
// Deep analysis with Six Thinking Hats + 5-Why
|
|
533
|
-
await
|
|
529
|
+
await graphflow_plan({ task: "complex ambiguous task", mode: "insight" });
|
|
534
530
|
|
|
535
531
|
// Full packaged task (bridge mode)
|
|
536
532
|
const result = await graphflow_run({ task: "full task description" });
|
|
@@ -542,27 +538,24 @@ await graphflow_report_outcome({
|
|
|
542
538
|
});
|
|
543
539
|
|
|
544
540
|
// After making changes - single file
|
|
545
|
-
await
|
|
541
|
+
await graphflow_index({ filePath: "src/foo.ts" });
|
|
546
542
|
|
|
547
543
|
// After making changes - workspace
|
|
548
544
|
await graphflow_index({ rootDir: "/path/to/project" });
|
|
549
545
|
|
|
550
|
-
// Check graph health
|
|
551
|
-
await
|
|
546
|
+
// Check graph health + stats + savings
|
|
547
|
+
await graphflow_diagnose({ nodeLimit: 20 });
|
|
552
548
|
|
|
553
549
|
// When graph is broken
|
|
554
|
-
await
|
|
550
|
+
await graphflow_index({ mode: "full", rootDir: "/path/to/project" });
|
|
555
551
|
|
|
556
552
|
// Team collaboration
|
|
557
|
-
await
|
|
558
|
-
await
|
|
553
|
+
await graphflow_artifact({ mode: "export", outputPath: "graph-artifact.gz" });
|
|
554
|
+
await graphflow_artifact({ mode: "import", inputPath: "graph-artifact.gz" });
|
|
559
555
|
|
|
560
556
|
// Leverage prior learning
|
|
561
557
|
await graphflow_skill_insights({ limit: 5 });
|
|
562
558
|
|
|
563
|
-
// Token savings stats
|
|
564
|
-
await graphflow_stats();
|
|
565
|
-
|
|
566
559
|
// Diagnose issues
|
|
567
560
|
await graphflow_diagnose();
|
|
568
561
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roarpeng/graphflow",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
91
|
+
"@xenova/transformers": "^2.17.2",
|
|
91
92
|
"gpt-tokenizer": "^3.4.0",
|
|
92
|
-
"hnswlib-node": "^3.0.0",
|
|
93
93
|
"pino": "^10.3.1",
|
|
94
94
|
"pino-pretty": "^13.1.3",
|
|
95
95
|
"web-tree-sitter": "^0.20.8"
|
|
@@ -6,11 +6,11 @@ GraphFlow is a graph-based context and planning MCP service. **You MUST use it b
|
|
|
6
6
|
|
|
7
7
|
Before code exploration, implementation, debugging, review, planning, or architecture questions:
|
|
8
8
|
|
|
9
|
-
1. Call MCP tool **`
|
|
9
|
+
1. Call MCP tool **`graphflow_context`** with the user's task/query and **`rootDir`** set to the current project absolute path.
|
|
10
10
|
2. Use returned `summary`, `anchors`, `refillPreview`, and `tokenBudget` as the primary context.
|
|
11
11
|
3. Read full files only when anchors point there, compressed context is insufficient, or exact edits require the file body.
|
|
12
12
|
4. For multi-step or ambiguous work, call **`graphflow_plan`** before implementation.
|
|
13
|
-
5. After major file changes, call **`graphflow_index`** or
|
|
13
|
+
5. After major file changes, call **`graphflow_index`** (or pass `filePath` for single-file index).
|
|
14
14
|
|
|
15
15
|
**Do NOT** recursively grep the whole repository or read large files before GraphFlow preview.
|
|
16
16
|
|
|
@@ -19,11 +19,12 @@ Before code exploration, implementation, debugging, review, planning, or archite
|
|
|
19
19
|
Code symbols are mostly English. For Chinese user questions:
|
|
20
20
|
|
|
21
21
|
1. **Proactive:** Translate intent to English **file/class/component names** and pass **`englishQuery`** (e.g. `PoseDetectionPage`, `BattlePage`, `shieldEffect`). Avoid generic `exercise` when the user means UI/camera.
|
|
22
|
-
2. **
|
|
23
|
-
3.
|
|
22
|
+
2. **Module families (store/slices):** Prefer file stems (`useGameStore companionSlice dailySlice`), not bare domain words like `monster` (often hits `data/monsters` instead of `monsterSlice`).
|
|
23
|
+
3. **Reactive:** If preview returns `agentWorkItems` with `query-translate-en`, answer the JSON prompt, then retry with `englishQuery`.
|
|
24
|
+
4. Keep `query` as the original Chinese text.
|
|
24
25
|
|
|
25
26
|
```typescript
|
|
26
|
-
|
|
27
|
+
graphflow_context({
|
|
27
28
|
query: "摄像头锻炼人物角色选择",
|
|
28
29
|
englishQuery: "PoseDetectionPage avatarMode poseService",
|
|
29
30
|
rootDir: "/absolute/path/to/project"
|
|
@@ -34,12 +35,11 @@ graphflow_preview_context({
|
|
|
34
35
|
|
|
35
36
|
| Tool | When |
|
|
36
37
|
|------|------|
|
|
37
|
-
| `
|
|
38
|
-
| `graphflow_expand_anchor` | Need full content of one anchor |
|
|
38
|
+
| `graphflow_context` | **Always first** for code questions (use `query`); need full content of one anchor (use `anchorId`) |
|
|
39
39
|
| `graphflow_plan` | Multi-step tasks |
|
|
40
40
|
| `graphflow_index` | After significant edits |
|
|
41
41
|
|
|
42
|
-
For the full
|
|
42
|
+
For the full 10-tool reference and workflows, use Skill **`graphflow`** in `~/.gemini/antigravity/skills/graphflow/SKILL.md` or `.agent/skills/graphflow/SKILL.md`.
|
|
43
43
|
|
|
44
44
|
## Bridge mode
|
|
45
45
|
|
|
@@ -4,7 +4,7 @@ GraphFlow is a graph-based context and planning service backed by a persistent M
|
|
|
4
4
|
|
|
5
5
|
Before broad code exploration, implementation, debugging, review, planning, or architecture questions:
|
|
6
6
|
|
|
7
|
-
1. Call `
|
|
7
|
+
1. Call `graphflow_context` with the user's task/query.
|
|
8
8
|
2. Use the returned `summary`, `anchors`, `refillPreview`, and `tokenBudget` as the first context source.
|
|
9
9
|
3. Read full files only when:
|
|
10
10
|
- GraphFlow anchors point to that file/symbol,
|
|
@@ -45,16 +45,16 @@ Do **not** hardcode `GRAPHFLOW_WORKSPACE_ROOT` — let the MCP server detect the
|
|
|
45
45
|
|
|
46
46
|
Code symbols are mostly English. For Chinese user questions:
|
|
47
47
|
|
|
48
|
-
1. **Proactive:** Before or with `
|
|
49
|
-
2. **
|
|
50
|
-
3.
|
|
48
|
+
1. **Proactive:** Before or with `graphflow_context`, translate intent to English **file/class/component names** (e.g. `PoseDetectionPage`, `BattlePage`, `shieldEffect`) and pass `englishQuery`. Avoid generic terms like `exercise` when the user means UI/camera — they often match data/types layers.
|
|
49
|
+
2. **Module families (store/slices):** Prefer file stems (`useGameStore companionSlice dailySlice inventorySlice`), not bare domain words like `monster` (often hits `data/monsters` instead of `monsterSlice`).
|
|
50
|
+
3. **Reactive:** If preview returns `agentWorkItems` with `query-translate-en` (low `anchorCount`), answer the JSON prompt with your model, then retry preview with `englishQuery`.
|
|
51
|
+
4. Keep `query` as the original Chinese text; use `englishQuery` for search terms only.
|
|
51
52
|
|
|
52
53
|
## High-frequency MCP tools
|
|
53
54
|
|
|
54
55
|
| Tool | When |
|
|
55
56
|
|------|------|
|
|
56
|
-
| `
|
|
57
|
-
| `graphflow_expand_anchor` | Need full content of one anchor |
|
|
57
|
+
| `graphflow_context` | **Always first** for code questions (use `query`); expand anchor with `anchorId` |
|
|
58
58
|
| `graphflow_plan` | Multi-step tasks |
|
|
59
59
|
| `graphflow_run` | Full task packaging (bridge mode) |
|
|
60
60
|
| `graphflow_report_outcome` | After executing a `graphflow_run` descriptor |
|
|
@@ -11,7 +11,7 @@ GraphFlow is a graph-based context and planning service backed by a persistent M
|
|
|
11
11
|
|
|
12
12
|
Before broad code exploration, implementation, debugging, review, planning, or architecture questions:
|
|
13
13
|
|
|
14
|
-
1. Call `
|
|
14
|
+
1. Call `graphflow_context` with the user's task/query.
|
|
15
15
|
2. Use the returned `summary`, `anchors`, `refillPreview`, and `tokenBudget` as the first context source.
|
|
16
16
|
3. Read full files only when:
|
|
17
17
|
- GraphFlow anchors point to that file/symbol,
|
|
@@ -31,57 +31,50 @@ Do not scan the whole repository, recursively inspect many files, or read large
|
|
|
31
31
|
|
|
32
32
|
Code symbols are mostly English. For Chinese user questions:
|
|
33
33
|
|
|
34
|
-
1. **Proactive:** Before or with `
|
|
35
|
-
2. **
|
|
36
|
-
3.
|
|
34
|
+
1. **Proactive:** Before or with `graphflow_context`, translate intent to English **file/class/component names** (e.g. `PoseDetectionPage`, `BattlePage`, `shieldEffect`) and pass `englishQuery`. Avoid generic terms like `exercise` when the user means UI/camera — they often match data/types layers.
|
|
35
|
+
2. **Module families (store/slices):** Prefer file stems (`useGameStore companionSlice dailySlice inventorySlice`), not bare domain words like `monster` (often hits `data/monsters` instead of `monsterSlice`).
|
|
36
|
+
3. **Reactive:** If preview returns `agentWorkItems` with `query-translate-en` (low `anchorCount`), answer the JSON prompt with your model, then retry preview with `englishQuery`.
|
|
37
|
+
4. Keep `query` as the original Chinese text; use `englishQuery` for search terms only.
|
|
37
38
|
|
|
38
39
|
```typescript
|
|
39
|
-
|
|
40
|
+
graphflow_context({
|
|
40
41
|
query: "游戏战斗系统怎么实现的",
|
|
41
42
|
englishQuery: "battle combat fight damage scene system",
|
|
42
43
|
rootDir: "/absolute/path/to/project"
|
|
43
44
|
})
|
|
44
45
|
```
|
|
45
46
|
|
|
46
|
-
## Tool Inventory (
|
|
47
|
+
## Tool Inventory (10 MCP Tools)
|
|
47
48
|
|
|
48
49
|
### Core Context Tools (Highest Frequency)
|
|
49
50
|
|
|
50
51
|
| Tool | Purpose | Call Frequency |
|
|
51
52
|
|------|---------|---------------|
|
|
52
|
-
| `
|
|
53
|
-
| `graphflow_expand_anchor` | Expand a single anchor to full content | **High** - dive deeper into specific items |
|
|
53
|
+
| `graphflow_context` | Preview compressed context (query) or expand anchor (anchorId) | **Highest** - default first step |
|
|
54
54
|
|
|
55
55
|
### Planning Tools (High Frequency)
|
|
56
56
|
|
|
57
57
|
| Tool | Purpose | Call Frequency |
|
|
58
58
|
|------|---------|---------------|
|
|
59
|
-
| `graphflow_plan` | Multi-step task decomposition & DAG | High - before complex work |
|
|
60
|
-
| `graphflow_plan_insight` | Six Thinking Hats + 5-Why deep analysis | Medium - ambiguous/high-stakes tasks |
|
|
59
|
+
| `graphflow_plan` | Multi-step task decomposition & DAG (mode='simple' or 'insight') | High - before complex work |
|
|
61
60
|
| `graphflow_run` | Plan + context package (bridge mode) | Medium - full task packaging |
|
|
62
61
|
| `graphflow_report_outcome` | Report bridge-mode execution outcome back | Medium - close the learning loop |
|
|
63
|
-
| `
|
|
64
|
-
| `graphflow_merge_insight` | Merge submitted insights into unified plan | Medium - after submit_insight |
|
|
62
|
+
| `graphflow_insight` | Submit or merge agent insights | Medium - no external LLM API |
|
|
65
63
|
|
|
66
64
|
### Graph Management Tools (Medium Frequency)
|
|
67
65
|
|
|
68
66
|
| Tool | Purpose | Call Frequency |
|
|
69
67
|
|------|---------|---------------|
|
|
70
|
-
| `graphflow_index` | Incremental workspace re-index | Medium - after file changes |
|
|
71
|
-
| `graphflow_index_file` | Single file incremental index | Medium-High - after saving a file |
|
|
72
|
-
| `graphflow_rebuild` | Clear cache + full re-index | Low - when graph is stale/corrupted |
|
|
73
|
-
| `graphflow_inspect_graph` | Graph stats & sample nodes/edges | Low - check graph health |
|
|
68
|
+
| `graphflow_index` | Incremental workspace re-index, single-file, or full rebuild | Medium - after file changes |
|
|
74
69
|
|
|
75
70
|
### Collaboration & Insights Tools (Low Frequency)
|
|
76
71
|
|
|
77
72
|
| Tool | Purpose | Call Frequency |
|
|
78
73
|
|------|---------|---------------|
|
|
79
|
-
| `
|
|
80
|
-
| `graphflow_import_artifact` | Import graph artifact | Low - skip full index on new machine |
|
|
74
|
+
| `graphflow_artifact` | Export or import graph artifact | Low - team sharing |
|
|
81
75
|
| `graphflow_skill_insights` | Learned skill patterns | Low - leverage prior learning |
|
|
82
76
|
| `graphflow_skill_guide` | Skill usage guide for connected agents | Low - onboarding |
|
|
83
|
-
| `
|
|
84
|
-
| `graphflow_diagnose` | Provider health & model routing | Rare - config issues |
|
|
77
|
+
| `graphflow_diagnose` | Provider health, graph stats, and token savings | Rare - config issues |
|
|
85
78
|
|
|
86
79
|
## Standard Workflows
|
|
87
80
|
|
|
@@ -90,9 +83,9 @@ graphflow_preview_context({
|
|
|
90
83
|
**Use when:** Answering code questions, exploring codebase, understanding modules
|
|
91
84
|
|
|
92
85
|
```
|
|
93
|
-
Step 1:
|
|
86
|
+
Step 1: graphflow_context(query: "<your question>")
|
|
94
87
|
Step 2: Read summary + anchors as primary context
|
|
95
|
-
Step 3: Expand specific anchors with
|
|
88
|
+
Step 3: Expand specific anchors with graphflow_context(anchorId: "...") when needed
|
|
96
89
|
Step 4: Read full files only when exact edits required
|
|
97
90
|
```
|
|
98
91
|
|
|
@@ -101,7 +94,7 @@ Step 4: Read full files only when exact edits required
|
|
|
101
94
|
**Use when:** Multi-step changes, refactors, features with unclear scope
|
|
102
95
|
|
|
103
96
|
```
|
|
104
|
-
Step 1:
|
|
97
|
+
Step 1: graphflow_context(query: "<task>")
|
|
105
98
|
Step 2: graphflow_plan(task: "<task description>")
|
|
106
99
|
Step 3: Review plan steps and dependencies
|
|
107
100
|
Step 4: Execute step by step, using GraphFlow context for each step
|
|
@@ -113,8 +106,8 @@ Step 5: graphflow_index() after major changes
|
|
|
113
106
|
**Use when:** High-stakes changes, root-cause analysis, ambiguous requirements
|
|
114
107
|
|
|
115
108
|
```
|
|
116
|
-
Step 1:
|
|
117
|
-
Step 2:
|
|
109
|
+
Step 1: graphflow_context(query: "<task>")
|
|
110
|
+
Step 2: graphflow_plan(task: "<task>", mode: "insight")
|
|
118
111
|
Step 3: Review analysis and apply findings
|
|
119
112
|
```
|
|
120
113
|
|
|
@@ -124,7 +117,7 @@ After `graphflow_run`, the external agent **must** call `graphflow_report_outcom
|
|
|
124
117
|
|
|
125
118
|
- Pass `episodeId` from the run result, a `success` boolean, and optional `lessons`.
|
|
126
119
|
- Do this after executing the work described in the returned `executionDescriptor`, whether the task succeeded or failed.
|
|
127
|
-
- When the run returns `agentWorkItems`, answer each prompt with your model and call `
|
|
120
|
+
- When the run returns `agentWorkItems`, answer each prompt with your model and call `graphflow_insight(mode: "submit")` once per item (before or with `graphflow_report_outcome`).
|
|
128
121
|
|
|
129
122
|
CLI fallback:
|
|
130
123
|
|
|
@@ -144,4 +137,4 @@ graphflow --json route diagnose
|
|
|
144
137
|
|
|
145
138
|
Treat GraphFlow outputs as structured machine-readable data, not prose.
|
|
146
139
|
|
|
147
|
-
When the user asks about saving token usage, optimizing context, repo understanding, or learning from Graphify, prioritize GraphFlow context compression over ordinary file search.
|
|
140
|
+
When the user asks about saving token usage, optimizing context, repo understanding, or learning from Graphify, prioritize GraphFlow context compression over ordinary file search.
|