diff --git a/CHANGELOG.md b/CHANGELOG.md index a50669ce..6193cb1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.1.8 (2026-04-05) + +- Fix: follow-up questions now check for wiki first (graphify-out/wiki/index.md) before falling back to graph.json +- Fix: --update now auto-regenerates wiki if graphify-out/wiki/ exists +- Fix: community articles show truncation notice ("... and N more nodes") when > 25 nodes +- UX: pipeline completion message now lists all available flags and commands so users know what graphify can do + ## 0.1.7 (2026-04-05) - Add: `--wiki` flag — generates Wikipedia-style agent-crawlable wiki from the graph (index.md + community articles + god node articles) diff --git a/graphify/wiki.py b/graphify/wiki.py index 20f83a16..898a8ec5 100644 --- a/graphify/wiki.py +++ b/graphify/wiki.py @@ -59,6 +59,9 @@ def _community_article( degree = G.degree(nid) src_str = f" — `{src}`" if src else "" lines.append(f"- **{node_label}** ({degree} connections){src_str}") + remaining = len(nodes) - len(top_nodes) + if remaining > 0: + lines.append(f"- *... and {remaining} more nodes in this community*") lines.append("") lines += ["## Relationships", ""] diff --git a/pyproject.toml b/pyproject.toml index 2a914112..fdf84e40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "graphifyy" -version = "0.1.7" +version = "0.1.8" description = "Claude Code skill - turn any folder of code, docs, papers, images, or tweets into a queryable knowledge graph" readme = "README.md" license = { text = "MIT" } diff --git a/skills/graphify/skill.md b/skills/graphify/skill.md index 3a6d63f5..f576f2d0 100644 --- a/skills/graphify/skill.md +++ b/skills/graphify/skill.md @@ -641,18 +641,25 @@ rm -f graphify-out/.needs_update 2>/dev/null || true Tell the user: ``` -Graph complete. Outputs are in a hidden folder called graphify-out/ inside the directory you ran this on. - -The folder is hidden (dot prefix) so it won't show in Finder or a normal ls. -To see it: - Mac/Linux: ls -la graphify-out/ - VS Code: the Explorer panel shows hidden files by default - Finder: Cmd+Shift+. to toggle hidden files +Graph complete. Outputs are in graphify-out/ inside the directory you ran this on. What's inside: - graphify-out/obsidian/ - open this folder as a vault in Obsidian (File > Open Vault) - graphify-out/GRAPH_REPORT.md - full audit report, also readable here in Claude - graphify-out/graph.json - persistent graph, query it later with /graphify query "..." + graphify-out/obsidian/ - open as a vault in Obsidian (File > Open Vault) + graphify-out/graph.html - interactive graph, open in any browser + graphify-out/GRAPH_REPORT.md - full audit report + graphify-out/graph.json - raw graph data + +What you can do next: + /graphify --wiki build a Wikipedia-style wiki agents can navigate (index.md + articles) + /graphify --update re-extract only new/changed files, merge into existing graph + /graphify --watch auto-update graph whenever files change + /graphify add fetch a URL and add it to the corpus + /graphify query "" BFS search of the graph + /graphify path "ConceptA" "ConceptB" shortest path between two concepts + /graphify explain "" plain-language explanation of any node + /graphify --mcp start MCP server so other agents can query the graph live + /graphify --neo4j export Cypher for Neo4j import + /graphify --graphml export GraphML for Gephi/yEd Full path: PATH_TO_DIR/graphify-out/ ``` @@ -723,6 +730,34 @@ print(f'Merged: {G_existing.number_of_nodes()} nodes, {G_existing.number_of_edge Then run Steps 4–8 on the merged graph as normal. +After Step 8, if `graphify-out/wiki/` already exists, regenerate the wiki automatically: + +```bash +python3 -c " +import json +from graphify.build import build_from_json +from graphify.analyze import god_nodes +from graphify.wiki import to_wiki +from pathlib import Path + +if not Path('graphify-out/wiki').exists(): + raise SystemExit(0) # wiki was never built, skip + +extraction = json.loads(Path('.graphify_extract.json').read_text()) +analysis = json.loads(Path('.graphify_analysis.json').read_text()) +labels_raw = json.loads(Path('.graphify_labels.json').read_text()) if Path('.graphify_labels.json').exists() else {} + +G = build_from_json(extraction) +communities = {int(k): v for k, v in analysis['communities'].items()} +cohesion = {int(k): v for k, v in analysis['cohesion'].items()} +labels = {int(k): v for k, v in labels_raw.items()} +gods = god_nodes(G, top_n=20) + +n = to_wiki(G, communities, 'graphify-out/wiki', community_labels=labels or None, cohesion=cohesion, god_nodes_data=gods) +print(f'Wiki updated: {n} articles in graphify-out/wiki/') +" +``` + After Step 4, show the graph diff: ```bash @@ -1154,7 +1189,11 @@ For the personal inspo use case: leave this running in a terminal. Drop tweets, Do NOT use Glob, Grep, Read, Bash, or the Explore agent to answer questions about the corpus content. The graph already has the information. Re-exploring the directory defeats the entire purpose of graphify and wastes time. -Instead, load and query `graphify-out/graph.json` directly: +**If `graphify-out/wiki/index.md` exists, use the wiki — it is more readable than raw JSON.** + +Start at `index.md`, read the relevant community article(s), then drill into god node articles as needed. This is faster and more accurate than parsing graph.json because the articles are already structured for agent consumption. + +If the wiki does not exist, load and query `graphify-out/graph.json` directly: ```python import json diff --git a/tests/test_wiki.py b/tests/test_wiki.py index 686d0d69..3b29cf5b 100644 --- a/tests/test_wiki.py +++ b/tests/test_wiki.py @@ -123,3 +123,17 @@ def test_article_navigation_footer(tmp_path): to_wiki(G, COMMUNITIES, tmp_path, community_labels=LABELS) article = (tmp_path / "Parsing_Layer.md").read_text() assert "[[index]]" in article + + +def test_community_article_truncation_notice(tmp_path): + """Communities with more than 25 nodes show a truncation notice.""" + G = nx.Graph() + nodes = [f"n{i}" for i in range(30)] + for nid in nodes: + G.add_node(nid, label=f"concept_{nid}", file_type="code", source_file="a.py", community=0) + for i in range(len(nodes) - 1): + G.add_edge(nodes[i], nodes[i + 1], relation="calls", confidence="EXTRACTED", weight=1.0) + communities = {0: nodes} + to_wiki(G, communities, tmp_path, community_labels={0: "Big Community"}) + article = (tmp_path / "Big_Community.md").read_text() + assert "and 5 more nodes" in article