agentleFS
strikersamstrikersam/autonomous-ai-agency/.agents/skills/graphify/SKILL.md

graphify

Skill9 starsChanged 3 months agoMITView on GitHub

Converts this codebase into a queryable knowledge graph so AI sessions query graph.json (71.5x fewer tokens) instead of reading raw source files. Integrates with Claude Code and Codex via repo hooks that auto-refresh on session start and after turns.

  • Installs packages

51 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use defuddle, json-canvas and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • joeseesunSkill

    defuddle

    Extract clean article content from web pages or local HTML files. Removes clutter (ads, sidebars, nav) and returns readable content with metadata.

    Also in 5 projects that use this

  • KKodiacSkill

    json-canvas

    Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.

    Also in 4 projects that use this

  • jorgeasaurusSkill

    ponytail-review

    Code review focused exclusively on over-engineering. Finds what to delete: reinvented standard library, unneeded dependencies, speculative abstractions, dead flexibility. One line per finding: location, what to cut, what replaces it. Use when the user says "review for over-engineering", "what can we delete", "is this over-engineered", "simplify review", or invokes /ponytail-review. Complements correctness-focused review, this one only hunts complexity.

    Also in 3 projects that use this

  • OpenAISkill

    playwright

    Use when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) via `playwright-cli` or the bundled wrapper script.

    Also in 3 projects that use this

  • gcpdevSkill

    llm-council

    Multi-LLM collaborative brainstorming and planning. Use when user explicitly requests consultation with multiple AI models (ChatGPT, Gemini, other LLMs) before presenting an implementation plan, or asks to "consult the council", "ask other models", or "get perspectives from other AIs". Queries external LLM APIs, synthesizes their perspectives, and presents an adapted implementation plan.

    Also in 3 projects that use this

  • StrayDragonSkill

    ui-ux-pro-max

    UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.

    Also in 6 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 50 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Start session: Check GRAPH_REPORT.md first — it lists god nodes (highest-connected concepts) and surprising relationships for free.

    line 88
  2. Very specific:

    Only then open files: Use Read only when you need the actual implementation line numbers to make an edit.

    line 92
  3. Distinctive:

    Use graphify first (cheaper to bootstrap), escalate to repowise-intelligence for questions graphify can't answer.

    line 130

“Common” is measured: kept by at least 6 in 10 of the 50 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: graphify — Knowledge Graph Token Optimization

Why This Exists

Reading raw source files to understand context is expensive. On a codebase this size, a single "understand the auth flow" task can consume 8–20k tokens just in file reads. Graphify pre-processes every file into a structured knowledge graph (graph.json) using local AST parsing (no API calls for code). Claude queries the graph instead of reading files — the upstream benchmark shows 71.5x fewer tokens per query on large mixed corpora.

Installation (one-time per machine)

# Install the CLI
pip install graphifyy        # PyPI name uses double-y; CLI stays `graphify`
# macOS managed envs: use pipx install graphifyy instead

# Install the /graphify slash command into Claude Code
graphify install

# Build the initial graph for this repo
cd /path/to/local-llm-server
graphify .

On success you'll have:

graphify-out/graph.json        ← local queryable graph (gitignored; path-specific IDs)
graphify-out/graph.html        ← interactive visualization (gitignored, >5k nodes skipped)
graphify-out/GRAPH_REPORT.md  ← god nodes, surprising edges, suggested questions
graphify-out/cache/            ← SHA256 change-detection cache (gitignored)

Session-Start Auto-Refresh

settings.json in this repo configures a SessionStart hook that runs .claude/hooks/graphify-refresh --session when any Claude Code session opens. The wrapper runs graphify update . without unsupported flags, then prints the committed report summary. This keeps the graph current without full rebuilds — only changed files are re-processed.

The hook prints a one-line status so Claude knows the graph state:

  • === GRAPHIFY KNOWLEDGE GRAPH (auto-loaded) === → report summary loaded; query graph.json
  • [graphify] not installed → install with python -m pip install graphifyy and retry

How to Use the Graph (Token Savings Protocol)

Instead of reading raw files:

# EXPENSIVE (reads 300-line file = ~1200 tokens)
/graphify explain "How does ModelRouter select a model?"

# Returns a targeted 200-token answer from the pre-built graph

Key commands:

CommandWhat it does
graphify .Full build with LLM semantic layer (needs API key)
graphify update .Incremental AST-only refresh — no API key needed
graphify query "question"Query conceptual relationships
graphify path "ModelRouter" "proxy"Find connection between two nodes
graphify explain "Concept"Detailed concept analysis from graph
graphify watch .Auto-sync as files change during development

Claude's query protocol (use this instead of Read tool for exploration):

  1. Start session: Check GRAPH_REPORT.md first — it lists god nodes (highest-connected concepts) and surprising relationships for free.
  2. Targeted lookup: graphify query "X" to understand a concept without opening files.
  3. Path tracing: graphify path "A" "B" to trace how two modules connect.
  4. Only then open files: Use Read only when you need the actual implementation line numbers to make an edit.

Token Savings — Concrete Examples for This Repo

Task (naive)Tokens (raw read)Tokens (graph query)Saving
"How does auth work?"~6,000 (proxy.py + admin_auth.py + key_store.py)~20030x
"What calls ModelRouter?"~4,000 (grep + read 3 files)~15027x
"Agent loop dependencies"~8,000 (loop.py + tools.py + state.py)~30027x
"All endpoints in proxy.py"~5,000~18028x

Graph Artifacts — What to Commit

graphify-out/GRAPH_REPORT.md   ✅ commit — portable readable summary (no machine-specific IDs)
graphify-out/graph.json        ❌ gitignore — node IDs embed absolute checkout path; not portable
graphify-out/.graphify_labels.json  ❌ gitignore — machine-specific
graphify-out/graph.html        ❌ gitignore — skipped when >5k nodes anyway
graphify-out/cache/            ❌ gitignore — local SHA cache
graphify-out/.graphify_root    ❌ gitignore — machine-specific absolute path
graphify-out/manifest.json     ❌ gitignore — machine-specific absolute paths

graph.json is regenerated locally by the SessionStart hook (.claude/hooks/graphify-refresh --session) on every session open — so each contributor gets a correct graph for their own checkout path. Already configured in .gitignore for this repo.

Relationship to repowise-intelligence Skill

Both skills target token reduction through pre-computed codebase structure. They are complementary:

  • graphify: external tool, runs CLI, produces graph.json + GRAPH_REPORT.md; best for exploration queries and initial orientation.
  • repowise-intelligence: internal skill, produces .claude/skills/repowise-intelligence/intelligence/; best for deep dependency tracing, git history, and decision archaeology.

Use graphify first (cheaper to bootstrap), escalate to repowise-intelligence for questions graphify can't answer.

Acceptance Checks

  • python -m pip install -r requirements.txt or python -m pip install graphifyy && graphify install completed on this machine
  • .claude/hooks/graphify-refresh --session produced graphify-out/graph.json and refreshed graphify-out/GRAPH_REPORT.md
  • graphify-out/GRAPH_REPORT.md is committed; graphify-out/graph.json remains gitignored because node IDs are checkout-path-specific
  • graph.html and cache/ are in .gitignore
  • .claude/settings.json SessionStart and Stop hooks point at .claude/hooks/graphify-refresh
  • At least one graphify query runs in <500ms returning useful output
  • Claude uses graphify explain before opening files for exploration tasks

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.