-
Notifications
You must be signed in to change notification settings - Fork 2
feat(graphify): add graphify knowledge-graph plugin #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "name": "graphify", | ||
| "version": "1.0.0", | ||
| "description": "Turn any folder of code, docs, papers, images, or videos into a queryable knowledge graph with community detection, query/path/explain tools, and an honest audit trail", | ||
| "author": { | ||
| "name": "Safi Shamsi", | ||
| "url": "https://github.com/safishamsi" | ||
| }, | ||
| "homepage": "https://github.com/safishamsi/graphify", | ||
| "repository": "https://github.com/safishamsi/graphify", | ||
| "license": "MIT", | ||
| "keywords": [ | ||
| "graphify", | ||
| "knowledge-graph", | ||
| "graphrag", | ||
| "codebase", | ||
| "code-understanding", | ||
| "ast", | ||
| "community-detection", | ||
| "obsidian", | ||
| "neo4j" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "name": "graphify", | ||
| "version": "1.0.0", | ||
| "description": "Turn any folder of code, docs, papers, images, or videos into a queryable knowledge graph with community detection, query/path/explain tools, and an honest audit trail", | ||
| "author": { | ||
| "name": "Safi Shamsi", | ||
| "url": "https://github.com/safishamsi" | ||
| }, | ||
| "interface": { | ||
| "displayName": "Graphify", | ||
| "shortDescription": "Turn any folder of code, docs, papers, images, or videos into a queryable knowledge graph with community detection, query/path/explain tools, and an honest a...", | ||
| "longDescription": "Turn any folder of code, docs, papers, images, or videos into a queryable knowledge graph with community detection, query/path/explain tools, and an honest audit trail", | ||
| "developerName": "Safi Shamsi", | ||
| "category": "Tooling", | ||
| "capabilities": [ | ||
| "Skill" | ||
| ], | ||
| "defaultPrompt": [ | ||
| "Help me use Graphify for my current task." | ||
| ], | ||
| "websiteURL": "https://github.com/safishamsi/graphify" | ||
| }, | ||
| "homepage": "https://github.com/safishamsi/graphify", | ||
| "repository": "https://github.com/safishamsi/graphify", | ||
| "license": "MIT", | ||
| "keywords": [ | ||
| "graphify", | ||
| "knowledge-graph", | ||
| "graphrag", | ||
| "codebase", | ||
| "code-understanding", | ||
| "ast", | ||
| "community-detection", | ||
| "obsidian", | ||
| "neo4j" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Graphify | ||
|
|
||
| Turn any folder of code, docs, papers, images, or videos into a navigable **knowledge graph** with community detection, an honest audit trail (EXTRACTED / INFERRED / AMBIGUOUS), and three outputs: interactive HTML, GraphRAG-ready JSON, and a plain-language `GRAPH_REPORT.md`. | ||
|
|
||
| This plugin bundles the official Graphify Claude skill, so Claude automatically treats questions about a codebase — its architecture, file relationships, or project content — as graph queries, and can build the graph on demand. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```sh | ||
| claude | ||
| /plugin marketplace add pleaseai/claude-code-plugins | ||
| /plugin install graphify@pleaseai | ||
| ``` | ||
|
|
||
| The skill installs the underlying `graphifyy` CLI on first use (via `uv tool install` or `pip`), so no manual setup is required. To install it yourself ahead of time: | ||
|
|
||
| ```sh | ||
| uv tool install graphifyy # recommended | ||
| # or: pipx install graphifyy | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| Once installed, ask Claude natural-language questions about a project, or invoke the pipeline directly: | ||
|
|
||
| ``` | ||
| /graphify # build a graph for the current directory | ||
| /graphify ./docs --update # re-extract only changed files | ||
| /graphify query "describe the auth flow" | ||
| /graphify path "UserService" "DatabasePool" | ||
| /graphify explain "SwinTransformer" | ||
| ``` | ||
|
|
||
| When `graphify-out/graph.json` already exists, plain questions like "How does X work?" are answered straight from the graph. | ||
|
|
||
| ## Optional environment variables | ||
|
|
||
| | Variable | Purpose | | ||
| |----------|---------| | ||
| | `GEMINI_API_KEY` / `GOOGLE_API_KEY` | Use Gemini for semantic extraction instead of in-session subagents | | ||
| | `GRAPHIFY_GEMINI_MODEL` | Override the default Gemini model | | ||
| | `GRAPHIFY_MAX_WORKERS` | AST parallelism thread count | | ||
|
|
||
| ## Links | ||
|
|
||
| - Source: https://github.com/safishamsi/graphify | ||
| - License: MIT |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "description": "Load graphify usage rules at session start when the project has a knowledge graph (graphify-out/graph.json)", | ||
| "hooks": { | ||
| "SessionStart": [ | ||
| { | ||
| "matcher": "startup", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "./hooks/context.sh", | ||
|
amondnet marked this conversation as resolved.
|
||
| "timeout": 10 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| ## graphify | ||
|
|
||
| This project has a knowledge graph at graphify-out/ with god nodes, community structure, and cross-file relationships. | ||
|
|
||
| Rules: | ||
| - For codebase questions, first run `graphify query "<question>"` when graphify-out/graph.json exists. Use `graphify path "<A>" "<B>"` for relationships and `graphify explain "<concept>"` for focused concepts. These return a scoped subgraph, usually much smaller than GRAPH_REPORT.md or raw grep output. | ||
| - If graphify-out/wiki/index.md exists, use it for broad navigation instead of raw source browsing. | ||
| - Read graphify-out/GRAPH_REPORT.md only for broad architecture review or when query/path/explain do not surface enough context. | ||
| - After modifying code, run `graphify update .` to keep the graph current (AST-only, no API cost). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # Only inject graphify's always-on rules when this project actually has a graph. | ||
| # The context describes how to use graphify-out/, so it is irrelevant (and just | ||
| # noise) in sessions for projects that have never been graphified. | ||
| if [ ! -f "graphify-out/graph.json" ]; then | ||
|
Check failure on line 7 in plugins/graphify/hooks/context.sh
|
||
| exit 0 | ||
| fi | ||
|
|
||
| # Resolve the plugin root from CLAUDE_PLUGIN_ROOT, falling back to this script's | ||
| # own location when the runtime does not set it (e.g. Antigravity). Without the | ||
| # fallback, `set -u` would abort here with "unbound variable". | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| CONTEXT_FILE="${CLAUDE_PLUGIN_ROOT:-$SCRIPT_DIR/..}/hooks/claude-md.md" | ||
| [ -f "$CONTEXT_FILE" ] || exit 0 | ||
|
Check failure on line 16 in plugins/graphify/hooks/context.sh
|
||
| CONTEXT_CONTENT=$(cat "$CONTEXT_FILE") | ||
|
|
||
| if command -v jq >/dev/null 2>&1; then | ||
| jq -n --arg context "$CONTEXT_CONTENT" '{ | ||
| "hookSpecificOutput": { | ||
| "hookEventName": "SessionStart", | ||
| "additionalContext": $context | ||
| } | ||
| }' | ||
| else | ||
| # Fallback: SessionStart hooks also accept raw stdout as additional context. | ||
| printf '%s\n' "$CONTEXT_CONTENT" | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "description": "Load graphify usage rules at session start when the project has a knowledge graph (graphify-out/graph.json)", | ||
| "hooks": { | ||
| "SessionStart": [ | ||
| { | ||
| "matcher": "startup", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "${CLAUDE_PLUGIN_ROOT}/hooks/context.sh", | ||
| "timeout": 10 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "name": "graphify", | ||
| "version": "1.0.0", | ||
| "description": "Turn any folder of code, docs, papers, images, or videos into a queryable knowledge graph with community detection, query/path/explain tools, and an honest audit trail", | ||
| "author": { | ||
| "name": "Safi Shamsi", | ||
| "url": "https://github.com/safishamsi" | ||
| }, | ||
| "homepage": "https://github.com/safishamsi/graphify", | ||
| "repository": "https://github.com/safishamsi/graphify", | ||
| "license": "MIT", | ||
| "keywords": [ | ||
| "graphify", | ||
| "knowledge-graph", | ||
| "graphrag", | ||
| "codebase", | ||
| "code-understanding", | ||
| "ast", | ||
| "community-detection", | ||
| "obsidian", | ||
| "neo4j" | ||
| ] | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.