graphify-knowledge-graph
```markdown
What this skill does
```markdown
---
name: graphify-knowledge-graph
description: Build queryable knowledge graphs from code, docs, papers, and images using AI coding assistant skills
triggers:
- "graphify my codebase"
- "build a knowledge graph"
- "turn my files into a graph"
- "understand this codebase with graphify"
- "run graphify on this folder"
- "query the knowledge graph"
- "install graphify skill"
- "extract relationships from my code"
---
# graphify-knowledge-graph
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
graphify turns any folder of code, docs, papers, or images into a queryable knowledge graph. It runs as an AI coding assistant skill — type `/graphify` in Claude Code, Codex, OpenCode, or OpenClaw to extract structure, relationships, and design rationale from your files into an interactive graph you can navigate and query without re-reading raw files.
---
## Install
```bash
pip install graphifyy && graphify install
```
> The PyPI package is `graphifyy`; the CLI and skill command remain `graphify`.
### Platform-specific install
```bash
graphify install # Claude Code (default)
graphify install --platform codex # Codex
graphify install --platform opencode # OpenCode
graphify install --platform claw # OpenClaw
```
### Always-on assistant integration (recommended)
Run once per project so your assistant consults the graph before searching files:
```bash
graphify claude install # writes CLAUDE.md section + PreToolUse hook (Claude Code)
graphify codex install # writes AGENTS.md (Codex)
graphify opencode install # writes AGENTS.md (OpenCode)
graphify claw install # writes AGENTS.md (OpenClaw)
```
Undo with the matching uninstall command:
```bash
graphify claude uninstall
```
### Manual install (curl, no pip)
```bash
mkdir -p ~/.claude/skills/graphify
curl -fsSL https://raw.githubusercontent.com/safishamsi/graphify/v3/graphify/skill.md \
> ~/.claude/skills/graphify/SKILL.md
```
Add to `~/.claude/CLAUDE.md`:
```
- **graphify** (`~/.claude/skills/graphify/SKILL.md`) - any input to knowledge graph. Trigger: `/graphify`
When the user types `/graphify`, invoke the Skill tool with `skill: "graphify"` before doing anything else.
```
---
## Core workflow
### 1. Build the graph
```bash
# In your AI coding assistant
/graphify . # current directory
/graphify ./src # specific folder
/graphify ./raw --mode deep # aggressive INFERRED edge extraction
/graphify ./raw --no-viz # skip HTML, produce report + JSON only
```
### 2. Outputs
```
graphify-out/
├── graph.html # interactive — click nodes, search, filter by community
├── GRAPH_REPORT.md # god nodes, surprising connections, suggested questions
├── graph.json # persistent graph — query later without re-reading files
└── cache/ # SHA256 cache — re-runs only process changed files
```
### 3. Query the graph
```bash
/graphify query "what connects attention to the optimizer?"
/graphify query "what connects attention to the optimizer?" --dfs # trace a path
/graphify query "what connects attention to the optimizer?" --budget 1500 # cap tokens
/graphify path "DigestAuth" "Response" # shortest path between two nodes
/graphify explain "SwinTransformer" # expand a single node
```
---
## Key commands reference
### Building
| Command | What it does |
|---|---|
| `/graphify .` | Build graph from current directory |
| `/graphify ./folder` | Build from a specific folder |
| `/graphify ./folder --mode deep` | More aggressive INFERRED edge extraction |
| `/graphify ./folder --update` | Re-extract only changed files, merge into existing graph |
| `/graphify ./folder --cluster-only` | Rerun clustering without re-extraction |
| `/graphify ./folder --watch` | Auto-sync as files change (code: instant AST; docs: notifies you) |
### Ingesting remote content
```bash
/graphify add https://arxiv.org/abs/1706.03762 # fetch a paper, add to graph
/graphify add https://x.com/karpathy/status/... # fetch a tweet
/graphify add https://... --author "Andrej Karpathy" # tag original author
/graphify add https://... --contributor "Your Name" # tag who added it
```
### Querying
```bash
/graphify query "why does the auth layer depend on redis?"
/graphify query "what implements the retry protocol?" --dfs
/graphify path "Transformer" "AdamW"
/graphify explain "DigestAuth"
```
### Exporting
```bash
/graphify ./folder --svg # export graph.svg
/graphify ./folder --graphml # export graph.graphml (Gephi, yEd)
/graphify ./folder --neo4j # generate cypher.txt for Neo4j import
/graphify ./folder --neo4j-push bolt://localhost:7687 # push to live Neo4j
/graphify ./folder --obsidian # generate Obsidian vault (opt-in)
/graphify ./folder --wiki # build agent-crawlable wiki (index.md + per-community articles)
/graphify ./folder --mcp # start MCP stdio server
```
### Git hooks
```bash
graphify hook install # post-commit + post-checkout: auto-rebuild on commit/branch switch
graphify hook uninstall
graphify hook status
```
---
## Supported file types
| Type | Extensions | Extraction method |
|---|---|---|
| Code | `.py .ts .js .go .rs .java .c .cpp .rb .cs .kt .scala .php .swift .lua` | AST via tree-sitter + call graph + docstring/comment rationale (no LLM) |
| Docs | `.md .txt .rst` | Concepts + relationships + design rationale via Claude |
| Papers | `.pdf` | Citation mining + concept extraction |
| Images | `.png .jpg .webp .gif` | Claude vision — screenshots, diagrams, any language |
---
## How it works
graphify runs in **two passes**:
1. **AST pass (deterministic, no LLM):** Extracts classes, functions, imports, call graphs, docstrings, and rationale comments from code files.
2. **Semantic pass (parallel Claude subagents):** Extracts concepts, relationships, and design rationale from docs, papers, and images.
Results are merged into a **NetworkX graph**, clustered with **Leiden community detection** (topology-based — no embeddings or vector database), and exported as HTML, JSON, and a plain-language audit report.
### Edge provenance tags
Every relationship is tagged so you always know what was found vs guessed:
| Tag | Meaning | Confidence |
|---|---|---|
| `EXTRACTED` | Found directly in source | Always 1.0 |
| `INFERRED` | Reasonable inference | 0.0–1.0 score |
| `AMBIGUOUS` | Flagged for human review | — |
---
## Python API
graphify is primarily a CLI/skill tool, but the graph output (`graph.json`) is standard NetworkX JSON you can load and traverse:
```python
import json
import networkx as nx
# Load the persistent graph
with open("graphify-out/graph.json") as f:
data = json.load(f)
G = nx.node_link_graph(data)
# Find god nodes (highest degree)
god_nodes = sorted(G.degree(), key=lambda x: x[1], reverse=True)[:10]
for node, degree in god_nodes:
print(f"{node}: {degree} connections")
# Find all EXTRACTED edges (high confidence, found in source)
extracted_edges = [
(u, v, d) for u, v, d in G.edges(data=True)
if d.get("provenance") == "EXTRACTED"
]
# Find INFERRED edges above a confidence threshold
high_confidence_inferred = [
(u, v, d) for u, v, d in G.edges(data=True)
if d.get("provenance") == "INFERRED" and d.get("confidence_score", 0) > 0.85
]
# Shortest path between two concepts
try:
path = nx.shortest_path(G, source="DigestAuth", target="Response")
print(" -> ".join(path))
except nx.NetworkXNoPath:
print("No path found")
# Get all nodes in a community
communities = {}
for node, data in G.nodes(data=True):
community_id = data.get("community")
if community_id is not None:
communities.setdefault(community_id, []).append(node)
for cid, members in sorted(communities.items()):
print(f"Community {cid}: {', '.join(members[:5])}{'...' if len(members) > 5 else ''}")
```
### WoRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.