Repository navigation
Description
Summary
graphify.wiki.to_wiki() is defined, re-exported via __init__.py, and unit-tested in tests/test_wiki.py. It generates the agent-crawlable wiki (index.md + one article per community + god-node articles) that is referenced in the README and CHANGELOG.
Despite this, no user-facing entry point in the package calls to_wiki(). The CLI (__main__.py) has no --wiki flag handling, and the skill orchestration (skills/graphify/skill.md, also bundled as graphify/skill.md) has no Step that calls it.
Evidence
Repo-wide code search for to_wiki:
$ gh api -X GET search/code -f q='to_wiki repo:safishamsi/graphify'
graphify/wiki.py # definition
graphify/__init__.py # re-export
tests/test_wiki.py # unit test
CHANGELOG.md # feature mention
Zero occurrences in __main__.py, skill.md, or any skill-*.md variant.
Observed inconsistency between v0.4.13 and main
- v0.4.13 packaged
skill.mdline 29 documents--wikias a valid skill argument:But there is no Step 6b/etc. in the same file that responds to/graphify <path> --wiki # build agent-crawlable wiki (index.md + one article per community)--wikiby callingto_wiki(). The flag is silently accepted and ignored. - main HEAD (
9c04b05) has removed even the documentation line, but the function definition and unit test remain. So on main, the function is exported and tested but completely undocumented in the skill.
Repro
pip install graphifyy==0.4.13
graphify install --platform claude
grep -i 'to_wiki' ~/.claude/skills/graphify/SKILL.md
# (no output)The function itself works correctly when called directly — verified on a 189-node markdown corpus, generating 12 community articles + 10 god-node articles + index.md (~92 KB total) in well under a second.
Suggested fix
Add a Step 6b to skills/graphify/skill.md (and graphify/skill.md) parallel to the existing Step 6 obsidian block:
```markdown
Step 6b - Generate wiki (only if --wiki flag)
If `--wiki` was given:
` ` `bash
$(cat graphify-out/.graphify_python) -c "
import json
from graphify.build import build_from_json
from graphify.wiki import to_wiki
from pathlib import Path
extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text())
analysis = json.loads(Path('graphify-out/.graphify_analysis.json').read_text())
labels_raw = json.loads(Path('graphify-out/.graphify_labels.json').read_text()) if Path('graphify-out/.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()}
n = to_wiki(G, communities, 'graphify-out/wiki', community_labels=labels or None, cohesion=cohesion, god_nodes_data=analysis['gods'])
print(f'Wiki: {n} articles in graphify-out/wiki/')
"
` ` `
```
…and re-add the v0.4.13 documentation line on line 29 if removing it was unintentional.
Workaround for users who need the wiki today
Call to_wiki() directly via the public API, reconstructing communities from node['community'] attributes in graph.json and parsing community_labels out of GRAPH_REPORT.md's ### Community N - "label" headers. ~30 lines of Python, no LLM calls, no skill dependency.
Happy to send a PR if useful.
Activity
johnp3004 commentedon Apr 14, 2026
Follow-up after inspecting both v0.4.13 (PyPI) and upstream main (
9c04b05,pyproject.tomlsays v0.1.14):The gap exists in both version lines. These appear to be parallel lineages — v0.1.x is a near-total rewrite that slimmed
__main__.pyfrom 1,261 → 180 lines and removedupdate,cluster-only,query,path,explain,add,watch, andsave-resultfrom the CLI entirely.In v0.4.13:
skill.mdline 29 documents/graphify <path> --wikibut no Step callsto_wiki().__main__.pyhas zero--wikiflag handling.In upstream main (v0.1.14):
skill.mdhas removed even the documentation reference (zerowikimentions in 1,204 lines). Butto_wikiis still defined, still exported from__init__.py:21, still unit-tested intests/test_wiki.py. And the CLAUDE.md template thatgraphify claude installwrites still referencesgraphify-out/wiki/index.mdas an artifact users should consult (__main__.py:64on main).The CHANGELOG on main claims
--updateregenerates wiki whengraphify-out/wiki/exists — but--updateno longer exists as a CLI command in v0.1.x.Question: is
to_wikiintended to be called via direct Python import by users, or is the flag→function wiring just missing across both lineages? If the former, a README note would help. If the latter, the original suggested fix still applies.Workaround for v0.4.13 users today (verified on a 189-node markdown corpus — 12 community articles + 10 god-node articles + index.md in <100ms, zero LLM calls):
```python
import json, re
from collections import defaultdict
from networkx.readwrite import json_graph
from graphify.cluster import score_all
from graphify.analyze import god_nodes
from graphify.wiki import to_wiki
raw = json.loads(open('graphify-out/graph.json').read())
G = json_graph.node_link_graph(raw, edges='links')
communities = defaultdict(list)
for nid, d in G.nodes(data=True):
if d.get('community') is not None:
communities[int(d['community'])].append(nid)
communities = dict(communities)
labels = {int(c): l for c, l in re.findall(
r'^### Community (\d+) - "([^"]+)"',
open('graphify-out/GRAPH_REPORT.md').read(),
re.M
)}
n = to_wiki(
G, communities, 'graphify-out/wiki',
community_labels=labels,
cohesion=score_all(G, communities),
god_nodes_data=god_nodes(G),
)
print(f'wrote {n} articles')
```
AveshLutchman commentedon Apr 14, 2026
I ran into this issue as well.
The agent ended up duplicating the obsidian vault because I named the obsidian output
obsidian-wikilol.Fix 9 issues: kiro package data, betweenness perf, wiki step, opencod…
safishamsi commentedon Apr 14, 2026
Implemented in v0.4.14.
Fix 9 issues: kiro package data, betweenness perf, wiki step, opencod…
Fix 9 issues: kiro package data, betweenness perf, wiki step, opencod…