@roarpeng/graphflow 1.4.4 → 1.7.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.
Files changed (84) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +25 -0
  3. package/CLAUDE.md +1 -1
  4. package/README.md +69 -47
  5. package/dist/agents/atp-schema.d.ts +59 -0
  6. package/dist/agents/atp-schema.d.ts.map +1 -0
  7. package/dist/agents/atp-schema.js +3 -0
  8. package/dist/agents/atp-schema.js.map +1 -0
  9. package/dist/agents/decision-engine.d.ts +55 -0
  10. package/dist/agents/decision-engine.d.ts.map +1 -0
  11. package/dist/agents/decision-engine.js +338 -0
  12. package/dist/agents/decision-engine.js.map +1 -0
  13. package/dist/agents/insight.d.ts +57 -1
  14. package/dist/agents/insight.d.ts.map +1 -1
  15. package/dist/agents/insight.js +365 -2
  16. package/dist/agents/insight.js.map +1 -1
  17. package/dist/config/defaults.d.ts.map +1 -1
  18. package/dist/config/defaults.js +1 -2
  19. package/dist/config/defaults.js.map +1 -1
  20. package/dist/config/discover-workspace.d.ts.map +1 -1
  21. package/dist/config/discover-workspace.js +4 -0
  22. package/dist/config/discover-workspace.js.map +1 -1
  23. package/dist/config/embedding-factory.js +6 -6
  24. package/dist/config/embedding-factory.js.map +1 -1
  25. package/dist/config/loader.d.ts.map +1 -1
  26. package/dist/config/loader.js +1 -2
  27. package/dist/config/loader.js.map +1 -1
  28. package/dist/config/schema.d.ts +1 -2
  29. package/dist/config/schema.d.ts.map +1 -1
  30. package/dist/core/agent-delegation.d.ts +3 -1
  31. package/dist/core/agent-delegation.d.ts.map +1 -1
  32. package/dist/core/agent-delegation.js +121 -0
  33. package/dist/core/agent-delegation.js.map +1 -1
  34. package/dist/core/orchestrator-context.d.ts.map +1 -1
  35. package/dist/core/orchestrator-context.js +25 -3
  36. package/dist/core/orchestrator-context.js.map +1 -1
  37. package/dist/core/types.d.ts +12 -0
  38. package/dist/core/types.d.ts.map +1 -1
  39. package/dist/graph/context-slicer-types.d.ts +0 -4
  40. package/dist/graph/context-slicer-types.d.ts.map +1 -1
  41. package/dist/graph/context-slicer-types.js.map +1 -1
  42. package/dist/graph/context-slicer.d.ts.map +1 -1
  43. package/dist/graph/context-slicer.js +5 -15
  44. package/dist/graph/context-slicer.js.map +1 -1
  45. package/dist/graph/file-indexer-walker.d.ts +3 -0
  46. package/dist/graph/file-indexer-walker.d.ts.map +1 -1
  47. package/dist/graph/file-indexer-walker.js.map +1 -1
  48. package/dist/graph/file-indexer.d.ts +1 -0
  49. package/dist/graph/file-indexer.d.ts.map +1 -1
  50. package/dist/graph/file-indexer.js +14 -18
  51. package/dist/graph/file-indexer.js.map +1 -1
  52. package/dist/learning/embeddings.d.ts +2 -3
  53. package/dist/learning/embeddings.d.ts.map +1 -1
  54. package/dist/learning/embeddings.js +18 -33
  55. package/dist/learning/embeddings.js.map +1 -1
  56. package/dist/learning/hnsw-index.d.ts +9 -35
  57. package/dist/learning/hnsw-index.d.ts.map +1 -1
  58. package/dist/learning/hnsw-index.js +8 -154
  59. package/dist/learning/hnsw-index.js.map +1 -1
  60. package/dist/surfaces/antigravity-rules/graphflow.md +5 -6
  61. package/dist/surfaces/cli/runtime/graph.d.ts.map +1 -1
  62. package/dist/surfaces/cli/runtime/graph.js +0 -1
  63. package/dist/surfaces/cli/runtime/graph.js.map +1 -1
  64. package/dist/surfaces/cli/runtime/settings.d.ts.map +1 -1
  65. package/dist/surfaces/cli/runtime/settings.js +0 -5
  66. package/dist/surfaces/cli/runtime/settings.js.map +1 -1
  67. package/dist/surfaces/cli/runtime/types.d.ts +0 -8
  68. package/dist/surfaces/cli/runtime/types.d.ts.map +1 -1
  69. package/dist/surfaces/copilot-instructions/graphflow.md +3 -4
  70. package/dist/surfaces/cursor-rules/graphflow.mdc +17 -25
  71. package/dist/surfaces/mcp/tool-definitions.d.ts.map +1 -1
  72. package/dist/surfaces/mcp/tool-definitions.js +31 -124
  73. package/dist/surfaces/mcp/tool-definitions.js.map +1 -1
  74. package/dist/surfaces/mcp/tool-handlers.d.ts.map +1 -1
  75. package/dist/surfaces/mcp/tool-handlers.js +78 -42
  76. package/dist/surfaces/mcp/tool-handlers.js.map +1 -1
  77. package/dist/surfaces/trae-rules/graphflow.md +6 -7
  78. package/dist/surfaces/trae-skill/graphflow/SKILL.md +66 -75
  79. package/package.json +2 -2
  80. package/src/surfaces/antigravity-rules/graphflow.md +5 -6
  81. package/src/surfaces/copilot-instructions/graphflow.md +3 -4
  82. package/src/surfaces/cursor-rules/graphflow.mdc +17 -25
  83. package/src/surfaces/trae-rules/graphflow.md +6 -7
  84. package/src/surfaces/trae-skill/graphflow/SKILL.md +66 -75
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "graphflow"
3
- description: "Graph-based code context compression, task planning, and knowledge graph orchestration (18 MCP tools). Invoke before ANY code question, bug fix, debugging, file reading, Chinese/CJK query, refactor, or multi-step edit — ALWAYS call graphflow_preview_context MCP first when GraphFlow is connected."
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
- 18 tools: preview, expand, plan, plan_insight, │
24
- run, report_outcome, submit_insight, merge_insight,│
25
- index, index_file, rebuild, inspect, skill_insights,│
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 `graphflow_preview_context`
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 `graphflow_preview_context` first |
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 preview call.
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 (18 MCP Tools)
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
- | `graphflow_preview_context` | Compress task context with token budget | **Highest** - default first step |
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
- | `graphflow_submit_insight` | Submit agent answers to Six Hats / plan prompts | Medium - no external LLM API |
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
- | `graphflow_export_artifact` | Export graph to portable artifact | Low - team sharing |
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
- | `graphflow_stats` | Cumulative token savings stats | Low - ROI tracking |
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: graphflow_preview_context(query: "<your question>")
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 graphflow_expand_anchor when needed
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 - preview_context:**
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 - expand_anchor:**
153
+ **Input - context (expand):**
164
154
  ```typescript
165
155
  {
166
- anchorId: string; // Required - anchor id from preview_context
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 (preview_context):**
162
+ **Output structure (preview):**
173
163
  ```typescript
