From cbdaf97460fa70432585fb4bfb15204f4d65ab5f Mon Sep 17 00:00:00 2001 From: Santhi Prakash Date: Thu, 20 Aug 2026 15:39:12 +0000 Subject: [PATCH 1/7] fix(skillgen): quote .graphify_python in reference fragments for paths with spaces Unquoted $(cat graphify-out/.graphify_python) in shared reference fragments word-splits on Windows when the cached interpreter path contains a space. Quote the substitution in the five reference source fragments and regenerate skill artifacts plus expected/ baselines. Fixes #2856 --- graphify/skills/agents/references/add-watch.md | 4 ++-- graphify/skills/agents/references/exports.md | 2 +- graphify/skills/agents/references/query.md | 16 ++++++++-------- graphify/skills/agents/references/transcribe.md | 2 +- graphify/skills/agents/references/update.md | 12 ++++++------ graphify/skills/amp/references/add-watch.md | 4 ++-- graphify/skills/amp/references/exports.md | 2 +- graphify/skills/amp/references/query.md | 16 ++++++++-------- graphify/skills/amp/references/transcribe.md | 2 +- graphify/skills/amp/references/update.md | 12 ++++++------ graphify/skills/claude/references/add-watch.md | 4 ++-- graphify/skills/claude/references/exports.md | 2 +- graphify/skills/claude/references/query.md | 16 ++++++++-------- graphify/skills/claude/references/transcribe.md | 2 +- graphify/skills/claude/references/update.md | 12 ++++++------ graphify/skills/claw/references/add-watch.md | 4 ++-- graphify/skills/claw/references/exports.md | 2 +- graphify/skills/claw/references/query.md | 16 ++++++++-------- graphify/skills/claw/references/transcribe.md | 2 +- graphify/skills/claw/references/update.md | 12 ++++++------ graphify/skills/codex/references/add-watch.md | 4 ++-- graphify/skills/codex/references/exports.md | 2 +- graphify/skills/codex/references/query.md | 16 ++++++++-------- graphify/skills/codex/references/transcribe.md | 2 +- graphify/skills/codex/references/update.md | 12 ++++++------ graphify/skills/copilot/references/add-watch.md | 4 ++-- graphify/skills/copilot/references/exports.md | 2 +- graphify/skills/copilot/references/query.md | 16 ++++++++-------- graphify/skills/copilot/references/transcribe.md | 2 +- graphify/skills/copilot/references/update.md | 12 ++++++------ graphify/skills/droid/references/add-watch.md | 4 ++-- graphify/skills/droid/references/exports.md | 2 +- graphify/skills/droid/references/query.md | 16 ++++++++-------- graphify/skills/droid/references/transcribe.md | 2 +- graphify/skills/droid/references/update.md | 12 ++++++------ graphify/skills/kilo/references/add-watch.md | 4 ++-- graphify/skills/kilo/references/exports.md | 2 +- graphify/skills/kilo/references/query.md | 16 ++++++++-------- graphify/skills/kilo/references/transcribe.md | 2 +- graphify/skills/kilo/references/update.md | 12 ++++++------ graphify/skills/kiro/references/add-watch.md | 4 ++-- graphify/skills/kiro/references/exports.md | 2 +- graphify/skills/kiro/references/query.md | 16 ++++++++-------- graphify/skills/kiro/references/transcribe.md | 2 +- graphify/skills/kiro/references/update.md | 12 ++++++------ graphify/skills/opencode/references/add-watch.md | 4 ++-- graphify/skills/opencode/references/exports.md | 2 +- graphify/skills/opencode/references/query.md | 16 ++++++++-------- .../skills/opencode/references/transcribe.md | 2 +- graphify/skills/opencode/references/update.md | 12 ++++++------ graphify/skills/pi/references/add-watch.md | 4 ++-- graphify/skills/pi/references/exports.md | 2 +- graphify/skills/pi/references/query.md | 16 ++++++++-------- graphify/skills/pi/references/transcribe.md | 2 +- graphify/skills/pi/references/update.md | 12 ++++++------ graphify/skills/trae/references/add-watch.md | 4 ++-- graphify/skills/trae/references/exports.md | 2 +- graphify/skills/trae/references/query.md | 16 ++++++++-------- graphify/skills/trae/references/transcribe.md | 2 +- graphify/skills/trae/references/update.md | 12 ++++++------ graphify/skills/vscode/references/add-watch.md | 4 ++-- graphify/skills/vscode/references/exports.md | 2 +- graphify/skills/vscode/references/query.md | 16 ++++++++-------- graphify/skills/vscode/references/transcribe.md | 2 +- graphify/skills/vscode/references/update.md | 12 ++++++------ graphify/skills/windows/references/add-watch.md | 4 ++-- graphify/skills/windows/references/exports.md | 2 +- graphify/skills/windows/references/query.md | 16 ++++++++-------- graphify/skills/windows/references/transcribe.md | 2 +- graphify/skills/windows/references/update.md | 12 ++++++------ ...ify__skills__agents__references__add-watch.md | 4 ++-- ...phify__skills__agents__references__exports.md | 2 +- ...raphify__skills__agents__references__query.md | 16 ++++++++-------- ...fy__skills__agents__references__transcribe.md | 2 +- ...aphify__skills__agents__references__update.md | 12 ++++++------ ...aphify__skills__amp__references__add-watch.md | 4 ++-- ...graphify__skills__amp__references__exports.md | 2 +- .../graphify__skills__amp__references__query.md | 16 ++++++++-------- ...phify__skills__amp__references__transcribe.md | 2 +- .../graphify__skills__amp__references__update.md | 12 ++++++------ ...ify__skills__claude__references__add-watch.md | 4 ++-- ...phify__skills__claude__references__exports.md | 2 +- ...raphify__skills__claude__references__query.md | 16 ++++++++-------- ...fy__skills__claude__references__transcribe.md | 2 +- ...aphify__skills__claude__references__update.md | 12 ++++++------ ...phify__skills__claw__references__add-watch.md | 4 ++-- ...raphify__skills__claw__references__exports.md | 2 +- .../graphify__skills__claw__references__query.md | 16 ++++++++-------- ...hify__skills__claw__references__transcribe.md | 2 +- ...graphify__skills__claw__references__update.md | 12 ++++++------ ...hify__skills__codex__references__add-watch.md | 4 ++-- ...aphify__skills__codex__references__exports.md | 2 +- ...graphify__skills__codex__references__query.md | 16 ++++++++-------- ...ify__skills__codex__references__transcribe.md | 2 +- ...raphify__skills__codex__references__update.md | 12 ++++++------ ...fy__skills__copilot__references__add-watch.md | 4 ++-- ...hify__skills__copilot__references__exports.md | 2 +- ...aphify__skills__copilot__references__query.md | 16 ++++++++-------- ...y__skills__copilot__references__transcribe.md | 2 +- ...phify__skills__copilot__references__update.md | 12 ++++++------ ...hify__skills__droid__references__add-watch.md | 4 ++-- ...aphify__skills__droid__references__exports.md | 2 +- ...graphify__skills__droid__references__query.md | 16 ++++++++-------- ...ify__skills__droid__references__transcribe.md | 2 +- ...raphify__skills__droid__references__update.md | 12 ++++++------ ...phify__skills__kilo__references__add-watch.md | 4 ++-- ...raphify__skills__kilo__references__exports.md | 2 +- .../graphify__skills__kilo__references__query.md | 16 ++++++++-------- ...hify__skills__kilo__references__transcribe.md | 2 +- ...graphify__skills__kilo__references__update.md | 12 ++++++------ ...phify__skills__kiro__references__add-watch.md | 4 ++-- ...raphify__skills__kiro__references__exports.md | 2 +- .../graphify__skills__kiro__references__query.md | 16 ++++++++-------- ...hify__skills__kiro__references__transcribe.md | 2 +- ...graphify__skills__kiro__references__update.md | 12 ++++++------ ...y__skills__opencode__references__add-watch.md | 4 ++-- ...ify__skills__opencode__references__exports.md | 2 +- ...phify__skills__opencode__references__query.md | 16 ++++++++-------- ...__skills__opencode__references__transcribe.md | 2 +- ...hify__skills__opencode__references__update.md | 12 ++++++------ ...raphify__skills__pi__references__add-watch.md | 4 ++-- .../graphify__skills__pi__references__exports.md | 2 +- .../graphify__skills__pi__references__query.md | 16 ++++++++-------- ...aphify__skills__pi__references__transcribe.md | 2 +- .../graphify__skills__pi__references__update.md | 12 ++++++------ ...phify__skills__trae__references__add-watch.md | 4 ++-- ...raphify__skills__trae__references__exports.md | 2 +- .../graphify__skills__trae__references__query.md | 16 ++++++++-------- ...hify__skills__trae__references__transcribe.md | 2 +- ...graphify__skills__trae__references__update.md | 12 ++++++------ ...ify__skills__vscode__references__add-watch.md | 4 ++-- ...phify__skills__vscode__references__exports.md | 2 +- ...raphify__skills__vscode__references__query.md | 16 ++++++++-------- ...fy__skills__vscode__references__transcribe.md | 2 +- ...aphify__skills__vscode__references__update.md | 12 ++++++------ ...fy__skills__windows__references__add-watch.md | 4 ++-- ...hify__skills__windows__references__exports.md | 2 +- ...aphify__skills__windows__references__query.md | 16 ++++++++-------- ...y__skills__windows__references__transcribe.md | 2 +- ...phify__skills__windows__references__update.md | 12 ++++++------ .../fragments/references/query/default.md | 16 ++++++++-------- .../fragments/references/shared/add-watch.md | 4 ++-- .../fragments/references/shared/exports.md | 2 +- .../fragments/references/shared/transcribe.md | 2 +- .../fragments/references/shared/update.md | 12 ++++++------ 145 files changed, 522 insertions(+), 522 deletions(-) diff --git a/graphify/skills/agents/references/add-watch.md b/graphify/skills/agents/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/agents/references/add-watch.md +++ b/graphify/skills/agents/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/agents/references/exports.md b/graphify/skills/agents/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/agents/references/exports.md +++ b/graphify/skills/agents/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/agents/references/query.md b/graphify/skills/agents/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/agents/references/query.md +++ b/graphify/skills/agents/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/agents/references/transcribe.md b/graphify/skills/agents/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/agents/references/transcribe.md +++ b/graphify/skills/agents/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/agents/references/update.md b/graphify/skills/agents/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/agents/references/update.md +++ b/graphify/skills/agents/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/amp/references/add-watch.md b/graphify/skills/amp/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/amp/references/add-watch.md +++ b/graphify/skills/amp/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/amp/references/exports.md b/graphify/skills/amp/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/amp/references/exports.md +++ b/graphify/skills/amp/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/amp/references/query.md b/graphify/skills/amp/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/amp/references/query.md +++ b/graphify/skills/amp/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/amp/references/transcribe.md b/graphify/skills/amp/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/amp/references/transcribe.md +++ b/graphify/skills/amp/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/amp/references/update.md b/graphify/skills/amp/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/amp/references/update.md +++ b/graphify/skills/amp/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/claude/references/add-watch.md b/graphify/skills/claude/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/claude/references/add-watch.md +++ b/graphify/skills/claude/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/claude/references/exports.md b/graphify/skills/claude/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/claude/references/exports.md +++ b/graphify/skills/claude/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/claude/references/query.md b/graphify/skills/claude/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/claude/references/query.md +++ b/graphify/skills/claude/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/claude/references/transcribe.md b/graphify/skills/claude/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/claude/references/transcribe.md +++ b/graphify/skills/claude/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/claude/references/update.md b/graphify/skills/claude/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/claude/references/update.md +++ b/graphify/skills/claude/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/claw/references/add-watch.md b/graphify/skills/claw/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/claw/references/add-watch.md +++ b/graphify/skills/claw/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/claw/references/exports.md b/graphify/skills/claw/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/claw/references/exports.md +++ b/graphify/skills/claw/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/claw/references/query.md b/graphify/skills/claw/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/claw/references/query.md +++ b/graphify/skills/claw/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/claw/references/transcribe.md b/graphify/skills/claw/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/claw/references/transcribe.md +++ b/graphify/skills/claw/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/claw/references/update.md b/graphify/skills/claw/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/claw/references/update.md +++ b/graphify/skills/claw/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/codex/references/add-watch.md b/graphify/skills/codex/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/codex/references/add-watch.md +++ b/graphify/skills/codex/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/codex/references/exports.md b/graphify/skills/codex/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/codex/references/exports.md +++ b/graphify/skills/codex/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/codex/references/query.md b/graphify/skills/codex/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/codex/references/query.md +++ b/graphify/skills/codex/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/codex/references/transcribe.md b/graphify/skills/codex/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/codex/references/transcribe.md +++ b/graphify/skills/codex/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/codex/references/update.md b/graphify/skills/codex/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/codex/references/update.md +++ b/graphify/skills/codex/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/copilot/references/add-watch.md b/graphify/skills/copilot/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/copilot/references/add-watch.md +++ b/graphify/skills/copilot/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/copilot/references/exports.md b/graphify/skills/copilot/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/copilot/references/exports.md +++ b/graphify/skills/copilot/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/copilot/references/query.md b/graphify/skills/copilot/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/copilot/references/query.md +++ b/graphify/skills/copilot/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/copilot/references/transcribe.md b/graphify/skills/copilot/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/copilot/references/transcribe.md +++ b/graphify/skills/copilot/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/copilot/references/update.md b/graphify/skills/copilot/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/copilot/references/update.md +++ b/graphify/skills/copilot/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/droid/references/add-watch.md b/graphify/skills/droid/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/droid/references/add-watch.md +++ b/graphify/skills/droid/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/droid/references/exports.md b/graphify/skills/droid/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/droid/references/exports.md +++ b/graphify/skills/droid/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/droid/references/query.md b/graphify/skills/droid/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/droid/references/query.md +++ b/graphify/skills/droid/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/droid/references/transcribe.md b/graphify/skills/droid/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/droid/references/transcribe.md +++ b/graphify/skills/droid/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/droid/references/update.md b/graphify/skills/droid/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/droid/references/update.md +++ b/graphify/skills/droid/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/kilo/references/add-watch.md b/graphify/skills/kilo/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/kilo/references/add-watch.md +++ b/graphify/skills/kilo/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/kilo/references/exports.md b/graphify/skills/kilo/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/kilo/references/exports.md +++ b/graphify/skills/kilo/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/kilo/references/query.md b/graphify/skills/kilo/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/kilo/references/query.md +++ b/graphify/skills/kilo/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/kilo/references/transcribe.md b/graphify/skills/kilo/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/kilo/references/transcribe.md +++ b/graphify/skills/kilo/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/kilo/references/update.md b/graphify/skills/kilo/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/kilo/references/update.md +++ b/graphify/skills/kilo/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/kiro/references/add-watch.md b/graphify/skills/kiro/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/kiro/references/add-watch.md +++ b/graphify/skills/kiro/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/kiro/references/exports.md b/graphify/skills/kiro/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/kiro/references/exports.md +++ b/graphify/skills/kiro/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/kiro/references/query.md b/graphify/skills/kiro/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/kiro/references/query.md +++ b/graphify/skills/kiro/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/kiro/references/transcribe.md b/graphify/skills/kiro/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/kiro/references/transcribe.md +++ b/graphify/skills/kiro/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/kiro/references/update.md b/graphify/skills/kiro/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/kiro/references/update.md +++ b/graphify/skills/kiro/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/opencode/references/add-watch.md b/graphify/skills/opencode/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/opencode/references/add-watch.md +++ b/graphify/skills/opencode/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/opencode/references/exports.md b/graphify/skills/opencode/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/opencode/references/exports.md +++ b/graphify/skills/opencode/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/opencode/references/query.md b/graphify/skills/opencode/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/opencode/references/query.md +++ b/graphify/skills/opencode/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/opencode/references/transcribe.md b/graphify/skills/opencode/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/opencode/references/transcribe.md +++ b/graphify/skills/opencode/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/opencode/references/update.md b/graphify/skills/opencode/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/opencode/references/update.md +++ b/graphify/skills/opencode/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/pi/references/add-watch.md b/graphify/skills/pi/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/pi/references/add-watch.md +++ b/graphify/skills/pi/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/pi/references/exports.md b/graphify/skills/pi/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/pi/references/exports.md +++ b/graphify/skills/pi/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/pi/references/query.md b/graphify/skills/pi/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/pi/references/query.md +++ b/graphify/skills/pi/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/pi/references/transcribe.md b/graphify/skills/pi/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/pi/references/transcribe.md +++ b/graphify/skills/pi/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/pi/references/update.md b/graphify/skills/pi/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/pi/references/update.md +++ b/graphify/skills/pi/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/trae/references/add-watch.md b/graphify/skills/trae/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/trae/references/add-watch.md +++ b/graphify/skills/trae/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/trae/references/exports.md b/graphify/skills/trae/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/trae/references/exports.md +++ b/graphify/skills/trae/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/trae/references/query.md b/graphify/skills/trae/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/trae/references/query.md +++ b/graphify/skills/trae/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/trae/references/transcribe.md b/graphify/skills/trae/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/trae/references/transcribe.md +++ b/graphify/skills/trae/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/trae/references/update.md b/graphify/skills/trae/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/trae/references/update.md +++ b/graphify/skills/trae/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/vscode/references/add-watch.md b/graphify/skills/vscode/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/vscode/references/add-watch.md +++ b/graphify/skills/vscode/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/vscode/references/exports.md b/graphify/skills/vscode/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/vscode/references/exports.md +++ b/graphify/skills/vscode/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/vscode/references/query.md b/graphify/skills/vscode/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/vscode/references/query.md +++ b/graphify/skills/vscode/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/vscode/references/transcribe.md b/graphify/skills/vscode/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/vscode/references/transcribe.md +++ b/graphify/skills/vscode/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/vscode/references/update.md b/graphify/skills/vscode/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/vscode/references/update.md +++ b/graphify/skills/vscode/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/windows/references/add-watch.md b/graphify/skills/windows/references/add-watch.md index 77844343e1..937edf327c 100644 --- a/graphify/skills/windows/references/add-watch.md +++ b/graphify/skills/windows/references/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/windows/references/exports.md b/graphify/skills/windows/references/exports.md index 242ff868e0..27b031e58c 100644 --- a/graphify/skills/windows/references/exports.md +++ b/graphify/skills/windows/references/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/windows/references/query.md b/graphify/skills/windows/references/query.md index 56565eb782..fdc9c68d5f 100644 --- a/graphify/skills/windows/references/query.md +++ b/graphify/skills/windows/references/query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/windows/references/transcribe.md b/graphify/skills/windows/references/transcribe.md index b967f83799..27064bfcdb 100644 --- a/graphify/skills/windows/references/transcribe.md +++ b/graphify/skills/windows/references/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/windows/references/update.md b/graphify/skills/windows/references/update.md index 3632fd4126..493323c3fe 100644 --- a/graphify/skills/windows/references/update.md +++ b/graphify/skills/windows/references/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md b/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__agents__references__exports.md b/tools/skillgen/expected/graphify__skills__agents__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__agents__references__query.md b/tools/skillgen/expected/graphify__skills__agents__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__query.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md b/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__agents__references__update.md b/tools/skillgen/expected/graphify__skills__agents__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__update.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md b/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__amp__references__exports.md b/tools/skillgen/expected/graphify__skills__amp__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__amp__references__query.md b/tools/skillgen/expected/graphify__skills__amp__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__query.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md b/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__amp__references__update.md b/tools/skillgen/expected/graphify__skills__amp__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__update.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md b/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__claude__references__exports.md b/tools/skillgen/expected/graphify__skills__claude__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__claude__references__query.md b/tools/skillgen/expected/graphify__skills__claude__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md b/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__claude__references__update.md b/tools/skillgen/expected/graphify__skills__claude__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__update.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md b/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__claw__references__exports.md b/tools/skillgen/expected/graphify__skills__claw__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__claw__references__query.md b/tools/skillgen/expected/graphify__skills__claw__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md b/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__claw__references__update.md b/tools/skillgen/expected/graphify__skills__claw__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__update.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md b/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__codex__references__exports.md b/tools/skillgen/expected/graphify__skills__codex__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__codex__references__query.md b/tools/skillgen/expected/graphify__skills__codex__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__query.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md b/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__codex__references__update.md b/tools/skillgen/expected/graphify__skills__codex__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__update.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md b/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__exports.md b/tools/skillgen/expected/graphify__skills__copilot__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__query.md b/tools/skillgen/expected/graphify__skills__copilot__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__query.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md b/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__update.md b/tools/skillgen/expected/graphify__skills__copilot__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__update.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md b/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__droid__references__exports.md b/tools/skillgen/expected/graphify__skills__droid__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__droid__references__query.md b/tools/skillgen/expected/graphify__skills__droid__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__query.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md b/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__droid__references__update.md b/tools/skillgen/expected/graphify__skills__droid__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__update.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md b/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__exports.md b/tools/skillgen/expected/graphify__skills__kilo__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__query.md b/tools/skillgen/expected/graphify__skills__kilo__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md b/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__update.md b/tools/skillgen/expected/graphify__skills__kilo__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__update.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md b/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__exports.md b/tools/skillgen/expected/graphify__skills__kiro__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__query.md b/tools/skillgen/expected/graphify__skills__kiro__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md b/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__update.md b/tools/skillgen/expected/graphify__skills__kiro__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__update.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md b/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__exports.md b/tools/skillgen/expected/graphify__skills__opencode__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__query.md b/tools/skillgen/expected/graphify__skills__opencode__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md b/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__update.md b/tools/skillgen/expected/graphify__skills__opencode__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__update.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md b/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__pi__references__exports.md b/tools/skillgen/expected/graphify__skills__pi__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__pi__references__query.md b/tools/skillgen/expected/graphify__skills__pi__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__query.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md b/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__pi__references__update.md b/tools/skillgen/expected/graphify__skills__pi__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__update.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md b/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__trae__references__exports.md b/tools/skillgen/expected/graphify__skills__trae__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__trae__references__query.md b/tools/skillgen/expected/graphify__skills__trae__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__query.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md b/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__trae__references__update.md b/tools/skillgen/expected/graphify__skills__trae__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__update.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md b/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__exports.md b/tools/skillgen/expected/graphify__skills__vscode__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__query.md b/tools/skillgen/expected/graphify__skills__vscode__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md b/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__update.md b/tools/skillgen/expected/graphify__skills__vscode__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__update.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md b/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__windows__references__exports.md b/tools/skillgen/expected/graphify__skills__windows__references__exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__windows__references__query.md b/tools/skillgen/expected/graphify__skills__windows__references__query.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__query.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__query.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md b/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__windows__references__update.md b/tools/skillgen/expected/graphify__skills__windows__references__update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__update.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/fragments/references/query/default.md b/tools/skillgen/fragments/references/query/default.md index 56565eb782..fdc9c68d5f 100644 --- a/tools/skillgen/fragments/references/query/default.md +++ b/tools/skillgen/fragments/references/query/default.md @@ -11,7 +11,7 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +28,7 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +77,7 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -168,7 +168,7 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -194,7 +194,7 @@ graphify path "NODE_A" "NODE_B" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B ``` --- @@ -262,7 +262,7 @@ graphify explain "NODE_NAME" If the CLI is unavailable, run it inline: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back: ```bash -$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/fragments/references/shared/add-watch.md b/tools/skillgen/fragments/references/shared/add-watch.md index 77844343e1..937edf327c 100644 --- a/tools/skillgen/fragments/references/shared/add-watch.md +++ b/tools/skillgen/fragments/references/shared/add-watch.md @@ -7,7 +7,7 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -41,7 +41,7 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -$(cat graphify-out/.graphify_python) -m graphify.watch INPUT_PATH --debounce 3 +"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/fragments/references/shared/exports.md b/tools/skillgen/fragments/references/shared/exports.md index 242ff868e0..27b031e58c 100644 --- a/tools/skillgen/fragments/references/shared/exports.md +++ b/tools/skillgen/fragments/references/shared/exports.md @@ -59,7 +59,7 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json +"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/fragments/references/shared/transcribe.md b/tools/skillgen/fragments/references/shared/transcribe.md index b967f83799..27064bfcdb 100644 --- a/tools/skillgen/fragments/references/shared/transcribe.md +++ b/tools/skillgen/fragments/references/shared/transcribe.md @@ -26,7 +26,7 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) export GRAPHIFY_WHISPER_PROMPT="" -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/fragments/references/shared/update.md b/tools/skillgen/fragments/references/shared/update.md index 3632fd4126..493323c3fe 100644 --- a/tools/skillgen/fragments/references/shared/update.md +++ b/tools/skillgen/fragments/references/shared/update.md @@ -7,7 +7,7 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +30,7 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +48,7 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path @@ -71,7 +71,7 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - $(cat graphify-out/.graphify_python) -c " + "$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +83,7 @@ fi Then: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +170,7 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -$(cat graphify-out/.graphify_python) -c " +"$(cat graphify-out/.graphify_python)" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json From 8eeebc612784f6b99f1351a0ab68fe2b08777233 Mon Sep 17 00:00:00 2001 From: Santhi Prakash Date: Fri, 21 Aug 2026 05:13:59 +0000 Subject: [PATCH 2/7] fix(skillgen): quote verbatim save-result arguments in query references The Graphify reviewer flagged five advisory findings on PR #2905: the save-result template at the end of every skill's query.md interpolates the user's verbatim question and answer into a shell command inside double quotes. A question like `hello"; rm -rf /` could escape the argument and break out of the command. Switch the user-supplied values to single quotes (literal in bash, no expansion) and document the standard `'\\''` escape pattern for embedded single quotes. Keep the double-quoted `"\$(cat ...)"` around .graphify_python: the file is documented to hold a single executable path, not a multi-word command, so the multi-word-command concern from the kilo finding is a false positive. Touched via the central source fragment `tools/skillgen/fragments/references/query/default.md`; all 14 split platform references and the expected/ fixtures were regenerated with `python3 -m tools.skillgen --bless`. - tools/skillgen --check: 134 artifacts OK - pytest tests/test_skillgen.py: 64 passed --- graphify/skills/agents/references/query.md | 12 ++++++------ graphify/skills/amp/references/query.md | 12 ++++++------ graphify/skills/claude/references/query.md | 12 ++++++------ graphify/skills/claw/references/query.md | 12 ++++++------ graphify/skills/codex/references/query.md | 12 ++++++------ graphify/skills/copilot/references/query.md | 12 ++++++------ graphify/skills/droid/references/query.md | 12 ++++++------ graphify/skills/kilo/references/query.md | 12 ++++++------ graphify/skills/kiro/references/query.md | 12 ++++++------ graphify/skills/opencode/references/query.md | 12 ++++++------ graphify/skills/pi/references/query.md | 12 ++++++------ graphify/skills/trae/references/query.md | 12 ++++++------ graphify/skills/vscode/references/query.md | 12 ++++++------ graphify/skills/windows/references/query.md | 12 ++++++------ .../graphify__skills__agents__references__query.md | 12 ++++++------ .../graphify__skills__amp__references__query.md | 12 ++++++------ .../graphify__skills__claude__references__query.md | 12 ++++++------ .../graphify__skills__claw__references__query.md | 12 ++++++------ .../graphify__skills__codex__references__query.md | 12 ++++++------ .../graphify__skills__copilot__references__query.md | 12 ++++++------ .../graphify__skills__droid__references__query.md | 12 ++++++------ .../graphify__skills__kilo__references__query.md | 12 ++++++------ .../graphify__skills__kiro__references__query.md | 12 ++++++------ .../graphify__skills__opencode__references__query.md | 12 ++++++------ .../graphify__skills__pi__references__query.md | 12 ++++++------ .../graphify__skills__trae__references__query.md | 12 ++++++------ .../graphify__skills__vscode__references__query.md | 12 ++++++------ .../graphify__skills__windows__references__query.md | 12 ++++++------ tools/skillgen/fragments/references/query/default.md | 12 ++++++------ 29 files changed, 174 insertions(+), 174 deletions(-) diff --git a/graphify/skills/agents/references/query.md b/graphify/skills/agents/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/agents/references/query.md +++ b/graphify/skills/agents/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/amp/references/query.md b/graphify/skills/amp/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/amp/references/query.md +++ b/graphify/skills/amp/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/claude/references/query.md b/graphify/skills/claude/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/claude/references/query.md +++ b/graphify/skills/claude/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/claw/references/query.md b/graphify/skills/claw/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/claw/references/query.md +++ b/graphify/skills/claw/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/codex/references/query.md b/graphify/skills/codex/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/codex/references/query.md +++ b/graphify/skills/codex/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/copilot/references/query.md b/graphify/skills/copilot/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/copilot/references/query.md +++ b/graphify/skills/copilot/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/droid/references/query.md b/graphify/skills/droid/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/droid/references/query.md +++ b/graphify/skills/droid/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/kilo/references/query.md b/graphify/skills/kilo/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/kilo/references/query.md +++ b/graphify/skills/kilo/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/kiro/references/query.md b/graphify/skills/kiro/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/kiro/references/query.md +++ b/graphify/skills/kiro/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/opencode/references/query.md b/graphify/skills/opencode/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/opencode/references/query.md +++ b/graphify/skills/opencode/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/pi/references/query.md b/graphify/skills/pi/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/pi/references/query.md +++ b/graphify/skills/pi/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/trae/references/query.md b/graphify/skills/trae/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/trae/references/query.md +++ b/graphify/skills/trae/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/vscode/references/query.md b/graphify/skills/vscode/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/vscode/references/query.md +++ b/graphify/skills/vscode/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/graphify/skills/windows/references/query.md b/graphify/skills/windows/references/query.md index fdc9c68d5f..ed107048ab 100644 --- a/graphify/skills/windows/references/query.md +++ b/graphify/skills/windows/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__agents__references__query.md b/tools/skillgen/expected/graphify__skills__agents__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__query.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__amp__references__query.md b/tools/skillgen/expected/graphify__skills__amp__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__query.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__claude__references__query.md b/tools/skillgen/expected/graphify__skills__claude__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__claw__references__query.md b/tools/skillgen/expected/graphify__skills__claw__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__codex__references__query.md b/tools/skillgen/expected/graphify__skills__codex__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__query.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__query.md b/tools/skillgen/expected/graphify__skills__copilot__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__query.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__droid__references__query.md b/tools/skillgen/expected/graphify__skills__droid__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__query.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__query.md b/tools/skillgen/expected/graphify__skills__kilo__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__query.md b/tools/skillgen/expected/graphify__skills__kiro__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__query.md b/tools/skillgen/expected/graphify__skills__opencode__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__pi__references__query.md b/tools/skillgen/expected/graphify__skills__pi__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__query.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__trae__references__query.md b/tools/skillgen/expected/graphify__skills__trae__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__query.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__query.md b/tools/skillgen/expected/graphify__skills__vscode__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/expected/graphify__skills__windows__references__query.md b/tools/skillgen/expected/graphify__skills__windows__references__query.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__query.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` diff --git a/tools/skillgen/fragments/references/query/default.md b/tools/skillgen/fragments/references/query/default.md index fdc9c68d5f..ed107048ab 100644 --- a/tools/skillgen/fragments/references/query/default.md +++ b/tools/skillgen/fragments/references/query/default.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -243,10 +243,10 @@ except nx.NodeNotFound as e: Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B ``` --- @@ -304,8 +304,8 @@ for neighbor in G.neighbors(nid): Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. -After writing the explanation, save it back: +After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME ``` From cc5b82055aac12408fa0f7d94521019871a770fd Mon Sep 17 00:00:00 2001 From: Santhi Prakash Date: Sat, 22 Aug 2026 04:35:03 +0000 Subject: [PATCH 3/7] fix(skillgen): quote verbatim node labels and pass URL via shell arg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #2905 addressing three new Graphify advisory findings on the post-fix render (review at 5a34411): - HIGH (kilo/references/add-watch.md:14) — URL placeholder embedded in shell-evaluated Python source. The 'URL' literal sits inside the python -c '...' block, so user-supplied text replaces a Python literal rather than flowing through a string parameter. Switching to sys.argv reads keeps user text out of evaluated Python source. - MEDIUM (amp/references/query.md:174, opencode/references/query.md:168) — --nodes NODE1 NODE2 left node labels unquoted after the question/answer single-quote fix. Node labels from the graph can contain whitespace, single quotes, semicolons, or shell metacharacters; substituting them unquoted preserves the original command-injection surface. Each node label is now single-quoted with the standard '\'' escape documented alongside the question/answer pattern. Same fix applies to all three save-result blocks in the source fragment (query, path_query, explain) since the unquoted --nodes pattern repeats across all three. Source-of-truth fragments edited, then all 14 platform renders + matching expected/ fixtures regenerated via 'python -m tools.skillgen --bless'. --check / --audit-coverage / --schema-singleton / --monolith-roundtrip / --always-on-roundtrip all green; tests/test_skillgen.py 64/64 pass. --- graphify/skills/agents/references/add-watch.md | 10 +++++++--- graphify/skills/agents/references/query.md | 8 ++++---- graphify/skills/amp/references/add-watch.md | 10 +++++++--- graphify/skills/amp/references/query.md | 8 ++++---- graphify/skills/claude/references/add-watch.md | 10 +++++++--- graphify/skills/claude/references/query.md | 8 ++++---- graphify/skills/claw/references/add-watch.md | 10 +++++++--- graphify/skills/claw/references/query.md | 8 ++++---- graphify/skills/codex/references/add-watch.md | 10 +++++++--- graphify/skills/codex/references/query.md | 8 ++++---- graphify/skills/copilot/references/add-watch.md | 10 +++++++--- graphify/skills/copilot/references/query.md | 8 ++++---- graphify/skills/droid/references/add-watch.md | 10 +++++++--- graphify/skills/droid/references/query.md | 8 ++++---- graphify/skills/kilo/references/add-watch.md | 10 +++++++--- graphify/skills/kilo/references/query.md | 8 ++++---- graphify/skills/kiro/references/add-watch.md | 10 +++++++--- graphify/skills/kiro/references/query.md | 8 ++++---- graphify/skills/opencode/references/add-watch.md | 10 +++++++--- graphify/skills/opencode/references/query.md | 8 ++++---- graphify/skills/pi/references/add-watch.md | 10 +++++++--- graphify/skills/pi/references/query.md | 8 ++++---- graphify/skills/trae/references/add-watch.md | 10 +++++++--- graphify/skills/trae/references/query.md | 8 ++++---- graphify/skills/vscode/references/add-watch.md | 10 +++++++--- graphify/skills/vscode/references/query.md | 8 ++++---- graphify/skills/windows/references/add-watch.md | 10 +++++++--- graphify/skills/windows/references/query.md | 8 ++++---- .../graphify__skills__agents__references__add-watch.md | 10 +++++++--- .../graphify__skills__agents__references__query.md | 8 ++++---- .../graphify__skills__amp__references__add-watch.md | 10 +++++++--- .../graphify__skills__amp__references__query.md | 8 ++++---- .../graphify__skills__claude__references__add-watch.md | 10 +++++++--- .../graphify__skills__claude__references__query.md | 8 ++++---- .../graphify__skills__claw__references__add-watch.md | 10 +++++++--- .../graphify__skills__claw__references__query.md | 8 ++++---- .../graphify__skills__codex__references__add-watch.md | 10 +++++++--- .../graphify__skills__codex__references__query.md | 8 ++++---- ...graphify__skills__copilot__references__add-watch.md | 10 +++++++--- .../graphify__skills__copilot__references__query.md | 8 ++++---- .../graphify__skills__droid__references__add-watch.md | 10 +++++++--- .../graphify__skills__droid__references__query.md | 8 ++++---- .../graphify__skills__kilo__references__add-watch.md | 10 +++++++--- .../graphify__skills__kilo__references__query.md | 8 ++++---- .../graphify__skills__kiro__references__add-watch.md | 10 +++++++--- .../graphify__skills__kiro__references__query.md | 8 ++++---- ...raphify__skills__opencode__references__add-watch.md | 10 +++++++--- .../graphify__skills__opencode__references__query.md | 8 ++++---- .../graphify__skills__pi__references__add-watch.md | 10 +++++++--- .../graphify__skills__pi__references__query.md | 8 ++++---- .../graphify__skills__trae__references__add-watch.md | 10 +++++++--- .../graphify__skills__trae__references__query.md | 8 ++++---- .../graphify__skills__vscode__references__add-watch.md | 10 +++++++--- .../graphify__skills__vscode__references__query.md | 8 ++++---- ...graphify__skills__windows__references__add-watch.md | 10 +++++++--- .../graphify__skills__windows__references__query.md | 8 ++++---- tools/skillgen/fragments/references/query/default.md | 8 ++++---- .../skillgen/fragments/references/shared/add-watch.md | 10 +++++++--- 58 files changed, 319 insertions(+), 203 deletions(-) diff --git a/graphify/skills/agents/references/add-watch.md b/graphify/skills/agents/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/agents/references/add-watch.md +++ b/graphify/skills/agents/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/agents/references/query.md b/graphify/skills/agents/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/agents/references/query.md +++ b/graphify/skills/agents/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/amp/references/add-watch.md b/graphify/skills/amp/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/amp/references/add-watch.md +++ b/graphify/skills/amp/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/amp/references/query.md b/graphify/skills/amp/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/amp/references/query.md +++ b/graphify/skills/amp/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/claude/references/add-watch.md b/graphify/skills/claude/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/claude/references/add-watch.md +++ b/graphify/skills/claude/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/claude/references/query.md b/graphify/skills/claude/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/claude/references/query.md +++ b/graphify/skills/claude/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/claw/references/add-watch.md b/graphify/skills/claw/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/claw/references/add-watch.md +++ b/graphify/skills/claw/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/claw/references/query.md b/graphify/skills/claw/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/claw/references/query.md +++ b/graphify/skills/claw/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/codex/references/add-watch.md b/graphify/skills/codex/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/codex/references/add-watch.md +++ b/graphify/skills/codex/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/codex/references/query.md b/graphify/skills/codex/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/codex/references/query.md +++ b/graphify/skills/codex/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/copilot/references/add-watch.md b/graphify/skills/copilot/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/copilot/references/add-watch.md +++ b/graphify/skills/copilot/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/copilot/references/query.md b/graphify/skills/copilot/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/copilot/references/query.md +++ b/graphify/skills/copilot/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/droid/references/add-watch.md b/graphify/skills/droid/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/droid/references/add-watch.md +++ b/graphify/skills/droid/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/droid/references/query.md b/graphify/skills/droid/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/droid/references/query.md +++ b/graphify/skills/droid/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/kilo/references/add-watch.md b/graphify/skills/kilo/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/kilo/references/add-watch.md +++ b/graphify/skills/kilo/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/kilo/references/query.md b/graphify/skills/kilo/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/kilo/references/query.md +++ b/graphify/skills/kilo/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/kiro/references/add-watch.md b/graphify/skills/kiro/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/kiro/references/add-watch.md +++ b/graphify/skills/kiro/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/kiro/references/query.md b/graphify/skills/kiro/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/kiro/references/query.md +++ b/graphify/skills/kiro/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/opencode/references/add-watch.md b/graphify/skills/opencode/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/opencode/references/add-watch.md +++ b/graphify/skills/opencode/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/opencode/references/query.md b/graphify/skills/opencode/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/opencode/references/query.md +++ b/graphify/skills/opencode/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/pi/references/add-watch.md b/graphify/skills/pi/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/pi/references/add-watch.md +++ b/graphify/skills/pi/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/pi/references/query.md b/graphify/skills/pi/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/pi/references/query.md +++ b/graphify/skills/pi/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/trae/references/add-watch.md b/graphify/skills/trae/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/trae/references/add-watch.md +++ b/graphify/skills/trae/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/trae/references/query.md b/graphify/skills/trae/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/trae/references/query.md +++ b/graphify/skills/trae/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/vscode/references/add-watch.md b/graphify/skills/vscode/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/vscode/references/add-watch.md +++ b/graphify/skills/vscode/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/vscode/references/query.md b/graphify/skills/vscode/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/vscode/references/query.md +++ b/graphify/skills/vscode/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/windows/references/add-watch.md b/graphify/skills/windows/references/add-watch.md index 937edf327c..6da691efd0 100644 --- a/graphify/skills/windows/references/add-watch.md +++ b/graphify/skills/windows/references/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/graphify/skills/windows/references/query.md b/graphify/skills/windows/references/query.md index ed107048ab..d88c639f62 100644 --- a/graphify/skills/windows/references/query.md +++ b/graphify/skills/windows/references/query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md b/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__agents__references__query.md b/tools/skillgen/expected/graphify__skills__agents__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__query.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md b/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__amp__references__query.md b/tools/skillgen/expected/graphify__skills__amp__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__query.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md b/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__claude__references__query.md b/tools/skillgen/expected/graphify__skills__claude__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md b/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__claw__references__query.md b/tools/skillgen/expected/graphify__skills__claw__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md b/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__codex__references__query.md b/tools/skillgen/expected/graphify__skills__codex__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__query.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md b/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__query.md b/tools/skillgen/expected/graphify__skills__copilot__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__query.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md b/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__droid__references__query.md b/tools/skillgen/expected/graphify__skills__droid__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__query.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md b/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__query.md b/tools/skillgen/expected/graphify__skills__kilo__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md b/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__query.md b/tools/skillgen/expected/graphify__skills__kiro__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md b/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__query.md b/tools/skillgen/expected/graphify__skills__opencode__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md b/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__pi__references__query.md b/tools/skillgen/expected/graphify__skills__pi__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__query.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md b/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__trae__references__query.md b/tools/skillgen/expected/graphify__skills__trae__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__query.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md b/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__query.md b/tools/skillgen/expected/graphify__skills__vscode__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md b/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) diff --git a/tools/skillgen/expected/graphify__skills__windows__references__query.md b/tools/skillgen/expected/graphify__skills__windows__references__query.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__query.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__query.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/fragments/references/query/default.md b/tools/skillgen/fragments/references/query/default.md index ed107048ab..d88c639f62 100644 --- a/tools/skillgen/fragments/references/query/default.md +++ b/tools/skillgen/fragments/references/query/default.md @@ -168,10 +168,10 @@ Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes NODE1 NODE2 +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around the user-supplied values make the substitution injection-safe: a question like `hello"; rm -rf /` cannot escape the argument. If your content contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): @@ -246,7 +246,7 @@ Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes NODE_A NODE_B +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -307,5 +307,5 @@ Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sent After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes NODE_NAME +"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/fragments/references/shared/add-watch.md b/tools/skillgen/fragments/references/shared/add-watch.md index 937edf327c..6da691efd0 100644 --- a/tools/skillgen/fragments/references/shared/add-watch.md +++ b/tools/skillgen/fragments/references/shared/add-watch.md @@ -12,8 +12,12 @@ import sys from graphify.ingest import ingest from pathlib import Path +url = sys.argv[1] +author = sys.argv[2] if len(sys.argv) > 2 else '' +contributor = sys.argv[3] if len(sys.argv) > 3 else '' + try: - out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR') + out = ingest(url, Path('./raw'), author=author, contributor=contributor) print(f'Saved to {out}') except ValueError as e: print(f'error: {e}', file=sys.stderr) @@ -21,10 +25,10 @@ except ValueError as e: except RuntimeError as e: print(f'error: {e}', file=sys.stderr) sys.exit(1) -" +" 'URL' 'AUTHOR' 'CONTRIBUTOR' ``` -Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. +Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. Each value is passed as a separate shell argument and read in Python via `sys.argv`, so user-supplied text never lands inside the evaluated Python source - even a URL containing single quotes, double quotes, backticks, or shell metacharacters is treated as a string value, not code. Single-quote each argument in the shell command; if a value contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph. Supported URL types (auto-detected): - YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`) From 897a76ce3b7c0756f4566dd125f290f6b0279978 Mon Sep 17 00:00:00 2001 From: Santhi Prakash Date: Sat, 22 Aug 2026 05:03:57 +0000 Subject: [PATCH 4/7] fix(skillgen): cover apostrophes in question/answer and switch Whisper export to single quotes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #2905 addressing four new Graphify advisory findings on the post-fix render (review at 12c3b67): - HIGH (graphify/skills/agents/references/transcribe.md:28) — the `export GRAPHIFY_WHISPER_PROMPT="<...>"` pattern left the one-sentence domain hint inside double quotes, so a hint containing ``, `$(...)`, or `"`, or an LLM-generated hint with shell metacharacters, would be evaluated by bash during export. Switching to single-quoted assignment plus a separate `export` line keeps the prompt literal; the standard `'\\''` escape pattern is documented in-line for hints that themselves contain an apostrophe. - MEDIUM (graphify/skills/claw/references/query.md:171, tools/skillgen/expected/graphify__skills__amp__references__query.md:174, tools/skillgen/expected/graphify__skills__copilot__references__query.md:171) — the prose around the save-result --question/--answer/--nodes block only documented the `'\\''` escape for *node labels*, leaving ORIGINAL_QUESTION and ANSWER without explicit guidance. A question like `What's the difference?` substituted into `'ORIGINAL_QUESTION'` produced a bash syntax error (unmatched single quote). Sabotage run confirms the old pattern fails with `unexpected EOF while looking for matching '\''`; the new pattern with `'\\''` escape parses cleanly. The escape guidance now explicitly names ORIGINAL_QUESTION, ANSWER, and node labels as the three substituted values that need it. Source-of-truth fragments edited (`tools/skillgen/fragments/references/shared/transcribe.md`, `tools/skillgen/fragments/references/query/default.md`), then all 14 platform renders + matching `expected/` fixtures regenerated. Verification: - `python -m tools.skillgen --check` → OK, 134 artifacts match - `python -m tools.skillgen --audit-coverage` → OK - `python -m tools.skillgen --schema-singleton` → OK - `python -m tools.skillgen --monolith-roundtrip` → OK - `python -m tools.skillgen --always-on-roundtrip` → OK - `python -m pytest tests/test_skillgen.py` → 64/64 pass - Sabotage run: old save-result pattern with apostrophe-containing question → bash syntax error; new pattern → parses cleanly. Old double-quoted Whisper export with `$(touch ...)` injection → executes the command (file created); new single-quoted export → keeps the value literal (no file created). --- graphify/skills/agents/references/query.md | 2 +- graphify/skills/agents/references/transcribe.md | 6 +++++- graphify/skills/amp/references/query.md | 2 +- graphify/skills/amp/references/transcribe.md | 6 +++++- graphify/skills/claude/references/query.md | 2 +- graphify/skills/claude/references/transcribe.md | 6 +++++- graphify/skills/claw/references/query.md | 2 +- graphify/skills/claw/references/transcribe.md | 6 +++++- graphify/skills/codex/references/query.md | 2 +- graphify/skills/codex/references/transcribe.md | 6 +++++- graphify/skills/copilot/references/query.md | 2 +- graphify/skills/copilot/references/transcribe.md | 6 +++++- graphify/skills/droid/references/query.md | 2 +- graphify/skills/droid/references/transcribe.md | 6 +++++- graphify/skills/kilo/references/query.md | 2 +- graphify/skills/kilo/references/transcribe.md | 6 +++++- graphify/skills/kiro/references/query.md | 2 +- graphify/skills/kiro/references/transcribe.md | 6 +++++- graphify/skills/opencode/references/query.md | 2 +- graphify/skills/opencode/references/transcribe.md | 6 +++++- graphify/skills/pi/references/query.md | 2 +- graphify/skills/pi/references/transcribe.md | 6 +++++- graphify/skills/trae/references/query.md | 2 +- graphify/skills/trae/references/transcribe.md | 6 +++++- graphify/skills/vscode/references/query.md | 2 +- graphify/skills/vscode/references/transcribe.md | 6 +++++- graphify/skills/windows/references/query.md | 2 +- graphify/skills/windows/references/transcribe.md | 6 +++++- .../expected/graphify__skills__agents__references__query.md | 2 +- .../graphify__skills__agents__references__transcribe.md | 6 +++++- .../expected/graphify__skills__amp__references__query.md | 2 +- .../graphify__skills__amp__references__transcribe.md | 6 +++++- .../expected/graphify__skills__claude__references__query.md | 2 +- .../graphify__skills__claude__references__transcribe.md | 6 +++++- .../expected/graphify__skills__claw__references__query.md | 2 +- .../graphify__skills__claw__references__transcribe.md | 6 +++++- .../expected/graphify__skills__codex__references__query.md | 2 +- .../graphify__skills__codex__references__transcribe.md | 6 +++++- .../graphify__skills__copilot__references__query.md | 2 +- .../graphify__skills__copilot__references__transcribe.md | 6 +++++- .../expected/graphify__skills__droid__references__query.md | 2 +- .../graphify__skills__droid__references__transcribe.md | 6 +++++- .../expected/graphify__skills__kilo__references__query.md | 2 +- .../graphify__skills__kilo__references__transcribe.md | 6 +++++- .../expected/graphify__skills__kiro__references__query.md | 2 +- .../graphify__skills__kiro__references__transcribe.md | 6 +++++- .../graphify__skills__opencode__references__query.md | 2 +- .../graphify__skills__opencode__references__transcribe.md | 6 +++++- .../expected/graphify__skills__pi__references__query.md | 2 +- .../graphify__skills__pi__references__transcribe.md | 6 +++++- .../expected/graphify__skills__trae__references__query.md | 2 +- .../graphify__skills__trae__references__transcribe.md | 6 +++++- .../expected/graphify__skills__vscode__references__query.md | 2 +- .../graphify__skills__vscode__references__transcribe.md | 6 +++++- .../graphify__skills__windows__references__query.md | 2 +- .../graphify__skills__windows__references__transcribe.md | 6 +++++- tools/skillgen/fragments/references/query/default.md | 2 +- tools/skillgen/fragments/references/shared/transcribe.md | 6 +++++- 58 files changed, 174 insertions(+), 58 deletions(-) diff --git a/graphify/skills/agents/references/query.md b/graphify/skills/agents/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/agents/references/query.md +++ b/graphify/skills/agents/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/agents/references/transcribe.md b/graphify/skills/agents/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/agents/references/transcribe.md +++ b/graphify/skills/agents/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/amp/references/query.md b/graphify/skills/amp/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/amp/references/query.md +++ b/graphify/skills/amp/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/amp/references/transcribe.md b/graphify/skills/amp/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/amp/references/transcribe.md +++ b/graphify/skills/amp/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/claude/references/query.md b/graphify/skills/claude/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/claude/references/query.md +++ b/graphify/skills/claude/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/claude/references/transcribe.md b/graphify/skills/claude/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/claude/references/transcribe.md +++ b/graphify/skills/claude/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/claw/references/query.md b/graphify/skills/claw/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/claw/references/query.md +++ b/graphify/skills/claw/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/claw/references/transcribe.md b/graphify/skills/claw/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/claw/references/transcribe.md +++ b/graphify/skills/claw/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/codex/references/query.md b/graphify/skills/codex/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/codex/references/query.md +++ b/graphify/skills/codex/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/codex/references/transcribe.md b/graphify/skills/codex/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/codex/references/transcribe.md +++ b/graphify/skills/codex/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/copilot/references/query.md b/graphify/skills/copilot/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/copilot/references/query.md +++ b/graphify/skills/copilot/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/copilot/references/transcribe.md b/graphify/skills/copilot/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/copilot/references/transcribe.md +++ b/graphify/skills/copilot/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/droid/references/query.md b/graphify/skills/droid/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/droid/references/query.md +++ b/graphify/skills/droid/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/droid/references/transcribe.md b/graphify/skills/droid/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/droid/references/transcribe.md +++ b/graphify/skills/droid/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/kilo/references/query.md b/graphify/skills/kilo/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/kilo/references/query.md +++ b/graphify/skills/kilo/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/kilo/references/transcribe.md b/graphify/skills/kilo/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/kilo/references/transcribe.md +++ b/graphify/skills/kilo/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/kiro/references/query.md b/graphify/skills/kiro/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/kiro/references/query.md +++ b/graphify/skills/kiro/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/kiro/references/transcribe.md b/graphify/skills/kiro/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/kiro/references/transcribe.md +++ b/graphify/skills/kiro/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/opencode/references/query.md b/graphify/skills/opencode/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/opencode/references/query.md +++ b/graphify/skills/opencode/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/opencode/references/transcribe.md b/graphify/skills/opencode/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/opencode/references/transcribe.md +++ b/graphify/skills/opencode/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/pi/references/query.md b/graphify/skills/pi/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/pi/references/query.md +++ b/graphify/skills/pi/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/pi/references/transcribe.md b/graphify/skills/pi/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/pi/references/transcribe.md +++ b/graphify/skills/pi/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/trae/references/query.md b/graphify/skills/trae/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/trae/references/query.md +++ b/graphify/skills/trae/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/trae/references/transcribe.md b/graphify/skills/trae/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/trae/references/transcribe.md +++ b/graphify/skills/trae/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/vscode/references/query.md b/graphify/skills/vscode/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/vscode/references/query.md +++ b/graphify/skills/vscode/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/vscode/references/transcribe.md b/graphify/skills/vscode/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/vscode/references/transcribe.md +++ b/graphify/skills/vscode/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/graphify/skills/windows/references/query.md b/graphify/skills/windows/references/query.md index d88c639f62..a13b53bde4 100644 --- a/graphify/skills/windows/references/query.md +++ b/graphify/skills/windows/references/query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/graphify/skills/windows/references/transcribe.md b/graphify/skills/windows/references/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/graphify/skills/windows/references/transcribe.md +++ b/graphify/skills/windows/references/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__agents__references__query.md b/tools/skillgen/expected/graphify__skills__agents__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__query.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md b/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__amp__references__query.md b/tools/skillgen/expected/graphify__skills__amp__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__query.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md b/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__claude__references__query.md b/tools/skillgen/expected/graphify__skills__claude__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md b/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__claw__references__query.md b/tools/skillgen/expected/graphify__skills__claw__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md b/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__codex__references__query.md b/tools/skillgen/expected/graphify__skills__codex__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__query.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md b/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__query.md b/tools/skillgen/expected/graphify__skills__copilot__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__query.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md b/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__droid__references__query.md b/tools/skillgen/expected/graphify__skills__droid__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__query.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md b/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__query.md b/tools/skillgen/expected/graphify__skills__kilo__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md b/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__query.md b/tools/skillgen/expected/graphify__skills__kiro__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md b/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__query.md b/tools/skillgen/expected/graphify__skills__opencode__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md b/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__pi__references__query.md b/tools/skillgen/expected/graphify__skills__pi__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__query.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md b/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__trae__references__query.md b/tools/skillgen/expected/graphify__skills__trae__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__query.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md b/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__query.md b/tools/skillgen/expected/graphify__skills__vscode__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md b/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/expected/graphify__skills__windows__references__query.md b/tools/skillgen/expected/graphify__skills__windows__references__query.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__query.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__query.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md b/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path diff --git a/tools/skillgen/fragments/references/query/default.md b/tools/skillgen/fragments/references/query/default.md index d88c639f62..a13b53bde4 100644 --- a/tools/skillgen/fragments/references/query/default.md +++ b/tools/skillgen/fragments/references/query/default.md @@ -171,7 +171,7 @@ After writing the answer, save it back into the graph so it improves future quer "$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` -Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If a node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote). This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. +Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. **Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting): diff --git a/tools/skillgen/fragments/references/shared/transcribe.md b/tools/skillgen/fragments/references/shared/transcribe.md index 27064bfcdb..5fb6296821 100644 --- a/tools/skillgen/fragments/references/shared/transcribe.md +++ b/tools/skillgen/fragments/references/shared/transcribe.md @@ -25,7 +25,11 @@ Read the top god node labels from detect output or analysis, then compose a shor ```bash export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported) -export GRAPHIFY_WHISPER_PROMPT="" +# Single quotes keep the prompt literal — no expansion of $, `, or \ inside it. +# If your domain hint itself contains a single quote, replace it with '\'' (close-quote, escaped-quote, open-quote) +# or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. +GRAPHIFY_WHISPER_PROMPT='' +export GRAPHIFY_WHISPER_PROMPT "$(cat graphify-out/.graphify_python)" -c " import json, os, sys from pathlib import Path From 764cd29806a761f82e803f9aecce9f99f11073e5 Mon Sep 17 00:00:00 2001 From: Santhi Prakash Date: Tue, 25 Aug 2026 08:30:26 +0000 Subject: [PATCH 5/7] fix(skillgen): pass query/path/explain values as shell args instead of embedding in python -c Addresses the latest Graphify review findings on PR #2905: - User query placeholders no longer live inside double-quoted python -c scripts. - Inline query/path/explain fallbacks pass QUESTION, NODE_A/B, and NODE_NAME as single-quoted shell arguments and read them via sys.argv inside the script. - CLI examples now use single quotes for user-supplied values. - Guidance explains the '\'' escape for literal single quotes in every value. Regenerated all 14 platform references and the tools/skillgen expected fixtures. Co-Authored-By: Paperclip --- graphify/skills/agents/references/query.md | 34 +++++++++---------- graphify/skills/amp/references/query.md | 34 +++++++++---------- graphify/skills/claude/references/query.md | 34 +++++++++---------- graphify/skills/claw/references/query.md | 34 +++++++++---------- graphify/skills/codex/references/query.md | 34 +++++++++---------- graphify/skills/copilot/references/query.md | 34 +++++++++---------- graphify/skills/droid/references/query.md | 34 +++++++++---------- graphify/skills/kilo/references/query.md | 34 +++++++++---------- graphify/skills/kiro/references/query.md | 34 +++++++++---------- graphify/skills/opencode/references/query.md | 34 +++++++++---------- graphify/skills/pi/references/query.md | 34 +++++++++---------- graphify/skills/trae/references/query.md | 34 +++++++++---------- graphify/skills/vscode/references/query.md | 34 +++++++++---------- graphify/skills/windows/references/query.md | 34 +++++++++---------- ...hify__skills__agents__references__query.md | 34 +++++++++---------- ...raphify__skills__amp__references__query.md | 34 +++++++++---------- ...hify__skills__claude__references__query.md | 34 +++++++++---------- ...aphify__skills__claw__references__query.md | 34 +++++++++---------- ...phify__skills__codex__references__query.md | 34 +++++++++---------- ...ify__skills__copilot__references__query.md | 34 +++++++++---------- ...phify__skills__droid__references__query.md | 34 +++++++++---------- ...aphify__skills__kilo__references__query.md | 34 +++++++++---------- ...aphify__skills__kiro__references__query.md | 34 +++++++++---------- ...fy__skills__opencode__references__query.md | 34 +++++++++---------- ...graphify__skills__pi__references__query.md | 34 +++++++++---------- ...aphify__skills__trae__references__query.md | 34 +++++++++---------- ...hify__skills__vscode__references__query.md | 34 +++++++++---------- ...ify__skills__windows__references__query.md | 34 +++++++++---------- .../fragments/references/query/default.md | 34 +++++++++---------- 29 files changed, 493 insertions(+), 493 deletions(-) diff --git a/graphify/skills/agents/references/query.md b/graphify/skills/agents/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/agents/references/query.md +++ b/graphify/skills/agents/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/amp/references/query.md b/graphify/skills/amp/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/amp/references/query.md +++ b/graphify/skills/amp/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/claude/references/query.md b/graphify/skills/claude/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/claude/references/query.md +++ b/graphify/skills/claude/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/claw/references/query.md b/graphify/skills/claw/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/claw/references/query.md +++ b/graphify/skills/claw/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/codex/references/query.md b/graphify/skills/codex/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/codex/references/query.md +++ b/graphify/skills/codex/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/copilot/references/query.md b/graphify/skills/copilot/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/copilot/references/query.md +++ b/graphify/skills/copilot/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/droid/references/query.md b/graphify/skills/droid/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/droid/references/query.md +++ b/graphify/skills/droid/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/kilo/references/query.md b/graphify/skills/kilo/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/kilo/references/query.md +++ b/graphify/skills/kilo/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/kiro/references/query.md b/graphify/skills/kiro/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/kiro/references/query.md +++ b/graphify/skills/kiro/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/opencode/references/query.md b/graphify/skills/opencode/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/opencode/references/query.md +++ b/graphify/skills/opencode/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/pi/references/query.md b/graphify/skills/pi/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/pi/references/query.md +++ b/graphify/skills/pi/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/trae/references/query.md b/graphify/skills/trae/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/trae/references/query.md +++ b/graphify/skills/trae/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/vscode/references/query.md b/graphify/skills/vscode/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/vscode/references/query.md +++ b/graphify/skills/vscode/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/graphify/skills/windows/references/query.md b/graphify/skills/windows/references/query.md index a13b53bde4..42eb448b07 100644 --- a/graphify/skills/windows/references/query.md +++ b/graphify/skills/windows/references/query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__agents__references__query.md b/tools/skillgen/expected/graphify__skills__agents__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__query.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__amp__references__query.md b/tools/skillgen/expected/graphify__skills__amp__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__query.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__claude__references__query.md b/tools/skillgen/expected/graphify__skills__claude__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__claw__references__query.md b/tools/skillgen/expected/graphify__skills__claw__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__codex__references__query.md b/tools/skillgen/expected/graphify__skills__codex__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__query.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__query.md b/tools/skillgen/expected/graphify__skills__copilot__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__query.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__droid__references__query.md b/tools/skillgen/expected/graphify__skills__droid__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__query.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__query.md b/tools/skillgen/expected/graphify__skills__kilo__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__query.md b/tools/skillgen/expected/graphify__skills__kiro__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__query.md b/tools/skillgen/expected/graphify__skills__opencode__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__pi__references__query.md b/tools/skillgen/expected/graphify__skills__pi__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__query.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__trae__references__query.md b/tools/skillgen/expected/graphify__skills__trae__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__query.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__query.md b/tools/skillgen/expected/graphify__skills__vscode__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/expected/graphify__skills__windows__references__query.md b/tools/skillgen/expected/graphify__skills__windows__references__query.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__query.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__query.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): diff --git a/tools/skillgen/fragments/references/query/default.md b/tools/skillgen/fragments/references/query/default.md index a13b53bde4..42eb448b07 100644 --- a/tools/skillgen/fragments/references/query/default.md +++ b/tools/skillgen/fragments/references/query/default.md @@ -64,8 +64,8 @@ Build the **expanded query string** by joining the selected tokens with spaces. Prefer the CLI when it is installed: ```bash -graphify query "QUESTION" -# or: graphify query "QUESTION" --dfs --budget 3000 +graphify query 'QUESTION' +# or: graphify query 'QUESTION' --dfs --budget 3000 ``` If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline: @@ -86,8 +86,8 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -question = 'QUESTION' -mode = 'MODE' # 'bfs' or 'dfs' +question = sys.argv[1] +mode = sys.argv[2] # 'bfs' or 'dfs' terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392) # Find best-matching start nodes @@ -137,7 +137,7 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = BUDGET # default 2000 +token_budget = int(sys.argv[3]) # default 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output @@ -160,10 +160,10 @@ output = '\n'.join(lines) if len(output) > char_budget: output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)' print(output) -" +" 'QUESTION' 'MODE' 'BUDGET' ``` -Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains. +Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the Python source. Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then answer based on the subgraph output above, using only what the graph contains. After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: @@ -188,7 +188,7 @@ At the **start** of graph work, refresh and read the lessons: run `graphify refl Find the shortest path between two named concepts in the graph. Prefer the CLI when installed: ```bash -graphify path "NODE_A" "NODE_B" +graphify path 'NODE_A' 'NODE_B' ``` If the CLI is unavailable, run it inline: @@ -203,9 +203,6 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -a_term = 'NODE_A' -b_term = 'NODE_B' - def find_node(term): term = term.lower() scored = sorted( @@ -215,6 +212,9 @@ def find_node(term): ) return scored[0][1] if scored and scored[0][0] > 0 else None +a_term = sys.argv[1] +b_term = sys.argv[2] + src = find_node(a_term) tgt = find_node(b_term) @@ -238,10 +238,10 @@ except nx.NetworkXNoPath: print(f'No path found between {a_term!r} and {b_term!r}') except nx.NodeNotFound as e: print(f'Node not found: {e}') -" +" 'NODE_A' 'NODE_B' ``` -Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant. +Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python source. Replace them with the actual concept names from the user. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then explain the path in plain language - what each hop means, why it's significant. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): @@ -256,7 +256,7 @@ After writing the explanation, save it back (single quotes around the user-suppl Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed: ```bash -graphify explain "NODE_NAME" +graphify explain 'NODE_NAME' ``` If the CLI is unavailable, run it inline: @@ -271,7 +271,7 @@ from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) G = json_graph.node_link_graph(data, edges='links') -term = 'NODE_NAME' +term = sys.argv[1] term_lower = term.lower() # Find best matching node @@ -299,10 +299,10 @@ for neighbor in G.neighbors(nid): conf = edge.get('confidence', '') src_file = G.nodes[neighbor].get('source_file', '') print(f' --{rel}--> {nlabel} [{conf}] ({src_file})') -" +" 'NODE_NAME' ``` -Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. +Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Replace it with the concept the user asked about. The single quotes keep the substitution injection-safe: any value containing a literal single quote must have it replaced with `'\''` (close-quote, escaped-quote, open-quote). Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations. After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): From e531703199f3722e6ffbc6da0b0dbe23d0ed0e2c Mon Sep 17 00:00:00 2001 From: Santhi Prakash Date: Tue, 25 Aug 2026 09:43:49 +0000 Subject: [PATCH 6/7] fix(skillgen): default query token budget when BUDGET placeholder is unreplaced or omitted --- graphify/skills/agents/references/query.md | 5 ++++- graphify/skills/amp/references/query.md | 5 ++++- graphify/skills/claude/references/query.md | 5 ++++- graphify/skills/claw/references/query.md | 5 ++++- graphify/skills/codex/references/query.md | 5 ++++- graphify/skills/copilot/references/query.md | 5 ++++- graphify/skills/droid/references/query.md | 5 ++++- graphify/skills/kilo/references/query.md | 5 ++++- graphify/skills/kiro/references/query.md | 5 ++++- graphify/skills/opencode/references/query.md | 5 ++++- graphify/skills/pi/references/query.md | 5 ++++- graphify/skills/trae/references/query.md | 5 ++++- graphify/skills/vscode/references/query.md | 5 ++++- graphify/skills/windows/references/query.md | 5 ++++- .../expected/graphify__skills__agents__references__query.md | 5 ++++- .../expected/graphify__skills__amp__references__query.md | 5 ++++- .../expected/graphify__skills__claude__references__query.md | 5 ++++- .../expected/graphify__skills__claw__references__query.md | 5 ++++- .../expected/graphify__skills__codex__references__query.md | 5 ++++- .../expected/graphify__skills__copilot__references__query.md | 5 ++++- .../expected/graphify__skills__droid__references__query.md | 5 ++++- .../expected/graphify__skills__kilo__references__query.md | 5 ++++- .../expected/graphify__skills__kiro__references__query.md | 5 ++++- .../graphify__skills__opencode__references__query.md | 5 ++++- .../expected/graphify__skills__pi__references__query.md | 5 ++++- .../expected/graphify__skills__trae__references__query.md | 5 ++++- .../expected/graphify__skills__vscode__references__query.md | 5 ++++- .../expected/graphify__skills__windows__references__query.md | 5 ++++- tools/skillgen/fragments/references/query/default.md | 5 ++++- 29 files changed, 116 insertions(+), 29 deletions(-) diff --git a/graphify/skills/agents/references/query.md b/graphify/skills/agents/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/agents/references/query.md +++ b/graphify/skills/agents/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/amp/references/query.md b/graphify/skills/amp/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/amp/references/query.md +++ b/graphify/skills/amp/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/claude/references/query.md b/graphify/skills/claude/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/claude/references/query.md +++ b/graphify/skills/claude/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/claw/references/query.md b/graphify/skills/claw/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/claw/references/query.md +++ b/graphify/skills/claw/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/codex/references/query.md b/graphify/skills/codex/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/codex/references/query.md +++ b/graphify/skills/codex/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/copilot/references/query.md b/graphify/skills/copilot/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/copilot/references/query.md +++ b/graphify/skills/copilot/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/droid/references/query.md b/graphify/skills/droid/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/droid/references/query.md +++ b/graphify/skills/droid/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/kilo/references/query.md b/graphify/skills/kilo/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/kilo/references/query.md +++ b/graphify/skills/kilo/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/kiro/references/query.md b/graphify/skills/kiro/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/kiro/references/query.md +++ b/graphify/skills/kiro/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/opencode/references/query.md b/graphify/skills/opencode/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/opencode/references/query.md +++ b/graphify/skills/opencode/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/pi/references/query.md b/graphify/skills/pi/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/pi/references/query.md +++ b/graphify/skills/pi/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/trae/references/query.md b/graphify/skills/trae/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/trae/references/query.md +++ b/graphify/skills/trae/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/vscode/references/query.md b/graphify/skills/vscode/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/vscode/references/query.md +++ b/graphify/skills/vscode/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/graphify/skills/windows/references/query.md b/graphify/skills/windows/references/query.md index 42eb448b07..0ff2e0252a 100644 --- a/graphify/skills/windows/references/query.md +++ b/graphify/skills/windows/references/query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__agents__references__query.md b/tools/skillgen/expected/graphify__skills__agents__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__query.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__amp__references__query.md b/tools/skillgen/expected/graphify__skills__amp__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__query.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__claude__references__query.md b/tools/skillgen/expected/graphify__skills__claude__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__claw__references__query.md b/tools/skillgen/expected/graphify__skills__claw__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__codex__references__query.md b/tools/skillgen/expected/graphify__skills__codex__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__query.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__query.md b/tools/skillgen/expected/graphify__skills__copilot__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__query.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__droid__references__query.md b/tools/skillgen/expected/graphify__skills__droid__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__query.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__query.md b/tools/skillgen/expected/graphify__skills__kilo__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__query.md b/tools/skillgen/expected/graphify__skills__kiro__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__query.md b/tools/skillgen/expected/graphify__skills__opencode__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__pi__references__query.md b/tools/skillgen/expected/graphify__skills__pi__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__query.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__trae__references__query.md b/tools/skillgen/expected/graphify__skills__trae__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__query.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__query.md b/tools/skillgen/expected/graphify__skills__vscode__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/expected/graphify__skills__windows__references__query.md b/tools/skillgen/expected/graphify__skills__windows__references__query.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__query.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__query.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output diff --git a/tools/skillgen/fragments/references/query/default.md b/tools/skillgen/fragments/references/query/default.md index 42eb448b07..0ff2e0252a 100644 --- a/tools/skillgen/fragments/references/query/default.md +++ b/tools/skillgen/fragments/references/query/default.md @@ -137,7 +137,10 @@ else: frontier = next_frontier # Token-budget aware output: rank by relevance, cut at budget (~4 chars/token) -token_budget = int(sys.argv[3]) # default 2000 +try: + token_budget = int(sys.argv[3]) +except (IndexError, ValueError): + token_budget = 2000 char_budget = token_budget * 4 # Score each node by term overlap for ranked output From 6e569d9cc3fbe19ec5c1c612955464d80ad7b481 Mon Sep 17 00:00:00 2001 From: Santhi Prakash Date: Tue, 25 Aug 2026 11:44:48 +0000 Subject: [PATCH 7/7] fix(skillgen): read .graphify_python into an array so interpreter paths keep space support The previous fix quoted $(cat graphify-out/.graphify_python) so paths with spaces worked, but the Graphify reviewer noted that quoting the whole substitution narrows it to a single executable and prevents passing flags. Switch every reference fragment to read the file into a bash array with readarray -t GFY_PYTHON and then invoke "${GFY_PYTHON[@]} ...". A single line (the default written by Step 1) still resolves as one element, so paths with spaces continue to work. Optional interpreter flags can be placed on subsequent lines, restoring the command-line flexibility without re-opening the word-splitting bug. Regenerated all platform reference artifacts and expected/ snapshots. Verification: - python3 -m tools.skillgen --check - python3 -m tools.skillgen --audit-coverage --schema-singleton --monolith-roundtrip --always-on-roundtrip - python3 -m pytest tests/test_skillgen.py -q Co-Authored-By: Paperclip --- .../skills/agents/references/add-watch.md | 6 +++-- graphify/skills/agents/references/exports.md | 3 ++- graphify/skills/agents/references/query.md | 24 ++++++++++++------- .../skills/agents/references/transcribe.md | 3 ++- graphify/skills/agents/references/update.md | 18 +++++++++----- graphify/skills/amp/references/add-watch.md | 6 +++-- graphify/skills/amp/references/exports.md | 3 ++- graphify/skills/amp/references/query.md | 24 ++++++++++++------- graphify/skills/amp/references/transcribe.md | 3 ++- graphify/skills/amp/references/update.md | 18 +++++++++----- .../skills/claude/references/add-watch.md | 6 +++-- graphify/skills/claude/references/exports.md | 3 ++- graphify/skills/claude/references/query.md | 24 ++++++++++++------- .../skills/claude/references/transcribe.md | 3 ++- graphify/skills/claude/references/update.md | 18 +++++++++----- graphify/skills/claw/references/add-watch.md | 6 +++-- graphify/skills/claw/references/exports.md | 3 ++- graphify/skills/claw/references/query.md | 24 ++++++++++++------- graphify/skills/claw/references/transcribe.md | 3 ++- graphify/skills/claw/references/update.md | 18 +++++++++----- graphify/skills/codex/references/add-watch.md | 6 +++-- graphify/skills/codex/references/exports.md | 3 ++- graphify/skills/codex/references/query.md | 24 ++++++++++++------- .../skills/codex/references/transcribe.md | 3 ++- graphify/skills/codex/references/update.md | 18 +++++++++----- .../skills/copilot/references/add-watch.md | 6 +++-- graphify/skills/copilot/references/exports.md | 3 ++- graphify/skills/copilot/references/query.md | 24 ++++++++++++------- .../skills/copilot/references/transcribe.md | 3 ++- graphify/skills/copilot/references/update.md | 18 +++++++++----- graphify/skills/droid/references/add-watch.md | 6 +++-- graphify/skills/droid/references/exports.md | 3 ++- graphify/skills/droid/references/query.md | 24 ++++++++++++------- .../skills/droid/references/transcribe.md | 3 ++- graphify/skills/droid/references/update.md | 18 +++++++++----- graphify/skills/kilo/references/add-watch.md | 6 +++-- graphify/skills/kilo/references/exports.md | 3 ++- graphify/skills/kilo/references/query.md | 24 ++++++++++++------- graphify/skills/kilo/references/transcribe.md | 3 ++- graphify/skills/kilo/references/update.md | 18 +++++++++----- graphify/skills/kiro/references/add-watch.md | 6 +++-- graphify/skills/kiro/references/exports.md | 3 ++- graphify/skills/kiro/references/query.md | 24 ++++++++++++------- graphify/skills/kiro/references/transcribe.md | 3 ++- graphify/skills/kiro/references/update.md | 18 +++++++++----- .../skills/opencode/references/add-watch.md | 6 +++-- .../skills/opencode/references/exports.md | 3 ++- graphify/skills/opencode/references/query.md | 24 ++++++++++++------- .../skills/opencode/references/transcribe.md | 3 ++- graphify/skills/opencode/references/update.md | 18 +++++++++----- graphify/skills/pi/references/add-watch.md | 6 +++-- graphify/skills/pi/references/exports.md | 3 ++- graphify/skills/pi/references/query.md | 24 ++++++++++++------- graphify/skills/pi/references/transcribe.md | 3 ++- graphify/skills/pi/references/update.md | 18 +++++++++----- graphify/skills/trae/references/add-watch.md | 6 +++-- graphify/skills/trae/references/exports.md | 3 ++- graphify/skills/trae/references/query.md | 24 ++++++++++++------- graphify/skills/trae/references/transcribe.md | 3 ++- graphify/skills/trae/references/update.md | 18 +++++++++----- .../skills/vscode/references/add-watch.md | 6 +++-- graphify/skills/vscode/references/exports.md | 3 ++- graphify/skills/vscode/references/query.md | 24 ++++++++++++------- .../skills/vscode/references/transcribe.md | 3 ++- graphify/skills/vscode/references/update.md | 18 +++++++++----- .../skills/windows/references/add-watch.md | 6 +++-- graphify/skills/windows/references/exports.md | 3 ++- graphify/skills/windows/references/query.md | 24 ++++++++++++------- .../skills/windows/references/transcribe.md | 3 ++- graphify/skills/windows/references/update.md | 18 +++++++++----- ...__skills__agents__references__add-watch.md | 6 +++-- ...fy__skills__agents__references__exports.md | 3 ++- ...hify__skills__agents__references__query.md | 24 ++++++++++++------- ..._skills__agents__references__transcribe.md | 3 ++- ...ify__skills__agents__references__update.md | 18 +++++++++----- ...ify__skills__amp__references__add-watch.md | 6 +++-- ...phify__skills__amp__references__exports.md | 3 ++- ...raphify__skills__amp__references__query.md | 24 ++++++++++++------- ...fy__skills__amp__references__transcribe.md | 3 ++- ...aphify__skills__amp__references__update.md | 18 +++++++++----- ...__skills__claude__references__add-watch.md | 6 +++-- ...fy__skills__claude__references__exports.md | 3 ++- ...hify__skills__claude__references__query.md | 24 ++++++++++++------- ..._skills__claude__references__transcribe.md | 3 ++- ...ify__skills__claude__references__update.md | 18 +++++++++----- ...fy__skills__claw__references__add-watch.md | 6 +++-- ...hify__skills__claw__references__exports.md | 3 ++- ...aphify__skills__claw__references__query.md | 24 ++++++++++++------- ...y__skills__claw__references__transcribe.md | 3 ++- ...phify__skills__claw__references__update.md | 18 +++++++++----- ...y__skills__codex__references__add-watch.md | 6 +++-- ...ify__skills__codex__references__exports.md | 3 ++- ...phify__skills__codex__references__query.md | 24 ++++++++++++------- ...__skills__codex__references__transcribe.md | 3 ++- ...hify__skills__codex__references__update.md | 18 +++++++++----- ..._skills__copilot__references__add-watch.md | 6 +++-- ...y__skills__copilot__references__exports.md | 3 ++- ...ify__skills__copilot__references__query.md | 24 ++++++++++++------- ...skills__copilot__references__transcribe.md | 3 ++- ...fy__skills__copilot__references__update.md | 18 +++++++++----- ...y__skills__droid__references__add-watch.md | 6 +++-- ...ify__skills__droid__references__exports.md | 3 ++- ...phify__skills__droid__references__query.md | 24 ++++++++++++------- ...__skills__droid__references__transcribe.md | 3 ++- ...hify__skills__droid__references__update.md | 18 +++++++++----- ...fy__skills__kilo__references__add-watch.md | 6 +++-- ...hify__skills__kilo__references__exports.md | 3 ++- ...aphify__skills__kilo__references__query.md | 24 ++++++++++++------- ...y__skills__kilo__references__transcribe.md | 3 ++- ...phify__skills__kilo__references__update.md | 18 +++++++++----- ...fy__skills__kiro__references__add-watch.md | 6 +++-- ...hify__skills__kiro__references__exports.md | 3 ++- ...aphify__skills__kiro__references__query.md | 24 ++++++++++++------- ...y__skills__kiro__references__transcribe.md | 3 ++- ...phify__skills__kiro__references__update.md | 18 +++++++++----- ...skills__opencode__references__add-watch.md | 6 +++-- ...__skills__opencode__references__exports.md | 3 ++- ...fy__skills__opencode__references__query.md | 24 ++++++++++++------- ...kills__opencode__references__transcribe.md | 3 ++- ...y__skills__opencode__references__update.md | 18 +++++++++----- ...hify__skills__pi__references__add-watch.md | 6 +++-- ...aphify__skills__pi__references__exports.md | 3 ++- ...graphify__skills__pi__references__query.md | 24 ++++++++++++------- ...ify__skills__pi__references__transcribe.md | 3 ++- ...raphify__skills__pi__references__update.md | 18 +++++++++----- ...fy__skills__trae__references__add-watch.md | 6 +++-- ...hify__skills__trae__references__exports.md | 3 ++- ...aphify__skills__trae__references__query.md | 24 ++++++++++++------- ...y__skills__trae__references__transcribe.md | 3 ++- ...phify__skills__trae__references__update.md | 18 +++++++++----- ...__skills__vscode__references__add-watch.md | 6 +++-- ...fy__skills__vscode__references__exports.md | 3 ++- ...hify__skills__vscode__references__query.md | 24 ++++++++++++------- ..._skills__vscode__references__transcribe.md | 3 ++- ...ify__skills__vscode__references__update.md | 18 +++++++++----- ..._skills__windows__references__add-watch.md | 6 +++-- ...y__skills__windows__references__exports.md | 3 ++- ...ify__skills__windows__references__query.md | 24 ++++++++++++------- ...skills__windows__references__transcribe.md | 3 ++- ...fy__skills__windows__references__update.md | 18 +++++++++----- .../fragments/references/query/default.md | 24 ++++++++++++------- .../fragments/references/shared/add-watch.md | 6 +++-- .../fragments/references/shared/exports.md | 3 ++- .../fragments/references/shared/transcribe.md | 3 ++- .../fragments/references/shared/update.md | 18 +++++++++----- 145 files changed, 1044 insertions(+), 522 deletions(-) diff --git a/graphify/skills/agents/references/add-watch.md b/graphify/skills/agents/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/agents/references/add-watch.md +++ b/graphify/skills/agents/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/agents/references/exports.md b/graphify/skills/agents/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/agents/references/exports.md +++ b/graphify/skills/agents/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/agents/references/query.md b/graphify/skills/agents/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/agents/references/query.md +++ b/graphify/skills/agents/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/agents/references/transcribe.md b/graphify/skills/agents/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/agents/references/transcribe.md +++ b/graphify/skills/agents/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/agents/references/update.md b/graphify/skills/agents/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/agents/references/update.md +++ b/graphify/skills/agents/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/amp/references/add-watch.md b/graphify/skills/amp/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/amp/references/add-watch.md +++ b/graphify/skills/amp/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/amp/references/exports.md b/graphify/skills/amp/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/amp/references/exports.md +++ b/graphify/skills/amp/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/amp/references/query.md b/graphify/skills/amp/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/amp/references/query.md +++ b/graphify/skills/amp/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/amp/references/transcribe.md b/graphify/skills/amp/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/amp/references/transcribe.md +++ b/graphify/skills/amp/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/amp/references/update.md b/graphify/skills/amp/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/amp/references/update.md +++ b/graphify/skills/amp/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/claude/references/add-watch.md b/graphify/skills/claude/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/claude/references/add-watch.md +++ b/graphify/skills/claude/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/claude/references/exports.md b/graphify/skills/claude/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/claude/references/exports.md +++ b/graphify/skills/claude/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/claude/references/query.md b/graphify/skills/claude/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/claude/references/query.md +++ b/graphify/skills/claude/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/claude/references/transcribe.md b/graphify/skills/claude/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/claude/references/transcribe.md +++ b/graphify/skills/claude/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/claude/references/update.md b/graphify/skills/claude/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/claude/references/update.md +++ b/graphify/skills/claude/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/claw/references/add-watch.md b/graphify/skills/claw/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/claw/references/add-watch.md +++ b/graphify/skills/claw/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/claw/references/exports.md b/graphify/skills/claw/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/claw/references/exports.md +++ b/graphify/skills/claw/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/claw/references/query.md b/graphify/skills/claw/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/claw/references/query.md +++ b/graphify/skills/claw/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/claw/references/transcribe.md b/graphify/skills/claw/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/claw/references/transcribe.md +++ b/graphify/skills/claw/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/claw/references/update.md b/graphify/skills/claw/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/claw/references/update.md +++ b/graphify/skills/claw/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/codex/references/add-watch.md b/graphify/skills/codex/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/codex/references/add-watch.md +++ b/graphify/skills/codex/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/codex/references/exports.md b/graphify/skills/codex/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/codex/references/exports.md +++ b/graphify/skills/codex/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/codex/references/query.md b/graphify/skills/codex/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/codex/references/query.md +++ b/graphify/skills/codex/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/codex/references/transcribe.md b/graphify/skills/codex/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/codex/references/transcribe.md +++ b/graphify/skills/codex/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/codex/references/update.md b/graphify/skills/codex/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/codex/references/update.md +++ b/graphify/skills/codex/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/copilot/references/add-watch.md b/graphify/skills/copilot/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/copilot/references/add-watch.md +++ b/graphify/skills/copilot/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/copilot/references/exports.md b/graphify/skills/copilot/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/copilot/references/exports.md +++ b/graphify/skills/copilot/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/copilot/references/query.md b/graphify/skills/copilot/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/copilot/references/query.md +++ b/graphify/skills/copilot/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/copilot/references/transcribe.md b/graphify/skills/copilot/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/copilot/references/transcribe.md +++ b/graphify/skills/copilot/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/copilot/references/update.md b/graphify/skills/copilot/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/copilot/references/update.md +++ b/graphify/skills/copilot/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/droid/references/add-watch.md b/graphify/skills/droid/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/droid/references/add-watch.md +++ b/graphify/skills/droid/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/droid/references/exports.md b/graphify/skills/droid/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/droid/references/exports.md +++ b/graphify/skills/droid/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/droid/references/query.md b/graphify/skills/droid/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/droid/references/query.md +++ b/graphify/skills/droid/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/droid/references/transcribe.md b/graphify/skills/droid/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/droid/references/transcribe.md +++ b/graphify/skills/droid/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/droid/references/update.md b/graphify/skills/droid/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/droid/references/update.md +++ b/graphify/skills/droid/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/kilo/references/add-watch.md b/graphify/skills/kilo/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/kilo/references/add-watch.md +++ b/graphify/skills/kilo/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/kilo/references/exports.md b/graphify/skills/kilo/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/kilo/references/exports.md +++ b/graphify/skills/kilo/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/kilo/references/query.md b/graphify/skills/kilo/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/kilo/references/query.md +++ b/graphify/skills/kilo/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/kilo/references/transcribe.md b/graphify/skills/kilo/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/kilo/references/transcribe.md +++ b/graphify/skills/kilo/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/kilo/references/update.md b/graphify/skills/kilo/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/kilo/references/update.md +++ b/graphify/skills/kilo/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/kiro/references/add-watch.md b/graphify/skills/kiro/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/kiro/references/add-watch.md +++ b/graphify/skills/kiro/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/kiro/references/exports.md b/graphify/skills/kiro/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/kiro/references/exports.md +++ b/graphify/skills/kiro/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/kiro/references/query.md b/graphify/skills/kiro/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/kiro/references/query.md +++ b/graphify/skills/kiro/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/kiro/references/transcribe.md b/graphify/skills/kiro/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/kiro/references/transcribe.md +++ b/graphify/skills/kiro/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/kiro/references/update.md b/graphify/skills/kiro/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/kiro/references/update.md +++ b/graphify/skills/kiro/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/opencode/references/add-watch.md b/graphify/skills/opencode/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/opencode/references/add-watch.md +++ b/graphify/skills/opencode/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/opencode/references/exports.md b/graphify/skills/opencode/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/opencode/references/exports.md +++ b/graphify/skills/opencode/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/opencode/references/query.md b/graphify/skills/opencode/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/opencode/references/query.md +++ b/graphify/skills/opencode/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/opencode/references/transcribe.md b/graphify/skills/opencode/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/opencode/references/transcribe.md +++ b/graphify/skills/opencode/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/opencode/references/update.md b/graphify/skills/opencode/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/opencode/references/update.md +++ b/graphify/skills/opencode/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/pi/references/add-watch.md b/graphify/skills/pi/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/pi/references/add-watch.md +++ b/graphify/skills/pi/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/pi/references/exports.md b/graphify/skills/pi/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/pi/references/exports.md +++ b/graphify/skills/pi/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/pi/references/query.md b/graphify/skills/pi/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/pi/references/query.md +++ b/graphify/skills/pi/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/pi/references/transcribe.md b/graphify/skills/pi/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/pi/references/transcribe.md +++ b/graphify/skills/pi/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/pi/references/update.md b/graphify/skills/pi/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/pi/references/update.md +++ b/graphify/skills/pi/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/trae/references/add-watch.md b/graphify/skills/trae/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/trae/references/add-watch.md +++ b/graphify/skills/trae/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/trae/references/exports.md b/graphify/skills/trae/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/trae/references/exports.md +++ b/graphify/skills/trae/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/trae/references/query.md b/graphify/skills/trae/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/trae/references/query.md +++ b/graphify/skills/trae/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/trae/references/transcribe.md b/graphify/skills/trae/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/trae/references/transcribe.md +++ b/graphify/skills/trae/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/trae/references/update.md b/graphify/skills/trae/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/trae/references/update.md +++ b/graphify/skills/trae/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/vscode/references/add-watch.md b/graphify/skills/vscode/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/vscode/references/add-watch.md +++ b/graphify/skills/vscode/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/vscode/references/exports.md b/graphify/skills/vscode/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/vscode/references/exports.md +++ b/graphify/skills/vscode/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/vscode/references/query.md b/graphify/skills/vscode/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/vscode/references/query.md +++ b/graphify/skills/vscode/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/vscode/references/transcribe.md b/graphify/skills/vscode/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/vscode/references/transcribe.md +++ b/graphify/skills/vscode/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/vscode/references/update.md b/graphify/skills/vscode/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/vscode/references/update.md +++ b/graphify/skills/vscode/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/graphify/skills/windows/references/add-watch.md b/graphify/skills/windows/references/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/graphify/skills/windows/references/add-watch.md +++ b/graphify/skills/windows/references/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/graphify/skills/windows/references/exports.md b/graphify/skills/windows/references/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/graphify/skills/windows/references/exports.md +++ b/graphify/skills/windows/references/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/graphify/skills/windows/references/query.md b/graphify/skills/windows/references/query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/graphify/skills/windows/references/query.md +++ b/graphify/skills/windows/references/query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/graphify/skills/windows/references/transcribe.md b/graphify/skills/windows/references/transcribe.md index 5fb6296821..1a08046668 100644 --- a/graphify/skills/windows/references/transcribe.md +++ b/graphify/skills/windows/references/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/graphify/skills/windows/references/update.md b/graphify/skills/windows/references/update.md index 493323c3fe..e5f20d1500 100644 --- a/graphify/skills/windows/references/update.md +++ b/graphify/skills/windows/references/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md b/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__agents__references__exports.md b/tools/skillgen/expected/graphify__skills__agents__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__agents__references__query.md b/tools/skillgen/expected/graphify__skills__agents__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__query.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md b/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__agents__references__update.md b/tools/skillgen/expected/graphify__skills__agents__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__agents__references__update.md +++ b/tools/skillgen/expected/graphify__skills__agents__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md b/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__amp__references__exports.md b/tools/skillgen/expected/graphify__skills__amp__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__amp__references__query.md b/tools/skillgen/expected/graphify__skills__amp__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__query.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md b/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__amp__references__update.md b/tools/skillgen/expected/graphify__skills__amp__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__amp__references__update.md +++ b/tools/skillgen/expected/graphify__skills__amp__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md b/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__claude__references__exports.md b/tools/skillgen/expected/graphify__skills__claude__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__claude__references__query.md b/tools/skillgen/expected/graphify__skills__claude__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md b/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__claude__references__update.md b/tools/skillgen/expected/graphify__skills__claude__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__claude__references__update.md +++ b/tools/skillgen/expected/graphify__skills__claude__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md b/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__claw__references__exports.md b/tools/skillgen/expected/graphify__skills__claw__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__claw__references__query.md b/tools/skillgen/expected/graphify__skills__claw__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__query.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md b/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__claw__references__update.md b/tools/skillgen/expected/graphify__skills__claw__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__claw__references__update.md +++ b/tools/skillgen/expected/graphify__skills__claw__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md b/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__codex__references__exports.md b/tools/skillgen/expected/graphify__skills__codex__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__codex__references__query.md b/tools/skillgen/expected/graphify__skills__codex__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__query.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md b/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__codex__references__update.md b/tools/skillgen/expected/graphify__skills__codex__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__codex__references__update.md +++ b/tools/skillgen/expected/graphify__skills__codex__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md b/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__exports.md b/tools/skillgen/expected/graphify__skills__copilot__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__query.md b/tools/skillgen/expected/graphify__skills__copilot__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__query.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md b/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__copilot__references__update.md b/tools/skillgen/expected/graphify__skills__copilot__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__copilot__references__update.md +++ b/tools/skillgen/expected/graphify__skills__copilot__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md b/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__droid__references__exports.md b/tools/skillgen/expected/graphify__skills__droid__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__droid__references__query.md b/tools/skillgen/expected/graphify__skills__droid__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__query.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md b/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__droid__references__update.md b/tools/skillgen/expected/graphify__skills__droid__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__droid__references__update.md +++ b/tools/skillgen/expected/graphify__skills__droid__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md b/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__exports.md b/tools/skillgen/expected/graphify__skills__kilo__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__query.md b/tools/skillgen/expected/graphify__skills__kilo__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md b/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__kilo__references__update.md b/tools/skillgen/expected/graphify__skills__kilo__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__kilo__references__update.md +++ b/tools/skillgen/expected/graphify__skills__kilo__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md b/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__exports.md b/tools/skillgen/expected/graphify__skills__kiro__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__query.md b/tools/skillgen/expected/graphify__skills__kiro__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__query.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md b/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__kiro__references__update.md b/tools/skillgen/expected/graphify__skills__kiro__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__kiro__references__update.md +++ b/tools/skillgen/expected/graphify__skills__kiro__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md b/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__exports.md b/tools/skillgen/expected/graphify__skills__opencode__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__query.md b/tools/skillgen/expected/graphify__skills__opencode__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md b/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__opencode__references__update.md b/tools/skillgen/expected/graphify__skills__opencode__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__opencode__references__update.md +++ b/tools/skillgen/expected/graphify__skills__opencode__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md b/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__pi__references__exports.md b/tools/skillgen/expected/graphify__skills__pi__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__pi__references__query.md b/tools/skillgen/expected/graphify__skills__pi__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__query.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md b/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__pi__references__update.md b/tools/skillgen/expected/graphify__skills__pi__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__pi__references__update.md +++ b/tools/skillgen/expected/graphify__skills__pi__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md b/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__trae__references__exports.md b/tools/skillgen/expected/graphify__skills__trae__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__trae__references__query.md b/tools/skillgen/expected/graphify__skills__trae__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__query.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md b/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__trae__references__update.md b/tools/skillgen/expected/graphify__skills__trae__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__trae__references__update.md +++ b/tools/skillgen/expected/graphify__skills__trae__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md b/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__exports.md b/tools/skillgen/expected/graphify__skills__vscode__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__query.md b/tools/skillgen/expected/graphify__skills__vscode__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__query.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md b/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__vscode__references__update.md b/tools/skillgen/expected/graphify__skills__vscode__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__vscode__references__update.md +++ b/tools/skillgen/expected/graphify__skills__vscode__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md b/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/expected/graphify__skills__windows__references__exports.md b/tools/skillgen/expected/graphify__skills__windows__references__exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__exports.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/expected/graphify__skills__windows__references__query.md b/tools/skillgen/expected/graphify__skills__windows__references__query.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__query.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__query.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md b/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/expected/graphify__skills__windows__references__update.md b/tools/skillgen/expected/graphify__skills__windows__references__update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/expected/graphify__skills__windows__references__update.md +++ b/tools/skillgen/expected/graphify__skills__windows__references__update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json diff --git a/tools/skillgen/fragments/references/query/default.md b/tools/skillgen/fragments/references/query/default.md index 0ff2e0252a..b8bc4b5121 100644 --- a/tools/skillgen/fragments/references/query/default.md +++ b/tools/skillgen/fragments/references/query/default.md @@ -11,7 +11,8 @@ Two traversal modes - choose based on the question: First check the graph exists: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " from pathlib import Path if not Path('graphify-out/graph.json').exists(): print('ERROR: No graph found. Run /graphify first to build the graph.') @@ -28,7 +29,8 @@ Fix this **without inventing tokens** by expanding the query against the actual 1. Extract the token vocabulary from node labels: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, re from pathlib import Path data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) @@ -77,7 +79,8 @@ If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal 5. If the graph lacks enough information, say so - do not hallucinate edges. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from networkx.readwrite import json_graph import networkx as nx @@ -171,7 +174,8 @@ Pass `QUESTION`, `MODE`, and `BUDGET` as single-quoted shell arguments after the After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node: ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'ORIGINAL_QUESTION' --answer 'ANSWER' --type query --nodes 'NODE1' 'NODE2' ``` Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. The single quotes around every user-supplied value (including each `--nodes` argument) make the substitution injection-safe: a question like `hello"; rm -rf /` or a node label containing whitespace, single quotes, or shell metacharacters cannot escape the argument. If `ORIGINAL_QUESTION`, `ANSWER`, or any node label contains a literal single quote, replace it with `'\''` (close-quote, escaped-quote, open-quote) - the escape applies to every substituted value, not just node labels. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph. @@ -197,7 +201,8 @@ graphify path 'NODE_A' 'NODE_B' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -249,7 +254,8 @@ Pass `NODE_A` and `NODE_B` as single-quoted shell arguments after the Python sou After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Path from NODE_A to NODE_B' --answer 'ANSWER' --type path_query --nodes 'NODE_A' 'NODE_B' ``` --- @@ -265,7 +271,8 @@ graphify explain 'NODE_NAME' If the CLI is unavailable, run it inline: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, sys import networkx as nx from networkx.readwrite import json_graph @@ -310,5 +317,6 @@ Pass `NODE_NAME` as a single-quoted shell argument after the Python source. Repl After writing the explanation, save it back (single quotes around the user-supplied values keep the substitution injection-safe; replace any literal `'` in the substituted text with `'\''`): ```bash -"$(cat graphify-out/.graphify_python)" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify save-result --question 'Explain NODE_NAME' --answer 'ANSWER' --type explain --nodes 'NODE_NAME' ``` diff --git a/tools/skillgen/fragments/references/shared/add-watch.md b/tools/skillgen/fragments/references/shared/add-watch.md index 6da691efd0..1067a9560c 100644 --- a/tools/skillgen/fragments/references/shared/add-watch.md +++ b/tools/skillgen/fragments/references/shared/add-watch.md @@ -7,7 +7,8 @@ Load this when the user ran `/graphify add ` or passed `--watch`. Neither i Fetch a URL and add it to the corpus, then update the graph. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys from graphify.ingest import ingest from pathlib import Path @@ -45,7 +46,8 @@ Supported URL types (auto-detected): Start a background watcher that monitors a folder and auto-updates the graph when files change. ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.watch INPUT_PATH --debounce 3 +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.watch INPUT_PATH --debounce 3 ``` Replace INPUT_PATH with the folder to watch. Behavior depends on what changed: diff --git a/tools/skillgen/fragments/references/shared/exports.md b/tools/skillgen/fragments/references/shared/exports.md index 27b031e58c..7a2aa30b89 100644 --- a/tools/skillgen/fragments/references/shared/exports.md +++ b/tools/skillgen/fragments/references/shared/exports.md @@ -59,7 +59,8 @@ graphify export graphml ### Step 7d - MCP server (only if --mcp flag) ```bash -"$(cat graphify-out/.graphify_python)" -m graphify.serve graphify-out/graph.json +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -m graphify.serve graphify-out/graph.json ``` This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live. diff --git a/tools/skillgen/fragments/references/shared/transcribe.md b/tools/skillgen/fragments/references/shared/transcribe.md index 5fb6296821..1a08046668 100644 --- a/tools/skillgen/fragments/references/shared/transcribe.md +++ b/tools/skillgen/fragments/references/shared/transcribe.md @@ -30,7 +30,8 @@ export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passe # or use a here-doc / printf %q pattern; the export must still happen for the child Python process to inherit it. GRAPHIFY_WHISPER_PROMPT='' export GRAPHIFY_WHISPER_PROMPT -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json, os, sys from pathlib import Path from graphify.transcribe import transcribe_all diff --git a/tools/skillgen/fragments/references/shared/update.md b/tools/skillgen/fragments/references/shared/update.md index 493323c3fe..e5f20d1500 100644 --- a/tools/skillgen/fragments/references/shared/update.md +++ b/tools/skillgen/fragments/references/shared/update.md @@ -7,7 +7,8 @@ Load this only when the user passed `--update` or `--cluster-only`. A first-time Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time. ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import sys, json from graphify.detect import detect_incremental, save_manifest from pathlib import Path @@ -30,7 +31,8 @@ if new_total > 0: Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\")) @@ -48,7 +50,8 @@ Path('graphify-out/.graphify_detect.json').write_text(json.dumps({ If new files exist, first check whether all changed files are code files: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path @@ -71,7 +74,8 @@ If no new files exist (only deletions), create an empty extraction so the merge ```bash if [ ! -f graphify-out/.graphify_extract.json ]; then echo '[graphify update] Only deletions -- creating empty extraction for merge.' - "$(cat graphify-out/.graphify_python)" -c " + readarray -t GFY_PYTHON < graphify-out/.graphify_python + "${GFY_PYTHON[@]}" -c " import json from pathlib import Path Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8') @@ -83,7 +87,8 @@ fi Then: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from pathlib import Path from graphify.build import build_merge @@ -170,7 +175,8 @@ Then run Steps 4–8 on the merged graph as normal. After Step 4, show the graph diff: ```bash -"$(cat graphify-out/.graphify_python)" -c " +readarray -t GFY_PYTHON < graphify-out/.graphify_python +"${GFY_PYTHON[@]}" -c " import json from graphify.analyze import graph_diff from graphify.build import build_from_json