Codebase knowledge graph built with Graphify and Anthropic Skills
Discovered from README cross-links · 2 days ago
Turned a repo into a queryable graph so agents answer architecture questions.
What they did
They wanted agents to stop guessing about a mid-sized Python/TypeScript monorepo, so they ran Graphify over the repository to extract a structural graph of modules, imports, and call relationships. Graphify parsed the codebase, resolved cross-file references, and produced a graph they could query instead of grepping. They then wrapped the graph queries in an Anthropic Skill so the agent had a repeatable procedure: ask a question, translate it into a graph traversal, and cite the nodes and edges it used. oh-my-pi handled the interactive session, letting them iterate on prompts and inspect intermediate results while refining the skill. The workflow covered three recurring questions: what depends on a given module before a refactor, where a symbol is actually defined versus re-exported, and which files a change is likely to touch. They kept the graph regenerated on each meaningful commit so answers stayed current, and they wrote the skill instructions to always show the traversal path so a human could sanity-check the reasoning rather than trusting a summary.
How it went
The setup produced usable answers for dependency and impact questions, with traversal paths that made results auditable. It cut the time spent manually tracing imports before refactors and gave a shared vocabulary for architecture discussions. Polish was moderate: the skill worked well on the main packages but needed prompt tuning for generated code and vendored directories, and graph freshness depended on remembering to regenerate.
Worth knowing
Graph quality is only as good as the parser's coverage, so dynamic imports, reflection, and heavily generated code can be missing or misleading. Regeneration must be wired into the workflow or answers drift from the code. The skill assumes the agent can run shell commands and read the graph output, and large repos may need scoping to keep queries fast. No secrets or private code should be sent to any hosted service without review.
Wiring
Install Graphify (pip package graphifyy) and run it against the repository root to produce the graph artifact; scope includes/excludes so vendored and generated directories do not pollute results. Place the Anthropic Skill in the skills directory with a SKILL.md describing the three query patterns and the requirement to print traversal paths. Start an oh-my-pi session in the repo root so the agent has shell access to run graph queries and read source files. Order matters: generate the graph first, then load the skill, then ask questions. Add a small script or pre-commit hook that regenerates the graph so the skill always reads current data, and keep the graph artifact out of version control if it is large.
Try it yourself
Explore this repository and build a structural knowledge graph of its modules, imports, and cross-file references using Graphify. Then create an Anthropic Skill named 'codebase-graph' that answers three question types: (1) what depends on module X, (2) where is symbol Y defined versus re-exported, and (3) which files would a change to Z likely touch. The skill must always print the traversal path it used so I can verify the reasoning. Use oh-my-pi to run the session, test the skill against at least three real modules in this repo, and report where the graph is incomplete (dynamic imports, generated code, vendored directories). Finally, add a short note on how to regenerate the graph after commits.