174
164
  {
175
165
  summary: string[];
@@ -197,7 +187,7 @@ 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: graphflow_preview_context({ query: "<Chinese>", englishQuery: "PoseDetectionPage avatarMode BattlePage shieldEffect", rootDir })
190
+ Step 2: graphflow_context({ query: "<Chinese>", englishQuery: "PoseDetectionPage avatarMode BattlePage shieldEffect", rootDir })
201
191
  Step 3: Use summary + anchors
202
192
  ```
203
193
 
@@ -212,7 +202,7 @@ Use **exact file/class/component names** (PascalCase stems). Avoid generic words
212
202
  **Use when:** Multi-step changes, refactors, features with unclear scope
213
203
 
214
204
  ```
215
- Step 1: graphflow_preview_context(query: "<task>")
205
+ Step 1: graphflow_context(query: "<task>")
216
206
  Step 2: graphflow_plan(task: "<task description>")
217
207
  Step 3: Review plan steps and dependencies
218
208
  Step 4: Execute step by step, using GraphFlow context for each step
@@ -223,6 +213,8 @@ Step 5: graphflow_index() after major changes
223
213
  ```typescript
224
214
  {
225
215
  task: string; // Required - task description to plan
216
+ mode?: "simple" | "insight"; // 'simple' (default) for quick planning, 'insight' for Six Hats + 5-Why
217
+ configPath?: string;
226
218
  }
227
219
  ```
228
220
 
@@ -250,8 +242,8 @@ Step 5: graphflow_index() after major changes
250
242
  **Use when:** High-stakes changes, root-cause analysis, ambiguous requirements
251
243
 
252
244
  ```
253
- Step 1: graphflow_preview_context(query: "<task>")
254
- Step 2: graphflow_plan_insight(task: "<task description>")
245
+ Step 1: graphflow_context(query: "<task>")
246
+ Step 2: graphflow_plan(task: "<task description>", mode: "insight")
255
247
  Step 3: Review Six Hats analysis and 5-Why chains
256
248
  Step 4: Use insights to inform implementation plan
257
249
  Step 5: Execute with regular context previews
@@ -304,7 +296,7 @@ graphflow_index(rootDir?: string, configPath?: string)
304
296
 
305
297
  #### Single File Index (fastest)
306
298
  ```
307
- graphflow_index_file(filePath: string, configPath?: string)
299
+ graphflow_index(filePath: string, configPath?: string)
308
300
  ```
309
301
  - Index just one file
310
302
  - Perfect for onSave hooks
@@ -312,7 +304,7 @@ graphflow_index_file(filePath: string, configPath?: string)
312
304
 
313
305
  #### Full Rebuild (slow but clean)
314
306
  ```
315
- graphflow_rebuild(rootDir?: string, configPath?: string)
307
+ graphflow_index(mode: "full", rootDir?: string, configPath?: string)
316
308
  ```
317
309
  - Clears ALL cached data
318
310
  - Full re-index from scratch
@@ -320,11 +312,12 @@ graphflow_rebuild(rootDir?: string, configPath?: string)
320
312
 
321
313
  #### Inspect Graph State
322
314
  ```
323
- graphflow_inspect_graph(nodeLimit?, edgeLimit?, rootDir?)
315
+ graphflow_diagnose(nodeLimit?, edgeLimit?, rootDir?)
324
316
  ```
325
317
  - Check graph size, file count, symbol count
326
318
  - Verify indexing worked correctly
327
319
  - Sample nodes to verify quality
320
+ - Also shows provider health and token savings
328
321
 
329
322
  ---
330
323
 
@@ -334,7 +327,7 @@ graphflow_inspect_graph(nodeLimit?, edgeLimit?, rootDir?)
334
327
 
335
328
  #### Export Artifact
336
329
  ```
337
- graphflow_export_artifact(outputPath?, compression?)
330
+ graphflow_artifact(mode: "export", outputPath?, compression?)
338
331
  ```
339
332
  - Export graph to portable gzip artifact
340
333
  - Share with team to skip full indexing
@@ -342,7 +335,7 @@ graphflow_export_artifact(outputPath?, compression?)
342
335
 
343
336
  #### Import Artifact
344
337
  ```
345
- graphflow_import_artifact(inputPath?)
338
+ graphflow_artifact(mode: "import", inputPath?)
346
339
  ```
347
340
  - Import teammate's graph artifact
348
341
  - Skip initial full workspace index
@@ -362,9 +355,9 @@ graphflow_skill_insights(limit?, rootDir?)
362
355
 
363
356
  #### Token Savings Stats
364
357
  ```
365
- graphflow_stats(configPath?, rootDir?)
358
+ graphflow_diagnose(configPath?, rootDir?)
366
359
  ```
367
- - Cumulative token savings across all runs
360
+ - Check the `stats` field for cumulative token savings across all runs
368
361
  - ROI tracking
369
362
  - See how much GraphFlow has saved
370
363
 
@@ -375,6 +368,7 @@ graphflow_diagnose(configPath?)
375
368
  - Check provider health
376
369
  - Verify model routing
377
370
  - Debug configuration issues
371
+ - Also returns graph stats and token savings
378
372
 
379
373
  ---
380
374
 
@@ -384,37 +378,37 @@ graphflow_diagnose(configPath?)
384
378
  Start
385
379
 
386
380
  ├─ Is this a codebase question/exploration?
387
- │ └─ YES → graphflow_preview_context ← START HERE
381
+ │ └─ YES → graphflow_context ← START HERE
388
382
  │ │
389
383
  │ └─ Need more detail on specific item?
390
- │ └─ YES → graphflow_expand_anchor
384
+ │ └─ YES → graphflow_context(anchorId)
391
385
 
392
386
  ├─ Is this a multi-step coding task?
393
- │ ├─ Simple (2-3 files) → preview_context + implement
394
- │ ├─ Complex → preview_context → graphflow_plan → implement
395
- │ └─ Ambiguous/high-stakes → preview_contextgraphflow_plan_insight → implement
387
+ │ ├─ Simple (2-3 files) → context + implement
388
+ │ ├─ Complex → context → graphflow_plan → implement
389
+ │ └─ Ambiguous/high-stakes → contextgraphflow_plan(mode="insight") → implement
396
390
 
397
391
  ├─ Do you need a complete packaged task?
398
392
  │ └─ YES → graphflow_run (bridge mode) → execute → report_outcome
399
393
 
400
394
  ├─ Did you just make file changes?
401
- │ ├─ Single file → graphflow_index_file
395
+ │ ├─ Single file → graphflow_index(filePath)
402
396
  │ └─ Multiple files → graphflow_index (incremental)
403
397
 
404
398
  ├─ Is the graph giving bad results?
405
- │ ├─ First → graphflow_inspect_graph (check state)
399
+ │ ├─ First → graphflow_diagnose (check state)
406
400
  │ ├─ Then → graphflow_index (try incremental)
407
- │ └─ Last resort → graphflow_rebuild (full rebuild)
401
+ │ └─ Last resort → graphflow_index(mode="full") (full rebuild)
408
402
 
409
403
  ├─ Sharing with teammates?
410
- │ ├─ Export → graphflow_export_artifact
411
- │ └─ Import → graphflow_import_artifact
404
+ │ ├─ Export → graphflow_artifact(mode="export")
405
+ │ └─ Import → graphflow_artifact(mode="import")
412
406
 
413
407
  ├─ Do you want to leverage prior learning?
414
408
  │ └─ YES → graphflow_skill_insights
415
409
 
416
410
  ├─ Tracking ROI?
417
- │ └─ graphflow_stats
411
+ │ └─ graphflow_diagnose (check stats field)
418
412
 
419
413
  └─ Is routing/models misbehaving?
420
414
  └─ YES → graphflow_diagnose
@@ -455,21 +449,21 @@ Always pay attention to `tokenBudget`:
455
449
  ## Best Practices
456
450
 
457
451
  ### 1. Context First, Always
458
- - Start EVERY coding task with `graphflow_preview_context`
452
+ - Start EVERY coding task with `graphflow_context`
459
453
  - Only read full files when compressed context is insufficient
460
454
  - Never grep the whole repo before trying GraphFlow
461
455
 
462
456
  ### 2. Plan Before Complex Work
463
457
  - Use `graphflow_plan` for anything beyond 2-3 files
464
- - Use `graphflow_plan_insight` for ambiguous tasks
458
+ - Use `graphflow_plan(mode="insight")` for ambiguous tasks
465
459
  - Follow the DAG order (respect dependencies)
466
460
  - Use context from GraphFlow at each step
467
461
 
468
462
  ### 3. Keep Graph Fresh
469
- - Call `graphflow_index_file` after saving individual files
463
+ - Call `graphflow_index(filePath)` after saving individual files
470
464
  - Call `graphflow_index` after significant changes
471
465
  - Prefer incremental index over full rebuild
472
- - Check `graphflow_inspect_graph` if results seem off
466
+ - Check `graphflow_diagnose` if results seem off
473
467
 
474
468
  ### 4. Close the Learning Loop
475
469
  - After bridge-mode runs, call `graphflow_report_outcome`
@@ -492,18 +486,18 @@ Always pay attention to `tokenBudget`:
492
486
 
493
487
  ### "0 anchors found" or empty results
494
488
  1. **Chinese/CJK:** translate to English keywords; pass `englishQuery` or answer `agentWorkItems` id `query-translate-en`
495
- 2. Check if graph exists: `graphflow_inspect_graph`
489
+ 2. Check if graph exists: `graphflow_diagnose`
496
490
  3. If empty: run `graphflow_index`
497
491
  4. If still empty: verify `rootDir` points to correct project
498
492
 
499
493
  ### Results seem stale
500
494
  1. Run `graphflow_index` (incremental, fast)
501
- 2. If still stale: `graphflow_rebuild` (full, slow)
495
+ 2. If still stale: `graphflow_index(mode="full")` (full, slow)
502
496
 
503
497
  ### Context quality is poor
504
498
  1. Try more specific query terms
505
- 2. Check if symbols are indexed (inspect graph)
506
- 3. Run `graphflow_rebuild` if the graph may be stale
499
+ 2. Check if symbols are indexed (diagnose)
500
+ 3. Run `graphflow_index(mode="full")` if the graph may be stale
507
501
 
508
502
  ### Tool errors / configuration issues
509
503
  1. Run `graphflow_diagnose` to check provider health
@@ -511,9 +505,9 @@ Always pay attention to `tokenBudget`:
511
505
  3. Check workspace root is correct
512
506
 
513
507
  ### Want to share graph with teammates
514
- 1. Export: `graphflow_export_artifact`
508
+ 1. Export: `graphflow_artifact(mode="export")`
515
509
  2. Send the artifact file
516
- 3. Teammate imports: `graphflow_import_artifact`
510
+ 3. Teammate imports: `graphflow_artifact(mode="import")`
517
511
 
518
512
  ---
519
513
 
@@ -521,16 +515,16 @@ Always pay attention to `tokenBudget`:
521
515
 
522
516
  ```typescript
523
517
  // 90% of the time - start here
524
- await graphflow_preview_context({ query: "what you're looking for" });
518
+ await graphflow_context({ query: "what you're looking for" });
525
519
 
526
520
  // Need more detail on a specific anchor?
527
- await graphflow_expand_anchor({ anchorId: "symbol:src/foo.ts:abc123" });
521
+ await graphflow_context({ anchorId: "symbol:src/foo.ts:abc123" });
528
522
 
529
523
  // Before complex tasks
530
524
  await graphflow_plan({ task: "describe the task" });
531
525
 
532
526
  // Deep analysis with Six Thinking Hats + 5-Why
533
- await graphflow_plan_insight({ task: "complex ambiguous task" });
527
+ await graphflow_plan({ task: "complex ambiguous task", mode: "insight" });
534
528
 
535
529
  // Full packaged task (bridge mode)
536
530
  const result = await graphflow_run({ task: "full task description" });
@@ -542,27 +536,24 @@ await graphflow_report_outcome({
542
536
  });
543
537
 
544
538
  // After making changes - single file
545
- await graphflow_index_file({ filePath: "src/foo.ts" });
539
+ await graphflow_index({ filePath: "src/foo.ts" });
546
540
 
547
541
  // After making changes - workspace
548
542
  await graphflow_index({ rootDir: "/path/to/project" });
549
543
 
550
- // Check graph health
551
- await graphflow_inspect_graph({ nodeLimit: 20 });
544
+ // Check graph health + stats + savings
545
+ await graphflow_diagnose({ nodeLimit: 20 });
552
546
 
553
547
  // When graph is broken
554
- await graphflow_rebuild({ rootDir: "/path/to/project" });
548
+ await graphflow_index({ mode: "full", rootDir: "/path/to/project" });
555
549
 
556
550
  // Team collaboration
557
- await graphflow_export_artifact({ outputPath: "graph-artifact.gz" });
558
- await graphflow_import_artifact({ inputPath: "graph-artifact.gz" });
551
+ await graphflow_artifact({ mode: "export", outputPath: "graph-artifact.gz" });
552
+ await graphflow_artifact({ mode: "import", inputPath: "graph-artifact.gz" });
559
553
 
560
554
  // Leverage prior learning
561
555
  await graphflow_skill_insights({ limit: 5 });
562
556
 
563
- // Token savings stats
564
- await graphflow_stats();
565
-
566
557
  // Diagnose issues
567
558
  await graphflow_diagnose();
568
559
  ```